|
| 1 | +# Repo-local ADF agents for terraphim-service (Gitea #2203). |
| 2 | +# |
| 3 | +# Loaded into the orchestrator fleet at startup when orchestrator.toml lists |
| 4 | +# this repo under [[project_sources]] id = "terraphim-service". The project |
| 5 | +# itself (working_dir + gitea owner/repo/token) is declared CENTRALLY in |
| 6 | +# conf.d/terraphim-service.toml -- secrets never live here. |
| 7 | +# |
| 8 | +# Only repo-specific agents belong here. The shared verdict agents |
| 9 | +# (pr-reviewer/pr-validator/pr-verifier) remain central via extra_projects |
| 10 | +# (#2175); do NOT redeclare them or the load will reject a duplicate. |
| 11 | +project_id = "terraphim-service" |
| 12 | +name = "terraphim-service" |
| 13 | + |
| 14 | +# Autonomous implementer for terraphim-service. Cron-driven; the task below is a |
| 15 | +# PROMPT to the cli_tool (pi-rust, an LLM coding agent with Bash/Read/Write/Edit |
| 16 | +# tools) -- not a shell script. It picks the top unblocked issue, implements on |
| 17 | +# a task/ branch off origin/main, opens a PR, and lets the enforced 4-check |
| 18 | +# verdict gate review it. Subscription model only (C1). Staggered off |
| 19 | +# terraphim-ai's :00 to ease native-runner load (#2185). |
| 20 | +[[agents]] |
| 21 | +evolution_enabled = true |
| 22 | +name = "implementation-swarm" |
| 23 | +layer = "Core" |
| 24 | +cli_tool = "/home/alex/.local/bin/pi-rust" |
| 25 | +model = "zai-coding-plan/glm-5.1" |
| 26 | +fallback_provider = "/home/alex/.bun/bin/opencode" |
| 27 | +fallback_model = "kimi-for-coding/k2p6" |
| 28 | +persona = "Echo" |
| 29 | +terraphim_role = "Terraphim AI Developer" |
| 30 | +skill_chain = [ |
| 31 | + "disciplined-research", |
| 32 | + "disciplined-design", |
| 33 | + "disciplined-implementation", |
| 34 | + "disciplined-verification", |
| 35 | + "rust-mastery", |
| 36 | + "testing", |
| 37 | +] |
| 38 | +schedule = "45 * * * *" |
| 39 | +capabilities = ["implementation", "coding", "tdd"] |
| 40 | +max_cpu_seconds = 7200 |
| 41 | +grace_period_secs = 30 |
| 42 | +task = ''' |
| 43 | +You are the autonomous implementer for the $GITEA_OWNER/$GITEA_REPO repository. |
| 44 | +Your working directory ($ADF_WORKING_DIR) is a checkout of that repo. Use your |
| 45 | +Bash tool for all git/gtr/cargo commands. Apply the disciplined-research, |
| 46 | +disciplined-design, disciplined-implementation, and disciplined-verification |
| 47 | +skills. Never use --dangerously-skip-permissions; never mock, bypass tests, or |
| 48 | +skip hooks. |
| 49 | +
|
| 50 | +PATH setup (run first): |
| 51 | + export GITEA_URL=https://git.terraphim.cloud |
| 52 | + export PATH=$HOME/.cargo/bin:$HOME/.local/bin:$HOME/bin:$HOME/.bun/bin:/usr/local/bin:/usr/bin:/bin:$PATH |
| 53 | + cd "$ADF_WORKING_DIR" && git fetch origin --quiet |
| 54 | +
|
| 55 | +Step 1 -- select work: |
| 56 | + Run: gtr ready --owner "$GITEA_OWNER" --repo "$GITEA_REPO" |
| 57 | + Pick the highest-PageRank issue that is NOT blocked. If there are none, stop |
| 58 | + and exit without changes. |
| 59 | + Skip the issue if a remote branch task/<IDX>-* already exists |
| 60 | + (git ls-remote --heads origin "task/<IDX>-*") or an open PR already covers it |
| 61 | + (gtr list-pulls --owner "$GITEA_OWNER" --repo "$GITEA_REPO" --state open); |
| 62 | + in that case pick the next unblocked issue. |
| 63 | +
|
| 64 | +Step 2 -- understand (research): |
| 65 | + Read the issue: gtr view-issue --owner "$GITEA_OWNER" --repo "$GITEA_REPO" --issue <IDX> |
| 66 | + Read the relevant source files. Understand the problem before coding. |
| 67 | +
|
| 68 | +Step 3 -- branch from origin/main (never local main, which may have diverged): |
| 69 | + git checkout -B "task/<IDX>-impl" origin/main |
| 70 | +
|
| 71 | +Step 4 -- implement with tests first (design + implementation + verification): |
| 72 | + Write tests first, then the minimal code to pass them. Keep changes surgical. |
| 73 | +
|
| 74 | +Step 5 -- quality gates (ALL must pass before submitting): |
| 75 | + cargo fmt --all -- --check |
| 76 | + cargo clippy --workspace --all-targets -- -D warnings |
| 77 | + cargo build --workspace |
| 78 | + cargo test --workspace --lib --no-fail-fast |
| 79 | + If any gate fails, fix and re-run. Do not submit failing work. |
| 80 | +
|
| 81 | +Step 6 -- submit: |
| 82 | + git add -A |
| 83 | + git commit -m "feat: implement #<IDX> (Refs #<IDX>)" |
| 84 | + git push -u origin "task/<IDX>-impl" |
| 85 | + gtr create-pull --owner "$GITEA_OWNER" --repo "$GITEA_REPO" --title "Fix #<IDX>" --base main --head "task/<IDX>-impl" |
| 86 | + gtr comment --owner "$GITEA_OWNER" --repo "$GITEA_REPO" --index <IDX> --body "Implementation pushed on task/<IDX>-impl; PR opened. The verdict gate will review." |
| 87 | + Do NOT close the issue -- the merge-coordinator closes it after merge. |
| 88 | +
|
| 89 | +Constraints: subscription models only; British English in any prose; no emoji; |
| 90 | +never use the `timeout` command; one PR per run. |
| 91 | +''' |
| 92 | + |
0 commit comments