Landing L14: the Reviewer, an acp agent that reviews a pull request and posts its verdict #48
No reviewers
Labels
No labels
No milestone
No project
No assignees
2 participants
Due date
No due date set.
Dependencies
No dependencies set
Reference
mikluko/gascitypacks!48
Loading…
Reference in a new issue
No description provided.
Delete branch "worker/gascitypacks-7mb"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Row L14 of gascity-root
docs/handoffs.md(bead gascitypacks-7mb, HQ ticket root-ons.17): the Reviewer, a rig's agent that reviews one head of one pull request and posts its verdict on the forge, and its formulamol-forgejo-review.What it is
forgejo/agents/reviewer: a rig-scoped named session ([[named_session]],mode = "on_demand", inforgejo/pack.toml),session = "acp",permission_mode = "unrestricted", claiming withgc hook --claim --drain-ack --json.max_active_sessions = 1with nomin_active_sessions:gc lintreads that as a singleton a named session may target, and amin_active_sessions = 0made it fail as a pool. The city's own import makes no Reviewer (rig scope), andtests/reviewer.shasserts one Reviewer per rig.forgejo/formulas/mol-forgejo-review.toml: one step, five parts, held from the claim to the close like the Worker's. rexcity'smol-forgejo-pr-reviewless its wait for checks; no new shell, only the formula's text and the Go tool'spr stateandpr review.pr_url,review_head,work_bead).review_head(review_verdict=void, nothing posted); halt when the checks have not completed (it never waits); if the account of its token already has a review of the head on the forge, go to Part 5..bodyalone;REVIEW.mdand conventions read from the target branch; the head merged into current main in the clone (a conflict is REQUEST_CHANGES saying it needs a rebase); what the repository's workflows run, underenv -iso the city's variables are gone; the head's failed check read and reported, never approved.gc forgejo pr review --expect-head:APPROVEDorREQUEST_CHANGESwith the findings as the body.review_verdict(pass/fail/void),review_reviewed(the head),review_urland a note on the review bead, close it withgc.work_outcome=no-op, close the step,gc runtime drain-ack. The verdict is written only after the review is on the forge, and from what the forge holds, so a restart posts nothing twice.gcwrites are the review bead, its own step and the mail of a halt. Norm -rf, norex/rexcity, the token read only inside an Authorization header. Its clone stays under its work directory.[Unreleased].What is Claude Code's own
The formula is plain text:
gc,git,curlandjqcommands, read throughgc bd show. Any ACP adapter and model that can run commands and follow a step can run it. Claude's:permission_mode,modelandeffortinoption_defaultsand the city's patch (optionsclaudeacptakes),session = "acp"with the city'sacpprovider, and the 28000-character size of the step, whichtests/reviewer.shkeeps under Claude Code's 30000-character inline Bash output.Verification
tests/reviewer.sh(new, wired into thelintjob): resolves the agent in a throwaway city with a rig (gc --city, so a session'sGC_*does not matter), compiles the formula, checks the safety rules and the order of the writes in the text, and runs the lines that read and write the bead against a stubgcandcurl(state block, "already reviewed" filter with other accounts', other heads' and dismissed reviews, pass/fail record, void, close order, halt). I broke four rules in the formula one at a time (agit push, a missing--expect-head, a write to the work bead, a changed account filter) and the test failed each time.gc lint .,go vetandgo test ./...inforgejo, every othertests/*.sh,tests/formula.sh(underenv -i: the checkout's copy has no--city, the knowngascitypacks-pmnsymptom), and the v1 changelog check (valid=true) pass. Rebased on43dce15(L12) right before the push; the README andpack.tomlconflicts were line-level and resolved to keep both.The city's patch (the Operator's to file, with the import bump)
An import of this pack that carries the Reviewer fails
scripts/check-pins.shfor every rig unless this patch goes in the same pull request. I checked it in a throwaway city:gc config show --validatepasses and the Reviewer of the rig resolves with the acp provider,MaxActiveSessions1, the pinned model and effort, andFORGEJO_TOKEN_FILEset to the review token. An agent'senvwins overworkspace.env, so no other agent'sFORGEJO_TOKEN_FILEchanges. Inpack.tomlof gascity-root:(The path is the review account's token file from the Operator's brief; adjust if it is not.) The pull request that bumps
[imports.forgejo]to the release with this change also needs the release of this repository first.The trial (question 4 of section 4: which assignee string wakes an acp named session)
Not for me to run on the live city. After the release, the import bump and the patch have landed,
gc config showhas<rig>/forgejo.reviewer:gc forgejo pr state --json --repo <rig checkout> --pr <url> | jq '{state, head, base, checks}'. Note the fullhead, and the work bead it answers.gc bd --rig <rig> create --title "Review <url> at <head, 7 chars>" --type task --labels service,review --metadata '{"pr_url":"<url>","review_head":"<full head>","work_bead":"<work bead id>"}'.gc sling <rig>/forgejo.reviewer <review bead>. Expected within a few minutes: the bead is routed and has a workflow (gc bd showshowsgc.execution_routed_to), a session of templatereviewerstarts (gc session list), and, within roughly ten minutes, the review bead is closed withreview_verdictpassorfail,review_reviewedthe head,review_urland a note that says "as<account>". The pull request shows one review at that head by the review account (city-root-review): if the note names the city's account instead, the patch'senvdid not apply. The work bead is unchanged. The pull request is not merged by it.gc bd --rig <rig> update <bead> --assignee <rig>/forgejo.reviewer. Wait two minutes and look atgc session listfor areviewersession. If none starts, try the other stringssessionAssigneeMatchestakes in turn, setting the assignee each time: the session's name, its alias, the named identity without the rig. Record which one woke it. Expected when one does: the Reviewer has no workflow for a bare bead, mails the Operator "assigned and not slung" and exits (gc mail inbox); that mail is the pass of this step, and it shows the review order (L15) must sling and not only assign.review_headis an older commit of an open pull request, slung. Expected: closed,review_verdict=void, a note saying so, and no new review on the pull request.After each,
gc bd showof the review bead and the pull request's reviews are the evidence; the Reviewer's clone is under.gc/agents/<rig>/reviewer/and can be cleared by hand.Bead: gascitypacks-7mb
Reviewed
136899bin full against gascitypacks-7mb: agent, formula, tests/reviewer.sh, README, CHANGELOG, description (city patch + trial); merge onto main43dce15is a fast-forward and CI on that tree is green.Review of
136899bagainst gascitypacks-7mb (Landing L14), approved and merged.Checked:
forgejo/agents/revieweris a rig-scoped on-demand named session on acp, unrestricted, with at most one session.mol-forgejo-reviewis one step of five parts. It voids on a moved head or a closed PR, never waits, never merges, never pushes and never writes the work bead. It posts withgc forgejo pr review --expect-headand recordsreview_verdict/review_reviewed/review_urland a note, read back from the forge, then closes withno-op. The place for L7 is marked and nothing calls it. The description says what is Claude Code's own.roles.workerpatches in gascity-rootpack.toml. The review token is set only through the Reviewer's agentenv, and every other agent keepsworkspace.env's city token. The description also carries the trial for question 4.43dce15(the PR base), so the merge is a fast-forward to the head. CI on that tree (changelog, lint incl. tests/reviewer.sh, scripts) is all green.Follow-ups:
Merged by the Operator's reviewing agent under the user's interim mandate of 2026-11-11.