Review brief: managed fleets 1c, round 1
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
1 file changed,
+39
−0
docs/superpowers/plans/CODEX-REVIEW-BRIEF-MANAGED-FLEETS-1C.md+39 −0
CI cancelled — superseded by a newer push — run details
diff --git a/docs/superpowers/plans/CODEX-REVIEW-BRIEF-MANAGED-FLEETS-1C.md b/docs/superpowers/plans/CODEX-REVIEW-BRIEF-MANAGED-FLEETS-1C.md| new file mode 100644 |
| index 000000000..5499b2e45 |
| --- /dev/null |
| +++ b/docs/superpowers/plans/CODEX-REVIEW-BRIEF-MANAGED-FLEETS-1C.md |
| @@ -0,0 +1,39 @@ |
| +# Review brief: managed fleets 1c branch (#451 reboot lease) and its census, round 1 of 3 |
| + |
| +Repo carlos/platform, branch `managed-fleets-1c-451`, tip: the commit that adds this brief (`git log -1` on the branch). |
| +Under review: the code diff `d3908d930a..HEAD` excluding `docs/` (ten files: `internal/hafresh/owner.go`, `internal/host/haself.go`, `internal/lease/legacytake.go`, `internal/activator/control.go`, their tests, and the census overlay under `internal/provision/testdata/`). |
| +Authorities: the plan `docs/superpowers/plans/2026-10-30-managed-fleets-1c-reboot-lease.md` and spec `docs/superpowers/specs/2026-10-28-managed-fleets-design.md` §4 item 1c (both approved by Paul, on this branch), amadan #451 (`amadan discuss show carlos/platform 451`), AGENTS.md "The census". The ledger of rulings is `.superpowers/sdd/2026-10-30-managed-fleets-1c-reboot-lease/progress.md` if present; the three rulings are also in the commit messages' neighbourhood (tests moved to a new file, a fourth wrapped systemctl call, boot pinned to "" in four existing identity tests). |
| + |
| +You are an independent reviewer. Read the diff, then the code it touches and reaches, and check every claim against that code. |
| + |
| +## Fixed: do not re-argue |
| + |
| +- Paul approved the spec and plan (2026-10-30). The design: after a reboot, a box takes an UNEXPIRED legacy (non-HA) lock immediately when the lock's owner is this same EC2 instance (same non-empty iid, same ref) under a different, known kernel boot id. HA locks and HA owners are out of scope and must be untouched; an HA owner never carries `boot=`. |
| +- Unit-ordering fixes for shutdown (`After=dbus.service`) are a follow-up, not this branch. |
| + |
| +## What to check |
| + |
| +1. **Safety of the takeover.** Can any path take a lock whose writer might still be alive: the same boot with a different pid (agent restart while instance units run), another instance sharing a machine id (cloned disk), an owner with no `boot=` (older binary), an HA lock, a self with an empty iid or boot, EC2 hibernate-resume (same boot id)? Is the take still the single conditional write in `classifyAndTake` on the classified ETag, at generation+1? |
| +2. **Mixed versions.** A box running main without this branch reads a lock written by this branch: `;boot=` on a legacy owner. Does any existing reader (grep `ParseOwner`, `HAOn`, `DecideKeep`, `hafresh.View` users, the release marker and tombstone paths, `origin/region-ha-p1b2-forwarding`'s haforward callers act only on HA owners per its author) misbehave on a string it can no longer parse? And the reverse: this branch reading main's owners. |
| +3. **After the take.** Does the wake that follows treat the local database as this box's own (it was the last holder), and is anything else keyed on the old pid or boot (obligation store `owed`, release markers, `currentOwner`) left inconsistent? |
| +4. **The boot id read.** `readBootID` and `bootIDPath`: failure modes, non-Linux builds (darwin and windows must cross-compile), and whether the edge's systemd sandbox could hide `/proc/sys/kernel/random/boot_id` (check the unit template under `internal/host/units`). |
| +5. **`unitStateError`.** No caller compares these errors by identity or type-asserts `*exec.ExitError` directly, so wrapping changes no decision; stderr is bounded. |
| +6. **Census approval.** The card is `docs/superpowers/notes/census-proposal-managed-fleets-1c-451.md`. Give a verdict for every unit (three `systemctl*` readers: body change on the error path only; new `readBootID`) and every re-pinned envelope (`internal/activator`, `internal/hafresh`, `internal/host`, `internal/lease`), using the card's own review question: does any root read now open, run, query or follow a path or input a tenant, an app or a box agent can create, write or name, or is a check weakened? Approve or reject per unit. |
| + |
| +## Severity |
| + |
| +- **P1**: unsafe, would not compile, a test fails, or it would not work. Blocks merge. |
| +- **P2**: wrong or missing. Fixed without reopening this review. (The census, and review of any newly changed security, root, termination or production-storage behaviour, still check the fix; see AGENTS.md, "Stopping rules".) |
| +- **P3**: clarity or polish. Goes on a follow-up list; never a reason for another round. |
| + |
| +A P1 states its failure scenario and the evidence (file:line). Do not raise a P2 to P1 to keep the review open. |
| + |
| +## Output |
| + |
| +Findings ranked P1, P2, P3. Each gives the file, the problem, the evidence (file:line, verified), the failure scenario, a concrete fix and the invariant or trust boundary it breaks (that is its fault family). Then the census verdicts, one line per unit and envelope. End with exactly one verdict: |
| + |
| +- **READY**: no P1 and no P2. |
| +- **READY AFTER FIXES**: no P1. The listed P2s are fixed without another round. |
| +- **NOT READY**: one or more P1s, listed. |
| + |
| +Do not edit files. Do not spawn Anthropic-model reviewers or subagents of your own. Do not run the full test suites; targeted `go test -run` is fine if your sandbox allows it. |