Landing L16: a Reviewer for the city's own repository #56
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!56
Loading…
Reference in a new issue
No description provided.
Delete branch "worker/gascitypacks-wmm"
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 L16 of gascity-root
docs/handoffs.md(bead gascitypacks-wmm, HQ ticket root-ons.17, factory review root-i0s item 2): a Reviewer for the city's own repository. gascity-root is no rig, so no rig's Reviewer can review it, and every one of its pull requests has gone to a sub-agent of the Operator's session with a hand-written brief. Decision 4's condition is met: the rigs' Reviewers have run.What it is
forgejo/agents/reviewerlosesscope = "rig". With no scope gc instantiates it for each rig and, as for the Worker, for a city that imports the pack at the city level:forgejo.reviewerwith no rig,Dirempty, working the HQ store.forgejo/pack.tomldeclares a second on-demand[[named_session]](scopecity) beside the rig's, so each is a one-session singleton.work_dirleaves the rig segment out whenRigis empty, as the Worker's does (.gc/agents/reviewer). The prompt names the rig or the city repository.mol-forgejo-review, with the same tool (gc forgejo pr state,pr review). What differs for a repository that is no rig (README, "The city's Reviewer", has the table):${GC_RIG_ROOT:-$GC_CITY_PATH}, still refuses a pull request that is not of that origin (halt), and the target branch isbasefrompr stateas for a rig..gc/agents/reviewer/review-<bead>.AGENTS.mdcarries what the Operator's sub-agents were told by hand.AGENTS.mdorCLAUDE.md, read from the target asREVIEW.mdis, as written on the merge result, provided they write nothing outside the clone. For the city repository that is the three gates of itsAGENTS.mdwith--city "$CLONE"(agccommand on the clone without it answers for the live city, andgc importrewrites the livepacks.lock), plus the steps of.forgejo/workflows/test.yaml, which the formula already read from the merged tree.gascitypacks-imy(an assigned, unslung bead leaves the session holding it): the prompt now has the Reviewer hand the bead to the Operator (--assignee roles.operator --status open) and mail it beforegc runtime drain-ack, which gc refuses while the session holds a bead it claimed; a test holds the order in the rendered prompt of both agents.gascitypacks-mkr(the permission prompt on anrm): the rules belong to the formula text, which is the one agent's for rigs and city alike, and #54 carries them, so this branch does not repeat them. The two pull requests touch neighbouring lines of the formula's rules section and may need a trivial rebase..changelog/city-reviewer.md. No new shell logic: the one new shell is the default expansion${GC_RIG_ROOT:-$GC_CITY_PATH}in an existing line of the formula.Verification
tests/reviewer.sh(extended): resolves two Reviewers (Dir"" and "demo") and two named sessions in a throwaway city; checks the work_dir template; renders each prompt withgc primeunderenv -iand holds the claim and the hand-over order; runs the origin check of Part 2 on two local repositories (a rig's origin and the city's) for the four cases of pull request x Reviewer; checks the Quality Gates hook and--city "$CLONE"in Part 3; the existing cases still pass (the allowedgitoutside the clone is now the${GC_RIG_ROOT:-$GC_CITY_PATH}read). The step stays under the 28000-character bound.gc lint .ok (it flagged--notifyin my first draft of the prompt line; fixed),tests/formula.sh,go vetandgo test ./...inforgejopass; the v2 changelog checker, built from the tag v2.0.1 and run with-base main, saysvalid=truewith the fragment.The patch gascity-root needs
None new, if its
rig = "*"patch offorgejo.revieweris in place (the one the rigs' Reviewers run on). I resolved it in a throwaway city: a[[patches.agent]]withrig = "*"reaches the city'sforgejo.revieweras well as every rig's. The city's agent comes out withprovider = "acp",max_active_sessions = 1,claude-opus-5-5athigh,permission_mode = "unrestricted"andFORGEJO_TOKEN_FILEset to the review account's token file, in these two agents'envand no other's; an entry with norigkey wins over the*one for the city's agent alone (tried with a different model). So the bump of[imports.forgejo]to the release that carries this needs only the existing entry:If the city wants a different model or token for its own Reviewer, the same entry again with no
rigkey. Without a patch that reaches the city's agent,scripts/check-pins.shfails it. Note the city's session cap (gascity-root#36counted a rig's Reviewer against it): the city's Reviewer is one more possible session, at most one, on demand.The trial, for the Operator (after the release, the import bump and this patch; not for me to run on the live city)
gc config showhasforgejo.reviewer(no rig) andgc order/gc sessionshow nothing running for it.gc forgejo pr state --json --repo <city checkout> --pr <url> | jq '{state, head, base, checks}'. Note the fullheadand the work bead.gc bd create --labels service,review --metadata '{"pr_url":"<url>","review_head":"<full head>","work_bead":"<id>"}') and sling it:gc sling forgejo.reviewer <review bead>. Expect within about ten minutes: a session of templatereviewerwith no rig starts, the review bead closes withreview_verdictpassorfail,review_reviewedthe head,review_url, and one review at that head by the review account. The gates ran with--city "$CLONE": check that the live city's checkout is still clean afterwards (scripts/check-live-city.sh), the failure thatAGENTS.md's rule exists to avoid. The clone stays under.gc/agents/reviewer/and can be cleared by hand.forgejo.reviewer: it mails the Operator "assigned and not slung", the bead is the Operator's (open, assigned toroles.operator), and the session drains (thegascitypacks-imyfix;gc session listshows it gone).review_headof an open pull request) and restart safety (sling the same head again: no second review) as in #48's trial.Bead: gascitypacks-wmm
🤖 Generated with Claude Code
Bead: gascitypacks-wmm
Review of
c0953217d8for gascitypacks-wmm. Checks of the head: success.Verdict
pass
Findings
env -i. With the throwawayHOMEthe formula prescribes forgcon a clone,gc --city "$CLONE" config show --validateandscripts/check-pins.sh --city "$CLONE"both fail: the remote import "is locked but not cached ... run gc import install". With the realHOME,config show --validatestill fails, withrig "kuberex": path is required, because a clone has no.gc/site.toml. Both gates pass once the setup steps of gascity-root'stest.yamlconfigjob have run in the clone:gc --city "$CLONE" import install, which went into the throwaway HOME and left packs.lock unchanged, and its site binding written to$CLONE/.gc/site.toml. A Reviewer that reproduces test.yaml in order before the gates gets this right. One that takes the paragraph literally, or skipsgc import installas needing the network, fails every gascity-root pull request ("pass only when every check you ran passed"). Fix: say in the paragraph that the city repository's gates run after test.yaml'sconfigsetup (import install with--city "$CLONE"into the throwaway HOME, then the site binding). Or put that in gascity-root's AGENTS.md, which matches the bead's "from the repository it reviews". Step 3 of the trial will show this either way.$CLONE":gc config showreads the pack cache under HOME, andimport installreads the network. Read literally, the rule excludes the three gates the next sentence names. "write nothing outside$CLONE" says what is meant.check-live-city.shin the clone proves little, as the text says. Runningscripts/check-live-city.sh "$GC_CITY_PATH"after the gates, which is read-only, would check the thing that AGENTS.md rule exists for: that the live city's checkout is still clean. Today the trial leaves that check to the Operator.Verified
98f2d80, which includes #51, #53 and #55): clean, and forgemergeable.env -i(0 city variables, checked):gc lint .ok.tests/formula.shandtests/reviewer.shok.go vet ./...,go test ./...andgo test -race ./...in forgejo ok. All ten script tests of thescriptsjob ok. The changelog checker built from mikluko/changelog v2.0.1 with-base=mainreportsvalid=truewith.changelog/city-reviewer.md.rig = "*"entry forforgejo.reviewer, both Reviewers resolve (Dir "" and "demo") with provider acp,max_active_sessions = 1, claude-opus-5-5 at high,permission_modeunrestricted andFORGEJO_TOKEN_FILE. gascity-root imports forgejo at the city level (pack.toml[imports.forgejo]), so it gets the city's Reviewer, and no other pack's agent uses.gc/agents/reviewer.${GC_RIG_ROOT:-$GC_CITY_PATH}is the fallback the city's Worker already uses (roles/commands/worktree/setup/run.sh:28). The test runs the origin check for all four combinations of pull request and Reviewer.check-live-city.shin a plain clone reads the clone's own status (--git-common-diris$CLONE/.git), as the text says. The live city's checkout was clean after all of the above.gc runtime drain-ack, and the test checks that order in the rendered prompts of both agents. The step stays under the 28000-character limit.