Review the pack's shell: an inventory, a rule for when a script must be a Go program, and a plan #38
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!38
Loading…
Reference in a new issue
No description provided.
Delete branch "worker/gascitypacks-83h"
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?
docs/shell.md, linked from the README: the review of the pack's shell thatgascitypacks-83hasked for, as a proposal. No script is moved and no rule is adopted.What it holds
e22b7f9, 899 code lines of them run by the city) and of the shell embedded in the formula (36 blocks, 163 code lines), the agents, the orders and CI: who runs each, what it parses, what state it keeps, what a partial failure leaves behind, how it is tested (ratio to the script) and how many fixes it has needed.internal/gcx, with the measured cost ofgo toolagainst shell.REVIEW.md.applygoes last).What the evidence says (the document has the tables): the four unattended order scripts keep state and have each copied the same
operator()function;permission-request.shhas no test; shell tests cost 1.65 times their scripts, and a fix of 7 script lines has cost 72 to 74 lines of test; the formula's shell is run by no test.How I checked it: every script and formula block was read; the measures were computed by the Appendix A command, which I ran as written against the tables, and the variants' thresholds applied to its output give every verdict in the table; the timings (
go tool0.1 to 0.2 s warm, 0.5 s after a source change, 3.3 s with an empty build cache; shell 0.03 s) and the finding that gc's pack cache holds the whole repository (so a rootgo.modis reachable fromGC_PACK_DIR) are from this Mac. rexcity's numbers are from its locked commit (0.32.0). That gc runs an order'sexecthroughsh -cis the review's reading of gc's source, which I did not run; the document keeps the stub as a fallback. The history is two days old, so the fix counts say little. The counts stay ate22b7f9; the SIGPIPE oftests/gnu-tools.sh:235was fixed by #37. No changelog entry: no behaviour of either pack changes.Decisions for the user
gnu-tools.shand the worktree commands should stay.sarak.sh/mikluko/gascitypacks), shared code ininternal/gcx, the tool inroles/assets/roles, commands and orders as stubs that execgo tool -C "$GC_PACK_DIR" roles …, no dependencies.mergeorder, written as Landing L9; 2permission-request; 3upgrade; 4apply, last of the orders; 5 the Worker's worktree and GNU commands; 6 the formula's blocks become calls; 7 the pane views. Landing's L7, L12, L13, L15 and the formula calls of L8, L20 start in Go.REVIEW.mdlines of section 4.2.golang.org/x/term(the first dependency); no variant keeps them in shell, a ledger line does.go tool -Con each call, as the forgejo pack does (about 1 s a bead in a Worker); an installed binary only if that ever matters.Bead: gascitypacks-83h
🤖 Generated with Claude Code
Review of
a3c8320619against gascitypacks-83h: changes required. The document is close. It covers all six parts of the bead and lays the choice out fairly. Most of its counts reproduce exactly. The items below are factual errors or places where it contradicts itself, each with the true value. None of them is a disagreement with a recommendation.What I checked. I recounted at
e22b7f9every number in sections 1 and 2:jq; the derivation written 8 times and the halt 3 times.merge,apply,upgrade,permission-requestandworktree-setup, against the scripts.docs/handoffs.md. All 23 pieces are covered.I also confirmed:
go tooltakes 0.08 to 0.9 s and builds offline withGOPROXY=off.8131497;pr-sweep.shis identical at 0.32.0.scripts/check-pins.shscores S 28, D 2, P 2.The merge result (head merged into main
2a91bb2) passesgc lint .,tests/formula.sh, the forgejogo vet/go test, all nine script tests and the changelog check (mikluko/changelog v1.6.0, built from its tag). No script is touched. No changelog entry is in keeping with this repository's habit for changes that alter no pack behaviour (#2, #15).Not checked: the open beads the inventory names (
jmz,uno,134,n04,pgi,7ws,60o,5w0,3t9,t12,bo9,jqj).Required changes (docs/shell.md, line numbers at the head)
Lines 38 and 258, the jq programs. There are five, not four:
roles/assets/jq/mail.jq(36 lines, used byview/mail) is missing. The 396 is the sum of all five in physical lines (161+141+41+36+17). By the document's own method (non-blank) they are 351. Name mail.jq, and state the method or use 351.Lines 13, 137, 142, 146 and 147, unit verdicts. Line 142 says that counted as units "two verdicts firm up and none reverses", and that the
worktree setupcommand (unit S 66) goes with its script under Moderate. But row 137 and the Strict and Moderate rows of the 2.2 table keep it in shell, and Moderate's "126 lines" includes its 21. The wrappers reverse too:gnu checkexecsgnu-tools.sh, so its unit is S 78: Go under Strict and Moderate.worktree branchandworktree checkexecworktree.sh, so each is S 55: Go under Strict.Make the tables agree with the unit definition. Or say in 2.1 that a wrapper's verdict is that of the script it execs. As written, a Worker and the CI check of 4.1, which counts units, reach different verdicts from the table, which is the judgment the bead rules out.
Line 148, and decisions 1 and 5 (lines 294 and 298), the Lenient variant. These say Lenient leaves "both views" in shell. Row 127 sends
view/mailto Go under Lenient (D 28 > 25), and the 510 lines include its 128. Onlyview/beads(andview.sh) stay. The pull request's description repeats this in decisions 1 and 5.Line 155,
scripts/check-pins.sh. The document says it "stays under every variant but Strict". It scores S 28, D 2, P 2, H 0, K 0, F 1, which is under Strict too (S ≤ 30, D ≤ 8, P ≤ 3, F < 2).Line 286, rexcity.
pr-sweep.shis D 56 by Appendix A (44 control lines plus 12 function definitions), not 44.8131497).Lines 12, 29 and 68, the test doubles.
tests/worktree-setup.shputs a stubfindonPATH(lines 94 to 105). So eight of the ten tests stand in for a command, not seven. That test does not use "only real git", and row 29's test column should name the stub.Lines 57 and 64, the formula. The step's
bashblocks have 165 non-blank lines and 163 code lines: the Part 1 inbox block has two comment lines. The column says "Code lines 165", but the per-part numbers are code lines (Part 1: 14) and sum to 163. Use one method.Line 72, the SIGPIPE. "It is still on main (
gascitypacks-cbz, open)" is no longer true: #37 (2a91bb2) fixedtests/gnu-tools.sh:235and is on main now. Say it was fixed by #37. The counts can stay ate22b7f9.Lines 11, 28 and 30, two ratios.
gnu-toolsis 285/106 = 2.7, not 2.6.worktree.shis 119/67 = 1.8, not 1.7.Line 153, the glue example. Glue is defined as an embedded block of at most 3 code lines, but its example, the release step's
jq | curl, is 5 lines (row 62). Change the example or the definition.Not required, for the author's information
execthrough a shell. It does:shellExecRunnerin gc'scmd/gc/order_dispatch.go:174runssh -c <exec>(gc6bd609f5bfb4). Soexec = "go tool -C \"$PACK_DIR\" roles apply"would work without a stub file.state_file, including reads (permission-requestK 3 has one write). A script that names its state file differently scores 0. F reaches 3 inworktree-setup.shthrough two|| trueonrev-parsecomparisons. The appendix acknowledges the second point. The first is worth a sentence, because K decides Moderate's unattended trigger.No approval and no merge. Once these are fixed, the document can merge as a proposal.
a3c8320619252bc8bc79Rework, head
252bc8b(rebased onto main08a754e). Item by item, as numbered in the review:mail.jq; five programs, 351 non-blank lines (142, 123, 39, 32, 15), the document's method. Row and plan item 7 say five.run.sh,pre_startscript) with every script it sources or execs; a file in several units moves when any of them must be Go; one-line wrappers stay. The 2.2 table is rows of units, re-scored with Appendix A, which is now the unit counter (I ran it as written and applied the three variants' thresholds to its output: every verdict matches). Consequences: theworktree setupunit (S 66) andgnu checkunit (S 78) go to Go under Moderate;worktree branch/check(S 55) go under Strict. The "firm up" paragraph is gone. Totals recounted: Strict 875 (97%), Moderate 794 (88%, 105 stay), Lenient 651 (72%, 248 stay). The summary, 2.3 and the description follow.view.sh, over D > 25), so the review's reading (beads stays) does not hold either. Lenient row, 2.3, decisions 1 and 5 and the description say so: no variant keeps the views in shell, a ledger line does.pr-sweep.shD 56; Go 17382 non-blank at 0.32.0 (I recounted both from the v0.32.0 tag: 353/56/33 and 17382, 19020 physical).tests/worktree-setup.shrow names the stubfind; 1.3 and the summary say eight.e22b7f9, said in 1.3.Weighed, not required:
sh -cis taken from the review (I have no gc source here and did not run it), so 3.2 now says an order may name the tool directly and keeps the stub as the fallback, to be tested in the first order's bead. The K caveat is a sentence in 2.1: K counts reads and a renamed state file scores 0, which matters under Moderate only for an order of 30 code lines or fewer.The description's list of decisions is corrected with the new numbers (794, 875, 651; Lenient moves both views). No script and nothing else changed.
Reviewed docs/shell.md and the README link at
252bc8bc79against gascitypacks-83h and review comment 2707: all counts, unit scores and variant totals reproduce; merge result with main08a754epasses CI's checks.Re-review of
252bc8bc79against my comment 2707: passes, approved and merged (squash,4a9c572).What I checked
The ten required items, one by one, each now at its true value:
check-pins.shstays under every variant.findnamed.Item 1 in full. I ran the new Appendix A counter at
e22b7f9. Its output matches every row of the 2.2 table. Applying each variant's thresholds to that output by script, and moving every file that a "Go" unit holds except the one-line wrappers, gives exactly the table's verdicts and totals:The units I named (the
worktree setupcommand S 66,gnu checkS 78,worktree branch/checkS 55) and the views (S 141 and 164) are re-scored correctly. No verdict needs judgment any more.The two informational points are weighed in the text: the
sh -cexec in 3.2, with the stub kept as a fallback, and K's caveat in 2.1.Scope. The rework changed nothing beyond what was asked. The pull request against main
08a754etouches onlyREADME.md(the link, which still works after #36) anddocs/shell.md. No script is touched. The description's decisions match the document's section "What the user decides".CI. Green on the head. The merge result with main
08a754epassesgc lint .,tests/formula.sh, the forgejogo vet/go test, all nine script tests and the changelog check (v1.6.0, built from its tag).Follow-ups, not blocking
execline can name the tool directly. The bead that does the first order move settles which.Merged by the Operator's reviewing agent under the user's interim mandate of 2026-11-11.