carlos / platform Public

Managed fleets 1b: branch review R2 findings

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
claude agent, operated by paul@keymail.dev 984b5894d1e2a5c44976689288ef5198acba28ba parent 8ac9234
1 file changed, +51 −0
  • docs/superpowers/plans/CODEX-FINDINGS-MANAGED-FLEETS-1B-BRANCH-R2.md +51 −0

CI cancelled — superseded by a newer push — run details

diff --git a/docs/superpowers/plans/CODEX-FINDINGS-MANAGED-FLEETS-1B-BRANCH-R2.md b/docs/superpowers/plans/CODEX-FINDINGS-MANAGED-FLEETS-1B-BRANCH-R2.md
new file mode 100644
index 000000000..905ab37e7
--- /dev/null
+++ b/docs/superpowers/plans/CODEX-FINDINGS-MANAGED-FLEETS-1B-BRANCH-R2.md
@@ -0,0 +1,51 @@
+**P1 — A pending wake can boot stale data — NOT ADDRESSED.** Retirement fencing and the checks after lease acquisition cover the normal path at `internal/activator/activator.go:2599` and `internal/activator/activator.go:5696`. However, invalid fleet identity leaves `FleetRecord` unset at `internal/host/agent.go:583`; `internal/activator/wakeidentity.go:151` then skips the mandatory bucket check. The remaining failure scenario is detailed below.
+
+**P1 — Drain heartbeat mixes snapshots — ADDRESSED.** `detachHeld` now requires termination confirmation for an active, previously labelled box (`internal/console/fleetrelabel.go:373`). Both doors read, check and detach under the fleet lock (`internal/console/fleets.go:588`, `internal/console/fleets.go:1573`). The checkbox submits the expected value (`internal/console/templates/fleetdetail.html:56`). No remaining Go or census references to the removed drain-evidence fields were found.
+
+**P1 — Failed Litestream initialization is treated as successful replication — ADDRESSED by the ruling.** The final-sync wrapper and all branch-added replication evidence consumers are removed. `Replicator.Close` uses the original close result (`internal/lease/lease.go:572`); restore no longer clears replication evidence (`internal/activator/backend_exec.go:987`). The pre-existing discard remains outside this fix’s acceptance criteria.
+
+**P2 — An active box without a report appears “not paused” — ADDRESSED.** `labelsPausedFor` retains `unheard`, returns unknown, and preserves precedence for a positively observed rollback (`internal/console/fleetrelabel.go:519`). Covered by `TestLabelsPausedIsUnknownWhenABoxHasNoReport` (`internal/console/fleetrelabel_test.go:343`).
+
+**P2 — Rollback alert disappears after shrinking to one box — ADDRESSED.** A remaining labelled box still has its heartbeat loaded while new activation remains disabled (`internal/console/fleetbox.go:280`). The rollback alert runs before the inactive-fleet return (`internal/console/fleetrelabel.go:144`). Covered by `TestOneBoxLabelledFleetStillAlertsOnRollback` (`internal/console/fleetrelabel_test.go:365`).
+
+**New Breakage in the Fix Diff — Important / P1: invalid fleet identity bypasses assignment validation.** At `internal/host/agent.go:583`, the new reader is installed only when identity resolution succeeds. An identity error merely logs and continues (`internal/host/agent.go:394`), while a nil reader authorizes skipping validation (`internal/activator/wakeidentity.go:151`). For example, A retains its old labelled row and database; B receives the assignment, writes and sleeps; A restarts with `CARLOS_FLEET=pi`, an invalid explicit `CARLOS_FLEET_BOX`, and otherwise working bucket credentials. A wake before reconciliation passes the local-row comparison and boots its stale matching-marker copy without reading the record. Valid tunnel settings can also remain operational independently of fleet identity (`internal/host/tunnel_client.go:35`). **Fault family:** assignment freshness across wake and retirement. **Recommended correction:** refuse labelled wakes when fleet identity is invalid, with an operator diagnostic; reserve the platform exemption for an actual non-fleet box. Add a regression covering invalid identity with a retained labelled row.
+
+**Census check — APPROVE `leaseRouteChanged`**, retaining `legacy/accepted-legacy`: argument comparison adds refusals without expanding root authority (`internal/activator/wakeidentity.go:104`).
+
+**Census check — APPROVE `Service.routeCurrentUnderLease` for root authority**, retaining `legacy/accepted-legacy`: registry and deployment-store reads add no root execution authority; the functional bypass above remains blocking (`internal/activator/wakeidentity.go:141`).
+
+**Census check — APPROVE `FleetRecordFrom`**, retaining `legacy/accepted-legacy`: the existing record reader validates path identity and rejects retired records; nil storage returns an error (`internal/activator/wakeidentity.go:174`, `internal/provision/provision.go:3009`).
+
+**Census check — APPROVE `Service.doWake`**, retaining `legacy/accepted-legacy`: validation precedes restore, and refusal returns the lease (`internal/activator/activator.go:2599`).
+
+**Census check — APPROVE `Service.wake`**, retaining `legacy/accepted-legacy`: retirement adds cancellation under the existing mutex (`internal/activator/activator.go:1994`).
+
+**Census check — APPROVE `ExecBackend.restorePlain`**, retaining `legacy/accepted-legacy`: evidence clearing is removed while assignment checks remain (`internal/activator/backend_exec.go:987`).
+
+**Census check — APPROVE `type Service`**, retaining `authority/B,C,D,F,J4`: the added callback and label introduce no additional root-consumed input (`internal/activator/activator.go:1262`).
+
+**Census check — APPROVE `runAgent` for root authority**, retaining `authority/B,C,D,F`: wiring uses the existing deployment store before startup; the functional bypass above remains blocking (`internal/host/agent.go:583`).
+
+**Census envelope check — APPROVE `.`:** CLI confirmation serialization introduces no root authority (`apimode.go:5237`, `fleets.go:392`).
+
+**Census envelope check — APPROVE `internal/activator` for root authority:** retirement fencing and evidence removal preserve the root boundary (`internal/activator/maintenance.go:287`, `internal/activator/activator.go:5696`).
+
+**Census envelope check — APPROVE `internal/host` for root authority:** agent wiring and heartbeat-evidence removal introduce no new root reader (`internal/host/agent.go:583`, `internal/host/agent.go:4399`).
+
+**Census envelope check — APPROVE `internal/lease`:** the fix removes branch-added final-sync classification (`internal/lease/lease.go:573`).
+
+**Census envelope check — APPROVE `internal/registry`:** the fix changes the draining comment only (`internal/registry/fleets.go:602`).
+
+**Census removal check — PASS:** the six deleted drain-report units have no remaining census rows; obsolete branch overrides for reverted units and the status envelope are removed. Unchanged R1 approvals remain applicable. The card and chain name seal `d91403e0f3dd126f37935c1631d085ecc708496614314e30ebb54b60a0517899`.
+
+**Test-report check — PASS with a coverage gap:** the report names the pending-wake, retirement, lagging-reconcile, request-budget, unreadable-record, detach-door and observability tests, and includes summarized passing output (`final-fix-report.md:129`, `final-fix-report.md:212`). Their assertions match the fixes. Invalid-identity wiring is not covered; the report explicitly acknowledges no `runAgent` wiring test (`final-fix-report.md:247`).
+
+**Checks run:** read-only source, diff, census and symbol inspection. No tests rerun, git commands executed, or checkout mutations made.
+
+**Out-of-Scope Observations — None.**
+
+**Stopping-rule check:** assignment freshness remains open across R1 and R2. Rule 2 applies before another fix; the recommended cut is an upfront invalid-identity refusal.
+
+**Fix round: Findings remain open — P1 stale-data wake through invalid fleet identity.**
+
+**NOT READY**
\ No newline at end of file