carlos / platform Public

region-ha-p3b2-build

Region HA P3b-2: attended operator Standby rolls (plan docs/superpowers/plans/2026-11-04-region-ha-p3b-group.md, Task 7) under N-HA14 and N-HA19. Build only: no release, apply or drill. The dev witness is a later dated card.

What changes

  • Group members get the SSM agent (infra/modules/region-host/group-init.sh.tftpl). P3b-1 found they had none, so Session Manager, the only approved root channel, could not reach them. A failed install stops the boot before edge start.
  • Operator IAM output. The module output group_operator_policy_json is least privilege: UpdateASG, EnterStandby and ExitStandby on the exact group; describes; StartSession only on group-tagged instances with one approved document; the operator's own sessions; reads of control/edges/*. It grants no termination, no SetDesiredCapacity and no CompleteLifecycleAction.
  • Root verbs on the box: carlos system group-maintenance {status|permit|revoke|prepare|apply|rollback}. - The permit writer uses the merged Task 4 guard's own validators, and the guard's acceptance is unchanged. - prepare verifies the signed pointer and artifact digest before minimum is lowered. - apply and rollback reuse the unchanged apply body under the permit. Rollback needs an explicit same-transaction rollback permit. - status gives a bounded local snapshot, including the edge start time as a lower bound.
  • scripts/region-group-roll.py, the attended N-HA14 transaction tool. - One serialized transaction per group, with a fsynced, hash-chained journal and a group lock. - The sequence: min N to N-1, EnterStandby with decrement, deregistration readback, permit, box apply, readback, fresh admission (≤5 s before Exit), ExitStandby, InService and healthy readback, restore min, revoke last. - Every return decision comes from one pure classify() table. It never terminates, never raises desired, and never sends a lifecycle completion or ABANDON.
  • Docs: operator note, Standby witness runbook (including 7(b) with a fixed box legitimately out), follow-up list, and one plan ruling row.

Ruling change (Paul, 2026-11-05, stopping rule 2, recorded on #421). The tool refuses return hooks. If Pending:Wait is seen after ExitStandby, that is divergence: the tool journals it, alerts and blocks further rolls. If AWS's default ABANDON then terminates the member, that is a FAIL, never a pass. This replaces B3b-D's defensive CONTINUE.

Tests and review

  • Fake-provider tests (132), a seeded simulation (one 3000-seed sweep) that asserts no completion is ever sent, and plan and simulation mutations, all caught.
  • Targeted Go tests for the verbs, and mock tofu tests for the policy and user data.
  • Per-task Opus reviews: B1, B2, B2b (two fix rounds), B3 (three rounds plus the cut, under rule 2 twice).
  • Whole-branch Opus review round 1: READY AFTER FIXES, 0 P1, 1 P2 (applied: freeze region applies during rolls), 6 P3 (follow-up list).
  • Census region-ha-p3b2 APPROVED by Opus on #280.
  • CI green on the tip.
Commits 19
Discussions 0 0 open
Tasks 8/8 done

Activity