carlos / platform Public

Document attended group rolls and the Standby witness

Describe the current operator configuration, guarded verbs and recovery contract.

Design the later scoped provider, outage, IAM and same-member return checks,
including fault expiry, fixture placement, alarm delivery and cleanup. Keep
live evidence and the deferred copy pass with the controller.
Paul Campbell pushed by claude agent, operated by paul@keymail.dev 06bedaf74d0555ffffd8ddec4342090bb76f4945 parent 277d66c
3 files changed, +555 −0
  • docs/superpowers/notes/2026-11-05-region-ha-p3b2-operator.md +177 −0
  • docs/superpowers/notes/2026-11-05-region-ha-p3b2-standby-witness.md +371 −0
  • infra/modules/region-host/README.md +7 −0

Intent

Human

<task-notification> <task-id>bg9aukyxz</task-id> <tool-use-id>toolu_01KFiADsNQC2ruZnRniWYqeW</tool-use-id> <output-file>/home/paulca/.cache/tmp/claude-1001/-home-paulca-amadan-net-carlos-platform/e47280e8-3e59-4dc1-95d2-11de7237d34c/tasks/bg9aukyxz.output</output-file> <status>completed</status> <summary>Background command ".superpowers/sdd/2026-11-04-region-ha-p3b-group/run-astra.sh b3f" completed (exit code 0)</summary> </task-notification>

Human

