| new file mode 100644 |
| index 000000000..25d4d471f |
| --- /dev/null |
| +++ b/docs/superpowers/plans/2026-11-04-region-ha-p3b-group.md |
| @@ -0,0 +1,275 @@ |
| +# Region HA P3b: group mode implementation plan |
| + |
| +**Goal:** Boot two disposable dev IE group boxes without claims, serve an existing born-HA hapair host through the regional Network Load Balancer (NLB), and prepare operator Standby rolls and the G2 failure drills. |
| + |
| +**Architecture:** Extend the merged admission and role readers. OpenTofu creates a fixed-size Auto Scaling group (ASG), a pinned launch template and an initial launch hook, attached to the existing ingress child module. Provider-neutral Go owns admission; AWS adapters complete the hook and supply local identity. Root owns boot, maintenance permits and hairpin rules. Existing reconciliation, publication, metrics and termination cadences do the background work. |
| + |
| +**Tech stack:** Go 1.26 and the existing Auto Scaling SDK (`go.mod:3,10`); OpenTofu/AWS provider (`infra/modules/region-host/versions.tf:1`); Linux systemd, nftables, IMDSv2 and chrony. |
| + |
| +**Spec:** `docs/superpowers/specs/2026-10-26-region-ha-without-claims-design.md`, rev 6.2, §§4.3–4.4, 9.5, 9.8, 10, 12–13, 18–21. Rev 6.2 only records the already-approved N-HA14 exception in §12.1. Read this with P3 rev 3, `2026-11-01-region-ha-p3-group.md` (called **P3** below), and discussion #421's exported rulings. |
| + |
| +**Citation base:** amadan main **016599d5b97c04b2fc5e807b834fdf38e2c7a35e**, containing P3a, P1b-3b T (`9b8b2c50`), follow-ups (`f18da984`) and the store-Deny fix (`9bd45488`). All platform source `file:line` citations below refer to this base. Proposed paths and tests are explicitly marked. No sibling branch is an implementation authority. |
| + |
| +**Status:** rev 1, draft for Opus R1. This commission writes two Markdown files and one local commit; no push, implementation, reviewer dispatch or account access. Product wording gets a Luna pass at build time; plan prose is exempt. |
| + |
| +## Rulings |
| + |
| +| Authority | Choice and invariant | |
| +|---|---| |
| +| Paul, N-HA9 | **I1/I2:** confirmed termination still waits the remaining lease. Admission, Standby and a receipt never authorize takeover or local-copy reuse. | |
| +| Paul, N-HA11, N-HA16/17 | **I3/I6/B1:** retain one 20s SQS consumer per box, durable termination evidence and rescan-to-finish. Started is a lifecycle fact, not a coverage or drain acknowledgment. | |
| +| Paul, N-HA12/15; controller R7 | **H4/I4:** preserve the 10s per-box suspect exclusion, one bounded lock reread per host/window, and cancellation classification. Do not make healthy visitor cancellation evidence of peer failure. | |
| +| Paul, N-HA14 | **T1/H5/I4:** one serialized operator Standby transaction, no unattended group update, fixed total membership during maintenance. The companion spec edit is verbatim P3's approved sentence; §10 is unchanged. | |
| +| Controller, P3a T2 cut | **H4/A1:** closed boxes retain name authority and answer 503 + Retry-After. Namespace withdrawal is not revived. Task 1 defines one reader invariant across every name class; upgrade every reader before group opt-in. | |
| +| Author's call, B3b-A | **R1/A1:** use the merged two-GET role reader. Own object wins, then existing regional default, then absent-both means serve. Create no role writer or seed bypass. Initial activation requires effective serve; see D2 for the user-visible restriction. | |
| +| Author's call, B3b-B | **N1:** a hairpinned client's address is this box's IMDS-reported public IPv4, checked against root boot identity and public-address validation. It is not the NLB EIP, a bridge address or an HTTP header. Task 5 specifies the authenticated kernel path. | |
| +| Author's call, B3b-C | **T1/A1:** the restart guard, immutable group marker and Restart=no drop-in ship with the first group, even though the attended roll drill is a later slice. An environment flag cannot disable them. | |
| +| Needs Paul, D1–D4 below | **S1/H4/I6:** dated dev go, P2b-dependent activation boundary, compute/retention cap and the sidecar drill boundary. Recommendations are explicit; none is assumed approved. | |
| + |
| +## Scope, slices and finish lines |
| + |
| +| Slice / one session | Work | Finish line | |
| +|---|---|---| |
| +| **P3b-1, visible group boot** | Tasks 1–6: names, ASG/IAM, boot/admission/receipt, restart protection, hairpin and real group alarms. Safety work and measurement travel with this slice. | A dated approved dev deployment: count=2 across two AZs; at least one new `g-` member demonstrably serves the existing born-HA nested hapair fixture via each NLB EIP after its own hook acknowledgment. Record UTC hook → receipt → admission → first 200 and version/body. Both members must admit before accepting the slice. | |
| +| **P3b-2, attended maintenance** | Task 7: private operator transaction tooling, same-iid roll/rollback/recovery, T1/I4 outage witness. Root guard semantics are already active in P3b-1. | One member returns from Standby on the new build, same iid, no extra launch; a >15m S3+SSM restart outage preserves it in Standby and then recovers. | |
| +| **P3b-3, G2 evidence** | Task 8: complete drill card and execute only after the named main-only addendum and scoped go. | Terminate, hang, direct-backhaul first-service hang, S3 loss, networking and all remaining §21 witnesses recorded; no G2 claim while any prerequisite is missing. | |
| + |
| +P3b-1 is the smallest safe first group merge, not six scaffolding merges. If it cannot fit one session, stop at three days or three compactions and hand off; do not drop the restart guard or hairpin to force a landing. Each implementation session ends at its slice's merge. Planning finishes at this local commit. |
| + |
| +**Switch-on gate:** Paul wants G3, the first carloku.com region, after dev G1/G2. Preserve the spec's G1 prerequisite for live group activation: P2b must merge and the release owner must supply G1 evidence before the group window. Executable local tasks here use only 016599d5; P2b integration remains outline. Before implementation landing, name the actual UTC release/drill window, deployment operator and cleanup owner, and obtain the scoped card approval in Task 8. A relative promise of “next release” is insufficient. Without a date or G1, keep implementation on its branch. D1 offers an explicit alternative if Paul wants an earlier limited experiment; this plan does not silently change §19. |
| + |
| +**Topology:** eu-west-1, canonical `ie`, empty record placement `CARLOS_REGION`, existing dev IE bucket, `CARLOS_POOLS=hapair` only, count=2 in two public AZ subnets. Use existing born-HA fixtures; P2a's create refusal is not bypassed by writing records. Group boxes run no console/relay/platform unit. Fixed IE boxes and their EIPs stay owned by their existing modules. Group-only fault runs require cleanly sleeping hapair fixtures and withdrawing only hapair from the fixed pair under the private approval card; retain all other pools and restore the exact configuration afterward. No production EIP transfer, old-host migration, replica design (#511), fleet provisioning, moves/import design or P6 retirement work. |
| + |
| +## Round history and stopping rules |
| + |
| +P3 plan review is **CLOSED at Opus R2, READY AFTER FIXES**, after R1's 2 P1/10 P2 and R2's 0 P1/6 P2. P3a whole-branch R1 was READY, 0 P1/0 P2/3 P3 (`docs/superpowers/reviews/REVIEW-REGION-HA-P3A-BRANCH-R1.md`). This plan replaces its group outlines with executable main-based tasks; **P3b has at most three Opus plan rounds, zero spent here**, stopping at the first with no P1. Apply that round's P2s without another round; P3s go on a follow-up list. A fourth needs Paul. Splits, renames and reviewer changes do not reset a budget. |
| + |
| +Upstream history remains closed: spec/P1a/P1b-1/P1b-2/dead-holder backoff R1–R3; P1b-3a R2/N-HA12; P2a R3/N-HA13; P1b-3b R3/N-HA16/17; follow-ups branch R2. **Namespace family:** P3a F1/F2 → N1 → R2-1/R2-2, then the ruled CUT and its incomplete-cut correction. This is not permission for another iterative withdrawal repair. Task 1 implements the brief's retained-name invariant; if the same boundary fails in two consecutive rounds, stop and offer refuse/cut/one-invariant choices under rule 2. |
| + |
| +Use `docs/superpowers/reviews/REVIEW-BRIEF-TEMPLATE.md`. Carry these histories into every brief. Only marked risky tasks get their own Opus review; every slice gets a whole-branch review and census decision. The same budget includes census and checks of newly changed root/security/termination/storage behavior after P2 fixes. At 24h without merge, report blocker, last two rounds and recommended cut on the branch discussion and to Paul; repeat daily. No reviewer is launched by this drafting session. |
| + |
| +## Current code and file map |
| + |
| +| Evidence at 016599d5 | Reuse or missing work | |
| +|---|---| |
| +| `infra/modules/region-host/main.tf:536,580`; `variables.tf:16,21`; `outputs.tf:1` | Fixed instance/EIP; caller-supplied type and volume. There is **no module default instance type**. Group resources below are new. | |
| +| `infra/modules/region-host/ingress/main.tf:1`; `ingress/outputs.tf:1,9,12`; `ingress/alarms.tf:7,28,49,70` | Reuse NLB/TGs, zone-address map, NLB SG and per-TG/regional alarms. Do not create competing ingress ownership. | |
| +| `scripts/check-region-group-plan.py:337,346,357` | Fixed/protected-resource gate exists; cross-module creates with unknown target identity still need P3a follow-up P3-2. | |
| +| `infra/modules/region-host/main.tf:153,189,195,410,456,499,843,898,722` | Existing bucket/version/metrics/SSM policies, queue and receive rights. Group-specific least privilege is absent; store DeleteObject Deny correction is present. | |
| +| `internal/boxroles/roles.go:38,50,67`; `internal/host/boxroles.go:41,53,91,114` | Strict own/default reader, error retention, change-index/backstop and 5→60s retry. No new polling or role writer needed for serve-by-absence. | |
| +| `internal/groupadmission/state.go:9,15,32,47` | `Facts`, `Launch{Group,Hook,Instance}`, `Completer.Complete(ctx, Launch)`, coalesced Admit and close-wins core already exist. | |
| +| `internal/host/group_admission.go:37,45,63,105,112,140,183,195` | Group explicitly refused; fixed path calls Admit with nil launch. Real wiring, booting publication ack and worker-after-admission helper exist. Extend them; do not add a parallel latch. | |
| +| `internal/host/agent.go:2000,2003`; `internal/hadeparture/types.go:47`; `consumer.go:73,157`; `internal/host/hadepartures_wiring.go:108,148` | Reconciled acknowledgment, actual lifecycle Started/Done/Running/Stop, existing 20s consumer and policy-scoped importer. Use Started, never goroutine creation or coverage as acknowledgment. | |
| +| `internal/host/edgesfile.go:547,558,596,617,642,954,995` | Ready reconciled routes publish before admission; role fields are applied afterward. Fresh group boxes **cannot be claimed to publish no names**. Sidecars are explicitly excluded from served names. | |
| +| `internal/edge/homemap.go:897,1065,1082`; `internal/edgesfile/homeelect.go:100,187`; `internal/edge/wakeplacement.go:32,103,163,176` | Closed-entry exact refusal and serving exclusion exist. Dial-first collision ordering is not a complete all-name ownership proof; Task 1 owns that guard. The placement projection requires the peer to publish the same host/account/app; together with pool-scoped reconciliation this excludes foreign-pool targets. Preserve the existing chooser and prove this composition in Task 6. | |
| +| `internal/hostenv/hostenv.go:39,70,131,343`; `awsssm.go:60` | Existing required/shared selections still contain claims; pool scope needs a group-specific allowlist and bounded SSM pagination. | |
| +| `internal/host/installchannel.go:442,457,464,481` | Missing first floor object currently refuses. The spec's no-floor group boot is not implemented; Task 3 must add it explicitly. | |
| +| `internal/host/boxreference.go:34,40,77,98`; `boxrecord.go:121,158`; `awsaddr.go:31,51,75`; `boxaddress.go:50,79`; `internal/edge/door.go:142` | Signed group identity and metadata address adapter exist. `ipv4Only` checks syntax only; public-source validation and kernel hairpin authentication remain new. | |
| +| `internal/host/agent.go:3451,5436`; `systemapply.go:296,552,771,1788,2008`; `systemunits.go:56`; `units/carlos-edge.service:23` | System update, unit repair, apply/recover/rollback and Restart=always remain live paths. All group variants need one root guard. | |
| +| `internal/host/group_metrics.go:25,47,72`; `memwatch.go:115,128,143,164`; `infra/modules/region-host/group_alarms.tf:8` | Metrics explicitly exclude groups today; append group samples on the existing minute batch. Queue-age alarm exists. | |
| +| `internal/console/regioningress.go:12`; `internal/console/apiboxroles.go:14,26`; `hostclaimops.go:50,59`; `awsregionmetric.go:26` | Configured public ingress parser exists. Role vocabulary remains claim-era; claim-free verified EligibleBoxes startup is P2b, not an executable dependency here. | |
| +| `internal/provision/reconcile.go:515,3286,3314`; `internal/host/hadepartures_wiring.go:108,120`; `internal/host/hadepartures.go:33,54` | Region/pool reconciliation and importer policy are present. Test the composed hapair-only path; consumer admission must not wait for every unrelated departure to complete (N-HA17). | |
| + |
| +External, read-only evidence: private `platform-infrastructure` HEAD **e57979d85a05a31f0b51d3bee071f0f14a860187**, `dev/region-ie.tf:10,11` and `dev/region-ie-b.tf:14,15`, uses `t4g.micro`/20 GiB. It is neither a platform-main citation nor live inventory. P3a ledger at `.claude/worktrees/region-ha-p3/.superpowers/sdd/2026-11-03-region-ha-p3a/progress.md` explicitly defers group resources, hook adapter/receipt/marker/guard, boot/IAM/hairpin and group/EligibleBoxes alarms to this work. |
| + |
| +## Global constraints and review focus |
| + |
| +**I1–I6:** retain normal lease acquire, positive local-copy proof, duty adoption and forwarding/accounting. N-HA9's remaining 15-minute lease is reported separately from replacement time. Retain N-HA17's per-departure unsupported-host pages; never turn those into consumer-start failure. No replica feature or earlier takeover. **H4/R1:** capacity is advisory for existing hosts; role errors close new starts but cannot cause a previously admitted process to exit. After admission, shared S3/SSM/reconcile/publication failures leave startup facts and health latched until local shutdown (§9.5). |
| + |
| +**A1/I4:** an NLB can route to unhealthy targets. Direct HTTP, signed backhaul, authenticated doors, tunnel delivery, schedules, workers, co-spawn, sessions and duty import all remain behind the same tenant-start gate. Groups have no fixed platform/unit exemption. **N1:** root accepts only root-owned configuration, never agent receipt content as authority; no header-based proxy trust. **B1:** local gates, hairpin and permit reads add zero cloud requests. No new per-box poll. |
| + |
| +Review the actual production wiring, response-loss windows, namespace ownership versus dial eligibility, IAM Deny/Allow composition, all restart-capable root entries, and egress enforcement before DNAT. A passing isolated helper is insufficient. Keep fixed-mode wire fields, unit behavior, SDK metric inputs and resource addresses unchanged. The three P3a branch P3s are addressed in Tasks 1–3; the separate `region-ha-followups-p3.md` remains a follow-up list, not a new review round. Task 8 checks its alert-routing/identity limits on the card. |
| + |
| +### Task 1: Retain every name while admission is closed [own review: routing authority/cache] |
| + |
| +**Files:** existing `internal/host/edgesfile.go`, `internal/edge/{homemap.go,edge.go,wakeplacement.go}`, `internal/edgesfile/{homeelect.go,snapshot.go,fold.go}`, existing `internal/console/boxselect.go` and `boxselect_ha_test.go`, and their home/alias tests; proposed `internal/edgesfile/{nameauthority.go,nameauthority_test.go}`, `internal/edge/group_names_test.go`, `internal/host/group_names_test.go`. Read every consumer of host/name fields, including console election, aliases, asset authorities, certificates and steering; change a consumer only where the shared predicate requires it. |
| + |
| +- [ ] Write failing `TestGroupNamesBeforeAdmission` through real reconcile → edges publication → peer fold. Enumerate exact routes, platform aliases, plain aliases, instance catch-alls, delegated served catch-alls, cert-only wildcard parents, replica-marked names and path-owner ambiguity. Sidecar names remain absent. Cross two accounts, an admitted peer's own catch-all, no address, stale/malformed admission and all role states. Confirm real routes can exist before hook completion; do not infer an empty namespace from an empty disk. |
| +- [ ] **One H4/A1 invariant:** admission changes who may serve a name, never who owns it or whether a real route exists. Implement one pure name-authority resolution helper in `internal/edgesfile/nameauthority.go`, consumed by peer fold/election and exact-versus-local-fallback dispatch. Inputs retain class, owner/target, lifetime ordering and service eligibility separately. Output distinguishes absent, held and dialable, with a separate real-route bit. Proposed interface: `ResolveNameAuthority(name string, local []NameClaim, peers []NameClaim) NameResolution`; `NameClaim` carries class, account/app/target, stamp/lifetime, eligibility and dial point; `NameResolution` carries Absent/Held/Dialable, RouteExists, owner/target and optional dial. Derive claims from the existing wire schema and local route map; make all consumers use this resolution rather than independently interpreting a held bit. Keep existing wire rows; do not introduce withdrawal or a generic held wildcard that masks another admitted app. |
| +- [ ] Resolve ownership first: real route beats another account's alias even when the route is closed; exact name beats a catch-all. Within the same established owner/target, a serving peer may supply the dial under the existing lifetime rules. A held exact entry refuses 503 with no holder and no fallback to another account. Cert-only parents supply certificates, no route/namespace reservation. A closed wildcard supplies no new concrete ownership over names served by an admitted peer's own valid catch-all. Unknown owner identity cannot authorize a cross-account dial. Preserve switch-off legacy behavior and single-hop accounting. |
| +- [ ] Add `TestGroupNameClassCensus`: schema/producer inventory must fail when a new name-bearing field or derivation appears without a table row. Drive actual `ServeHTTP`, `ExactHome`, `Owner`, console home election and `DeploymentRoutesComplete` consequences; route existence must survive admission closure and aliases must not gain route authority. Run `nice -n 19 go test ./internal/edgesfile ./internal/edge ./internal/host ./internal/console -run 'TestGroupName|Test.*Booting|Test.*Alias|Test.*HomeElect' -count=1` before/after. |
| +- [ ] Mutation witnesses, at most six: drop closed real-route bit; let admitted alias beat closed route; let held exact fall through; treat cert-only as route; let closed wildcard mask local admitted catch-all; omit a name class. Every mutation must fail the production-path guard. Before group activation, deployment owner records every box/console reader on the accepted build. Rollback cannot put an old reader beside active group publishers. |
| +- [ ] Take P3a P3-1 in existing `internal/boxroles/{roles.go,roles_test.go}` and proposed `internal/boxroles/imports_test.go`: replace boxroles' `release.Store` dependency with a one-method `Get(context.Context,string) ([]byte,string,error)` interface; preserve its two GETs/strict decoding. Extend the import assertion to both boxroles and groupadmission. This is a dependency cut, no role protocol change. |
| + |
| +### Task 2: Fixed-size group and least-authority IAM [own review: infrastructure/security/termination] |
| + |
| +**Files:** existing `infra/modules/region-host/{main.tf,variables.tf,outputs.tf,group_alarms.tf}`, `scripts/check-region-group-plan.py`, `scripts/check_region_group_plan_test.py`; proposed `infra/modules/region-host/{group.tf,group_iam.tf,tests/group.tftest.hcl,tests/group_iam.tftest.hcl}`. Ingress remains its own owner. Preserve existing fixed tests; new group fixtures use mock providers only. |
| + |
| +- [ ] Failing tests `group_shape`, `fixed_state_unchanged`, `invalid_group_inputs`, `group_iam_exact_scope`, `group_no_control_writes`. Add mode=fixed default/group, integer box_count≥1 (dev card ≥2), explicit VPC plus ≥2 distinct public-AZ subnets, pinned AMI/numeric launch-template version, validated deployment/region/bucket/pool/bootstrap configuration. Refuse fixed subnet/group mixtures, relay/console settings, wrong-VPC zones and duplicate EIPs. Fixed outputs keep meaning; group instance_id is null, group outputs additive. |
| +- [ ] Instantiate a distinct group module beside fixed roots. Allow it to consume an existing ingress output bundle (TG ARNs, NLB SG, own-region EIPs) so the dev root can reuse P3a ingress without moving its state; optionally create the same child for a new region, with exactly one owner. Check TG VPC, enabled AZs and address/config agreement. ASG attaches directly to both TGs; no attachment controller. New host SG: 80 only NLB SG, 443 NLB SG plus public signed backhaul; keep VPC backhaul rule, no SSH/extra IPv6 path. NLB egress remains VPC/ports, avoiding an SG cycle. |
| +- [ ] ASG min=max=desired=count, ELB+EC2 health, 60s grace, suspended AZRebalance, no refresh/scaling policy/maximum instance lifetime/Spot replacement. Use **initial_lifecycle_hook**, launching transition, 900s, default ABANDON; policies/hook must exist for initial instances. Template uses same encrypted gp3/delete-on-termination volume, IMDSv2 hop1 and public IPv4. Pin release/AMI; no automatic template adoption. Ordinary tofu count decreases stay refused; N-HA14 is an operator API transaction only. No apply while a transaction is open. |
| +- [ ] Add explicit fixed state moves only where count conversion requires them; preserve every fixed resource's attributes. Extend plan gate's known-identity guard for unknown `instance_id`, `network_interface_id`, `role`, `allocation_id` on cross-module creates (P3a P3-2). Test state/volume/ENI attachments, moved names and targeted closure drift. New group creates with expected unknown identities need a **specific resolved group-resource provenance**, not a global unknown exemption; unrelated ambiguous creates refuse. Fixed-target attachment exception remains limited to reviewed create/delete. No new blanket override. |
| +- [ ] Group IAM: define regional=`arn:<partition>:ssm:<aws-region>:<account>:parameter/carlos/<deployment>/<region>` and shared=`arn:<partition>:ssm:<aws-region>:<account>:parameter/carlos/<deployment>/shared`. Regional/shared SSM exact-path AND descendant sets in Allow and NotResource Deny are `[regional, regional+"/*", shared, shared+"/*"]`; no ancestor, sibling or release-key reads. Put bootstrap/hash/ingress under regional `boot/`, outside nonrecursive env enumeration. Configuration KMS key only, ViaService=regional SSM and matching PARAMETER_ARN. CompleteLifecycleAction only exact account/region/group-name ARN (UUID wildcard only), matching deployment/region tags; no box UpdateASG, Enter/ExitStandby, heartbeat, SetInstanceHealth, RegisterTargets or EC2 writes. Scoped DescribeInstances region only; remove broader duplicate inventory grant for groups. |
| +- [ ] Audit final policy composition, including managed attachments. Group denies Put/Delete/tagging on `control/box-roles/*`; preserve existing signed identity, termination proof, edges and lease consumers and the merged store-Deny correction. Drop broad DeleteObjectVersion/ListBucketVersions; if a merged consumer needs versions, enumerate its exact object prefix and conditioned LIST prefix with a positive witness. Keep console inventory/writer rights on fixed roles. Box gets existing queue receive/delete/attributes only; no new queue consumer or IAM write rights. Operator seed and maintenance privileges are separate, scoped on the approval card. |
| +- [ ] Run mock `tofu test -filter=tests/group.tftest.hcl` and `-filter=tests/group_iam.tftest.hcl`, plus Python gate fixtures, from owned initialized local fixtures; first FAIL then PASS. Run module fmt check. Mutate six rails: no initial hook, wildcard completion, dropped Deny, decrement via tofu, changed fixed resource, unknown foreign identity. Never use an account-backed plan as a unit test. |
| + |
| +### Task 3: Claim-free boot, hook and receipt [own review: root/admission/termination] |
| + |
| +**Files:** existing `internal/host/{group_admission.go,agent.go,installchannel.go,bootstrap.go,boxroles.go}`, `internal/hostenv/{hostenv.go,awsssm.go,cli.go}` and existing `hostenv_test.go`, `write_linux_test.go`; existing host tests `group_admission_test.go`, `installchannel_test.go`, `host_test.go`; proposed `internal/awsregiongroup/{complete.go,complete_test.go}`, `internal/host/{group_boot.go,group_boot_test.go,group_receipt.go,group_receipt_test.go,group_config_linux.go,group_config_test.go}`, `infra/modules/region-host/group-init.sh.tftpl`. Extend existing host-env command plumbing and `docs/site/cli.md` for any option change; no separate public administration command. |
| + |
| +- [ ] Failing-first tests: `TestGroupBootOrder`, `TestGroupHostEnvNoClaims`, `TestGroupHostEnvPools`, `TestGroupHostEnvRegions`, `TestGroupInstallFloor`, `TestGroupAdmissionLifecycle`, `TestGroupAdmissionReceiptCrash`, `TestGroupAdmissionNoHibernate`. Refuse missing hibernate configuration at startup (P3a P3-3), rather than waiting forever for a consumer which cannot arm. |
| +- [ ] Boot hardening precedes credentials/tenant execution: nft IMDSv4/v6 denial, chrony, service account, root-owned no-symlink directories. Write immutable root-owned 0644 `/etc/carlos/group.json` (non-secret version/account/region/group/hook/deployment/placement/pools/config digest), separate `/etc/carlos/region-config.json`, and task-4 group unit protection before starting anything. Require the marker and matching unit/configuration on every group entry; `CARLOS_BOX_REFERENCE=group`, admission=1, HA=true and index=read must agree. Missing/unsafe marker, claims enabled, wrong identity or switch mismatch refuses; no fixed-mode fallback. |
| +- [ ] Read operator-protected bootstrap object key/version and SHA from SSM once; verify object before any exec. New group-specific hostenv selection omits every `CARLOS_HOST_CLAIM*`, accepts explicit validated `CARLOS_POOLS`, AWS_REGION for deployment bucket, queue URL, platform ingress and canonical region separately from record placement. Compare env scope to marker, require hapair only on dev; never default empty pools to shared. Keep fixed allowlists unchanged. Bound configuration to 100 parameters/20 SSM pages at MaxResults=10, reject duplicate/conflicting keys, no secret logs or shell sourcing. |
| +- [ ] Run existing bootstrap then install-channel with safely parsed host.env. Add proposed `checkGroupInstallFloor` observation: both floor and authorization genuinely absent permits claim-free installation; either alone, unreadable, invalid or too new refuses. Observe both once. Published floor still verifies signed identity/image; no-floor still verifies signed pointer/artifact. Existing claims/--policy install stays strict; unreadable/local guard participation refuses. No fabricated identity or guard-arm. Retain `TestBootstrapAppliesTmpfilesBeforeArming` and `TestReconcileMintsNestedUnderANestedIntent`. |
| +- [ ] Install/read back hairpin and Restart=no before agent. Whole boot must finish within the original 900s hook deadline; healthy consumer startup budgets ≤30s separately from first full reconcile and booting publication. Reuse `wireAgentAdmission`, actual `Lifecycle.Started()` and matching booting `EdgesPublished`; use nonnil Launch/Completer for first group boot. Do not complete from requests or public health checks. Full local six-condition health plus four facts precedes CONTINUE; post-call health/closure recheck precedes opening. No host orchestration mutex may be held across the cloud call; Close must win while completion is in flight, as the core already allows. Platform role on a group is refused. A drain role is not “drained”; until its producer merges the activation preflight is serve-only (D2). |
| +- [ ] Adapter validates own signed iid/account/region against immutable group/hook, sends CompleteLifecycleAction by InstanceId, and disables SDK retries. Bound completion to four total 2s attempts, 1/2/4s backoffs; **budget is per launch, not per tick**. Persist attempt/unknown state locally so an agent restart cannot reset it. Definite failed initial boot may send ABANDON within that same total; early failures without a working adapter rely on default ABANDON at 900s. No heartbeat extensions. Ambiguous CONTINUE stays closed; do not follow it with a guessed success or keep issuing CONTINUE on later ticks. Alarm and health-driven initial-launch cleanup cover accepted-but-unrecorded success; observe no accumulating live Pending members. |
| +- [ ] Host wrapper fsyncs atomic `/data/carlos/group-admission/receipt.json` before reporting successful completion: carlos-owned 0700 parent/0600 file, no symlinks, bound account/region/iid/group/hook/config digest. **Root never reads this agent receipt.** On admitted maintenance restart, a valid same-identity receipt suppresses completion only; all local facts and readiness must recur. Operator-mediated config rebind verifies original completion evidence, not a root trust of agent content. Wrong iid/group/hook, corrupt/absent receipt and “no active hook” never count as acknowledgment. Such an admitted member stays in Standby; no ABANDON/timeout replacement. Reboot needs new boot-id permit and address verification. |
| +- [ ] Drive real direct/hop/door/tunnel and timer/worker/session/co-spawn/duty-import paths with withheld facts: zero acquires, key mints, restores, starts or holder headers. Close admission before shutdown/consumer Stop; Done is not synthesized. Test ack-before-receipt, receipt-before-publication, lost response, persistence failure, close-during-complete, duplicate callbacks and no retry after exhaustion. Run targeted host/groupadmission/awsregiongroup/activator/edge/hostenv tests (`-run 'TestGroup|TestPreAdmission|TestAdmission'`, nice 19) FAIL→PASS. Mutate eight rails: nil group launch, early ack, fake Started, receipt reuse, retry reset, no-floor error-as-absence, pool mismatch, shutdown reopening. |
| + |
| +### Task 4: One root restart guard [own review: root/termination] |
| + |
| +**Files:** proposed `internal/host/{group_maintenance.go,group_maintenance_test.go}`, `internal/host/units/carlos-edge-group.conf`; existing `internal/host/{agent.go,systemleg.go,systemunits.go,systemapply.go,bootstrap.go,systemleg_test.go,systemunits_test.go,systemapply_test.go}`. Operator automation is Task 7; define and test its transaction protocol here with fakes so the first group already has enforceable protection. |
| + |
| +- [ ] `TestGroupMaintenanceRestartGuard` fails first on every actual apply/recover/rollback/quiesce/repoint/unit-repair entry. Central `requireGroupMaintenance` reads only root-owned marker and permit under `/etc/carlos` and `/run/carlos/group-maintenance/permit.json`: strict bounded schema, uid0, mode0600, regular single-link file, no symlink path traversal, boot-id and exact account/region/group/iid/transaction/old+new signed artifact digests. Checks occur under the mutation lock before any stop, repoint or recovery side effect. Agent-writable data is never a permit. |
| +- [ ] Disable group systemLeg; mask automatic system-update path/service, make unit repair preserve masks and the group-only `Restart=no` drop-in. Keep fixed units unchanged. A stale queued update cannot stop/repoint; an absent flag cannot remove marker enforcement. Add root gate to direct install-channel reentry on an already-booted member, so it cannot bypass system-apply protection. First boot's installation permission is consumed before edge starts, never reusable as maintenance permission. |
| +- [ ] Permits are installed only by the authenticated deployment operator **after** ASG Standby and both TG deregistration readback. Permit phases distinguish mutation, local verification, return and revocation; expiry refuses further mutation but never terminates or exits Standby. An already-used mutation cannot replay under a stale permit; same transaction may explicitly authorize rollback to the recorded old artifact. Operator loss leaves durable transaction/Standby intact. Root receipt/config file tampering tests are independent of agent admission tests. |
| +- [ ] Fake transaction tests require N≥2, one transaction and admitted healthy peer; lower min N→N-1 (desired/max N), EnterStandby(decrement=true), verify exact iid/desired N-1/min N-1/max N and deregistration, then permit/close/restart. Return only after fresh full admission and role publication: ExitStandby increments desired N, verify same iid InService/healthy, restore min N, revoke last. Never blindly repair desired after an ambiguous response; read actual phase. No global suspension of HealthCheck/ReplaceUnhealthy, no EnterStandby without decrement. |
| +- [ ] `TestGroupSharedDependencyHealth`, `TestGroupMaintenanceCrashResume`, `TestGroupUnitsCannotRearmUpdate` prove S3/SSM errors leave an admitted live process healthy; restarted member stays closed in Standby. Use preserved host.env/certs/binary, no restart-time SSM refresh. Fifteen-minute wait only alerts/returns to operator. Fake time advances beyond grace/threshold/wait without replacement. Run targeted `nice -n 19 go test ./internal/host -run 'TestGroupMaintenance|TestGroupSharedDependency|TestGroupUnits' -count=1`. Mutate seven rails: absent permit allowed, check after stop, wrong iid/boot-id, agent receipt trusted, repaired Restart=always, automatic ExitStandby, timeout termination. |
| + |
| +### Task 5: Own-region hairpin with a verified public source [own review: root/network trust] |
| + |
| +**Files:** proposed `internal/hairpin/{rules.go,rules_test.go}`, `internal/host/{group_hairpin.go,group_hairpin_rootrunner_linux_test.go}`, `internal/edge/{hairpin_linux.go,hairpin_other.go,hairpin_test.go}`, `infra/modules/region-host/hairpin.sh.tftpl`; existing group boot, `internal/edge/edge.go`, unit rendering and tests. Non-Linux builds retain an explicit unsupported group-hairpin result. |
| + |
| +- [ ] Failing `TestHairpinRules`, `TestHairpinPublicIdentity`, `TestHairpinOriginalDestination`: strict versioned root-owned `/etc/carlos/region-ingress.json`, 1–16 distinct canonical public IPv4 literals, own region only. No hostnames, arbitrary nft fragments or environment interpolation. Root owns the ruleset table and configuration. Existing metadata source is reused, but syntax-only `ipv4Only` is insufficient. |
| +- [ ] **Verified address:** at boot root reads IMDSv2 public-ipv4 from this instance, verifies signed identity against marker account/region/iid, checks public global IPv4 using the `usableDoorAddr` property plus rejection of non-public/reserved ranges, and writes a root-owned runtime snapshot bound to boot-id. The identity document does not itself sign the public-IP leaf; provenance is the local protected IMDS channel. Group boot refuses a conflicting env address override. The edge revalidates snapshot ownership/schema/boot binding before enabling hairpin; missing/unknown/private source refuses before tenant dispatch. It represents the local caller's public egress address; an outside client keeps its actual socket address. |
| +- [ ] Concrete path: two dedicated listeners bound to the validated primary host address at reserved ports 18080/18443, separate from ordinary 80/443. Root nft output DNAT catches host-network root/agent/tenant/sidecar calls to configured EIP:80/443; a corresponding prerouting rule covers supported tenant bridge/rootfs namespaces. Input filter admits these ports only for connection-tracked DNAT from local output or enumerated tenant interfaces with that original destination/port. All external/VPC/direct-port traffic is denied. No route_localnet or widened loopback trust. |
| +- [ ] Linux accept wrapper obtains the kernel's original destination (`SO_ORIGINAL_DST`) before TLS, verifies it against the root list/port and dedicated listener, and supplies an unforgeable connection-context hairpin mark. Handler normalizes RemoteAddr to verified public box IPv4 before rate/accounting/forward signing; strip/replace spoofed forwarding fields using the ordinary public path. No HTTP header or caller-set socket mark opts in. Preserve Host/SNI, TLS cert selection, WebSocket upgrades, request method/body and single-hop behavior. Even if input filtering is accidentally bypassed, a direct dedicated-port connection has the wrong original destination and refuses. |
| +- [ ] Prove cgroup egress checks still evaluate the requested ingress EIP, before rewrite, for host and namespace paths. Never solve a failed witness by permitting private/loopback destinations. Atomically replace only the owned nft table; persist/reload before tenant units. Address changes need explicit root reseed under maintenance; an ordinary process restart retains verified boot snapshot, stop/start or reboot re-verifies. No DNS/SSM/IMDS polling is added. |
| +- [ ] `TestHairpinKernelAgentTenantSidecar` runs on the designated Linux root runner (never sudo on this shared machine): real agent, nested tenant, standalone sidecar and supported rootfs namespace, both EIPs, GET/POST/TLS/WebSocket. Check tenant-observed address and derived client headers; public ingress headers cannot impersonate local hairpin. Test IMDSv4/v6 denial, egress-denied EIP, direct-port forgery, wrong original destination, no rewrite loops, reboot ordering and owned-table rollback. A skipped root test is not acceptance. Mutate six rails: trust header, use private source, broad destination rule, bypass original-destination check, weaken egress, omit namespace path. Local pure tests run with nice 19; network-layout refusal that cuts supported callers goes back to Paul, not silently to a limitation note. |
| + |
| +### Task 6: Group observability and first visible slice |
| + |
| +**Files:** existing `internal/host/{group_metrics.go,memwatch.go,group_metrics_test.go,memwatch_test.go}`, `internal/groupadmission/observability.go`, `infra/modules/region-host/group_alarms.tf` and tests; proposed `infra/modules/region-host/tests/group_alarms.tftest.hcl`, `internal/host/group_boot_budget_test.go`; existing `internal/sim/regionha/{world_test.go,actions_test.go,invariants_test.go,sim_test.go}` and proposed `group_admission_test.go` in that directory. Whole-branch review covers instrumentation; any changed security/root behavior still gets the scoped check. |
| + |
| +- [ ] FAIL→PASS `TestGroupPoolIsolation` through real reconcile/publication/wakeSnapshot/CanAdopt (shared-only, hapair-only and combined peers), `TestGroupMetricsBatch`, `TestGroupAlarmProducers`, `TestGroupBootRequestBudget`: extend existing minute batch, actual box AWS region. Preserve original InstanceId MemAvailablePercent/PSI bytes; append group-name memory/clock/admitted plus existing Deployment+Region admission/clock samples. No second sampler or S3 object. Keep fixed switch-off input byte-identical. Chrony remains fixed absolute command, 1s/4KiB, synchronized/finite parsed offset; unknown is not zero. |
| +- [ ] Keep NLB alarm ownership in ingress: each TG UnHealthy maximum >0 for 10/10 minutes; Healthy minimum <count for 25/25; missing breaching. Add ASG metric math `GroupInServiceInstances - GroupDesiredCapacity < 0`, 1/1 minute, missing breaching; use actual desired so approved Standby is not misreported as missing membership. Group memory minimum <15%, 3/3 minutes, missing breaching; group clock maximum >1s, 1/1 minute. Existing queue age >600s stays. EventBridge launch-unsuccessful events scoped to group notify same-region SNS; no brittle Cause-text filter. Timeout/default ABANDON and group-size deficit are both witnesses. Alerts never trigger replacement for S3 loss. |
| +- [ ] Enumerate producers before arming alarms. P2b EligibleBoxes remains outline, not a zero/dummy stream. Record per-iid diagnostic evidence: regional aggregate clock samples alone cannot prove every member reported. Test low-member memory, missing clock, hook failure, recovery and SNS region. No missing-data suppression that invents healthy capacity. |
| +- [ ] Extend actual simulation with boot/hook/response-loss/admission/first-direct-service hang and maintenance actions; retain I1–I6 and merged production predicates. Mutation pre-admission service and failed-health completion must fail; one serial nice-19 3,000-seed sweep per implementation revision. Do not model unmerged drain as complete. Run named metrics/budget/mock tests; no extra task review solely for metrics. |
| +- [ ] Complete census/whole-branch review and Task 8's first-service subsection under a dated scoped go. Reuse dev ingress or separately approved group ingress, set console full ingress **before** group publication, roll all readers first, verify exact SSM path reads with the actual box role, and show signed release/version and hapair service. No empty NLB acceptance. Only then land P3b-1 through amadan with exact-tip green CI; read main CI afterward. |
| + |
| +### Task 7: Operator Standby roll and T1/I4 witness [own review: root/termination] |
| + |
| +**Files:** later, separate `platform-infrastructure` branch: proposed `scripts/roll-region-group.sh`, proposed `scripts/tests/roll-region-group-test.sh` for fake-AWS/transport tests, `dev/region-ha-group.tf`, and `docs/superpowers/notes/2026-11-04-region-ha-p3b-dev-drill.md`. These are proposed private paths, not existing interfaces. This planning commission writes none of them. Platform changes, if needed by testing, remain in Task 4's reviewed guard. |
| + |
| +- [ ] Implement Task 4's phase machine as an attended operator command, with a durable root-on-operator-host record keyed by group and transaction, exclusive group lock and authenticated root delivery. All supported operators must share that serialized release entry; a second writer or lost record refuses before changes. Record before/after API intents and responses, exact iid, member set, artifact digests, permit state and target readback. Restrict operator IAM to named group UpdateASG/EnterStandby/ExitStandby and required describes; termination is separate scoped fault authority. No cron, daemon or box credential can run it. |
| +- [ ] Fake-provider failing-first `standby_roll_order`, `standby_response_loss`, `standby_resume`, `standby_shared_outage` cover every write boundary including operator death after Enter/ExitStandby and before restoring min. Refuse unsupported hand restarts **before** issuing systemctl stop. Validate staged signature and old local configuration before lowering minimum. Keep the same iid; do not refetch SSM to restart. A local-failure termination requires independent evidence and scoped authority. |
| +- [ ] Live witness, later approved: capture member IDs/activity counters; admit two members; roll one. Attempt unattended update and invalid permit (zero stop/repoint). In Standby black-hole S3+SSM, restart, drive direct/hop/door/tunnel/timer paths, hold >15 minutes, lose/recover operator connection. Require same iid, no extra launch/replacement/termination, no lifecycle completion, closed tenant admission. Restore access, re-admit/publish, return same iid and restore min=desired=max=2. Test rollback/recovery through the same guard. Then hang outside maintenance to prove genuine local failure still replaces. |
| +- [ ] Bound each operator wait to 15m, then alert and retain Standby/permit/record; no automatic timeout action. Run fake tests before scoped live go; mutate decrement=false, permit-before-Standby, blind desired reset, exit-on-timeout, ignored transaction lock (five). Warm multi-tenant drain/readiness claims wait for the outline below; a maintenance restart is not certification that duties drained. Record any held-request outage and remaining-lease wait, never promise seamless roll. |
| + |
| +### Task 8: Dev approval and G2 drill card |
| + |
| +**Files:** proposed private `dev/region-ha-group.tf` and `docs/superpowers/notes/2026-11-04-region-ha-p3b-dev-drill.md` for the card and evidence; platform evidence references them. Tests here are acceptance observations, not new production code. No live call is authorized by this plan. |
| + |
| +- [ ] Card names actual account id, eu-west-1 VPC/subnet/AZ/SSM/KMS/SNS/bucket ARNs, domains/fixture IDs, two group members, ingress ownership, max count/type/volume, IAM deltas, fault permissions, cost/UTC 24h window, cleanup owner and retained-versus-disposable resources. Set `CONSOLE_REGION_INGRESS` to full configured public set before publication; own-region hairpin uses only IE EIPs. Record G1 releases and P2b producer commits after merge. Refuse wrong pool, legacy fixture, unsupported sidecar, missing clock sandbox access, missing local admission or unverified namespace-reader roll. |
| +- [ ] Read-plan the **whole private dev root** at the proposed pinned module revision, inventory fixed IE/IE-b/UK/standby drift, then make a targeted saved plan for named group resources/ingress changes only. Run JSON gate on the full target closure. The store-Deny fix is on this base; prove the selected module revision includes it and no saved plan restores the Deny. Do not apply incidental fixed user_data/IAM/SG/EIP drift. First flagship module bump later must also pass the moved-state/fixed gate; no flagship change here. |
| +- [ ] First-service sequence: verify baseline fixtures born HA/nested and hapair-only reconciliation/placement/import; preserve fixed scopes until the approved group-only phase. Observe Pending:Wait with each readiness fact withheld, direct signed backhaul refused, real first Receive acknowledgment, full readiness, CONTINUE/receipt, admission publication, InService/healthy, then GET/POST/WebSocket/version via each EIP from outside VPC. Console remains fixed, with its existing unit stamp before any fixed admission roll. Verify DNS guidance never offers transient group public box addresses. |
| +- [ ] **G2 failure matrix:** (1) terminate one disposable admitted member; (2) hang health/agent; (3) hang immediately after first successful service reached by direct backhaul; (4) black-hole S3 on a live admitted member. For 1–3 capture health exclusion, termination proof, lease expiry, replacement boot, first200 and data loss per replication class. For 4 require health200, same iid, no automatic replacement; alarm then separately scoped operator termination. Measure §9.8 phases separately; N-HA9 waits the remaining lease, no early takeover. An initial failed boot reaches ABANDON/termination notification without live Pending buildup. All-unhealthy NLB still cannot bypass local admission. |
| +- [ ] Also run concurrent cold wakes (one writer), no-visitor synced timer/departure recovery using merged T, own-region hairpin for approved callers, outside-VPC ingress and signed cross-region backhaul, 30s deregistration, T1/I4 Task 7 witness and **disposable-only** EIP mapping rehearsal. Drain/role/default rollback/readiness and native-sidecar recovery remain blocked outline until their producers merge; missing items prevent full G2, even if the four fault injections pass. Record loss around one second only for stream DB; other classes up to their configured interval. |
| +- [ ] Evidence includes exact release and module SHAs, UTC fault/termination/expiry/restore/first200, hook/receipt/admission, request counters, loss windows, alarm delivery/recovery, pool inventory and per-box clock/sandbox result. Check the follow-up list's retained-edges alert subject and recreated-fixed-ref restrictions; do not replace immutable fixed identity records. P3 supplies no fixes to those unrelated follow-ups. |
| +- [ ] Rollback/cleanup: remove faults first; restore fixed hapair scope and verified fixture service before removing group capacity. Stop/sleep fixtures through supported API; if state/debt cannot be verified, keep resources and alert, never declare drain by zero process count. No retained group implies explicitly approved teardown of only experiment ASG/template/targets/alarms/parameters/new allocations. If ingress is reused, remove group attachments/resources and restore fixed target/expected-count state, **retain P3a NLB/EIPs**. If ingress is new, unprotect only named disposable allocations via a reviewed cleanup-only module copy, run saved-plan cleanup manifest gate, destroy, then discard that copy. Never delete bucket/shared identity/pre-existing EIP. Rollback readers only after group publishers are gone and their namespace evidence is safely retired. Record any operator-held Standby resource beyond expiry and obtain expanded duration approval; expiry never authorizes replacement. |
| + |
| +## Integration still waiting on main |
| + |
| +| Outline / producer | Required evidence before replacing this row with executable work | |
| +|---|---| |
| +| **P2b role writer/platform door — R1/S1/E1** | Actual merged operator API/CLI/CAS/audit/index contracts; desired versus applied evidence. Existing old role endpoint is not reused. Default drain/platform behavior, invalidation and fixed platform exclusion from TGs get an addendum against that main. No local role-object writes. | |
| +| **Drain — I1/I3/I6** | P2b desired-role producer **and a real drain/quiescence/import completion producer**. T's plan explicitly leaves EnqueueDrained unwired (`2026-11-03-region-ha-p1b3b-duties.md`, “Drain integration hook”). Specify leases/release debt, one-at-a-time 5s sleeps, generation invalidation, successor duties and completion ack from merged code. Started/Done is never drained. | |
| +| **Verified capacity/readiness and EligibleBoxes — H4/R1** | P2b shared verified observation and claim-free metric startup on main. Pin API, producer and its separate request budget; then arm minimum<count for 25/25 minutes, missing breaching. Keep operator review of current evidence distinct from this missing product door. | |
| +| **Native sidecar recovery — I6** | P1b-3b slice S (B6) has not been claimed merged here. Birth-only HA sidecars and departure recovery need that actual producer. Legacy gaps remain explicit per departure under N-HA17. See D4; no fake successful sidecar drain/import. | |
| + |
| +Serving-set projection, real consumer acknowledgment and console ingress are now executable/reused in Tasks 1/3/8. Group simulation covers those actual producers. No sibling P2b-plan code or proposed signature is read as authority. |
| + |
| +## Exact S3 and AWS request budget |
| + |
| +Count logical API attempts, including failures, and wire attempts including SDK retries. G/P/L/D = S3 GET/PUT/LIST/DELETE. New boot/SSM/lifecycle/operator clients pin SDK max attempts=1; explicit budgets below then equal wire attempts. Existing runtime S3 clients keep their behavior: record effective retry limit **r** in the counting witness; wire ceiling is r times logical attempts, normally r=3, and refuse unbounded/custom retry configuration for group activation. Do not silently label logical counts physical. No new per-box polling. |
| + |
| +| Path | Logical attempts / retry bound | |
| +|---|---| |
| +| Quiet roles | Existing 2G/30m = **4G/box/h**; no-op tick 0. Startup or changed scope exactly 2G, no LIST. Error backoff 5/10/20/40/60s then ≥60s, ≤128G/h including burst; runtime wire ≤r×. Group adds no new role cadence. | |
| +| Effective publication | Existing replacing helper ≤3(G+P), successful mutation index ≤4(G+P): success normally 2G+2P, ceiling **7G+7P**; unsuccessful three CAS operations ≤3G+3P, no index. Booting+admitted normally 4G+4P, ≤14G+14P; failed later retries charged anew. Receipt/permit 0S3. | |
| +| Reader fan-out | Each coalesced mutation ≤ceil(B/1000)L+B G per reader at next existing fold; sustained bound ≤120×(ceil(B/1000)L+B G)/reader/h. B readers multiply this; no separate roles LIST. Keep original timed-write baseline separate. | |
| +| Bootstrap + install binaries | Bootstrap named/versioned object **1G**. Fresh no-floor install **4G** (pointer, two absent floors, artifact); published floor **5G** (plus signed identity). Total **5G or 6G**, 0P/L/D, retries=1 per call in the bounded boot path. Already-installed release omits artifact. Failures count attempted reads and stop. Existing reconcile/certs/identity/escrow reads are measured separately, not hidden in this line. | |
| +| SSM boot | One GetParameters for key/hash; shared/regional nonrecursive pages at MaxResults=10: max(1,ceil(S/10))+max(1,ceil(R/10)) for ordinary pages, hard **20 pages/100 env values** including empty-token pages; one separate ingress GetParameter. **≤22 calls**. KMS service decrypt work is charged per returned SecureString occurrence (including duplicate/empty-page retry behavior), ≤103 on a successful nonduplicate path including 3 boot/ingress values; box makes 0 KMS write/direct decrypt calls. No boot retry loop after failure. | |
| +| Metadata/config | First root identity fetch budgets token + document + signature (3; `internal/host/boxrecord.go:32,65`), address adapter token + public/local/mac/VPC-CIDR (5): **≤8 IMDS HTTP requests**, failures stop; reuse cached identity where available. SDK credential retrieval/refresh is existing infrastructure overhead, recorded separately. 0 EC2 membership describes. Root snapshots avoid new metadata requests on hairpin/health/request paths. | |
| +| Launch completion | Successful launch **1 CompleteLifecycleAction**. Total ≤4 attempts/launch, SDK=1, 2s each, backoff 1/2/4s, persisted exhaustion, original 900s deadline. Explicit initial ABANDON consumes this same budget; default ABANDON needs 0 box calls. Valid receipt maintenance restart **0** box ASG calls. | |
| +| Operator maintenance | Normal four writes: lower min, EnterStandby(decrement), ExitStandby, restore min. SDK=1; ambiguous write requires readback, no blind retries. One invocation ≤2×180 read rounds, at 5s for each ≤15m wait; each ≤1 DescribeAutoScalingGroups + 2 DescribeTargetHealth = **≤1,080 reads**. Entry validation is first round. Return with record at timeout; resumed invocation counted anew. No box runtime polling. Artifact staging uses the separate bounded boot/release fetch budget. | |
| +| Termination | Existing consumer ≈180 empty Receive/h/box, SDK=1; event/redelivery receives and Deletes extra. Initial ≤1 GetQueueAttributes, no GetQueueUrl/heartbeat/second consumer. Confirmation ≤1 Describe/iid/10s on suspicion, 0 healthy-path describes. P3b increment **0**. | |
| +| Departure import | Retain T's actual budget, not P3's earlier abbreviated estimate: **(U+E+2N+4A+W+Q+F)G+(2A+1)P**, then completion 1D+k(G+P), k≤4. N inventory hosts, A imports, W wake objects, Q changed manifests, U identities, E edges refreshes, F proof reads. Retry/rescan attempts add their real counts; shared queue may duplicate receiver work. No new scan tick. | |
| +| Metrics | Existing ≤60 PutMetricData/h/box; extra group datums in same call, 0 S3. Pin group metric client SDK=1, so ≤60 wire submissions/h. Fixed client untouched. Console P2b separately owns ≤60 regional publishes/h and observation reads; no invented 0-read observation. | |
| +| Health, starts, names, hairpin | **0 S3/SSM/EC2/ASG calls**. NLB nominal 720 checks/target/h across two TGs is not a hard HTTP ceiling (distributed consensus). Twenty simultaneous closed-box requests cause zero acquire/start/completion work. | |
| +| Plan/apply and drills | Local mocks 0 account calls. Later provider refresh/apply and operator fault/verification reads have saved-plan/card counts, separate from runtime. No account-backed request made while drafting. | |
| + |
| +`TestGroupBootRequestBudget` counts no-op/error/absence, SSM empty pages, index conflicts, failed edges CAS, duplicate callbacks, lost completion, persisted exhaustion and receipt restart with transport instrumentation. Runtime S3 baseline remains about 3,300–3,500 calls/box/h; adding boxes adds that baseline, even when P3b's extra path costs zero. S3 allowances are spec §18's $0.0004/1,000 G, $0.005/1,000 P/L, D free. Charge SDK retries too. |
| + |
| +## Planning costs |
| + |
| +USD, 730h/month, two AZs. P3's “Cost per region” retains NLB+two EIP monthly allowances: IE **$25.696**, UK **$26.6158**, US **$23.725**, AU **$25.696**, before NLCU/traffic. For the IE drill count the gross ingress cost even if P3a already pays it; actual incremental reused-ingress cost is lower. ASG and launch-template resource fees are $0; EC2/storage/network remain billed. |
| + |
| +| Dev IE count=2 item | Monthly allowance | 24h allowance | |
| +|---|---:|---:| |
| +| NLB + two NLB EIPs (P3 rate) | $25.696 | $0.8448 | |
| +| Two auto-assigned box IPv4 at $0.005/h each | $7.30 | $0.2400 | |
| +| Two t4g.micro Linux/on-demand at **budget rate $0.010/h each** | $14.60 | $0.4800 | |
| +| Two 20 GiB gp3 roots at **budget rate $0.10/GiB-month** | $4.00 | $0.1315 | |
| +| Nine custom series at $0.30/series-month | $2.70 | $0.0888 | |
| +| Up to eleven standard metric alarms at $0.10/month | $1.10 | $0.0362 | |
| +| **Infrastructure/observability subtotal** | **$55.396** | **$1.8212** | |
| +| One continuous NLCU at $0.006/h | $4.38 | $0.1440 | |
| +| S3/SQS/SNS/SSM/KMS, modest logs/traffic and churn reserve | card-specific | $1.00 | |
| +| **24h planning total / proposed spend ceiling** | | **$2.9652 / $5.00** | |
| + |
| +Compute/storage rates above are rounded **planning allowances, not a live regional quote**. Module `variables.tf:16,21` supplies no defaults; the cited private dev roots supply t4g.micro/20 GiB. Confirm boot and fixture capacity before approving; resize is a new scoped choice, never an automatic workaround. Standard CPU-credit mode avoids an unpriced Unlimited burst assumption; pin it for the drill. Nine series comprise two original memory/PSI per iid, two regional admission/clock, three group memory/clock/admission. Each replacement adds two new per-iid series; eleven alarms reserve ingress six, queue, ASG deficit, group memory, group clock and later EligibleBoxes. Metric batching saves requests, not series charges. No free-tier credit assumed. Replacement overlap, unused EIPs/Standby boxes and retention beyond 24h still cost money; stop faults and alert before the cap, never terminate merely to enforce a cost timeout. |
| + |
| +Primary pricing references (public pages, no account calls): [https://aws.amazon.com/ec2/autoscaling/pricing/](https://aws.amazon.com/ec2/autoscaling/pricing/), [https://aws.amazon.com/ec2/pricing/on-demand/](https://aws.amazon.com/ec2/pricing/on-demand/), [https://aws.amazon.com/ebs/pricing/](https://aws.amazon.com/ebs/pricing/), [https://aws.amazon.com/vpc/pricing/](https://aws.amazon.com/vpc/pricing/), [https://aws.amazon.com/cloudwatch/pricing/](https://aws.amazon.com/cloudwatch/pricing/). NLB regional offer URLs and their original price date are in P3. Refresh the scoped card before go; these are not authorization to spend. |
| + |
| +Provider behavior references: Standby health exclusion/decrement semantics [https://docs.aws.amazon.com/autoscaling/ec2/userguide/as-enter-exit-standby.html](https://docs.aws.amazon.com/autoscaling/ec2/userguide/as-enter-exit-standby.html); completion by iid [https://docs.aws.amazon.com/autoscaling/ec2/APIReference/API_CompleteLifecycleAction.html](https://docs.aws.amazon.com/autoscaling/ec2/APIReference/API_CompleteLifecycleAction.html); preserved-IP hairpin limitation [https://docs.aws.amazon.com/elasticloadbalancing/latest/network/edit-target-group-attributes.html](https://docs.aws.amazon.com/elasticloadbalancing/latest/network/edit-target-group-attributes.html). Kernel/listener behavior is a proposed implementation requiring the root witness, not a claim established by AWS documentation. |
| + |
| +## Copy deck for controller → Luna |
| + |
| +Inventory **every added literal** under these rows before writing product/ops prose during implementation. Meanings below are requirements, not approved wording. Reuse already-approved P3a refusal text when unchanged. One Luna pass at build time; apply approved text verbatim. No copy server or model review is launched here. |
| + |
| +| ID | Destination | Required meaning | |
| +|---|---|---| |
| +| P3-C3 | group boot/config/admission/receipt diagnostics | Phase, missing fact, exhausted/unknown completion, corrupt/mismatched receipt; distinguish failed initial launch from operator-held maintenance. No secrets/raw env. | |
| +| P3-C4 | Terraform validations/outputs, plan gate, module README | Explicit mode/count/AZ/type inputs, protected fixed/EIP ownership, claim-free config, version pin, no unattended refresh, cost/cleanup and public-443 exception. Inventory each error and description. | |
| +| P3-C5 | alarm descriptions/notifications and runbook | Actual producer, unknown/recovery, remaining lease and class-specific loss; S3 failure requires operator decision, never automatic replacement. | |
| +| P3-C7 | private dev card/roll/drill/cleanup guide | Exact scope/window/owner, first-service versus G2, Standby recovery, retained resources/cost, no production retirement. | |
| +| P3-C8 | external health/startup 503 | Not admitted, Retry-After, no holder/account/iid detail or false “waking elsewhere” claim. | |
| +| P3b-C9 | root permit/maintenance command diagnostics | Refuse before stop; exact phase/action needed, concurrent/stale/wrong-identity permit, operator-held timeout; no suggestion to force replacement on dependency error. | |
| +| P3b-C10 | hairpin listener/rule diagnostics | Missing public identity or unsupported kernel/egress path refuses; no header-trust workaround. Public responses disclose no internal topology. | |
| +| P3b-C11 | host-env option help/CLI docs | Group-only claim-free allowlist, explicit pools/regions, safe boot selection; existing fixed mode preserved. | |
| +| P3b-C12 | first-slice refusal and G2 evidence summary | P2b/drain/sidecar producer missing, desired role versus applied status, experiment versus completed gate. | |
| + |
| +P3-C1/C6 role/drain product copy stays P2b-owned outline. Protocol field/metric/reason-code names are data. Product strings, operator shell messages, usage/errors, tofu descriptions, comments explaining new operations and docs all get inventoried; this deck does not preapprove invented text. |
| + |
| +## Census and verification |
| + |
| +This commission changes Markdown only: no census overlay now. Implementation root inputs include group marker, maintenance permit, immutable boot settings, SSM bootstrap/hash/ingress, host.env, nft config and unit drop-in. Root must never consume agent-owned admission receipt or tenant-selected paths. Trace all root readers and writers of their inputs, not just direct filesystem calls; IAM and every regular infra file are in scope. |
| + |
| +For each actual slice: `make census-card`; write tab-separated CLAIMS; `make census-propose NAME=region-ha-p3b CLAIMS=<owned-file>` for P3b-1 (later slices use distinct names rather than rewriting a merged overlay). Run targeted `nice -n 19 go test ./internal/provision -run 'TestPlan14RootReadCensus|TestCensusScopeIsTheRootBinary|TestPlan14RootInputInventoryCoverage|TestCensusRebaseCarriesDispositions' -count=1`. Independent Opus reviewer for a Codex author approves every unit/envelope against amadan main, citing lines; record reviewer, exact tip and verdict on #280. No Paul census escalation; no archive edits. Preserve 9B8 record-write checks. |
| + |
| +Implementation uses failing-first named tests and bounded risky mutations, mock AWS/tofu and the designated root runner. Before each eventual landing run repo build/vet/make-test/format once, plus CGO_ENABLED=0 darwin/amd64, windows/amd64, linux/arm64 cross-compiles (arm64 <64,000,000 bytes). Use default Go cache and owned `$TMPDIR` scratch, nice 19 for CPU-heavy work; clean owned processes/files. Push/describe/green exact-tip CI/amadan squash/main-CI happens only in the later implementation session. This planning session runs static document/diff checks only. |
| + |
| +## Open decisions for Paul |
| + |
| +1. **D1 — activation window and G1 boundary (S1/rules 5–6).** **Wait for merged P2b and recorded G1, then name a UTC dev window (Recommended):** preserves §19 and permits a useful first group merge without guessing P2b interfaces. Alternative: explicitly authorize a limited pre-G1 group experiment and amend the rollout ruling; that changes the spec and is not decided here. Either option still requires the complete scoped card, named operator, permission/traffic effects and cleanup. |
| +2. **D2 — initial roles and missing operator features (R1/H4/I3).** **Serve-only initial group acceptance using existing default/absence; keep role transitions, drain, readiness and full G2 blocked until their producers merge (Recommended):** the reader works today without an unauthorized writer; no dummy drained acknowledgment. Alternative: hold all group work until those producers merge. If an existing role is drain/platform or unknown, refuse activation without rewriting it. The recommendation limits the initial visible slice, not the eventual required capability; Paul must choose it before build acceptance. |
| +3. **D3 — resources and retention (S1/H5).** **Two t4g.micro/20 GiB boxes, hapair-only existing IE bucket, ≤24h, $5 planning ceiling, destroy temporary resources after evidence (Recommended):** matches checked dev roots and isolates tenants. Reuse P3a ingress if its ownership/card permits. Alternative: approve larger boxes or a retained proving group with revised measured cost/duration. Capacity failure is a stop, not permission to resize. Actual account/resource IDs and date are still unverified. |
| +4. **D4 — sidecar acceptance (I6/N1).** **Keep the real sidecar hairpin witness on the root runner now; require merged native-sidecar producer and a scoped born-HA fixture for the live sidecar/G2 witness (Recommended):** avoids adding a legacy sidecar to a born-HA-only fault set or claiming unsupported duty recovery. Alternative: approve a narrowly separated disposable legacy-sidecar network-only experiment, removed and verified absent before termination/drain drills; this is an explicit topology exception, still no native-sidecar failover claim. Skipping sidecar hairpin entirely is not completion of scope. |
| + |
| +N-HA14 is decided; no new maintenance exception or §10 change is requested. Any later kernel-layout refusal, fixture exclusion or loss of user-visible capability must return as a decision, never become an author's silent cut. |
| + |
| +## Self-review |
| + |
| +| Brief scope / requirement | Coverage / honest limit | |
| +|---|---| |
| +| Group mode, group IAM, automatic claim-free boot | Tasks 2/3, initial hook order and fixed-state/IAM witnesses. No live plan or boot verified here. | |
| +| N-HA14 exception, Standby, root guard, Restart=no | Verbatim companion spec edit; Tasks 4/7. No unattended update; shared outage never authorizes replacement. | |
| +| Hook adapter, receipt, ABANDON, no Pending accumulation | Task 3 crash matrix/persisted four-attempt budget and Task 8 timed evidence. | |
| +| Verified client hairpin, no proxy-trust expansion | Task 5 pins address provenance and kernel original-destination checks; all callers, both ports, real root witness required. | |
| +| Dev IE count=2/hapair-only | Scope, Tasks 6/8, D1–D4. Module has no type default; private root evidence is explicitly separate. | |
| +| G2 four faults plus T1/I4 | Tasks 7/8, §9.8 timing and N-HA9 expiry; P2b/drain/native-sidecar pieces are named blockers, not fake executables. | |
| +| Booting names and mixed-reader rollout | Task 1 preserves authority in one helper; actual main disproves a general empty-name claim. Guard covers every name class; all readers upgraded first. | |
| +| Rulings, request/cost/copy/census/review budgets | Dedicated tables; no new per-box poll; P3 closed history retained, P3b max three rounds. No review verdict claimed. | |
| + |
| +**Unverified:** deployed resource IDs/configuration and G1 status, effective live IAM, root kernel egress/original-destination behavior, boot timing/fit on t4g.micro, regional price quote, real alarm delivery and P2b/S interfaces not on the citation base. These remain explicit build/activation gates. This draft finishes after its two-file local commit and is ready for the controller's Opus R1 brief. |