Fleet secrets key: Astra branch review R1 findings and the R2 brief
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
docs/superpowers/reviews/CODEX-FINDINGS-fleet-secrets-key-branch-R1.md+58 −0docs/superpowers/reviews/CODEX-REVIEW-BRIEF-fleet-secrets-key-branch-R2.md+11 −0
CI failed — run details
Intent
<task-notification> <task-id>a19d5d9acdf424d9f</task-id> <tool-use-id>toolu_01QD8Eh75HuM7B8FRPXtDL5G</tool-use-id> <output-file>/home/paulca/.cache/tmp/claude-1001/-home-paulca-amadan-net-carlos-platform/2d812478-ae68-44f2-8075-b2330abd5939/tasks/a19d5d9acdf424d9f.output</output-file> <status>completed</status> <summary>Agent "Wire FSK-C71/C72 into direct mode" 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>Status: DONE. Not pushed. Commit: 34926419 "Direct secrets set: own copy rows for the two new refusals (branch review R1)". It includes the deck edit. The packed-refs.lock error appeared and `git log -1` confirms the commit. Wiring: in `appconfig_cli.go`, `directRefuseNotDeploymentKey` (FSK-C71) now answers the fingerprint-mismatch case, and `directRefuseNoPublishedKey` (FSK-C72) answers the no-record-but-fleets case. Each is one whole literal copied byte for byte from its row. FSK-C49 is still returned when the terminal key is a listed fleet key, and FSK-C50 for read and list errors. Tests: I added FSK-C71 and FSK-C72 to `fleetSecretsCopyBuilt`, and also to the pinned `fleetSecretsCopyIDs` inventory, which the completeness test needs. `TestDirectSecretsSetRequiresThePublishedDeploymentKey` and `TestDirectSecretsSetRaceRegistrationAfterCheck` now assert C71. `TestDirectSecretsSetNoConsoleRecordButFleets` now asserts C72. Both new texts are spelled out as `want…` constants in the test file. Checks: the requested `go test . -run …` passes. It needed `TMPDIR=/tmp/g` and the sandbox off, because the sandbox TMPDIR sits under a directory with a `.carlos/config` above it. `go vet .` and gofmt are clean, and the darwin and windows builds pass. I did not show the tests red first, since this was a copy swap on a branch where the logic was already tested. Concerns: the untracked `docs/superpowers/reviews/CODEX-FINDINGS-fleet-secrets-key-branch-R1.md` is not mine, so I left it out of the commit.</result> <usage><subagent_tokens>59811</subagent_tokens><tool_uses>9</tool_uses><duration_ms>71309</duration_ms></usage> </task-notification>
Attributed to this commit: 13.1 g CO₂e (1,671,194 tokens). This is an attribution, not a measurement — usage counted from this commit's own marker forward to the next one on design-fleet-secrets-key, 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/reviews/CODEX-FINDINGS-fleet-secrets-key-branch-R1.md b/docs/superpowers/reviews/CODEX-FINDINGS-fleet-secrets-key-branch-R1.md| new file mode 100644 |
| index 000000000..6323b020f |
| --- /dev/null |
| +++ b/docs/superpowers/reviews/CODEX-FINDINGS-fleet-secrets-key-branch-R1.md |
| @@ -0,0 +1,58 @@ |
| +## 1. Findings |
| + |
| +- **P1 — I1: replacing a key releases its cross-account uniqueness reservation.** `internal/registry/fleets.go:158,304–306`; `internal/console/fleetsecretskey.go:118–147`. Fleet B registers K, then replaces it with K2 while holding no sealed values. B’s boxes can still hold K: registration never removes their private key. Account A can now register K, and `sealKeyFor` will seal A’s values to a key B’s boxes hold. The append-only bucket history does not prevent this: registration checks only the current registry index. Executing the branch’s index and UPDATE statements against an in-memory database confirmed that sequence is accepted. **Fix:** reserve each successfully registered fingerprint permanently to its original fleet, atomically with registration; add a cross-account replacement/reuse witness. |
| + |
| +- **P1 — I1: direct mode’s negative lookup does not survive concurrent registration.** `appconfig_cli.go:1014–1028,1043–1073`; `internal/console/fleetsecretskey.go:134–139`. Direct mode targets account A with terminal key K. It reads B’s fleet record before K is appended and passes. B then registers K successfully; direct mode subsequently seals and stores A’s secret to K. This is a confidentiality failure, beyond the accepted I2 case where a concurrent fleet creation leaves a value sealed to the deployment key. **Fix:** permit direct sealing only after positively identifying an authoritative deployment key that fleet registration excludes, or refuse direct sealing until that identification exists. Add a deterministic registration-between-check-and-write witness. |
| + |
| +- **P2 — I1 guard completeness: a new Sealer method can bypass constructor policing.** `internal/console/sealkey_guard_test.go:205–220,242–246`. `fieldsAllowed` permits field access in **every** method with a `Sealer` receiver. A new exported method can fill a zero sealer’s `pub`, `fp`, `binding` and `bound` fields from arbitrary arguments, return it, and allow a new sealing site without any guarded constructor call or populated composite literal. Existing negative fixtures exercise standalone constructors, leaving this route uncovered. **Fix:** allow field access only in explicitly named existing methods, restrict field mutation to `NewSealer`, and add a receiver-method constructor fixture. |
| + |
| +- **P2 — lock lifetime: recovered seed-copy panics retain the account mutex.** `internal/console/apiinstanceseed.go:435–455`. If `instanceStoreProvisionFor` panics, `runFrom`’s existing recovery aborts the seed and keeps the console alive, but execution skips `unlockAcct()`. Subsequent account-locked operations wait indefinitely. **Fix:** wrap the provisioning call in a closure with deferred unlock; test recovery followed by another account-locked operation. |
| + |
| +No new P3 findings. |
| + |
| +The security witnesses inspected use production doors, sealers, store-door ACLs and config guards; the task reports document mutations that make them fail. I could not rerun Go tests: the targeted command stopped before compilation because Go could not create its work directory on the read-only filesystem. GOCACHE was left unset. |
| + |
| +## 2. Census |
| + |
| +These verdicts cover the recorded root-input authority and writer classifications. They do not clear the confidentiality findings above. |
| + |
| +- **APPROVE** card unit `Registry.migrateFleets` — `internal/registry/fleets.go:145–159`: fixed migration SQL; no new caller-selected path or root read. |
| +- **APPROVE** card unit `secretsKeyFingerprint` — `appconfig_cli.go:1211–1224`: explicitly invoked local file read under the caller’s privileges; errors and output omit private material. |
| +- **APPROVE** card unit `readFleetPubKeyFile` — `fleets.go:419–460`: explicitly named local file, parsed as public material; no production root caller added. |
| +- **APPROVE** card unit `Registry.SetFleetSecretsKey` — `internal/registry/fleets.go:292–321`: parameterized update or existing registry transport; accepted-legacy classification fits its accesses. Its I1 defect remains finding 1. |
| +- **APPROVE** card unit `Registry.GetFleet` — `internal/registry/fleets.go:240–255`: additional columns from the same selected fleet row. |
| +- **APPROVE** card unit `Registry.ListFleets` — `internal/registry/fleets.go:259–283`: additional columns from the existing fleet listing. |
| +- **APPROVE** card unit `Registry.dispatchRemote` — `internal/registry/remote_dispatch.go:181–190`; `internal/registry/remote.go:233–235,277–286`: setter dispatch through the existing non-root worker; the read-only method gate still excludes it. |
| +- **APPROVE** registry-schema closure — `internal/registry/fleets.go:43–51`; `internal/registry/remote_dispatch.go:30–38`: additive fleet/request fields; no unrelated schema closure. |
| + |
| +- **APPROVE** envelope `.` — `appconfig_cli.go:315–320,864–918,924–1080,1211–1243`; `fleets.go:385–537`; `apimode.go:2905–2975,4934–4991`; `instances_cli.go:658–698`: CLI selection, metadata and presentation changes add no unattended root execution or privileged path following. |
| +- **APPROVE** envelope `internal/appconfig` — `appconfig.go:160–167`; `crypto.go:237–247`; `sealer.go:17–67`; `store.go:240–251,347–354`: additive metadata and binding-checked sealing; existing opaque config storage. |
| +- **APPROVE** envelope `internal/hostops` — `fleetowner_classifier.go:39–104`; `mutation_classifier.go:153–157`: appended fingerprints cannot alter owner identity, creation time or the existing fingerprint prefix; deletes remain refused. |
| +- **APPROVE** envelope `internal/objstore` — `walk.go:140–151,228–399,448–519,882–975`: existing provisioning/write destinations and validation remain; sealing uses the supplied bound sealer. |
| +- **APPROVE** envelope `internal/registry` — `fleets.go:145–159,240–321`; `remote.go:17,277–286`; `remote_dispatch.go:30–38,181–190`: no additional production root read or weakened read-only worker gate. |
| +- **APPROVE** envelope `internal/release` — `release.go:174–191`: additive fingerprint history; fleet/account identity and owner-record key remain unchanged. |
| + |
| +- **APPROVE** 9B8 re-pin `ClassifyMutation` — `internal/hostops/mutation_classifier.go:153–157`: comment change; same classifier dispatch. |
| +- **APPROVE** 9B8 re-pin `classifyFleetOwner` — `internal/hostops/fleetowner_classifier.go:39–104`: narrowly admitted append; reference classification remains correct. |
| +- **APPROVE** 9B8 re-pin `claimUnserializedEnable` — `internal/mail/walk.go:761–891,956–995`: supplied sealer replaces the public-key parameter; same credential/config writes. |
| +- **APPROVE** 9B8 re-pin `claimUnserializedRotate` — `internal/mail/walk.go:1031–1104`: same rotation destinations, pause preservation and environment writes. |
| +- **APPROVE** 9B8 re-pin `claimUnserializedEnableEnvironment` — `internal/mail/walk_environment.go:36–124`: ownership check remains before credential delivery; same writes. |
| +- **APPROVE** 9B8 re-pin `Server.runFrom` — `internal/console/apiinstanceseed.go:421–455`: record-writer classification and seed-write authority unchanged; finding 4 requires the lock fix and re-pin. |
| +- **APPROVE** 9B8 re-pin `Server.placeAppTarget` — `internal/console/fleets.go:732–837`: added lock and pre-write refusal; existing account/app filtering and placement-write authority remain. |
| +- **APPROVE** 9B8 re-pin `Server.handleAPIInstanceList` — `internal/console/apiinstances.go:840–872,1117–1197`: read-only join over tenant-filtered records and own-account fleet reports. |
| +- **APPROVE** 9B8 re-pin `Server.registerCLIRoutes` — `internal/console/authcli.go:940–946`: new door has zero service-role permissions; registration itself writes no record. |
| +- **APPROVE** 9B8 new unit `Server.recordFleetKeyFP` — `internal/console/fleetowner.go:116–168`: nonrecord owner-record create/append with identity checks and CAS; no instance or sidecar write. |
| + |
| +## 3. Deferred-minor triage |
| + |
| +Fix before merge: |
| + |
| +- **Guard coverage of packages wholly excluded on Linux.** The guard must inspect same-module packages omitted entirely by its Linux package listing. Carry this into the guard fix above; it is an existing deferred item, not a new finding. |
| +- **Plan-storage keyless-fleet skip.** `internal/console/planstorage.go:100–103` leaves pre-existing stores outside storage-deny enforcement indefinitely. This concerns billing enforcement independently of I2. Require a sealer only when the regrant would mint, following the healthy-store handling already used by scan doors. |
| +- **Request-budget accounting.** Correct the “no new bucket reads” claim to include direct mode’s account listing/record reads and fleet-list stale-report fan-out. |
| + |
| +The remaining deferred items may stay on the follow-up list. In particular, body reading under the account lock is bounded by the production server’s five-minute `ReadTimeout`; it is undesirable contention, but not an unbounded network-body wait. |
| + |
| +## 4. Verdict |
| + |
| +NOT READY. |
| \ No newline at end of file |
diff --git a/docs/superpowers/reviews/CODEX-REVIEW-BRIEF-fleet-secrets-key-branch-R2.md b/docs/superpowers/reviews/CODEX-REVIEW-BRIEF-fleet-secrets-key-branch-R2.md| new file mode 100644 |
| index 000000000..b0b2fb74d |
| --- /dev/null |
| +++ b/docs/superpowers/reviews/CODEX-REVIEW-BRIEF-fleet-secrets-key-branch-R2.md |
| @@ -0,0 +1,11 @@ |
| +# Review brief: fleet secrets key, whole branch and census, round 2 of 3 |
| + |
| +Repo carlos/platform, branch `design-fleet-secrets-key`, commit named in your prompt. Authorities and "Fixed: do not re-argue" as in `docs/superpowers/reviews/CODEX-REVIEW-BRIEF-fleet-secrets-key-branch.md` (round 1's brief, same directory), plus Paul's ruling of 2026-10-29 under stopping rule 2 on round 1's direct-mode P1: **direct mode must positively prove the deployment key** (it seals only to a terminal key whose fingerprint equals the one the console publishes in `control/moves-console.json`; no record means allowed only with zero fleet records). Do not edit files. |
| + |
| +Scope: the diff `6271d4ca..<commit>` (round 1 reviewed 6271d4ca), plus anything that diff breaks elsewhere. Round 1's findings: `docs/superpowers/reviews/CODEX-FINDINGS-fleet-secrets-key-branch-R1.md`. |
| + |
| +1. One line per round 1 finding (P1 and P2) and per must-fix deferred minor: resolved, partly, or not. |
| +2. New findings only in or caused by the fix diff, with the invariant beside each (stopping rule 2). The direct-mode family is closed by Paul's ruling: raise a direct-mode finding only if the positive check itself can be satisfied by a key other than the deployment's (who can write `control/moves-console.json`? check `internal/edge/storedoor.go` aclWrite for fleet boxes). |
| +3. Census: verdicts for every re-proposed unit and re-pinned envelope and 9B8 re-pin in the fix diff (`docs/superpowers/notes/census-proposal-fleet-secrets-key.md`, `internal/provision/testdata/plan14-root-reads-fleet-secrets-key.tsv`, `internal/provision/fleet_secrets_key_census_test.go`), citing lines read. |
| + |
| +Severity and output as in round 1's brief. Verdict line: READY, READY AFTER FIXES (no P1), or NOT READY. A round with no P1 ends the review. |