region HA P3b plan: Opus R2 findings (READY AFTER FIXES, 1 P2)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
docs/superpowers/plans/REVIEW-REGION-HA-P3B-R2.md+93 −0
Intent
<task-notification> <task-id>a063a6d5338f8cd33</task-id> <tool-use-id>toolu_01KFQjA5GHd8g2q5SMPWsvgF</tool-use-id> <output-file>/home/paulca/.cache/tmp/claude-1001/-home-paulca-amadan-net-carlos-platform/322ac65e-c7fd-49f1-985b-a0352676881d/tasks/a063a6d5338f8cd33.output</output-file> <status>completed</status> <summary>Agent "Opus R2 review of P3b plan" 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>**Verdict: READY AFTER FIXES.** No P1 and one P2, carried over from round 1. It can be fixed without a fourth round. The review is at `/home/paulca/.cache/tmp/p3b-plan/REVIEW-REGION-HA-P3B-R2.md`. I nearly wrote it in the wrong place: the sandbox makes that folder read-only, so I wrote the draft under $TMPDIR, copied it across with the sandbox off, and deleted the draft. I changed nothing in the repo. Round 1: - P1-1 (restart authority, the ExitStandby hook): **resolved.** The AWS lifecycle-hooks page says verbatim, in the footnote to its availability table, that hooks do "not apply when you attach or detach instances, move instances in and out of standby mode, or delete the group with the force delete option." Rev 2 is safe either way: - Only the operator ever completes the hook on return, so the box never competes. - The fake tests must cover a hook firing on return, and they must fail against rev 1. - The first live step is a no-change probe that blocks rolls if AWS behaves differently. - P2-1 (namespace authority, the rollout gate): **partly resolved.** Carried forward at P2. - P2-2 (duty recovery, the group termination queue): **resolved.** - P2-3 (no tenant work before admission, departure import): **resolved.** It took option (a), and the code agrees: the journal is local, and `Started` needs `record` to return nil. - P2-4 (restart authority, OS restarters): **resolved.** - P2-5 (G2 drill pass conditions): **resolved.** - P2-6 (stopping rules 5 and 6): **resolved.** The G1 citations check out against the #421 export, and the dated window is gated on Paul before the build starts. Round 2: - **P2, R2 P2-1 (namespace authority across mixed-version readers).** The old-reader check runs only when a group box joins. Fixed boxes update themselves, unattended, to whatever release the console's system-update API publishes, so an ordinary rollback still puts pre-`names-2` readers beside group publishers that are already admitted. No task touches `internal/console/apisystemupdate.go` or `internal/host/systemleg.go` for fixed boxes. The fix is to refuse that rollback in one of those two places while group publishers exist, and add a mutation test for it. - **P3, R2 P3-1 (observability).** The ASG deficit alarm needs `enabled_metrics` set on the group. Without it, missing data counts as breaching and the alarm stays on permanently. - **P3, R2 P3-2 (hairpin).** The redirect sends local calls to the region's own address to this box even while it is not admitted, so they get a 503 instead of reaching a healthy peer. Either state that nothing calls it then, or switch the redirect on only after admission. - **P3, R2 P3-3 (restart authority).** The plan has no step for a member that is waiting on the hook after leaving Standby and has dropped out of admission. Left alone, AWS terminates it after 900 s. This only matters if AWS behaves unlike its docs, which already blocks rolls. The spec edit is still verbatim. Every new file:line cited in rev 2 matches the code at 016599d5.</result> <usage><subagent_tokens>156944</subagent_tokens><tool_uses>33</tool_uses><duration_ms>446559</duration_ms></usage> </task-notification>
Attributed to this commit: 23.6 g CO₂e (1,328,396 tokens). This is an attribution, not a measurement — usage counted from this commit's own marker forward to the next one on region-ha-p3b-plan, 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/plans/REVIEW-REGION-HA-P3B-R2.md b/docs/superpowers/plans/REVIEW-REGION-HA-P3B-R2.md| new file mode 100644 |
| index 000000000..7a97c4cbc |
| --- /dev/null |
| +++ b/docs/superpowers/plans/REVIEW-REGION-HA-P3B-R2.md |
| @@ -0,0 +1,93 @@ |
| +# Review: region HA P3b plan, round 2 of 3 |
| + |
| +Reviewer: Opus (independent), 2026-11-04. Read-only. |
| +Under review: `docs/superpowers/plans/2026-11-04-region-ha-p3b-group.md` rev 2 (473b0d4d), brief daf648c8, spec §12.1 edit from cac62f37. Base main 016599d5. Diff read: `git diff 15d43bad 473b0d4d` (plan file only). |
| + |
| +**Spec edit.** Rev 2 does not touch the spec. The §12.1 sentence is still word for word P3 rev 3 `2026-11-01-region-ha-p3-group.md:110`. The only other spec changes are the rev line (6.1 to 6.2) and one history bullet. Clean. |
| + |
| +**AWS claim (P1-1).** Checked against the live pages on 2026-11-04. |
| +- `lifecycle-hooks.html`, "Lifecycle hook availability", footnote 1 says, verbatim: "Applies to all launches and terminations, whether they are initiated automatically or manually such as when you call the `SetDesiredCapacity` or `TerminateInstanceInAutoScalingGroup` operations. Does not apply when you attach or detach instances, move instances in and out of standby mode, or delete the group with the force delete option." The plan's quote at :137 is accurate. Its "[…]" stands for "attach or detach instances,", as it says. |
| +- `as-enter-exit-standby.html` contains "You return the instance to service by exiting the standby state." Its exit-standby example shows `StatusCode: PreInService`, `Progress: 30`. The page says nothing about lifecycle hooks or `Pending:Wait`. The plan's reading at :138 is accurate. |
| +- `ec2-auto-scaling-lifecycle.html` describes `Pending` to `Pending:Wait` only for scale-out launches. It has no text saying that exiting Standby passes through `Pending`. The figure is the only basis for R1's premise. The plan's reading at :139 is fair. |
| + |
| +**Rev 2 is safe whichever way AWS behaves:** |
| +- With no hook on return, `return_member` makes no completion. The receipt cannot suppress anything that matters. |
| +- If a hook does fire, the operator owns the CONTINUE, with a separate journal (:150), and the box never competes (:128, :143). The first live P3b-2 step is a no-change probe that refuses rolls on divergence (:154). The probe's residual risk is a disposable dev member if API access is lost inside 900 s, and :154 states it. |
| +- The fakes must include `Pending:Wait` and must fail against rev 1 semantics (:164, :192). |
| + |
| +**File:line check.** I re-verified every anchor new in rev 2 at 016599d5: |
| +- `main.tf:256,301,390,428–435,693,777,815,843–898` (queue, rule, 14-day retention, SSE, Deny on a SourceArn mismatch); |
| +- `hadepartures.go:153–182` (the invalid-hint `DeleteReceipt`, the already-complete `ackDeparture`, then `ParkTermination`); |
| +- `edgesfile.go:198,360`; `snapshot.go:71`; `boxrecord.go:32,65`; `observation.go`; |
| +- `ingress/alarms.tf:28` and `ingress/variables.tf:48` (`expected_targets`); |
| +- `/home/paulca/.cache/tmp/d421.txt:365,381–383` (G1 items 1–7 and item 8, as cited). |
| + |
| +Every existing file named in the Task file lists exists at the base. No inaccuracies found. |
| + |
| +--- |
| + |
| +## Round 1 dispositions |
| + |
| +- **P1-1 (T1/I4, ExitStandby hook versus receipt): resolved.** The AWS quote is verified. One operator return owner and a separate return journal. The receipt is scoped to the original launch. A mandatory `Pending:Wait` fake fails rev 1. A live probe gate refuses on divergence. Budget row :245. |
| +- **P2-1 (H4/A1, rollout gate enforced): partly resolved.** The box side is now enforced in code: `names-2`, and `GroupReadersReady` before the first booting edges write and before CONTINUE or re-admission (:98–100). The rollback side is not: see R2 P2-1 below. Carried at P2. |
| +- **P2-2 (I6/E1, group termination queue): resolved.** :112–113 creates a distinct queue, rule, target and anti-forgery policy in the group module, delivers its URL through group SSM, leaves fixed queues unchanged, and asserts all of this in `group_shape`/`group_iam_exact_scope`. Budget row :247. |
| +- **P2-3 (A1/I6, departure import before admission): resolved, option (a).** Checked against the code: |
| + - The registry journal is local SQLite (`internal/registry/ha_journal.go:71–80,101`). Parking a hint on a closed member creates no shared state. |
| + - `Started` closes only if `record` returns nil for every message (`internal/hadeparture/consumer.go:168–200`). The plan's rule "do not return a receive-record error merely because admission is closed" (:129) is therefore the necessary condition, and the plan states it. |
| + - The invalid-hint and already-complete ack shortcuts (`hadepartures.go:156–158,177–179`) are named as gated. |
| +- **P2-4 (T1/I4, OS restarters): resolved.** :123 masks the apt timers and services and unattended-upgrades, turns off automatic reboot, sets needrestart to list-only, and forbids SSM patch and reboot schedules. It adds a rendered-template test and a live readback in Task 7. |
| +- **P2-5 (G2 pass conditions): resolved.** :206–214 add numeric exclusion, replacement and recovery limits, zero service by the failed iid, one writer per generation, per-class loss limits, a FAIL procedure and per-drill cleanup. |
| +- **P2-6 (S1, rules 5/6): resolved.** The G1 record is verified. No executable task reads a P2b interface. D1 and a dated UTC window, operator and cleanup owner are required before implementation **starts** (:41, :185, :306). This waits on Paul, which is correct, and it is not hidden. |
| + |
| +--- |
| + |
| +## P1 |
| + |
| +None. |
| + |
| +## P2 |
| + |
| +### R2 P2-1 (carried from R1 P2-1, partly resolved). The supported release-rollback path can put fixed readers on a pre-`names-2` build while group publishers are live, and no executable task refuses it (Task 1 :99; Task 8 :219) |
| + |
| +- **Problem.** Rev 2 enforces the gate where a group box joins: `GroupReadersReady` is checked before the booting write and before CONTINUE. That is a one-time check. Once a group member is admitted, nothing re-checks it. |
| +- **What happens on rollback today.** Fixed boxes follow the platform channel pointer unattended: |
| + - `systemLeg` "notice[s] the channel pointer, fetch[es] and verif[ies] the artifact … ask[s] root" (`internal/host/systemleg.go:21–24`). |
| + - It is armed in the fast loop and observed at arming (`internal/host/agent.go:3451–3461`). |
| + - The pointer is written by the console's system-update API (`internal/console/apisystemupdate.go:374` `handleAPISystemUpdate`, `:508` `runSystemUpdate`). A rollback is just an update to an older release. |
| +- **What rev 2 says, and why it is not enough.** Rev 2 says "Serialize all supported release/rollback commands with the group experiment record. A rollback to a pre-`names-2` build refuses until Task 8's readback…" (:99). Task 8's rollback command does that readback (:219). But no task's Files list touches `apisystemupdate.go`, `systemleg.go` or the fixed-box apply path for this purpose. Task 4 edits `systemapply.go`/`systemleg.go` for **group** boxes only and says "Keep fixed units unchanged" (:161). |
| +- **Why it matters.** The ordinary, supported release tool is exactly the path a second operator or agent on this shared fleet would use. The plan calls only "ad hoc privileged downgrade" unsupported, and this is not that. |
| +- **Failure scenario.** Group members g1 and g2 are admitted and published, holding names. Someone runs the normal console system update to the previous release, for example the bad-artifact rollback recipe. Sophie and leo self-update to a pre-`names-2` build within the spread. They fold the group's held names with main's dial-first ordering (`internal/edge/homemap.go:903–915`), and R2-1/R2-2 return for visitors that reach the fixed pair. No group box re-checks `GroupReadersReady` after admission, so nothing refuses. |
| +- **Fix.** Pick one enforcement point in code and name its file in Task 1. |
| + - **Publisher side.** `apisystemupdate.go` refuses a pointer whose release lacks `names-2` (by release tag floor) while the deployment fold shows any group publisher or retained group namespace. The refusal is logged and uses copy row P3b-C12. |
| + - **Consumer side (stronger).** The fixed box's `systemLeg`/apply refuses to stage or apply such a release while its own cached fold shows group publishers. This costs 0 extra requests, because the fold is cached. |
| + - Either way, add the mutation "pointer rollback below `names-2` with a live group publisher" to Task 1's mutation list, which becomes nine. Keep Task 8's readback for the deliberate downgrade. |
| +- **Family.** H4/A1: namespace authority across mixed-version readers. This is the same family as R1 P2-1. It is not a new iterative repair of the withdrawal boundary: Task 1's one-invariant helper is sound, and only the rollout guard's coverage is incomplete. |
| + |
| +## P3 (cheap and real only) |
| + |
| +- **R2 P3-1 (Task 6 :182).** The alarm math over `GroupInServiceInstances` and `GroupDesiredCapacity` needs Auto Scaling group-metrics collection (`enabled_metrics`, 1-minute granularity) on the ASG. That is off by default. Task 2's `group_shape` does not list it. With "missing breaching", the alarm would sit in ALARM permanently. Add `enabled_metrics` to the group resource and assert it in `group_shape`/`group_alarms.tftest.hcl`. Collection is free. |
| +- **R2 P3-2 (Task 5 :172).** The output DNAT sends every local call to an own-region EIP to this box's own listener, including while admission is closed (booting, or held in Standby). Those calls get the local 503 instead of reaching an admitted peer. State whether any root or agent caller uses the platform ingress EIP before admission or during maintenance, for example the console domain if it points at the regional NLB. Either arm the DNAT only once admitted, or record the 503 as expected. |
| +- **R2 P3-3 (Standby return table :150).** The defensive `Pending:Wait` row says "recheck current-process admission first", but gives no action when that recheck fails. Without a completion, the default ABANDON at 900 s terminates the member. Two options: |
| + - wait a bounded share of the deadline for re-admission, then CONTINUE and EnterStandby(decrement) from InService inside the 60 s grace; |
| + - or declare it the same failed-probe outcome as :154. |
| + |
| + This is reachable only under provider divergence, which already blocks rolls. |
| + |
| +--- |
| + |
| +## Checked and sound (no finding) |
| + |
| +- **Restart authority.** |
| + - Every carlos-edge restart site found at base is inside the restart guard's named entries: `systemapply.go:1503–1504,2094`, `guardarm.go:166` recover requirement, unit repair, and `systemleg`. |
| + - `carlos-restart.path`, `carlos-stage.path` and `carlos-adopt.path`/`timer` run `carlos adopt` for tenant instances, not the edge (`internal/host/units/*`). |
| + - The OS restarters are covered by :123. |
| + - Standby suspends Auto Scaling health checks (AWS standby page, "Health status…"). The 15-minute wait only alerts. |
| +- **Departure gating** composes with the existing 120 s visibility (`internal/awsterminations/queue.go:78`) and the accepted shared-queue duplicate work (P1b-3b plan :285). |
| +- **IAM.** Inherited and excluded policies are enumerated against the verified lines. Completion is scoped to the group ARN and tags. The operator gets CompleteLifecycleAction for returns only. Managed SSM is kept with its Denies. |
| +- **Budget.** The operator reads are 2×180 rounds × 4 = 1,440, which is correct. Session Manager is ≤8. The group consumers add about 360 Receives an hour. `GroupReadersReady` adds 0 requests. There is no new per-box poll. |
| +- **Rule 4.** No executable task reads P2b. Drain, platform and EligibleBoxes stay outline only, and activation is serve-only (D2). |
| +- **D1–D4** list every user-visible restriction. Nothing is cut silently. |
| + |
| +--- |
| + |
| +**Verdict: READY AFTER FIXES.** No P1. Fix R2 P2-1 (carried R1 P2-1: code enforcement of the pre-`names-2` rollback refusal on the console system-update or fixed `systemLeg` path) without another round. The three P3s go on the follow-up list. |