Cut Worker orientation: the step body under 8,000 characters, reference material in skills loaded on demand #60
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!60
Loading…
Reference in a new issue
No description provided.
Delete branch "worker/gascitypacks-7l7"
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?
Cuts the step of
mol-worker-workfrom about 24,000 characters to 7,716 (7,615 with a rig's variables filled in) and moves what few runs need into four skills the parts name.tests/formula.shholds the limit at 8,000. Bead gascitypacks-7l7 (HQ root-i0s, item 5).Why the installed step is one body, and what a Worker receives
The review spoke of a five-step formula. That is the shape before #26 (merged 2026-11-12 00:21): six steps (
load-context...open-pull-request), 26.8 KB. #26 folded them into one step of six parts, so that a closed step does not make gc's fresh cycle restart the Worker's session. The installed pack (0.6.0,d9d5ad4) is byte-identical to main: one step, 24 KB body. A Worker receives nothing per part. The claim hands it the one step bead, whose description is the whole body, and everygc bd showof the step prints that body again (the parts are headings in it, not deliveries). That is why the body is read over and over, and why a Worker that also shows the root bead overruns the 28k inline limit of a Bash call (it happened to this session's first read).What moved, and to where
metadata.pr_url, review comments, conflict,halt_reason, continuemetadata.branch, rebase, skip pre-flightsworker-reworkgnu check,worktree setup,worktree branch,worktree checkdo; the box with nopre_start; why nogitbeforesetup; what each failure means; the Rex label, setup commandworker-worktreeworker-gatesworker-haltworker's Halting section)Also out of the step: the formula-level explanation (the README has it), the
gc primecomments, the emptyConfig:blocks, the four copies of the convoy derivation andBRANCH(Part 1 printsWORK_BEAD_IDandBRANCHonce and later parts take them as literals, since each Bash call starts clean), the commit-message template and the repeated prose of each part. The body begins with "Read the work bead first, its description and notes", and opens a design document only at the lines the bead names; the first command of Part 1 shows the bead.Nothing lost
Every rule
tests/formula.shheld by its phrase is still found, in the step or in the skill that now holds it: the part order, the single close as passed, the worktree check first in Parts 3 to 6, the CI rule, Resuming, the mark, the hand-over, the halt (its three lines, now run once fromworker-halt, with the detach guard still run in a plain directory and a linked worktree). New tests: the limit, that the bead is read first, that each part names its skill, that each skill exists, isname:d right and is materialized forroles.workerbygc internal materialize-skills(the way an acp Worker gets its skills), and that the skills hold the moved rules. A mutated copy (a 400-character longer step, a missing skill, a renamed halt key) fails them.No shell logic is added (docs/shell.md): the commands are the old ones, fewer. The trade: a Worker that halts now loads one skill first (the
workerskill it loads at start also says so); the rest of the cost is read once, when needed.Checks run
env -i ... bash tests/<each>.shfor all twelve (formula.sh needsenv -iin a Worker's env, see gascitypacks-pmn),gc lint ., the changelog v2 checker. The README's "Worker pools" section describes the formula and the skills; the fragment is.changelog/worker-step-under-8000.md.Bead: gascitypacks-7l7
Review of
daf1eae3cefor gascitypacks-7l7. Checks of the head: success.Verdict
fail
Findings
gnu checkorworktree setupnow halts throughworker-halt, and that skill runs the detach guard. The old step's two Part 2 halts ran no detach ("A failure halts the bead as above and detaches nothing"), andtests/formula.shfailed on anygit switchafter a failed setup ("Part 2 detaches after a failed worktree setup, in the checkout above the directory"). This PR removes that test. The guard is not enough here.worktree setuprefuses a directory "inside a linked worktree" (roles/assets/scripts/worktree-setup.sh:32-40), and in such a directory--git-dirand--git-common-dirdiffer, sogit switch --detachdetaches the enclosing worktree's branch. Reproduced: main repo,git worktree add -b other ../wt, a plainwt/agents/w1, then the skill's detach line run fromw1;wtended onHEAD (no branch). This is the very case the setup refusal exists for, and the bead requires that nothing a Worker must do is lost and that every rule the tests hold today is still found. Fix: haveworker-halt(or Part 2) say that a halt from Part 2 steps 1 and 2, before the directory is a worktree, skips the detach line, and restore a test that holds it, for example a phrase check on that rule in the skill and on Part 2.worktree branchcommands sit in one fenced block, and the Worker must pick one by reading the prose. The old step chose with anifonmetadata.pr_url. A Worker that runs the block as written on a new bead cuts the branch, then fails onorigin/worker/<bead>, which does not exist, and halts the bead. Keeping the one-line conditional costs a few dozen characters:if <bead has pr_url>; then ... "origin/$BRANCH"; else ... "origin/{{base_branch}}"; fi.main("NOTICE: main pre-flight failed", "Also observed on main", "Observed on main"), where the step used{{base_branch}}. A rig with another base branch files and comments with the wrong branch name, andtests/formula.shnow pins the literalAlso observed on main. Say "the base branch (Part 1'sorigin/<base>)" or have the step pass the name. Similarly,worker-reworknamesgc forgejo pr statewhere the step uses{{forge}}.Verified
.changelog/worker-step-under-8000.mdfragment are present. No shell logic is added.daf1eaeinto origin/main (be97be3, 7 commits past the branch point, none touching the formula or the worker skills): clean.env -i, 0 such variables shown), on the merge result:tests/formula.shok (it includes the 8000 limit andgc internal materialize-skillsfor roles.worker),tests/reviewer.shok,gc lint .reported 2 packs ok, and worktree-setup, worktree, gnu-tools, merge, handover, apply, upgrade, view-beads, view-mail, permission-deny and permission-request all exited 0.go vet ./...was clean andgo test -race ./...passed. The changelog v2 checker (built from changelog v2.1.0,-base=main) reported valid=true.worker-haltdetach line in a plain directory inside a linked worktree: it detached that worktree (first finding).daf1eae3ce3c73c24159Review of
3c73c24159for gascitypacks-7l7. Checks of the head: success.Verdict
pass
Findings
gc roles gnu check,gc roles worktree setup/branch/check, where the step runsgc {{binding_name}} ...(mol-worker-work.toml:106,110,117). The skill only describes the commands and the step runs them, so a rig that binds the roles pack under another name runs the right command and only reads a wrong name.tests/formula.shnow pins thegc rolesliterals. This is the same kind of issue as the{{forge}}point of round 1, whichworker-reworknow solves with<forge>.<binding>would do the same here.{{setup_command}}again before the checks, and the new one runs only the gates and the build. A change that adds a dependency can then fail Part 5's gates on a rig whosesetup_commandinstalls it. That is only a few characters to put back ("Run the setup, the gates of Part 3 and the build"). I do not block on it, since Part 2 runs the setup and a Worker who sees a missing dependency will run it.Round 1's findings, at this head
worker-halt's detach line, andworker-haltsays the same and why (it would detach the enclosing worktree's branch).tests/formula.shpins both phrases.worktree branchcommands in one block: fixed. Part 2 step 3 is again oneifonmetadata.pr_url, and a test holds it.mainhard-coded inworker-gates: fixed. The text says "the base branch" throughout, and the test pinsAlso observed on the base branch.worker-reworkusesgc <forge> pr stateand says what<forge>is.Verified
drain-ack, the worktree check at the start of Parts 3 to 6, the CI rule, Resuming and "Never run Part 2", the mark with${WORK_BEAD_ID:?}, and the hand-over. The moves into the four skills match the PR's table. The step begins by telling the Worker to read the bead and to open a design document only at the named lines, and the first command of Part 1 shows the bead. The README's "Worker pools" section and.changelog/worker-step-under-8000.mdare there, and no shell logic is added. The target branch has no REVIEW.md, AGENTS.md or CLAUDE.md.daf1eaeis no longer on the forge. Merged3c73c24into origin/main (c06effd, one commit past its base, #81, which touches neither the formula nor the skills): clean.env -i, 0 such variables shown), on the merge result, with a throwaway HOME for the gc-based tests:gc lint .reported 2 packs ok.tests/formula.shpassed, including the 8000 limit, the four skills being named, existing and materialized for roles.worker bygc internal materialize-skills, the Part 2 detach rule and the halt run against the stub.tests/reviewer.shandtests/operator-overlay.shpassed. All 11 scripts tests passed (worktree-setup, worktree, gnu-tools, merge, handover, apply, upgrade, view-beads, view-mail, permission-deny, permission-request).go vet ./...was clean, andgo test -race ./...passed. The changelog v2 checker, built from changelog v2.1.0 and run with-base=main, reported valid=true.city-root referenced this pull request2026-11-12 17:36:47 +00:00