carlos / platform Public

plan: Task 1 review brief

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
claude agent, operated by paul@keymail.dev pushed by paul@keymail.dev 99685b9489b00f4186181c8d8f7402196c925b9e parent fb0bba0
1 file changed, +46 −0
  • docs/superpowers/plans/CODEX-REVIEW-BRIEF-cli-registry-words-T1.md +46 −0

Intent

Human

<task-notification> <task-id>af54ac42ca43b7269</task-id> <tool-use-id>toolu_01A3xnBPeYyPUy4ZWUCdXo7Y</tool-use-id> <output-file>/home/paulca/.cache/tmp/claude-1001/-home-paulca-amadan-net-carlos-platform/27979b8d-cc90-4f50-88f6-87ba41433627/tasks/af54ac42ca43b7269.output</output-file> <status>completed</status> <summary>Agent "Implement Task 1 clireg core" 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 1 is committed as `fb0bba0d3601780fd06ee0f8197f0a0f36ec1888` on `cli-registry-words`, with subject `clireg: node tree, walk and Validate (CLI registry step 1)`. git printed the "packed-refs.lock" error, but the branch and HEAD both point at the commit and the tree is clean. `go test ./internal/clireg/ -v` and `go vet ./internal/clireg/` pass, and `gofmt -l internal/clireg` prints nothing. The package imports only `fmt` and `strings`. **Files** (all new, in `/home/paulca/amadan.net/carlos/platform/.claude/worktrees/cli-registry-words/internal/clireg/`): `clireg.go`, `dispatch.go`, `validate.go`, `dispatch_test.go`, `validate_test.go`. **Tests, all passing:** - `TestDispatchWalk`: 21 rows. They cover every case in the plan, plus `instances create a`, bare `canary`, bare `config destinations`, `system router nope`, bare `system` and a root fallback. Each row also checks `ID(Dispatch(...))`. - `TestDispatchRawIsUnchanged` - `TestDispatchOnError`: the nearest handler is called, including through nested branches, and a leaf that returns nil calls nothing. - `TestDispatchErrorWithoutOnErrorPanics`: the panic message names the ID. - `TestRawArgs` - `TestRunnable` - `TestValidate`: 18 negative fixtures, one or more per rule in spec A8, each checking that an error starts with the node's ID. - `TestValidateInternalWord`: `__demo-snapshot` with the internal audience is accepted. - `TestValidateWalkFixture`: the walk fixture returns no errors. - `TestValidateReportsEveryError` Every test passed on its first run, so I checked that the walk table catches a real bug. Removing the "drop a transparent word only once per level" line made `system router router` fail, and I put the line back. `go vet` and `go test` could not write to `~/.cache/go-build` inside the sandbox ("read-only file system"), so I ran them with the sandbox off and `GOCACHE` at its default. Nothing was written to `$TMPDIR` or `/tmp`. **Decisions the plan and clarifications did not settle:** 1. **Audience constants are all typed.** The plan's block, as written, would make `Operator`, `BoxLocal` and `Internal` untyped strings. All four are now typed `Audience`; the names are unchanged. 2. **What Dispatch returns.** Transparent nodes are left off the returned path. An unnamed `DefaultLeaf` is on it, so its `NoUpdateHint` counts. `ID` skips the root, transparent nodes and a branch's `DefaultLeaf`, so `ID(path)` is always the canonical ID. 3. **Words recorded in `consumed`.** It holds canonical names, including for transparent nodes (`router`), not the alias the user typed. 4. **One Validate rule is stricter than the spec.** The spec only refuses a branch with neither a default nor a `Fallback`. I also refuse a branch whose `DefaultOn` doesn't admit absent, flag and word but has no `Fallback`, because at runtime that case has nowhere to go. 5. **Extra Validate checks.** `Default` must name a leaf child. A `DefaultLeaf` must be a leaf with an `Audience`, and the `__` prefix check for `Internal` applies to the branch's name. A child with no name and a nil child are refused. Duplicate checks include transparent siblings' names, and an alias that repeats the node's own name is ignored. 6. **Not checked in Validate.** I did not refuse a nonzero `DefaultOn` with no default. Validate also cannot tell statically whether a leaf will return an error with no `OnError` above it, so the panic in `Dispatch` is the only guard for that. 7. **Order of default entries in Runnable.** A branch's unnamed default comes before its children (`instances (default)`, then `instances create`). The root's `DefaultLeaf`, if it ever has one, produces no entry. 8. **Runtime panics.** `Dispatch` panics, naming the ID, if a branch has no match, no applicable default and no `Fallback`, or if `Default` names a missing or non-leaf child. These are runtime backstops for what Validate refuses. 9. **`Invocation.Raw`** shares the caller's array, is never modified, and is an empty slice rather than nil when no arguments remain.</result> <usage><subagent_tokens>72528</subagent_tokens><tool_uses>19</tool_uses><duration_ms>214885</duration_ms></usage> </task-notification>

Attributed to this commit: 7.87 g CO₂e (948,049 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-T1.md b/docs/superpowers/plans/CODEX-REVIEW-BRIEF-cli-registry-words-T1.md
new file mode 100644
index 000000000..27a2cae16
--- /dev/null
+++ b/docs/superpowers/plans/CODEX-REVIEW-BRIEF-cli-registry-words-T1.md
@@ -0,0 +1,46 @@
+# Review brief: CLI registry step 1, Task 1 (clireg core), round 1 of 3
+
+Repo carlos/platform, branch `cli-registry-words`. Under review: the diff
+`fb0bba0d^..fb0bba0d` (`internal/clireg/`).
+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. Does `Dispatch` implement A2 exactly: words only; every remaining
+ argument passed unchanged; aliases; `When`; transparent words (once
+ per level, recorded in `consumed`); `Default`/`DefaultLeaf` with
+ `DefaultOn` (absent, flag = starts with `-`, word); `Fallback(args,
+ consumed)`; `OnError` nearest on the path? Any argv shape where it
+ consumes, drops or reorders an argument is a P1.
+2. Does `Validate` refuse every A8 case, and refuse nothing a real
+ dispatcher in the audit (`docs/superpowers/notes/2026-11-09-cli-dispatch-audit.md`)
+ will need? The implementer added a stricter rule (a branch whose
+ `DefaultOn` does not cover all three cases needs a `Fallback`): is it
+ right?
+3. `Runnable` and `ID`: will the projection (one line per leaf and
+ unnamed default) and the parity guard built on it see every
+ dispatchable path, with no duplicates?
+4. Do the tests pin the behaviour, or would a plausible bug pass?
+
+## 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.