carlos / platform Public

spec: parity guard, builder-check calls + review brief

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
claude agent, operated by paul@keymail.dev pushed by paul@keymail.dev f887860aa2826def6b1fcaf4178d3527d710655e parent abc6d05
2 files changed, +61 −0
  • docs/superpowers/specs/2026-11-09-parity-guard-design.md +36 −0
  • docs/superpowers/specs/CODEX-REVIEW-BRIEF-parity-guard.md +25 −0

CI cancelled — superseded by a newer push — run details

Intent

Human

<task-notification> <task-id>a57dda7ff243fb47d</task-id> <tool-use-id>toolu_01VEnPzWZRvc9h4m53tjMQsg</tool-use-id> <output-file>/home/paulca/.cache/tmp/claude-1001/-home-paulca-amadan-net-carlos-platform/a1de5273-c148-49b8-8267-3dee9d49c9c1/tasks/a57dda7ff243fb47d.output</output-file> <status>completed</status> <summary>Agent "Builder check on parity guard design" 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>Questions I'd still need answered, most important first. **1. What is a "console action" for the guard, and how do routes map to rows?** - There are about 195 non-`/api` `registerRoute` calls: 67 `POST /a/...` and 37 `GET /a/...`, plus auth, fleet, demo, alerts and static (`internal/console/server.go:1933-2260`, `claim_routes.go:68`). - The inventory has about 118 capability rows and cites several handlers per row. For example "env set/unset/list" is one row, and Billing is seven routes in one line (inventory line 224). - The spec says a route "with no row" fails the test. That could mean: - (a) every route needs its own row, or - (b) a row may cover several routes, with a route-to-row mapping column. - It is also unclear whether GET data endpoints and tab sub-pages (Logs data, `analyticslive`) need rows, or only form POSTs plus top-level pages. The spec says "page or form POST route". - Option (b) needs a rule for which routes are exempt (GET read pages) and how a row claims a route set. That rule is the real design. The spec's example row, `POST /a/{sqid}/apps/{app}/settings/env`, suggests (a), but the inventory is written as (b). **2. How does the guard tell customer-facing routes from the rest?** - Nothing in the code tags routes as customer, operator or auth. Only the URL prefix and handler names carry that. - `/fleet/*` is operator, but `POST /a/{sqid}/store/apply` is registered right beside it (`server.go:1950`). - Non-`cli` `/api` routes exist (14 POST, 5 GET), as do `/demo`, `/alerts` (email links), `/invite`, `/claim-witness` and `/billing`. - Do I classify by prefix allowlist and denylist in the test, or add an explicit tag at registration? A prefix list is itself a second hand-kept list, which the anti-goals forbid. - Do operator and demo routes get rows, as the `operator` status implies, or are they excluded? The inventory includes ops pages (§2, lines 244-248), but the spec's guard only covers "customer-facing" routes. **3. How do I enumerate routes, given the package boundary and flag-gated registration?** - `s.claimEntries.snapshot()` is already a runtime inventory of every route (`claim_routes.go:20-67`). It is unexported, so the guard must live in `internal/console` or I add an exported accessor. - The CLI lives in `package main` at the root and the console in `internal/console`. Is a single test spanning both acceptable, with an exported hook added to the console package? - Registration differs by config. `cfg.HostClaim` gates routes (`server.go:2013`, `:2268`), and the moves flag has an invariant test showing different inventories (`claim_invariant_moves_test.go:66-80`). Must the guard build the Server with every flag on? If so, which config? - Some routes are registered via `cliRoute`, `cliScopedRoute` and `cliRouteJournaled`. These all end in `registerRoute`, so excluding `/api/cli/` by prefix works. **4. What counts as a CLI "command or subcommand", given there is no table?** - `main.go:63-238` is a plain `switch`. Sub-verbs are hand-written switches in each `runX` or `RunX` (`apps.go:156`, `features_cli.go:48`). Some are inline `args[0] ==` checks (`main.go` for `channels`, `releases`, `version target`), and some are in other packages (`host.Run*`, `edge.Run`, `vet.Run`, `instanceexec.*`). - The inventory's granularity includes flag-level rows such as `apps set --interactive` and `instances set --updates`. These are flags, not subcommands, and flag sets are local variables inside each function. - Is the guard's unit the verb path (`apps set`) with flag-level capabilities only noted in the row? Or must flags also be enumerated? - If it is verb paths, I must refactor about 50 dispatchers to expose a verb table, which touches root-scope code. The spec says census-relevant moves are "unlikely". If I only parse `main.go` and the per-command switches, that needs a rule for the nested ones. - Which hidden or plumbing commands (`__rootfs-check-probe`, `instance-*`) and aliases (`help`, `-h`, `--help`) are excluded? **5. How do rows name their counterpart, and does matching rely on it?** - Row IDs are free text ("`carlos secrets set`", "route and a few words"). Is a row exactly one CLI command paired with one route, or can it list several, as in "`env set/unset/list`"? - Existence checking ("row names a command that no longer exists") needs a parsing rule for slashes, flags and placeholders. `secrets set/unset/list` is one inventory row but three commands. - For `gap` rows, the missing side is empty. Does the guard still need to know which half exists? **6. How should the inventory's box-local and operator rows be enumerated?** - The `box-local` and `operator` statuses need a row for every `system` and `ops` subcommand, and the inventory lumps these (e.g. `system apply/files/guard-arm/...`, line 176). - Do I split them into one row per subcommand? That is a big seed task. - Or may a row cover a wildcard such as `carlos system *`? **7. Where do the generated doc and its stale check live?** - Is the `make parity-doc` target new? I did not check whether a Makefile exists. - Is the stale check a plain test that regenerates and diffs?</result> <usage><subagent_tokens>65658</subagent_tokens><tool_uses>8</tool_uses><duration_ms>94141</duration_ms></usage> </task-notification>

