carlos / platform Public

G6 design: capacity card, write fence and pool path specs

Three approved specs for the first customer app in the flagship US HA pool:
the US capacity card (2 x t4g.medium), the F-C write fence (rev 3.1, ~30 s,
slice kill through root, unclean release) and the pool path (env allowlist
CONSOLE_HA_POOL_ACCOUNTS, person-only HA option on app create). Reviewed by
Astra (two rounds) and a Fable 5.2 spot check of the fence. Docs only.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

Squashed from design-g6 into main.
claude agent, operated by paul@keymail.dev 8660f95a03b35d066a10850f42d747670429c18c parent ae1b8cc
7 files changed, +964 −0
  • docs/superpowers/reviews/CODEX-FINDINGS-G6-R1.md +75 −0
  • docs/superpowers/reviews/CODEX-FINDINGS-G6-R2.md +83 −0
  • docs/superpowers/reviews/CODEX-REVIEW-BRIEF-G6.md +26 −0
  • docs/superpowers/reviews/FABLE-SPOTCHECK-G6-FENCE.md +43 −0
  • docs/superpowers/specs/2026-11-11-g6-pool-path-design.md +247 −0
  • docs/superpowers/specs/2026-11-11-g6-us-capacity-design.md +165 −0
  • docs/superpowers/specs/2026-11-11-g6-write-fence-design.md +325 −0

CI failed — run details