<task-notification> <task-id>a42921b49e60b5572</task-id> <tool-use-id>toolu_017JhJL6GuoyeSbLAooAGwcM</tool-use-id> <output-file>/home/paulca/.cache/tmp/claude-1001/-home-paulca-amadan-net-carlos-platform/e47280e8-3e59-4dc1-95d2-11de7237d34c/tasks/a42921b49e60b5572.output</output-file> <status>completed</status> <summary>Agent "Re-review B3 fix round 1" 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>All nine items are addressed, but the fix diff adds three Important breakages, so it is not ready to close. Checkout at 277d66cb. The full suite passes (55 tests in 171 s, exit 0), and all 8 plan mutations are still caught. I confirmed each new breakage by running a short probe script against the tool with the fake provider; the scratch is deleted. Paths: S = `scripts/region-group-roll.py`, T = `scripts/region_group_roll_test.py`. **Per-item verdicts** 1. **R13: ADDRESSED.** - Apply runs `carlos system group-maintenance apply` with no host.env sourcing (S:516, 524-525). - `previous_result` refuses with separate messages for applied, rolled-back and rollback-failed, and refuses generically for any other value (S:900-903, TEXT 109-111). Tested at T:659. - Status is read right after apply and after rollback, and `verify_action` alerts on a wrong digest or a missing/unchanged edge identity (S:911-919, 975-979). Standby, permit and record are kept. Tested at T:691. 2. **R15: ADDRESSED.** Generation must be at least `started_at` + 2 s, and the whole edge dict must be equal on the reads before and after the edges read (S:713-719). The fake's publication lag is configurable (T:58, 127). Tested at T:723: a 20 s lag waits; 0, 1 and 1.999 s refuse. 3. **R17: ADDRESSED.** `min_release` is required and must parse (S:214, 218). `release_version`/`below_floor` (S:197-209) match `ParseReleaseVersion`/`ParseSemVer`/`BelowFloor`: one optional `v`, three ASCII decimal parts, no leading zeros, at most 9 digits, unparseable means not below. The check runs in `prepare` before the minimum write (S:908). Edge cases tested at T:670. `--allow-downgrade` is gone. 4. **R18: ADDRESSED.** Observation age starts at the first status response (S:664, 708). Peers and readiness use a 60 s bound (S:720). The 5 s bound applies only at dispatch of Exit (S:1110) and CONTINUE (S:1150-1151), checked after the intent is fsynced (S:659-661). The 60 s bound cannot leak in: both writes pass `freshness=ready["observed"]` from a readiness read taken right before them, and the CONTINUE retry takes a fresh read (S:1145). 5. **R19: ADDRESSED.** - A describe blip without an observed hook re-raises with no flag (S:1076-1083, 1204-1205). - An unsent Exit is tracked via `dispatched=False` (S:1085-1087, 1197-1200). - `KeyboardInterrupt` is journaled and propagates in both `call` and the adapter (S:665-672, 495-500). - The flag is set on an observed `Pending:Wait` (S:1121), or on a sent Exit followed by an unknown, terminated or replaced member (S:1089-1094). - A real `Pending:Wait` with dropped admission still FAILs at once: readiness errors, `ObservationExpired` and `exit_activity` errors all go through the return-hook FAIL path (S:1129-1130, 1197-1203). Tested at T:843, 859, 881. 6. **R16: ADDRESSED for the tested path.** After CONTINUE and an InService return, the tool requires min N-1, calls `EnterStandby(decrement=true)`, waits for Standby with both target groups deregistered, then raises `DivergenceHeld` (S:1167-1174, 1097-1100). It never restores min: S:1167 runs before S:1175. Entering Standby with min N-1 is legal (desired N → N-1). Tested at T:777. New breakage #2 below is a gap in this branch. 7. **Transport: ADDRESSED.** - Prepare's local bound is 360 s against the box's 300 s. Apply and rollback run under `timeout` 900 s plus 30 s kill, with a 990 s local bound (S:135, 525). - Session IDs are captured while output streams and journaled (S:447-451, 656-657). - `TerminateSession` is called only for this process's own captured session ID, and only on a local timeout (S:669-671). - After a cut, the next call is a status read (S:975-977). On resume, `observe_pending_action` runs first (S:921-934, 987). Tested at T:798, 931. - The "sessions can be cut" risk is in the module docstring (S:33-38). 8. **Fake fidelity: ADDRESSED.** - The rev-1 test is renamed to `test_fake_abandon_terminates_and_replaces`, with a comment naming mutation 6 as the real witness (T:471-484). - ABANDON now terminates the old iid and launches a replacement (T:73-83). - The "member terminated or replaced: failed probe" text is at S:120 and the stop at S:1089-1091. - The AWS capacity rules (raising min raises desired; `ValidationError` on entering Standby below min) are modeled at T:132-141 and tested at T:907. 9. **Minors** - (a) Min N-1 is refused unless this journal holds a `minimum` intent: **ADDRESSED** (S:996, T:901). - (b) The Exit activity is "the one Exit for this iid after this transaction's Enter", using provider activity times: **ADDRESSED** (S:1041-1062, T:914). - (c) A successful but oddly shaped Exit response is journaled as uncertain-success, then described: **ADDRESSED** (S:621-628, T:818, T:994). - (d) `status` takes no lock and opens state and journal read-only: **ADDRESSED** (S:1232-1237, 262-267, 323, T:937). - (e) The AWS config, credentials-file and CA-bundle variables pass through and are documented; access keys, profile selection and endpoint overrides are stripped: **ADDRESSED** (S:40-42, 477-483). - (f) A TTY run records `SUDO_USER`, or the login name if unset: **ADDRESSED** (S:636, T:835). All 8 mutations still fail the suite (my run: all 8 "mutation caught", suite OK). **ExitStandby/CompleteLifecycleAction:** `call("exit")` and `call("complete")` appear only in `return_member` (S:1110, 1150). The only other `enter` is the R16 hold (S:1171), which also sits inside `return_member`. **New breakage:** 1. **Important (T1/I4 return contract, liveness): a normal no-hook return now gives up while the target group is still warming up.** The fix added `if g is None or phase != "Standby": raise` (S:1204-1205). Before, a refusal while InService fell through to sleep and re-poll. Now the "all members healthy in both target groups" check (S:1158-1160) raises as soon as the returned member is InService but its target is still `initial`. Real AWS shows `initial` for at least one health-check interval after Exit, so a live roll will exit with "Refused: The provider has not completed this member's return". Probe confirmed it. The journal stays resumable and unflagged, so it is not unsafe, but every live return will need a manual `resume`. The fake hides this because it sets the target healthy at the moment of Exit (T:155). 2. **Important (R16 / N-HA14 shape): after a successful CONTINUE, a warming target group is recorded as a failed probe instead of being held in Standby.** Same cause, hook path. After CONTINUE is acknowledged and the member is InService with its target `initial`, the refusal reaches S:1201-1203 with `return-hook` set and calls `alert("return_failed", failed=True)`. Probe result: `FailedProbe`, member InService, min/desired 1/2, no hold Enter. The member is left in service with min N-1 and a failed-probe record, although CONTINUE succeeded. A later `resume` does reach the hold. The same path fires if readiness fails after InService (S:1164-1165): the R16 branch should go to EnterStandby whatever readiness says. 3. **Important (recovery after the R13 refusal; the member stays safely in Standby): rollback can no longer run after an apply whose readback failed.** `rollback()` now calls `observe_pending_action()` first (S:1029). That re-runs `verify_action` against the consumed apply and alerts again (S:932-934, 914-916). After the R13 "unchanged edge identity" refusal, rollback therefore refuses forever, and so do `resume` and `return`. Probe: roll refused, then rollback raised the same "expected artifact and a new edge process" refusal. The base rollback allowed this case. The wrong-digest case, including the box's own automatic rollback to the old binary, was already blocked before this diff (base required `binary == new`), and is now equally stuck. The transaction can only be cleared by hand. Rollback should skip the apply verification, or treat a failed apply verification as permission to roll back. **Minor (outside this diff or low risk):** - A `Pending:Wait` seen when there is no `exit-intent` (direct `return` command) or desired ≠ N is refused at S:1117-1118 before `return-hook` and the block flag are recorded. Move the `Pending:Wait` classification ahead of those checks. - Matching `BelowFloor` means unparseable pointer versions pass the floor, including iteration versions like `0.33.0-1` and pointers without a release tag (dev pointers). `groupReaderTargetAllowed` pairs that check with a digest allow-list; this tool has none. The controller should confirm R17 accepts that. - Refusals in prepare (`previous_result`, release floor, generic) leave an active transaction that cannot be finished and blocks new rolls, with no abandon path. This pattern predates the diff; R13 and R17 add more of these refusals. - After a cut session, the status read can catch an apply still running on the box (permit consumed, old binary) and ALERT. A later resume verifies correctly. **Verdict: open: new breakage 1 (no-hook return refuses on a warming target group), 2 (R16 branch fails instead of holding after a successful CONTINUE), 3 (rollback blocked after the R13 readback refusal).**</result> <usage><subagent_tokens>124732</subagent_tokens><tool_uses>26</tool_uses><duration_ms>294223</duration_ms></usage> </task-notification>

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
new file mode 100644
index 000000000..0bf4c4474
--- /dev/null
+++ b/docs/superpowers/notes/2026-11-05-region-ha-p3b2-operator.md
@@ -0,0 +1,177 @@
+# Rolling a region group member
+
+Run `scripts/region-group-roll.py` from the repository root on the shared,
+root-owned operator host. It rolls one member through Auto Scaling Standby
+and keeps a journal for recovery. You need Python 3, the AWS CLI and its
+Session Manager plugin, plus a terminal or an explicit `--attended-by` name.
+Do not run it from cron, a service, a timer or a member's credentials.
+
+These examples are for a later approved window. Replace the placeholders
+with the values on your dated card. The
+[Standby witness](2026-11-05-region-ha-p3b2-standby-witness.md) describes the
+provider observation that must pass before the first roll.
+
+```sh
+python3 scripts/region-group-roll.py --config '<config.json>' plan \
+ --member '<iid-a>' --to-sha256 '<new-artifact-sha256>'
+python3 scripts/region-group-roll.py --config '<config.json>' roll \
+ --member '<iid-a>' --to-sha256 '<new-artifact-sha256>'
+python3 scripts/region-group-roll.py --config '<config.json>' status \
+ --transaction '<transaction>'
+python3 scripts/region-group-roll.py --config '<config.json>' resume \
+ --transaction '<transaction>'
+```
+
+`plan` reads cloud state and root status and saves a local inspection log.
+It does not prepare an artifact or change the group or box. A clean plan is
+not signature verification: `roll` performs that preparation before lowering
+minimum. `status` reads only the saved journal, without taking the group
+lock or contacting AWS. Its last observation may be old.
+
+`roll` continues through return when readiness succeeds. There is no pause
+flag or separate enter-only command. `resume` reads current state before
+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.
+
+## Identity and configuration
+
+Attach only the module's `group_operator_policy_json` to the approved
+operator identity, including when you use an assumed role or SSO. The
+output creates no IAM resource. Check effective inherited permissions too:
+it is an Allow policy, not a permissions boundary.
+
+Set `group_operator_session_document_arn` to the approved document ARN in
+the deployment configuration. The tool's `document` field is its name.
+The default is `AWS-StartNonInteractiveCommand`; an approved custom document
+must belong to the same account and region. It must accept `command` and
+run noninteractive commands as root. The tool checks uid 0. The general
+`SSM-SessionManagerRunShell` document is refused. Verify actual document
+and role/SSO authorization using the witness card.
+
+The JSON config requires exactly these fields. Unknown or duplicate keys
+refuse. Keep the same config for the lifetime of a transaction.
+
+| Field | Value |
+| --- | --- |
+| `deployment` | Deployment name used by the group's tags. |
+| `account` | Account ID from the approved private card. |
+| `region` | AWS region, not the platform placement code. |
+| `group` | Exact Auto Scaling group name. |
+| `group_arn` | Full group ARN including its UUID. A recreated group is a new identity. |
+| `hook` | Exact launch-hook name. It must have a 900-second default ABANDON. |
+| `target_groups` | Exactly two distinct target-group ARNs in the same partition, account and region. |
+| `bucket` | Deployment bucket holding `control/edges/<box-ref>.json`. |
+| `document` | Approved Session Manager document name, matching the policy's ARN. |
+| `state_dir` | Absolute path to the existing shared operator state directory. |
+| `profile` | Explicit AWS CLI profile for the approved identity. |
+| `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.
+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
+require `release_tag` to be present.
+
+Provision `state_dir` as root-owned mode 0700, with root-owned ancestors
+that are not group/world writable and contain no symlinks. Every operator
+must use this directory on the same serialized host. Files are root-owned
+0600, regular, single-link files. Preserve the group lock, `active.json`,
+transaction `.jsonl` files and observation records. The group subdirectory
+is the first 32 hexadecimal characters of SHA256(`group_arn`). `plan` prints
+its path, even when the provider observation is missing.
+
+After the approved unchanged-member probe passes, the controller installs
+`provider-observation.json` in that directory with exactly these fields:
+`v: 1`, `group_arn`, `hook`, `template` (the exact described LaunchTemplate
+object with its pinned numeric version), and `documented_no_hook: true`.
+Keep the full probe evidence on the private card. Do not create this record
+from an expectation or a fake test. `provider-divergence.json` blocks further
+rolls until the controller resolves the provider contract.
+
+The tool passes through `AWS_CONFIG_FILE`, `AWS_SHARED_CREDENTIALS_FILE` and
+`AWS_CA_BUNDLE` for profile and trust configuration. It removes ambient
+access keys, profile selection and endpoint overrides from child commands.
+
+## Refusal and recovery
+
+Before group writes, the tool requires min=desired=max=N with N at least two,
+all members SSM-online, healthy InService peers in both target groups, exact
+identity, current-process admission and role publication. It also refuses a
+busy lock, another active transaction, unsafe or missing state, a missing
+provider observation, a divergence flag, an existing target permit or an
+unchanged target digest. Preparation refuses invalid preserved configuration,
+a mismatched signed artifact, a below-floor version or a previous result for
+that promotion. Applied, rolled-back and rollback-failed results have separate
+messages and do not create another request.
+
+A successful roll lowers minimum, enters Standby with decrement=true, verifies
+both deregistrations, installs the permit, applies and verifies. Return restores
+desired through ExitStandby; minimum is restored only after the same member and
+both target groups are healthy. The permit is revoked last.
+
+The tool never terminates a member, sends ABANDON or explicitly sets/raises
+desired capacity. It never suspends HealthCheck or ReplaceUnhealthy. Before
+Exit, doubt leaves the member held in Standby. If Exit has already been sent,
+read the actual lifecycle state: an uncertain response cannot establish that
+the member is still protected by Standby. An unexpected return hook blocks
+rolls; recovery completes only while freshly admitted, then holds the same
+member in Standby. Admission loss there is a failed probe, not a 15-minute
+Standby wait. See the witness's return table.
+
+The IAM policy grants no direct termination action, but its
+`UpdateAutoScalingGroup` permission can change more than minimum. Only this
+command may use it in the approved maintenance flow; the policy does not
+restrict those request parameters itself.
+
+A Standby wait alerts after 15 minutes and leaves the member, permit and
+journal for you. A consumed action is never replayed. If status cannot prove
+its completion, investigate under the existing guard. Do not delete used-action
+records, relax the permit or issue a hand restart.
+
+For an already restarted, freshly admitted member, finish with:
+
+```sh
+python3 scripts/region-group-roll.py --config '<config.json>' return \
+ --transaction '<transaction>'
+```
+
+For a completed apply still in Standby, before any Exit intent, use:
+
+```sh
+python3 scripts/region-group-roll.py --config '<config.json>' rollback \
+ --member '<iid-a>' --transaction '<transaction>'
+```
+
+Rollback revokes the apply permit and installs an explicit rollback-action
+permit with the same transaction and recorded old/new digests. It restores
+the local old artifact, verifies a new edge process and proceeds to return.
+It is not a console channel rollback or a way to recover every partial apply.
+
+All box operations use `carlos system group-maintenance
+{status|permit|revoke|prepare|apply|rollback}`. Group operators never invoke bare
+`carlos system apply`. The local permit is
+`/run/carlos-group-maintenance/permit.json`; its phase stays `mutation`.
+The operator journal carries local-verification, return and revocation phases.
+`accepted` is a validator result, not readiness. Before mutation, the action
+must match and its consumed flag must be false. After mutation, return requires
+the matching consumed action, fresh health and published admission.
+
+Prepare has a five-minute box deadline and six-minute local session bound.
+Apply/rollback have a 900-second remote transport bound, TERM then KILL after
+30 seconds, and a 990-second local session bound. A timed-out owned session
+is terminated and status is read before continuing. These bounds do not make
+a partly consumed action replayable.
+
+| Exit code | Meaning and next step |
+| --- | --- |
+| `0` | Help, clean plan, successful saved-status read or completed requested flow. A status success says nothing about live readiness. Read the journal outcome. |
+| `1` | Refused, failed or uncertain operation, including an alert or failed provider probe. Preserve state and inspect it before resuming. |
+| `2` | Invalid command-line arguments from argparse. Correct the command. |
+
+An interrupt or forced process kill is not a transaction verdict and can
+produce a signal-related exit code. Resume from the journal and actual state.
+The box verbs separately use 0 for success/help, 1 for refusal/failure and 2
+for invalid arguments; their errors begin `group-maintenance:`.
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
new file mode 100644
index 000000000..34c3ab253
--- /dev/null
+++ b/docs/superpowers/notes/2026-11-05-region-ha-p3b2-standby-witness.md
@@ -0,0 +1,371 @@
+# P3b-2 Standby witness design
+
+Use this design to prepare the later dated private dev card. No live step has
+run for this note, and this note grants no infrastructure or fault permission.
+Paul's dated, scoped go must name the operator, account, region, domains,
+resources, IAM changes, traffic effects, cost cap, UTC window and cleanup owner.
+Keep actual deployment values and evidence in that card. Examples here use
+`<group>`, `<iid-a>`, `<iid-b>` and `<fixture-host>`.
+
+The pass is one member rolled and returned with the same instance ID, plus
+proof that a restarted unready member survives an extended shared-dependency
+outage in Standby. It is not a warm drain or seamless-roll claim. Record request
+outages and the remaining lease wait separately from replacement time.
+
+Follow the [operator instructions](2026-11-05-region-ha-p3b2-operator.md).
+The sources are the [P3b plan, rev 3](../plans/2026-11-04-region-ha-p3b-group.md),
+Tasks 7 and 8, and the [HA spec, rev 6.2](../specs/2026-10-26-region-ha-without-claims-design.md),
+sections 9.5 and 12.1. The controller's build rulings put the operator in
+`scripts/region-group-roll.py` and keep the dated deployment card private.
+Plan review is closed: R1 NOT READY; R2 READY AFTER FIXES, 0 P1. This design
+does not start another review round.
+
+## Before the window
+
+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
+target digest. A missing `release_tag` is allowed. Record the verified
+`names-2` reader floor, capable artifact digests, all publishing and nonpublishing
+readers, and the console's deployed version. Do not downgrade an active or
+retained group namespace to an incompatible reader.
+
+Require two already-admitted disposable members, a healthy peer throughout
+maintenance, min=desired=max=2, an immutable numeric launch-template version,
+the exact 900-second initial hook, both target groups and preserved local
+host.env/certificates. If the SSM-capable revision is not already deployed,
+its provisioning needs a separate scoped step. Do not install software as
+part of the first Enter/Exit probe.
+
+Use the real operator role/SSO identity with only `group_operator_policy_json`
+attached, accounting for inherited grants. Pin the approved session document
+and its content/version on the card. Keep the member role's
+`AmazonSSMManagedInstanceCore` and parameter Denies. All operators use one
+root-owned state directory and one group lock. No instance, service or cron
+may run the operator.
+
+Check SNS email confirmation before faults. P3b-1 did not establish it.
+Record confirmed subscription status and an actually received test notification
+using the card's separately scoped alarm authority. Missing delivery is a
+refusal. Check retained-edges alert routing against its current prose subject,
+and preserve N-HA17's per-departure unsupported-host pages. Those pages must
+not become consumer-start failures.
+
+`plan` itself requires a completed no-hook observation, so a clean plan cannot
+be a prerequisite to the first probe. Before Step 0, inventory its other
+checks explicitly and record the expected missing-observation refusal. After
+Step 0, install the evidence record and require clean `plan` output before any
+software roll. Never fabricate the record to make this ordering work.
+
+## Step 0. Observe the unchanged member first
+
+The first live maintenance action is one disposable, unchanged-member
+Enter/ExitStandby probe. Hold the exclusive group lock on the shared operator
+host for the entire probe, with a durable probe record. The current tool has
+no probe subcommand and requires a changed artifact for `roll`; do not use
+`roll` or `return` to simulate this observation. The card must specify the
+serialized probe driver, its journal and recovery actions before approval.
+It must preserve the return invariant below with the unchanged process.
+
+1. Read back the exact member set, min/desired/max, hook, pinned template,
+ scaling activities and both target groups. Confirm both members are
+ SSM-online, admitted and healthy with successful role publication. Record
+ iid, boot ID, edge PID/start identity, artifact digest and UTC timestamps.
+2. Lower only minimum from 2 to 1. Enter Standby for `<iid-a>` with
+ decrement=true. Read back `<iid-a>` in Standby, min=desired=1, max=2,
+ unchanged membership and both target registrations absent/unused. A draining
+ target is not yet deregistered. Do not stop, repoint, install or refresh
+ anything on the member.
+3. Read fresh root status, published edges and root status again. Require
+ unchanged edge identity, health 200, admission and serve-role publication.
+ Record readiness and return intent durably; the observation must be at most
+ five seconds old immediately before ExitStandby. Exit once, then describe
+ the actual member lifecycle, activity and target states through InService.
+4. Require the same iid and process, unchanged artifact and member set, desired
+ 2 and both target groups healthy. Restore minimum to 2 only then. Record
+ zero return lifecycle completions and no observed return hook.
+
+Pass only with the documented no-return-hook behavior. AWS explicitly excludes
+Standby transitions from lifecycle-hook availability:
+[https://docs.aws.amazon.com/autoscaling/ec2/userguide/lifecycle-hooks.html](https://docs.aws.amazon.com/autoscaling/ec2/userguide/lifecycle-hooks.html).
+An activity labelled PreInService is not an instance Pending:Wait observation
+or proof of InService. Capture both API objects, not just activity text.
+
+If a return hook appears, stop the probe as a roll blocker. While freshly
+admitted, the serialized probe owner must handle any pending CONTINUE safely,
+verify same-iid InService, then EnterStandby with decrement=true and verify both
+deregistrations. Retain min=desired=1, max=2, the probe record and the same iid
+in Standby until the controller resolves the contract. Never pretend an iid
+in Pending:Wait is still in Standby. If readiness/API access drops, follow the
+failed-probe row below. Do not send ABANDON or invent a heartbeat extension.
+
+Only after a pass may the controller write root-owned 0600
+`provider-observation.json` with the exact fields in the operator instructions.
+Keep the raw observations alongside it. A new group UUID, hook or template
+requires matching evidence. Refuse all software rolls while divergence remains.
+
+## Step 1. Verify the real maintenance channel
+
+Use the card's exact operator identity and approved document on the unchanged
+members. Record request IDs, principal/session identity, document identity,
+exit status and remote uid without recording session tokens or credentials.
+
+| Check | Pass | Failure action |
+| --- | --- | --- |
+| StartSession without `--document-name` | Access denied; no usable default-shell session. | Stop before any roll. |
+| StartSession naming another document | Access denied, including an unapproved account-owned document. | Stop; do not add broad permissions to make the test run. |
+| Approved document, real role/SSO identity | Data channel opens, uid is 0 and framed root status succeeds. | Stop on access, elevation or transport failure. |
+| `ssm:SessionDocumentAccessCheck` | Live allowed/denied cases agree with the policy's `BoolIfExists` plus exact-document grant. | Keep the IAM evaluation unresolved until evidence explains it. |
+| Member reachability | Both members report SSM Online and root identity matches the card. | Refuse before AWS group writes. |
+
+Mocks pin policy shape but cannot settle these checks. Retain the effective
+policy and authorization/audit evidence under the card's observation authority.
+The maintenance identity itself has no general IAM or alarm-inspection grant.
+
+Verify effective `carlos-system-update.path` and service masks, group
+`Restart=no`, package/needrestart policy and absence of automatic SSM-agent,
+patch or reboot associations. Check that unit repair preserves these settings.
+Run `plan`; require exit 0 and no refusals. Record its inspection log and the
+full starting member/activity/target baseline.
+
+## Step 2. Show a group member serving the fixture
+
+P3b-1's 7(b) check was blocked because a fixed holder kept the fixture's
+clean-release marker and won cold wakes. A Network Load Balancer (NLB) response alone cannot show
+which box actually served the app.
+
+Recommend temporarily withdrawing only the fixed holder's hapair scope under
+the dated card. First sleep the approved born-HA fixture through the supported
+API, verify its writer is stopped, inspect lease/clean-release/debt state, then
+apply the supported scope change and observe its reconciliation. Keep the
+fixed targets registered and serving their other scopes. Scope withdrawal
+must actually make the fixed holder ineligible; it is not proof that a lease
+has been released. Require a legally free lease, or wait its remaining expiry
+under the normal acquisition rules, before the next cold wake.
+
+The alternative is the fixed holder's own attended restart window. It affects
+more tenants and a short restart may leave the same clean-release preference,
+so the card must prove the holder remains legitimately out for the wake.
+Paul's card chooses and scopes the method. Do not delete lease, clean-release,
+identity or debt records, falsify death, or change the placement chooser.
+If neither method can establish eligibility and lease release, record 7(b)
+as blocked instead of forcing placement.
+
+Cold-wake `<fixture-host>` and record request ID, response serving iid/box
+reference, app version and corresponding server log. Correlate the serving
+`g-` reference to the group's described iid, root status and published edges.
+Read the lock holder, generation, last renewal and expiry. Pass only if the
+fixture is actually served by a group member with the matching lock holder
+and one writer. A forwarding fixed edge or version header alone is insufficient.
+Record any remaining lease wait separately. Restore the original scope during
+cleanup and verify service before removing group capacity.
+
+## Step 3. Prepare a bounded one-member fault
+
+The card must include an exact, rehearsed root-owned local fault recipe before
+approval. Deliver it over the same approved Session Manager channel while that
+channel still works. Blocking SSM also removes operator access: there can be no
+plan to reconnect through the black-hole to remove it. Session Manager uses
+HTTPS to `ssm`, `ssmmessages` and `ec2messages` regional endpoints:
+[https://docs.aws.amazon.com/systems-manager/latest/userguide/session-manager-prerequisites.html](https://docs.aws.amazon.com/systems-manager/latest/userguide/session-manager-prerequisites.html).
+
+Use a uniquely named nftables table on `<iid-a>` only, with root-owned code
+and state. The card must enumerate the actual S3 and SSM destination paths,
+including private endpoints, DNS changes, IPv4/IPv6 and existing connections.
+An IP list resolved once is not proof of a continuing black-hole. Prefer a
+short-lived outbound TCP/UDP 443 drop for new service connections when the
+card can explicitly account for its wider HTTPS impact; otherwise pin and
+verify complete endpoint sets. Ensure existing S3/SSM flows are also dropped.
+Keep loopback, inbound probe responses, peer/backhaul traffic, DNS, clock and
+metadata available as required for this isolated fault. Check counters and
+failed requests to prove the block, and verify `<iid-b>` remains unaffected.
+Do not flush shared tables or alter security groups, routes or IAM to inject it.
+
+Before enabling the drop, arm and verify a root systemd timer that removes only
+this fault table after the card's bounded duration, recommended 35 minutes.
+Its service must work entirely from local files, independently of the session,
+edge process and network. Record timer/unit names, ownership, hashes, activation
+and expiry times, cleanup result and removal readback. Rehearse expiry before
+the disruptive run. If timer installation or verification fails, do not inject.
+Do not reboot during this witness. Never restart or terminate a member on expiry.
+
+`roll` has no pause-before-apply flag. Receive its apply command while SSM is
+reachable. Apply still verifies the signed pointer through S3, even after
+preparation; blocking S3 before that verification may refuse before restart.
+The card therefore needs a reviewed, pre-delivered root fault harness that
+activates after apply's cloud verification and before the new edge can admit.
+One design is a one-shot root systemd dependency at edge pre-start, bound to
+this iid/boot/transaction and the recorded Standby/deregistration evidence.
+It arms and verifies cleanup before enabling the drop, then permits that one
+already-requested guarded start. It must never initiate a restart itself.
+
+Rehearse the exact unit ordering, privileges and survival across unit repair
+with the pinned build before the card is approved. Keep the production apply
+command, framing, timeouts, masks and guard intact. No timer may start a second
+apply or make an ASG call. Record the harness, units and approved document as
+test apparatus, including hashes and removal. This note supplies the design
+requirements, not an executable harness or authority to install one. If this
+boundary cannot be enforced, stop before the fault; do not substitute a manual
+stop/restart, weaken a guard or invent a tool flag.
+
+## Step 4. Roll and hold through the outage
+
+Before starting `roll`, attempt the unattended update path and an invalid
+permit under the card's negative-test scope. Use a wrong iid/boot ID or expired
+permit through the permit verb, never a direct file replacement. Require
+refusal and zero edge stops, restarts, binary changes or symlink repoints.
+Compare process identity, binary/symlink state and service journal across each
+attempt. Do not unmask the update units to make the attempt run.
+
+Start `roll` with `<iid-a>` and the pinned new digest. Record the old artifact,
+process identity, member set and activity counters. Require signed preparation
+and preserved host.env/certificate checks before minimum drops. Record only
+hashes/metadata for secret-bearing files, never their contents.
+
+Require min=desired=1, max=2, unchanged member set and both target groups
+fully deregistered before the tool installs the valid permit. The preloaded
+harness then blocks S3+SSM at the guarded restart boundary. Collect local
+root-owned evidence independently of the SSM connection. The pass needs an
+actual new edge process under the block with tenant admission closed. If the
+cut session prevents that restart, record the interrupted-action result;
+it is not a passing restarted-outage witness and must not be bypassed.
+
+Keep the member unready in Standby for more than 15 minutes. Continue the
+bounded hold beyond 25 minutes to exercise alarm delivery. Record any
+15-minute operator alert and retain the journal, permit and same iid. Losing
+the operator connection must not cause an Exit, stop, replacement or termination.
+Retain lock ownership while the operator lives; if it dies, only the same
+journal may be resumed. A second operator must refuse the held group lock.
+
+Exercise direct HTTP, signed hop/backhaul, authenticated doors, tunnel delivery,
+timers, workers, co-spawn, sessions and duty import using the card's supported
+fixtures and network paths. For each, record request/job ID, destination iid,
+refusal or deferred-start result, and absence of tenant process creation.
+A namespace advertisement or an NLB probe does not establish admission; NLB
+can route to unhealthy targets. Retain ordinary lease, local-copy and duty
+rules. Missing fixtures mean NOT RUN, not a pass for the entire gate.
+
+Pass the hold only with the same iid and total member set, zero extra launches,
+replacements or terminations, zero lifecycle completions while unready in
+Standby, closed tenant starts and the healthy peer unaffected. Separately show
+that shared dependency loss on an already-admitted live process leaves its
+health/startup latch intact until local shutdown. Use a separate short bounded
+fault before the roll, restore access before
+apply's cloud verification, and distinguish its timestamps from the restarted
+closed-admission phase.
+
+## Step 5. Restore access and return
+
+Wait for the local fault timer to remove the block. Verify S3 and all SSM paths,
+read the root log and nftables counters, and confirm the table is gone. Restore
+operator access through the approved document. Do not refetch SSM parameters
+for restart; use preserved local configuration, certificates and binary.
+
+For a lost or cut apply session, run saved `status` and resume the same journal.
+The first remote operation must read root status. Record consumed state,
+artifact and PID/start identity. If completion is uncertain, retain Standby
+and investigate. A consumed incomplete action is not replayable. Test an
+explicit mid-apply Session Manager cut in a separately bounded repetition
+under the same card; require the same status-first behavior and no spontaneous
+return. Record the session ID, timing, remote timeout/TERM/KILL outcome and
+whether apply completed. A disconnect test is not proof that apply survived it.
+
+For a completed action, wait for fresh local health, admission and serve-role
+publication. Compare root status before and after the edges read. Require the
+same identity, expected digest and edges generation at least two seconds after
+`edge.started_at`, which is a lower bound. Measure the time from the first
+status response through the second status, journal fsync and Exit dispatch.
+The observation must still be at most five seconds old. The code permits
+60 seconds for ordinary readiness, but Exit/CONTINUE require five. Slow real
+session startup is a refusal, not permission to widen that bound.
+
+Use the tool's `return --transaction '<transaction>'` only when that state is
+established; `resume` may already complete return if readiness is restored.
+The single return controller handles these cases:
+
+| Observation | Required action and evidence |
+| --- | --- |
+| Standby, unready or stale/wrong-process evidence | No Exit or completion. Retain the member and transaction; alert after the bounded wait. |
+| Standby, freshly admitted | Persist current transaction/iid/boot/process/publication and intent, then Exit with observation age at most five seconds. |
+| Lost Exit response | Describe group, exact member, targets and activity before any write. Retry only from observed Standby with fresh evidence. Never blindly restore desired. |
+| Pending or PreInService | Observe transition; do not send another Exit or call it InService. |
+| Pending:Wait | Record provider divergence immediately. Only the serialized operator may send CONTINUE for this iid/hook after rechecking current-process admission. Journal transaction+iid+boot+process+Exit activity, each intent/outcome and at most four attempts with 1/2/4-second backoffs and two-second calls. Describe after an ambiguous response. The original launch receipt cannot suppress this action. |
+| Pending:Proceed | Observe; do not complete again. |
+| Admission/API access lost after a return hook | Record FAIL and alert immediately before the 900-second hook deadline. Send neither CONTINUE nor ABANDON. Restore reversible probe faults, stop all rolls and retain exact iid/hook/transaction/deadline. Default ABANDON may still terminate the disposable member; record that loss and replacement as a failed probe. Never use the ordinary 15-minute Standby wait here. |
+| InService, same iid, unchanged members, desired 2, both target groups healthy | On documented no-hook return, restore minimum 2, revoke permit last and verify absence. Zero return completions. On unexpected hook return, enter Standby again with decrement=true, verify deregistration, retain permit/record and block further rolls. |
+
+A divergent hook is always a failed provider-contract observation, even if
+CONTINUE safely preserves the iid. The synthetic Pending:Wait tests remain
+required offline; do not deliberately manufacture a live hook. Never interpret
+a lost session, elapsed time or old launch receipt as fresh admission.
+
+## Step 6. Exercise rollback and genuine local failure
+
+In a separately recorded roll that has completed apply but remains in Standby
+before any Exit intent, use `rollback` with the same member and transaction.
+The card's harness must make this boundary observable without a second writer;
+the tool otherwise proceeds directly to return. Require revoke of the apply
+permit, an explicit rollback permit for the same old/new pair, restoration of
+the old local artifact, a new edge process and fresh admission. Verify return,
+min=desired=max=2 and revocation through the same guard. Never clear consumption
+markers or use bare system apply to recover a failed/partial action. Record
+safe refusal when the existing guard cannot recover the action.
+
+Only after all maintenance faults are removed and both members are healthy
+may the card inject a genuine local hang outside maintenance. This has a
+separate fault scope and an expected replacement, unlike the Standby witness.
+Record exact process/iid, fault time, target exclusion, replacement launch,
+confirmed termination, queue evidence, lease expiry, boot/admission and first
+successful fixture response. Use Task 8's hang limits: exclusion within 30s,
+replacement launch within 180s, first200 within remaining lease plus 180s.
+No takeover before confirmed death and expiry. Restore a reversible hang only
+on the exact still-live process if the fault is aborted before termination.
+Do not use this step to terminate a box merely because S3 or SSM is unavailable.
+
+## Alarms, cleanup and evidence
+
+Keep alarm delivery enabled throughout. A Standby interval over 25 minutes is
+expected to trip HealthyHostCount. Annotate and acknowledge it with transaction
+ID and UTC window. Record SNS receipt, threshold/healthy readback and recovery.
+Do not lower thresholds or change the ASG deficit alarm to hide maintenance.
+For shared fixed-plus-group ingress, expected targets are 2 before, 4 during
+and 2 after group removal; withdrawing hapair scope does not deregister the
+fixed targets. A separately approved dedicated group ingress has 2 during.
+
+Remove faults first. Verify removal of the exact nftables table, timer/service,
+fault harness and temporary document changes, and close task-owned sessions.
+Keep durable operator journals, probe records and consumed-action evidence.
+Verify same-member return, min=desired=max=2, target health and permit absence
+before declaring maintenance complete. If a member is held for investigation,
+record its exact state, retained resources and named owner instead of declaring
+cleanup complete or forcing return.
+
+Restore fixed scope and verified fixture service before any group teardown.
+Sleep fixtures through the supported API and check marker/debt state. Unclear
+state means retain resources and alert. Teardown requires the card's explicit
+resource list and cleanup plan; preserve shared ingress/EIPs, buckets and
+immutable fixed identity records. No reader downgrade until zero active group
+publishers and zero retained group namespace are proven. A silent peer is not
+retirement evidence.
+
+Retain the following on the private card:
+
+- Approved scope, UTC window, operator/cleanup owners, effective IAM and session
+ document, release/module/script commits and artifact hashes.
+- Probe and transaction journals, member IDs, group UUID/template/hook, capacity,
+ target states, activity IDs/counters and every API intent/outcome or lost reply.
+- Root status before/after, boot/process identity, local configuration hashes,
+ permit/action/consumption, published generation and measured pre-Exit age.
+- Fault recipe/hash, timer and table readbacks/counters, session IDs and reconnect
+ counts, local outage timeline, all entry-path results and request outages.
+- 7(b) response identity and lock proof, remaining lease wait, genuine-hang phases,
+ termination/replacement and data-loss observations where exercised.
+- Alarm confirmation/delivery/acknowledgment/recovery, cleanup readback and every
+ PASS, FAIL, BLOCKED or NOT RUN result. Preserve failed probes as failures.
+
+Charge all operator calls and Session Manager connections, including plan,
+probe, refusals and resume. The current transport starts a new session for each
+box operation; do not claim the plan's original shared-stream connection budget
+from these tests. Have the controller reconcile actual counts with the card's
+approved budget before execution. This witness alone does not establish full
+G2, duties drained, or any producer-dependent checks that remain unrun.
diff --git a/infra/modules/region-host/README.md b/infra/modules/region-host/README.md
index a3dcddd40..18bfa7d8a 100644
--- a/infra/modules/region-host/README.md
+++ b/infra/modules/region-host/README.md
@@ -165,3 +165,10 @@ Do not associate `AWS-UpdateSSMAgent`, patch baselines, or automatic patch or
reboot jobs with group members. This module creates no State Manager
association. Keep package and agent updates inside the attended Standby
transaction, with one member held out of service at a time.
+
+Use [`scripts/region-group-roll.py`](../../../scripts/region-group-roll.py)
+for group rolls. The [operator instructions](../../../docs/superpowers/notes/2026-11-05-region-ha-p3b2-operator.md)
+cover its config, IAM, commands, exit codes and recovery. The
+[Standby witness design](../../../docs/superpowers/notes/2026-11-05-region-ha-p3b2-standby-witness.md)
+sets out the later approved probe and outage checks. Neither note authorizes
+live work. Group operators use `carlos system group-maintenance apply`.