carlos / platform Public

plan: Task 3 review brief

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
claude agent, operated by paul@keymail.dev pushed by paul@keymail.dev 9d7e9dd350ea94d357e8ee6d8437df4df8e10241 parent 3ab5be8
1 file changed, +45 −0
  • docs/superpowers/plans/CODEX-REVIEW-BRIEF-cli-registry-words-T3.md +45 −0

Intent

Human

<task-notification> <task-id>a0791a0304085c183</task-id> <tool-use-id>toolu_01SvwCqXHkkHFmZNwQdwLioy</tool-use-id> <output-file>/home/paulca/.cache/tmp/claude-1001/-home-paulca-amadan-net-carlos-platform/27979b8d-cc90-4f50-88f6-87ba41433627/tasks/a0791a0304085c183.output</output-file> <status>completed</status> <summary>Agent "Implement Task 3 golden corpus" finished</summary> <note>A task-notification fires each time this agent stops with no live background children of its own. The user can send it another message and resume it, so the same task-id may notify more than once.</note> <result>Task 3 is done and committed as **3ab5be86** (`cli: golden corpus recorded from the base binary`). A `packed-refs.lock` error printed, but `git log -1` shows the commit on `cli-registry-words`. Replay passes with zero differences, and `TestCommandTreeIsValid`, `TestCLIProjection`, the two new generator/normaliser unit tests, `go vet .` and gofmt are all clean. With `-short`, `TestCLIGolden` skips. **Files** - `/home/paulca/amadan.net/carlos/platform/.claude/worktrees/cli-registry-words/clireg_golden_test.go`: the case generator, the runner, record and replay, and a generator unit test on a small tree with an alias, a named default, an unnamed default, a transparent word, a `When` node, a `Skip` node and a `SkipBare` branch. - `/home/paulca/amadan.net/carlos/platform/.claude/worktrees/cli-registry-words/testdata/clireg-golden.jsonl` - `/home/paulca/amadan.net/carlos/platform/.claude/worktrees/cli-registry-words/commands.go`: a `skipGolden` helper and two skips. **Cases:** 155 in total, 9 skipped. Seven are the `__` plumbing and shim words that were already skipped. The other two are new `Golden.Skip`s, both reported below. **Run times** - Record from 7f4bdf3a3674f1794241aab961f9c9b2a585036a: 19.5 s wall, 17.4 s test time. That covers the `git archive` and build plus every case run twice. - Replay: 7.3 s wall, 5.4 s test time. - No case came near the 10 s limit. The determinism check passed, including `secrets -h` and `secrets --zz-unknown-flag`. **New skips in commands.go** - `agent` (`commands.go:177`, was `SkipBare`): even `agent -h` starts the agent before it reads its arguments. It prints a lease-lock line containing its pid, so the output also changes from run to run. - `adopt` (`commands.go:179`, was `SkipBare`): even `adopt -h` opens root's release state and claims before reading its arguments. It ends in `adopt: permission denied`, which is an attempt on a path outside the case directory. **Fail demo:** I changed `usage: carlos &lt;command&gt; [flags]` to `[FLAGS]` in `main.go:62`, replayed, then put it back with `sed`. No checkout or restore was used. The replay failed on 12 cases, for example: ``` clireg_golden_test.go:554: case "&lt;root&gt; | --help": stdout: line 1: want "usage: carlos &lt;command&gt; [flags]", got "usage: carlos &lt;command&gt; [FLAGS]" clireg_golden_test.go:557: case "&lt;root&gt; | bare": stderr: line 1: want "usage: carlos &lt;command&gt; [flags]", got "usage: carlos &lt;command&gt; [FLAGS]" clireg_golden_test.go:554: case "help | -h": stdout: line 1: want ... FAIL github.com/carlosframework/platform 4.850s ``` **Absorbing-default audit** I ran the base binary on every generated case inside `bwrap` with the whole filesystem read-only except the case directory. I also ran bare, unknown-word, `-h` and unknown-flag for `instances`, `channels`, `releases`, `canary`, `move`, `pipeline`, `email events`, `version` and `secrets`. Apart from `adopt`, nothing tried to write outside the case directory, nothing timed out, and nothing left files behind. - `instances` (bare or a word) fails at `$DIR/data/registry.db`, inside the case directory. - `channels`, `releases`, `pipeline` and `email events` exit 1 with "no deployment target configured" and never reach the network. - `canary &lt;word&gt;` exits 1 with "not in a git repository". It runs git, which walks up from the working directory, so the result relies on the case directory not being inside a repo. - `move` exits 2 with "needs --host". - `version` prints `carlos dev` for every form. One finding: if a case directory sits under `$HOME` (as `$TMPDIR` does here), the CLI's config lookup finds the real `~/.carlos/config` and the output changes ("not logged in to https://console.carloku.com"). The test is only isolated because `TestMain` moves the temp root to `/var/tmp`. I added a check that makes the test stop if a config file sits above the cases' directory (`clireg_golden_test.go:358`). **Decisions the plan didn't settle** - **Switches for `When` nodes** (`clireg_golden_test.go:43`): the generator can't read a node's switch from its `When` func, so a test-side map `goldenWhenEnv` holds it, keyed by node ID. It holds `ops host` → `CARLOS_HOST_CLAIM=1` today, and a `When` node missing from it is an error. Only the `When` node gets on and off cases; the nodes below it run with the switch on. - **Case keys** (`clireg_golden_test.go:88`): each key is `&lt;typed words&gt; | &lt;kind&gt;`, `&lt;root&gt;` when there are no words. Alias cases use the alias spelling (`-h | -h`); `When` cases get ` (when on)` or ` (when off)` appended. A skipped node gets one `&lt;id&gt; | skipped` line, and a `SkipBare` gives a skipped `| bare` line. An unnamed default's cases are the same as its branch's, so they are written once. Aliases spell only the node's own cases, not the cases of everything below it. - **Leaves get no bare case**, as the plan says. So `SkipBare` on today's top-level leaves (edge, bootstrap, `instance-*`) has no effect yet. - **`TMPDIR=&lt;case dir&gt;/tmp`** (`clireg_golden_test.go:310`). HOME and the working directory are the case directory itself. - **argv[0] is set to `carlos`** (`clireg_golden_test.go:327`), so a usage line that names the binary reads the same from both builds. This controls the input, not the output, so the "normalise only two things" rule still holds. - **The base build directory** (`clireg_golden_test.go:466`) is made with `os.MkdirTemp("")`, so inside the test it lands in TestMain's moved temp root (`/var/tmp/carlos-test-*`, on disk) rather than the session's `$TMPDIR`. It is never `/tmp`, and a `t.Cleanup` removes it. - **`argv` is left out of the JSON when empty** (`clireg_golden_test.go:267`), so the root's bare line has no argv field. Replay treats a missing argv as an empty one. I removed my scratch (the audit binary and scripts under `$TMPDIR` and `/var/tmp`). No processes are left running.</result> <usage><subagent_tokens>137144</subagent_tokens><tool_uses>36</tool_uses><duration_ms>515309</duration_ms></usage> </task-notification>

