Freeze region applies during group rolls; list P3b-2 follow-ups
Carry the infrastructure freeze on the operator note and witness card while a roll is unfinished or provider divergence remains. Explain the capacity reset and correct the pointer-version refusal wording. Record the eleven P3 follow-ups from whole-branch review round 1 without opening another review. Validation: go build ./..., diff whitespace checks, and documentation completeness and source-reference checks.
docs/superpowers/notes/2026-11-05-region-ha-p3b2-followups.md+56 −0docs/superpowers/notes/2026-11-05-region-ha-p3b2-operator.md+9 −2docs/superpowers/notes/2026-11-05-region-ha-p3b2-standby-witness.md+7 −0
CI cancelled — superseded by a newer push — run details
Intent
<task-notification> <task-id>bhrywak18</task-id> <tool-use-id>toolu_0119JEwHtTanx8xwUQ8d4FbN</tool-use-id> <output-file>/home/paulca/.cache/tmp/claude-1001/-home-paulca-amadan-net-carlos-platform/e47280e8-3e59-4dc1-95d2-11de7237d34c/tasks/bhrywak18.output</output-file> <status>completed</status> <summary>Background command ".superpowers/sdd/2026-11-04-region-ha-p3b-group/run-astra.sh copy" completed (exit code 0)</summary> </task-notification>
<task-notification> <task-id>a94c69749a57ccf19</task-id> <tool-use-id>toolu_01SwDWJsTrzeULfBrZPhZ4zt</tool-use-id> <output-file>/home/paulca/.cache/tmp/claude-1001/-home-paulca-amadan-net-carlos-platform/e47280e8-3e59-4dc1-95d2-11de7237d34c/tasks/a94c69749a57ccf19.output</output-file> <status>completed</status> <summary>Agent "Whole-branch review P3b-2" 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 I found no P1 problems and one P2, a documentation fix. Every command you allowed ran once, niced, with GOCACHE left unset, and all passed: - `go build ./...` and the darwin/arm64 build: exit 0. Both printed a harmless "writing stat cache … read-only file system" warning. That comes from the read-only module download cache, not GOCACHE. - `go test ./internal/host -run TestGroupMaintenance`: ok. - `go test ./internal/provision -run 'TestPlan14RootReadCensus$'`: ok. The census is clean at e5e9b1a7. - `python3 -m unittest scripts/region_group_roll_test.py`: 132 tests OK. All 10 unit mutations and all 5 simulation mutations were caught. **Contracts checked across the pieces (no finding):** - **Tool vs IAM:** every AWS call `region-group-roll.py` makes has a matching grant in `group_operator.tf`. CompleteLifecycleAction is absent from the policy (the tftest asserts it) and from `AWS.request`. The document rules agree on both sides: `AWS-StartNonInteractiveCommand`, an account-owned document, or refusal of RunShell. - **Tool vs box verbs:** the tool calls only `/opt/carlos/carlos system group-maintenance {status|prepare|permit|revoke|apply|rollback}`. That matches `maintenanceArguments`. The permit body has exactly the fields `validateMaintenancePermit` checks, with phase `mutation` (R4). - **R10:** before mutation the tool requires accepted, unconsumed and the matching action. After mutation it requires consumed=true. - **R15:** `generation ≥ started_at + 2` with an unchanged edge identity. The edges file is written by `carlos agent`, which is the same process as `carlos-edge.service`. `RolePublishRequired` forces a fresh publication after restart, so the check can be met. - **Order end to end:** prepare (signature check plus R17/R20) → peers → lower min to N-1 → EnterStandby with decrement → wait for deregistration → permit → apply → verify → readiness no older than 5 s → ExitStandby → InService and target groups healthy → readiness again → restore min → revoke last. - **N-HA14 shape:** min N-1 / desired N-1 / max N during Standby. Desired is raised only by ExitStandby itself, never by the tool. - **T1/I4 after the cut:** - Pending:Wait leads to journal, block flag, alert and stop. - A terminated or replaced member is FAIL. - If AWS returns the member to InService on its own, the tool re-enters Standby with decrement and does not restore minimum (R16). - Nothing sends a completion. - **Fixed boxes:** behaviour is unchanged. The `Run`/`runLocked` split is the same; `systemRollbackCompleted.Error()` gives the same string; fixed mode emits an empty policy output. - **Root trust:** root reads only root-owned host.env and permit files. Any agent-cache bytes are accepted only when they match the signed digest. - **Plan edit:** only the one ruling row was added. ### P1 None. ### P2 1. **`infra/modules/region-host/group.tf:241-243` against the operator note and witness card.** - **What breaks:** N-HA14 says membership stays unchanged and no extra instance launches during Standby. Terraform owns `min_size` and `desired_capacity` (no `ignore_changes`). - **How:** a `tofu apply` of the region during an open transaction resets min and desired to N. That can happen in the 15-minute alert state, in a held member, or in an R16 divergence hold, which can last indefinitely. AWS then launches an extra instance while the member is in Standby. Afterwards ExitStandby is refused (desired+1 > max), and the transaction is stuck at "members". - **Why it matters:** the tool only notices after the damage. Neither note mentions Terraform. - **Fix:** say in the operator note and the witness's "Before the window" section that no tofu apply of the region-host module may run while any transaction is unfinished or `provider-divergence.json` exists, and put that freeze on the card. ### P3 1. **Expired permit, `scripts/region-group-roll.py:1090`.** A permit that expired before it was used is "present" but not accepted. The tool writes a new permit only when the state is "absent", and abandon is refused once write intents exist. The member is safe in Standby, but the only way forward is a hand revoke on the box. Fix: when the permit is present, unconsumed, same transaction and action, and past `expires`, journal a revoke and re-permit. 2. **Old CONTINUE protocol still in a merged test, `internal/host/group_maintenance_protocol_test.go:192`.** The Task 4 fake (`TestGroupStandbyExitPendingWait`, `…ReturnAttemptBudget`, `…ReturnAmbiguousCompletion`) still encodes the operator CONTINUE protocol your cut replaced. It isn't in this diff and changes no behaviour, but it contradicts the ruling. Follow-up: invert those tests to assert zero completions. 3. **Plan text not marked superseded.** The plan's contract table, Task 7 bullets (lines 150-158, 200-203) and cost row 255 still describe CONTINUE. The new ruling row overrides them, so this is acceptable without a further plan edit, but a later reader needs that row. 4. **`docs/superpowers/notes/2026-11-05-region-ha-p3b2-operator.md:72`.** "an unparseable pointer version is not classified as below the floor" reads as if the tool accepts such a version. The code refuses it (`release_version` check, R20). Reword. 5. **`scripts/region-group-roll.py:845`.** Readiness doesn't require edges `drained` to be false, although `HomeEligible` does. Drain is blocked for groups (D2), so this is cosmetic for now. 6. **Unpinned SSM agent package.** The ledger asked for "record on census claim", but the census basis text for `group-init.sh.tftpl` doesn't mention that root runs `dpkg -i` on an unpinned, unsigned `.deb`. Note it on #280 or the card. ### Deferred minors triage None must be fixed before merge. - **Already closed:** - B1 README wording, TMPDIR and OpenDataChannel: R7/R9. - RunShell precondition: implemented. - B1f no-document/data-channel live check: in witness Step 1. - B2 and B2f minors: folded in and R10. - B2b minors: fix round 1, R17 and R20. - Operator-note line about closing a transaction before clearing the flag: applied. - **Moot after the cut:** "ambiguous CONTINUE + InService + admission lost". - **Stay deferred:** - B1 unpinned `.deb` (see P3-6). - B1f tftest ARN built from the variable. - B1f README UpdateASG powers list. The operator note now says "can change more than minimum", which is enough for now. - B3 cut-session status ALERT (documented in the witness). - B3 rollback `already_restored` while a cut apply still runs. The member is safe in Standby, but the only way out is editing a hash-chained journal. The card should name a recovery procedure. - B3 dead `complete` tripwire in the Python fake. Round: 1 of 3. There is no P1, so under stopping rule 1 the review stops here. Apply the P2 doc fix without another round. Files reviewed: `/home/paulca/amadan.net/carlos/platform/.claude/worktrees/region-ha-p3b2-build/{scripts/region-group-roll.py, infra/modules/region-host/group_operator.tf, infra/modules/region-host/group.tf, internal/host/group_maintenance_verbs.go, internal/host/group_maintenance_prepare.go, docs/superpowers/notes/2026-11-05-region-ha-p3b2-operator.md, docs/superpowers/notes/2026-11-05-region-ha-p3b2-standby-witness.md}`.</result> <usage><subagent_tokens>192474</subagent_tokens><tool_uses>51</tool_uses><duration_ms>511464</duration_ms></usage> </task-notification>
diff --git a/docs/superpowers/notes/2026-11-05-region-ha-p3b2-followups.md b/docs/superpowers/notes/2026-11-05-region-ha-p3b2-followups.md| new file mode 100644 |
| index 000000000..d41534ac9 |
| --- /dev/null |
| +++ b/docs/superpowers/notes/2026-11-05-region-ha-p3b2-followups.md |
| @@ -0,0 +1,56 @@ |
| +# P3b-2 follow-ups |
| + |
| +Whole-branch review round 1: READY AFTER FIXES, no P1. These P3 follow-ups |
| +do not start another review round. The apply freeze and pointer-version |
| +wording are fixed in the operator note and witness design. |
| + |
| +- (a) `scripts/region-group-roll.py:1090`: when a permit is present, |
| + unconsumed, bound to the same transaction and action, and past `expires`, |
| + journal a revoke and install a fresh permit. Preserve the refusal for a |
| + consumed permit or a different transaction or action. |
| +- (b) `internal/host/group_maintenance_protocol_test.go:333`, `:440`, `:457`: |
| + `TestGroupStandbyExitPendingWait`, `TestGroupStandbyReturnAttemptBudget` |
| + and `TestGroupStandbyReturnAmbiguousCompletion` still encode operator |
| + CONTINUE. Invert them to assert zero completions and the divergence |
| + outcome required by Paul's 2026-11-05 ruling. |
| +- (c) `docs/superpowers/plans/2026-11-04-region-ha-p3b-group.md:152`, `:200`: |
| + the Standby return table and Task 7 bullets still describe CONTINUE, |
| + superseded by the Rulings row at `:28`. Mark those passages as superseded |
| + in a later plan revision; the operator must never complete a return hook. |
| +- (d) `scripts/region-group-roll.py:845` and |
| + `internal/edgesfile/admission.go:26`: require edges `drained` to be false |
| + in readiness, as `HomeEligible` already does. This is cosmetic while |
| + group drain remains blocked under D2. |
| +- (e) `infra/modules/region-host/group-init.sh.tftpl:144`: root installs an |
| + unpinned, unsigned SSM-agent package with `dpkg -i`, as scanner/pdf hosts |
| + do. Consider a versioned download path and a pinned SHA256 checked before |
| + installation. |
| +- (f) `infra/modules/region-host/tests/group_operator.tftest.hcl:168`: |
| + the B1 review reported an expected edges ARN built from a variable; keep |
| + the expectation independent of the implementation by using a literal |
| + fixture ARN. The current line already uses a literal, so retain that |
| + check when updating the fixture. |
| +- (g) `infra/modules/region-host/README.md:163`: expand the incomplete |
| + description of `UpdateAutoScalingGroup` powers to cover changes to the |
| + launch template and health-check settings as well as capacity and |
| + lifetime limits. State that the operator command's restrictions do not |
| + constrain those API request parameters in IAM. |
| +- (h) `scripts/region-group-roll.py:1054`: after a cut session, the first |
| + root-status read can encounter a still-running apply and produce ALERT. |
| + Add a bounded observation path that retains Standby and the same journal |
| + until completion is known, without replaying the consumed action. |
| +- (i) `scripts/region-group-roll.py:1266`: rollback can record |
| + `already_restored` while a cut session's apply still runs, leaving a |
| + journal edit as the only recovery. Define a controller-approved recovery |
| + procedure on the dated card, including proof that apply has stopped and |
| + preservation of the original journal, before attempting such recovery. |
| +- (j) `scripts/region_group_roll_test.py:186`: the fake retains a dead |
| + `complete` handler as a tripwire. Make that purpose explicit and preserve |
| + the assertions that any operator lifecycle completion fails the tests. |
| +- (k) `docs/superpowers/notes/2026-11-05-region-ha-p3b2-standby-witness.md:124`, |
| + `:285`, `:140`, `:54`: only the approved dev card can settle refusal of |
| + StartSession without a document, data-channel access from the real operator |
| + identity, `BoolIfExists` behavior, a pre-Exit observation at most five seconds |
| + old with real session latency, 7(b) served by a `g-` member with the fixed |
| + holder legitimately out, and SNS email confirmation. Record the live |
| + evidence and keep missing results unresolved. |
diff --git a/docs/superpowers/notes/2026-11-05-region-ha-p3b2-operator.md b/docs/superpowers/notes/2026-11-05-region-ha-p3b2-operator.md| index 600880d0f..11bcf2091 100644 |
| --- a/docs/superpowers/notes/2026-11-05-region-ha-p3b2-operator.md |
| +++ b/docs/superpowers/notes/2026-11-05-region-ha-p3b2-operator.md |
| @@ -34,6 +34,13 @@ continuing the recorded transaction. After an interrupted box action, its |
| first provider call is root status. Never replace a lost journal with a new |
| transaction to get past a refusal. |
| +Do not run `tofu apply` or make any other change to the region-host module |
| +or group while any roll transaction is unfinished or `provider-divergence.json` |
| +exists. Carry this freeze on the dated card. OpenTofu owns `min_size` and |
| +`desired_capacity` in `infra/modules/region-host/group.tf`, with no |
| +`ignore_changes`, so an apply resets both to N. AWS then launches an extra |
| +member while one is in Standby, and ExitStandby is refused. |
| + |
| ## Identity and configuration |
| Attach only the module's `group_operator_policy_json` to the approved |
| @@ -68,8 +75,8 @@ refuse. Keep the same config for the lifetime of a transaction. |
| | `min_release` | Deployment reader floor, such as `v0.34.0`. Use the card's verified floor. | |
| `min_release` accepts an optional `v` and three decimal components, without |
| -leading zeros and with at most nine digits each. It follows the release |
| -parser: an unparseable pointer version is not classified as below the floor. |
| +leading zeros and with at most nine digits each. The tool refuses a pointer |
| +version it cannot parse (R20). |
| The card must also pin known reader-capable artifact digests. This field |
| alone does not establish deployment-wide reader compatibility. The release |
| pin for `--to-sha256` is the architecture's artifact digest; it does not |
diff --git a/docs/superpowers/notes/2026-11-05-region-ha-p3b2-standby-witness.md b/docs/superpowers/notes/2026-11-05-region-ha-p3b2-standby-witness.md| index 6846920db..b493856e4 100644 |
| --- a/docs/superpowers/notes/2026-11-05-region-ha-p3b2-standby-witness.md |
| +++ b/docs/superpowers/notes/2026-11-05-region-ha-p3b2-standby-witness.md |
| @@ -22,6 +22,13 @@ does not start another review round. |
| ## Before the window |
| +The card must freeze changes to the region-host module and group while any |
| +roll transaction is unfinished or `provider-divergence.json` exists: no |
| +`tofu apply` or other change may run. OpenTofu owns `min_size` and |
| +`desired_capacity` in `infra/modules/region-host/group.tf`, with no |
| +`ignore_changes`, so an apply resets both to N. AWS then launches an extra |
| +member while one is in Standby, and ExitStandby is refused. |
| + |
| The card must pin the platform release and module revision containing the |
| SSM-agent installation, root maintenance verbs and current operator fixes. |
| Record both members' actual binary digests and the architecture-specific signed |