carlos / platform Public

spec: CLI registry rev 5, Astra round 3 P2s (READY AFTER FIXES)

channels digests kept raw; system files is box-service; mixed qualifiers
checked per component. Round 3 findings beside the spec. Review closed.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
claude agent, operated by paul@keymail.dev pushed by paul@keymail.dev 27a87d53badbf134359175ae4fe5332f5630e908 parent 5c97104
2 files changed, +72 −10
  • docs/superpowers/specs/2026-11-09-cli-registry-design.md +32 −10
  • docs/superpowers/specs/CODEX-FINDINGS-cli-registry-R3.md +40 −0

CI cancelled — superseded by a newer push — run details

Intent

Human

<task-notification> <task-id>b13rxxx0y</task-id> <tool-use-id>toolu_01Qfi6i9i1URV2GZtGeacPBU</tool-use-id> <output-file>/home/paulca/.cache/tmp/claude-1001/-home-paulca-amadan-net-carlos-platform/27979b8d-cc90-4f50-88f6-87ba41433627/tasks/b13rxxx0y.output</output-file> <status>completed</status> <summary>Background command "Verify commits; wait for Astra round 3" completed (exit code 0)</summary> </task-notification>

Attributed to this commit: 12.3 g CO₂e (1,481,182 tokens). This is an attribution, not a measurement — usage counted from this commit's own marker forward to the next one on design-cli-registry, 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/specs/2026-11-09-cli-registry-design.md b/docs/superpowers/specs/2026-11-09-cli-registry-design.md
index fb622746c..10be6714d 100644
--- a/docs/superpowers/specs/2026-11-09-cli-registry-design.md
+++ b/docs/superpowers/specs/2026-11-09-cli-registry-design.md
@@ -1,6 +1,8 @@
# The CLI command registry (slice 4, project 1 of 3)
-Status: rev 4, 2026-11-09, for review (Astra round 3 of 3, the last). Rev 2
+Status: rev 5, 2026-11-09. Astra round 3 of 3 (`CODEX-FINDINGS-cli-registry-R3.md`):
+READY AFTER FIXES, no P1; its three P2s are applied in rev 5, marked
+**(R3b-N)**. Review closed. Rev 2
applied the builder check (fresh Sonnet reading spec and code; points
marked **(builder N)**). Astra round 1 (`CODEX-FINDINGS-cli-registry.md`,
NOT READY: two P1s in the CLI enumeration family, three P2s) hit stopping
@@ -130,8 +132,9 @@ them and commands whose deciding word follows flags (`steering --app a
spec claims no mechanical proof for words inside handlers. Words the
walk dispatches are fully enumerated by construction.
- **The one exception: root-run dispatchers (R2-2).** A dispatcher that
- runs as root on a box (`Auth: box-root`) and does shared work before
+ **The one exception: box plumbing dispatchers (R2-2, R3b-2).** A
+ dispatcher that runs on a box as root (`Auth: box-root`) or as the
+ `carlos` service user (`Auth: box-service`) and does shared work before
it reads its word, or reads its word together with its arguments,
stays one `raw` leaf, and its word is an enum positional (A4) rather
than a set of nodes, so its order of checks and every error it prints
@@ -141,8 +144,9 @@ them and commands whose deciding word follows flags (`steering --app a
enum `apply|recover|console|edge`), `system group-maintenance`
(`maintenanceArguments` validates word and arity together and prints
its help with exit 2, `group_maintenance_verbs.go:54`), `system files`
- (signal context and cleanup budget set before the word,
- `claimfilesseed_command.go:49`), `system host-env` (the `--group`
+ (`Auth: box-service`: it refuses root and requires the `carlos` user,
+ `claimfilesseed_command.go:79`; signal context and cleanup budget set
+ before the word, `claimfilesseed_command.go:49`), `system host-env` (the `--group`
pre-scan, `internal/hostenv/cli.go:38`) and `system named-units`
(word and arity in one check, `unitops.go:96`). Their parity rows name
the leaf (`system guard-exec`, as `parity.tsv:225` does today) and may
@@ -193,14 +197,21 @@ them and commands whose deciding word follows flags (`steering --app a
`DefaultOn` set is copied from the audit row, and the golden corpus (E)
proves it.
4. **Words after flags are values, not nodes.** A word a leaf reads after
- parsing its flags (`steering ... latency|off`, `channels digests
- on|off`, `env exec-delivery file|off|inherit`, `instances set-assets
+ parsing its flags (`steering ... latency|off`, `env exec-delivery file|off|inherit`, `instances set-assets
<host> on|off`, `instance-exec <role> <iid>`, `store scan enforce
on|off`, the post-flag `switch verb` in `system antivirus` and `system
layout`) is an enum positional of that leaf (B3). The leaf's code is
unchanged. Parity rows that need a row per value use a qualifier
(`steering [latency]`), which the guard checks against the declared
enum (D3).
+ **`channels digests` (R3b-1)** is the opposite shape: its `on|off`
+ counts only as the first argument, and only those two words are
+ removed before flags are parsed (`channels_digests.go:160`); a
+ trailing `on` is a stray positional and refused. It is a `raw` leaf
+ with `on|off` as an enum positional, its parser unchanged (not
+ `leading`, which lifts any non-flag word). The corpus pins
+ `channels digests on -h`, `channels digests --account-id x on` and an
+ unknown leading word followed by a bad flag.
5. **Word-first verbs whose handler is shared** (`system antivirus
status|enable|disable|rotate-webhook-key`, `system layout
status|migrate|revert`) become one child per word, each `Run` a closure
@@ -419,7 +430,8 @@ them and commands whose deciding word follows flags (`steering --app a
`risky`), `Scope` (`none` | `account` | `app` | `instance` | `fleet` |
`deployment` | `box`), `Audience` (`customer` | `operator` |
`box-local` | `internal`), `Auth` (`none` | `console-login` |
- `operator` | `box-root`), `Locality` (`api`: the command's effect is a
+ `operator` | `box-root` | `box-service`, the `carlos` service user on
+ a box), `Locality` (`api`: the command's effect is a
console API call; `local`: it reads or writes this machine, such as
`config`, `update`, `devbox`, `auth login`; `box`: it runs on a host),
`Tool` (C3). Before a leaf's args step (F), only `Audience` is required.
@@ -486,8 +498,14 @@ them and commands whose deciding word follows flags (`steering --app a
Below the top level nothing is hand-kept any more. Fixtures: removing a
leaf's row fails while its parent's row remains (the R3-2 case);
a row naming `apps source delete` fails (the R3-3 case).
-3. **Qualifiers.** A flag qualifier (`[--swap,--swap-concurrency]`) must
- name flags the leaf declares; a single-word qualifier that matches one
+3. **Qualifiers (R3b-3).** A qualifier is split on commas and each
+ component trimmed. A component starting with `-` must name a flag the
+ leaf declares (`[--swap,--swap-concurrency]`); other components are
+ free text, so mixed qualifiers keep working (`env set [--environment,
+ existing bundle]` and `[--environment, new bundle]`,
+ `parity.tsv:51`, stay positive fixtures; a mixed qualifier naming an
+ undeclared flag is the negative one). Flags are checked only once the
+ leaf has `Args`; a single-word qualifier that matches one
of the leaf's enum values is checked as that value; other word
qualifiers stay free text (slice 3 C2, R3-4).
4. **The MCP column** is filled from `parity/cli.tsv`: the tool names of
@@ -689,3 +707,7 @@ non-vacuity test becomes one on the file (at least 20 commands; `ship`,
- **R2-3 (one audience vs the status rows; P1):** D5, with today's three
status rows as the positive fixture.
- **R2-4 (positional scope targets):** C2.
+- **Round 3 (READY AFTER FIXES):** R3b-1 `channels digests` kept raw
+ with its leading-only parser (A4); R3b-2 `system files` is
+ `box-service`, not `box-root` (A0, C1); R3b-3 mixed qualifiers checked
+ per component (D3).
diff --git a/docs/superpowers/specs/CODEX-FINDINGS-cli-registry-R3.md b/docs/superpowers/specs/CODEX-FINDINGS-cli-registry-R3.md
new file mode 100644
index 000000000..5ba794e5a
--- /dev/null
+++ b/docs/superpowers/specs/CODEX-FINDINGS-cli-registry-R3.md
@@ -0,0 +1,40 @@
+- **R2-1: Resolved** — the tripwire is removed; ordinary value validation remains allowed.
+- **R2-2: Resolved** — `guard-exec` stays intact as a raw leaf, preserving its pre-dispatch checks.
+- **R2-3: Resolved** — D5 permits different outside statuses for the same leaf.
+- **R2-4: Resolved** — C2 supports flag and positional scope bindings.
+
+Reviewed `5c9710481620609dc9e5b59bc6906dc7d01704b0`; the spec matches `7e78de46d129c5d570dee6525e42b210bf2d4269`. No P1 findings.
+
+1. **P2 — A4/B2/B6: `channels digests` needs its leading-only enum parser explicitly preserved.**
+
+ [A4:195](docs/superpowers/specs/2026-11-09-cli-registry-design.md:195) describes `on|off` among words read after parsing flags. In fact, [channels_digests.go:160](channels_digests.go:160) removes only a leading `on` or `off`, then parses flags and rejects remaining positionals.
+
+ **Failure scenario:** Treating this as an ordinary post-flag enum rejects the supported leading form or accepts the currently refused trailing form. Generic `leadingArg` also differs: it removes any leading non-flag word, whereas this parser removes only `on|off`.
+
+ **Fix:** Explicitly retain this leaf’s parser as `raw`, with its enum annotation. Pin cases such as `channels digests on -h`, `channels digests --account-id x on`, and an unknown leading word followed by an invalid flag.
+
+ **Fault family:** Byte-for-byte argument-parsing compatibility.
+
+2. **P2 — A0/C1: `system files` is incorrectly classified as root-run.**
+
+ [A0:133](docs/superpowers/specs/2026-11-09-cli-registry-design.md:133) defines the exception through `Auth: box-root` and includes `system files`. However, [claimfilesseed_command.go:79](internal/host/claimfilesseed_command.go:79) requires the effective UID to equal the non-root `carlos` user. Root is refused. Its root capability check happens separately at [line 100](internal/host/claimfilesseed_command.go:100).
+
+ **Failure scenario:** Following the stated classification produces metadata claiming root is the required caller, although that caller cannot execute the operation.
+
+ **Fix:** Retain the explicitly named raw exception and its signal/cleanup ordering, but describe it as delegated box-service plumbing. Represent its actual service-user prerequisite rather than assigning `box-root`.
+
+ **Fault family:** Accurate caller-authority metadata.
+
+3. **P2 — D3: Mixed flag-and-prose qualifiers need an explicit checking rule.**
+
+ [D3:489](docs/superpowers/specs/2026-11-09-cli-registry-design.md:489) distinguishes flag qualifiers from word qualifiers without specifying mixtures. Existing rows contain `--environment, existing bundle` and `--environment, new bundle` at [parity.tsv:51](parity/parity.tsv:51). These are expressly accepted by [rules_test.go:148](internal/parity/rules_test.go:148).
+
+ **Failure scenario:** Classifying the entire qualifier by its initial `--` and checking every comma-separated component as a flag rejects these valid rows. Treating the entire mixture as prose instead leaves its flag reference unchecked.
+
+ **Fix:** Specify checking individual flag-shaped components against declared flags while preserving descriptive components as free text. Keep both existing environment rows as positive fixtures and add a mixed qualifier containing an undeclared flag as a negative fixture.
+
+ **Fault family:** Capability qualifiers preserved while validating flag references.
+
+No files changed, subagents spawned or tests run. These P2s can be fixed without another review round; implementation census obligations remain.
+
+**READY AFTER FIXES**
\ No newline at end of file