Attributed to this commit: 14.3 g CO₂e (1,783,407 tokens). This is an attribution, not a measurement — usage counted from this commit's own marker forward to the next one on design-parity-guard, 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-parity-guard-design.md b/docs/superpowers/specs/2026-11-09-parity-guard-design.md
index 20a9bfe0f..60e635fe9 100644
--- a/docs/superpowers/specs/2026-11-09-parity-guard-design.md
+++ b/docs/superpowers/specs/2026-11-09-parity-guard-design.md
@@ -78,6 +78,42 @@ full; census if any root-scope code moves (unlikely: a test, a data file, a
make target, docs). Add a short AGENTS.md rule: new CLI commands and console
actions update `parity/parity.tsv` in the same branch.
+## Calls after the builder check (mine, 2026-11-09)
+
+1. **A row is a capability and lists its exact members**: zero or more CLI
+ verb paths (e.g. `secrets set`, `secrets unset`, `secrets list`) and zero
+ or more console routes as registered (`METHOD pattern`). Every enumerated
+ verb path and every enumerated console route must appear in exactly one
+ row; a member in two rows fails. `gap` rows still list the side that
+ exists.
+2. **The table classifies, not a prefix list.** Every non-`/api/cli/*`
+ route the console registers (pages, form POSTs, GET data endpoints, auth,
+ demo, email-link, alerts, ops, static) appears in some row; its status
+ says whether it counts toward customer parity. Statuses add `auth`,
+ `demo`, `asset` and `internal` for rows that are neither customer
+ capability nor gap, each with a reason. The counts in `docs/parity.md`
+ cover customer rows only.
+3. **Routes are enumerated from the console's own route register**
+ (`claimEntries`, every `registerRoute`), built by a test inside
+ `internal/console` with every optional route group switched on (host
+ claim, moves, demo, and any other config-gated group), so no route hides
+ behind a flag. `/api/cli/*` doors are excluded by their registration
+ helper (`cliRoute` family), not by a typed prefix.
+4. **The CLI unit is the verb path** (command + subcommand), not flags.
+ Verb paths are derived from the dispatch code: the top-level switch in
+ `main.go` and each command's first-argument switch (go/ast over the
+ module root, plus the handful of commands dispatched into other
+ packages), checked by a root-package test. Flag-level capabilities
+ (`apps set --interactive`) are noted in the row, not enumerated. Hidden
+ plumbing verbs (leading `__`, internal helpers) and help aliases get
+ `internal` rows. If AST parsing proves fragile, the builder may add a
+ small verb registry the dispatch itself uses (census applies then).
+5. **Operator and box-local verbs get exact rows** (no wildcards), several
+ verbs per row where they form one capability.
+6. **Two tests, one table:** the console test checks routes, the root test
+ checks verb paths and the generated page; both read `parity/parity.tsv`.
+ `make parity-doc` is a new target; the stale check regenerates and diffs.
+
## Left to the builder
The table format and location details, how commands and routes are
diff --git a/docs/superpowers/specs/CODEX-REVIEW-BRIEF-parity-guard.md b/docs/superpowers/specs/CODEX-REVIEW-BRIEF-parity-guard.md
new file mode 100644
index 000000000..b049a911a
--- /dev/null
+++ b/docs/superpowers/specs/CODEX-REVIEW-BRIEF-parity-guard.md
@@ -0,0 +1,25 @@
+# Review brief: spec "CLI and console parity: the stock and its guard", round 1 of 3
+
+Repo carlos/platform, branch `design-parity-guard`, commit: the commit that
+adds this file. Under review:
+`docs/superpowers/specs/2026-11-09-parity-guard-design.md`, seeded from
+`docs/superpowers/notes/2026-11-09-parity-inventory.md`. Authorities: main's
+code (main.go and the CLI dispatchers; internal/console route registration,
+claim_routes.go, server.go registerRoute and the cliRoute family).
+
+Fixed, do not re-argue: Paul's direction (parity both ways; keep the stock;
+gaps closed over time, not now). The builder-check calls are the author's;
+challenge them on correctness and robustness.
+
+Check:
+1. Can the guard really enumerate ALL CLI verb paths and ALL console routes
+ from code (no second hand list), including config-gated route groups and
+ commands dispatched into other packages? Name anything it would miss.
+2. Would it fail on every kind of drift the spec promises, and not pass
+ vacuously (e.g. an enumeration that silently returns nothing)?
+3. Is the row model (capability rows listing exact members, statuses) sound
+ and not so noisy that people rubber-stamp rows?
+4. Census or other repo gates the build would trip.
+
+Severity P1/P2/P3; end with exactly one verdict: READY, READY AFTER FIXES,
+NOT READY. Do not edit files. No subagents. No full test suites.