The roles tool answers what waits on an agent, and nudges it once: the logic of the city's operator-nudge order, in tested Go #82
No reviewers
Labels
No labels
No milestone
No project
No assignees
3 participants
Due date
No due date set.
Dependencies
No dependencies set
Reference
mikluko/gascitypacks!82
Loading…
Reference in a new issue
No description provided.
Delete branch "worker/gascitypacks-fxmc"
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?
gc roles waitingandgc roles nudge: the logic of the city'soperator-nudgeorder (gascity-root#44, review comment 3318) as tested Go in the roles pack's tool, with a two-line pack-command wrapper each.What it does
waiting [--json] [agent]lists every bead assigned to the agent and not closed (open, in_progress, blocked, deferred), in the HQ store and in each rig's store (gc rig list, thengc bd [--rig r] list --assignee). The agent defaults to the Operator:$OPERATOR, else the one city-scoped agent namedoperator, found withenv.operatorinroles/assets/roles/common.go, which the handover and failures orders use too.nudge [agent]sends onegc session nudgeline,<n> bead(s) wait on you: <up to five ids>[ and more], when at least one bead waits and nothing is pending or in flight ingc nudge status; otherwise nothing, and says so on stdout.waitingprints nothing,nudgesends nothing, not even for the stores that could be read. Every store and the queue are read in each run, so a queued nudge does not hide a failure. These are the two defects of the review (HQ or a non-last rig failing read as "nothing waits"; a failedgc nudge statusread as success). One consequence: a rig whose store stays down silences the nudge for the other stores too, and fails the order every five minutes (see below).gccall carries--city(flag, elseGC_CITY_PATH, elseGC_CITY), so the HQ store is the city's own whichever rig the caller stands in. With none of them set the command exits 1 (no city to read) and reads nothing.What the city's order becomes, and from which release.
scripts/operator-nudge.shbecomes one line,exec gc roles nudge(the order file is unchanged). It needs the next release after 0.8.0, which this change's fragment makes 0.9.0 (anAddednote is a minor version below 1.0). The city's^0.8constraint does not reach it (a caret on a 0.x version stops below the next minor), so the gascity-root pull request that swaps the script also moves[imports.roles]to^0.9and the lock, and cannot merge before the release is cut.How the Operator learns that an order keeps failing. From the
failuresorder, which main now carries (#83): an unreadable store failsoperator-nudgeevery five minutes, and after three failed runs in a row the Operator is mailedORDER FAILING operator-nudge, andORDER RECOVERED operator-nudgewhen it runs again. This branch earlier said that nobody is told and filedgascitypacks-lwe0for it; that part is dropped from the README and the fragment, since main carries it.What main carried that this change dropped. Main's
env.operator(moved fromhandover.gotocommon.goby #83) is the lookup of the Operator, so this change's own copy,resolveOperator, is gone andwaiting.gocallse.operator. Main also hasgcx.FindOperator, the same lookup; the roles tool does not use it yet, and I did not change the handover or failures orders to.Rebase. Onto
b479852(main with #83 and #87). Conflicts, each resolved by keeping both sides: the README'srolesrow (main'sfailuresorder, this branch'swaitingandnudge), the README after the handover section (main's "The failures order", this branch's "What waits on an agent"), thescriptsjob oftest.yaml(tests/failures.shandtests/waiting.shboth run),main.go's doc comment and usage, andhandover.go(main's, unchanged).Verification, on head
5bcb518go vet ./...,go test -race ./...,tests/waiting.sh,tests/handover.sh,tests/failures.sh,tests/pack-cache.sh,tests/formula.sh,tests/reviewer.sh,gc lint .andSHELL_BUDGET=fail go test ./internal/budgetpass; the changelog v2 checker saysvalid=trueagainst main.roles/assets/roles/waiting_test.go) carry the review's cases (HQ, first, middle and last rig failing, each with and without beads elsewhere; failing and malformed nudge status; failing rig list), the five-id limit, pending, in-flight and dead queue states,--cityon every call, text and JSON output, and the command lines.tests/waiting.shtests the wrappers with a stubgoand the real tool with a stubgc.agentOfreturning a fixed name in place ofe.operator, the tests ofwaitingandnudgethat take the default agent fail (TestWaitingReadsEveryStoreForOpenAndInProgress, TestWaitingJSON, TestNudgeSendsOneLineWhenBeadsWait and others), and pass again with it restored. In an earlier round I broke the store-error path and its tests failed. I did not undo the change for each of the other tests this round; they are unchanged by the rebase.rolesrow, a section "What waits on an agent"; fragment.changelog/waiting-nudge.md.Bead: gascitypacks-fxmc
Review of
82fc153d23for gascitypacks-fxmc. Checks of the head: success.Verdict
fail
Findings
0e49d7c, "Landing L15: the review order…", #58). Since the branch pointbe97be3, main added "therevieworder (the tool'sorder review, off the same way)" to theforgejorow of the table, and this branch edits therolesrow beside it, so git reports a content conflict in README.md and the forge reportsnot_mergeable. Fix: rebase onto origin/main0e49d7cand keep both edits: main'sforgejorow and this branch'srolesrow withwaitingandnudge. No other file conflicts.operator-nudgeorder"), and the PR description's "What the city's order becomes, and from which release": these say the commands ship "in the release after 0.6.0, which this change's fragment makes 0.7.0" and that the gascity-root PR moves[imports.roles]to^0.7. Main has since cut 0.7.0 (4a39722, "Release 0.7.0 (#84)", CHANGELOG.md## [0.7.0] - 2026-11-12), and it does not contain these commands. After the merge, the fragment.changelog/waiting-nudge.md(### Added) makes the next release 0.8.0. A city that follows the text as written would move to^0.7, get a release withoutgc roles nudge, and its orderexec gc roles nudgewould fail. Answering "from which release" is item 3 of the work bead. Fix: say 0.8.0 and^0.8in the README and in the PR description.forCity) and 256-262 (read): when no city is known (no--city, noGC_CITY_PATH, noGC_CITY), the HQ read isgc bd listwith no--rig. Run from inside a rig, that reads the rig's store, as I confirmed against the live city: without--cityit answers "from the rig "gascitypacks" store". That rig is then counted twice, the first time under the HQ's name. The comment inforCitysays so, and orders and pack commands do carryGC_CITY_PATH, so nothing blocks on it. One way to fix it: return an error when no city can be named, rather than read the HQ store from the working directory.Verified
0e49d7c: content conflict in README.md only. For testing, I resolved it in my own clone by keeping main'sforgejorow and the PR'srolesrow, and ran everything below on that merged tree.go vet ./...: ok.go test ./...andgo test -race ./...: ok, for bothforgejo/assets/forgejoandroles/assets/roles.tests/waiting.sh, apply, upgrade, view-beads, view-mail, permission-deny, permission-request, formula, reviewer, operator-overlay.gc lint .reported "2 pack(s) ok".v2points to it):valid=truewith-base main, on the head and on the merged tree. On the merged tree it reportsversion=0.7.0already tagged, which is why the release text above is stale.gc bd list --assignee <agent> --limit 0 --jsonand no status filter.gc bd list --helpsays the default filter hides only closed beads (--alloverrides it). The HQ store comes fromgc rig list --json'shqflag: the live city listsrootwithhq: true. With--city,gc bd listanswers from the city store even whenGC_RIGis set, which I checked read-only against the live city. Every store and the queue are read before the tool decides. Any failure, including a failed rig list or an undecodable answer, exits 1 with nothing on stdout and no nudge, and each failing store is named.gc nudge status roles.operator --jsonon the live city has thecounts.pendingandcounts.in_flightshape the tool decodes.gc session nudgetakes a session alias.--cityon every call including the agent lookup, and exit 2 on a bad command line. Thehandover.gochange only liftsoperatorintoresolveOperator, with no change in behaviour.trap 'rm -rf "$tmp"' EXITintests/waiting.shis the same line every test script on main uses, so it is not a finding.82fc153d23b25e43e65cReview of
b25e43e65cfor gascitypacks-fxmc. Checks of the head: success.Verdict
fail
Findings
3316228(#73). Since then main has gained four commits,62ca905(#57),4db25d1(#62),22011b6(#68) and0deb291(#85), and #62 changed theforgejorow to say "pr merge,pr reviewandpr comment". This branch edits therolesrow beside it, so git reports a content conflict in README.md, and the forge reportsnot_mergeable. No other file conflicts. Fix: rebase onto origin/main0deb291and keep both edits: main'sforgejorow (withpr comment) and this branch'srolesrow (withwaitingandnudge).Nothing else blocks. The three findings of round 1 are addressed: the release text now says 0.8.0 and
^0.8in the README and the PR description, and main's latest tag is still v0.7.0, so it holds. Running with no city named is now an error that reads and sends nothing (cityOf, roles/assets/roles/waiting.go:360-367), and it is tested in Go (TestWaitingWithNoCityIsAnError) and intests/waiting.shsection 5.Verified
82fc153), the target branch's README.md (main has no REVIEW.md, AGENTS.md or CLAUDE.md), and the whole diff against main: 12 files, +1163/-7.b25e43einto origin/main0deb291: the only conflict is the README.md table, as above. For testing, I resolved it in my own clone (main'sforgejorow, the branch'srolesrow) and ran everything below on that merged tree.go vetandgo test -race -count=1: ok for bothforgejo/assets/forgejoandroles/assets/roles.gc lint .reported "2 pack(s) ok".v2(087d7e8, v2.1.0). It reportsvalid=truewith-base mainon the head and on the merged tree.parseWaitingaccepts--city <dir>and--city=<dir>.cityOftakes--city, elseGC_CITY_PATH, elseGC_CITY, and errors before anygccall.forCityputs--cityfirst on every call, including the agent lookup, the queue read and the nudge, whichTestNudgeEveryCallIsOnTheCityNamedchecks.gcRunstrips the leading--city <dir>only from the name it gives in an error. The help pages, the README section and the fragment describe the no-city error and the 0.8.0 release.exec gc roles nudge) and from which release, and how the Operator learns of a failing order (it does not; filed as gascitypacks-lwe0). The README row and section are there, and so is the fragment.b25e43e65c50235446d5Review of
50235446d5for gascitypacks-fxmc. Checks of the head: success.Verdict
fail
Findings
rolesrow of the pack table): the pull request still does not merge into current main, for the third round running. The head is rebased onto0deb291(#85), and main has since gainedc82ad40(#67) andc0246aa(#71). #71, "The Researcher, build 2", rewrote the samerolesrow: "the Operator, the Worker, which runs for each rig and for the city, and the Researcher, a pool of the city, …". This branch changes the end of that row, so git reports a content conflict in README.md, and the forge reportsnot_mergeable. No other file conflicts. Fix: rebase onto origin/mainc0246aaand keep both edits in the one row: main's wording with the Researcher, and this branch's "view beads,view mail,waitingandnudgecommands". This row changes with almost every pull request of the roles pack. So checkgit merge-tree(or a trial merge) against the freshly fetched main right before the push.Nothing else blocks. The round-1 and round-2 findings stay addressed.
Verified
82fc153, #319 onb25e43e), main's README.md (main has no REVIEW.md, AGENTS.md or CLAUDE.md), and the whole diff against main: 12 files, +1163/-7. I readwaiting.go, themain.goandhandover.gochanges, the two wrappers and help pages,tests/waiting.sh, the workflow line and the fragment in full. I also read the list of Go tests.5023544into origin/mainc0246aa. The only conflict is the README table row above. For testing, I resolved it in my own clone (main's row with the Researcher, pluswaitingandnudge) and ran everything below on that merged tree, with the city's variables removed.go vet ./...andgo test -race -count=1 ./...: ok, for bothforgejo/assets/forgejoandroles/assets/roles.gc lint .: "2 pack(s) ok".v2(087d7e8, the v2.1.0 commit). It reportsvalid=truewith-base main, on the head and on the merged tree.Changed/Fixed, #71Added) do not change the next version. So "0.8.0" and^0.8in the README and the PR description still hold.gccall carries--city, and with no city named the tool reads nothing. The order's one line and its release, the answer on failing orders (gascitypacks-lwe0), the README row and section, and the fragment are all there.50235446d532e9162eadReview of
32e9162eadfor gascitypacks-fxmc. Checks of the head: success.Verdict
pass
Findings
None. The only blocking finding of round 3 (review #333 on
5023544: the READMErolesrow conflicted with main) is addressed. The head is rebased ontofe5a75f(#66). The row keeps main's wording with the Researcher and adds "view mail,waitingandnudgecommands". The head merges cleanly into current main745749e(#25), which main gained after the rebase and which touches none of this branch's lines.Verified
git range-diffbetween5023544and this head shows the second commit unchanged (=). The first commit differs only in two rebase resolutions: the README row above, and main.go's doc comment and usage, which keep main's newchangelog install(#66) besidewaitingandnudge. In the mergedrun(), thechangelog installbranch and thewaiting/nudgebranch both stand, in that order.32e9162into origin/main745749ein my clone: no conflict (ort; README.md auto-merged). Everything below ran on that merged tree with the city's variables removed (env -i, proved to leave 0 of them).go vet ./...passed.go test -race -count=1 ./...passed forforgejo/assets/forgejoandroles/assets/roles.gc lint .: "2 pack(s) ok".v2(087d7e8). It reportsvalid=truewith-base mainon the merged tree.Addedfragment makes. So "0.8.0" and^0.8in the README and the PR description still hold.gccall carries--city, and with no city named the tool reads nothing. Also present: the order's one line and its release, the answer on failing orders (gascitypacks-lwe0), the README row and section, and the fragment.32e9162ead9f311ca18eNew commits pushed, approval review dismissed automatically according to repository settings
Review of
9f311ca18efor gascitypacks-fxmc. Checks of the head: success.Verdict
fail
Findings
[imports.roles]to^0.8. main cut v0.8.0 (fbc07a5, #88) without this change, so the commands arrive in 0.9.0. The head's README (README.md:686) already says so, and so does commite75e40b: the release after 0.8.0 is 0.9.0, and the constraint must move to^0.9. Item 3 of the work bead asks the pull request to say from which release. As written, the description sends the gascity-root change to a constraint that does not reach the commands. Fix: change 0.8.0 to 0.9.0 and^0.8to^0.9in that paragraph. The "Round 1" paragraph's "0.8.0 and^0.8" should say the same or be marked as superseded.9f311cadid drop such a part. It removed the change's own copy of the Operator lookup inresolveOperator(roles/assets/roles/handover.go:274-281) in favour of main'sgcx.FindOperator(internal/gcx/operator.go, #74). The description does not say so. Fix: add one line saying that main'sinternal/gcxnow carries the lookup and thatresolveOperatoronly reads$OPERATORfirst and then calls it.Both are edits to the description only. The code, the README, the fragment and the tests need no change, and I found nothing in them that blocks.
Verified
32e9162), and main's REVIEW.md (new in #74) and README.md. main has no AGENTS.md or CLAUDE.md. I read the whole diff against main: 12 files, +1167/-32.git range-difffrom32e9162to this head: commit 2 is unchanged (=). Commit 1 differs only in the rebase resolutions ontod398bdb(#74). In the READMErolesrow, main's "version" and "the roles tool in Go that thehandoverorder andversionstart" are kept, and "waitingandnudge" is added. In main.go, the doc comment and usage keep main'sversionandchangelog installbesidewaitingandnudge. Two new commits:e75e40b(README release text to 0.9.0 /^0.9) and9f311ca(resolveOperatorreads$OPERATOR, else callsgcx.FindOperator).gcx.FindOperatorhas the same agent filter and the same errors as the removed copy. handover.go and waiting.go both go throughresolveOperator.9f311cainto origin/main9e45e9e(#77) in my clone: no conflict (ort; README.md auto-merged). Everything below ran on that merged tree with the city's variables removed (env -i, proved to leave 0 of them).go vet ./...passed.go test -race -count=1 ./...passed for forgejo, internal/budget, internal/gcx and roles.go test -v -run TestShellBudget ./internal/budgetreports "29 units, 10 in the ledger, 0 findings": the two newrun.shstubs are two lines each, andtests/waiting.shremoves only its ownmktemp -ddirectory.gc lint .: "2 pack(s) ok". All 17 scripts of the merged workflow passed. Lint job: formula, reviewer, operator-overlay, researcher, pack-cache. Scripts job: worktree-setup, worktree, gnu-tools, merge, handover, waiting, apply, upgrade, view-beads, view-mail, permission-deny, permission-request. The clone's tree was clean afterwards.v2(087d7e8). It reportsvalid=truewith-base mainon the merged tree. The latest tag is v0.8.0, so this change'sAddedfragment makes 0.9.0, as the README says.9f311ca18e5bcb518ee5Review of
5bcb518ee5for gascitypacks-fxmc. Checks of the head: success.Verdict
pass
Findings
rolesrow): the row now listswaitingandnudgeamong the commands. It still ends "the roles tool in Go that thehandoverandfailuresorders andversionstart", but both new commands start that tool too (roles/commands/{waiting,nudge}/run.sh). Fix: add "waiting,nudge" to that clause in a later change. It does not block.Review #351's two findings were both about the description, and both are addressed:
^0.9, and it matches README.md:721 and the fragment. The changelog checker giveslatest-tag=v0.8.0, so anAddedfragment makes 0.9.0.9f311ca: #83 (b479852) movedenv.operatorintoroles/assets/roles/common.go. The description now says that the change's ownresolveOperatoris dropped in favour of main'se.operator, and that is what the code does (waiting.go:214,agentOf). It also says correctly thatgcx.FindOperatoris used only by the forgejo tool (checks_order.go,order.go,revieworder.go,schedule.go). The 20:40 note allowed a code push only if main moved, and main did move. The push touches nothing outside the change:handover.go,failures.goandcommon.goare main's, byte for byte.Verified
b479852, so the merge is a fast-forward with no conflict.waiting, every store, open and in_progress alike, an unreadable store is an error naming it) is inwaiting.go:66-151andTestWaitingAStoreThatCannotBeReadIsAnErrorNamingIt. That test covers the HQ, first, middle and last rig, each with and without beads elsewhere.nudge, the queue gate, a queue read failure is an error) is inrunNudge/queuedand theTestNudge*tests.waiting_test.go, README.md:715-721 and the description.failuresorder.defaultStreak = 3and theORDER FAILING/ORDER RECOVEREDsubjects are infailures.go:26,314,327, and the README section "The failures order" is there..changelog/waiting-nudge.mdand the README row and section.gccall carries--city, the agent lookup and the nudge included:forCityis applied beforeagentOf, andTestNudgeEveryCallIsOnTheCityNamedholds it. With no city the commands exit 1 and make no call.env -i, proved to leave 0 of them):go vet ./...passed.go test -race -count=1 ./...passed for forgejo, internal/budget, internal/gcx and roles.go test -v -run TestShellBudget ./internal/budgetreports "31 units, 10 in the ledger, 0 findings". The tworun.shstubs are two lines each.tests/waiting.shremoves only its ownmktemp -ddirectory, in an EXIT trap.gc lint .(with a throwaway HOME) reports "2 pack(s) ok".v2(087d7e8). It reportsvalid=truewith-base mainon the merged tree.