region HA P2b: plan rev 2, R1 fixes and rulings
docs/superpowers/plans/2026-11-04-region-ha-p2b-console.md+121 −56docs/superpowers/reviews/REVIEW-REGION-HA-P2B-R1.md+93 −0
CI cancelled — superseded by a newer push — run details
Intent
<task-notification> <task-id>ae402e6c21f3b0e90</task-id> <tool-use-id>toolu_016vfiQ9zn8YiZyP2qQRwmQ9</tool-use-id> <output-file>/home/paulca/.cache/tmp/claude-1001/-home-paulca-amadan-net-carlos-platform/e6b2a16d-5028-4b21-87ee-9a9c28814cdf/tasks/ae402e6c21f3b0e90.output</output-file> <status>completed</status> <summary>Agent "Opus review P2b plan R1" finished</summary> <note>A task-notification fires each time this agent stops with no live background children of its own. The user can send it another message and resume it, so the same task-id may notify more than once.</note> <result>**READY AFTER FIXES** The plan has no P1s. Five P2s can be fixed without another round. Nine P3s go on the follow-up list. The full review is in /home/paulca/.cache/region-ha-p2b/REVIEW-R1.md. I made no repo edits, ran no tests and created no scratch files. What checked out: - **Citations:** every existing-code reference in the plan is correct on 016599d5, and nothing depends on P3b. - **Costs:** all the S3 and role-event arithmetic is right. - **Dev console:** the plan's claim that `CONSOLE_HA_REGIONS=ie` is set is correct. #421 records it as G1 item 8, approved by Paul and never unset, so the brief's "unset after drills" assumption no longer holds. - **Copy deck:** no em dashes, and the reused strings match main exactly. P2s: - **P2-1, Eligibility / T1 (I2/I4, capacity evidence classification):** The plan never says whether out-of-scope boxes are excluded before identity and admission evidence is demanded, or how one unknown box affects the region's answer. Dev boxes without HA or admission opt-in (dennis, box-1) could make the IE region permanently unknown. Every create in an HA region would then return 503, and the metric would never publish. - **P2-2, Observation and freshness / T1 (I3, observation lifetime):** An observation expires 60 s after its pass starts, but the next pass only replaces it when it finishes. Once a minute, for the length of a pass, every HA create gets the "could not be checked" 503. - **P2-3, Observation / budget (I2/I3, bounded read of unbounded history):** The plan reads every status key ever written against a 200-key cap. Status keys are never deleted, so a deployment that has seen enough boxes ends up permanently refusing creates. The reason given for reading old keys doesn't hold, because a stale edges file already counts as zero on its own. - **P2-4, Slices / dev card (rule 5 / I6, rollout gating):** There is no separate switch, and dev already has HA regions on. If P2b-1 merges before a P3a-only dev release and drill, the next routine dev release refuses all dev HA-region creates. The capacity config also has to be installed before the console binary rolls. - **P2-5, Q1/Q3 (rule 5, switch-on scheduling):** Dev uses named pools (sophie and leo both serve hapair). Q1's recommendation is to wait for an undated box-side slice. Q3 targets 2026-11-06 after Q1's prerequisite. Following both recommendations makes that date unreachable. The P3s cover: - the import door's permanent 409 coming after the capacity 503; - unsuitable 503 wording if named-pool creates are refused; - several fixture, witness and worker-registration details; - two lists of fixed boxes that can drift apart; - checks to add to the dev card.</result> <usage><subagent_tokens>195496</subagent_tokens><tool_uses>58</tool_uses><duration_ms>637069</duration_ms></usage> </task-notification>
diff --git a/docs/superpowers/plans/2026-11-04-region-ha-p2b-console.md b/docs/superpowers/plans/2026-11-04-region-ha-p2b-console.md| index 7a247c16e..3e0c3ca45 100644 |
| --- a/docs/superpowers/plans/2026-11-04-region-ha-p2b-console.md |
| +++ b/docs/superpowers/plans/2026-11-04-region-ha-p2b-console.md |
| @@ -1,4 +1,4 @@ |
| -# Region HA P2b: console implementation plan |
| +# Region HA P2b: console implementation plan, rev 2 |
| > **For agentic workers:** Planning only in this session. No production edits, push, reviewer dispatch or full test suite. Execute the checkbox tasks only in a later authorized implementation session, after resolving their gates. Later slices below are requirements, not permission to implement an unmerged producer. |
| @@ -12,7 +12,7 @@ |
| **Citation base:** **016599d5b97c04b2fc5e807b834fdf38e2c7a35e**, the checked-out `origin/main`. All existing-code file:line citations below refer to that tree. Proposed files, settings, helpers and response additions are explicitly marked proposed and have no invented source lines. The released `v0.34.0` decoder/watch was also inspected for compatibility; it is not an implementation dependency. |
| -**Status:** rev 1, no review yet; the display slice carries P2's two C1 rounds and N-HA13. This draft settles no open choice for Paul by implication. Its finish line is one local planning commit and the requested DRAFT-DONE file. |
| +**Status:** rev 2. R1 (Opus) READY AFTER FIXES, 0 P1 / 5 P2 / 9 P3, applied as rev 2; review closed under rule 1. The pool-evidence task added by the Q1 ruling was not in R1; its build gets its own per-task review (rule 3). The display slice retains P2's C1 history. Finish line: commit this plan and the R1 review locally, then write REV2-DONE. No push or production work. |
| ## Rulings and decisions |
| @@ -28,15 +28,24 @@ |
| | #421 controller P3a T2 final CUT, 2026-11-04 / I6 | Closed boxes keep legacy names. They refuse locally; home election and cold-wake exclusion remain. Do not reintroduce namespace withdrawal or infer readiness from a held name. Its three-round family remains closed. | |
| | P2 controller G3 ruling / I5 | Keep non-home and pooled HA data creates refused. Lifting F5 is not trivial: main only proves the configured home data prefix, not arbitrary region/pool storage. | |
| -New author decisions, subject to the questions below: |
| +Rulings supplied in BRIEF-REV2.md, all dated 2026-11-04: |
| + |
| +| Authority / invariant | Decision and reason | |
| +|---|---| |
| +| Q1, agent manager 8a3d302 under Paul's delegation / I2, I4 | Fold pool evidence into P2b-1's existing edges publication. T0 precedes admission and gets its own security-gate review. Preserve named-pool creates on dev: sophie serves @shared,hapair; leo serves cohort1,hapair. Old publishers supply unknown named-pool evidence; shared creates use existing evidence. | |
| +| Q2 = N-HA18, Paul / I6 | P2b-2 ships desired-role save/read-back and eligibility diagnostics. Full readiness and drain completion remain not yet reported until their P3b producers merge. A drain request stays visibly pending and never permits stopping a box. | |
| +| Q3, resolved by Q1 and R1 P2-4 / I6 | A P3a-only dev release and fixed-pair admission drill precede the P2b-1 merge. Validate and install CONSOLE_HA_CAPACITY_CONFIG before the release carrying P2b-1. Hold other dev releases during the named window. Flagship is unaffected while CONSOLE_HA_REGIONS is unset there. | |
| +| Q4/Q5, controller, recommended options with no capability cut / I7 | P2b-3 stays an outline. When scheduled, give it one explicitly scoped review carrying P2's two C1 P1 rounds, closed third round and N-HA13. Stop at the first P1-free round; a repeated-family P1 returns to Paul without a fix. Before switch-on, prove a shorter stale-reporter bound from a merged stop guarantee or evidence producer. No URL polling and no accepted 24-hour display blackout. | |
| + |
| +Author decisions implementing those rulings: |
| | Decision / invariant | Reason | |
| |---|---| |
| -| D1 / I2, I3: keep a console-wide immutable observation for one minute, including failures | Request memoization alone is not process-wide sharing. A burst must neither multiply bucket reads nor keep an old successful count after an unsuccessful observation. | |
| +| D1 / I2, I3: refresh a console-wide immutable observation once a minute, including failures; expire it 120 seconds from pass start | Request memoization alone is not process-wide sharing. A burst must neither multiply bucket reads nor keep an old successful count after an unsuccessful observation. | |
| | D2 / I2: configure the region universe and trusted coordinates explicitly | A vanished region must still produce zero after a complete empty read. Neither surviving files nor their majority can select a CloudWatch region or data bucket. | |
| | D3 / I2, I6: require explicit P3a admission fields for HA create eligibility | `HomeEligible` intentionally accepts old files as serving for compatibility. It cannot prove admission/readiness. Missing additions are unknown, not a positive result. Schedule box rollout before enabling this console behavior. | |
| -| D4 / I4: count all eligible serving boxes regionally, then narrow for the create's pool | A box serving a named pool is regional capacity. Requiring shared-pool membership for the metric would undercount it. Named-pool admission has no published pool-list input on this main; Q1 decides the temporary capability boundary. | |
| -| D5 / I6: readiness and completed drain remain outline work | P3a publishes role/admitted/drained, but not its local facts or health conditions, and never publishes drained=true. Q2 chooses a limited diagnostic door or waiting. | |
| +| D4 / I4: count all eligible serving boxes regionally, then narrow for the create's pool | A box serving a named pool is regional capacity. Requiring shared-pool membership for the metric would undercount it. T0 adds the missing pool-list input on the same branch before admission; missing pool evidence cannot justify a named-pool zero. | |
| +| D5 / I6: ship the N-HA18 diagnostic role door; defer full readiness and completed drain | P3a publishes role/admitted/drained, but not its local facts or health conditions, and never publishes drained=true. The limited door has its own dated slot below. | |
| | D6 / I7: do not execute display in P2b-1 | Shared observation, failure holds, retry authority, lifetime attribution and released deploy-watch behavior need one design. A small badge does not isolate those risks. | |
| ## Named invariants |
| @@ -76,13 +85,17 @@ The cited base includes P1b-3a `322d2447`, home-scope correction `c6304f2d`, sur |
| ## Slices and first visible result |
| -**P2b-1, executable subject to Q1 and the release card:** Tasks T1–T4 below ship one observation, EligibleBoxes and pre-write create refusals together. Paul can see a disposable dev `carlos instances create` return the approved 503/Retry-After answer, or succeed with positive evidence, while CloudWatch shows that same observation's regional count. A structured observation identifier in internal logs ties the two together. There is no scaffolding-only first merge. |
| +**P2b-1, executable subject to the release card:** Tasks T0–T4 ship the pool-evidence producer, one observation, EligibleBoxes and pre-write create refusals together. Paul can see a disposable dev `carlos instances create` return the approved 503/Retry-After answer, or succeed with positive evidence, while CloudWatch shows that observation's regional count. The drill includes supported named-pool creates. A structured observation identifier in internal logs ties the results together. There is no scaffolding-only first merge. |
| + |
| +**P2b-2, scoped outline under N-HA18:** desired-role save/read-back and eligibility diagnostics. Its write target is merged. Full readiness and drain completion stay explicitly not yet reported until their P3b producers merge. The scope below is settled; executable task details must use merged interfaces. |
| + |
| +**P2b-3, outline:** HA awake-box display and every rollout consumer. When scheduled, its one explicitly scoped review carries the inherited C1 history and the Q4/Q5 stopping conditions. Scheduling does not authorize another P2 review round. |
| -**P2b-2, outline:** operator role object writer/read-back and region readiness. The write target is now merged, but full readiness/drain producers are not. Q2 selects the visible diagnostic subset or waits. Keep full-readiness work on its branch until its producer has merged and been re-read; do not use P3b's proposed fields. |
| +**P2b-1 dev slot: 2026-11-09, 14:00–16:00 UTC.** The 2026-11-06 target is replaced because T0 adds a producer, compatibility witnesses and a security review to the same visible slice, after the P3a-only release/drill prerequisite. The implementation controller owns booking the attended slot and naming the release operator in the card. Hold other dev releases and unattended updates through the window. If the complete slice, prerequisites or operator cannot fit, keep it on its branch and name a replacement date before merge. |
| -**P2b-3, outline and separate small design:** HA awake-box and every rollout consumer. The inventory below is its entry brief, including old-client safety. It has not received authorization to reopen the closed C1 review. |
| +The order is binding: first roll a **P3a-only dev release** and pass its fixed-pair admission drill; only then merge P2b-1. Validate and install the exact capacity configuration on the dev console as a drop-in without restarting, before the release carrying P2b-1. That release rolls boxes and verifies their pool publications before rolling the console. CONSOLE_HA_REGIONS is already set on dev, so the new console binary activates the gate immediately. Flagship remains unaffected while that setting is unset there. |
| -Switch-on slot proposed for P2b-1: **the first dev-only release after its reviewed implementation merge, target 2026-11-06**, after the fixed-pair P3a release/admission drill and Q1 resolution. Q3 must supply the actual release owner/window before implementation lands. If unavailable, leave implementation on its branch. The planning commit has no runtime switch. Later slices each need their own dated slot before landing; they do not ride this date by default. |
| +**P2b-2 dev slot: 2026-11-11, 14:00–16:00 UTC**, after P2b-1 acceptance, for Paul's N-HA18 role save/read-back and diagnostic door. Its controller must book an operator and scoped card before its merge, or retain it on branch and name a new date. Full readiness, completed drain and P2b-3 do not ride either slot. The planning commit changes no running system. |
| #421 records dev v0.34.0 with CARLOS_REGION_HA enabled on sophie-knitting and leo-climbing, and CONSOLE_HA_REGIONS=ie enabled on the console. It records P3a as merged but not released. Revalidate at card preparation; do not reuse P2a's historical assumption that HARegions is unset. P2b alone proves neither G1 completion nor G2/G3, and never G5 retirement readiness. |
| @@ -94,7 +107,7 @@ Proposed console-only setting **CONSOLE_HA_CAPACITY_CONFIG** is a bounded JSON d |
| The region universe is exactly CONSOLE_HA_REGIONS, with every entry requiring coordinates. It persists when all boxes vanish. The home region is CONSOLE_HOME_REGION; its wire/record placement remains `""`, while all other region codes match exactly. Omitted or empty placement is home; explicit null is malformed. Never set CARLOS_REGION=ie on the dev home boxes or console. The console's raw CARLOS_REGION stays empty for its existing home data proof. |
| -An HA-enabled console with missing/invalid capacity configuration returns temporary evidence refusals for affected creates and emits no unprovable metric, rather than disabling the safety check. Parser validation must pass on the exact proposed configuration before rolling. Non-HA creates keep main's behavior. Configuration loads once; changing it requires the normal console restart/card. |
| +An HA-enabled console with missing/invalid capacity configuration returns temporary evidence refusals for affected creates and emits no unprovable metric, rather than disabling the safety check. Parser validation must pass on the exact proposed configuration before rolling. Creates outside CONSOLE_HA_REGIONS keep main's behavior. Configuration loads once; changing it requires the normal console restart/card. |
| Fixed pins bind identity, not membership: a listed pin without live evidence counts nothing. For a g- reference, the exact existing derivation is `g-` plus the first 20 hex digits of SHA-256(`carlos-box-ref-v1|account|instance`), at `internal/host/boxreference.go:91`. Validate it without EC2/group enumeration. P3a still cannot admit such a box; no test may manufacture group admission as production capability. Fixed boxes recreated on a new iid require a new reference, as #421's f18da98 correction states. |
| @@ -102,32 +115,48 @@ Fixed pins bind identity, not membership: a listed pin without live evidence cou |
| Proposed `internal/console/hacapacity.go` owns the pure projection; `hacapacity_observe.go` owns I/O and the immutable cache. Start one runner from console serve, immediately then on the existing one-minute capacity interval, whenever configured HA regions or the CloudWatch adapter need it. Move the nested metric start out of StartClaimRecoveryPass. Do not run either producer from NewServer. A cancellable console lifetime owns the runner; one in-flight pass, bounded to 45 seconds. Requests never start or retry a load. Before the first successful observation they get evidence unavailable. |
| -Each pass lists control/edges/ and status/boxes/ once with the existing bounded PageLister interface (`internal/release/store.go:389`, `:1074`). Ask for 201 keys per prefix: at most 200 accepted; 201 means incomplete, not a silently truncated census. Use bounded body reads with 1MiB maximum per edges/status object, 64KiB per identity record and the existing status decoder. Read all accepted status keys, including old ones: the ordinary 24-hour horizon must not turn a known stale counterpart into missing evidence. A console-local store view can expose that one preloaded list to LoadBoxesComplete without ModLister or another S3 LIST. Keep this exception local to capacity; display's existing horizon is unchanged. Tests pin actual low-level requests, not just wrapper method calls. |
| +Each pass makes one bounded LIST per prefix. For control/edges/, use PageLister (`internal/release/store.go:389`, `:1074`) with 201 keys: at most 200 accepted; the 201st makes the census incomplete. Status keeps the existing 24-hour object-modification horizon, applied before the 200-report cap or any status GET. Self-stale edges need no status counterpart. |
| -Retain raw presence/type information for placement, admission and eligibility fields alongside the existing PlacementView. Validate the key's reference, Box and BoxID agree, version is understood, status label is unique, and status Metrics.InstanceID agrees with the verified identity. JoinLive remains the baseline for missing/stale counterpart handling. Verify each distinct candidate reference once per observation through boxid.Load/Verifier.Enroll, with expected account/AWS region, fixed pin or derived g- reference, and a uniqueness check across proven instance IDs. No cross-observation identity cache is necessary in this slice; its GETs are budgeted every minute. |
| +PageLister discards modification times, and the existing ModLister paginates without a bound. Add a **proposed console-local bounded metadata adapter** in hacapacity_observe.go: one S3 ListObjectsV2 request with MaxKeys=1000, retaining LastModified and IsTruncated. Filter entries older than pass start minus 24 hours, then enforce at most 200 recent/unknown-time keys. Missing modification times are retained, never treated as old. A truncated raw page is incomplete even if fewer than 200 recent keys were seen; do not fetch a second page or assume old keys hide no current box. The raw 1000-key scan limit is separate from the 200 current-report cap. No HEAD per key and no unbounded ListMod fallback. Provide a bounded directory-store counterpart for local witnesses; unsupported stores report unknown. Expose the prefiltered keys through a console-local store view to LoadBoxesComplete, with no second LIST. |
| -Record observation start/completion, each edges generation, each status generation, completeness and machine-readable blocker codes. Keep generation times unchanged. Reads are not an atomic S3 snapshot: counts describe the bounded observation, not reserved capacity. On use, recompute time predicates from the retained timestamps; do not freeze a stale answer as fresh. At age >=60s from pass start, the observation is unavailable. Canceled waiters do not cancel a shared load; failed/timed-out passes replace successful evidence with unknown, never stale success. |
| +Read bodies with 1MiB maximum per edges/status object and 64KiB per identity record. The dev card records total edges/status counts and recent-status counts on dev and flagship. At an edges cap, use the runbook's existing departure-verified edges-file removal procedure; age alone grants no deletion. At the raw status scan cap, prepare a scoped prune of retired status keys older than the horizon, verified against current identities and publishers. Never delete an active or uncertain reporter. At a true >200-current-report cap, reduce the supported scope or design and price a larger bound before switch-on. Cleanup is operator work, not automatic capacity-observer deletion. Count its requests separately in its approved card. Pin LIST flags, filtering and request totals at the low-level transport. |
| -An unreadable LIST or unassignable malformed key can affect every region, so all those datapoints are omitted. A failure provably scoped to a validated region omits that region only. A missing status counterpart, missing identity or unknown protocol is incomplete. An identity conclusively failing verification is excluded and diagnosed; it is never admitted by falling back to a label. Conflicting reference/instance evidence makes the affected set incomplete. A complete empty deployment is zero for every configured region. Complete stale publications are zero, including after 24 hours; no deletion or terminal EC2 conclusion follows. |
| +Retain raw presence/type information for placement, admission and eligibility fields alongside the existing PlacementView. Validate the key's reference, Box and BoxID agree, version is understood, status label is unique, and status Metrics.InstanceID agrees with the verified identity. Classify each edges file before demanding a status counterpart, using the precedence table below; do not reuse JoinLive's whole-request missing-status rule for self-stale or out-of-scope files. Verify each distinct candidate reference once per observation through boxid.Load/Verifier.Enroll, with expected account/AWS region, fixed pin or derived g- reference, and a uniqueness check across proven instance IDs. No cross-observation identity cache is necessary in this slice; its GETs are budgeted every minute. |
| + |
| +Record observation start/completion, each edges generation, each status generation, completeness and machine-readable blocker codes. Keep generation times unchanged. Reads are not an atomic S3 snapshot: counts describe the bounded observation, not reserved capacity. On use, recompute time predicates from the retained timestamps; do not freeze a stale answer as fresh. A successful observation expires at age >=120s from pass start. Start passes on a fixed 60-second schedule, not 60 seconds after completion; each has a 45-second deadline. The prior success therefore covers the successor pass, including a create at t=60s+epsilon. Readers never wait on that pass. At use, producer timestamps still decide freshness. A missed schedule cannot extend the 120-second bound. Canceled readers do not cancel the shared load; failed/timed-out passes immediately replace successful evidence with unknown, even before expiry. |
| + |
| +An unreadable LIST or unassignable malformed key can affect every region, so all those datapoints are omitted. A failure provably scoped to a validated region omits that region only. For a remaining in-scope candidate, a missing status counterpart, missing identity or unknown protocol is incomplete. An identity conclusively failing verification is excluded and diagnosed; it is never admitted by falling back to a label. Conflicting reference/instance evidence makes the affected set incomplete. A complete empty deployment is zero for every configured region. Complete stale publications are zero, including after 24 hours; no deletion or terminal EC2 conclusion follows. |
| ### Eligibility (I2, I4, I6) |
| -For each configured region, use one complete observation. A counted box needs matching verified AWS identity, exact placement, configured data bucket/region, expected nonempty secrets fingerprint, region-ha-1 capability, hibernation configuration, fresh status and edges, and explicit valid admission fields. Require box_role=serve, admitted=true, drained=false, and no legacy draining flag. Apply boxchoice.Placeable with its existing thresholds after forming candidates; do not pass serve as an old roster role (ExcludeRoles expects the empty default). Reject negative/inconsistent totals before the arithmetic. Apps is not required. |
| +Evaluate each file in this order. A known exclusion removes only that file; it cannot speak for a peer. Unknown data cannot assert that the rest of the region is empty. |
| + |
| +| Precedence | Classification and required evidence | |
| +|---|---| |
| +| 1. Validate scope facts | A successfully decoded file with validated placement different from the region, different data bucket/region, no region-ha-1 capability, no hibernation, or a different secrets fingerprint is a known non-candidate. Its own valid edges generation failing HeadroomFresh for age also excludes it. Require no identity, status or admission fields for these exclusions. An invalid scope field cannot be used as an exclusion; only independently validated facts can remove the file. Null placement, corrupt bodies and unassignable versions remain unknown when no scope exclusion can be established. | |
| +| 2. Bind the candidate | Only in-scope, self-fresh files need identity/status/admission evidence. Bind key, Box, BoxID, signed deployment-account identity, configured AWS region, fixed pin or exact g- derivation, and status instance ID. A valid signed deployment-account record with no configured fixed binding and no valid derived g- binding is **unbound**, excluded with a diagnostic. Failed reads/missing identity are unknown; conclusively invalid identity is excluded. Conflicting instance/ref evidence remains unknown. | |
| +| 3. Classify liveness and admission | A valid stale status is a known exclusion. Missing status is unknown. Require fresh status (BoxStale's 15-minute bar), valid producer times and explicit admission fields. Booting/drain/platform, not-admitted, drained and legacy draining are known exclusions. Missing additions, unknown roles, malformed booleans/numbers and zero/far-future times are unknown. | |
| +| 4. Apply headroom | Require serve, admitted=true, drained=false and no legacy draining. Apply boxchoice.Placeable's existing thresholds; do not pass serve as an old roster role (ExcludeRoles expects the empty default). Reject negative/inconsistent totals before arithmetic. Well-formed insufficient or absent totals exclude; Apps is not required. | |
| +| 5. Narrow to the requested pool | Shared creates use explicit serves_shared_pool=true and accepts_inbound=true. Named creates require membership in T0's named_pools and accepts_inbound=true. A valid list lacking the pool excludes that candidate for this request; missing/malformed pool evidence is unknown for named creates only. Never infer pools from host lists. | |
| + |
| +**Aggregation:** allow a create if at least one verified-eligible box serves its requested pool, even when another candidate is unknown. With no such positive witness, complete-zero requires every in-scope file to be classified for that request; otherwise return unknown. A failed/capped LIST cannot establish a complete census and makes the observation unavailable. Emit a regional EligibleBoxes metric only when every in-scope file is classified for regional eligibility; count the unique union independent of pool. Unknown pool evidence alone does not change the regional count and never becomes a regional zero. A request-specific complete zero must not overwrite that metric. |
| + |
| +**Pool publication (Q1):** T0 proposes additive `named_pools`, a sorted unique JSON array of the named pools from the same provisionTickConfig/ParseBoxPools result used by the reconciler. Include only nonempty names accepted by provision.ValidPool; invalid configured tokens cannot match a valid create and must not poison evidence for valid pools. Omit the canonical shared empty string from this array; existing serves_shared_pool remains authoritative for shared creates. New publishers always emit the array, including `[]` for no named pools. Absence/null/wrong types are unknown, not an empty list. Keep the existing edges version and cadence; old readers ignore the additive field. Bound reads by the existing edges-body limit and validate names with the existing pool grammar, without inventing a stricter deployment limit. |
| -First exclude a positively stale, validly joined report; it need not satisfy current admission-field coverage to count zero. Treat explicit booting/drain/platform/not-admitted/drained and well-formed insufficient or absent totals as known exclusions. Missing admission additions, malformed booleans/numbers, unknown roles and future timestamps beyond one minute are unknown evidence. Status uses BoxStale's 15-minute bar plus rejection of zero/far-future times. Edges use HeadroomFresh. The one-minute cache age is separate from both 15-minute producer bounds. |
| +In a mixed-version region, a verified new publisher can admit a named-pool create on its positive membership evidence. If none can, an otherwise eligible old publisher's missing list makes the answer unknown (C10, no page); it cannot justify zero. Shared creates keep using existing shared/inbound evidence. Regional metrics remain based on regional eligibility, so an old box missing only pools is still countable. All-old regions refuse named creates as unknown. Dev rolls both publishers before the new console so sophie's @shared,hapair and leo's cohort1,hapair coverage is retained. Existing F5 still refuses pooled/non-home HA data creates. |
| -Regional EligibleBoxes is the unique union of these boxes, independent of pool. Shared-pool creates additionally require explicit serves_shared_pool=true and accepts_inbound=true. A named-pool create needs evidence that the box serves that pool; `serves_shared_pool=false` supplies no such evidence. Main has no pool-list producer. Pending Q1, its provisional result is evidence unavailable, without a no-capacity page or regional zero. Never derive pool membership from an existing host list or broaden the pool. |
| +The 120-second observation lifetime is separate from both 15-minute producer bounds. A box whose producer evidence ages out while a successor is in flight is reclassified at use. |
| -These are last-published eligibility observations. P3a's admitted latch does not mean all six health conditions still hold now; the console cannot see a later local known=false. Neither the metric nor an admitted create promises full health. Q2 and P2b-2 own that missing diagnostic evidence. This is not permission to ignore a published restriction. |
| +These are last-published eligibility observations. P3a's admitted latch does not mean all six health conditions still hold now; the console cannot see a later local known=false. Neither the metric nor an admitted create promises full health. N-HA18 and P2b-2 make that missing diagnostic evidence explicit. This is not permission to ignore a published restriction. |
| ### Create boundary (I5, I8) |
| -Proposed helper `requireHACreateCapacity` takes the normalized region/pool and reads the observation only. It returns allow, complete-zero, or unknown. Complete-zero uses noRoom, approved copy and Retry-After 60. Unknown returns 503 with C04 and Retry-After 60, sends no capacity page and does not publish a zero. A positive count permits main's subsequent checks; it never picks or stamps a box. Retain the existing hourly successful-send throttle and its send-failure release semantics. |
| +Proposed helper `requireHACreateCapacity` takes the normalized region/pool and reads the observation only. It returns allow, complete-zero, or unknown. Complete-zero uses noRoom, approved copy and Retry-After 60. Unknown returns 503 with C04 and Retry-After 60, or C10 when named-pool publication is the missing input; neither sends a capacity page or publishes a zero. A positive count permits main's subsequent checks; it never picks or stamps a box. Retain the existing hourly successful-send throttle and its send-failure release semantics. |
| | Door | Required ordering and regression witnesses | |
| |---|---| |
| -| Instance, plain and --from | Keep auth, duplicate response, input/shape, F5 and other permanent rails before capacity. Run capacity before createFrom/createImport dispatch or any binding/store/lifetime writer. For active HA regions, defer the old armed-region 400 until the HA check can answer 503. Imported creates keep their existing HA refusal; capacity cannot make an import legal. Cover home `""` and explicit home normalization, static, address, resident rootfs and binary shapes. | |
| -| Standalone sidecar | Check the same effective region and manifest Pool before beginClaimCreate/createSidecarMarked. Keep duplicate/paused/shape responses and HA stamping unchanged. Q1 explicitly governs the newly unavailable named-pool case; do not hide it as a sidecar implementation detail. | |
| +| Instance, plain and --from | Keep auth, duplicate response, input/shape, F5 and other permanent rails before capacity. Keep the permanent HA import refusal before capacity; run capacity before supported createFrom dispatch or any binding/store/lifetime writer. For active HA regions, defer the old armed-region 400 until the HA check can answer 503. Imported creates keep their existing HA refusal; capacity cannot make an import legal. Cover home `""` and explicit home normalization, static, address, resident rootfs and binary shapes. | |
| +| Standalone sidecar | Check the same effective region and manifest Pool before beginClaimCreate/createSidecarMarked. Keep duplicate/paused/shape responses and HA stamping unchanged. Use T0's named-pool evidence and the mixed-version rule above. | |
| | First-domain route | Run before the branch at domainattach.go:227, covering claims, lifetimes and plain paths, and before pending proof/claim writes. The prospective static record is home/shared. Existing-route aliases, reattachments that write no first route, wildcard/catch-all aliases and ordinary domain verification do not acquire a new capacity requirement. Both browser and API responses carry Retry-After. | |
| | Non-create work | No new helper in wake, enable of an existing record, restart, deploy, retry, timer/run pickup, domain alias attach, move cleanup or import cleanup. Preserve their existing gates. | |
| @@ -137,13 +166,22 @@ Do not leave the early claims-based roomIn as an alternative HA policy. Route ac |
| These task commits stay on one implementation branch until the visible slice is complete. Each test name below is proposed unless identified as existing. Production-wired means real parsers, stores, middleware and handler/runner entry points with a local counted transport; no live AWS mutation is necessary. |
| +### Task T0: Publish pool evidence on existing edges [own review: security gate and root surface] |
| + |
| +**Files:** `internal/host/edgesfile.go`, its existing serialization tests and a new host-produced fixture under `internal/host/testdata/`; T1's console decoder/tests. Reference `internal/provision/reconcile.go:3274`, `:3310`, `:3329` for the existing pool parser and predicates. No new pool object or independent reader loop. |
| + |
| +- [ ] **Step 1:** Add `TestEdgesNamedPoolsPublication` through the real edges builder/serializer using provisionTickConfig. Cover empty config, @shared, @shared,hapair, cohort1,hapair, duplicates and invalid tokens as the existing parser handles them. Always emit named_pools, including an empty array. Compare membership to the real reconciler's named-pool decisions; no separately parsed environment or host-list inference. |
| +- [ ] **Step 2:** Add the field to the existing replacing publication, preserving its normal timer/watch cadence, conditional write and change-index behavior. Test that the published list changes with the effective reconcile configuration on the next ordinary publication and that old readers tolerate the additive field. No forced startup/periodic pool write, extra LIST/GET, or namespace change. |
| +- [ ] **Step 3:** Have the host serialization test generate/check a shared golden body; T1 consumes those bytes, including existing P3a admission fields. Pin absent versus empty/malformed lists and mixed-version positive/unknown/complete-zero named-pool decisions through T3's real create handlers. Shared decisions and regional counts must stay independent of missing named pools. |
| +- [ ] **Step 4:** Run targeted host serialization and console pool tests, `make census-card`, and required proposal/checks for changed root units/envelopes. Obtain the task's independent security-gate review before admission integration. Commit `ha: publish named pools in existing edges evidence` on the same implementation branch. No separate scaffolding merge. |
| + |
| ### Task T1: Build the bounded observation [own review: cache and security boundary] |
| **Files:** new `internal/console/{hacapacity.go,hacapacity_observe.go,hacapacity_test.go,hacapacity_observe_test.go}`; `internal/console/server.go`; `cmd/console/{main.go,main_test.go}`. Existing `hotreads.go`, `reqmemo.go`, `boxselect.go` are reference seams, not permission to change other readers' semantics. |
| -- [ ] **Step 1:** Add failing `TestHACapacityConfiguredUniverse`, `TestHACapacityIdentityAndScope`, `TestHACapacityUnknownIsNotZero`, `TestHACapacityBudget`. Use actual serialized P3a edges bytes and signed identity fixture keys. Include omitted/empty/null placement, missing versus stale status, stale reports older than 24h, absent region, duplicate iid/ref, copied identity, wrong account/region/bucket/fingerprint, unknown versions and exact age/headroom boundaries. |
| -- [ ] **Step 2:** Implement the strict console configuration and bounded observation described above. Require PageLister; unsupported stores give unknown. Reuse the status parser with the capacity-specific bounded listing. Do not change box publication or add a roster reader. Test 200/201 keys and oversize bodies at the low-level release.Store transport. |
| -- [ ] **Step 3:** Exercise the real runner with a controllable clock: concurrent reads use one generation, timeout/error replaces success, canceled readers cannot poison others, expiry blocks requests, shutdown ends the runner, and a second start does not create another loop. Count the initial pass separately from 60 steady-state passes/hour. Through an actual failing S3 transport, prove the dedicated observer client makes one wire attempt, with no hidden SDK retries. |
| +- [ ] **Step 1:** Add failing `TestHACapacityConfiguredUniverse`, `TestHACapacityIdentityAndScope`, `TestHACapacityUnknownIsNotZero`, `TestHACapacityBudget`. Use T0's host-produced serialized fixture, including P3a admission fields, and signed identity fixture keys. Include omitted/empty/null placement, missing versus stale status, stale reports older than 24h, absent region, duplicate iid/ref, copied identity, wrong account/region/bucket/fingerprint, unknown versions and exact age/headroom boundaries. |
| +- [ ] **Step 2:** Implement the strict console configuration and bounded observation described above. Use PageLister for edges and the proposed console-local metadata adapter for status; unsupported stores give unknown. Reuse the status parser with its prefiltered bounded list. T0 owns publication; add no roster reader. Test 200/201 edges, 200/201 recent status keys, >200 old status keys plus live reports within a complete raw page, the 1000-key/truncated raw limit, missing modification times and oversize bodies at the actual store transport. Self-stale edges without status must be excluded; fresh edges without status stay unknown. Pin every precedence-table row in TestHACapacityIdentityAndScope, including non-HA dev neighbors, unbound identities and positive-plus-unknown aggregation with an omitted metric. |
| +- [ ] **Step 3:** Exercise the real runner with a controllable clock: concurrent reads use one generation, timeout/error replaces success, canceled readers cannot poison others, a create at t=60s+epsilon succeeds while the next pass is in flight, retained producer evidence ages independently, expiry at 120s blocks requests even after a missed tick, shutdown ends the runner, and a second start does not create another loop. Count the initial pass separately from 60 steady-state passes/hour. Through an actual failing S3 transport, prove the dedicated observer client makes one wire attempt, with no hidden SDK retries. |
| - [ ] **Step 4:** Run `nice -n 19 go test ./internal/console ./cmd/console -run 'TestHACapacity' -count=1`. Commit `ha: observe verified regional capacity without claims` after the risk-sized review. No standalone merge. |
| ### Task T2: Wire the metric to console start [whole-branch review] |
| @@ -159,8 +197,8 @@ These task commits stay on one implementation branch until the visible slice is |
| **Files:** `internal/console/{nocapacity.go,nocapacity_test.go,apiinstances.go,apisidecars.go,domainattach.go}`; new `internal/console/hacreatecapacity_test.go`; relevant existing create, domain, sidecar and writer-census tests. |
| -- [ ] **Step 1:** Add `TestHACreateCapacityDoors` through registered authenticated HTTP handlers, including browser first-domain attach. Run shared-pool allow/zero/unknown for every door and each lifetime/claims setting that the door supports. Verify status/body/header, not just a helper error. Named pools exercise the approved Q1 choice; until then they remain an explicit failing acceptance gate. |
| -- [ ] **Step 2:** Place the single helper at the pre-write boundaries above. Where existing early roomIn/placement checks precede final input checks, split read-only validation from the mutation phase rather than adding a second predicate. Preserve duplicate, F1/F5 and import refusals, and successful non-HA behavior. Do not stamp sidecars HA. |
| +- [ ] **Step 1:** Add `TestHACreateCapacityDoors` through registered authenticated HTTP handlers, including browser first-domain attach. Run shared-pool allow/zero/unknown for every door and each lifetime/claims setting that the door supports. Verify status/body/header, not just a helper error. Named pools exercise T0's publication and mixed-version decisions, including hapair/cohort1 coverage, unsupported membership, old publishers and all-old regions. Missing pools never produce a page or a regional zero. |
| +- [ ] **Step 2:** Place the single helper at the pre-write boundaries above. Where existing early roomIn/placement checks precede final input checks, split read-only validation from the mutation phase rather than adding a second predicate. Preserve duplicate, F1/F5 and import refusals, and successful creates outside HA regions. Do not stamp sidecars HA. |
| - [ ] **Step 3:** Count all protected stores and local writes: environment bundles/bindings, private-storage adapter calls, history/lifetime slots, records, claims, serial, change index and success audit. Zero/unknown must leave all untouched. Use real local registry/DirStore state plus the existing private-storage transport seam; a test that only asserts no CreateRecord call is insufficient. Include --from, private storage, pending DNS proof and first-domain lifetime paths. |
| - [ ] **Step 4:** Add `TestHACreateCapacitySharesObservation` for simultaneous instance/sidecar/domain requests and a metric pass. They consume the same observation and add zero S3 reads. Add `TestHACreateCapacityPageThrottle` covering concurrent zeros, send failure and process restart. Add `TestHACapacityDoesNotGateExistingWake` through the existing edge/activator production fixture with no capacity, preserving its normal HA acquire path. |
| - [ ] **Step 5:** Run `nice -n 19 go test ./internal/console -run 'TestHACreateCapacity|TestHACapacity|TestNoCapacity|TestHAP2|TestHACreate|TestHAImport' -count=1` and the package containing the existing-wake witness. Check the relevant console record-write inventories. Commit `ha: gate new creates on shared capacity evidence`. |
| @@ -169,12 +207,12 @@ These task commits stay on one implementation branch until the visible slice is |
| **Files:** test additions above; execution-time docs in `docs/site/cli.md` and `docs/region-ha-runbook.md`; any census artifacts required by the actual diff. This drafting commission writes none of those files. |
| -- [ ] **Step 1:** Approve the executable copy rows below before product/docs writes. Document 503/Retry-After, incomplete evidence versus known zero, Q1's chosen named-pool behavior, retained F5 and the create-only boundary. Do not claim readiness or completed drain. |
| -- [ ] **Step 2:** Prepare the dev card below, including exact proposed capacity config and Q3's release window. Verify signatures, fixed pins, home bucket/region/fingerprint and all opt-in publications using read-only evidence. A missing prerequisite blocks the roll, not a new producer designed on an unmerged branch. |
| +- [ ] **Step 1:** Approve the executable copy rows below before product/docs writes. Document 503/Retry-After, incomplete evidence versus known zero, T0's named-pool behavior, retained F5 and the create-only boundary. Do not claim readiness or completed drain. |
| +- [ ] **Step 2:** Prepare the dev card below, including exact proposed capacity config and the named release window. Verify signatures, fixed pins, home bucket/region/fingerprint and all opt-in publications using read-only evidence. A missing prerequisite blocks the roll, not a new producer designed on an unmerged branch. |
| - [ ] **Step 3:** Complete local production-wired checks and mutation witnesses: deleting the shared helper call from each door, treating unknown as zero, accepting missing admission fields and restoring the nested HostClaim start must each fail a witness. Run the whole-branch review within the budget and census checks on its final diff. No repetitive review of low-risk tasks. |
| - [ ] **Step 4:** In implementation only, run the repo build/vet/test/format gate once, plus required cross-compiles. Push and describe on amadan, verify green CI on the exact tip, squash-merge with -expect, then read main CI. The scheduled dev release and card make the create result visible; archive measured counters and cleanup evidence. This planning session does none of those actions. |
| -## P2b-2: role and readiness outline (I6, I8) |
| +## P2b-2: desired role and eligibility diagnostics, N-HA18 (I6, I8) |
| Use a distinct proposed versioned API for the new object writer and read-back. The exact new routes belong to the executable P2b-2 design. Keep the old roster endpoints unavailable in claims-off HA mode: a released CLI would otherwise accept a save and falsely print that the role is applied. New CLI code must not fall back to the roster writer on 404. The command becomes `carlos system box role <ref|@region-code> <serve|drain|platform>`. Add API-backed read-back and `carlos system region readiness <region>` in this slice; these read commands/endpoints are proposed, not available on the citation base. Keep `publish-record` dispatch intact. Remove misleading group/default/legacy guidance in `system.go`, `system_roles.go` and `docs/site/cli.md`; reject obsolete syntax with R12, never translate legacy to drain silently. Keep old claim-only routes from writing the new object by accident. |
| @@ -186,15 +224,15 @@ The write has these requirements: |
| - Read-back distinguishes saved desired state, own/default/implicit source, last reported effective role, admitted/drained values, publication time/age, observation age, and missing blockers. A 200 save is not “now applied”; reuse of the old `boxRoleLine` would lie. Handle the role-save response lost in transit by exact-object read-back before any repeat mutation. Local observation invalidation may mark pending immediately but must not trigger another full observation inside the minute. |
| - Extend the one observation with B own-role GETs plus R default GETs, deduplicated. Decode both even when an override exists: main's boxroles.Read fails closed if either read/record fails. A fresh override serve legitimately wins over a drain default. Equality between desired and published role is only observed agreement; no exact role-write receipt exists, and clock comparison cannot create one. |
| -Readiness reports the region's eligibility and per-box evidence source/timestamps, desired/effective roles, and independent unavailable blockers. Empty, stale or missing evidence is never ready. With this main it must explicitly report unavailable for current startup facts, current six-condition health, role-reader knowledge and completed drain. Do not reconstruct these from an aggregate CloudWatch Admitted datum, the presence of route names, an empty host map, a nil blocker slice, or a saved role. |
| +The readiness door reports eligibility diagnostics: the region's eligible count and per-box source/timestamps, desired/reported roles, and independent unavailable blockers. Empty, stale or missing evidence is never ready. **Full readiness: Not yet reported** and **Drain completion: Not yet reported** remain explicit until P3b's producers merge. Do not emit Ready from admitted=true or an eligible count. A saved drain request stays **Pending**, including when the last reported role equals drain; that agreement does not permit stopping the box. Do not reconstruct these from an aggregate CloudWatch Admitted datum, the presence of route names, an empty host map, a nil blocker slice, or a saved role. |
| -**Producer gate:** main's local facts are EnvLoaded, Reconciled, RolePublished and TerminationStarted. Full readiness also needs current hosting, forwarding map/key, certs, edge and activator heartbeat, refresh evidence, plus drained completion/duty-transfer truth. P3a provides no remote report for these. Drain currently restricts starts; it does not implement §13's graceful sleep/scan completion. P3b's launch completion, Standby, booting-name protection and group health are later dependencies, not fields to add here. Q2 can authorize an explicitly incomplete diagnostic door now; otherwise wait for a separate box-side publication/drain slice to merge. It must ride existing status/edges cadence, with no new box poll, before executable P2b-2 tasks are written. |
| +**Producer gate:** main's local facts are EnvLoaded, Reconciled, RolePublished and TerminationStarted. Full readiness also needs current hosting, forwarding map/key, certs, edge and activator heartbeat, refresh evidence, plus drained completion/duty-transfer truth. P3a provides no remote report for these. Drain currently restricts starts; it does not implement §13's graceful sleep/scan completion. P3b's launch completion, Standby, booting-name protection and group health are later dependencies, not fields to add here. N-HA18 authorizes the diagnostic door now, in the 2026-11-11 dev slot. Its executable tasks may use only the role objects and evidence already merged, plus P2b-1 after its merge. Full-readiness and drain-completion extensions wait for P3b producers to merge and be re-read; those producers must ride existing status/edges cadence with no new box poll. No proposed P3b fields are part of this door. |
| Own reviews apply to the operator writer, security/identity changes, any cache extension and root CLI changes. Production-wired witnesses must drive the actual P3a role reader from the console-written DirStore object, publish its actual edges body, and read it back through the new door. Include default/override precedence, malformed default despite override, write conflict, saved-but-unobserved, old CLI/new server and new CLI/old server, and all unauthorized principals. No fixture may invent drained=true as proof that P3a drains. |
| ## P2b-3: HA display design entry brief (I7) |
| -This slice remains outline-only. It changes observed presentation, not runtime authority. Scope by immutable rec.HA even when HARegions is later unset. Determine actual activator ownership first: address-backed HA records and pre-existing non-hibernating sockets may have no rollout report and must retain their applicable metrics/health paths. A fresh timestamp after CreatedAt is the existing lifetime fence, not a published incarnation ID: `internal/status/snapshot.go:370` has no such ID. A stronger proof needs a separately merged producer, not an invented field. |
| +This slice remains outline-only under the controller's Q4/Q5 ruling. When scheduled, it gets one explicitly scoped review carrying the two C1 P1 rounds, closed third round and N-HA13. Stop at the first P1-free round; a repeated-family P1 returns to Paul without a fix. It changes observed presentation, not runtime authority. Scope by immutable rec.HA even when HARegions is later unset. Determine actual activator ownership first: address-backed HA records and pre-existing non-hibernating sockets may have no rollout report and must retain their applicable metrics/health paths. A fresh timestamp after CreatedAt is the existing lifetime fence, not a published incarnation ID: `internal/status/snapshot.go:370` has no such ID. A stronger proof needs a separately merged producer, not an invented field. |
| ### Consumer inventory at 016599d5 |
| @@ -217,7 +255,7 @@ The separate design must settle these requirements together: |
| 1. One valid awake reporter may win over sleeping adopters only with complete applicable evidence. Multiple awake/transient reporters, wrong tenant/lifetime, unread reports or unsupported coverage are unknown. Neither sorting labels nor taking the latest timestamp resolves a conflict. |
| 2. An all-asleep answer claims no awake box. Define agreement on Installed, scheduler-idle and hold state before a rollout is considered final. A nil rollout on a complete HA list is unsafe for old deploy watches. Supply a compatible safe server projection or block the slice; never fix only the new CLI. Assert zero URL requests, including fallback from a later refresh. |
| 3. Keep status generation, normal 5m cadence, 15m freshness and console-cache age distinct. No report is not asleep. Freshness checks use both future bounds and valid generation semantics. |
| -4. Stale dead-holder keys can remain inside the 24h listing horizon. The later design must prove a shorter exclusion bound from merged lease-loss/stop behavior and clock witnesses, or obtain Q4's explicit acceptance of the loss in display availability. This draft claims neither a stop bound nor a free 24h blackout. |
| +4. Stale dead-holder keys can remain inside the 24h listing horizon. The later design must prove a shorter exclusion bound from a merged stop guarantee with clock witnesses, or a separately merged evidence producer, before switch-on. The controller chose the shorter-bound requirement with no capability cut; a 24-hour unknown display is not an accepted fallback. This draft claims no such bound. |
| 5. Source every ancillary field consistently; all-HA versus mixed lists must not change the result or trigger a hidden second loader. Existing unrelated non-HA rows retain main behavior. Cover health on both console-local and remote routes. |
| Use the real `TestInstalledAndServingCells`, `TestRolloutReason`, `TestRolloutWireShape` in `instances_rollout_test.go:15`, `:36`, `:77`, plus the actual deploywatch tests, notably `TestWatchRolloutDarkBoxNeverPollsOverHTTP`, `TestWatchRolloutMixedFleetPollsOnlyTheUnreported`, `TestWatchRolloutWithNoReportsIsTheOldWatch`, and `TestWatchRolloutIncompleteJoinIsNotNoReports`. Add an HTTP integration witness feeding real console list JSON to the released/current decoders and watches with a counted URL transport. A permutation test over report order and local/remote placement must yield identical HA answers. Removing rollout_incomplete or returning nil for known sleep must make the zero-poll witness fail. |
| @@ -228,11 +266,12 @@ P2b-3 adds no independent polling loop. Its later design must connect page/list/ |
| G/P/L/D mean S3 GET/PUT/LIST/DELETE API attempts. Spec §18 pins G at **$0.0004/1,000**, P/L at **$0.005/1,000**, D free. All numbers below are incremental capacity/role/display work, not the unchanged reads and writes of a successful create. Failed requests count. Configure the new console observation store and CloudWatch client for one SDK attempt per operation: their retry is the next minute. The later role writer must use the same one-attempt policy for its object and index calls; the index's bounded application-level CAS attempts remain counted below. Keep this client policy local to the new paths, without changing other console or box clients. For these new paths logical counts therefore equal wire-attempt bounds. Existing box fan-out rows are application-call counts; record their deployed SDK multiplier separately in the card. No operation is called free because it fails. |
| -Let E be accepted edges keys, H accepted status keys including old ones, B distinct identity refs needing verification (B<=E), R configured HA regions and C console processes. The new capacity listing uses one bounded request per prefix, including empty prefixes. A 201st key yields incomplete immediately for that prefix, without a next page or success claim. For the accepted <=200-key universe there is no hidden pagination. If a later design raises that bound, price every page and the terminal empty page required by start-after listing. Existing unbounded main readers are not relabeled as this budget. |
| +Let E be accepted edges keys, H accepted status keys after the 24-hour horizon, B distinct identity refs needing verification (B<=E), R configured HA regions and C console processes. The observer makes one bounded request per prefix, including empty prefixes: 201 edges keys as a sentinel for the 200-edge limit; up to 1000 raw status entries with modification times and truncation, then <=200 recent/unknown-time status keys after horizon filtering. Old status entries add LIST response bytes only, no GETs and no slots in the recent-report cap. Raw truncation or >200 recent keys is incomplete, without another page. Cap remedies are in Observation and freshness. If a later design raises these bounds, price every page and any terminal empty page. Existing unbounded main readers are not relabeled as this budget. |
| | Path/event | Incremental logical requests and effect | |
| |---|---| |
| | P2b-1 accepted observation, once/minute/console | **2L + (E+H+B)G; 0P/0D.** One GET per accepted body and verified ref; no desired-role GET in P2b-1. Empty prefixes still cost 2L and return zero for configured regions. | |
| +| Pool field on ordinary edges publication/fold | **0 added G/P/L/D and 0 AWS calls.** T0 adds JSON bytes to the existing write and each existing read; no new object, write trigger, index bump, request or poll. | |
| | Unreadable/capped observation | At most that bound for started calls; a failed first LIST costs its attempt. No request-time retry. Omit affected metric points, refuse creates, no page. At most one subsequent scheduled attempt per minute. | |
| | Metric tick | **0 additional S3; up to R PutMetricData calls**, one datum/region at standard resolution. Incomplete regions omitted. No GetMetricData, EC2 Describe, SQS, ELB, ASG or SSM calls. | |
| | Each create admission / retrying a refused create | **0G/0P/0L/0D, 0 AWS control calls** from capacity. Auth, validation and existing prefix proof remain separately charged. Refusal writes no protected state; complete zero may send the existing throttled operator alert. No additional alert from an unknown observation or metric alone. | |
| @@ -246,6 +285,8 @@ Let E be accepted edges keys, H accepted status keys including old ones, B disti |
| | Each resulting edges reader fold | For N deployment edges keys, per affected reader **ceil(N/1000)L+N G**, at least 1L for empty prefix. Coalesced existing bound **120 folds/hour/box**; multiply by all readers. Role reads cost no all-role LIST. | |
| | P2b-3 display | No execution budget approved yet. Required envelope: **0 added S3 on a warm shared observation**, one **ceil(H/1000)L+H G** status load on a cold shared refresh if it cannot reuse P2b-1; at least 1L when empty. It must become one shared refresh, not one per row/tab or a second per-minute loop. Existing fleet-prefix lists/GETs and record reads remain charged separately. No lock, EC2 or HTTP-health/host-URL probes. | |
| +The pool-field byte increment per body is the length of `,"named_pools":` plus the compact JSON array: 25 bytes for sophie (hapair), 35 bytes for leo (cohort1,hapair), and 17 bytes for an empty array. Each normal upload, observer GET and existing reader fold carries those bytes; sum the per-box increments times each path's existing publication/read count. It adds 60 stored bytes for the dev pair and 2,592,000 response bytes per 43,200 console observations, with **$0 incremental request cost/month per region or console**. Existing S3 storage/transfer tariffs, if applicable, price those bytes separately; §18 pins request prices only. |
| + |
| For a 30-day month, steady-state passes are **43,200 per console**, plus one initial pass at startup and one after each restart. P2b-1 S3 cost is: |
| `C * 43,200 * (2 * $0.000005 + (E+H+B) * $0.0000004)`. |
| @@ -271,6 +312,8 @@ Drafts only, as expressly requested. This implementation-plan deck is not produc |
| | C07 | Observer failure log | `HA capacity evidence is incomplete for %s. New creates are paused there.` | |
| | C08 | Observer recovery log | `HA capacity evidence is available again for %s.` | |
| | C09 | Metric start/failure/recovery logs | Reuse existing regioncapacity.go:122, :134, :137 and awsregionmetric.go:63 wording; no new prose variant. | |
| +| C10 | Named-pool evidence unavailable, 503 | `Capacity for pool %s in %s could not be checked. Nothing was created. A box serving this pool must report its pool membership before this create can proceed.` | |
| +| C11 | Unbound identity diagnostic | `This box has a signed identity but no configured reference binding. It is excluded from capacity.` | |
| | R01 | CLI role usage | `carlos system box role <ref|@region-code> <serve|drain|platform>` | |
| | R02 | Proposed role read-back usage | `carlos system box role <ref|@region-code>` | |
| | R03 | Proposed readiness usage | `carlos system region readiness <region>` | |
| @@ -286,14 +329,16 @@ Drafts only, as expressly requested. This implementation-plan deck is not produc |
| | R13 | Operator audit and role-save log | `Set the desired role of %s to %s.` | |
| | R14 | Read-back labels, separate strings | `Box`; `Region`; `Desired role`; `Role source`; `Reported role`; `Admitted`; `Drained`; `Generated at`; `Age`; `Evidence source`; `Blockers`; `Eligible boxes` | |
| | R15 | Role source values, separate strings | `Box override`; `Region default`; `Implicit serve` | |
| -| R16 | Readiness values, separate strings | `Ready`; `Not ready`; `Unknown`; `Pending`; `Not reported`; `Yes`; `No` | |
| +| R16 | Readiness values, separate strings | `Eligible`; `Not eligible`; `Unknown`; `Pending`; `Not yet reported`; `Yes`; `No` | |
| | R17 | Missing/stale source blockers | `No report is available.`; `The report is too old.`; `The report time is invalid.`; `Some evidence could not be read.` | |
| | R18 | Identity/configuration blockers | `The box identity could not be verified.`; `The box reports different region or data settings.`; `This report version is not supported.` | |
| | R19 | Eligibility blockers | `The box is booting.`; `The box is not admitted.`; `The box is draining.`; `The box has the platform role.`; `The box reports that it has drained.`; `The box has too little free memory or disk.` | |
| | R20 | Missing inputs/pool blockers | `Headroom totals are not available.`; `Shared-pool hosting is not available.`; `Named-pool membership is not reported by this release.`; `Admission is not reported by this release.` | |
| -| R21 | Full readiness limitation | `Current admission checks, health checks and drain completion are not reported by this release. Full readiness cannot be confirmed.` | |
| +| R21 | Full readiness limitation | `Full readiness is not yet reported. Current admission and health checks are not available in this release.` | |
| | R22 | Desired/effective discrepancy | `The box has not reported the desired role yet.` | |
| | R23 | Read-back age | `Reported at %s UTC. Observed %s ago.` | |
| +| R24 | Drain completion limitation | `Drain completion is not yet reported. The drain request is pending. Do not stop the box on the basis of this request.` | |
| +| R25 | Diagnostic labels, separate strings | `Eligibility`; `Full readiness`; `Drain completion`; `Drain request` | |
| | H01 | HA awake observation, later display | `Awake on %s as of %s UTC.` | |
| | H02 | Proven asleep observation | `Asleep as of %s UTC.` | |
| | H03 | Unknown/conflicting observation | `The current box could not be confirmed.`; `Boxes disagree about this instance. Its current state is unknown.` | |
| @@ -302,48 +347,67 @@ Drafts only, as expressly requested. This implementation-plan deck is not produc |
| | D01 | CLI/runbook create explanation | `New creates in an HA region need a box with room. A 503 response asks you to retry after 60 seconds. Missing evidence pauses creates without reporting zero capacity. Existing instances can still wake.` | |
| | D02 | Role/readiness docs | `A role change saves the desired role. Read it back to see the last reported role and its age. A saved drain request does not prove that instances have stopped or duties have moved.` | |
| | D03 | Deployment docs | `Roll the boxes and verify their admission reports before enabling the capacity check. Keep the home placement empty. Set the configured region codes and data coordinates on the console.` | |
| -| D04 | Named-pool temporary cut, only if Q1 approves | `This release cannot check capacity for named-pool creates. Those creates return 503 until pool evidence is available. Existing pooled instances keep running.` | |
| +| D04 | Named-pool and mixed-version docs | `Named-pool creates need a serving box that reports membership of the requested pool. Older boxes do not report this evidence. If no box confirms capacity and evidence is missing, the create returns 503 without a capacity alert. Shared-pool creates use the existing shared-pool reports.` | |
| | D05 | Display docs | `The box and state are observations from reports. They can be delayed. A sleeping HA instance is not woken to check a deploy.` | |
| HTTP codes/Retry-After and JSON field names are protocol, not extra prose. Preserve existing auth/duplicate/F1/F5 errors verbatim. If execution adds a new error, tooltip, help paragraph, blocker or log, it must enter this deck before writing product copy. Outline-only readiness reasons for unpublished individual facts must not be rendered as if the facts were measured. |
| ## Census and reviews |
| -This plan-only Markdown changes no root-census byte. P2b-1's intended production changes are cmd/console and internal/console, outside root scope. Confirm with `make census-card` on the implementation diff; do not assume a new shared helper is exempt. Reuse boxchoice without modifying its runtime policy. Relevant record-write censuses still apply to create/role writers even when the root census is empty. |
| +This plan-only Markdown changes no root-census byte. P2b-1 now also changes the root-scoped host edges publisher and any shared decoder needed for named_pools. T0 needs a card for the additive JSON field, serialization/configuration reads, tests in scoped envelopes and all consumer changes. Its console-only admission/observer changes remain outside root scope unless they modify a linked shared package. Confirm with `make census-card` on the implementation diff; do not assume a new shared helper is exempt. Reuse boxchoice without modifying its runtime policy. Relevant record-write censuses still apply to create/role writers even when the root census is empty. |
| -P2b-2 CLI dispatch, flags, usage and JSON decoder changes in system.go/system_roles.go are root-binary surface. Any shared boxroles/release/status/edgesfile change is also in scope. P2b-3 changes in apimode.go, instances_cli.go, deploywatch.go and linked shared packages need a card, including every changed unit and whole-file envelope. Docs prose under docs/site is not a root read, but every new command needs its CLI heading and docsite validation; flags and JSON cannot evade census by being called presentation. |
| +P2b-2 CLI role/read-back/diagnostic output, dispatch, flags, usage and JSON decoder changes in system.go/system_roles.go are root-binary surface. Any shared boxroles/release/status/edgesfile change is also in scope. P2b-3 changes in apimode.go, instances_cli.go, deploywatch.go and linked shared packages need a card, including every changed unit and whole-file envelope. Docs prose under docs/site is not a root read, but every new command needs its CLI heading and docsite validation; flags and JSON cannot evade census by being called presentation. |
| For an in-scope diff: create CLAIMS with tab-separated file:unit and changes/new reads; run census-propose under the actual slice name; run targeted census, scope, rebase and J4 checks; obtain an independent Opus or Fable verdict for this Codex-authored work against amadan main at the exact tip, including every unit/envelope, and record it on #280 in the authorized implementation session. The reviewer decides; do not escalate census classes to Paul. This session dispatches nobody and posts nothing. |
| -Review T1's cache/identity boundary and T3's pre-write gate separately under stopping rule 3. T2 and docs/local acceptance ride one whole-branch review. Later role authority, retry grants, root changes and new caches get risk-sized review. A final P2 fix still needs census and changed security/root/termination/storage checks inside the same budget. |
| +Review T0's pool-evidence security gate/root surface, T1's cache/identity boundary and T3's pre-write gate separately under stopping rule 3. T2 and docs/local acceptance ride one whole-branch review. Later role authority, retry grants, root changes and new caches get risk-sized review. A final P2 fix still needs census and changed security/root/termination/storage checks inside the same budget. |
| ## Dev switch-on card and rollback |
| Preparation is read-only. A later card names the actual AWS account/region, deployment, console service, sophie/leo identities, binary versions, exact env/config changes, disposable app/hosts, cost ceiling, traffic effect, operator, window and cleanup. #421's prior G1 approval is not approval for these additional settings or a P3a drill. |
| -1. Confirm P3a is released on every dev box before opt-in, with its own card satisfied: sophie's console route Unit=console.service, chronyc working under the edge sandbox, change-index read mode and root-owned region-config.json, termination queues/Started, and unattended self-update held during the attended window. CARLOS_GROUP_ADMISSION=1 is box-only; CARLOS_REGION_HA and queue/fixed identity configuration retain their existing box scope. The console keeps its box HA variables unset and CARLOS_REGION empty. Do not create a group or infrastructure resource for P2b-1. |
| -2. Preserve current CONSOLE_HA_REGIONS=ie unless the read-only recheck finds otherwise. Validate the exact proposed CONSOLE_HA_CAPACITY_CONFIG and existing SecretsPub/AWSAccount/home data configuration. Set CARLOS_REGION_METRICS=cloudwatch only with its existing Carlos/Region PutMetricData grant verified. Missing rights require a separate scoped card, not hidden IAM work. Preserve CONSOLE_REGION_INGRESS/PLATFORM_EDGE_IPS from the ingress owner; neither changes proxy trust. |
| -3. Resolve Q1's named-pool effect before switching the check on. List affected dev create users and expected refused operations. Positive/zero/incomplete scenarios are local production-wired witnesses first. The live card uses disposable approved names; it does not exhaust host memory, alter storage prefixes, drain a production workload or kill an edge merely to produce a zero. |
| -4. In the attended dev window, show a positive supported create and its cleanup through the CLI/API. For visible refusal, use a separately approved temporary capacity-configuration exclusion or coordinated P3a role window; name which concurrent creates are affected. Show the actual no-capacity response and zero protected writes, then restore and show recovery. Observe CloudWatch's corresponding count and transport counters. Incomplete-evidence fault injection remains local unless explicitly scoped on the card. Wakes continue through the real edge during the window. |
| -5. Record exact previous binary/config/env bytes and restore them on failure. Restoring the previous console binary removes this new gate; it is a deliberate return to the earlier weaker create checks, not proof of capacity. Stop experimental creates before rollback. Existing HA stamps are immutable and must never be cleared. Removing CARLOS_REGION_METRICS stops metric sends only; it is not an admission bypass. Restore Q1-related configuration and any approved desired-role change, then verify read-back/publication rather than assuming applied. Retire only approved throwaways through the API/CLI. Remove owned scratch and stop test processes. |
| +1. **Before P2b-1 merges**, roll a P3a-only dev release and pass its fixed-pair admission drill. Confirm every dev box is on P3a before opt-in and satisfy its own card: sophie's console route Unit=console.service, chronyc under the edge sandbox, change-index read mode, root-owned region-config.json and termination queues/Started. CARLOS_GROUP_ADMISSION=1 is box-only. The console keeps its box HA variables unset and CARLOS_REGION empty. Record the drill's binary and evidence; a combined P3a/P2b-1 release cannot substitute for it. |
| +2. Book **2026-11-09, 14:00–16:00 UTC** with a named release operator. Hold other dev releases and unattended updates during that window. Before the release carrying P2b-1, validate the exact CONSOLE_HA_CAPACITY_CONFIG and existing SecretsPub/AWSAccount/home data settings, then install the capacity-config drop-in on the dev console **without restart**. Preserve CONSOLE_HA_REGIONS=ie. Set CARLOS_REGION_METRICS=cloudwatch only after verifying its existing Carlos/Region PutMetricData grant. Missing rights need a separate scoped card. Preserve CONSOLE_REGION_INGRESS/PLATFORM_EDGE_IPS. Flagship is unaffected while CONSOLE_HA_REGIONS remains unset there; verify that read-only. |
| +3. Record current total key counts under control/edges/ and status/boxes/, plus status counts inside the 24-hour horizon, on dev and flagship. Include the 200-edge, 200-recent-status and 1000-raw-status limits and the scoped cap remedies above. Record each dev box's actual wire placement, including sophie, leo, dennis, box-1 and any lingering noor-fossicking publication. Home is empty/omitted, not ie. Non-HA home neighbors must be known scope exclusions without identity/admission requirements. |
| +4. Roll P2b-1's boxes before its console. Verify fresh named_pools: sophie-knitting [hapair], leo-climbing [cohort1,hapair], with sophie's shared flag true and leo's false; also verify admission, identities and timestamps. No new object or extra poll is installed. Confirm supported named-pool users retain capacity; retain the F5 HA-data cut. Mixed-version and incomplete-evidence cases run locally first. Only after these checks roll the new console, whose already-set HARegions activates the gate immediately. |
| +5. In the attended window, show positive shared and supported named-pool creates and cleanup through CLI/API. For visible refusal, use the card's separately approved temporary capacity-configuration exclusion or coordinated P3a role window; name all concurrent creates affected. Show the no-capacity response and zero protected writes, restore and show recovery, and observe the corresponding CloudWatch count and transport counters. Do not exhaust memory, alter storage prefixes, drain a production workload or kill an edge merely to manufacture zero. Incomplete-evidence injection remains local unless explicitly scoped; existing wakes continue through the real edge. |
| +6. Record exact previous binary/config/env bytes and restore them on failure. Stop experimental creates before rollback. Roll back the console gate before reverting a pool publisher, so named creates do not become unknown during rollback. Restoring the prior console returns to its earlier weaker create checks; it is no proof of capacity. Preserve immutable HA stamps. Removing CARLOS_REGION_METRICS stops sends only, not admission. Restore approved configuration/role changes and verify read-back/publication. Retire only approved throwaways through CLI/API, release the update hold, remove owned scratch and stop test processes. |
| Role/readiness and display later get separate cards. Full readiness green, graceful drain, ASG hook/Standby and NLB/termination/hairpin drills remain with their merged producers and approved series cards. Do not report P2b-1's create drill as those gates passing. |
| -## Open questions for Paul |
| +## Resolved questions and execution prerequisites |
| + |
| +Q1–Q5 are resolved by the attributed 2026-11-04 rulings above. No design choice remains open for Paul in this revision. The dated dev slots require a named release operator, scoped live card and the documented prerequisites before implementation merges. These are execution gates, not permission to mutate production from this planning session. |
| -**Q1. What should happen to named-pool creates while pool membership is not published?** This affects currently allowed standalone sidecar and other non-F5 named-pool creates; it is a new user-visible cut. Options: **(Recommended)** wait for a small box-side pool-evidence publication slice to merge before switching on P2b-1 for a deployment using those creates, then refresh only the dependent admission task against that main; this preserves the capability and adds no polling. Or explicitly accept temporary 503 evidence refusals for named-pool creates, while existing pooled instances keep their wake path. The latter lets the current executable tasks ship without inventing a producer. Do not silently bypass the pool check. F5 for pooled/non-home HA data creates remains the already-approved G3 cut either way. |
| +## R1 P2 dispositions |
| -**Q2. Should the first role/readiness door be diagnostic-only?** **(Recommended)** ship desired-role save/read-back plus eligibility diagnostics, with full readiness unavailable and drain completion explicitly unreported until a separate runtime publication/drain slice merges. This makes actual P3a behavior visible without claiming §10/§13 completion. Or wait to ship all of P2b-2 until those producers exist. This is a staged capability cut from the full requested readiness door, not a declaration that the spec is complete. A drain request must remain visibly pending; it cannot become permission to stop a box. |
| +| Finding / fault family | Rev 2 change | |
| +|---|---| |
| +| P2-1 / capacity evidence classification, I2/I4 | Ordered per-file scope exclusions before identity/admission, explicit unbound exclusion, positive-witness admission and complete-only regional metric; T1 pins each case. | |
| +| P2-2 / observation lifetime, I3 | Fixed 60-second schedule, 45-second pass deadline and 120-second start-based expiry; test a create during the successor pass and recheck producer times at use. | |
| +| P2-3 / bounded census of unbounded history, I2/I3 | Restore the 24-hour status horizon before GETs/report cap, exclude self-stale edges without status, retain modification metadata in one bounded LIST, and document raw-cap limits, count inventories and scoped cleanup. | |
| +| P2-4 / rollout gating, I6 | P3a-only release/drill before merge; validated capacity-config drop-in installed before the P2b-1 release; named attended window with other releases held; flagship remains off. | |
| +| P2-5 / switch-on scheduling, rule 5 | Q1's pool producer rides P2b-1 as T0. Move the full slice to the 2026-11-09 dev slot for its added implementation and review work. | |
| -**Q3. Which dev release/window owns switch-on?** **(Recommended)** reserve the first dev-only release after implementation merge, target 2026-11-06, after P3a fixed-pair admission and the selected Q1 prerequisite, with an attended create/metric drill. Or choose a later named date and keep implementation on its branch until that slot exists. The current dev HA settings remain as recorded; no live changes are authorized by this draft. |
| +## R1 P3 follow-ups |
| -**Q4. What display availability limit is acceptable if old reporter conflicts cannot yet be bounded?** **(Recommended)** require the separate display design to establish a shorter bound using a cited merged stop guarantee or a separately merged evidence producer before switch-on. Or explicitly accept an unknown awake-box display for up to the 24-hour status horizon after failover, with H03 copy, while runtime recovery proceeds normally. The second option cuts visible availability and must not be chosen silently. Neither option permits URL polling to settle uncertainty. |
| +All nine remain recorded; none starts a review round. Only one-line wording fixes are applied here, except the pool-fixture detail necessarily supplied by the new Q1 task. |
| -**Q5. What review scope is authorized for the separate display design?** **(Recommended)** authorize one explicitly scoped review of the new merged-input design, carrying P2's two C1 P1 rounds, the closed third P2a round and N-HA13; stop at no P1 and bring any repeated-family blocker back without another fix. Or keep display as this outline until Paul schedules it. Renaming to P2b-3 is not authorization for a fourth P2 round. |
| +| R1 item / invariant | Disposition | |
| +|---|---| |
| +| P3-1 / I5, import precedence | One-line correction applied: permanent HA import refusal precedes capacity. Implementation witness belongs to T3. | |
| +| P3-2 / I2, persistent named-pool refusal | Superseded by Q1's producer; C10 still explains missing publication in mixed-version regions without promising a one-minute fix. | |
| +| P3-3 / I5, region versus HA stamp | One-line correction applied: creates outside CONSOLE_HA_REGIONS retain main behavior. | |
| +| P3-4 / I4, real serialized fixture | T0's new Q1 task supplies a host-generated/checked golden body shared with T1; no hand-written production-field proof. | |
| +| P3-5 / I1, vacuous wake witness | Follow-up in T3 implementation: replace the console-inaccessible edge wake test with console enable/restart/deploy/retry/alias-attach door witnesses under zero and unknown observations. Retain the series' real wake coverage separately. | |
| +| P3-6 / I3, worker registration | Follow-up in T2 implementation: register the new worker name with RunClaimWorker and specify idle job-list behavior, since unregistered names panic. | |
| +| P3-7 / I2, absent status iid | Follow-up in T1 implementation: make an empty status metrics.instance_id explicit unknown, not a conclusive identity mismatch. | |
| +| P3-8 / I2, duplicated fixed bindings | Follow-up in the release card/runbook: cross-check console fixed_boxes with box CARLOS_HA_FIXED_BOX_IDENTITIES, including recreated fixed refs. | |
| +| P3-9 / I2, identity verifier setup | Follow-up in the release card: verify Config.AWSAccount and the embedded identity certificates on the actual console binary. | |
| ## Round history and stopping rules |
| -**rev 1, no review yet; the display slice carries P2's two C1 rounds and N-HA13.** |
| +**R1 (Opus) READY AFTER FIXES, 0 P1 / 5 P2 / 9 P3, applied as rev 2; review closed under rule 1. The pool-evidence task added by the Q1 ruling was not in R1; its build gets its own per-task review (rule 3).** |
| | Inherited review | History and disposition | |
| |---|---| |
| @@ -351,10 +415,11 @@ Role/readiness and display later get separate cards. Full readiness green, grace |
| | P2 R2, Opus, 2026-11-01 | NOT READY, 1 P1/7 P2/6 P3. P1-A repeats C1 through sleeping-host URL fallback. N-HA13 cuts display; no third family fix. | |
| | P2 R3, Opus, 2026-11-01 | READY AFTER FIXES, 0 P1/1 P2/7 P3. P2a rev 4 applies fixes; review CLOSED, 3 of 3 used. No automatic fourth round for an outline split. | |
| | P3a T2 namespace withdrawal | F1/F2, N1, then R2-1/R2-2. Final controller CUT under Paul's delegation. Closed; no P2b repair of that family. | |
| -| This drafting commission | No independent review, producer change, test suite or deployment claimed. Author source/budget checks are not a review round. | |
| +| P2b R1, Opus, 2026-11-04 | READY AFTER FIXES, 0 P1 / 5 P2 / 9 P3, at plan 77b0d81d / branch 7124ba61. Archived as `docs/superpowers/reviews/REVIEW-REGION-HA-P2B-R1.md`. Rev 2 applies all P2s; review CLOSED after one round. T0 was added by Q1 after R1 and needs its build review. | |
| +| This revision | Author edits only; no second review, production change, test suite or deployment claimed. | |
| -Future briefs use `docs/superpowers/reviews/REVIEW-BRIEF-TEMPLATE.md` and carry this history. The controller must scope capacity/role review as the newly executable merged-input slice, not reopen P2a. Stop at the first no-P1 round, apply P2s without reopening, list P3s as follow-ups. A fourth round needs Paul's scoped go. Two consecutive findings against one invariant stop fixes and require his refuse/cut/central-enforcement choice. Q5 gates display review. |
| +Future briefs use `docs/superpowers/reviews/REVIEW-BRIEF-TEMPLATE.md` and carry this history. The controller must scope capacity/role review as the newly executable merged-input slice, not reopen P2a. Stop at the first no-P1 round, apply P2s without reopening, list P3s as follow-ups. A fourth round needs Paul's scoped go. Two consecutive findings against one invariant stop fixes and require his refuse/cut/central-enforcement choice. The controller's Q4/Q5 ruling scopes display review when scheduled; a repeated C1 P1 returns to Paul without a fix. |
| One implementation session owns one slice and ends at its merge. At three days or three compactions, hand off and stop. At 24h without a merge, or a stopping-rule trigger, report the blocker, last two rounds and recommended cut to Paul and on the authorized branch discussion; repeat every further 24h. Splitting this document does not reset the clock or rounds. This plan's requested local drafting work ends at its commit; no branch post or HANDOFF.md is written. |
| -Draft verification: re-read cited merged code, check no proposed interface is claimed to exist, verify budget arithmetic and all required sections, run `git diff --check`, stage only this plan, and use the requested author and a subject shorter than 80 characters. Runtime tests and live acceptance remain unchecked implementation tasks. |
| +Draft verification: re-read cited merged code, check no proposed interface is claimed to exist, verify budget arithmetic and all required sections, run `git diff --check`, verify the archived review is byte-identical to R1, stage only this plan and that review, and use the requested author and a subject shorter than 80 characters. Runtime tests and live acceptance remain unchecked implementation tasks. |
diff --git a/docs/superpowers/reviews/REVIEW-REGION-HA-P2B-R1.md b/docs/superpowers/reviews/REVIEW-REGION-HA-P2B-R1.md| new file mode 100644 |
| index 000000000..2027af3fd |
| --- /dev/null |
| +++ b/docs/superpowers/reviews/REVIEW-REGION-HA-P2B-R1.md |
| @@ -0,0 +1,93 @@ |
| +# Review: region HA P2b console plan, round 1 of 3 |
| + |
| +Reviewer: Opus, independent. Plan `docs/superpowers/plans/2026-11-04-region-ha-p2b-console.md` at 77b0d81d (branch tip 7124ba61). Citation base 016599d5. Read-only; no tests run. |
| + |
| +## Summary |
| + |
| +Citations hold. I checked every existing-code anchor in "Merged evidence", the create doors, the metric start, boxchoice, the status loader, the P2b-2 role seams and the P2b-3 inventory against 016599d5. Each exists and says what the plan says. The plan does not depend on P3b. The budget arithmetic is right: $0.53568, $0.58752, $0.432, $0.01728 per key, $0.05184 for P2b-2, and the role event total of 28G+4P+4L = $0.0000512. The plan's statement about the dev console agrees with #421. CONSOLE_HA_REGIONS=ie was set as G1 item 8 at 23:03Z, approved by Paul, and was never unset (d421.md:377, :383, :430). The plan is right to drop P2a's "unset" assumption. The copy deck has no em dashes, and C01-C03 and C09 match main's strings exactly. |
| + |
| +I found no P1. The P2s are gaps in four places: how the observation classifies boxes and how long it stays valid, the status-key bound, how merging and releasing the slice line up with P3a, and the Q1/Q3 recommendations. Each has a local fix that needs no new round. |
| + |
| +## P1 |
| + |
| +None. |
| + |
| +## P2 |
| + |
| +### P2-1. Box classification precedence and regional aggregation are unspecified (Eligibility; T1) |
| + |
| +- **Invariant / family:** I2 (complete or unknown) and I4 (eligibility agrees). Family: capacity evidence classification. |
| +- **Problem.** Plan lines 111, 115 and 117 list the counted predicate, some known exclusions (booting, drain, platform, not admitted, drained, stale, insufficient totals) and some unknowns (missing admission additions, missing identity, missing status counterpart, unknown protocol). They never say: |
| + 1. whether a box that is plainly out of scope is excluded before identity and admission evidence are demanded. Out of scope means another placement, another data bucket, no `region-ha-1` capability, no hibernation, or the wrong secrets fingerprint. |
| + 2. how per-box unknowns combine into a regional answer. Does one unknown box make the whole region unknown, or can ≥1 verified-eligible box still allow a create while the metric omits the region? |
| + 3. whether a box with a valid identity record but no fixed pin and no derivable g- binding (for example a recreated fixed box under a new reference, f18da98) is "conclusively failing verification" (excluded) or "missing identity" (unknown). |
| +- **Evidence.** |
| + - A box without CARLOS_REGION_HA publishes no `region-ha-1` (`internal/host/edgesfile.go:198-203`) and no identity record (`internal/host/boxrecord.go:163-165`). |
| + - A box without CARLOS_GROUP_ADMISSION=1 has no RoleSource, so it publishes no admission fields (`internal/host/boxroles.go:100-102`, `:115`). |
| + - An unset CARLOS_REGION is the home placement `""` (#421, c6304f2d). |
| + - Dev has non-HA boxes beside sophie and leo: dennis, box-1, and the retired noor-fossicking (d421.md:64, :190, :430). |
| + - Main's `boxchoice.Eligible` silently skips out-of-scope boxes (`internal/boxchoice/boxchoice.go:131-144`). Spec §4.3 defines view(r) by placement, bucket and fingerprint, so out-of-scope boxes are simply not in it. |
| +- **Failure scenario.** Suppose dennis (no HA, no admission fields, no identity record) publishes home placement. Read literally ("missing identity / missing admission additions are unknown"), the IE region is unknown on every pass. Then every dev HA-region create returns 503 C04, and the EligibleBoxes datapoint is never published, so the alarm breaches permanently. Read the other way, the implementer picks a rule that review never saw. |
| +- **Fix.** Add a precedence table to "Eligibility" and pin it in `TestHACapacityIdentityAndScope`: |
| + 1. Validated per-file scope facts are known non-candidates and need no identity or admission evidence. A file can only remove itself this way. These facts are: placement ≠ region, data bucket or region ≠ configured, no `region-ha-1`, no hibernation, fingerprint ≠ expected, and its own edges generation stale. |
| + 2. Only in-scope files go on to identity, status and admission checks. |
| + 3. Regional rule: allow if ≥1 verified-eligible box serves the requested pool. Complete-zero only when every in-scope file is classified. Otherwise unknown. Metric: publish only when every in-scope file is classified. |
| + 4. A signed record for the deployment account with no configured binding is "unbound" and excluded, with a diagnostic. It is not unknown. |
| + |
| + State in the card which dev boxes publish home placement. |
| + |
| +### P2-2. The one-minute validity window lapses before every successor pass completes (Observation and freshness; T1 Step 3) |
| + |
| +- **Invariant / family:** I3 (one bounded observation). Family: observation lifetime. |
| +- **Problem.** The runner starts a pass immediately and then on the one-minute interval (plan line 103), and "At age >=60s from pass start, the observation is unavailable" (line 109). Pass n is valid until the instant pass n+1 starts. Pass n+1 publishes only when it completes: 2 LISTs plus E+H+B sequential GETs, bounded to 45 s. So once a minute there is a window as long as the pass during which every HA create gets 503 C04. A Go ticker that drops a tick widens the window to a full minute. Line 109's "canceled waiters" hints that requests might wait on the in-flight pass, but line 103 says requests never start or wait for a load. |
| +- **Evidence.** Plan lines 103 and 109. The existing loop shape is `internal/console/regioncapacity.go:121-145` (ticker after the pass). The status loader is sequential (`internal/status/fleet.go:285-308`). |
| +- **Failure scenario.** On the dev card (step 4), a "positive supported create" lands in the refresh window and gets C04 even though both boxes are eligible. In steady state, about 1-5% of HA creates are refused, and more when S3 is slow. |
| +- **Fix.** Measure validity from completion, with a bound of at least interval + pass timeout (for example 120 s from pass start). That is safe because I2 already recomputes every producer-time predicate at use. Alternatively, define a bounded wait for an in-flight pass. Add the boundary to T1 Step 3: a request at t = 60 s + ε, while the next pass is in flight, must still allow. |
| + |
| +### P2-3. Reading every historical status key against a 200-key cap turns normal accumulation into a permanent create outage (Observation and freshness; budget) |
| + |
| +- **Invariant / family:** I2 and I3. Family: bounded census of unbounded history. |
| +- **Problem.** The plan drops the 24 h horizon for capacity and reads "all accepted status keys, including old ones" (line 105). A 201st key under either prefix makes the observation incomplete for every region (lines 105, 111 and 231). |
| +- **Evidence.** |
| + - Status keys are never deleted. Nothing in the repo deletes `status/boxes/` outside tests and dry-run. |
| + - The horizon exists precisely because "with automatic replacement such reports pile up, one per replaced box, and could fill the key cap" (`internal/status/fleet.go:240-251`). |
| + - Retired boxes' edges files also persist (`internal/edgesfile/snapshot.go:122-125`). |
| +- **Failure scenario.** Once a deployment has seen more than 200 box labels (status keys) or more than 200 edges files, every HA create returns 503 and the metric stops, with no documented remedy. H, and so the per-minute GET cost, grows with history rather than with the live fleet. |
| +- **Why the rationale does not hold.** The plan wants old status keys so that a retired box's lingering edges file counts as known stale rather than missing. But capacity never needs that status. An edges file whose own generation fails `HeadroomFresh` is already a known zero for capacity (it can never be Placeable). A box with fresh edges needs fresh status, which is always inside the 24 h horizon. |
| +- **Fix.** |
| + - Classify per file. A self-stale edges file is excluded with no status counterpart, instead of reusing JoinLive's whole-request "edges without status" incompleteness for it. Keep the horizon, so old status keys never count against the cap or the budget. |
| + - If a bounded mod-time listing is not available, say how the horizon is applied within one LIST. |
| + - Either way, make the card record current key counts under `control/edges/` and `status/boxes/` on dev and flagship. Name the remedy at the cap (the runbook's edges-file removal, plus a status-key prune). |
| + |
| +### P2-4. Merge and release order with P3a and the absent capacity config is not pinned; the dev gate turns on with the binary (Slices; dev card) |
| + |
| +- **Invariant / family:** AGENTS.md rule 5 (switch-on date) and I6. Family: rollout gating. |
| +- **Problem.** No new switch exists. CONSOLE_HA_REGIONS=ie is already live on the dev console (d421.md:383). With P2b-1, an HA console that lacks CONSOLE_HA_CAPACITY_CONFIG refuses affected creates (line 97). D3 also requires P3a admission fields, which boxes publish only with CARLOS_GROUP_ADMISSION=1 on a P3a build. P3a is merged but not released (d421.md:436). If P2b-1 merges before a P3a-only dev release and drill, the next dev release carries both. The console then refuses every HA-region create from the moment it rolls, which is before any box can opt in. That covers all dev home creates of every gated kind: instance, sidecar and first-domain static. Card item 1 says "confirm P3a is released ... before opt-in" (line 324). It does not require the merge to wait for a P3a-only release, or the config to be installed before the console binary. |
| +- **Failure scenario.** Another workstream's routine dev release, which by memory always rolls dev first, ships P2b-1. Dev creates 503 for everyone until the card runs. |
| +- **Fix.** In "Slices" and the card, state these in order: |
| + 1. P2b-1 merges only after a P3a-only dev release has rolled and its fixed-pair admission drill has passed. |
| + 2. CONSOLE_HA_CAPACITY_CONFIG is validated and installed on the dev console (drop-in, no restart) before the release that carries P2b-1. |
| + 3. Name the window with other dev releases held. |
| + 4. Note that flagship is unaffected while CONSOLE_HA_REGIONS is unset there. |
| + |
| +### P2-5. Q1's recommendation conflicts with Q3's date on dev (Open questions) |
| + |
| +- **Invariant / family:** rule 5 and no silent capability cut. Family: switch-on scheduling. |
| +- **Problem.** Q1 (recommended) waits for an unplanned, undated box-side pool-evidence slice before switching P2b-1 on "for a deployment using those creates". Dev is such a deployment: sophie serves @shared,hapair and leo serves cohort1,hapair (d421.md:56), with dev pooled apps (cohort1/claimtrial, hapair). Q3 (recommended) targets 2026-11-06 "after ... the selected Q1 prerequisite". Taking both recommendations makes 11-06 unreachable and leaves the slice without a real date. And because of P2-4, merging without the producer cuts named-pool creates anyway. |
| +- **Fix.** Either recommend Q1 option 2 for dev, with D04, an affected-user list and the 11-06 date, and keep option 1 for other deployments. Or keep option 1 and give the pool-evidence slice its own date, moving Q3's target behind it. Say plainly which one Paul is being asked to approve. |
| + |
| +## P3 (follow-up list; never a reason for another round) |
| + |
| +1. **Import ordering versus I5 (Create boundary, instance door).** "Run capacity before createFrom/createImport dispatch" puts a temporary 503 ahead of the import's permanent 409 (`refuseHAImport` runs inside `createImport`, `internal/console/apiinstanceimport.go:119`). That contradicts I5's "permanent-refusal checks precede capacity". Skip capacity for `req.Import` in an HA region, or call `refuseHAImport` before capacity. |
| +2. **C04 for the Q1 named-pool cut.** If Q1 option 2 is chosen, C04 ("Try again in a minute", Retry-After 60) misdescribes a refusal that lasts until a release. Give named-pool refusals their own 503 string, consistent with D04. |
| +3. **"Non-HA creates keep main's behavior" (line 97).** Static, address, rootfs, sidecar and first-domain records are never HA-stamped (`internal/console/seedmove.go:47-49`, `domainattach.go:256`) but are gated by region. Reword to "creates outside CONSOLE_HA_REGIONS". |
| +4. **T1 Step 1 fixture.** `edgesFile` is unexported in `internal/host`. Name where the "actual serialized P3a edges bytes" come from, for example a golden file generated by an `internal/host` test and checked by both packages. |
| +5. **T3 `TestHACapacityDoesNotGateExistingWake`.** The console helper cannot be reached from the box wake path, so this witness is vacuous. Point it at the console's own non-create doors listed in line 132 (enable, restart, deploy, retry, alias attach) with a zero/unknown observation. |
| +6. **Worker registration.** `RunClaimWorker` panics for unregistered names (`internal/console/claim_workers.go:60-64`). T2 should name the new worker's registration and its job-list behaviour when there is nothing to do. |
| +7. **Status `metrics.instance_id` absent** (`internal/status/snapshot.go:585`, omitempty). State whether an empty value is unknown or a mismatch. |
| +8. **Two fixed-identity sources.** `fixed_boxes` duplicates the boxes' CARLOS_HA_FIXED_BOX_IDENTITIES. A recreated fixed box under a new reference that is missing from the console config counts nothing. The card and runbook should cross-check both lists. |
| +9. **Card checks.** Card item 2 should verify Config.AWSAccount and the embedded identity certificates on the dev console (`internal/console/server.go:1854-1858`). Without them every identity is unverified. |
| + |
| +## Verdict |
| + |
| +READY AFTER FIXES |