plans: P2a plan rev 3 (N-HA13: display cut)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
1 file changed,
+136
−128
docs/superpowers/plans/2026-11-01-region-ha-p2-console.md+136 −128
diff --git a/docs/superpowers/plans/2026-11-01-region-ha-p2-console.md b/docs/superpowers/plans/2026-11-01-region-ha-p2-console.md| index 3c9054422..de8a2609e 100644 |
| --- a/docs/superpowers/plans/2026-11-01-region-ha-p2-console.md |
| +++ b/docs/superpowers/plans/2026-11-01-region-ha-p2-console.md |
| @@ -2,15 +2,15 @@ |
| > **For agentic workers:** Use the writing-plans task format below. This commission is planning only: write and commit this plan, with no production code, push, reviewer dispatch or full test suite. A later controller chooses execution tooling; no subagent dispatch is authorized here. |
| -**Goal:** Make the dev console describe an HA instance and its public ingress honestly, refuse unsupported creates and transfers before they change anything, and finish the console's capacity and operator doors once their box-side producers have merged. |
| +**Goal:** Give console and CLI users on dev correct public-ingress guidance and pre-write refusals for unsupported HA creates and transfers. Finish capacity and operator doors after their box-side producers merge. HA records keep main’s display, rollout, health, retry and deploy-watch behaviour unchanged (N-HA13). |
| -**Architecture:** P2a reads existing records, box snapshots and configured ingress; it adds refusal checks at the existing console write boundaries. It neither places a wake nor grants a lease. P2b is an outline gated on merged producers: one claim-free eligibility observation must feed readiness, the capacity metric and all create doors. Desired role and applied role must remain distinguishable. |
| +**Architecture:** P2a reads existing records and configured ingress; it adds refusal checks at the existing console write boundaries. It neither places a wake nor grants a lease. P2b is an outline gated on merged producers: one claim-free eligibility observation must feed readiness, the capacity metric and all create doors. Desired role and applied role must remain distinguishable. |
| **Tech stack:** Go 1.26, console HTTP/API and Go templates, SQLite registry, existing S3 stores and bounded listings, existing CloudWatch adapter. No new service, dependency or polling loop on boxes. |
| **Spec:** `docs/superpowers/specs/2026-10-26-region-ha-without-claims-design.md`, rev 6.1, especially §§4.4, 10–11, 14–16, 18–21. Authorities are this merged spec, AGENTS.md, and Paul's rulings on discussion #421 (`amadan discuss show carlos/platform 421`, read 2026-11-01). |
| -**Revision:** 2, 2026-11-01; answers Opus round 1. This revision has not had an independent review. |
| +**Revision:** 3, 2026-11-01; applies Paul’s N-HA13 display cut and answers the in-scope round-2 findings. Round 3 is the final round; rev 3 has not had an independent review. |
| **Citation base:** refreshed amadan `origin/main` on 2026-11-01: **65420a4d9e0d919743ea2e95e20b1a649605db3d**. Every existing-code citation below was re-read at that commit. The branch starts at `79d9d6a281c58c481e902c6e963b5479a016446a`; it is not rebased or merged here. Main's intervening team-service, navigation and edge-test changes do not change the cited code. Proposed interfaces and witnesses have destination paths but no invented source lines. P1b-3a is still unmerged; it supplies no executable dependency to P2a. |
| @@ -18,7 +18,7 @@ |
| | Invariant / ruling | Design consequence | |
| |---|---| |
| -| **C1, honest observation (§15)** | An adopted route is not an awake process. Display a box only from a fresh, tenant-matching, post-creation awake report; incomplete or contradictory evidence cannot establish absence or a unique holder. A snapshot is never lease authority. | |
| +| **C1, honest observation (§15)** | Deferred under N-HA13 to the separate HA display design after P1b-3a merges. P2a makes no new attribution or rollout projection; a snapshot remains no lease authority. | |
| | **Controller, P2-5 (C3/C4)** | **DROP F4.** Standalone sidecars in HA regions keep main’s behavior until P2b’s capacity gate. No new cut, no new HA stamp, no dependency on unfinished runtime work for P2a. | |
| | **Controller, P2-6 (C3)** | A record with `rec.KindOrDefault() == "static"` is exempt from the new active-HA-region move refusal because it holds no instance data. This exemption does not override an immutable `rec.HA` flag or any existing seed/runtime/shape refusal. | |
| | **Controller, accepted defaults (C3/C5)** | P2a ships in the next dev release after merge; P3 produces merged role and admission evidence before P2b; non-home and pool HA **data** creates stay refused for G3, with 409/new F5 copy. This does not authorize infrastructure mutations. | |
| @@ -32,14 +32,15 @@ |
| | **N-HA5,6** | No capture/sync cadence changes. Never promise a universal one-second recovery or loss window; replication classes retain their stated intervals. | |
| | **N-HA8,10** | P1b slices stay separate. Front forwarding/accounting remain P1b-2's; P2 does not insert a wake check or duplicate per-request work. | |
| | **N-HA11,12 (#421)** | The small termination SQS consumer belongs to P1b-3b (about 180 receives/hour/box). P1b-3a's per-box 10-second suspect exclusion stays there. Neither is a console poll or a dependency available on main today. | |
| +| **N-HA13 (Paul, 2026-11-01, stopping rule 2)** | **CUT Task 1’s HA display from P2a.** C1 had a P1 in both rounds (P1-1, P1-A). Preserve main’s HA display, rollout, health, retry and deploy watch. After P1b-3a merges, write a separate small design against every rollout consumer; retain both rounds’ requirements in the outline below. Round 3 of this P2a plan is final. | |
| ## Slices, first visible merge and finish line |
| -**P2a, executable against this main:** Tasks 1–5. Task 1 lands first with its display and witness together: on the dev console, the born-HA host's Instances row and detail identify its last reported awake box, or explain that none can be established. Task 2 changes ingress guidance. Tasks 3–4 close main's refusal gaps. Task 5 supplies the production-wiring witness and dev acceptance. These changes need no P1b-3a interface. |
| +**P2a, executable against this main:** Tasks 1–4 after removing the former Task 1. Task 1 lands configured DNS guidance and its witnesses together; Tasks 2–3 add create/move/import refusals. The first visible result is console and CLI answers on dev: configured public-ingress instructions, including the placements door’s safe refusal, followed by unsupported-create and transfer refusals before writes. Task 4 (former Task 5) witnesses only ingress and refusals and supplies dev acceptance. No P1b-3a interface is required. |
| -**P2b, outline only:** claim-free capacity/create eligibility, role writes and full readiness, plus any regional data-proof path needed to lift P2a's conservative create gate. Combining those with display changes would couple API authority, role consumption, a metric loop and boot/admission evidence in one review. Its dependencies and remaining acceptance are listed under **After P1b-3a merges**. Do not implement or review that outline as an executable plan. |
| +**P2b, outline only:** claim-free capacity/create eligibility, role writes and full readiness, plus a regional data-proof path to lift the conservative create gate. Its dependencies and acceptance remain under **After P1b-3a merges — P2b outline only**. The separate **After P1b-3a: HA display design** outline preserves C1’s findings without executable display tasks. Neither outline may be implemented or reviewed against unmerged producers. |
| -**Switch-on (rule 5):** Paul gets the console view and safer doors he requested for G3. P2a switches on in the **first dev release after its implementation merge**, with Task 5's scoped drill scheduled before landing. Snapshot attribution is active for born-HA records immediately; ingress uses the new configured list only when supplied; refusals apply to active HA regions and immutable HA records. Switch-on also requires Task 5’s verified home data wiring and pre-roll ingress validation. No new feature flag. If that dev release/drill cannot be scheduled, retain implementation on its branch. P2b switches on at **G1**, after its merged dependencies and dev witness; keep it on branch without a scheduled G1 release. A planning commit has no runtime switch. |
| +**Switch-on (rule 5):** Paul gets safer console and CLI doors and public-ingress guidance for G3. P2a switches on in the **first dev release after its implementation merge**, with Task 4’s scoped ingress/refusal drill scheduled before landing. Ingress uses the configured list only when supplied; refusals apply to active HA regions and immutable HA records. Task 4 must verify home data wiring, pre-roll ingress validation and the HA activation window. There is no new feature flag; `CONSOLE_HA_REGIONS` is currently recorded unset, so any temporary IE activation requires the scoped card below. If that release/drill cannot be scheduled, keep implementation on its branch. P2b switches on at **G1**, after its merged dependencies and dev witness; keep it on branch without a scheduled G1 release. A planning commit has no runtime switch. |
| P2a alone finishes neither P2 nor G1. The current series finish line is **G3**: P1b-3, P2, P3 built, dev G1/G2 drills passed, first carloku.com region HA. G5 is the later routine box-swap goal; do not claim it from these doors. Each implementation session owns one stated slice and ends when it merges. This session ends at the local plan commit. |
| @@ -47,9 +48,10 @@ P2a alone finishes neither P2 nor G1. The current series finish line is **G3**: |
| | Round | Brief / findings | Verdict | Invariant / disposition | |
| |---|---|---|---| |
| -| 1 — Opus, 2026-11-01 | `docs/superpowers/plans/REVIEW-BRIEF-REGION-HA-P2-R1.md`; `docs/superpowers/plans/REVIEW-REGION-HA-P2-R1.md`; reviewed tip `e6cfc5bdce84bb94ad5a5f52772a65596ba1150a` | **NOT READY: 1 P1, 9 P2, 11 P3** | P1-1/C1 shared observation; P2-1–9/C1–C3,C6 answered in rev 2 below. P3 dispositions recorded below. No second round dispatched; the controller owns any round 2 within the same budget. | |
| +| 1 — Opus, 2026-11-01 | `docs/superpowers/plans/REVIEW-BRIEF-REGION-HA-P2-R1.md`; `docs/superpowers/plans/REVIEW-REGION-HA-P2-R1.md`; reviewed tip `e6cfc5bdce84bb94ad5a5f52772a65596ba1150a` | **NOT READY: 1 P1, 9 P2, 11 P3** | P1-1/C1 shared observation; P2-1–9/C1–C3,C6 answered in rev 2 below. P3 dispositions recorded below. Historical rev-2 response; C1 partly resolved in round 2 and then cut by N-HA13. | |
| +| 2 — Opus, 2026-11-01 | `docs/superpowers/plans/REVIEW-BRIEF-REGION-HA-P2-R2.md`; `docs/superpowers/plans/REVIEW-REGION-HA-P2-R2.md`; reviewed tip `38d39c8ee74bc0b88a9dd936cba35fded21d0da6` (rev 2 at `0acfe905`) | **NOT READY: 1 P1, 7 P2, 6 P3** | P1-A/C1 repeats P1-1’s fault family. Paul chose CUT (N-HA13), not a third C1 fix. P1-A and P2-A–D go to the display outline; P2-E–G and four in-scope P3s are answered below. | |
| -Round budget used: **1 of 3**; rev 2 is the author’s response, not a READY verdict. Preserve this table through splits and handoffs; P2a/P2b do not reset a review of the same change. Upstream history stays closed: spec three rounds, P1a three, P1b-1 three, P1b-2 three, dead-holder backoff three; P1b-3a two, final READY AFTER FIXES under N-HA12. Do not reopen those designs. |
| +Round budget used: **2 of 3**. **Round 3 is final** and is not dispatched here; rev 3 is the author’s response, not a READY verdict. N-HA13 settles the repeated C1 family by cutting it. A remaining P1 in round 3 stops this plan for Paul’s decision; no fourth round is authorized. Preserve this table through splits and handoffs; P2a/P2b do not reset a review of the same change. Upstream history stays closed: spec three rounds, P1a three, P1b-1 three, P1b-2 three, dead-holder backoff three; P1b-3a two, final READY AFTER FIXES under N-HA12. Do not reopen those designs. |
| Future briefs use `docs/superpowers/reviews/REVIEW-BRIEF-TEMPLATE.md`. Stop at the first round without P1, fix its P2s without reopening, put P3s on the branch follow-up list. A fourth round needs Paul's scoped go. Two consecutive rounds against the same invariant stop fixes and require Paul's refuse/cut/central-enforcement choice. Task reviews are limited to security, cache, root, termination, production storage, billing or redirect risk; other tasks receive whole-branch review. Census and newly changed security/root/termination/storage behavior still check final fixes inside that budget. No reviewer is dispatched here. |
| @@ -60,27 +62,26 @@ At 24 hours without a merge, or when stopping rule 1 or 2 triggers, the implemen |
| | P2 item | Verified main evidence | Disposition / invariant | |
| |---|---|---| |
| | Born-HA switch and record stamp | `cmd/console/main.go:476`; `internal/console/seedmove.go:33,47`; `internal/console/apiinstances.go:2308` | Built by P1a. Preserve main’s stamping (address-backed instances are stamped today) and exclusions; never migrate on display or create. **N-HA7.** | |
| -| Moves of an immutable HA record | `internal/console/seedmove.go:64`; callers `internal/console/apiinstancemove.go:427,583`, `internal/console/apiinstancemove_offline.go:505`; `internal/console/ha_born_test.go:116` | Built, including stage/start and both older doors. Do not build again. Missing: HA-active source/destination regions when `rec.HA` is false; Task 4. **C3.** | |
| +| Moves of an immutable HA record | `internal/console/seedmove.go:64`; callers `internal/console/apiinstancemove.go:427,583`, `internal/console/apiinstancemove_offline.go:505`; `internal/console/ha_born_test.go:116` | Built, including stage/start and both older doors. Do not build again. Missing: HA-active source/destination regions when `rec.HA` is false; Task 3. **C3.** | |
| | App placement of HA records | `internal/console/seedmove.go:134`; `internal/console/ha_born_test.go:143,247`; `internal/console/fleets.go:881,955` | Built. Keep the strict read and under-write race protection. Extend only regional refusal gaps, without rewriting placement. **C3.** | |
| -| HA imports | `internal/console/seedmove.go:74`; `internal/console/apiinstanceimport.go:119,391,718`; `internal/console/ha_born_test.go:165,179` | Begin/upload/stopped refusals built; one-box seed restriction is `internal/console/seedfloor.go:88`. Retain these; witness immutable HA record even after configuration is unset in Task 4. **C3/N-HA4.** | |
| +| HA imports | `internal/console/seedmove.go:74`; `internal/console/apiinstanceimport.go:119,391,718`; `internal/console/ha_born_test.go:165,179` | Begin/upload/stopped refusals built; one-box seed restriction is `internal/console/seedfloor.go:88`. Retain these; witness immutable HA record even after configuration is unset in Task 3. **C3/N-HA4.** | |
| | HA staging fallback | `internal/activator/backend_exec.go:933–939` | Built: HA restore returns before legacy warm-copy/staging path. Test existing behavior, no backend edit. **I2/C3.** | |
| -| Leftover create rail | `internal/console/createleftovers.go:43,69,136`; `internal/console/apiinstances.go:2252`; `internal/console/apisidecars.go:394` | Built LTX-only rail; intentionally skips remote, pool and fleet data. Missing arbitrary host-prefix objects, files and lock; Task 3. **C3.** | |
| -| Non-hibernating socket create | `internal/console/apiinstances.go:2182,2308` | Shape validation and HA stamp exist, but this boundary has no HA-specific non-hibernating socket refusal. Task 3. **C3/§6.1.** | |
| +| Leftover create rail | `internal/console/createleftovers.go:43,69,136`; `internal/console/apiinstances.go:2252`; `internal/console/apisidecars.go:394` | Built LTX-only rail; intentionally skips remote, pool and fleet data. Missing arbitrary host-prefix objects, files and lock; Task 2. **C3.** | |
| +| Non-hibernating socket create | `internal/console/apiinstances.go:2182,2308` | Shape validation and HA stamp exist, but this boundary has no HA-specific non-hibernating socket refusal. Task 2. **C3/§6.1.** | |
| | No capacity message/throttle | `internal/console/nocapacity.go:31,38,67,125` | Approved text, Retry-After 60 and per-console-process hourly page throttle already exist. Reuse, not rewrite. Current `roomIn`/chooser depend on claims (`internal/console/nocapacity.go:146,166`). P2b. **C4/C6.** | |
| | Headroom/shared policy | `internal/host/headroom.go:13`; `internal/host/edgesfile.go:173,953,1238`; `internal/boxchoice/policy.go:16,63,83` | Existing free/total memory/disk, 15%/10%, age 15m/future 1m, timed publication. `headroom.apps` is absent on main. P2a reads none of it. **C4/rule 4.** | |
| | Identity and live evidence | `internal/console/boxselect.go:147`; `internal/console/reqmemo.go:218`; `internal/edgesfile/snapshot.go:160` | Reuse liveEdges and signed box identity verification in P2b; no roster/enrolment or ASG enumeration. Current verifier expects `BoxID`, whereas views identify `Box`; reconcile that explicitly at P2b planning. **C4.** | |
| | Role doors/CLI | `internal/console/apiboxroles.go:55,115,159`; `internal/console/authcli.go:554`; `system_roles.go:35,55` | Exist only as signed-roster box/group role writes, with old default/legacy vocabulary. No `control/box-roles` reader/producer on main; `internal/release/changeindex.go:72` has no role scope. Replace in P2b with a merged consumer, not enable these doors. **C5.** | |
| | Capacity adapter/start | `internal/console/awsregionmetric.go:25,30,58`; `internal/console/regioncapacity.go:99,121`; `internal/console/hostclaimops.go:50–64`; `cmd/console/main.go:707` | Carlos/Region EligibleBoxes and one-minute runner exist, but only start inside claim recovery and count through claim executors. P2b moves start; no duplicate metric loop now. **C4/C6.** | |
| | Full LB readiness | `internal/lbhealth/lbhealth.go:154`; `internal/edge/lbhealth.go:21`; spec §10 | Six local conditions built. Main has no claim-free remote admission/latch/hook-completion report on which a console can assert full readiness. P2b waits for P3; no remote health polling invented. **C5.** | |
| -| Snapshot attribution and rollout | `internal/console/remoteinstances.go:259,337,459`; `internal/console/apiinstances.go:962,1133,1326,1415`; `internal/console/instancepage.go:298`; `internal/console/apiretry.go:90`; `internal/console/view.go:726` | `foldRollout` keeps a last-read box, `facts.host` a newest box, and local adopted rows bypass remote attribution. Task 1 replaces all HA rollout/health selection with one observation, including single GET and retry. **C1.** | |
| -| Ingress list | `cmd/console/main.go:1339`; `internal/console/server.go:1580,1632`; `internal/console/view.go:199` | PLATFORM_EDGE_IPS plus every live box EIP today. No CONSOLE_REGION_INGRESS parser. Task 2. `internal/console/authcli.go:1202` separately uses EdgeIPs for proxy trust: do not add ingress there. **C2.** | |
| +| Ingress list | `cmd/console/main.go:1339`; `internal/console/server.go:1580,1632`; `internal/console/view.go:199` | PLATFORM_EDGE_IPS plus every live box EIP today. No CONSOLE_REGION_INGRESS parser. Task 1. `internal/console/authcli.go:1202` separately uses EdgeIPs for proxy trust: do not add ingress there. **C2.** | |
| All existing-code paths and lines are pinned to the citation base above; task file lists below are authoritative edit destinations. |
| ## Global constraints |
| - **C1/security:** session, CSRF where applicable, owner/member byte-identical 404, fresh authentication last. Team/service scope remains the existing door's scope. No tenant name, host, bucket or box detail before authorization. |
| -- **C3/N-HA7:** `haRegion("")` resolves through HomeRegion. The immutable record flag remains effective with HARegions unset. `HAData := s.shouldStampHA(rec) && !seeded && rec.DerivesPaths()`; `DerivesPaths()` is exactly instance kind with `len(rec.AddrsOrDefault()) == 0` (`internal/provision/provision.go:487`). Address-backed instances keep main’s stamp but are explicitly outside HAData and F1. Static records, replicas, sidecars and rootfs keep main’s stamp exclusions. F1 also checks seeded socket creates; being unstamped does not exempt a socket from the shape rule. |
| +- **C3/N-HA7:** `haRegion("")` resolves through HomeRegion. The immutable record flag remains effective with HARegions unset. `HAData := s.shouldStampHA(rec) && !seeded && rec.DerivesPaths()`; `DerivesPaths()` is exactly instance kind with `len(rec.AddrsOrDefault()) == 0` (`internal/provision/provision.go:487`). Address-backed instances keep main’s stamp but are explicitly outside HAData and F1. Static records, replicas, sidecars and rootfs keep main’s stamp exclusions. F1 also checks seeded binary socket creates; it requires `rec.Runtime == ""`. P1a’s resident rootfs allowance remains intact, including non-hibernating rootfs in an HA home. |
| - **C3:** preserve existing hosts-history, seed floor, rootfs, binding, private-storage and create-only CAS rails. An existence retry gets the door's ordinary duplicate response before examining its own live replica. |
| - **C4:** at least 15% free memory, 10% free disk, generation at most 15 minutes old and at most 1 minute ahead. Missing totals are not eligible. No headroom gate in edge, activator, restart, timer or ordinary wake paths. |
| - **C5/rule 4:** no assumed Apps, role, drained, booting, latch, hook or readiness wire field from an unmerged producer. The spec's contract is a requirement, not evidence that main publishes it. |
| @@ -90,21 +91,18 @@ All existing-code paths and lines are pinned to the citation base above; task fi |
| ## Review focus |
| -1. A newer asleep adopter masks the older awake reporter, including a platform-local adopted row: Task 1 `TestHAAwakeBoxIgnoresSleepingAdopters` and `TestHAAwakeBoxPageAndAPI`. |
| -2. Same host under a prior lifetime or another account leaks a box: Task 1 `TestHAAwakeBoxTenantAndLifetime`. |
| -3. NLB ingress becomes a trusted X-Forwarded-For sender or group EIPs escape into guidance: Task 2 `TestIngressDoesNotWidenProxyTrust` and `TestConfiguredIngressSuppressesMemberIPs`. |
| -4. Empty LTX but sealed secrets/marker remain, or the destination bucket cannot be inspected: Task 3 `TestHACreatePrefixObjects` and `TestHACreateUninspectableRefusesBeforeWrites`. |
| -5. A legacy record moves into an HA-active region, or an import resumes after its HA configuration is unset: Task 4 `TestHAMixedMoveRegionsBeforeWrites` and `TestHAImportFlagSurvivesSwitchOff`. |
| +1. Ingress must never widen proxy trust or advertise group member EIPs through domain or placements guidance: Task 1’s configured-mode and placements witnesses. |
| +2. Empty LTX with sealed objects/marker remaining, or an uninspectable destination bucket: Task 2’s prefix and zero-write witnesses. |
| +3. F1 must preserve resident rootfs and address-backed creates while refusing unsupported binary sockets, including `--from`: Task 2. |
| +4. Legacy moves into active HA regions and imports after HA switch-off must refuse before writes: Task 3. |
| +5. The drill needs verified home data wiring and an approved, reversible activation window: Task 4. C1’s display design is outside this revision’s executable review. |
| ## File map for P2a |
| | File | Responsibility | |
| |---|---| |
| -| New `internal/console/haawake.go`, `haawake_test.go` | One tenant/lifetime-bounded HA observation with selected rollout, health and report time; retain stale hazard evidence in appFacts. | |
| -| `internal/console/{remoteinstances.go,apiinstances.go,view.go,overview.go,instancepage.go,apiretry.go}`; new `haawake_wiring_test.go`; existing templates and `instancecopy.go` | Shared observation adapters for list/single API, local/remote rows, detail and retry; copy keys. No adapter selects a box. | |
| -| `apimode.go`, `instances_cli.go`; `instances_rollout_test.go`, new `instances_ha_test.go` | Add decoded observation fields and `instances list --json`; use the server’s rollout and health without selection. Root census applies. | |
| | New `internal/console/regioningress.go`, `regioningress_test.go`; `cmd/console/main.go`, `main_test.go` | Strict configured-ingress parsing and startup wiring. | |
| -| `internal/console/{server.go,view.go,edgefold_test.go,server_test.go}` | DNS-only source selection; preserve legacy mode and proxy trust. | |
| +| `internal/console/{server.go,view.go,edgefold_test.go,server_test.go,apiplacements.go,apiplacements_test.go,apiplacements_put_test.go,apidomains.go,appsettings.go}`; `domains_cli_test.go` | DNS-only source selection and configured HA placements refusal/guidance, including browser/domain-list sinks; preserve legacy mode and proxy trust. Root CLI production code stays unchanged. | |
| | New `internal/console/hacreate.go`, `hacreate_test.go`; `createleftovers.go`, `apiinstances.go`; existing `ha_born_test.go`, `rootfs_test.go` | Pre-write shape/provenance refusals and fixture corrections. Sidecar/domain handlers need no production edit in P2a; witness their unchanged doors. | |
| | `internal/console/{seedmove.go,apiinstancemove_offline.go,apiinstancemove.go,apiinstanceimport.go,fleets.go}`; new `hatransfers_test.go` | HA source/destination and immutable import refusal gaps. | |
| | New `internal/console/hap2_wiring_test.go` | Real handlers and store counters; no duplicate simulated admission algorithm. | |
| @@ -112,66 +110,40 @@ All existing-code paths and lines are pinned to the citation base above; task fi |
| --- |
| -### Task 1: Show the reported awake box on the dev console |
| +### Task 1: Use configured regional ingress for DNS instructions |
| -**Files:** create `internal/console/{haawake.go,haawake_test.go,haawake_wiring_test.go}`; modify the console attribution/retry/view/template files in the file map, plus root `apimode.go`, `instances_cli.go`, `instances_rollout_test.go`, new `instances_ha_test.go` and `docs/site/cli.md`. Console-only paths below are relative to `internal/console/`; root files are named explicitly. |
| +**Files:** ingress parser/startup/source files from the file map, `internal/console/server_test.go` for `TestDomainGuidanceSteering` (`internal/console/server_test.go:1652`); update accepted `domainGuidance`/regional guidance at `view.go`, `apiplacements.go` and its `apidomains.go` / `appsettings.go` callers, plus CLI docs in the same task. Add a fake-console refusal witness in `domains_cli_test.go`; no root CLI production edits. |
| -**Current consumers / C1:** last-read `boxJoin` rollout (`internal/console/apiinstances.go:962,1133,1182,1326`), single GET (`internal/console/apiinstances.go:1415,1425`), local detail (`internal/console/instancepage.go:298`), remote health (`internal/console/remoteinstances.go:337,459`), row health (`internal/console/overview.go:317`), retry (`internal/console/apiretry.go:90`) and CLI cells/decoder (`instances_cli.go:573,583,596`; `apimode.go:3337`). These are one invariant: no HA consumer may infer a unique awake reporter independently. |
| +**Interfaces:** `Config.RegionIngress []string` (DNS destinations only), plus `func ParseRegionIngress(raw string) ([]string, error)` in `internal/console/regioningress.go`, called by `cmd/console` startup. Format of **CONSOLE_REGION_INGRESS** for this plan is comma-separated IP literals (NLB's static EIPs), matching PLATFORM_EDGE_IPS's address vocabulary; tofu deployment wiring must supply the complete regional set. Trim, canonicalize IPv4/IPv6, de-duplicate in first-seen order. Empty/unset retains legacy behavior. Non-empty with any invalid item fails startup; never silently fall back to member EIPs. **Suppression scope:** this flat list is deployment-wide, not keyed by region. Configured `dnsTargets` suppresses the entire folded box-IP union, including edges in non-HA regions. Deployment wiring must supply the complete intended public set across those regions or leave this mode unset; test HA and non-HA member IPs together. Per-region ingress discovery/mapping waits for P3. |
| -**Interfaces:** extend existing `hostReport`/`fleetReports` in `remoteinstances.go` to retain per-box rollout candidates (including retry book/epoch/version), region, generation, freshness and stale awake/transient hazards **before** `foldFleetReports` drops stale boxes (`internal/console/remoteinstances.go:259,263`). Reuse the tenant check and existing `foldRollout` projection per individual box to retain rollout fields; never flatten HA candidates into `boxJoin.rollouts` first. Keep legacy `appFacts.host` behavior for non-HA callers. |
| +**Placements door (P2-E / C2): choose the review’s refusal option until P3.** A configured-ingress response must not advertise HA member EIPs as DNS destinations. After the existing auth/owner/team gates, GET of a regional claim naming any active HA region, or a single-mode claim targeting an HA record/active HA region, returns **409/I6**, with the configured public union and an explicit statement that placement readiness is unavailable here. Return no `placements`/member-EIP payload and no ready verdict. Resolve single-mode targets from the authorized record (claim Route, or claim Host when Route is empty); normalize empty-home region and honour immutable `HA` even if HARegions is unset. Unreadable/missing target evidence gets the existing neutral temporary refusal, never fallback to member addresses. For regional claims the configured region list suffices for active-region checks; read their target records as needed to honour immutable HA. Before any PUT claim write, apply the same check to both current and proposed targets after existing syntax/ownership validation. This also covers its success-response path: do not mutate and then refuse rendering. Non-HA-only placements and all unset-ingress placements retain main’s behaviour. The console’s regional domain guidance and placement-state detail use I6 at this boundary instead of RD-44/RD-46’s promise that placements supplies per-region addresses/readiness. Apply the same authorized-target check at domain list/single GET/settings sinks, reusing request-memo target reads; preserve domain verification/delegation and never change instance health or rollout. No configured union is claimed to be a verified regional readiness observation. The CLI already prints server error text, so old and current clients safely receive this refusal/guidance without a new wire field or root-code change. |
| -Produce one `type haObservation struct { Box, State string; At *time.Time; Rollout *rolloutView; Health string }` and `func (f appFacts) haObservation(rec provision.Record) haObservation` in `haawake.go`. This is the **only** HA decision function. It accepts existing cached report evidence, an injected observation time and home-region normalization carried by appFacts; it performs no I/O. Only records with `rec.HA` consume it, even when HARegions is unset. The function returns: |
| - |
| -| Evidence after account/app and `report.at.After(rec.CreatedAt)` checks | State / projection (C1) | |
| -|---|---| |
| -| Two or more fresh awake candidates | `conflict`; empty Box, nil At/Rollout, `healthUnknown`. Never pick by label, read order or newest timestamp. | |
| -| Incomplete read; matching transient; missing process/tenant evidence; no matching report; or a known box in the effective region with a stale matching last-awake/transient report | `unknown`; empty Box, nil At/Rollout, `healthUnknown`. Stale evidence is retained only as a hazard, never an awake assertion. A stale holder plus fresh asleep adopters stays unknown. | |
| -| Complete evidence with exactly one fresh awake candidate and no uncertainty above | `awake`; that candidate’s Box, generation At and **entire** tenant/lifetime-checked Rollout (including Installed, Serving and retry fields). Health comes from that candidate’s process state using existing health vocabulary. | |
| -| Complete matching fresh, explicit asleep reports, no awake/transient/stale hazard | `asleep`; empty Box, nil Rollout, existing asleep health word. At is the oldest matching report used for this conclusion. No snapshot invents an awake box or an installed/serving build. | |
| - |
| -Do not use absence from Rollout.Hosts as explicit asleep. `status.BoxStale` remains the age rule (`internal/status/fleet.go:120,138`): 5-minute cadence, stale after 15 minutes, plus console cache age. At is snapshot generation in UTC RFC3339, never cache-load time; omit it where no conclusion has a valid generation. Age is calculated from At at rendering, not persisted as a ticking value. |
| - |
| -Add additive `awake_box,omitempty`, `awake_box_state,omitempty`, `awake_box_at,omitempty` to **both** `instanceListRecord` and `instanceGetRecord`, and decoder fields on `apiInstanceRecord` (`apimode.go:3337`). In the single GET add HA-only `rollout,omitempty` and `health,omitempty` projections so it agrees with the list; leave non-HA GET’s shape alone. Carry the observation on RouteView and InstanceRow into row/detail templates. Keep `served_by` as the adopted/routed set. For HA records the selected observation also supplies rollout/health in existing fields: unknown/conflict/asleep must not expose a different `rollout.box`, awake flag or serving build. Clear HA `staged_version`/local version fallback where it would resurrect a discarded box’s Installed value. Preserve non-HA fields and behavior. |
| - |
| -- [ ] **Step 1: Write failing selection tests.** `TestHAAwakeBoxIgnoresSleepingAdopters`: leo awake, newer sophie asleep, and a platform-local asleep adopter always select leo’s rollout, Serving and generation. `TestHAAwakeBoxTenantAndLifetime`: foreign/missing tenant and reports at/before CreatedAt supply no Box or rollout/retry evidence. `TestHAAwakeBoxAmbiguous`: two awake reporters in either order yield conflict; incomplete, missing/transient and no process evidence yield unknown; explicit matching asleep evidence yields asleep with oldest At. `TestHAAwakeBoxStaleHolder`: advance the injected clock beyond 15 minutes while fresh asleep adopters remain; the old awake/transient reporter makes the result unknown, never A2. Test just before/after the stale boundary, timestamp serialization, unset HARegions and immutable inputs. |
| -- [ ] **Step 2: Run** `nice -n 19 go test ./internal/console -run 'TestHAAwakeBox' -count=1`. Expected FAIL before implementation. |
| -- [ ] **Step 3: Implement C1 in one place.** `remoteFacts` supplies all HA candidates from `pageBoxReports`; defer source loading until authorized records are available, skip legacy status warming/join on all-HA lists, and reuse request-memo loads on mixed lists rather than loading the same reports twice; every HA adapter calls `facts.haObservation(rec)` or passes its result. Wire it into `instanceHealth` before counts/filtering and after any legacy metric/fleet fallback; `addRemoteRows` covers both local adopted and remote rows. `assembleInstanceRows` and Running-tab counts use its Health instead of metrics/boxAwake OR-inference (`internal/console/overview.go:194,317`). Detail consumes the same observation even on its remote branch, instead of suppressing all remote rollout or calling the weaker local join. The authorized single GET uses the same accessor after `readRecord`; snapshot failure yields a 200 with unknown observation, not a false absence. Retry retains the record it currently discards, uses the same selected Rollout for HA, then applies existing retryable/version/book/epoch checks; unknown/conflict/asleep produce existing refusal and **no grant or serial write**. Non-HA consumers keep loadRolloutJoin. No consumer may fall back from a nil HA Rollout to legacy `join.rollout` or `facts.host`. Copy requirements A1–A6. |
| -- [ ] **Step 4: Add production-wired witnesses.** `TestHAAwakeBoxPageAndAPI` drives authorized list page, local/remote detail, list API and single GET for awake/unknown/conflict/asleep; assert Box/At, health, Installed/Serving and retry eligibility agree. Test stranger/team-out-of-scope neutral answers and no foreign box leak. `TestHAAwakeBoxRetryUsesObservation`: contradictory/partial/stale evidence writes zero retries; a uniquely awake held reporter uses its own book and epoch, never the sleeping adopter’s. `TestHAAwakeBoxNoExtraReads` renders all HA consumers within TTL and verifies one shared load, not one per view; include a cold single GET and retry. A wiring guard rejects direct HA selection through `boxJoin.rollout`, `facts.host` or local metrics in these adapters. Run Step 2 plus `nice -n 19 go test ./internal/console -run 'TestRemoteFacts|TestInstanceGrouping|TestHAAwakeBox' -count=1`; expected PASS. |
| -- [ ] **Step 5: CLI JSON and census witness.** Current `runInstancesList` has no JSON flag (`instances_cli.go:741`); add `--json` and its reviewed help/usage, decode the three observation fields in `apimode.go`, and encode `{instances,truncated,total}` from the existing API client result. Keep all selection on the server; retain corrected rollout and health in JSON and ordinary table cells. JSON mode emits no table, hint or trailing prose. Do not add a box column. `TestInstancesHAJSON` drives actual API decoding and CLI output for four states, timestamp round-trip, old-server field omission and truncation metadata; `TestInstancesHARolloutCells` checks selected Serving and unknown/asleep dashes. Use fake console/auth and `carlosTestEnv` plus scratch cwd for any binary subprocess. Run `nice -n 19 go test . -run 'TestInstancesHA|TestInstancesRollout' -count=1`. Update `docs/site/cli.md` for the flag and JSON-only observation contract (D1/J1); these two root source files and their envelopes require a census card/reviewer before implementation merge. |
| -- [ ] **Step 6: Commit** `region-ha p2a: show the last reported awake box`. This is the first implementation merge, with its view, CLI JSON, witnesses and census approval together; no scaffold-only merge. |
| - |
| -### Task 2: Use configured regional ingress for DNS instructions |
| - |
| -**Files:** ingress parser/startup/source files from the file map, `internal/console/server_test.go` for `TestDomainGuidanceSteering` (`internal/console/server_test.go:1652`); update accepted `domainGuidance` copy in `view.go` and CLI docs in the same task. |
| - |
| -**Interfaces:** `Config.RegionIngress []string` (DNS destinations only), plus `func ParseRegionIngress(raw string) ([]string, error)` in `internal/console/regioningress.go`, called by `cmd/console` startup. Format of **CONSOLE_REGION_INGRESS** for this plan is comma-separated IP literals (NLB's static EIPs), matching PLATFORM_EDGE_IPS's address vocabulary; tofu deployment wiring must supply the complete regional set. Trim, canonicalize IPv4/IPv6, de-duplicate in first-seen order. Empty/unset retains legacy behavior. Non-empty with any invalid item fails startup; never silently fall back to member EIPs. |
| - |
| -- [ ] **Step 1: Write failing tests.** `TestRegionIngressParsing`: blank legacy, whitespace, duplicate, IPv4/IPv6, invalid/hostname/URL/port rejected. `TestConfiguredIngressSuppressesMemberIPs`: in configured mode output is PLATFORM_EDGE_IPS followed by RegionIngress, deduplicated; no live-box fold even during S3 failure. Unset mode retains today’s union and cache. `TestConfiguredIngressSuppressesSteering` sets SteeringHost and tests apex/subdomain guidance contains only A records to the configured union, never a CNAME. Update `TestDomainGuidance` for every changed legacy sentence as well as the configured branch. `TestIngressDoesNotWidenProxyTrust`: new ingress alone does not make `trustsProxy` accept a peer; existing loopback and explicitly trusted EdgeIPs behave as before. |
| +- [ ] **Step 1: Write failing tests.** `TestRegionIngressParsing`: blank legacy, whitespace, duplicate, IPv4/IPv6, invalid/hostname/URL/port rejected. `TestConfiguredIngressSuppressesMemberIPs`: in configured mode output is PLATFORM_EDGE_IPS followed by RegionIngress, deduplicated; no live-box fold even during S3 failure. Unset mode retains today’s union and cache. `TestConfiguredIngressSuppressesSteering` sets SteeringHost and tests apex/subdomain guidance contains only A records to the configured union, never a CNAME. Update `TestDomainGuidance` for every changed legacy sentence as well as the configured branch. `TestConfiguredIngressPlacements` drives actual GET and PUT for regional HA/mixed claims and single HA targets, explicit/empty home and immutable HA after switch-off: 409/I6, configured guidance only, no member addresses, readiness or claim/index/serial writes. Missing target/read failure remains neutral temporary refusal. Cover unset-ingress and non-HA-only legacy success, stranger/team-scope neutrality, and the console domain-list/detail/settings guidance sinks. `TestConfiguredIngressMultiRegion` proves deployment-wide fold suppression. `TestDomainsPlacementsConfiguredIngressRefusal` drives the existing CLI against a fake-console 409 and proves its answer contains configured guidance, no DNS-ready member table; use `carlosTestEnv` and scratch cwd for any binary subprocess. `TestIngressDoesNotWidenProxyTrust`: new ingress alone does not make `trustsProxy` accept a peer; existing loopback and explicitly trusted EdgeIPs behave as before. |
| - [ ] **Step 2: Run** `nice -n 19 go test ./internal/console -run 'TestRegionIngress|TestConfiguredIngress|TestIngressDoesNotWidenProxyTrust' -count=1`; expected FAIL. |
| -- [ ] **Step 3: Implement C2.** Parse at console startup, before NewServer/listener. Do not merge RegionIngress into Config.EdgeIPs: `internal/console/authcli.go:1210` uses that as authority. In configured mode `edgeIPs` returns the static DNS union without `foldedEdgeIPs`; all callers of `dnsTargets` inherit it. In configured mode suppress `SteeringHost` in dnsTargets: offer only A-record guidance for apexes **and subdomains**, even if steering is armed. `internal/host/steering_loop.go:126` builds steering from edges files, not RegionIngress; no CNAME may promise configured ingress until a later merged steering producer uses that list. Unset mode retains main’s steering behavior. Use reviewed I1/I2/I5, with I3/I4 restricted to legacy mode; do not promise the console discovers NLB addresses. Validate the complete proposed ingress with this parser **before rolling** the console, since invalid nonempty input stops startup. Verify console PLATFORM_EDGE_IPS contains only intended public ingress, with no member-only/platform-box EIP, before enabling configured mode. In the deployment recipe require the agents' existing PLATFORM_EDGE_IPS to recognize that same public set before any NLB cut-over; console instructions alone cannot change their DNS verdict. |
| -- [ ] **Step 4: Add/run** `TestRegionIngressStartupWiring` in `cmd/console/main_test.go` using injected getenv/parser input; no real process or credentials. Run Step 2 plus `nice -n 19 go test ./cmd/console -run TestRegionIngress -count=1` and `nice -n 19 go test ./internal/console -run 'TestEdgeFold|TestDomainGuidance' -count=1`. Expected PASS; configured mode makes **zero** fold reads, and no network address is looked up during parsing. |
| +- [ ] **Step 3: Implement C2.** Parse at console startup, before NewServer/listener. Do not merge RegionIngress into Config.EdgeIPs: `internal/console/authcli.go:1210` uses that as authority. In configured mode `edgeIPs` returns the static DNS union without `foldedEdgeIPs`; all callers of `dnsTargets` inherit it. In configured mode suppress `SteeringHost` in dnsTargets: offer only A-record guidance for apexes **and subdomains**, even if steering is armed. `internal/host/steering_loop.go:126` builds steering from edges files, not RegionIngress; no CNAME may promise configured ingress until a later merged steering producer uses that list. Unset mode retains main’s steering behavior. Use reviewed I1/I2/I5/I6, with I3/I4 restricted to legacy mode; do not promise the console discovers NLB addresses. Validate the complete proposed ingress with this parser **before rolling** the console, since invalid nonempty input stops startup. Verify every listed console PLATFORM_EDGE_IPS entry is public ingress before enabling configured mode; a platform box EIP may be that ingress. The same variable also feeds agent DNS checks and console proxy trust, so no cosmetic removal of a platform IP is authorized here. In the deployment recipe require the agents' existing PLATFORM_EDGE_IPS to recognize that same public set before any NLB cut-over; console instructions alone cannot change their DNS verdict. |
| +- [ ] **Step 4: Add/run** `TestRegionIngressStartupWiring` in `cmd/console/main_test.go` using injected getenv/parser input; no real process or credentials. Run Step 2 plus `nice -n 19 go test ./cmd/console -run TestRegionIngress -count=1` and `nice -n 19 go test ./internal/console -run 'TestEdgeFold|TestDomainGuidance' -count=1`. Run `nice -n 19 go test . -run TestDomainsPlacementsConfiguredIngressRefusal -count=1` as well. Expected PASS; configured DNS source selection makes **zero** fold reads (placements retains its separately budgeted authorization/target checks), and no network address is looked up during parsing. |
| - [ ] **Step 5: Commit** `region-ha p2a: use regional ingress in DNS guidance`. |
| -### Task 3: Refuse unsafe HA creates before any side effect [own review: security/storage gate] |
| +### Task 2: Refuse unsafe HA creates before any side effect [own review: security/storage gate] |
| **Files:** new `internal/console/hacreate.go`, `hacreate_test.go`; modify `createleftovers.go`, `apiinstances.go`, `ha_born_test.go`, `rootfs_test.go`. No sidecar/domain handler edit is needed for the dropped F4. |
| -**Interfaces / C3:** `func (s *Server) haCreateShapeRefusal(rec provision.Record) *doorRefusal` returns F1/400 iff `s.haRegion(rec.Region) && rec.KindOrDefault() == "instance" && len(rec.AddrsOrDefault()) == 0 && !rec.HibernateOrDefault()`. This applies equally to plain and `--from` creates, before their paths split; an unstamped seed is not exempt. Use effective region after home/placement normalization, not raw request input. Address-backed records default non-hibernating (`internal/provision/provision.go:537`) and are outside this predicate. |
| +**Interfaces / C3:** `func (s *Server) haCreateShapeRefusal(rec provision.Record) *doorRefusal` returns F1/400 iff `s.haRegion(rec.Region) && rec.KindOrDefault() == "instance" && len(rec.AddrsOrDefault()) == 0 && rec.Runtime == "" && !rec.HibernateOrDefault()`. This applies equally to plain and `--from` creates, before their paths split; an unstamped seed is not exempt. Use effective region after home/placement normalization, not raw request input. Address-backed records default non-hibernating (`internal/provision/provision.go:537`) and are outside this predicate. |
| Add `HAData bool` to leftoverCreate, set exactly to `s.shouldStampHA(rec) && !seeded && rec.DerivesPaths()` before stamping (`internal/console/seedmove.go:47`; `internal/console/apiinstances.go:2308`). This explicitly excludes Addr **and** Addrs instances from prefix proof while preserving their existing stamp; seed/import, static, replica, sidecar and rootfs exclusions remain. `firstHALeftover(ctx, st, prefix) (class string, err error)` uses `release.PageLister.ListPage(ctx,prefix,"",1)` for `activator.HibernatePrefix(cfg.HibernatePrefix,host)+"/"`. Missing bounded listing is an error. Classify the first key into fixed `lock`, `files`, `replica` or `other`; return no raw key, object SHA, contents or bucket. Use SeedData only at the configured home data-bucket root (`internal/console/server.go:551`). |
| -- [ ] **Step 1: Write failing tests.** `TestHACreateShapeBeforeWrites`: plain **and --from** HA socket creates with Hibernate false get F1/400 before writes; normal hibernating socket proceeds to its existing rails; non-HA, static and Addr/Addrs-backed shapes retain main behavior. `TestHACreatePrefixObjects`: lock.json (legacy/corrupt/other lifetime), files/0/manifest, sealed object, each LTX level and an unknown key all get F2/409 with only a fixed class; empty/sibling prefixes pass. No hash/key/bucket/body appears in JSON or HTML. Address-backed creates get no F1 or HA prefix listing, including remote/pool cases. |
| +- [ ] **Step 1: Write failing tests.** `TestHACreateShapeBeforeWrites`: plain **and --from** HA binary socket creates (`Runtime == ""`) with Hibernate false get F1/400 before writes; normal hibernating socket proceeds to its existing rails; non-HA, static, resident rootfs (including Hibernate=false) and Addr/Addrs-backed shapes retain main behavior. `TestHACreatePrefixObjects`: lock.json (legacy/corrupt/other lifetime), files/0/manifest, sealed object, each LTX level and an unknown key all get F2/409 with only a fixed class; empty/sibling prefixes pass. No hash/key/bucket/body appears in JSON or HTML. Address-backed creates get no F1 or HA prefix listing, including remote/pool cases. |
| - [ ] **Step 2: Run** `nice -n 19 go test ./internal/console -run 'TestHACreate' -count=1`; expected FAIL. |
| -- [ ] **Step 3: Implement C3 before mutation.** Add F1 after ValidateShape (`internal/console/apiinstances.go:2182`) and effective-region resolution, before env binding/seed dispatch. In `leftoverReplicaRefusal` (`internal/console/createleftovers.go:136`), only `!c.HAData && !leftoverCheckApplies(...)` may take the old early return. Read record existence first; return ordinary duplicate/read failures before any new data proof or placement cut. For HAData, a non-home effective region or nonempty pool gets **F5/409**, the deliberate G3 cut, with no Retry-After or operator-access remedy. For home, unpooled HAData, require HibernateBucket, non-nil SeedData, and normalized record region equal to cfg.Region so `leftoverCheckApplies` can prove authority (`internal/console/createleftovers.go:43`). Missing/mismatched wiring, unsupported bounded listing or listing failure gets **F3/503** with retry wording; a predecessor object gets F2/409. Perform the bounded whole-prefix proof before the existing LTX/move-staging rail; retain that rail. The create-time proof is no reservation; keep first-wake’s empty-prefix proof. No IAM expansion, speculative bucket clients or unbounded LIST fallback. |
| +- [ ] **Step 3: Implement C3 before mutation.** Add F1 after ValidateShape (`internal/console/apiinstances.go:2182`) and effective-region resolution, before env binding/seed dispatch. In `leftoverReplicaRefusal` (`internal/console/createleftovers.go:136`), only `!c.HAData && !leftoverCheckApplies(...)` may take the old early return. Read record existence first; return ordinary duplicate/read failures before any new data proof or placement cut. For HAData, a non-home effective region or nonempty pool gets **F5/409**, the deliberate G3 cut, with no Retry-After or operator-access remedy. For home, unpooled HAData, require HibernateBucket, non-nil SeedData, and normalized record region equal to cfg.Region so `leftoverCheckApplies` can prove authority (`internal/console/createleftovers.go:43`). Missing/mismatched wiring, unsupported bounded listing or listing failure gets **F3/503** with retry wording; a predecessor object gets F2/409. For HAData, perform the bounded whole-prefix proof, then retain only the existing `moves/<host>/` LTX check (levels 0–9). Skip the redundant ten `instances/<host>/` level LISTs after a successful empty whole-prefix proof. Parameterize the existing prefix walker so non-HA and sidecar callers keep both original prefixes; do not duplicate the scan algorithm. Witness exact prefixes and maximum attempts, including every move-staging level and error path. The create-time proof is no reservation; keep first-wake’s empty-prefix proof. No IAM expansion, speculative bucket clients or unbounded LIST fallback. |
| **Controller ruling / C3/C4:** standalone sidecars retain main’s success/duplicate/LTX behavior and remain unstamped in HA regions (`internal/console/apisidecars.go:394`; `internal/console/ha_born_test.go:84`). **F4 is dropped.** First-domain static creates also retain main’s behavior (`internal/console/domainattach.go:253,679`); no HAData check. P2b adds the shared §11 capacity gate to those doors. Existing-host wakes remain outside create admission. |
| - [ ] **Step 4: Wire refusal witnesses.** `TestHACreateUninspectableRefusesBeforeWrites` covers remote/pool F5/409 separately from home missing-store/missing PageLister/list error F3/503, private storage and lifetime-on/off. `TestHACreateDuplicatePrecedesReplica` covers existing instance and sidecar retries before data checks/cuts, preserving each door’s main duplicate text. Exercise actual handlers: refused requests write zero record/lifetime/claim/env/store-grant/provision/serial/index/staging mutations. --from stays on seed-floor/leftover transport without stamp, but F1 applies; import’s active-HA refusal precedes seed data work. Non-HA fleet behavior stays unchanged. |
| - **Existing fixtures whose setup/expectations change (P2-6 / C3):** `TestCreateStampsBornHA` (`internal/console/ha_born_test.go:45`) currently creates explicit ie with no home/data wiring: split remote ie into F5/409/no writes, then set HomeRegion=ie and coherent cfg.Region/normalized record region, HibernateBucket and empty bounded SeedData for successful explicit-home and empty-home stamps. Keep non-HA/off-switch assertions. `TestSeedsAndSidecarsAreNeverStampedHA` (`internal/console/ha_born_test.go:84`) gets the same home wiring for its plain-create control; preserve its successful HA standalone sidecar and seed exclusions. `TestStaticRecordIsNotStampedAndDoesNotBlockAMove` (`internal/console/ha_born_test.go:205`) keeps no HA refusal for static moves, adds destinations into HA, and supplies home data wiring to its binary stamp control. `TestRootfsCreateIsNeverBornHA` (`internal/console/rootfs_test.go:588`) changes its rootfs release fixture to hibernating so the successful create still proves no HA stamp, explicitly checks that the original non-hibernating socket shape now gets F1/400, and wires the empty home store for its binary control. Main’s `unplacedRootfsApp` ships Hibernate=false (`internal/console/rootfs_test.go:465,468`); no runtime exception is hidden in F1. Never set HAData=false or bypass a gate to rescue fixtures. Run Step 2 plus `nice -n 19 go test ./internal/console -run 'TestCreateStampsBornHA|TestSeedsAndSidecarsAreNeverStampedHA|TestStaticRecordIsNotStamped|TestRootfsCreateIsNeverBornHA|TestLeftover|TestCreateRefuses|TestCreateAllows|TestCreateSkips|TestCreateRetry' -count=1`; expected PASS. |
| + **Existing fixtures whose setup/expectations change (P2-6 / C3):** `TestCreateStampsBornHA` (`internal/console/ha_born_test.go:45`) currently creates explicit ie with no home/data wiring: split remote ie into F5/409/no writes, then set HomeRegion=ie and coherent cfg.Region/normalized record region, HibernateBucket and empty bounded SeedData for successful explicit-home and empty-home stamps. Keep non-HA/off-switch assertions. `TestSeedsAndSidecarsAreNeverStampedHA` (`internal/console/ha_born_test.go:84`) gets the same home wiring for its plain-create control; preserve its successful HA standalone sidecar and seed exclusions. `TestStaticRecordIsNotStampedAndDoesNotBlockAMove` (`internal/console/ha_born_test.go:205`) keeps no HA refusal for static moves, adds destinations into HA, and supplies home data wiring to its binary stamp control. `TestRootfsCreateIsNeverBornHA` (`internal/console/rootfs_test.go:588`) preserves the original successful non-hibernating rootfs fixture and proves no HA stamp; only its binary control gains coherent empty home data wiring. P1a row 3.3’s resident rootfs allowance is unchanged. F1’s `rec.Runtime == ""` explicitly distinguishes the refused binary socket from this lease-owning rootfs route. Never set HAData=false or bypass a gate to rescue fixtures. Run Step 2 plus `nice -n 19 go test ./internal/console -run 'TestCreateStampsBornHA|TestSeedsAndSidecarsAreNeverStampedHA|TestStaticRecordIsNotStamped|TestRootfsCreateIsNeverBornHA|TestLeftover|TestCreateRefuses|TestCreateAllows|TestCreateSkips|TestCreateRetry' -count=1`; expected PASS. |
| - [ ] **Step 5: Commit** `region-ha p2a: refuse unsupported HA creates before writes`. |
| -### Task 4: Close regional move/import refusal gaps [own review: production storage] |
| +### Task 3: Close regional move/import refusal gaps [own review: production storage] |
| **Files:** transfer files in the file map; new `internal/console/hatransfers_test.go`. Preserve main’s P1a and provision CAS protections; no change to `provision.SetRecordRegion`. |
| @@ -179,20 +151,47 @@ Add `HAData bool` to leftoverCreate, set exactly to `s.shouldStampHA(rec) && !se |
| - [ ] **Step 1: Write failing tests.** `TestHAMixedMoveRegionsBeforeWrites`: HA→legacy, legacy→HA, HA→HA, legacy record in active HA source, both home spellings, flag true with HARegions unset; offline stage/start plus legacy and Phase-1 doors. Assert 409 names blocking region and no OfflineStart/stage journal/stop/hold/env/control mutation. `TestHAImportFlagSurvivesSwitchOff` tests immutable HA at upload/stopped after switch-off; begin’s active-region check and defensive flag predicate are explicit separate cases, not a claim begin can load an existing HA record. Non-HA imports retain main behavior. |
| - [ ] **Step 2: Run** `nice -n 19 go test ./internal/console -run 'TestHAMixedMove|TestHAImportFlag' -count=1`; expected FAIL. |
| -- [ ] **Step 3: Implement C3 centrally.** In `offlineBeginChecks` (`internal/console/apiinstancemove_offline.go:505`), validate syntax/ownership and run the helper before claim evidence, manifest/fleet work or writes; stage and start share it. Apply it to older and Phase-1 initiation (`internal/console/apiinstancemove.go:427,583`). Preserve cleanup/recovery of already-started operations. In `placeAppTarget` (`internal/console/fleets.go:783`), target is home (`""`) or `fleet/<name>` only (`internal/console/fleets.go:817`). Under the existing account/app locks (`internal/console/fleets.go:856,857`), examine changed-region records from the strict read and refuse before SetAppPlacementContext (`internal/console/fleets.go:928`) or manifest/registry writes. A fleet→HA-home data move refuses; a home→same-home or same-fleet record does not acquire a new HA-region refusal. Config is immutable for process lifetime and the app lock spans checks/writes, so no new shared-package recheck is needed. Keep existing SetRecordRegion HA/seed/rootfs CAS checks and their races (`internal/provision/provision.go:1040,1042,1049`); they already apply only when the raw region changes. Avoid a cosmetic empty-home↔home-code rewrite on an immutable HA record: skip SetRecordRegion for normalized no-op records, rather than weakening the shared CAS. No-op records must not trigger either the preflight or write-time HA refusal; changed records still do. |
| +- [ ] **Step 3: Implement C3 centrally.** In `offlineBeginChecks` (`internal/console/apiinstancemove_offline.go:505`), preserve main’s refusal order: after its existing ownership/shape checks and `offlineClaimEvidence`, parse with `readJSON`, normalize/validate the target, then run the helper before manifest/fleet work or writes; stage and start share it. Apply it to older and Phase-1 initiation (`internal/console/apiinstancemove.go:427,583`). Preserve cleanup/recovery of already-started operations. In `placeAppTarget` (`internal/console/fleets.go:783`), target is home (`""`) or `fleet/<name>` only (`internal/console/fleets.go:817`). Under the existing account/app locks (`internal/console/fleets.go:856,857`), examine changed-region records from the strict read and refuse before SetAppPlacementContext (`internal/console/fleets.go:928`) or manifest/registry writes. A fleet→HA-home data move refuses; a home→same-home or same-fleet record does not acquire a new HA-region refusal. Config is immutable for process lifetime and the app lock spans checks/writes, so no new shared-package recheck is needed. Keep existing SetRecordRegion HA/seed/rootfs CAS checks and their races (`internal/provision/provision.go:1040,1042,1049`); they already apply only when the raw region changes. Avoid a cosmetic empty-home↔home-code rewrite on an immutable HA record: skip SetRecordRegion for normalized no-op records, rather than weakening the shared CAS. No-op records must not trigger either the preflight or write-time HA refusal; changed records still do. |
| - [ ] **Step 4: Add/run** `TestHAPlaceRegionsBeforeWrites` for both changed-region refusals and no-op/mixed no-op-plus-moving records, explicit/empty home equality, fleet→HA-home, static-only place and data-plus-static app. `TestHATransferStaticExemption` covers the exact static predicate in every initiation family and confirms an immutable HA flag still refuses. `TestHATransferCleanupStillWorks` covers cut/abort/resolve, offline seal/flip/open/finish, and import **commit/abort**, all continuing started operations. Run `nice -n 19 go test ./internal/console -run 'TestHAMixedMove|TestHAImportFlag|TestHAPlace|TestHATransfer|TestStaticRecordIsNotStamped|TestMoveDoorsRefuseHAHostBeforeAnyWrite|TestMoveRefusalNamesTheHomeRegion|TestImportRefusedIntoHARegionInOneBoxRegion|TestImportUploadAndStoppedRefusedInHARegion|TestPlaceRefusedForAppWithHAHost|TestPlaceRefusesAnHARecordCreatedBetweenItsScans' -count=1`; expected PASS. HA restore’s existing early return (`internal/activator/backend_exec.go:936`) stays a regression witness, with no backend edit. |
| - [ ] **Step 5: Commit** `region-ha p2a: refuse HA transfers at both region boundaries`. |
| -### Task 5: Production-wiring witness, dev console drill and landing gate |
| +### Task 4: Ingress/refusal wiring witness, dev drill and landing gate |
| + |
| +**Files:** new `internal/console/hap2_wiring_test.go`; implementation branch’s ingress/refusal drill evidence. This is the former Task 5, renumbered after the display cut. No infrastructure change is authorized by this plan. |
| -**Files:** new `internal/console/hap2_wiring_test.go`; implementation branch's drill evidence. No infrastructure change is part of this task without the scoped approval below. |
| +- [ ] **Step 1: Write/run** `TestHAP2ProductionDoors` and `TestHAP2RequestBudget`, using NewServer’s real auth/router, real store wrappers and a low-level S3 counting transport. Cover ingress guidance/placements and refused instance/move/stage/place/import writes, including private storage and lifetime modes. Retain success/exclusion witnesses for resident rootfs, standalone sidecars, first-domain static creates and ordinary duplicates. Count the whole-prefix proof plus only ten move-staging levels for HAData; non-HA/sidecar rails keep both prefixes. Assert reviewed copy at actual console/API sinks and existing CLI error propagation. Run `nice -n 19 go test ./internal/console -run 'TestHAP2|TestHACreate|TestHAMixedMove|TestHAImportFlag|TestHAPlace|TestHATransfer|TestRegionIngress|TestConfiguredIngress|TestIngressDoesNotWidenProxyTrust' -count=1` and Task 1’s startup/CLI tests. Temporarily omitting each production gate must fail its witness; no production mutation switch. No display, rollout, health, hold, retry or deploy-watch witness is added by P2a. |
| +- [ ] **Step 2: Prepare the scoped dev approval card before live mutation.** Deployment evidence read 2026-11-01: discussion #421 records **`CONSOLE_HA_REGIONS` unset**, first after P1a’s 2026-10-27 drill and again after P1b-1. The later `~/.cache/release-v0.31.1/roll-log.md` records it unset before and after the 2026-10-30 console roll (10:58–11:03Z), with no HA drop-in. That P1b-2 drill used existing **`hapair-a1`**, in pool **`hapair`** on leo/sophie. The private `platform-infrastructure/dev/main.tf` names AWS account **640012953448**; the IE data bucket/region recorded on #421 is **carlos-dev-ie-640012953448 / eu-west-1**. These are recorded deployment facts, not a fresh live config read. Re-read the actual dev configuration and target records before finalizing the card; stop if they differ until the scope is corrected. Existing pooled `hapair-a1` is not the successful-create drill host: F5 would refuse a new pooled HAData create. |
| -- [ ] **Step 1: Write/run** `TestHAP2ProductionDoors` and `TestHAP2RequestBudget`, using NewServer's real auth/router, real record/store wrappers and a low-level S3 counting transport. Count refused instance/move/stage/place/import mutations, including private storage and lifetime modes. Separately witness successful HA standalone-sidecar and first-domain static creates retaining main behavior, ordinary duplicate precedence and no HAData/F4 rail. Their capacity gates are P2b, not unimplemented P2a refusals. Display tests drive a platform-local adopted route plus the two existing report snapshots through list/single API, pages, CLI JSON and retry; no fake replica-to-awake inference. Assert accepted copy IDs at actual response/template/alert sinks. New targeted commands: `nice -n 19 go test ./internal/console -run 'TestHAP2|TestHAAwakeBox|TestHACreate|TestHAMixedMove|TestHAImportFlag|TestHAPlace|TestHATransfer|TestRegionIngress|TestConfiguredIngress|TestIngressDoesNotWidenProxyTrust' -count=1`. Expected PASS. Temporarily omitting each production gate must make its corresponding witness fail; do not add production mutation switches. |
| -- [ ] **Step 2: Prepare dev approval card.** Read the private deployment root to identify actual account/region/resources. Name dev console, leo/sophie/hapair, exact test app/account/host/domain/prefixes, release/roll/restarts, temporary instance/alias writes, ingress configuration, cost cap, duration and rollback/cleanup/verification. Verify **before the roll** that the effective console HomeRegion and cfg.Region match the HA home after normalization, HibernateBucket is nonempty and is the intended regional data bucket, and SeedData is non-nil at that bucket’s root (startup construction: `cmd/console/main.go:444,446,449`; admission: `internal/console/createleftovers.go:43`). Record the pre-roll store/config identity and read-only bounded empty-prefix check through the console’s store seam; local built-console handler witnesses cover zero writes and explicit/empty-home aliases. After scoped approval, confirm a disposable home create succeeds with the rolled binary; that success changes records and is part of the approved drill, never a read-only preflight. Missing wiring blocks switch-on; do not roll a configuration that makes every home create F3. Run the ingress parser on the exact proposed env first and check PLATFORM_EDGE_IPS for member-only/platform-box EIPs. No guessed account IDs, new IAM, NLB, DNS or group resource changes. Get scoped approval before live mutation; a later NLB drill needs a separate expanded scope. This planning task grants none. |
| -- [ ] **Step 3: Dev visible witness.** Use the built console binary, record version/UTC times. With a born-HA host awake on one peer and adopted/asleep on the other/platform registry, capture Instances row/detail, list/single API and CLI JSON: exactly the reporter’s rollout/Serving, generation At and age. Exercise retry locally using the same selected book/epoch; unknown/conflict writes zero grants. Sleep it; after complete fresh explicit asleep reports and the cache interval, show no reported awake box with the oldest report’s age. A missing/stale prior awake/transient report must show unknown instead. Unknown/duplicate reporters are exercised locally, without fabricating dev files. State the normal five-minute snapshot cadence and 60-second console cache separately; report load failures as unknown. Neither is a guaranteed live-state bound. Do not promise immediate sleep tracking or trigger fresh box polls. |
| -- [ ] **Step 4: Dev refusal/ingress witness.** Configured ingress equals approved existing dev public destinations (no pretending an NLB exists). Inspect DNS guidance/API and ensure member-only addresses disappear from configured mode. Validate agent DNS acceptance using existing tooling/config, without changing production DNS. Use approved never-woken throwaway names to demonstrate unsupported shape and mixed-region/import refusals before any app/control write. Prefix fixtures/counters stay local unless approval explicitly permits disposable data objects. Do not exhaust dev headroom; no kill/terminate/hang is necessary for P2a. Clean all resources/processes started by this task and restore configuration within the approval. |
| -- [ ] **Step 5: Census and review** as below; one whole-P2a branch review plus only risk-sized own-task reviews, within stopping budget. Record exact tip and evidence; no claims of P2b readiness or G1/G3 acceptance. |
| -- [ ] **Step 6: Implementation landing only.** Once targeted checks pass, run repo-required `go build ./...`, `go vet ./...`, `make test`, whole-tree formatting gate once; darwin/amd64, windows/amd64 and linux/arm64 compiles with CGO_ENABLED=0, explicit scratch output, arm64 binary below 64,000,000 bytes. A later authorized session pushes/describes the branch on amadan, requires green CI on its full tip, squash-merges with `-expect`, and reads main's CI. No push/merge or those suites in this plan-drafting session. |
| + Reserve **`hap2a-home1.bab.dev.oncarlos.com`** in existing **ops/hacheck**, home **IE**, **no pool**, as the proposed disposable successful-create host; it must be unused with empty home replica/move prefixes. The card must confirm account sqid, app manifest, domain ownership and availability; if unavailable, name the replacement explicitly before approval. Do not reuse, move or restamp `hapair-a1`, and do not wake either host for this drill. Use separately named never-woken throwaway requests for F1 and regional/import refusals; list their exact names/prefixes on the card. |
| + |
| + The card names the actual dev console, account/region, leo/sophie only as existing deployment context, exact app/account/hosts/domains/prefixes, binary/version, release/roll/restart operations, expected record/lifetime/env/serial/index writes, ingress inputs, traffic effects, cost cap, duration and cleanup/verification. Verify before rolling that normalized HomeRegion=IE and cfg.Region agree, HibernateBucket is the intended home bucket and root SeedData is non-nil (`cmd/console/main.go:444,446,449`; `internal/console/server.go:551`). Confirm the never-used prefixes through bounded read-only store checks. Local handler witnesses cover zero writes and explicit/empty-home aliases. Missing wiring blocks switch-on. |
| + |
| + **Switch change on the approval card:** if the preflight confirms unset HA regions, temporarily set **`CONSOLE_HA_REGIONS=ie`** on the dev console for the approved test window, then restore the exact prior value and restart/read back. This affects **every concurrent dev IE create**, not only hacheck: eligible new instance records acquire immutable HA; binary non-hibernating sockets get F1; HAData creates get F2/F3 or pool/non-home F5; legacy data moves/imports involving active IE get refusals; configured HA placements get I6. Resident rootfs keeps P1a’s allowance, and standalone sidecars/static retain main’s behaviour. Coordinate the window with other dev creators; if it cannot be isolated, leave the implementation on branch. **Rollback cannot remove an HA stamp.** Record all creates during the window, retire only approved disposable records via existing API/CLI cleanup, and report any unexpected born-HA record without migrating or clearing it. No migration or existing-record restamp is authorized. Record the exact previous ingress/env/binary versions and their restore/verification steps too. |
| + |
| + Validate exact proposed ingress with the parser before the roll. Require **every listed PLATFORM_EDGE_IPS address to be public ingress**; today a platform box EIP may be that ingress. Its agent DNS-check and console proxy-trust uses are unchanged. Verify agent DNS acceptance of the complete proposed public set before cut-over. Name existing dev public destinations only: no new IAM, NLB, DNS, group, box or account-level changes. The requested scoped approval covers this window and its cleanup; this planning commit grants none. |
| +- [ ] **Step 3: Dev ingress/refusal witness only.** With the approved rolled console binary, record version and UTC times. Capture console domain guidance/API and the existing CLI’s answer: complete configured public destinations, A-only guidance, no HA member-EIP recommendation, and placements I6 without a readiness claim. Exercise unset-ingress legacy guidance as a local witness; do not fabricate an NLB or change DNS. During the approved IE window, create the unused unpooled home drill record successfully and confirm its HA stamp without waking it; demonstrate F1, F5 and mixed-region/import refusals with the approved names, before any protected write. Prefix-object fixtures/counters remain local unless disposable data writes are expressly approved. No awake-box observation, health assertion, deploy/retry drill, headroom exhaustion, kill, termination or hang belongs here. Restore the recorded switch/ingress/binary configuration, verify its effective value and answers, retire only the approved throwaways and remove owned scratch/processes within the approved duration. Immutable HA semantics still apply after switch rollback. |
| +- [ ] **Step 4: Census and review** as below; one whole-P2a branch review plus only risk-sized own-task reviews, within the stopping budget. Record exact tip and ingress/refusal evidence; no claims of C1 completion, P2b readiness or G1/G3 acceptance. |
| +- [ ] **Step 5: Implementation landing only.** Once targeted checks pass, run repo-required `go build ./...`, `go vet ./...`, `make test`, whole-tree formatting gate once; darwin/amd64, windows/amd64 and linux/arm64 compiles with CGO_ENABLED=0, explicit scratch output, arm64 binary below 64,000,000 bytes. A later authorized session pushes/describes the branch on amadan, requires green CI on its full tip, squash-merges with `-expect`, and reads main’s CI. No push/merge or those suites in this plan-drafting session. |
| + |
| +## After P1b-3a: HA display design |
| + |
| +**N-HA13: outline only, no implementation or executable API/field/test contract.** After P1b-3a merges, re-read current main and write one small design for Paul’s “which box is it awake on” view. P2a preserves main’s display, rollout, health, hold, retry, deploy-watch and other join behaviour. Do not ship an independent awake-box field beside an inconsistent rollout. An observation is never lease or wake authority. |
| + |
| +Inventory **every rollout consumer** before designing a projection: console list and counts/filters, local and remote detail, list API, single GET, CLI table and JSON/decoder, hold/Failed presentation, retry grant, deploy watch (including released CLIs), health, and every other per-host join field. Current anchors include `internal/console/apiinstances.go:962,1133,1326,1415`, `instancepage.go:43,298,302`, `remoteinstances.go:259,337,459`, `overview.go:194,317`, `apiretry.go:90`, root `instances_cli.go:573,583,596,741`, `apimode.go:3337,4184` and `deploywatch.go:188,303,314,422,467,515`. Console basenames in this sentence are relative to `internal/console/`. Refresh these anchors against the merged tree. Include all wire decoders and old-client behaviour; budget any new status/cache reads and root census surface in that later plan. |
| + |
| +| Known finding / invariant | Requirement for the later design | |
| +|---|---| |
| +| Round 1 **P1-1 / C1** | Every box adopts each HA record. A newer sleeping adopter, the platform-local row or the last-read join must not override an awake report. Define consistent rollout/Serving/Installed/health and box attribution for all consumers; tenant/account/app/record-lifetime checks, conflicting reporters, partial/missing evidence and immutable HA after switch-off all matter. No arbitrary newest/label/read-order selection. | |
| +| Round 1 **P2-1 / C1** | Carry observation generation/age, with valid timestamp semantics for each conclusion. Five-minute normal status cadence, 15-minute freshness and console cache age are distinct; absence or a stale last-awake/transient report does not prove asleep. Cover timestamp boundaries, incomplete evidence and report failures. | |
| +| Round 1 **P2-2 / C1,C6** | Cover single GET as well as list/detail; decide CLI table versus JSON explicitly. Main has no `instances list --json` flag: a later addition requires help/docs/decoder/truncation/old-server-omission tests and root census. Count cold single-GET reads and cache sharing; never one status load per row/tab. | |
| +| Round 2 **P1-A / C1,C6** | Nil rollout on a complete list triggers old and current deploy watches’ URL fallback and wakes sleeping hosts. Specify asleep projection without an awake-box claim, agreement rules for Installed/SchedulerIdle, and `rollout_incomplete` for unknown/conflict and all-HA lists. Include all-asleep/mixed/unknown/held cases and prove zero URL polls; inspect `legacyOnly`, `apply`, `groupByBox` and released-client decoding. A CLI-only fix is insufficient. These are requirements to settle, not an adopted projection now. | |
| +| Round 2 **P2-A / C1** | Held/down reports need not be awake. Preserve Failed health, the hold row and retry recovery. Select hold/retry evidence by tenant/lifetime-checked fresh HeldBy/book/epoch, with explicit ambiguity/incompleteness refusals and zero grant/serial writes; inventory new copy. Never equate uniquely awake with uniquely held. | |
| +| Round 2 **P2-B / C1** | Address-backed HA and pre-existing non-hibernating sockets may not be activator-owned or publish rollout. Define observation applicability using actual ownership and retain main’s metrics/health for unsupported shapes; test both. HA stamp alone is not evidence of report coverage. | |
| +| Round 2 **P2-C / C1** | Stale dead-holder status keys can survive the 24-hour listing horizon after replacement. Bound their hazard using a cited, merged lease-loss stop guarantee and clock tests, or explicitly accept and communicate up to 24 hours of unknown. Do not silently block all post-failover attribution for a day. | |
| +| Round 2 **P2-D / C1,C6** | Define `staged_version`, `upstreams`, `db_bytes`, `egress`, `update_report`, `config_refusal` and detail Updates/Installed/Serving consistency. Choose each source/clear/aggregate rule and test all-HA and mixed lists; a legacy join present only for neighbours must not change HA answers or read cost. | |
| +| Round 1 **P3-11**, round 2 **P3 bullets 1–2 / C1,copy** | Preserve age/UTC-generation wording requirements without carrying A* strings into P2a. Keep main’s “Setting up” distinction for a complete read with no adoption. Correct test selection: existing CLI tests are `TestInstalledAndServingCells`, `TestRolloutReason`, `TestRolloutWireShape`, not `TestInstancesRollout`; include actual deploy-watch cases. | |
| + |
| +The later design needs a newly scheduled visible result and switch-on date, full copy inventory and production-wired witnesses across this inventory. Carry this P2 plan’s two-round C1 history and N-HA13 into it; a renamed/split document does not reset that history or authorize a fourth round. The controller scopes any further review explicitly after the prerequisite merge; none is dispatched here. |
| ## After P1b-3a merges — P2b outline only |
| @@ -214,54 +213,73 @@ The P1b-3a merge alone does not release the role/readiness/metric dependencies. |
| | Door / current main anchor | P2a behavior and witness | |
| |---|---| |
| -| Instance create, including --from/import dispatch: `internal/console/apiinstances.go:1524`; `internal/console/apiinstances.go:2297,2302`; record writes `internal/console/apiinstanceseed.go:86,89` | Task 3 F1 covers both plain/--from sockets; HAData proof covers prospective plain socket HA only. Imported creates retain the stronger import refusal. Counter witness covers every protected write. | |
| -| Standalone sidecar create: `internal/console/apisidecars.go:223,394` | Main success/duplicate/LTX rail retained, no F4. Task 3/5 success and exclusion witnesses; shared capacity gate is P2b. | |
| -| First-domain static create: `internal/console/domainattach.go:253,679` | Static, no HAData check and no new P2a cut. Task 5 success/exclusion witness; shared capacity gate is P2b. | |
| -| Offline stage/start: `internal/console/apiinstancemove_offline.go:625,663,505` | Both use Task 4 source/destination check before claim/stage/stop writes; staged start rechecks. | |
| -| Legacy/Phase-1 move request: `internal/console/apiinstancemove.go:422,427,574,583` | Same Task 4 rule; no alternative-door bypass. Existing cut/abort/resolve stay open. | |
| -| Apps place API/browser callers: `internal/console/fleets.go:1041,1105,1154` → `internal/console/fleets.go:783` | Only changed-region records enter Task 4’s HA preflight; unchanged records skip write-time region mutation. Existing app/rootfs/seed/hosts-history rails remain. | |
| +| Instance create, including --from/import dispatch: `internal/console/apiinstances.go:1524`; `internal/console/apiinstances.go:2297,2302`; record writes `internal/console/apiinstanceseed.go:86,89` | Task 2 F1 covers both plain/--from sockets; HAData proof covers prospective plain socket HA only. Imported creates retain the stronger import refusal. Counter witness covers every protected write. | |
| +| Standalone sidecar create: `internal/console/apisidecars.go:223,394` | Main success/duplicate/LTX rail retained, no F4. Task 2/4 success and exclusion witnesses; shared capacity gate is P2b. | |
| +| First-domain static create: `internal/console/domainattach.go:253,679` | Static, no HAData check and no new P2a cut. Task 4 success/exclusion witness; shared capacity gate is P2b. | |
| +| Offline stage/start: `internal/console/apiinstancemove_offline.go:625,663,505` | Both use Task 3 source/destination check before claim/stage/stop writes; staged start rechecks. | |
| +| Legacy/Phase-1 move request: `internal/console/apiinstancemove.go:422,427,574,583` | Same Task 3 rule; no alternative-door bypass. Existing cut/abort/resolve stay open. | |
| +| Apps place API/browser callers: `internal/console/fleets.go:1041,1105,1154` → `internal/console/fleets.go:783` | Only changed-region records enter Task 3’s HA preflight; unchanged records skip write-time region mutation. Existing app/rootfs/seed/hosts-history rails remain. | |
| | Import begin/upload/stopped: `internal/console/apiinstanceimport.go:119,391,718` | Region refusal at begin; immutable flag plus region refusal at upload/stopped; flag check at begin is defensive. | |
| -| Import commit/abort: `internal/console/apiinstanceimport.go:761,874`; offline recovery/finish verbs | No new HA refusal for already-started operations. Task 4 cleanup witness covers these explicitly. | |
| +| Import commit/abort: `internal/console/apiinstanceimport.go:761,874`; offline recovery/finish verbs | No new HA refusal for already-started operations. Task 3 cleanup witness covers these explicitly. | |
| +| Domain placements GET/PUT: `internal/console/apiplacements.go:83,445,644` | Task 1 configured HA placements refusal/guidance, including single mode, mixed sets and immutable HA after switch-off. Auth/scope and input validation precede refusal; no claim/index write and no member-EIP/ready payload. | |
| | Apps region / account move | Not data/instance placement doors: apps region changes no record region; account move rewrites console metadata. No new HA transfer gate. | |
| ## Round 1 dispositions |
| -Source anchors below are at the refreshed citation base. Task/step references identify the revised interfaces, tests and production-wired witnesses; these are plan changes, not claims that runtime tests have run. P3 numbering follows the review’s eleven bullets in order. All eleven were cheap enough to take in this revision; none starts another review round. |
| +Source anchors below are at the refreshed citation base. Task/step references identify the revised interfaces, tests and production-wired witnesses; these are plan changes, not claims that runtime tests have run. P3 numbering follows the review’s eleven bullets in order. Rev 2 took these P3s; rev 3 retains in-scope fixes and defers display requirements under N-HA13. None starts another round. |
| -| Finding / invariant | Current-main file:line | Rev 2 disposition and witness | |
| +| Finding / invariant | Current-main file:line | Rev 3 disposition and witness | |
| |---|---|---| |
| -| **P1-1 / C1** | `internal/console/apiinstances.go:962,1133,1326`; `internal/console/instancepage.go:298`; `internal/console/apiretry.go:90`; `internal/console/remoteinstances.go:337,459` | **Answered, Task 1 Steps 1–6:** one HA observation supplies selected rollout, health, Box and At to list/detail/single GET/CLI JSON/retry, including local rows. Nil rollout never falls back to a different box. Page/API/CLI/retry witnesses cover newer sleeping adopter and conflict. §15 census corrected. | |
| -| **P2-1 / C1** | `internal/console/remoteinstances.go:263`; `internal/status/fleet.go:120,138` | **Answered, Task 1:** At plus report-age requirement A1/A6; retain stale matching awake/transient hazard before filtering. Clock-boundary test prevents stale-holder→asleep inference; display five-minute cadence, 15-minute freshness and cache separately. | |
| -| **P2-2 / C1,C6** | `internal/console/apiinstances.go:1415,1425`; `apimode.go:3337,4184`; `instances_cli.go:741` | **Answered, Task 1 Steps 4–5:** single GET fields/projection, actual CLI JSON flag/decoder, D1 JSON-specific docs, root census and cold GET budget. Test old-server omission and timestamp round-trip; no invented existing JSON flag. | |
| -| **P2-3 / C3** | `internal/console/seedmove.go:47`; `internal/console/apiinstances.go:2182,2308`; `internal/provision/provision.go:487,495,537` | **Answered, Task 3:** exact F1 predicate applies to plain/--from; exact HAData predicate excludes Addr/Addrs. Address-backed stamp preserved without false data proof. Rootfs non-hibernating fixture updated explicitly; test both accepted hibernating and refused non-hibernating sockets. | |
| -| **P2-4 / C3** | `internal/console/createleftovers.go:43,136` | **Answered, Task 3 Steps 3–4:** permanent non-home/pool cut F5/409, no Retry-After or access-repair suggestion; transient home data failure F3/503 with retry wording. Counter tests distinguish them before writes; G3 cut recorded in Rulings. | |
| -| **P2-5 / C3,C4** | `internal/console/apisidecars.go:394`; `internal/console/ha_born_test.go:84` | **Controller ruling applied, Tasks 3/5:** DROP F4, preserve successful HA standalone sidecars and duplicates with no stamp. Capacity gate waits for P2b; no new cut. | |
| -| **P2-6 / C3** | `internal/console/ha_born_test.go:45,84,205`; `internal/console/rootfs_test.go:588`; `cmd/console/main.go:446,449` | **Answered, Task 3 Step 4 / Task 4:** explicit fixture setup/changed expectations for all four tests; coherent home Region/HibernateBucket/SeedData. Exact static predicate exempt from new regional refusal, immutable HA and existing rails retained; static move/place witness. | |
| -| **P2-7 / C2** | `internal/host/steering_loop.go:126`; `internal/console/server.go:1566`; `internal/console/view.go:199` | **Answered, Task 2:** configured mode suppresses SteeringHost and offers A-only guidance for apex/subdomain, even with steering armed. Legacy CNAME stays legacy. Test no CNAME/member EIP in configured mode. | |
| -| **P2-8 / C3** | `cmd/console/main.go:446,449`; `internal/console/server.go:551`; `internal/console/createleftovers.go:43` | **Answered, Task 5 Step 2 and switch-on:** verify configured home coordinates, HibernateBucket and non-nil root SeedData before roll; bounded read-only prefix proof/local zero-write evidence. Missing wiring blocks activation; approval card records exact deployment inputs. | |
| -| **P2-9 / C3** | `internal/console/fleets.go:865,881,928,955`; `internal/provision/provision.go:1040,1042` | **Answered, Task 4:** filter normalized no-op records before HA preflight and skip their region rewrite; fleet→HA-home still refused. Tests cover all-no-op and mixed changed/unchanged apps; retain shared CAS protection for real moves. | |
| +| **P1-1 / C1** | `internal/console/apiinstances.go:962,1133,1326`; `internal/console/instancepage.go:298`; `internal/console/apiretry.go:90`; `internal/console/remoteinstances.go:337,459` | **Deferred by N-HA13:** requirements retained in **After P1b-3a: HA display design**. Rev-2 implementation response is withdrawn; main’s behaviour remains unchanged in P2a. | |
| +| **P2-1 / C1** | `internal/console/remoteinstances.go:263`; `internal/status/fleet.go:120,138` | **Deferred by N-HA13:** requirements retained in **After P1b-3a: HA display design**. Rev-2 implementation response is withdrawn; main’s behaviour remains unchanged in P2a. | |
| +| **P2-2 / C1,C6** | `internal/console/apiinstances.go:1415,1425`; `apimode.go:3337,4184`; `instances_cli.go:741` | **Deferred by N-HA13:** requirements retained in **After P1b-3a: HA display design**. Rev-2 implementation response is withdrawn; main’s behaviour remains unchanged in P2a. | |
| +| **P2-3 / C3** | `internal/console/seedmove.go:47`; `internal/console/apiinstances.go:2182,2308`; `internal/provision/provision.go:487,495,537` | **Answered, Task 2:** exact F1 predicate applies to plain/--from; exact HAData predicate excludes Addr/Addrs. Address-backed stamp preserved without false data proof. P2-F corrects F1 with `rec.Runtime == ""`; keep resident rootfs successful, test accepted hibernating and refused non-hibernating binary sockets. | |
| +| **P2-4 / C3** | `internal/console/createleftovers.go:43,136` | **Answered, Task 2 Steps 3–4:** permanent non-home/pool cut F5/409, no Retry-After or access-repair suggestion; transient home data failure F3/503 with retry wording. Counter tests distinguish them before writes; G3 cut recorded in Rulings. | |
| +| **P2-5 / C3,C4** | `internal/console/apisidecars.go:394`; `internal/console/ha_born_test.go:84` | **Controller ruling applied, Tasks 2/4:** DROP F4, preserve successful HA standalone sidecars and duplicates with no stamp. Capacity gate waits for P2b; no new cut. | |
| +| **P2-6 / C3** | `internal/console/ha_born_test.go:45,84,205`; `internal/console/rootfs_test.go:588`; `cmd/console/main.go:446,449` | **Answered, Task 2 Step 4 / Task 3:** explicit home-data fixture wiring for all four tests; preserve the rootfs resident-success expectation; coherent home Region/HibernateBucket/SeedData. Exact static predicate exempt from new regional refusal, immutable HA and existing rails retained; static move/place witness. | |
| +| **P2-7 / C2** | `internal/host/steering_loop.go:126`; `internal/console/server.go:1566`; `internal/console/view.go:199` | **Answered, Task 1:** configured mode suppresses SteeringHost and offers A-only guidance for apex/subdomain, even with steering armed. Legacy CNAME stays legacy. Test no CNAME/member EIP in configured mode. | |
| +| **P2-8 / C3** | `cmd/console/main.go:446,449`; `internal/console/server.go:551`; `internal/console/createleftovers.go:43` | **Answered, Task 4 Step 2 and switch-on:** verify configured home coordinates, HibernateBucket and non-nil root SeedData before roll; bounded read-only prefix proof/local zero-write evidence. Missing wiring blocks activation; approval card records exact deployment inputs. | |
| +| **P2-9 / C3** | `internal/console/fleets.go:865,881,928,955`; `internal/provision/provision.go:1040,1042` | **Answered, Task 3:** filter normalized no-op records before HA preflight and skip their region rewrite; fleet→HA-home still refused. Tests cover all-no-op and mixed changed/unchanged apps; retain shared CAS protection for real moves. | |
| | **P3-1 / citation accuracy** | `internal/console/createleftovers.go:43,69`; `internal/console/nocapacity.go:38,42`; `internal/console/awsregionmetric.go:25,30`; `internal/console/apiinstances.go:2308` | **Taken:** corrected these and every other cited line against the refreshed main commit, including review’s drifted rollout/CLI references. Proposed files retain no fabricated lines. | |
| -| **P3-2 / C3,census** | `internal/console/fleets.go:856,857,928`; `internal/provision/provision.go:1040` | **Taken, Task 4:** fixed process config plus app lock permit console pre-write regional check; no new SetRecordRegion regional policy/recheck. Keep its existing HA CAS test. | |
| -| **P3-3 / C3** | `internal/console/apiinstanceimport.go:111,119,391,718` | **Taken, Task 4:** begin is create-only/unstamped; immutable flag defense belongs to helper plus upload/stopped tests, not an impossible existing-HA begin fixture. | |
| -| **P3-4 / C3,scope** | `internal/console/domainattach.go:253,679` | **Taken:** remove domainattach.go from Task 3 edits; retain unchanged-static success witness in Task 5/door inventory. | |
| -| **P3-5 / C3,disclosure** | `internal/console/createleftovers.go:136` | **Taken, Task 3:** firstHALeftover returns fixed lock/files/replica/other class; F2 never includes object key or SHA. Response tests assert no leak. | |
| -| **P3-6 / C3** | `internal/console/apisidecars.go:394,405` | **Resolved by DROP F4:** no sidecar refusal to order; main duplicate still precedes its LTX check. Retry witness retained. | |
| -| **P3-7 / C2** | `cmd/console/main.go:1339` | **Taken, Tasks 2/5:** run proposed parser on exact nonempty ingress env before console roll; invalid input must not become a rollout outage. | |
| -| **P3-8 / C2** | `internal/console/server.go:1580`; `internal/console/authcli.go:1210` | **Taken, Tasks 2/5:** inspect console PLATFORM_EDGE_IPS for member/platform-only EIPs before configured-mode switch-on; never add RegionIngress to proxy trust. | |
| -| **P3-9 / C2,copy** | `internal/console/server_test.go:1652`; `internal/console/view.go:199` | **Taken, Task 2:** inventory all changed legacy wording and update TestDomainGuidanceSteering plus configured guidance assertions. | |
| -| **P3-10 / C3,recovery** | `internal/console/apiinstanceimport.go:761,874` | **Taken, Task 4:** door inventory and cleanup witness explicitly keep commit/abort open for begun imports. | |
| -| **P3-11 / C1,copy** | `internal/console/remoteinstances.go:229` | **Taken, Task 1:** A1 carries box+age; A6 carries age+UTC generation. At is report time, not this cache-load time. | |
| +| **P3-2 / C3,census** | `internal/console/fleets.go:856,857,928`; `internal/provision/provision.go:1040` | **Taken, Task 3:** fixed process config plus app lock permit console pre-write regional check; no new SetRecordRegion regional policy/recheck. Keep its existing HA CAS test. | |
| +| **P3-3 / C3** | `internal/console/apiinstanceimport.go:111,119,391,718` | **Taken, Task 3:** begin is create-only/unstamped; immutable flag defense belongs to helper plus upload/stopped tests, not an impossible existing-HA begin fixture. | |
| +| **P3-4 / C3,scope** | `internal/console/domainattach.go:253,679` | **Taken:** remove domainattach.go from Task 2 edits; retain unchanged-static success witness in Task 4/door inventory. | |
| +| **P3-5 / C3,disclosure** | `internal/console/createleftovers.go:136` | **Taken, Task 2:** firstHALeftover returns fixed lock/files/replica/other class; F2 never includes object key or SHA. Response tests assert no leak. | |
| +| **P3-6 / C3** | `internal/console/apisidecars.go:394,405` | **Resolved by DROP F4:** no sidecar refusal to order; main duplicate still precedes its LTX check. Duplicate-create retry witness retained. | |
| +| **P3-7 / C2** | `cmd/console/main.go:1339` | **Taken, Tasks 1/4:** run proposed parser on exact nonempty ingress env before console roll; invalid input must not become a rollout outage. | |
| +| **P3-8 / C2** | `internal/console/server.go:1580`; `internal/console/authcli.go:1210` | **Taken, Tasks 1/4:** verify every console PLATFORM_EDGE_IPS entry is public ingress before configured-mode switch-on; a platform box EIP may be that ingress; never add RegionIngress to proxy trust. | |
| +| **P3-9 / C2,copy** | `internal/console/server_test.go:1652`; `internal/console/view.go:199` | **Taken, Task 1:** inventory all changed legacy wording and update TestDomainGuidanceSteering plus configured guidance assertions. | |
| +| **P3-10 / C3,recovery** | `internal/console/apiinstanceimport.go:761,874` | **Taken, Task 3:** door inventory and cleanup witness explicitly keep commit/abort open for begun imports. | |
| +| **P3-11 / C1,copy** | `internal/console/remoteinstances.go:229` | **Deferred by N-HA13:** requirements retained in **After P1b-3a: HA display design**. Rev-2 implementation response is withdrawn; main’s behaviour remains unchanged in P2a. | |
| + |
| +## Round 2 dispositions |
| + |
| +`REVIEW-REGION-HA-P2-R2.md` is NOT READY (1 P1, 7 P2, 6 P3). These are author responses, not a new verdict. |
| + |
| +| Finding / invariant | Rev 3 disposition | |
| +|---|---| |
| +| **P1-A / C1,C6** | Cut under N-HA13; deploy watch and list rollout remain main’s. Requirements retained in the separate display outline. No third C1 fix. | |
| +| **P2-A–D / C1,C6** | Cut with display: hold/retry/Failed, non-activator-owned coverage, stale-holder bound and every other join field belong to that outline. | |
| +| **P2-E / C2** | Task 1 chooses safe refusal until P3 for configured HA placements, GET and PUT, regional and single mode. I6 supplies configured guidance and makes no member-DNS/readiness claim; PUT refuses before claim writes. Console/API/CLI witnesses and target-read budget are included. | |
| +| **P2-F / C3** | Task 2 adds `rec.Runtime == ""` to F1; P1a’s successful resident rootfs fixture remains non-hibernating and unstamped. Only its binary control gets data wiring. | |
| +| **P2-G / C3,witness** | Task 4 records the unset dev HA switch and pooled hapair evidence, names a new unpooled home drill host, and requires exact activation value/window, concurrent-create blast radius, immutable-stamp limitation and verified rollback on the approval card. | |
| +| **P3 bullet 3 / C6, redundant LISTs** | Taken in Task 2: empty whole-prefix proof replaces instance-level checks; retain ten move-staging LISTs. Empty home HAData bound is 1G+11L; non-HA and sidecar rails stay unchanged. | |
| +| **P3 bullet 4 / C3, offline order** | Taken in Task 3: retain `offlineClaimEvidence` before `readJSON`, then normalize/validate and run the new helper before later work/writes. No hidden refusal-order change. | |
| +| **P3 bullet 5 / C2, multi-region scope** | Taken in Task 1: configured `dnsTargets` suppresses every folded IP, including non-HA-region edges; input must cover the intended deployment-wide public set. | |
| +| **P3 bullet 6 / C2, PLATFORM_EDGE_IPS** | Taken in Tasks 1/4 and D2: every listed IP must be public ingress. A platform box EIP may qualify; do not remove it by label. Agent DNS checks and console proxy trust retain main’s use. | |
| + |
| +**Branch follow-up list:** round-2 P3 bullets 1–2 (real CLI test names, “Setting up”) and round-1 P3-11 (observation age) are retained in the HA display outline. No P3 starts a new round; no in-scope P3 remains unaddressed. |
| ## S2 §8 / spec §15 disposition census |
| | Spec §15 row | Owner / result | |
| |---|---| |
| -| Move door / selectMoveBoxes | Phase 1 off stays inert; P2a Task 4 adds HA regional refusals only. N-box transport is P4 after its own design. | |
| +| Move door / selectMoveBoxes | Phase 1 off stays inert; P2a Task 3 adds HA regional refusals only. N-box transport is P4 after its own design. | |
| | Seed import / seedfloor | Keep one-box restriction and P1a begin/upload/stopped refusals; P2a pins switch-off record behavior. P5 owns N-box import. | |
| | CheckOneBoxRegion | Claim-only and inert: no new caller, no cleanup prerequisite. | |
| | Warm cache | P1a's HA restore/keep path built; P2a changes nothing. | |
| -| Hosts unique to one box | P2a Task 1 replaces the actual last-box rollout join (`internal/console/apiinstances.go:962,1133,1326`), local/detail and remote-health bypasses with **one** HA observation; list, detail, single GET, CLI JSON and retry consume its rollout/health/At. Conflict/unknown has no rollout; asleep has no awake box. **C1.** | |
| -| EIP list | P2a Task 2: configured ingress plus explicit EdgeIPs; legacy mode retained until deployment supplies complete ingress. | |
| +| Hosts unique to one box | **Deferred, N-HA13.** Main’s rollout join, attribution, local/remote health, detail, list/single GET, CLI, hold/retry, deploy watch and other join fields remain unchanged. P2a does not complete this §15 row; the separate display outline retains both rounds’ requirements. | |
| +| EIP list | P2a Task 1: configured ingress plus explicit EdgeIPs; legacy mode retained until deployment supplies complete ingress. | |
| | Forwarding dial | P1b-2 plus main's dead-holder backoff built; private-address selection unchanged. P2 is no forwarding redesign. | |
| | consoleBoxLabel | Holds: console remains on platform box. No move onto the tenant group. | |
| | Scoped restart/domain attach/economics/fleet listing/retention | Hold under A13's every-box adoption. Do not pick a single box for app listing, retention or restart; domain first-create admission is separately P2b's. | |
| @@ -274,19 +292,16 @@ Logical AWS API attempts, including unsuccessful calls. SDK transport retries ar |
| | P2a path/event | Increment over main | |
| |---|---| |
| -| Shared HA selection and API/page/CLI projection from already-loaded reports | **0G/0P/0L/0D**. Use the same request/report cache. A page gaining reports where it previously read none must charge the ordinary cache miss below; no claim that source loading is free. | |
| -| Shared status cache miss, H report objects | Source cost `max(1,ceil(H/1000))L + H*G`; cache success 60s, failure 10s; at most one load in flight. Not a timer or per-box loop. Repeated HA reads inside TTL add 0. | |
| -| HA single-instance GET, cold then warm | **New read versus main:** at most `max(1,ceil(H/1000))L + H*G` for a cold status cache, **0 new status reads** inside TTL; existing record/edges reads stay charged separately. Three report objects cost 1L+3G per cold load. Failure/partial loads count attempted pages/GETs, hold 10s and return unknown. Selection does not add identity/role/lease reads. | |
| -| HA list/detail/retry sharing and bursts | Use pageBoxReports for HA source loading, never a second loadRolloutJoin just to select HA. Skip legacy warming/join on all-HA lists; mixed lists retain their existing non-HA join costs and reuse request-memo report loads where present. Count those separately: the observation adds no second read of reports already loaded in that request. Concurrent HA consumers share one in-flight status load per console, independent of user/tab count; count every post-TTL refill. CLI JSON is the same list request, no follow-up GET per row. | |
| | Configured ingress parsing/render | **0 S3**. In configured mode eliminate the old DNS fold reads; do not credit savings to pay for another loop. Unset mode keeps the existing fold. | |
| +| Configured HA placements refusal/guidance | Existing claim/auth/scope reads stay charged. At most N target-record GETs (N≤8 regional targets, N=1 single mode) per current/proposed set, reusing records already read; PUT union ≤16 distinct targets. Domain list/settings with C regional claims and S single targets adds at most 8C+S target GETs, once per distinct target per request; count this amplification rather than charging only the placements GET. No new LIST/status poll; stop at first confirmed blocked target. Count failed GETs. Refused requests write zero claims/serial/index records. DNS union uses no S3. | |
| | HA shape/unsupported placement or transfer/import regional check | **0 new S3** for the predicates; local flags and already-read record (the data rail’s existence read is below). Refusal: **0 protected P/D/index mutations**. | |
| | Home HA data create prefix proof | **+1 bounded L**, maximum one result, **0G/0P/0D**, no body or lock GET. Existing duplicate record read is reused. Error costs its attempted L and no writes. | |
| -| Existing LTX rail when still reached | Main's up to **20 L** for two prefixes × levels 0–9 (`internal/dbdoor/coords.go:29`), plus its existing record GET. P2a total rail bound **1G+21L** on a successful empty check, before unchanged create writes. Early first-object refusal uses **1G+1L**. No scan over files/objects or pagination is added. | |
| +| Retained move-staging rail for home HAData | After the whole-prefix proof, at most **10 L** for `moves/<host>/` levels 0–9 (`internal/dbdoor/coords.go:29`); skip the redundant instance levels. Total bound **1G+11L** before unchanged create writes, versus main’s 1G+20L. Early first-object refusal uses **1G+1L**. Non-HA/sidecar checks retain main’s two-prefix bound. No scan over files/objects or pagination is added. | |
| | HA create duplicate | **1G**, reused when main already checked; now also required before a remote/pool F5 that main skipped; no new L; ordinary duplicate answer. | |
| | Remote/opaque-pool HA data proof unavailable | **0 data S3**: F5/409 after the record-existence GET (new if main skipped its rail), no speculative bucket client or unbounded cross-region scan. | |
| | P2a role/edges/control mutations | **0**: P2a writes no role objects, index scopes or publication files. Ordinary successful create's record/lifetime/env/serial/index writes retain main's budget. | |
| -Example: 1,000 empty home HA data-create checks add **1,000 LISTs = $0.005** over the existing rail. Quiet P2a adds **0 S3/box/hour** and **0 S3/console/hour**. Additional view traffic pays existing request-cache misses; it creates no background reader. Main's per-box §18 baseline remains roughly **3,300–3,500/hour**, not a new allowance. |
| +Example: 1,000 empty home HA data-create checks use **11,000 LISTs = $0.055**, versus main’s 20,000 = $0.10: a net saving of 9,000 LISTs = $0.045, with the same existence GETs. Quiet P2a adds **0 S3/box/hour** and **0 S3/console/hour**. Instance display, single GET and retry keep main’s reads and caches unchanged; P2a adds no snapshot reader. Main's per-box §18 baseline remains roughly **3,300–3,500/hour**, not a new allowance. |
| **P2b budget envelope, not an executable polling design:** one uncached complete console observation of E edges files and H status objects is `ceil(E/1000)L + E*G + ceil(H/1000)L + H*G`, plus at most B signed identity GETs for B uncached refs, plus actual role reads once their merged consumer is known. If loaded once/minute without cache sharing, charge **60 times** this formula per console/hour; that is new central-console workload, never claim it is zero because boxes do not poll. For E=H=B=3 the edges/status/identity component is **120 L + 540 G/hour = $0.000816/hour**, before role reads and retries. The executable P2b plan must pin role/default read counts, identity expiry/bounds and invalidation from the real main interfaces and prove all doors share the observation. No per-box invocation of that formula. CloudWatch adds up to 60 PutMetricData calls/region/hour, not S3. This plan does not authorize arming that workload. |
| @@ -298,42 +313,35 @@ This is the complete **intent/deck for P2a**, with **draft** words for Luna to r |
| | ID | Destination / context | Draft / required content | |
| |---|---|---| |
| -| A1 | Instances row/detail awake snapshot; variables box and age | Draft intent: name the last reported awake box **and its report age**, with no live-owner claim. Format is driven by Box and At together. | |
| -| A2 | Complete matching fresh asleep evidence only | No box reported awake; include A6’s observation age. Never use for stale-holder/partial evidence. | |
| -| A3 | Missing/stale/partial/transient observation | Cannot confirm the awake box. | |
| -| A4 | Contradictory fresh awake reporters | More than one box reported awake; no selected box/rollout. | |
| -| A5 | Row/detail help | Explain five-minute normal snapshot cadence, 15-minute freshness threshold and up-to-one-minute console cache separately; none guarantees live state. | |
| -| A6 | Row/detail report age; variables age and UTC generation | Draft intent: when the selected snapshot was generated, as age plus accessible UTC time. For asleep, oldest matching snapshot; no timestamp invented for unknown/conflict. | |
| | I1 | Configured ingress for every host, or legacy without steering; host, addresses | A-record instruction to the complete public ingress union; checks every few minutes. | |
| | I2 | Configured ingress apex help | Apex cannot CNAME; these are public ingress addresses. No claim of latency routing from A records. | |
| | I3/I4 | **Legacy only**, unset RegionIngress; host, steering hostname, addresses | Retain legacy steering CNAME recommendation and A-record alternative, naming healthy edges rather than configured regional ingress. Inventory changed legacy wording and update `internal/console/server_test.go:1652`. | |
| | I5 | Invalid configured ingress startup failure; safe invalid token only | Comma-separated IP literal requirement and invalid entry; validate before the roll. | |
| -| F1 | Plain or --from non-hibernating socket create, 400; region | %s has high availability turned on. Socket instances must allow hibernation. | |
| +| I6 | Configured HA placements GET/PUT refusal and console regional guidance; host and public union | Required intent: per-region placement readiness/DNS advice is unavailable with HA configured ingress until P3; identify the configured public addresses without a regional readiness or latency-routing claim. No member EIP, lease or box detail. Existing CLI prints this server answer; no new flag or JSON field. | |
| +| F1 | Plain or --from non-hibernating binary socket create (`Runtime == ""`), 400; region | %s has high availability turned on. Binary socket instances must allow hibernation; resident rootfs retains main’s allowance. | |
| | F2 | Predecessor data, 409; host and fixed class only | Describe earlier instance data, naming only lock/files/replica/other; choose another address or request operator inspection. No raw key/content hash. | |
| | F3 | Home wiring/listing failure, 503; display region | Cannot check this instance’s data in %s. Nothing was created. Try again. Persistent failures may require an operator to check home data access. | |
| | F5 | Deliberate non-home/pool HA data-create cut, 409; display region | Draft: HA data creates for this placement are not available yet in %s. Use the console’s home region without a pool. No retry/access-repair suggestion or Retry-After. | |
| -| F4 | **Dropped by controller (P2-5)** | No replacement string or new standalone-sidecar refusal. | |
| -| J1 | `instances list --json` flag help/usage; `instances_cli.go:741` | Print the instance result as JSON, including observed HA snapshot fields; no extra text on stdout. | |
| -| D1 | `docs/site/cli.md`, instances list flag/JSON behavior | Document `--json`, `{instances,truncated,total}`, awake_box/state/at, timestamp/age and snapshot limits. Only JSON/page shows box attribution; the ordinary CLI table uses corrected Serving/Health and adds no box column. Creates can refuse before writes. | |
| -| D2 | CLI deployment configuration docs | Explain RegionIngress plus PLATFORM_EDGE_IPS, full public ingress set, configured A-only guidance, pre-roll validation and no member/platform-only EIPs. | |
| -| D3 | CLI move/import behavior | HA data moves/imports unavailable; static-kind records exempt only from the new regional move refusal; existing immutable-HA and other rails remain; started operations can finish/clean up. | |
| +| D2 | CLI deployment configuration and domains placements docs | Explain RegionIngress plus PLATFORM_EDGE_IPS, full deployment-wide public set, configured A-only guidance, temporary HA placements refusal/readiness limits, pre-roll validation and the requirement that every PLATFORM_EDGE_IPS entry is public ingress (a platform box EIP can qualify). | |
| +| D3 | CLI create/move/import behavior | Document F1 for binary sockets only (rootfs allowance retained), F2/F3/F5 and their status/retry differences before writes. HA data moves/imports unavailable; static-kind records exempt only from the new regional move refusal; existing immutable-HA and other rails remain; started operations can finish/clean up. | |
| | Reuse N1 | `internal/console/nocapacity.go:38`, approved P2b no-capacity 503 | Reuse exactly: “No box in %s has room right now. Try again in a few minutes.” Retry-After 60. | |
| | Reuse N2/N3 | `internal/console/nocapacity.go:42`, approved P2b page subject/body | Reuse noCapacityAlert outputs exactly; shared throttle and send-failure semantics. | |
| | Reuse M1/M2 | `internal/console/seedmove.go:52,57`, P1a-approved transfer refusals | Reuse haMoveSentence/haImportSentence verbatim, substituting blocking display region. | |
| -| Reuse E1/E2 | Existing duplicate/read answers (`internal/console/apiinstances.go:2265,2266`; `internal/console/apisidecars.go:405,406`) | Keep door-specific main messages and existing retry refusal words; no replacement error copy. | |
| +| Reuse I7 | `internal/console/apiplacements.go:46`, unreadable target/evidence | Reuse `placementsUnreadableMsg` verbatim for temporary configured-placements uncertainty. No fallback to member DNS. | |
| +| Reuse E1/E2 | Existing duplicate/read answers (`internal/console/apiinstances.go:2265,2266`; `internal/console/apisidecars.go:405,406`) | Keep door-specific main duplicate/read messages; no replacement error copy. | |
| P2b's controller must inventory before implementation: role vocabulary/usage, saved-versus-applied result, invalid/unknown ref/region, read/CAS/write failures, operator audit, readiness label/each blocker/stale/incomplete/unsupported producer, metric startup/failure/recovery, no-capacity alert subject/body, regional proof refusal, and every changed CLI help/doc line. Those have no final destination/interface yet, so this is a **separate outline deck**, not invented executable strings. Do not implement P2b until its merged-input plan and complete approved deck exist. No new user-facing prose logs, empty states, tooltips or docs may escape that inventory. |
| ## Census and verification notes |
| -Plan-only Markdown is outside root census: no proposal/overlay or re-pin now. P2a changes console/templates/docs plus **root-binary `apimode.go` and `instances_cli.go`** for the CLI decoder/JSON output. Those root files, changed functions/types and whole-file envelopes need independent census approval; the plan does not claim a console-only exemption. Run `make census-card` on the implementation diff: helpers in shared packages are not exempt merely because the new caller is the console. Do not move selection into `internal/release`, `internal/host` or `internal/edgesfile` to avoid a review; if needed, record it and include actual changed units/envelopes. |
| +Plan-only Markdown is outside root census: no proposal/overlay or re-pin now. After N-HA13, P2a edits console/startup/tests/docs only. The display-only `apimode.go` / `instances_cli.go` changes and their census obligations are removed. `cmd/console` and `internal/console` are outside root-binary scope. Run `make census-card` on the actual implementation diff to confirm; any shared-package change still needs approval. No helper may move to `internal/release`, `internal/host` or `internal/edgesfile` to avoid review. Later display CLI work gets its own card and unit/envelope verdict against its actual diff. |
| For any in-scope execution change: tab-separated CLAIMS per unit with new read or none; `make census-propose NAME=region-ha-p2a CLAIMS=<owned-file>` (P2b gets its actual slice name), targeted census/scope/J4/rebase checks, and independent cross-family unit/envelope verdict at exact tip on #280. The reviewer decides every class; no census escalation to Paul. Role scope/shared release/CLI changes in P2b are expected census surface, including whole-file envelopes and tests. The record-write 9B8 censuses are separate: run relevant changed console writer inventories, and only re-pin a demonstrated digest change. Preserve production provenance and security ordering in final P2 fixes. |
| -Drafting verification: compare every proposed executable dependency to base main; cross-check §15 disposition table, budget arithmetic, copy destinations and Task 1's observable first merge; `git diff --check`; check the requested file is the only staged change; subject under 80 characters and a blank line before trailer. No go suite, dev drill or runtime acceptance is claimed by this plan commit. |
| +Drafting verification: compare every proposed executable dependency to base main; cross-check §15 disposition table, budget arithmetic, copy destinations and Task 1’s visible DNS guidance and Task 4’s ingress/refusal-only drill; `git diff --check`; check the requested file is the only staged change; subject under 80 characters and a blank line before trailer. No go suite, dev drill or runtime acceptance is claimed by this plan commit. |
| ## Accepted defaults and handoff |
| -The three former questions are settled by the controller’s Rulings table: next dev release after P2a merge, P3 produces role/admission evidence before P2b, and non-home/pool HA data creates remain F5/409 for G3. Task 5 still requires a concrete scoped dev approval card and verified wiring before live mutation/switch-on. These are implementation gates, not reopened design questions. |
| +The three former questions are settled by the controller’s Rulings table: next dev release after P2a merge, P3 produces role/admission evidence before P2b, and non-home/pool HA data creates remain F5/409 for G3. Task 4 still requires a concrete scoped dev approval card and verified wiring before live mutation/switch-on. These are implementation gates, not reopened design questions. |
| -This session revises and commits only this plan. P3/3b, migration, P4/P5/P6 and storage fencing stay with their owners. Round 1 found 1 P1/9 P2/11 P3; rev 2 answers them without claiming a new independent verdict. No production edit, push, subagent or reviewer dispatch, full suite, or running process. Splitting the change does not reset review history or the finish-line clock. |
| +This session revises and commits only this plan. P3/3b, migration, P4/P5/P6 and storage fencing stay with their owners. Rounds 1 and 2 both found a C1 P1; N-HA13 cuts display instead of fixing it a third time. Rev 3 answers the remaining in-scope findings; round 3 is final and has not been dispatched. No production edit, push, subagent or reviewer dispatch, full suite, or running process. Splitting the change does not reset review history or the finish-line clock. |