diff --git a/docs/superpowers/reviews/CODEX-FINDINGS-G6-R1.md b/docs/superpowers/reviews/CODEX-FINDINGS-G6-R1.md
new file mode 100644
index 000000000..1f9253f4a
--- /dev/null
+++ b/docs/superpowers/reviews/CODEX-FINDINGS-G6-R1.md
@@ -0,0 +1,75 @@
+Reviewed `design-g6` at `b5f825d9be1ba057d32120f5bb67283418c73492`, round 1. Litestream references below are to `github.com/benbjohnson/litestream@v0.5.14`.
+
+**G6-1.1 — P1 — Write fence §3.1: pending excludes uncaptured SQLite writes**
+
+- **Claim:** `DB.Pos().TXID > synced` identifies locally committed transactions absent from storage.
+- **Evidence:** Litestream `db.go:559-587` reads the latest local LTX position, not SQLite’s committed WAL position. WAL capture happens separately (`db.go:1165-1207`). If capture stalls or fails while the app keeps writing, local and replica TXIDs can remain equal. `Replica.Sync` can then record successful no-op syncs (`replica.go:157-179`). The fence never trips.
+- **Fix:** Include WAL-capture health and unrepresented commits in the fence’s invariant. Treat inability to establish capture progress conservatively. Add a witness where SQLite continues committing while local capture is blocked or failing.
+
+**G6-1.2 — P1 — Write fence §§3.1, 4–5: sync completion does not establish the 35-second loss bound**
+
+- **Claim:** Every unsynced commit occurred after `LastSuccessfulSyncAt()`.
+- **Evidence:** Litestream captures `dpos` before uploading (`replica.go:157-175`) and timestamps success afterward (`replica.go:179`, `db.go:618-621`). A sync can capture its target at t=0, finish at t=29, and reset the fence while writes acknowledged since t=1 remain pending. If the next upload hangs, fencing around t=60–65 can lose writes almost a minute old.
+- **Fix:** Base the loss bound on the capture boundary covered by confirmed replication, or on the oldest outstanding write, rather than upload completion. Test a successful slow upload followed by a hung upload while writes continue. Update the bound and exit assertions consistently.
+
+**G6-1.3 — P1 — Write fence §§2–3, 5: a hung upload can prevent release and owed-marker creation**
+
+- **Claim:** Latching the fence reuses existing paths to release unclean and retry the marker.
+- **Evidence:** `internal/lease/release.go:233-252` calls `db.SyncAndWait` before closing the store. Litestream’s `Replica.Sync` takes an unconditional mutex (`replica.go:134-136`); a final sync waits behind an already-hung background upload despite its context deadline. The client timeout is 24 hours (`s3/replica_client.go:365-366`). Renewal cancellation does not cancel the independently owned Litestream background work. No marker is attempted until finalization completes (`internal/lease/release.go:279-285`).
+- **Fix:** Specify how fence shutdown cancels and joins outstanding replication before attempting the unclean marker, preserving the rule that uploads cannot follow release. Extend the hung-sync test through finalization, marker failure, owed retry and recovery—not just the error latch.
+
+**G6-1.4 — P1 — Write fence §3.2: incarnation identity does not prevent duplicate stops**
+
+- **Claim:** The watcher may call `beginStopLocked` whenever the entry is still the same incarnation.
+- **Evidence:** A request can start stopping that same entry first (`internal/activator/haleaseloss.go:103-110`). `beginStopLocked` has no state guard: it replaces `e.stopped` and launches another stop goroutine (`internal/activator/activator.go:3453-3467`). Both callers can therefore stop and finalize the same entry concurrently. Also, normal renewal shutdown does not close `Lost()` (`internal/lease/health.go:301-311`), so a watcher waiting only on loss survives ordinary hibernation.
+- **Fix:** Under `a.mu`, verify entry and replica identity and start a stop only from `actAwake`; latch loss without restarting an existing stop. Cancel the watcher on lifecycle completion. Add request-versus-watcher, intentional-stop-versus-loss, and clean-hibernation tests.
+
+**G6-1.5 — P1 — Write fence §§3.2, 5: starting a graceful stop does not stop acknowledgements at the fence**
+
+- **Claim:** The watcher stops every writer promptly enough that all lost acknowledgements precede the fence line.
+- **Evidence:** `beginStopLocked` deliberately leaves in-flight requests to the graceful drain (`internal/activator/activator.go:3422-3428`). Shutdown can wait for respawn, sidecar starts and generation operations before stopping the main process (`:4803-4875`), then run a five-second next-due probe and a twenty-second process stop (`:4936-4960`). Existing requests and background writers can continue committing after the fence line.
+- **Fix:** Define and enforce the cessation boundary for admitted requests and background writers. Either make fence shutdown satisfy the stated acknowledgement bound or explicitly include the stopping interval in the guarantee. Test an in-flight write and a worker that continues writing during graceful shutdown.
+
+**G6-1.6 — P1 — Capacity §6: the resize does not select the new launch template**
+
+- **Claim:** Changing `instance_type` and `box_count` together launches a medium, and subsequent replacements use that template.
+- **Evidence:** The template takes `var.instance_type` (`infra/modules/region-host/group.tf:196`), but the ASG separately pins `var.group_launch_template_version` (`:252-255`). Step 1 leaves that pin unchanged, so scale-out launches another small. After correcting the pin, step 0’s old provider observation no longer matches; preflight checks the exact template (`internal/grouproll/engine.go:854-856,927-932`).
+- **Fix:** Create the medium template, explicitly pin its numeric version before or with scale-out, and obtain the matching provider observation before `replace`. Record the actual apply counts and verify each launched member’s type.
+
+**G6-1.7 — P1 — Capacity §6 rollback: reducing `box_count` bypasses the drain**
+
+- **Claim:** Before step 3, rollback reverts `box_count` to two and then removes the medium member.
+- **Evidence:** The module sets desired capacity directly from `box_count` (`infra/modules/region-host/group.tf:241-243`), so that apply initiates scale-in before the selected member is drained. Afterward, `remove` refuses because it must leave two members (`internal/grouproll/depart.go:120-122`).
+- **Fix:** Keep the group at three while restoring the intended template pin and matching observation. Drain and remove the selected medium through the verb, then set `box_count = 2` with no instance change.
+
+**G6-1.8 — P1 — Pool path §3.1: app creation bypasses the human-only enable boundary**
+
+- **Claim:** Adding the manifest write to `handleAPICreateApp` is equivalent to the enable door’s create.
+- **Evidence:** App creation admits account-scoped Publish service credentials (`internal/console/routedecls.go:489`, `apicli.go:416-429`). Manifest enable explicitly excludes every service role (`routedecls.go:612`) and calls `apiPerson` (`apiinstances.go:3486-3488`). The reason is that enabling instances grants standing creation policy (`apicli.go:337-343`). An account allowlist does not preserve this principal boundary.
+- **Fix:** Require a human principal for the HA option before any write, retaining ordinary service app creation. Test that an allowlisted account’s Publish credential cannot create the HA manifest.
+
+**G6-1.9 — P1 — Pool path §3.1 step 4: retry cannot distinguish partial creation from an existing app**
+
+- **Claim:** “App exists, no manifest” identifies an interrupted HA create that a retry may complete.
+- **Evidence:** Ordinary app creation does not create an instances manifest; enable creates it later (`internal/console/apiinstances.go:3573-3576`). Existing app names currently return `claimTaken` (`internal/console/server.go:5337-5343`). The proposed exception therefore also accepts an unrelated existing app, potentially with a different region, placement or existing routes. This exposes the existing-app HA conversion that §3.3 excludes.
+- **Fix:** Persist HA creation intent tied to the app lifetime and exact requested region/pool. Resume only that operation; refuse unrelated existing apps. Serialize completion against enable and instance creation, and test concurrent plain enable, changed-region retries and lost success responses.
+
+**G6-1.10 — P2 — Capacity §§3, 5: the advertised promote margin does not fit two large instances**
+
+- **Claim:** A medium carries two large instances plus the canaries and leaves room for promote overlap.
+- **Evidence:** The card allocates 2,840 MiB usable and 300 MiB to canaries. Two large instances plus one overlapping large generation require `300 + 3 × 1024 = 3372 MiB`. Large is 1,024 MiB (`internal/cgroup/sizes.go:20`), and generation memory limits are applied separately (`internal/instancectl/gen.go:75-80`).
+- **Fix:** Include the maximum permitted simultaneous overlap in the sizing formula and admission envelope. Qualify the two-large recommendation or choose capacity that supports its promised overlap. Exercise that complete workload in the capacity witness.
+
+**G6-1.11 — P2 — Pool path §§4–5: the draft promises exceed the supported behavior**
+
+- **Claim:** The app runs on two servers; releases and maintenance do not interrupt it; losing storage stops it within about thirty seconds.
+- **Evidence:** RHA §7.2 assigns execution to one lease holder. Planned handover still returns 503 for several request classes and closes some connections (`docs/region-ha-runbook.md:149-158`). The proposed fence intentionally does not trip for an idle instance with no pending writes (write-fence §3.1).
+- **Fix:** Before copy review, state that another member can take over, preserve the documented handover exceptions, and qualify the storage-outage timing with the pending-write condition. This is factual scope, not wording style.
+
+**G6-1.12 — P2 — Pool path §3.1: the API route is incorrect**
+
+- **Claim:** `handleAPICreateApp` serves `POST /api/cli/apps/{account}`.
+- **Evidence:** Its registered route is `POST /api/cli/apps/{account}/new` (`internal/console/routedecls.go:489`).
+- **Fix:** Correct the endpoint and target the registered route in the forged-request and retry tests.
+
+Verdict: NOT READY
\ No newline at end of file
diff --git a/docs/superpowers/reviews/CODEX-FINDINGS-G6-R2.md b/docs/superpowers/reviews/CODEX-FINDINGS-G6-R2.md
new file mode 100644
index 000000000..f2759eff9
--- /dev/null
+++ b/docs/superpowers/reviews/CODEX-FINDINGS-G6-R2.md
@@ -0,0 +1,83 @@
+| Prior finding | Disposition | Round 2 result |
+|---|---|---|
+| G6-1.1 | partly | WAL observation added, but continuous changes reset its timer; G6-2.1. |
+| G6-1.2 | partly | Upload-completion timestamp removed, but capture can still erase outstanding-write age; G6-2.1. |
+| G6-1.3 | partly | Cancellation covers a newly selected fenced finalization, not an ordinary finalization already blocked; G6-2.3. |
+| G6-1.4 | fixed | Awake-state guard prevents duplicate stops; proposed `Done()` ends the watcher. |
+| G6-1.5 | partly | Immediate kill proposed, but it targets the wrong cgroup and does not establish the claimed acknowledgement boundary; G6-2.2–2.4. |
+| G6-1.6 | fixed | Numeric template pin and matching observation precede replacement. |
+| G6-1.7 | fixed | Rollback drains and removes before reducing `box_count`. |
+| G6-1.8 | fixed | HA app creation requires a person; manifest creation remains person-only. |
+| G6-1.9 | fixed | App-row intent distinguishes HA creation from unrelated existing apps. |
+| G6-1.10 | partly | Overlap included, but its concurrency and supported-size assumptions remain incorrect; G6-2.6–2.7. |
+| G6-1.11 | partly | Running and maintenance promises corrected; the new idle-outage row remains inaccurate; G6-2.9. |
+| G6-1.12 | fixed | App-create endpoint corrected to `/new`. |
+
+Reviewed `design-g6` at `d4c4d8419aaf5437f6630550ab1c8dfc994ae142`, round 2, FINAL. Litestream citations refer to v0.5.14.
+
+**G6-2.1 — P1 — Write fence §3.1: the revised timers still lose outstanding-write age**
+
+- **Invariant:** An unreplicated commit’s age must survive further writes and local capture.
+- **Claim:** `tW` and the sampled capture history bound lost commits to 33 seconds.
+- **Evidence:** The spec defines `tW` as when the WAL **last** changed without `L` advancing (`write-fence-design.md:76-90`). With capture blocked and writes every second, `tW` resets every second while `L = R`; neither condition trips. Separately, a commit at t=0 captured at t=29 stops satisfying the capture-stall condition and starts the capture timer at t=29. A hung upload then permits fencing around t=60. A one-second capture interval is not a capture-duration bound: Litestream runs synchronous capture and backs off after errors (`db.go:2696-2715`).
+- **Fix:** Preserve the earliest unresolved WAL observation through subsequent changes and its eventual capture, clearing it only when replication proves coverage. Add continuous-write capture-stall and delayed-capture-then-hung-upload witnesses.
+
+**G6-2.2 — P1 — Write fence §3.2 step 3: `KillHost` does not kill HA instance processes**
+
+- **Invariant:** Fence termination must cover the actual containment of every writer.
+- **Claim:** Calling the existing `KillHost` immediately kills the HA host’s writers.
+- **Evidence:** HA requires nested layout (`internal/activator/hawake.go:149-171`). Nested generations start through systemd (`genbackend.go:299-307`) in `instancectl.SliceName(host)` (`internal/instancectl/gen.go:65-72`). `KillHost` instead opens the agent’s `carlos-exec@<host>` cgroup and returns success when it is absent (`internal/activator/genbackend.go:666-707`). That can leave the HA instance running; `haHostEmpty` subsequently examines the different systemd slice (`harelease.go:50-72`).
+- **Fix:** Specify a root-authorized kill of the actual host slice, covering all generations and roles and preventing racing starts. Keep the whole-slice emptiness proof. Test nested HA processes with the exec cgroup absent.
+
+**G6-2.3 — P1 — Write fence §3.2 steps 2–4: an existing stop cannot switch while blocked**
+
+- **Invariant:** Fence cancellation must interrupt shutdown already in progress without duplicating finalization.
+- **Claim:** Reading `e.fenced` before each wait makes an ordinary stop switch promptly to killing and fenced release.
+- **Evidence:** A fence can arrive after the check: the stop may already be receiving from `startDone` (`internal/activator/activator.go:4852-4853`), joining operations (`opset.go:152-159`), or draining the process (`activator.go:4953-4960`). It cannot reread the flag until that operation returns. Worse, ordinary `finalize` holds `finMu` while `SyncAndWait` waits behind the hung upload (`internal/lease/release.go:225-235`; Litestream `replica.go:134-136`). Selecting a new finalizer later does not cancel that existing wait.
+- **Fix:** Define a fence signal that interrupts active waits and cancels replication independently of acquiring `finMu`. Preserve one finalization owner. Test fencing after each wait has begun, including after ordinary finalization enters `SyncAndWait`.
+
+**G6-2.4 — P1 — Write fence §§3.2, 4–5: asynchronous killing cannot guarantee zero acknowledgements after the log line**
+
+- **Invariant:** The acknowledgement boundary must match the enforcement boundary.
+- **Claim:** Every request in flight at the fence fails without acknowledgement; no 2xx follows the fence line.
+- **Evidence:** The proposed sequence logs at the lease latch, then schedules the watcher and stop before killing (`write-fence-design.md:90-92,117-140`). Already admitted requests execute `proxy.ServeHTTP` outside the admission lock (`internal/activator/activator.go:6565-6577`). They can commit and return success between the latch and kill. Killing also cannot retract a response already buffered downstream.
+- **Fix:** Distinguish admission refusal, writer cessation and client receipt. Include the bounded cessation interval in the loss guarantee and revise the exit assertions accordingly, or specify an additional response-enforcement mechanism. Exercise the latch-to-kill interleaving explicitly.
+
+**G6-2.5 — P1 — Pool path §§3.1–3.2: HA placement can change before enable**
+
+- **Invariant:** A born-HA app’s chosen region and pool must remain coherent before and after manifest creation.
+- **Claim:** Immutable `ha_pool` leaves nothing new to race, and the HA app cannot change region.
+- **Evidence:** CLI app creation leaves the manifest absent. `appPolicy` treats absence as unpooled and unrestricted (`internal/console/regioncandidates.go:289-294,313-321`); `setAppRegion` therefore permits changing the row’s region (`appregionset.go:314-358`). The proposed refusal applies only when the manifest identifies an HA pool (`pool-path-design.md:131-135`). Enable subsequently copies the old pool into the new region. Instance creation also accepts an explicit region instead of the app default (`apiinstances.go:1871-1888`), while the proposed manifest sets no regional restriction.
+- **Fix:** Enforce the born-HA region/pool binding from the app row at both region-change doors, including before enable. Validate it again during enable and constrain instance placement to that binding. Test sequential and concurrent create → region-change → enable.
+
+**G6-2.6 — P1 — Capacity §3: one release agent does not bound tenant overlap concurrency**
+
+- **Invariant:** Survivor capacity must include every permitted simultaneous generation.
+- **Claim:** Counting one extra copy of the largest app bounds promote overlap.
+- **Evidence:** Rollout scheduling is per account/app, not globally serialized (`internal/rollout/policy.go:14-15`). Each app’s configurable `SwapConcurrency` controls concurrent dispatch (`policy.go:42-43`; `scheduler.go:61-75`), and the API permits values above one (`internal/console/apiswap.go:67-76`). Three standard instances with concurrency three need `300 + 6 × 512 = 3372 MiB`, exceeding the medium’s 2840 MiB despite fitting the advertised three-standard envelope.
+- **Fix:** Calculate overlap from permitted per-app concurrency across the pool, or enforce the stated single-overlap restriction. Include that maximum workload in the capacity witness.
+
+**G6-2.7 — P2 — Capacity §§2–5: the size table and mixed-size arithmetic are incomplete**
+
+- **Invariant:** Every advertised workload must satisfy the stated memory formula.
+- **Claim:** A medium supports a first app of any size and one large plus one standard with overlap.
+- **Evidence:** `xlarge` is a supported 2048 MiB size (`internal/cgroup/sizes.go:21`); one with overlap requires `300 + 2 × 2048 = 4396 MiB`. The mixed-size table entry requires `300 + 1024 + 512 + 1024 = 2860 MiB`, exceeding 2840.
+- **Fix:** Include `xlarge`, qualify “any size,” and remove or correct the mixed-size recommendation. State the enforceable admission envelope before first-app selection.
+
+**G6-2.8 — P2 — Pool path §3.1 step 2: unconditional pool equality breaks existing operator-managed apps**
+
+- **Invariant:** Legacy manifests retain their existing update behavior.
+- **Claim:** Any manifest whose pool differs from `apps.ha_pool` returns 409.
+- **Evidence:** Existing operator-managed manifests have nonempty pools, including the canaries identified in pool-path §1, but their pre-existing app rows have no HA creation intent. The proposed comparison therefore rejects their enable updates. Today those updates preserve Pool and Regions (`internal/console/apiinstances.go:3592-3597`).
+- **Fix:** Apply the intent-equality rule only to apps carrying born-HA intent. Preserve legacy operator-managed manifests and test updates to both HA and non-HA named pools.
+
+**G6-2.9 — P2 — Pool path §4: the idle-storage-outage promise still overstates unavailability**
+
+- **Invariant:** Published outage behavior must match the serving and recovery paths.
+- **Claim:** An idle app becomes unavailable until its server is replaced when storage connectivity fails.
+- **Evidence:** Without pending writes the proposed fence does not trip. Serving checks lease health, not storage reachability (`internal/console/../activator/haleaseloss.go:95-103`), so requests can still succeed before renewal failure. Write-fence §4 also explicitly permits recovery after storage returns through the owed marker and reacquire path, without replacing the server.
+- **Fix:** Describe refusal after lease failure and recovery when storage returns; reserve operator termination for a holder that cannot recover.
+
+The outstanding-write-age, writer-cessation and release-cancellation families remain unresolved across both rounds. The final-round budget is exhausted; no round 3.
+
+Verdict: NOT READY
\ No newline at end of file
diff --git a/docs/superpowers/reviews/CODEX-REVIEW-BRIEF-G6.md b/docs/superpowers/reviews/CODEX-REVIEW-BRIEF-G6.md
new file mode 100644
index 000000000..2e4400821
--- /dev/null
+++ b/docs/superpowers/reviews/CODEX-REVIEW-BRIEF-G6.md
@@ -0,0 +1,26 @@
+# Review brief: G6 design (three short specs), round N
+
+You are an independent reviewer (GPT-6 Astra). Read cold; the repo is checked out at the commit named in the prompt.
+
+Specs under review (all on branch design-g6):
+1. docs/superpowers/specs/2026-11-11-g6-us-capacity-design.md (capacity card for the flagship US HA group)
+2. docs/superpowers/specs/2026-11-11-g6-write-fence-design.md (F-C minimal write fence)
+3. docs/superpowers/specs/2026-11-11-g6-pool-path-design.md (per-account allowlist + born-HA app create option)
+
+Parent spec: docs/superpowers/specs/2026-10-26-region-ha-without-claims-design.md (RHA). Roll verb: docs/superpowers/specs/2026-11-09-group-roll-verb-design.md. Runbook: docs/region-ha-runbook.md.
+
+Fixed rulings (do NOT re-argue; report only mechanisms that fail to honour them):
+- First customer app = a FRESH create in pool "ha" on flagship US; no migration of existing instances.
+- F-C: a holder whose replica sync fails for about 30 s stops serving (503 + Retry-After) and releases UNCLEAN. Late flush, storage fencing, batched/daily classes in the pool are deferred.
+- Pool creates sit behind a per-account allowlist.
+- A resize adds a member first; counted applies (re-pin, pin-back, box_count with no instance change) have standing approval; first-of-kind applies need a GO.
+- User-facing strings are DRAFTS for Paul's copy review; do not review wording style, only factual accuracy against the code and specs.
+
+What to check:
+- Every code citation (file:line, function names) against the tree. Litestream is github.com/benbjohnson/litestream v0.5.14 in the Go module cache (go env GOMODCACHE).
+- Fence: is the trip condition (pending = DB.Pos().TXID > highest non-zero Replica.Pos().TXID seen; age = now - max(LastSuccessfulSyncAt, start) > 30 s; checked every 5 s) correct and is the stated loss bound (~35 s of acknowledged writes) true? Can it fail to trip (e.g., positions, WAL checkpoints, snapshot/compaction resetting TXIDs, restore at wake), or trip spuriously? Does latching via renewer.loseLocked actually give immediate 503 + unclean marker + owed retry through existing paths? Does the Lost() watcher race the existing stop paths? Is restricting to stream class enforceable as stated?
+- Capacity: arithmetic, the rule, and whether the apply sequence is executable with the verb and module as written (min=max=desired=box_count; remove's two-member rule).
+- Pool path: does the allowlist gate cover every door that can create a record in a scoped HA pool (including paths the spec does not list: seeds, demo claim seed/target, moves, sidecars, domain attach, app region set, manifest updates)? Is the app-create-plus-manifest write coherent with how manifests and the enable door work today? Any way an unlisted account lands a record in the pool?
+- Cross-spec consistency and anything that would make the exit tests unable to pass or unable to fail.
+
+Output format: a findings file. For each finding: ID (G6-<round>.<n>), severity P1 (blocks build: wrong mechanism, unsafe, or exit test cannot work) / P2 (must fix in text before build) / P3 (minor), spec + section, the claim, the evidence (file:line), and a concrete fix. Then a verdict line: READY, READY AFTER FIXES, or NOT READY. Be concise; no praise; at most 15 findings, most severe first. If a prior findings file is named in the prompt, begin with a disposition table for its findings (fixed / not fixed / partly), then only NEW findings.
diff --git a/docs/superpowers/reviews/FABLE-SPOTCHECK-G6-FENCE.md b/docs/superpowers/reviews/FABLE-SPOTCHECK-G6-FENCE.md
new file mode 100644
index 000000000..fbb16bf73
--- /dev/null
+++ b/docs/superpowers/reviews/FABLE-SPOTCHECK-G6-FENCE.md
@@ -0,0 +1,43 @@
+**Verdict up front: READY AFTER FIXES** — one P1 (start race), four P2 text/mechanism fixes, two P3. The `Replica.Stop(true)` mechanism and the slice kill are sound against the code. I did not trace every activator start path; finding 1's missing-role list rests on the role list and the stop's `startDone` wait.
+
+**1. P1 — §3.2 step 3: an activator-side `e.fenced` flag cannot stop a start already in flight, and the list misses roles**
+- Evidence: the slice holds roles `run`, `gvisor-run`, `seed`, `sidecar`, `cmd`, `worker`, `tty` (`internal/instancectl/names.go:33-48`, `gen.go:65-69`). The spec names only respawn, sidecar, generation and swap (spec `:149-151`).
+- Spawns run outside `a.mu` (root RPC, then `systemctl start`), so one that passed the check before the latch can land after the slice is proven empty.
+- The unchanged stop then waits for it (`activator.go:4852-4853`) and stops it gracefully on the 20 s budget (`carlos-instance-gen@.service:43-44`). That writer runs well past `K`.
+- Fix: make the kill a root-side fence. The instance-control kill operation marks the host refused under the same lock `/start` takes, every role's start checks it, and it clears at the next acquire. Keep `e.fenced` as the fast path, list all seven roles, and add a test where a start is sent before the latch and lands after the kill.
+
+**2. P2 — §3.1 obligation queue: a same-run "W changed and L advanced" can clear a commit early**
+- Evidence: spec `:79-82` assigns `txid = L` to obligations appended in the same run. A write that lands after the capture but before the sample gets a TXID that does not contain it, and is removed when `R ≥ L`.
+- It is re-added only by the next capture, via the empty-queue rule with `t = now`, or by the next write. If capture then stalls (`db.go:2696-2715` backoff) with no further writes, the commit's age is lost. This is the G6-2.1 family in a narrow window.
+- Fix: assign a TXID only from an `L` advance seen in a strictly later run. To avoid a false trip when idle, resolve same-run obligations by WAL offset from the newest L0 header (`DB.Pos` already opens that file, `db.go:574-587`). Otherwise state the residual in the text. Add a witness for a write between capture and sample followed by a capture stall.
+
+**3. P2 — §3.1/§4/§5: the bound is 32 s plus K, not 31 s**
+- Evidence: `t` is stamped up to 1 s after the write (spec `:88-89`), and the trip needs `now − t > 30` on a 1 s tick, so it fires up to 31 s after `t`. A write at 0.01 s is sampled at 1.0 s and trips at 32.0 s.
+- The exit test's "committed between 31 s before the fence line" (spec `:252`) can fail on a correct build.
+- Fix: say 32 s in §3.1, §4 and the exit test, or trip at `≥ 29 s`.
+
+**4. P2 — §3.2 `K`: the "slice empty" return includes `ExecStopPost`, and the fake-backed `K < 2 s` test proves nothing**
+- Evidence: every unit in the slice runs `ExecStopPost=carlos instance-exit …` after the kill, in the same cgroup (`carlos-instance-gen@.service:38`, and the rootfs units likewise). The slice is populated again until those finish.
+- Real `K` is `a.mu` wait, plus the root RPC, plus systemd, plus `ExecStopPost`. Only the drill measures it.
+- Units are `Restart=no` (`:42`), so systemd does not respawn them; that part of the design holds.
+- Fix: define `K` as latch to main processes dead (writers gone) and report slice-empty separately. Drop the unit-test bound or call it a wiring test. Treat a drill `K` over 2 s as a fail.
+
+**5. P2 — §3.1: "uploads after the latch can only come from that bounded final attempt" is false, though nothing follows the marker**
+- Evidence: `Replica.Stop` stops only the replica monitor (`replica.go:118-130`). The store's compaction and snapshot monitors keep uploading until `store.Close` (`internal/lease/lease.go:459-461`, `release.go:252`).
+- `DB.Close` makes a second replica attempt through `syncReplicaWithRetry` (`db.go:786-790`).
+- All of it is inside `finalize`, so the invariant holds.
+- Fix: reword to "every upload after the latch runs inside the one finalization, before the marker", and name the three sources.
+
+**6. P3 — §3.1: a late `DB.init` can restart the monitor after the fence stopped it**
+- Evidence: `init` calls `Replica.Start(db.ctx)` (`db.go:1077`), and it can first succeed inside finalize's `SyncAndWait`. The restarted monitor can take `syncMu` on `db.ctx` and hang again.
+- Fix: set `Replica.MonitorEnabled = false` at the latch before `Stop`; `Start` then returns without starting anything (`replica.go:96-98`).
+
+**7. P3 — §3.1: no deadlock found in the stop path; record why**
+- `Stop(true)` only cancels and joins: `r.f` is never assigned in v0.5.14 (the only reference is `replica.go:124-125`), so the hard flag closes nothing.
+- The monitor exits on context at every wait and passes it to `Sync` (`replica.go:340-378`).
+- The fence goroutine holds none of `rn.mu`, `finMu` or `syncMu` while waiting. `DB.Close` calling `Stop(true)` again is harmless (`db.go:791`).
+- `DB.Pos` takes only its own cache lock (`db.go:559-561`), so a hung capture cannot block the check.
+- One finalization owner holds (`release.go:225-231`).
+- Fix: none to the mechanism. Add a line that the fence goroutine must be joined outside `finMu`, or not joined by `finalize` at all.
+
+READY AFTER FIXES
diff --git a/docs/superpowers/specs/2026-11-11-g6-pool-path-design.md b/docs/superpowers/specs/2026-11-11-g6-pool-path-design.md
new file mode 100644
index 000000000..3b24c03eb
--- /dev/null
+++ b/docs/superpowers/specs/2026-11-11-g6-pool-path-design.md
@@ -0,0 +1,247 @@
+# G6 slice 3: the pool path, born-HA apps for allowed accounts (design, rev 3, 2026-11-11)
+
+Design only. Paul approves before any build, and every user-facing string in
+§5 goes through Paul's copy review before it is written into code or docs.
+Parent: region HA spec `2026-10-26-region-ha-without-claims-design.md`
+(**RHA §n**), especially §23 (B10, born HA only in a named HA pool). Line
+citations are to `origin/main` at 01d6ca78.
+
+Rev 3 (not reviewed; the two-round budget is spent) answers Astra round 2 (`CODEX-FINDINGS-G6-R2.md`): the row's region and pool are bound at both region doors and into the manifest's `Regions` (G6-2.5); the pool-equality rule applies only to born-HA apps (G6-2.8); the idle storage row is corrected (G6-2.9).
+
+Rev 2 answers Astra round 1 (`docs/superpowers/reviews/CODEX-FINDINGS-G6-R1.md`): the HA choice is stored on the app row and the manifest is written only by the existing person-only enable door (G6-1.8, G6-1.9); the promise table matches the handover exceptions and the fence's condition (G6-1.11); the route is `/new` (G6-1.12).
+
+**Paul's rulings (2026-11-11, via 8a3d302):** the first app is a fresh create
+in pool `ha` on flagship US, with no migration; creates in the pool sit behind
+a per-account allowlist; the copy states what HA does and does not promise,
+including that an unplanned death can take up to about 15 minutes to recover
+until storage fencing exists.
+
+## 1. How a record lands in a pool today
+
+- A record's pool is never taken from a create request. The instance create
+ door stamps it from the app's manifest (`instances.json`):
+ `internal/console/apiinstances.go:1531` ("stamped from the MANIFEST ... the
+ body below has no pool field"), `:2160`.
+- Only an operator sets `Manifest.Pool`: `carlos instances enable --pool` in
+ store mode (`instances_cli.go:51`, refused when signed in). The console's
+ enable door leaves Pool untouched on update (`apiinstances.go:3592`).
+- B10 decides "born HA": `haCreate(region, pool)` (`internal/console/seedmove.go:40`),
+ true in a scoped region only when the pool is in the region's `ha_pools`
+ (`CONSOLE_HA_CAPACITY_CONFIG`, parsed in `hacapacity.go`).
+ `shouldStampHA` (`seedmove.go:63`) stamps `rec.HA`.
+- Nobody but an operator can put an account into pool `ha`, and the web UI
+ never mentions pools or HA. On the flagship the canaries (account `bab`) got
+ there by store-mode manifests.
+
+So the path needs two things: a way for an allowed account to ask for HA at
+app creation, and a gate that keeps everyone else out of the pool, whoever
+writes the manifest.
+
+## 2. The allowlist
+
+`CONSOLE_HA_POOL_ACCOUNTS`: a comma-separated list of account sqids, parsed
+and validated exactly like `CARLOS_SIDECAR_ACCOUNTS` (`cmd/console/main.go:1157-1191`,
+strict, a bad entry stops the console at start). Set by the console's drop-in;
+changing it is a console restart.
+
+One difference from the sidecar list, on purpose: **unset or empty means
+nobody**. The pool is closed by default.
+
+The gate, `haPoolAllowed(acct, region, pool)`: true unless `pool` is in the
+region's `ha_pools` (a scoped HA pool), in which case the account's sqid must
+be on the list. It is checked:
+- at every create door that can write a record into a scoped HA pool: instance
+ create, standalone sidecar create and domain-attach first route, the same
+ doors B10 lists (RHA §23), immediately after the door's authentication,
+ membership and validation and before any write, as `refuseSidecarsPaused`
+ does (`sidecarsgate.go:51-60`);
+- at the app create option (§3).
+
+Refusal: 403 with machine code `ha-pool-not-allowed` and the §5 sentence.
+Non-members still get the door's identical 404 first, so the gate never
+confirms that an account exists.
+
+Removing an account from the list stops its new records in the pool. Its
+existing records keep running and keep their HA flag (records are immutable
+in this respect, RHA §23). Operators are not exempt: the canary account `bab`
+goes on the flagship list, and an operator who writes a store-mode manifest
+with pool `ha` for an unlisted account gets the refusal at instance create.
+
+Dev's IE entry carries `ha_pools: ["hapair"]`, so the gate applies on dev
+too; the dev list names the dev canary account.
+
+## 3. The create option: a born-HA app in a region
+
+### 3.1 API and CLI
+
+The choice is stored on the app and acted on by the door that already owns
+manifests, so no new door writes standing creation policy.
+
+1. **App create.** `POST /api/cli/apps/{account}/new` (`handleAPICreateApp`,
+ `internal/console/apicli.go:411`, route `routedecls.go:489`) takes an
+ optional `"ha": true`. That route admits Publish service credentials; the
+ HA option does not. With `ha`:
+ - the caller must be a person (`apiPerson`, as the enable door,
+ `apiinstances.go:3486-3488`); a service credential gets 403 before any
+ write, and its plain creates are unchanged;
+ - `region` is required and explicit (not `@auto`), in
+ `CONSOLE_HA_REGIONS` and scoped with a non-empty `ha_pools`; otherwise
+ 400 (§5);
+ - `haPoolAllowed` must hold for the region's pool; otherwise 403 (§2);
+ - the app row is inserted as today, in the same statement with a new
+ column `ha_pool` (on the `apps` table, `store.go:828-840`, beside
+ `region`) set to the region's first `ha_pools` entry (`ha` on the
+ flagship). One insert, so there is no half-created state to resume.
+ Existing app names still answer `claimTaken` (`server.go:5337-5343`);
+ there is no path that adds `ha_pool` to an existing app (that is the
+ deferred migration).
+2. **Enable.** The existing person-only door `PUT .../{app}/instances-manifest`
+ (`handleAPIInstanceEnable`, `routedecls.go:612`) is the only writer of the
+ manifest's pool, and only on the manifest's first create (the
+ `os.ErrNotExist` branch, `apiinstances.go:3573-3576`): it sets
+ `Pool = ha_pool` from the live app row (by `AppIncarnation`, so a trashed
+ and recreated name never inherits it) after re-checking `haPoolAllowed`.
+ It also sets `Regions = [row region]`, so an instance create naming any
+ other region is refused by the manifest's existing regional restriction
+ (instance create accepts an explicit region, `apiinstances.go:1871-1888`).
+ Before writing, it re-checks that the row's region is still in
+ `CONSOLE_HA_REGIONS` with `ha_pool` in its `ha_pools`; otherwise 409.
+ For an app whose row carries `ha_pool`, an existing manifest whose pool
+ differs answers 409 and changes nothing. Apps without `ha_pool` (every
+ legacy and operator-managed app, the canaries included) keep today's
+ behaviour exactly (G6-2.8). On update, Pool stays untouched as today
+ (`apiinstances.go:3592`).
+3. **Instance creates** stamp `Pool` from the manifest and are born HA by
+ B10, with `haPoolAllowed` checked again at the create door (§2).
+4. **Region binding** (G6-2.5). An app whose row carries `ha_pool` cannot
+ change region, before or after enable: both region doors (`PUT .../region`,
+ `appregionset.go:187` and `setAppRegion`, `:314-358`, and the settings
+ form) refuse with 409 (§5 string 8) when the row has `ha_pool`, reading the
+ row, not the manifest (a missing manifest reads as unpooled,
+ `regioncandidates.go:289-294`). The check sits in `SetAppRegion`'s
+ conditional update, so a create, region change and enable racing each other
+ all see the same row.
+5. **Swap concurrency.** The swap door (`apiswap.go:67-76`) refuses a
+ concurrency above 1 for an app whose row has `ha_pool` (capacity card §3).
+
+Enable and instance create already serialise on the manifest's ETag
+(create-only and conditional writes), and the row's `ha_pool` never changes
+after insert.
+
+CLI: `carlos apps create <app> --region us --ha` (a signed-in person). Then
+`carlos instances enable` (or a first `carlos deploy`, which enables as the
+person) writes the manifest with the pool, and the default instance is born
+HA (`haCreate(us, ha)`), as the canaries showed in G5. A Publish credential
+can deploy to the app afterwards, as to any app.
+
+### 3.2 The web UI
+
+On "Create an app" (`templates/app_new.html`, `handleNewApp`,
+`server.go:5590`), when the account is allowed and at least one region it can
+pick has an HA pool:
+- below the region picker, one checkbox, "High availability", with the §5
+ explainer and a link to the docs page;
+- it is enabled only while the picked region supports HA (the picker's region
+ list gains an `ha` boolean; `regionpicker.go`); the server checks everything
+ again (§3.1);
+- the form posts `ha=1`; `handleNewApp` runs §3.1 step 1 (the web session is
+ a person) and then the enable door's create in the same request, so the app
+ is ready to deploy.
+
+App settings (`templates/app_settings.html`) shows one read-only line for an
+app whose manifest pool is a scoped HA pool: the §5 status sentence. The
+region form on that page refuses a change for such an app (409, §5): moves
+into, out of and within HA regions stay refused (N-HA4), and this makes the
+refusal say so before anything is attempted.
+
+Accounts not on the list see no change at all.
+
+### 3.3 What is not offered
+
+- Turning HA on for an existing app or instance (the migration slice, deferred).
+- Choosing a pool by name: the option picks the region's pool.
+- HA in a region without an HA pool (dev IE has one; flagship US only).
+- Another replication class: every born-HA route is stream (fence spec §3.3).
+
+## 4. What HA promises, for the copy
+
+The facts the §5 strings must state, each from a measured or specified bound:
+
+| Situation | What the app sees | Source |
+|---|---|---|
+| Normal running | the app runs on one server at a time; another server in the group can take it over | RHA §6.2, §7.1 |
+| Planned work: a release, a member replaced or removed | most requests wait a few seconds, then succeed. Some still get 503 with `Retry-After: 10` for those seconds: bodies over 64 KiB or of unknown length, requests another box already forwarded (most cross-region ones), edge-local and tunnel calls, and requests after the member starts closing connections. Keep-alive connections close, event streams reconnect, WebSockets older than 60 s close, always-on workers pause for a few minutes | `docs/region-ha-runbook.md:147-158`, RHA §25 |
+| A server dies without warning | requests get 503 with `Retry-After` until another server takes over; **up to about 15 minutes** until storage fencing exists | RHA §9.8 |
+| A server loses its storage connection while the app is writing | the app stops (503) about 30 seconds after its writes stop reaching storage; writes from the last ~35 seconds can be lost | fence spec §4 |
+| A server loses its storage connection while the app is idle | nothing is lost. The app keeps answering until its lease renewal fails (within about 5 minutes), then answers 503 with `Retry-After`. When storage returns it recovers by itself; if storage never returns to that server, an operator replaces it (paged at about 10 minutes) | RHA §6.7, §9.5, fence spec §4 |
+| A server dies | writes from about the last second can be lost | RHA §5.3 |
+| The whole region fails | not covered | out of scope |
+| Existing apps | cannot be moved into HA yet | §3.3 |
+
+## 5. Strings for copy review (drafts, not approved)
+
+These go to Paul's copy review before the build writes any of them. Drafts
+follow the house voice: plain, no em dashes.
+
+1. Checkbox label: `High availability`
+2. Checkbox explainer: `Keeps a second server in this region ready to take over this app. During releases and server maintenance most requests wait a few seconds instead of failing. If a server fails without warning, the app can be unavailable for up to 15 minutes while another server takes over.`
+3. Docs link text: `What high availability covers`
+4. Refusal, account not allowed, or a service credential asked for it (403 `ha-pool-not-allowed`): `high availability isn't available for this account yet.`
+5. Refusal, region without HA (400): `high availability isn't available in %s.` (region label, e.g. `N. Virginia (US)`)
+6. Refusal, `--ha` without an explicit region (400): `choose a region to turn on high availability.`
+7. Settings status line: `High availability is on in %s.`
+8. Region change refused for an HA app (409): `this app has high availability on, so its region can't be changed.`
+9. CLI flag help for `--ha`: `turn on high availability (needs --region; only for accounts that have it)`
+11. Swap concurrency refused for an HA app (400): `apps with high availability on swap one instance at a time.`
+10. Docs page `docs/site/high-availability.md`, short: the §4 table in prose, written with the writing pipeline after the strings above are approved, and reviewed in the same copy pass.
+
+The checkbox string (2) leaves out the storage and write-loss rows on purpose;
+the docs page carries them. Paul decides in the review whether that is the
+right split.
+
+## 6. Tests and the exit test
+
+Unit, `internal/console` (model: `ha_pool_scope_test.go` and the sidecar gate
+tests):
+- allowlist parse: strict; empty means nobody;
+- `haPoolAllowed` at each create door for a scoped pool: listed account
+ passes, unlisted gets 403 `ha-pool-not-allowed` before any bucket write,
+ non-member gets 404; legacy creates and unscoped regions unchanged;
+- app create with `ha`: person only (an allowlisted account's Publish
+ credential gets 403 and writes nothing); explicit region required;
+ unscoped region refused; `ha_pool` stored in the same insert;
+- enable: first create takes `Pool` and `Regions` from the live row; a
+ legacy app with a named pool updates exactly as today;
+- region change refused for a born-HA app before and after enable, including
+ create, region change and enable racing;
+- swap concurrency above 1 refused for a born-HA app;
+- enable: a recreated name does
+ not inherit it; an existing manifest with another pool is 409; a removed
+ account is refused at enable and at instance create;
+- web form: checkbox hidden for unlisted accounts, disabled for a non-HA
+ region, server rejects a forged `ha=1`;
+- approved-copy tests for the §5 strings once Paul approves them (the pattern of
+ `approved_region_ha_copy_test.go`).
+
+**Exit test (dev, then flagship):**
+1. An allowed account creates an app with HA in US (dev: IE, pool `hapair`) from
+ the web form, then deploys; its default instance record has `ha: true`,
+ `pool: ha`, region `us`, and it serves from a group member.
+2. An unlisted account sees no checkbox, and a forged API request gets 403;
+ a store-mode manifest with pool `ha` for it still gets 403 at instance create.
+3. A plain create in US by any account stays legacy and lands on adi-knitting,
+ exactly as before.
+
+## 7. Provider boundary
+
+Console-only and provider-neutral. The allowlist, the create option and the
+gate read console configuration and the bucket; nothing calls a cloud API. A
+self-hosted fleet with a scoped HA pool gets the same path.
+
+## 8. Open for Paul
+
+1. The env list (recommended, matching `CARLOS_SIDECAR_ACCOUNTS`) or a stored
+ per-account grant an operator approves (the objstore entitlement pattern,
+ `apistore_entitlement.go`). The env list needs a console restart per change;
+ the grant needs a table and an operator door.
+2. Whether the checkbox text (§5 string 2) names the 15-minute bound, as drafted.
diff --git a/docs/superpowers/specs/2026-11-11-g6-us-capacity-design.md b/docs/superpowers/specs/2026-11-11-g6-us-capacity-design.md
new file mode 100644
index 000000000..d2dec8ac1
--- /dev/null
+++ b/docs/superpowers/specs/2026-11-11-g6-us-capacity-design.md
@@ -0,0 +1,165 @@
+# G6 slice 1: capacity of the flagship US HA group (design, rev 3, 2026-11-11)
+
+Rev 3 (not reviewed; the two-round budget is spent) answers Astra round 2 (`CODEX-FINDINGS-G6-R2.md`): overlap is counted per app at its swap concurrency, and pool apps are held to concurrency 1 (G6-2.6); `xlarge` and the mixed-size arithmetic are corrected (G6-2.7).
+
+Rev 2 answers Astra round 1 (`docs/superpowers/reviews/CODEX-FINDINGS-G6-R1.md`): the launch template version pin and observation in §6 (G6-1.6), a drained rollback (G6-1.7), and the promote overlap counted in §3 and §5 (G6-1.10).
+
+Design only. Paul approves before any apply. Parent: region HA spec
+`2026-10-26-region-ha-without-claims-design.md` (cited **RHA §n**), the roll
+verb spec `2026-11-09-group-roll-verb-design.md` (**verb §n**), and Fable 5.2's
+G6 recommendation (`~/.cache/region-ha-next/fable52-g5g6/out.md` §3, approved by
+Paul 2026-11-11: "capacity spend per recommendation").
+
+## 1. The question
+
+The first customer app goes into pool `ha` on the flagship US group
+(`carlos-flagship-us-ha`). During a member replace (verb `replace`, RHA §25)
+the member being replaced is drained and terminated before its replacement
+serves, so with two members **one member carries the whole pool**. The same
+holds after an unplanned death until the group replaces the member. What
+size must a member be, what does it cost, and how is a change applied?
+
+## 2. What the flagship shows now (read-only, profile keymail, 2026-11-11 ~17:15Z)
+
+| Item | Value | Source |
+|---|---|---|
+| Group | 2/2/2, LT 10, both `t4g.small`, InService, Healthy | `describe-auto-scaling-groups` |
+| Member memory | `mem_total_mib` 1858; free 1459 and 1479 MiB with nothing awake (about 390 MiB baseline) | `control/edges/g-*.json` headroom |
+| Member memory under the G5 probe (canaries awake) | daily minimum `MemAvailablePercent` 61.7% and 75.1%, so the canaries take about 300 MiB at most | `Carlos/Host MemAvailablePercent`, 3 days |
+| Member CPU | hourly average 1.5-1.8%, hourly maximum 18.7-22.4%; credit mode `unlimited`; credit balance near 0 (new members start with none) | `AWS/EC2 CPUUtilization`, `CPUCreditBalance`, 3 days |
+| Disk | 20 GiB gp3; 17.4 GiB free | LT 10, edges files |
+| Pool `ha` hosts | 4, all account `bab`: `g3r-ha`, `heldwitness`, `held-1`, `held-2` (the G3/G5 canaries) | member edges files |
+| adi-knitting (fixed, not in the pool) | `t4g.small`, 59 awake, memory available falling 75% to 70% (daily average) over a week | edges file, CloudWatch |
+
+Per-instance memory ceilings are the cgroup sizes (`internal/cgroup/sizes.go:18-20`):
+`small` 256 MiB, `standard` 512 MiB (the default, `cgroup.go:105`), `large` 1 GiB,
+`xlarge` 2 GiB (`sizes.go:21`).
+`memory.max` equals `MemorySwapMax`, so an instance never exceeds its size.
+
+## 3. The rule
+
+Usable memory on a member = `mem_total` − baseline (390 MiB) − the eligibility
+floor (15% of `mem_total`, RHA §6.3, `policy.go`). Wakes are never refused
+for headroom (RHA §11), so exceeding it is not a refusal: it is OOM risk on
+the survivor while it carries everything. So:
+
+> **One member's usable memory ≥ the canaries' 300 MiB + the sum of the
+> sizes of every pool instance that may be awake at once.**
+
+Counting sizes, not observed use, is deliberate: the first app's real
+footprint is unknown, and a replace is exactly when every instance lands on
+one box.
+
+| Member type | `mem_total` (est.) | Usable | Fits besides the canaries |
+|---|---|---|---|
+| t4g.small (now) | 1858 MiB | ~1190 MiB | one `standard` app without an overlap (812); **not** with one (1324) |
+| t4g.medium | ~3800 MiB | ~2840 MiB | with each app's overlap: one `large` (2348), or two `standard` (2348); **not** one `xlarge` (4396) |
+| t4g.large | ~7750 MiB | ~6200 MiB | with each app's overlap: one `xlarge` (4396), or two `large` (4396), or five `standard` (5420) |
+
+**Promote overlap.** A promote can run an old and a new generation of the
+same app at once, each under its own memory limit
+(`internal/instancectl/gen.go:75-80`). Rollouts are scheduled per app, not
+globally (`internal/rollout/policy.go:14-15`), and an app's `SwapConcurrency`
+(`policy.go:42-43`, `scheduler.go:61-75`, settable above 1 through
+`internal/console/apiswap.go:67-76`) lets several of its instances swap at
+once. So the sum counts, for every pool app, **its instances' sizes times
+(1 + its swap concurrency)**, assuming every app promotes at once while one
+member serves. To keep that bounded, the swap door refuses a concurrency above
+1 for an app whose row carries a born-HA pool (pool path §3.1), with the
+operator text going through copy review. The figures in the table use
+concurrency 1: each app counts twice.
+
+The medium and large `mem_total` values are estimated at the small's ratio
+(91% of nominal); the first medium member's edges file gives the real number,
+and the card records it.
+
+CPU is not the constraint today: all three types have 2 vCPU, and t4g.small
+and t4g.medium earn the same 24 credits an hour (t4g.large 36). In unlimited
+mode a CPU-heavy app costs surplus credits ($0.04 per vCPU-hour) rather than
+throttling. If the first app is CPU-bound, revisit with `m7g` or `t4g.large`.
+
+## 4. Cost (us-east-1 on-demand, AWS Price List API, 730 h/month)
+
+| Shape | Instances | EBS (20 GiB gp3 at $0.08) | Per month | Change from now |
+|---|---|---|---|---|
+| 2 × t4g.small (now) | $24.53 | $3.20 | **$27.73** | — |
+| 3 × t4g.small | $36.79 | $4.80 | $41.59 | +$13.86 |
+| **2 × t4g.medium** | $49.06 | $3.20 | **$52.26** | **+$24.53** |
+| 2 × t4g.large | $98.11 | $3.20 | $101.31 | +$73.58 |
+
+The NLB, alarms and SNS are unchanged by any of these.
+
+A third small member does not help the rule in §3: it adds redundancy (two
+members serve during a replace) but not the memory one member has after an
+unplanned death during a replace, or in any one-member moment.
+
+## 5. Recommendation
+
+**2 × t4g.medium (+$24.53 a month), applied before the first app is created.**
+
+- It carries the canaries plus a first app of one `large` instance, or two
+ `standard`, each with its promote overlap (`300 + 2 × 1024 = 2348 ≤ 2840`).
+ That covers every first app up to `large`. An `xlarge` first app needs
+ t4g.large (`300 + 2 × 2048 = 4396`); the card then applies with that type
+ instead, at $101.31 a month.
+- The trigger for the next step is written down now: when the §3 sum for the
+ pool passes the medium's 2840 MiB (with every app counted twice), the next resize is due (t4g.large, or a
+ third member if the extra redundancy is wanted then).
+
+If Paul prefers to spend nothing yet: 2 × t4g.small fits a single `standard`
+first app without a promote overlap (§3: `300 + 512 = 812`; with an overlap
+`1324 > 1190`), and the card applies once a second app, a `large` app, or a
+promote while one member serves is in prospect. The cost of being wrong is OOM on the
+survivor during a replace, which is the moment G6 exists to make safe, so this
+is not the recommendation.
+
+## 6. How it is applied (a resize = add a member)
+
+The module sets `min = max = desired = box_count` (`infra/modules/region-host/group.tf:241-243`).
+`instance_type` feeds the launch template resource (`group.tf:196`), but the
+group launches the version pinned by `group_launch_template_version`
+(`group.tf:252-255`, `variables.tf:408`), so a type change only takes effect
+with a re-pin. The verb's preflight refuses unless the operator's provider
+observation matches the pinned template exactly (`internal/grouproll/engine.go:852-856`,
+`:927-932`), and an observation needs a member on that template (G5 lesson:
+"after a re-pin the verb can't run until a member exists on the new LT").
+Running members never change type in place. Per Paul's G5 ruling, a resize
+adds a member first, so at least two members serve at every step:
+
+| Step | Who | What | Expected counts / result |
+|---|---|---|---|
+| 0 | release agent | If the group's pinned version and the observation differ (every G5 roll needed this), pin back first. | 0/1/0, standing approval |
+| 1 | carloku-infrastructure PR, targeted | `instance_type = "t4g.medium"` (the template resource gains version N+1), `group_launch_template_version = N+1`, `box_count = 3`. **First-of-kind apply: needs a GO.** | 0/2/0 (template, group); the group launches one member from N+1; the two small members are untouched |
+| 2 | operator | Check the new member's type is t4g.medium (`describe-auto-scaling-groups`), wait for the lifecycle hook and its edges file, record `mem_total_mib`. Then `carlos system group probe start` against it and write the observation for template N+1. | 3 members serving; observation matches N+1 |
+| 3 | verb | `carlos system group replace --member <small A>`: drained; the replacement launches from N+1. Check its type. | holds ≤ 10 s, 0 non-2xx (G5 bar) |
+| 4 | verb | `carlos system group remove --member <small B>`: drained scale-in; the runbook's rule (at least two members remain) holds. | holds ≤ 10 s, 0 non-2xx; 2 medium members |
+| 5 | carloku-infrastructure PR | `box_count = 2` to match the live group (runbook: set `box_count` after `remove`). | 0/1/0, no instance change, standing approval |
+
+The capacity alarm fires once per launch until the damping pin (4fe12300,
+v0.34.46) reaches the flagship; that is expected noise, not a finding.
+
+Steps 1 to 5 run in one flagship window under the #421 lock, with the G5
+probe running against the canaries. The exit test: **one medium member
+carries the canaries plus a `large` heldwitness load and one promote of it
+through step 4's remove, the capacity alarm is quiet after the last launch,
+and the probe shows 0 non-2xx.**
+
+**Rollback** never lowers `box_count` while a member is undrained, because
+an apply that lowers desired starts an undrained scale-in.
+- Before step 3: pin back to version N (0/1/0; the template resource keeps
+ N+1, unused), write the observation for N, then `remove` the medium member
+ through the verb (three members, so two remain), then `box_count = 2`.
+- After step 3: roll forward.
+
+## 7. Provider boundary
+
+Instance types, launch templates, Auto Scaling sizes and EC2 prices are the
+AWS adapter (RHA §12, `infra/modules/region-host`). The rule in §3 is
+provider-neutral: a self-hosted fleet sizes each box so that one box carries
+its pool's instance sizes above the 15% floor. A deployment without AWS adds
+or retires boxes by hand and runs the verb's provider-neutral phases (verb §5.4).
+
+## 8. Open for Paul
+
+1. 2 × t4g.medium now (recommended), or stay on 2 × t4g.small until the first
+ app's size is known.
diff --git a/docs/superpowers/specs/2026-11-11-g6-write-fence-design.md b/docs/superpowers/specs/2026-11-11-g6-write-fence-design.md
new file mode 100644
index 000000000..48a3d20c9
--- /dev/null
+++ b/docs/superpowers/specs/2026-11-11-g6-write-fence-design.md
@@ -0,0 +1,325 @@
+# G6 slice 2: the minimal write fence (F-C) (design, rev 3.1, 2026-11-11)
+
+Design only. Paul approves before any build. Parent: region HA spec
+`2026-10-26-region-ha-without-claims-design.md` (**RHA §n**). Evidence:
+`~/.cache/region-ha-next/G2-FINDINGS.md` (F-C, F-A) and
+`~/.cache/region-ha-next/G2-RERUN-RESULTS.md` (drill 4 rerun, v0.34.14).
+Line citations are to `origin/main` at 01d6ca78.
+
+Rev 2 answers Astra round 1 (`docs/superpowers/reviews/CODEX-FINDINGS-G6-R1.md`): the trip condition now tracks the oldest outstanding capture and WAL changes litestream has not captured (G6-1.1, G6-1.2); a fenced holder kills its writers at once instead of draining (G6-1.5); the stop is started only from awake and the watcher ends with the replicator (G6-1.4); a fenced release cancels and joins replication before its marker (G6-1.3).
+
+**Rev 3.1** applies the Fable 5.2 spot check of §3.1-3.2 (`docs/superpowers/reviews/FABLE-SPOTCHECK-G6-FENCE.md`, READY AFTER FIXES): a root-side start fence (F1), same-run obligations resolved by WAL offset (F2), the 32 s bound (F3), `K` defined as writers dead (F4), the upload wording (F5), the monitor kept off after the latch (F6), and the join rule (F7).
+
+**Rev 3 (not reviewed; the two-round budget is spent)** answers Astra round 2 (`CODEX-FINDINGS-G6-R2.md`): an obligation queue keeps the oldest unresolved write's age through later writes and captures (G6-2.1); the fence kills the host's systemd slice through the root path, not the exec cgroup (G6-2.2); replication is stopped at the latch, outside `finMu`, and the kill runs from the watcher, so no blocked stop has to notice anything (G6-2.3); the bound now includes the latch-to-kill interval and makes no zero-acknowledgement claim (G6-2.4). The same three families drew findings in both rounds (stopping rule 2); §8 puts the choice to Paul.
+
+**Paul's ruling (2026-11-11, via 8a3d302, approving Fable 5.2 §3 decision 2):**
+a holder whose replica sync fails for about 30 s stops serving (503 with
+`Retry-After`) and releases unclean. This spec builds exactly that and nothing
+more. The late-flush redesign, storage fencing and the batched and daily
+classes in a pool stay deferred.
+
+## 1. The problem, measured
+
+| Run | Class | Acknowledged and lost | Why it stopped |
+|---|---|---|---|
+| G2 drill 4 (v0.34.7) | batched | 341 of 1109, over 340 s | lease loss after a hung renewal (F-A) |
+| G2 rerun drill 4 (v0.34.14), during the cut, before the latch | **stream** | **131 of 131** (20:35:04-20:37:14Z) | the next renewal failed its bounded attempt |
+| same | batched | 129 of 129, plus 187 from before the cut | same |
+
+The stream class is the class the pool will carry (§4). It lost every write it
+acknowledged for 130 s, because nothing reads replica health. The holder stops
+acknowledging only when a lease renewal fails, and renewals run every TTL/3,
+5 minutes at the 15-minute TTL (`internal/lease/health.go`, `lease.go:40`).
+So the stream loss window under an S3 cut is anywhere from 0 to about 5
+minutes, set by where the cut falls against the renewal. RHA §5.3 promises
+"about a second for the stream class".
+
+## 2. What already exists (verified)
+
+- **One trigger.** Every serving decision asks `servingError(e)`
+ (`internal/activator/stateless.go:226`), which returns the replicator's
+ `Err()` (`internal/lease/lease.go:539`, the renewer's latched error).
+ A non-nil answer already gives everything F-C asks for:
+ - requests answer at once with `edge.HAUnavailableResponse`: 503,
+ `Retry-After: 10`, `X-Carlos-Holder: none` (`internal/edge/haingress.go:15`,
+ via `haLeaseRefusalLocked` in `haleaseloss.go` and `serveWakeError`);
+ - the entry stops (`beginStopLocked(e, StopLeaseLost)`), and the final
+ release joins `rn.Err()` into `finishErr` (`internal/lease/release.go:254`),
+ so the marker is written `clean: false` (RHA §5.2);
+ - a marker PUT that fails is kept as an owed release and retried until it
+ lands or is answered 412 (RHA §5.2, `owed.go`).
+- **The latch is permanent.** `renewer.loseLocked` sets the error once and
+ closes `lost` (`health.go:137-142`); `checkLocked` returns it forever, and
+ the renewer's watch goroutine cancels renewals when it sees it.
+- **Litestream already tracks sync success.** `DB.LastSuccessfulSyncAt()`
+ (litestream v0.5.14 `db.go:625`) is set at the end of every successful
+ `Replica.Sync` (`replica.go:179`). `Replica.Pos()` and `DB.Pos()` give the
+ replicated and local transaction ids. A failed sync resets the replica
+ position to zero (`replica.go:139-145`). Nothing in the platform reads any of
+ them. The fence does not use `LastSuccessfulSyncAt`: a sync reads its target
+ position before uploading and stamps success after, so the timestamp can lag
+ the oldest outstanding write (G6-1.2).
+- **The stream case is known at wake.** For an HA lease with sync interval 0
+ the activator sets the 1 s WAL monitor (`internal/activator/activator.go:3335`).
+
+## 3. The change
+
+### 3.1 The fence (internal/lease)
+
+When `Held.Replicate` starts a replicator for an **HA lease in the stream
+class** (sync interval 0), it also starts a fence check that runs **every
+second** until the replicator closes. Each run reads only memory and one
+`stat`:
+
+1. `L` = `DB.Pos().TXID`, the newest transaction litestream has captured
+ locally into an LTX file (litestream `db.go:559-587`);
+2. `R` = the highest non-zero `Replica.Pos().TXID` seen so far (kept by the
+ check, because a failed sync zeroes the position, `replica.go:139-145`);
+3. `W` = the `-wal` file's size and modification time.
+
+**The obligation queue** (G6-2.1). Each run that finds `W` changed since the
+previous run appends an obligation `{t: now, txid: unknown}`. Each run that
+finds `L` advanced assigns `txid = L` to every obligation still unknown from
+**earlier** runs (frames that changed the WAL before this capture are in
+transactions up to `L`). An obligation appended in the **same** run as an `L`
+advance may hold a write made after that capture (Fable F2), so it gets
+`txid = L` only if the WAL size the `stat` saw is within the WAL range the
+newest L0 LTX file records (litestream reads that file's header for
+`DB.Pos`, `db.go:574-587`; the build confirms the header's WAL offset and
+size fields). Otherwise it waits for a later `L` advance. If the header does
+not carry the range, the build states the residual instead: a write in that
+same-run window followed by a capture stall with no further writes is not
+fenced. Obligations are removed from the front only when `R ≥ txid`. A run that
+finds `L > R` with the queue empty (captured before the first sample) appends
+`{t: now, txid: L}`. A failed `stat` appends an obligation as if `W` changed.
+
+The oldest obligation's `t` is therefore never reset by later writes, by a
+late capture, or by a slow upload: it goes only when replication proves its
+transaction is in the store. A commit not in the store changed the WAL no
+later than the run after it, so it is no older than `now − t_oldest + 1 s`. With the 1 s tick the trip fires up
+to 31 s after `t_oldest`, so the oldest lost write is at most **32 s** old at
+the fence line (Fable F3).
+
+**Trip:** if the queue is non-empty and `now − t_oldest > 30 s`: under
+`rn.mu`, `loseLocked(ErrReplicaStale)`, then (outside `rn.mu` and outside
+`finMu`) set `Replica.MonitorEnabled = false`, so a late `DB.init` cannot
+restart the monitor (`db.go:1077`, `replica.go:96-98`; Fable F6), and call
+`Replica.Stop(true)` (litestream `replica.go:118-130`), which cancels
+the monitor's context, aborts an in-flight upload and joins the monitor
+goroutine. Log once:
+`lease: <path>: a write has waited <age> to reach storage (local <L>, stored <R>); standing down (write fence)`.
+
+Stopping replication at the latch, in the lease package, is what makes a
+release that is already running unblock (G6-2.3): an ordinary `finalize`
+waiting in `SyncAndWait` behind the hung monitor sync (`release.go:225-235`,
+litestream `replica.go:134-136`) gets `syncMu` once the monitor's sync
+returns, makes its own attempt under its own release budget, fails while the
+store is down, and writes `clean: false` because `finishErr` includes
+`rn.Err()` (`release.go:254`). No second finalizer exists, so there is one
+finalization owner, as today. Every upload after the latch runs inside that one finalization, before the
+marker (Fable F5): the final `SyncAndWait` attempt, the store's compaction
+and snapshot monitors until `store.Close` (`lease.go:459-461`,
+`release.go:252`), and `DB.Close`'s `syncReplicaWithRetry`
+(`db.go:786-790`). None follows the marker.
+
+No deadlock (Fable F7): `Stop(true)` only cancels and joins (`r.f` is never
+assigned in v0.5.14); the monitor exits on its context at every wait
+(`replica.go:340-378`); the fence goroutine holds none of `rn.mu`, `finMu`
+or `syncMu` while waiting, and `finalize` never joins it (it ends with the
+replicator's `Done()`); `DB.Pos` takes only its own cache lock
+(`db.go:559-561`), so a hung capture cannot block the check.
+
+An idle instance has an empty queue, so it is never fenced; its lease renewal
+handles an outage as today. A hung upload never raises `R`, so it trips like
+an error.
+
+`ErrReplicaStale` is a new sentinel, distinct from `ErrLost`, so the journal
+and metrics tell a fence from a lost lease. No caller tests
+`errors.Is(err, lease.ErrLost)` on this path (the one `ErrLost` match in
+`internal/hostexec/rootbroker.go:795` is a different package's sentinel), so
+every existing consumer treats the fence exactly as a lost lease.
+
+The 30 s and the 1 s check are constants with a test seam, not settings.
+
+### 3.2 Stopping the writers (internal/activator)
+
+From the latch, admission refuses every new request at once through
+`servingError` (503, `Retry-After: 10`). Requests already admitted run
+`proxy.ServeHTTP` outside the admission lock (`activator.go:6565-6577`) and
+can still commit and answer until their process dies (G6-2.4). So the fence
+ends writers by killing them, from a goroutine that does not depend on the
+stop's progress:
+
+1. **The watcher.** For each awake HA stream entry the activator starts one
+ goroutine that selects on `rep.Lost()` (`lease.go:545`) and on the
+ replicator's end (a new `Done()`, closed when the replicator is finalized
+ or abandoned, so a clean hibernation ends the watcher). On `Lost()` with
+ `errors.Is(rep.Err(), ErrReplicaStale)`:
+ - under `a.mu`: if `e.rep != rep`, return; set `e.fenced = true`; if
+ `e.state == actAwake`, `beginStopLocked(e, StopFenced)`; if already
+ stopping, start nothing (`beginStopLocked` has no state guard,
+ `activator.go:3453-3467`);
+ - then, without `a.mu`, **kill the host's slice**.
+2. **The kill** (G6-2.2). HA hosts run nested (`hawake.go:149-171`): their
+ generations start through systemd in `instancectl.SliceName(host)`
+ (`genbackend.go:299-307`, `internal/instancectl/gen.go:65-72`), not in the
+ agent's `carlos-exec@<host>` cgroup that `KillHost` targets
+ (`genbackend.go:666-707`). The fence therefore asks instance control
+ (root) to SIGKILL every unit in that slice (`systemctl kill
+ --signal=SIGKILL <slice>`), all generations and roles, and returns when the
+ slice's cgroup is empty, the same proof `haHostEmpty` already reads
+ (`harelease.go:50-72`). The build adds this as one instance-control
+ operation beside the existing slice reads (`instancectl/size.go`).
+3. **No restarts, enforced by root** (Fable F1). Spawns run outside `a.mu`
+ (a root RPC, then `systemctl start`), so an activator flag cannot stop a
+ start already in flight. The instance-control kill operation therefore
+ first marks the host **fenced** under the same lock its `/start` takes,
+ then kills. Every role's start in the slice refuses while the mark is set:
+ `run`, `gvisor-run`, `seed`, `sidecar`, `cmd`, `worker`, `tty`
+ (`internal/instancectl/names.go:33-48`, `gen.go:65-69`). The mark clears at
+ the host's next lease acquire. `e.fenced` in the activator stays as the
+ fast path. Units are `Restart=no` (`carlos-instance-gen@.service:42`), so
+ systemd does not respawn them. The stop goroutine itself is unchanged: its
+ waits end because the processes are gone and replication is stopped, and
+ it then releases through the normal path (§3.1).
+
+`K` is the time from the fence line to every main process in the slice being
+dead, that is, writers gone (Fable F4). Slice-empty comes later, after each
+unit's `ExecStopPost=carlos instance-exit` (`carlos-instance-gen@.service:38`),
+and is reported separately. Only the drill measures `K`; a drill `K` over 2 s
+is a fail. The unit test with a fake instance control is a wiring test.
+
+### 3.3 Only the stream class in an HA pool (cli.go, registry)
+
+The fence covers the stream class only. The pool must therefore carry only
+the stream class:
+- `replicationRail` (`cli.go:2086`), the door for `carlos route --replication`,
+ refuses `batched` and `daily` on a route with `HA` set:
+ `route <host> has high availability on: only the stream class is allowed`
+ (operator text; copy review with the build's other strings).
+- Every route born HA by the pool path (slice 3) has the default class, `""`,
+ which is stream (`activator.go:459-467`).
+- Existing HA routes with another class keep it and are not fenced. Today these
+ are only dev's G2 fixtures `g2-batched` and `g2-daily` in pool `hapair`. The
+ build's flagship check reads the class of every pool `ha` route through
+ `carlos routes` on a member and expects none.
+- Moves into an HA region stay refused (N-HA4), so a move cannot land another
+ class on an HA route. HA wake-state import (`hawake.go:832`) carries the
+ class it was given, which by the rail above is stream for every new route.
+
+## 4. What changes for the pool, stated plainly
+
+For a stream instance on an HA box:
+
+| Event | Before | After |
+|---|---|---|
+| Box dies | about 1 s of writes lost (RHA §5.3) | unchanged |
+| Box loses the store, with writes arriving | every write acknowledged until the next renewal fails: 0 to about 5 min | at most the writes committed from 32 s before the fence line to the moment the slice is empty (`K`, about 2 s); new requests get 503 with `Retry-After: 10` from the fence line; a request admitted before it may still be acknowledged until its process dies |
+| Box loses the store, idle | nothing lost; lease renewal handles it | unchanged |
+| Store outage shorter than 30 s | nothing lost | unchanged |
+| Store outage longer than 30 s, with writes, no renewal inside it | nothing lost: the sync catches up when the store returns | **the instance is killed, and the unsynced tail (32 s + `K`) is lost** when the unclean marker lands and the instance restores from the store; the local copy is set aside as `<db>.stale` (RHA §5.3), so an operator can still recover it by hand |
+
+The last row is the price Paul's ruling accepts: a bounded loss in place of an
+unbounded one. Without the late flush (deferred), a fenced holder cannot hand
+its tail over cleanly.
+
+After the store returns, the owed unclean marker lands, and any eligible pool
+member (the old holder included) acquires and restores. The service comes back
+without a terminate, which is the drill 4 rerun's behaviour after its fault
+ended. If the box never gets the store back, RHA §9.5 is unchanged: the
+suspect-holder page at L+10 and the runbook terminate.
+
+RHA §5.5 gains one sentence: "On an HA box, a stream instance whose
+replication has fallen more than 30 seconds behind its local writes stops at
+once and releases unclean, so a storage outage loses at most about the last
+35 seconds of acknowledged writes. An instance with nothing unsynced is not
+affected."
+
+## 5. Tests and the exit test
+
+Unit (no AWS, run under `-run`), with the seam clock:
+- `internal/lease`, with `SetReplicaClientForTest` (`export_test.go:34`):
+ - a failing upload with writes trips `ErrReplicaStale` 30 s after the first
+ unreplicated capture; no writes never trips;
+ - **slow-then-hung** (G6-1.2): an upload that succeeds at 29 s for a target
+ captured at 0 s, then a hung upload while writes continue, trips 30 s after
+ the oldest write the slow upload did not cover;
+ - **continuous writes with capture blocked** (G6-2.1): SQLite commits every
+ second while capture is blocked (`L = R`); trips 30 s after the first
+ blocked write, not reset by later writes;
+ - **delayed capture then hung upload** (G6-2.1): a write at 0 s captured at
+ 29 s, then the upload hangs; trips at about 30 s, not 59 s;
+ - a failed `stat` counts as a change; the latch is permanent; the fence is
+ off for batched, daily and non-HA leases;
+ - **release already blocked** (G6-2.3): an ordinary `finalize` waiting in
+ `SyncAndWait` behind a hung upload completes within its release budget
+ after the latch; the marker is `clean: false`; no upload starts after the
+ marker PUT; a failing marker PUT is queued as owed and lands when the
+ fake store recovers; the next acquire restores and sets the local copy aside.
+- `internal/activator`, modelled on `haleaseloss_test.go` (`lossTestRep`,
+ `assertLostResponse`, `TestHALostLeaseAnswersImmediately`):
+ - `ErrReplicaStale` answers 503, `Retry-After: 10`, `X-Carlos-Holder: none`
+ with no proxy;
+ - **request versus watcher** (G6-1.4): both see the fence for one entry;
+ exactly one stop runs and one release is written;
+ - an ordinary stop already blocked in each of its waits (start-done, op
+ join, process drain) when the fence trips: the kill still runs, the stop
+ completes, no second stop starts (G6-2.3);
+ - the kill targets `SliceName(host)` with the exec cgroup absent (G6-2.2);
+ - **start in flight** (Fable F1): a start sent before the latch that
+ reaches instance control after the fence mark is refused, for each of the
+ seven roles; the mark clears at the next acquire;
+ - **same-run write** (Fable F2): a write between a capture and the sample,
+ then a capture stall with no further writes, still trips;
+ - a clean hibernation ends the watcher (no goroutine left, no stop);
+ - **latch-to-kill** (G6-2.4, wiring only): an in-flight write request and a
+ worker writing every 100 ms are killed after the latch; new requests after
+ the latch get 503.
+- `cli`: the rail refuses `batched` and `daily` on an HA route and allows them
+ on a non-HA route.
+
+**Exit test: rerun dev drill 4** (`~/.cache/region-ha-next/G2-CARD.md` drill 4,
+the fault harness with its 35-minute expiry timer), on the dev IE group, pool
+`hapair`, fixture `g2-stream` written to about once a second through both
+entries:
+1. Cut outbound 443 on the holder for 10 minutes.
+2. **Pass:** the fence line appears between t0+30 s and t0+35 s; from it every
+ request started after it gets 503 with `Retry-After: 10`, with no hangs;
+ acknowledged and lost writes (probe acks against `/ranges`) were all
+ committed between 32 s before the fence line and the writers-dead line, and
+ number at most 36 (was 131); `K` (fence line to writers dead) is under 2 s;
+ slice-empty is recorded; after the fault ends the unclean marker lands and the fixture serves
+ again within the bound of RHA §9.8; no other box takes the lease before the
+ marker or a terminate; the F-A, F-B and F-D rows of the rerun still pass.
+3. Two controls in the same window: a 20 s cut with writes (no fence, 0 lost)
+ and a 2-minute cut with the fixture idle (no fence).
+
+## 6. Provider boundary and cost
+
+Core only. The fence reads litestream's in-memory positions and one `stat`
+of the WAL per second per awake HA stream instance; it makes no request and
+adds no S3 cost. It behaves the same on MinIO or any
+S3-compatible store. A store whose uploads fall more than 30 s behind under load
+would fence spuriously; the drill's 20 s control and the dev metrics show the margin on
+AWS, and a self-hoster's store needs the same margin.
+
+## 7. Out of scope
+
+Late flush before release (the redesign F-C named), storage fencing (N-HA9),
+batched and daily classes in a pool, automatic replacement of a box that lost
+the store (RHA §9.5), and the W5 tolerance question.
+
+## 8. For Paul (stopping rule 2)
+
+The outstanding-write age, writer cessation and release cancellation drew
+findings in both Astra rounds. Rev 3 answers round 2 but is unreviewed. Options:
+
+1. **Approve rev 3 with a one-pass spot check of §3.1-§3.2 by Fable** before
+ the build (the held-floor-capability precedent), then the drill decides.
+ Recommended: the mechanism is now small (a queue, a stop call, a slice
+ kill), and drill 4 measures the bound directly.
+2. **Cut the precision:** keep §3 but state the bound only as measured by the
+ drill, not derived, and drop the capture-stall half (a stalled capture is
+ a local-disk fault, not the S3 loss F-C was about).
+
+**2026-11-11 (8a3d302):** option 1 taken. Fable 5.2 spot check: READY AFTER FIXES (1 P1, 4 P2, 2 P3); all applied in rev 3.1. The build still waits for Paul's rulings.