Attributed to this commit: 17.0 g CO₂e (2,064,669 tokens). This is an attribution, not a measurement — usage counted from this commit's own marker forward to the next one on cli-registry-words, never backward from it. A turn that produced more than one commit books all of its tokens to the last one, and a concurrent session on this branch can add to the same figure. Some of it was priced using the shared default rate, because no model-specific factor row exists yet for at least one model involved. The Carbon view has the repo total, which is never derived from this attribution.

diff --git a/docs/superpowers/plans/CODEX-REVIEW-BRIEF-cli-registry-words-T3.md b/docs/superpowers/plans/CODEX-REVIEW-BRIEF-cli-registry-words-T3.md
new file mode 100644
index 000000000..e30125d88
--- /dev/null
+++ b/docs/superpowers/plans/CODEX-REVIEW-BRIEF-cli-registry-words-T3.md
@@ -0,0 +1,45 @@
+# Review brief: CLI registry step 1, Task 3 (golden corpus), round 1 of 3
+
+Repo carlos/platform, branch `cli-registry-words`. Under review: the diff
+`e7c1c945..3ab5be86` (`clireg_golden_test.go`, `testdata/clireg-golden.jsonl`, `commands.go` skips).
+Authorities: `docs/superpowers/specs/2026-11-09-cli-registry-design.md`
+(rev 5, merged on main), sections A2, A6, A8 and B1 "Errors"; the plan's
+Task 1 (`docs/superpowers/plans/2026-11-09-cli-registry-words.md`) and its
+Interfaces block, which later tasks consume.
+
+You are an independent reviewer. Read the diff, then the spec and the
+plan, and check the code against them.
+
+## What to check
+
+1. Is the corpus deterministic and isolated (spec E1, plan Task 3 Steps
+ 2-3b): empty environment plus the listed variables, CARLOS_DATA_DIR,
+ symlinks, the closed proxy, argv[0], 10 s limit failing, recording
+ twice? Can a case read or write anything outside its directory (the
+ config walk-up above the case dir; git walk-up for canary)?
+2. Would replay catch a changed exit code, stream or message in any
+ dispatcher converted later (Tasks 4-7)? Is the normalisation (log
+ timestamp, case dir) too broad?
+3. Does the generator cover what spec E1 lists: branch bare/help/-h/
+ --help/unknown word/unknown flag, leaf -h/unknown flag, aliases,
+ transparent words, When on and off? Are the skips justified (agent,
+ adopt, plumbing)?
+4. Is the base build (git archive of 7f4bdf3a, built in a temp dir,
+ removed) sound, and does the file format replay exactly?
+
+## Severity
+
+- **P1**: unsafe, would not compile, a test fails, or it would not work.
+- **P2**: wrong or missing. Fixed without reopening this review.
+- **P3**: clarity or polish; never a reason for another round.
+
+A P1 states its failure scenario and the evidence (file:line).
+
+## Output
+
+Findings ranked P1, P2, P3, each with evidence, failure scenario, fix and
+fault family. End with exactly one verdict: READY, READY AFTER FIXES (no
+P1), or NOT READY (P1s listed).
+
+Do not edit files. Do not spawn Anthropic-model reviewers or subagents of
+your own. Do not run the full test suites.