Workers on darwin require GNU date and sed, and stop early without them #17
Loading…
Reference in a new issue
No description provided.
Delete branch "worker/gascitypacks-xqa"
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?
A Worker on macOS now requires GNU
dateandsed, halts its bead at once without them, and runs them in place of the BSD ones.Where the check lives.
gc roles gnu check(roles/commands/gnu/check, logic inroles/assets/scripts/gnu-tools.sh) is the first thingworkspace-setupruns inmol-worker-work, before any git command touches the worktree. On macOS it needsgdateandgsedonPATH. When one is missing, the Worker halts the bead: thehalt_reasonis one line that names the missing tools and the fix (brew install coreutils gnu-sed), and the bead goes to the Operator. It is a formula step, not apre_startcheck, because no bead is claimed atpre_start, so there is none to halt. Nothing happens on Linux.How a Worker's
dateandsedbecome GNU's. The Worker'sagent.tomlsetsenv = { PATH = "$HOME/.local/share/gascitypacks/gnubin:$PATH" }. gc expands$VARin an agent's env against the supervisor's (expandEnvMapincmd/gc), so this extends thePATH. A secondpre_startentry runsgnu-tools.sh shims, which linksdatetogdateandsedtogsedin that directory.checkalso verifies thatdateandsedrun as GNU's in the session, so a session whosePATHlacks the shims halts too, instead of failing deep into a run.Why this mechanism. The environment is the only thing that reaches
go test,bash tests/...and every script a Worker runs: each command starts a fresh shell, andpre_startruns outside the session. Per-tool shims rather than Homebrew'sgnubindirectories:gnubinturns every coreutils command GNU, which is more than the two tools asked for, and it names a Homebrew prefix. The shims name exactly the tools in the list, wherever Homebrew put them, and the list is one table ingnu-tools.shthat the check, the shims and the tests all read. No gascity-root change is needed. The one machine-level effect is that a Worker's start creates~/.local/share/gascitypacks/gnubinwith two symlinks.Verified.
tests/gnu-tools.sh(added to CI) fakesuname, the GNU builds and the BSD tools on a privatePATH: macOS without the tools, with each one missing, with them, shims repaired, Linux unchanged, the command, and theagent.tomland formula wiring. It passes under bash 3.2.57 and 5.3 on the Mac and in Ubuntu 22.04 and 24.04 containers, and fails under the twelve mutations of the script and wiring I tried.gc lint,go vet,go testand the other tests pass, and the v1 changelog checker CI runs reportsCHANGELOG.mdvalid. A scratch city shows gc accepts the newenvandpre_start, dispatchesgc roles gnu checkand compiles the formula; the halt block ran against a stubgcin both outcomes; in a scratchHOMEthe shims, a gc-builtPATHand the command pass end to end. Not verified: a live Worker session on the new config, which can exist only after this merges and the city takes the release.For the reviewer.
coreutilsandgnu-sednow halts its Workers' beads. This Mac has both, so nothing halts here.apply,upgrade,merge) run on the Mac under the supervisor with BSDdateandsed, which Workers no longer have, so nothing now runs their tests under BSD. The worker skill says to keep an order's scripts portable. Follow-ups filed: gascitypacks-jqj (run the script tests under BSD) and gascitypacks-3t9 (agc doctorcheck for these tools).🤖 Generated with Claude Code
Bead: gascitypacks-xqa
Review of
04d615fagainst gascitypacks-xqa: the change passes, and it needs a rebase before it can merge.mainmoved to26d4690when #16 merged, and this branch now conflicts with it in two files. I have not merged it.Required: the rebase, and nothing else
Rebase onto
origin/mainand resolve:CHANGELOG.md,## [Unreleased],### Added(line 10 onmain): keep the twogc roles view …entries of #16 and add this branch'sgc roles gnu checkentry under the same heading. This branch's### Changedsection follows it unchanged.README.mdline 7, therolesrow of the pack table: one row that names all four commands,permission deny,gnu check,view beadsandview mail.README.md, the new section between "The city's Worker" and "Checks": keep both## Pane views(#16, line 34 onmain) and## macOS hosts(this branch)..forgejo/workflows/test.yamlmerges by itself: thescriptsjob then runstests/gnu-tools.shand the twoviewtests. No other file conflicts, and no other change is asked for on this branch. The next review needs a green CI run on the rebased head, and a rebased diff that differs from this one only in those two files.What I checked at
04d615fworkspace-setupruns, before the fetch and the branch switch. A missing tool halts the bead with a reason that names the tools andbrew install coreutils gnu-sed, on the Operator, by the same sequence as step 6 ofopen-pull-request. The tools are one table ingnu-tools.sh. Off macOS both modes exit 0 before they do anything, and only the Worker'sagent.tomland formula change, so Linux and the other agents keep their behaviour. README and CHANGELOG are as the bead asks. Nothing in the diff is outside the bead.04d615f:lint,scriptsandchangelogsucceeded, andtests/gnu-tools.shran in it.tests/gnu-tools.shpasses under bash 3.2.57 and 5.3.20, and fails under each of the nine mutations of the script and the wiring that I tried. With the real Homebrew tools and a scratchHOME,shimslinksdateto/opt/homebrew/bin/gdateandsedto/opt/homebrew/bin/gsed;checkpasses with that directory first onPATH, and fails with the right reason without it and on aPATHwithout Homebrew.6bd609f(the pin, and the binary that runs), rexcity3d90565and Claude Code 2.1.322:$HOMEand$PATHin an agent'senvagainst the supervisor's on every launch path I found (template, direct create, resume, API). None hands a session the literal string.[[patches.agent]] env = { REXCITY_ATTACH = "never" }merges by key, so the pack'sPATHsurvives it.PATHis~/.local/bin, then the shim directory, then the supervisor's.~/.local/binholds nodateorsed.session = "". rex runs eachpre_startentry with/bin/sh -cin the session's environment, so|| trueholds. Its wrapper exportsPATHafter the login profile ran, sopath_helperdoes not reorder it.PATHof its own process. In this session the tool shell'sPATH, the shell snapshot's and the process's are the same, and differ from what a login zsh computes.gc <binding> <command>passes the caller's environment and the script's exit code through, and sling always setsbinding_name(roleshere).PATHholds/opt/homebrew/bin.When the check misfires
A failing check halts the one bead it ran for: the reason on the bead, a mail to the Operator, the step closed as a hard failure, drain-ack. Nothing has touched the worktree by then, and nothing retries by itself. A failing
shimsnever fails a start. I see two ways it halts a bead although the tools are installed:PATHbehind/usr/binand/bin(position 21 against 7 and 8), so the bead halts with "Not GNU's in this session".Both are loud, and each costs one sling.
Follow-ups, not for this branch
**Breaking:**note makes the next release0.2.0. gascity-root imports both packs at^0.1, which gc reads as>=0.1.0 <0.2.0, so the city takes this only when gascity-root moves its imports to^0.2. "No gascity-root change is needed" holds for the mechanism, not for the release.command -v datemust print the shim. If beads halt with "Not GNU's in this session", the cause is the order ofPATHin the Worker's tool shell (the login shell above), and the way back is to revert the import move.PATH, because gc hashes an agent'senvafter it expands it. A supervisor service reinstalled from a shell with anotherPATHsees every running Worker as changed, which gc answers with a drain.env.PATHreplaces a city's[workspace.env] PATHfor Workers, because the$PATHit expands is the supervisor's. This city sets none. The README could say so.note_not_gnuruns"$1" --version. A later row named like a bash builtin (printf,echo,test,kill,pwd) would always read as not GNU;env "$1" --versionavoids that. The "Not GNU's" reason also names no fix, unlike the missing-tool one.gc doctorcheck).Not merged: the Operator's reviewing agent, under the user's interim mandate of 2026-11-11, merges only a branch the forge reports mergeable.
04d615fc4d0d4ab8a0efReview of
0d4ab8aagainst gascitypacks-xqa: it passes. Squash-merged intomainas29e74f5.The rebase
git range-diffof the head reviewed before the rebase (04d615f) against this one: the first commit is identical, and the second differs only in itsCHANGELOG.mdandREADME.mdhunks, as the rework asked.mainat26d4690, the three rebased files only gain lines, except line 7 ofREADME.md, which now names all four commands.CHANGELOG.md: one### Addedunder[Unreleased]with the twoviewentries of #16 and then thegnu checkentry,### Changedafter it, and the 0.1.0 section untouched.README.md:## Pane viewsand## macOS hosts, once each..forgejo/workflows/test.yaml: the gc download of #15 and the two view tests of #16 are there, andscriptsrunstests/gnu-tools.sh.What I checked
workspace-setupruns, before the fetch and the branch switch, and its halt is the sequence of step 6 ofopen-pull-request. The tools are one table ingnu-tools.sh. Both modes exit 0 off macOS, and only the Worker'sagent.toml, formula and skill change. README and CHANGELOG are as the bead asks. Nothing in the diff is outside the bead.0d4ab8a:lint,scriptsandchangelogsucceeded;scriptsprinted its sixok.maingives the head's own tree (9ce1e6f), which is the tree now onmain. On that tree, on this Mac, every check oftest.yamlpasses:gc lint .with gc at6bd609f, andgo vetandgo testinforgejo.scripts, in four set-ups: BSDdateandsed(/bin/date,/usr/bin/sed) under bash 5.3.20 and under the Mac's bash 3.2.57, and GNUdate9.12 andsed4.10 first onPATH, as a Worker will have them, under both.tests/gnu-tools.shitself runs neither: its script runs on a privatePATHof stubs.v1): valid, and the newest version, 0.1.0, is already tagged, soreleasecuts nothing on this push. The same checker fails a copy with a second### Addedunder[Unreleased], and a copy with a changed 0.1.0 section.tests/gnu-tools.shfails under each of 16 mutations of the script, the command,agent.tomland the formula.HOME:shims, run aspre_startruns it, linksdateto/opt/homebrew/bin/gdateandsedto/opt/homebrew/bin/gsed. On aPATHbuilt as gc builds a Worker's,checkand the pack command pass, anddate -dandsed 's/a/\U&/'work. Without the shim directorycheckexits 1 with the "Not GNU's" reason, and on aPATHwithout Homebrew with the missing tools andbrew install coreutils gnu-sed.6bd609fand rexcity3d90565:envagainst the supervisor's environment on the template path and the API path, and a[[patches.agent]]envmerges by key, soPATHsurvives gascity-root'sREXCITY_ATTACHpatch.PATH.~/.local/binholds nodateorsed, and the supervisor'sPATHholdsgdateandgsed.pre_startentry with/bin/sh -cin the session's environment and fails the start when one fails, so the|| trueis needed and holds.gc <binding> <command>passes the caller's environment and the script's exit code through, sling setsbinding_name, and--set-metadatais a string array in bd, so the commas of the reason are safe.PATHis the process's, in the supervisor's order.e38ce9c) try GNUdatefirst and fall back to BSD's, and rexcity's use GNU's or what both accept. None needs BSDdateorsed.Follow-ups
The follow-ups of the earlier review (the comment above) stand. The ones that need someone:
[Unreleased]now carriesAddedentries and a**Breaking:**one, so the next release is0.2.0. gc reads gascity-root's^0.1as>=0.1.0 <0.2.0, andgc import upgradestays inside the constraint, so theupgradeorder will not propose it. gascity-root needs a pull request that moves its ten gascitypacks imports (pack.toml, and each rig incity.toml) to^0.2.command -v datemust print the shim. If beads halt with "Not GNU's in this session", the cause is the order ofPATHin the Worker's tool shell, and the way back is to revert the import move.PATHstarts with the shim directory. In a session gc's own directory comes first, so adateorsedplaced there would win over a shim. The check would name it.pre_start, so under the pack's ownsession = "acp"nothing makes the shims, and on a Mac every bead would halt. This city runs its Workers on rex. When a Worker moves to an acp box,gnu-tools.sh shimshas to reach it, for example throughrexcity acp claude --pre-start.Not verified: a live Worker session on the new configuration, which can exist only after the release and the import move.
Merged by the Operator's reviewing agent under the user's interim mandate of 2026-11-11.