carlos / platform Public

Fleet public routes: implementation plan (16 tasks)

Copy deck first; the binding hole and SetFleetBoxIf next; the forward
kind, its shape and the writer guard; the edge, request policy and
publication; the readers that must skip a forward row (root egress
included); the release floor and the fleet-create barrier; the forward
phase, dormant until the hub is armed; the console; switch-on with the
comparative request budget; the production-wired witness; census and
merge; live on dev.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Paul Campbell pushed by claude agent, operated by paul@keymail.dev 35b4c29b88f537d77488349a2cbaff3455b2570e parent 06b4d79
1 file changed, +434 −0
  • docs/superpowers/plans/2026-10-30-fleet-public-routes.md +434 −0
diff --git a/docs/superpowers/plans/2026-10-30-fleet-public-routes.md b/docs/superpowers/plans/2026-10-30-fleet-public-routes.md
new file mode 100644
index 000000000..fe9990af0
--- /dev/null
+++ b/docs/superpowers/plans/2026-10-30-fleet-public-routes.md
@@ -0,0 +1,434 @@
+# Fleet public routes Implementation Plan
+
+> **For agentic workers:** REQUIRED SUB-SKILL: Use superpowers:subagent-driven-development (recommended) or superpowers:executing-plans to implement this plan task-by-task. Steps use checkbox (`- [ ]`) syntax for tracking.
+
+**Goal:** An app placed on a customer fleet serves at its public URL through the hub (the console's box) with no hand-written route: `curl -sI https://shop.bab.dev.oncarlos.com/up` answers 200 with one `X-Carlos-Version: v1`.
+
+**Architecture:** The hub's instance pass gives each fleet-placed record whose fleet the hub's own `fleets` table gives to the record's account a `forward` row: a new registry kind with one exhaustive persisted shape, written only by `PutForward`/`DeleteForward`/`SetFleetBoxIf`, and refused by every other registry writer. The edge serves an eligible forward row only through the existing `fleetProxy`, and the edges file publishes exactly what the edge serves, by one predicate. The hub enforces the app's rate limit and plan throttle and does no gate or cache work for it; the fleet edge owns the gate. A release floor keeps a channel from moving below the first release that writes forward rows while fleets exist.
+
+**Tech Stack:** Go; registry SQLite (`internal/registry`); the edge and its tunnel hub (`internal/edge`); the agent passes (`internal/host`, `internal/provision`, `internal/domains`); the console (`internal/console`); signed system pointers (`internal/release`).
+
+**Status:** draft, for Astra plan review round 1 of 3.
+
+**Spec:** `docs/superpowers/specs/2026-10-29-fleet-public-routes-design.md`, rev 4, APPROVED by Paul 2026-10-30 (recorded on amadan #457). Read §4.2 (the shape and the writer rule), §4.3 (the forward phase), §4.4 (the predicate) and §9 (the floor) before any task. Every section number below is the spec's.
+
+## Global Constraints
+
+- Forward row (§4.2), four classes, every persisted `registry.Route` and `ClaimOwnership` column in exactly one:
+ - declared, written only by `PutForward`: `Host`; `Kind` = `"forward"` (`registry.KindForward`); `Slug`; `App`; `Account`; `Region` = `fleet/<f>`; `Channel` (display only); `RateLimit` = `rec.RateLimitColumn()`; `Status` = `"ready"`; `Provisioned` = true; `CreatedAt` (kept from the existing row, else now);
+ - binding: `FleetBox`, written only by `SetFleetBoxIf`; `PutForward` keeps it while `Region` is unchanged and clears it when `Region` changes;
+ - observational, preserved by `PutForward`, read by no dispatch, publication or eligibility decision: `DNSStatus`, `DNSCheckedAt`, `CertExpiresAt`;
+ - forbidden, zero, checked one by one by `InertForward`: `Socket`, `Addr`, `Addrs`, `Health`, `HoldOp`, `Incarnation`, `ServingSeq`, `SeedSource`, `ImportGate`, `AssetsOff`, `AssetGen`, `LastError`, `DBPath`, `Version`, `PrevVersion`, `GoodVersion`, `GoodDigest`, `GoodDemand`, `ServingVersion`, `Pool`, `Environment`, `Tunnel`, `Caps`, `Hibernate`, `HA`, `Runtime`, `Gate`, `Canary`, `Replication`, `NextDue`, `StatusNamed`, `Backing`, `Unit`, `Platform`, `Seed`, `Args`, `IdleSeconds`, `MaxRunSeconds`, `Steering`, `UpdateSettings`, `EgressAllow`, `Size`, `PolicyExpiresAt`, `BuildState`, `Replicas`, `Replica`, `ClaimIncarnation`, `ClaimStamp`, `ClaimOwner`, `ClaimRowID`.
+- Writer rule (§4.2, R3-1): refuse forward inputs before transactional side effects, guard the route writes. Only `PutForward`, `DeleteForward`, `SetFleetBoxIf`, `SetDNSStatus` and `SetCertExpiresAt` may write a forward row. Every other `routes` statement carries `kind <> 'forward'`; an insert or upsert over a forward host returns `ErrForwardRow`.
+- Hub: a box with `CARLOS_TUNNEL_HOST` set and `CARLOS_FLEET` unset (`hubArmed`). Only a hub mints forward rows or runs the bindings pass; every other box retires any it holds.
+- Tenancy (§4.4): a forward row is eligible only on a hub, inert, fleet-placed, its fleet in the hub's `fleets` table, and its raw `Account` non-empty and equal to the fleet's owner. A non-forward fleet-placed row taking the fleet arm: an empty raw `Account` is served and logged; otherwise `release.RouteAccount(rt)` must equal the owner. Raw field checked before `RouteAccount`.
+- Floor (§9): `release.FleetForwardFloor` (a `SemVer`, numbered at the cut; this plan sets `v0.32.0` and Task 13 re-pins it if the cut differs), `release.FleetForwardFloorAllows(installed, candidate string) bool`, override flag `--allow-below-fleet-forward-floor` (`release.FleetForwardFloorOverrideFlag`) on `carlos system update` and `carlos system rollback`, pointer field `SystemPointer.AllowBelowFleetForwardFloor` (signed, boxes never read it). Condition: `ListFleets` non-empty. A first publication below the floor is refused while a fleet exists. Judged in `systemFloorSnapshot` (not-found branch included) and again under `fleetFloorMu` in `fleetFloorPublish`, taken before `regionalMu`.
+- Request budget (§6), per box per day with nothing changing: hub + `A x P` trash-marker GETs (marker only, no manifest, seed or policy); telemetry `<= 2 x 48 x A` (index armed); plans + `C` per pass; alias pass + `K x Pa` instance-prefix LISTs and about `2 x D x Pa` lifetime GETs; retention, build states, canary status, domains: unchanged (forward rows skipped); bindings pass on the hub only, saving `(N - 1) x 262 x (1 + F + B)`; edges file one PUT per forward row appearing or going; console floor and barrier: none in steady state. No new timer anywhere.
+- No cloud API, no DNS change, no new bucket object, no new bucket polling.
+- Copy: every user-facing string is a row of `docs/superpowers/plans/2026-10-30-fleet-public-routes-copy.md` (ids `FPR-C01` on), approved before a task writes it, gated by `approved_fleet_routes_copy_test.go`. The task that writes a row adds its id to `fleetRoutesCopyBuilt` in the same commit. No em dashes. Lower case after a full stop. Diagnostics and log lines are not copy, except the override log line (C04), which is.
+- Names in tests and docs: app `shop`, account `bab` (and `k3x` for a second account), fleets `home` and `away`, boxes `box-1` and `box-2`, hosts under `example.com`. Never a tenant's name.
+- Tests: touched packages only, with `-run`, under `nice -n 19`, sandbox off for the Go cache (`dangerouslyDisableSandbox`), `GOCACHE` at its default. Socket and tunnel tests: `TMPDIR=/tmp/g`. Never `make test` locally; CI runs the full suite. Every new test is shown failing first; every security or ownership test also shows the mutation that makes it fail. Before each commit: `go build ./... && go vet <pkgs> && gofmt -l <files>` empty, and `GOOS=darwin go build ./... && GOOS=windows go build ./... && GOOS=linux GOARCH=arm64 go build ./...`.
+- Census (AGENTS.md "The census"): a task that changes a declaration in the root binary runs `make census-card` (sandbox off) after its tests pass and reconciles every unit the card shows against spec §7. A unit the card shows that §7 does not list, or the reverse, is written into spec §7 with its reason in the same commit. The overlay is proposed once, in Task 14.
+- Amadan: at execution start, one `amadan task add carlos/platform -branch design-fleet-public-routes -title "<Task N: title>"` per task below plus "Whole-branch review" and "Census verdict on #280"; `amadan task advance` to Started at dispatch and Done at review clean; fix rounds go in the title.
+- Stopping rules (AGENTS.md): per-task Astra review only for Tasks 1, 3, 4, 7, 8 and 9 (security gate, root, tenancy); the rest ride the whole-branch review. Three rounds per review.
+- Commits end with `Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>`. No push to GitHub; the branch lives on amadan.
+
+## Review Focus
+
+1. A host already held by another row (railsdemo's hand row on sophie): the forward phase must leave it byte for byte, log it once per pass, and `instances list` must say why the app is not reachable. Tests in Task 10 (`TestForwardPhaseLeavesAHeldHostAndReportsIt`) and Task 11 (`TestInstanceListNamesTheHeldHost`).
+2. A browser login form posted to a gated fleet app through the hub: the body must arrive at the fleet edge byte for byte with a true `Content-Length`, right and wrong password alike. Test in Task 4 (`TestForwardLoginBodyReachesTheFleetEdge`).
+3. A trashed app flagged production, or an unreadable trash marker: the forward row must stay; only a confirmed, non-production trash retires it. Test in Task 10 (`TestForwardPhaseTrashDecisions`).
+4. A system channel with no pointer yet, whose first publication is below the floor while a fleet is being created: whichever lands first, the other is refused. Test in Task 9 (`TestFleetFloorInterleavings`).
+5. A fleet app moved to another fleet of the same account while a binding from the old fleet's box is in flight: the old binding must change nothing. Test in Task 1 (`TestStaleBindingCannotStampTheNewPlacement`).
+
+## Plan rulings (choices the spec leaves open, with cost if wrong)
+
+- P-1. The floor's version: `v0.32.0`, the next minor after v0.31.0 (live on dev). Task 13's release step re-pins it if the cut is numbered otherwise. Cost if wrong: one constant and its pinning test.
+- P-2. The override's "CLI warning" (§9) is the console's override log line, as the regional floor's RD-31 is (`regionalfloor.go:44`); the CLI shows the flag's help (C05). The CLI prints nothing extra. Cost if wrong: one more row and two print sites in `system.go`.
+- P-3. The held-host REASON (§4.3 step 4) is computed by the console from its own registry (the hub's), not reported by the box: a fleet-placed record whose host has a local non-forward row. No new report object. Cost if wrong: none for single-hub deployments, which is every deployment.
+
+---
+
+## File structure
+
+| path | responsibility |
+|---|---|
+| `internal/registry/forward.go` (new) | `KindForward`, `IsForward`, `InertForward`, `ErrForwardRow`, `ErrHostHeld`, `PutForward`, `DeleteForward`, `SetFleetBoxIf`, `forwardShape` (the class table the tests read) |
+| `internal/registry/registry.go`, `routecas.go`, `claimhold.go`, `claimrows.go`, `coldhandover.go`, `recoveryhandover.go`, `importjournal.go`, `aliassocket.go` | the writer guard (§4.2 inventory) |
+| `internal/registry/remote_dispatch.go` | the three new remote cases; `SetFleetBox` gone |
+| `internal/host/hub.go` (new) | `hubArmed`, `hubFleetOwners` |
+| `internal/host/fleetbind.go` | key check, `SetFleetBoxIf` |
+| `internal/edge/fleetforward.go` (new) | `FleetServeEligible` |
+| `internal/edge/edge.go`, `ratelimit.go`, `planthrottle.go`, `assetcatch.go` | dispatch, login branch, caches, request policy |
+| `internal/host/edgesfile.go` | publication by the predicate |
+| `internal/host/egress_source.go`, `retention.go`, `agent.go`, `plans_pass.go`; `internal/domains/reconcile.go` | readers that skip or admit forward rows |
+| `internal/release/layoutintent.go`, `systempointer.go` | the floor and its signed override |
+| `internal/console/fleetfloor.go` (new) | `fleetForwardFloorJudge`, `fleetFloorPublish`, `fleetCreateFloorRefusal`, the floor rows |
+| `internal/console/rootfsfloor.go`, `hostactivation.go`, `apisystemupdate.go`, `server.go`, `fleets.go`, `apiinstances.go` | wiring, barrier, `placeAppTarget`, instance health and REASON |
+| `system.go`, `cli.go` | the flag; the forward-host refusal |
+| `internal/provision/forward.go` (new), `reconcile.go` | the forward phase |
+| `fleet_public_routes_e2e_test.go` (new, root package) | the production-wired witness |
+| `docs/superpowers/plans/2026-10-30-fleet-public-routes-copy.md`, `approved_fleet_routes_copy_test.go` (new) | the copy deck and its gate |
+
+## Task order, and why the feature stays dormant
+
+Forward rows exist only once the hub's pass is given `FleetOwners` (Task 12). Until then every task changes readers and writers of a row kind nothing creates, so `main` stays buildable and behaves as today, with two deliberate exceptions that are fixes in their own right: Task 1 closes the binding hole, and Task 4's tenancy check refuses a hand row whose account is not its fleet's owner (Q4). The floor (Tasks 8, 9) lands before Task 12, so no build that mints a forward row lacks it. The whole branch merges as one squash commit.
+
+---
+
+### Task 0: Copy deck
+
+**Files:**
+- Create: `docs/superpowers/plans/2026-10-30-fleet-public-routes-copy.md`
+- Create: `approved_fleet_routes_copy_test.go`
+
+**Interfaces:**
+- Produces: ids `FPR-C01` to `FPR-C08`; `fleetRoutesCopyBuilt []string` (empty), extended by Tasks 3, 8, 9, 11.
+
+- [ ] **Step 1: Write the deck**, columns id, file, text, status, every row `pending`, placeholders as Go verbs. Draft text (copy review settles words):
+
+| id | file | text |
+|---|---|---|
+| FPR-C01 | cli.go (`carlos add`, `route`, `remove` on a forward host) | %s is app %s on fleet %s. its route follows the app's instance record, so change the app instead: carlos apps place or carlos instances delete |
+| FPR-C02 | internal/console/fleetfloor.go (409, a channel move across the floor) | %s runs %s. this deployment has a customer fleet, so it must run %s or later. %s is not one. to move the channel there anyway, pass --allow-below-fleet-forward-floor |
+| FPR-C03 | internal/console/fleetfloor.go (409, a first publication below the floor) | %s has no release yet. this deployment has a customer fleet, so its first release must be %s or later. %s is not one. to publish it anyway, pass --allow-below-fleet-forward-floor |
+| FPR-C04 | internal/console/fleetfloor.go (console log on the override) | moving to %s below %s on %s with --allow-below-fleet-forward-floor: the hub keeps serving fleet apps it can no longer retire. remove their routes first |
+| FPR-C05 | internal/release/layoutintent.go (`FleetForwardFloorOverrideUsage`, flag help) | allow a release below %s while customer fleets exist. a hub on that release keeps serving fleet apps it can no longer retire |
+| FPR-C06 | internal/console/fleets.go (409, fleet create while a channel is below the floor) | this deployment's %s channel is on %s, below %s. new fleets wait until every channel is on %s or later. try again after the deployment's next update |
+| FPR-C07 | internal/console/fleets.go (503, fleet create when a channel pointer cannot be read) | could not check this deployment's release channels. try again in a minute |
+| FPR-C08 | internal/console/apiinstances.go (REASON, a fleet-placed instance whose host another route holds) | another route on the router holds this name, so requests do not reach fleet %s. the deployment's operator can remove that route |
+
+ C05 is a `const` and cannot format: the floor is written into the text at build time, as RD-32 writes `v0.31.0` (`layoutintent.go:296`); the deck keeps `%s` and Task 8 checks the applied text against `"v"+FleetForwardFloor.String()`.
+- [ ] **Step 2: Write the gate** by copying `approved_fleet_secrets_copy_test.go` with this deck's path, `fleetRoutesCopyIDPattern = ^FPR-C(0[1-9]|[1-9][0-9]{1,2})$`, the eight ids and an empty built list: `TestFleetRoutesCopyRecordIsComplete`, `TestFleetRoutesCopyHasNoEmDash`, `TestFleetRoutesCopyBuiltIsApproved`, `TestFleetRoutesCopyBuiltIsApplied`.
+- [ ] **Step 3: Run** `nice -n 19 go test . -run 'TestFleetRoutesCopy' -count=1`. Expected: PASS (eight pending rows, nothing built).
+- [ ] **Step 4: Copy review.** The controller sends the deck through `copy-review` (a Luna pass by delegation is acceptable for eight rows). Rows return `approved` with their final text; no later task writes a row before then.
+- [ ] **Step 5: Commit** deck and gate.
+
+### Task 1: Bindings bind only their own fleet, at write time (pre-existing hole)
+
+**Files:**
+- Create: `internal/registry/forward.go` (this task adds only `SetFleetBoxIf`), `internal/registry/fleetbox_if_test.go`, `internal/host/hub.go`
+- Modify: `internal/registry/registry.go:2750-2775` (remove `SetFleetBox`), `internal/registry/remote_dispatch.go:293` and its request fields, `internal/host/fleetbind.go:210-270`, `internal/host/agent.go:3860-3898` (`instancesLoop`), `internal/edge/fleetapi_e2e_test.go`
+
+**Interfaces:**
+- Produces:
+ - `func (r *Registry) SetFleetBoxIf(host, fleet, label string) (bool, error)`: one statement, §4.5 step 2's SQL (`WHERE host = ? AND region = 'fleet/' || ? AND kind <> 'sidecar' AND EXISTS (SELECT 1 FROM fleet_boxes WHERE fleet = ? AND label = ? AND status = 'active')`); returns whether a row changed; no row is not an error. Remote case `"SetFleetBoxIf"`.
+ - `func hubArmed(getenv func(string) string) bool`: `CARLOS_TUNNEL_HOST` non-empty after `TrimSpace` and `CARLOS_FLEET` empty.
+ - `func ReconcileFleetBindings(ctx context.Context, s release.Store, reg *registry.Registry) error` keeps its signature; applies a binding only when `key == fleetBindingKey(b.Fleet, b.Host)`, then calls `SetFleetBoxIf(b.Host, b.Fleet, b.Box)`. Its existing pre-checks stay as a filter.
+ - `instancesLoop` runs it only when `hubArmed(os.Getenv)`.
+- Test seam: `var bindingsAfterChecks func(host string)` in `fleetbind.go`, nil in production, called between the pre-checks and `SetFleetBoxIf`.
+
+- [ ] **Step 1: Write failing tests.**
+ - `internal/registry`: `TestSetFleetBoxIfBindsPlacementKindAndMembership`: fleets `home` (boxes `box-1` active, `box-2` detached) and `away` (`box-1` active); a row `shop.example.com` placed `fleet/home`. `SetFleetBoxIf(host, "home", "box-1")` = true and the row reads `box-1`; `(host, "away", "box-1")` = false; `(host, "home", "box-2")` = false; `(host, "home", "box-9")` = false; a sidecar row placed `fleet/home`: false; unknown host: `false, nil`. `TestSetFleetBoxIfOverRemote`: the same first two cases through the remote fixture the fleet remote tests use.
+ - `internal/host`: `TestHubArmed`: table over the two variables (`"tunnel.example.com"`/`""` -> true; set/`"home"` -> false; `""`/`""` -> false; `" "`/`""` -> false).
+ - `internal/edge/fleetapi_e2e_test.go` (package `edge_test`, `newFleetDoorWorld`, `fapiStore`): `TestForgedBindingsChangeNothing`: account `bab` owns `home`, `k3x` owns `away`; `away`'s `box-1` PUTs through its door `fleets/away/bindings/<home's host>.json` naming fleet `home`, box `box-1`, and `fleets/away/bindings/<away's host>.json` naming box `box-7`; `host.ReconcileFleetBindings` leaves both rows' `FleetBox` empty. `TestStaleBindingCannotStampTheNewPlacement`: `bab` owns `home` and `away`; `home`'s `box-1` PUTs a correct binding; `bindingsAfterChecks` moves the row to `fleet/away` (as `PutForward` will, here with `SetPlacement` and `FleetBox` cleared) and returns; the stored row's `FleetBox` is empty after the pass.
+ - Mutations to show: compare against the body's fleet instead of the key (forged test fails); use the old `UPDATE ... WHERE host` (stale test fails).
+- [ ] **Step 2: Run** `TMPDIR=/tmp/g nice -n 19 go test ./internal/registry/ ./internal/host/ ./internal/edge/ -run 'TestSetFleetBoxIf|TestHubArmed|TestForgedBindingsChangeNothing|TestStaleBindingCannotStampTheNewPlacement|TestReconcileFleetBindings|TestFleetBoxConvergesWithoutBucketCredentials' -count=1`. Expected: FAIL on the new tests (undefined `SetFleetBoxIf`, `hubArmed`).
+- [ ] **Step 3: Implement** as the Interfaces block says.
+- [ ] **Step 4: Run** the Step 2 command. Expected: PASS, the existing `TestReconcileFleetBindings*` and `TestFleetBoxConvergesWithoutBucketCredentials` included.
+- [ ] **Step 5: Census.** `make census-card`; expect `ReconcileFleetBindings` (body), `SetFleetBox` (removed), `SetFleetBoxIf` (new, if the card sees a site), `dispatchRemote`, `instancesLoop`, `hubArmed`; reconcile with §7.
+- [ ] **Step 6: Commit.**
+
+### Task 2: The forward kind and its persisted shape
+
+**Files:**
+- Modify: `internal/registry/forward.go`
+- Create: `internal/registry/forward_test.go`
+- Modify: `internal/registry/remote_dispatch.go` (two cases)
+
+**Interfaces:**
+- Produces:
+ - `const KindForward = "forward"`; `func (t Route) IsForward() bool`.
+ - `func (t Route) InertForward() bool`: `IsForward()` and every forbidden column of Global Constraints zero.
+ - `var ErrForwardRow = errors.New("registry: the host is a forward row")`; `var ErrHostHeld = errors.New("registry: another row holds the host")`, both appended to `remoteErrors` (`internal/registry/remote.go:17`) after the existing entries.
+ - `func (r *Registry) PutForward(rt Route) error`: refuses `rt` that is not `IsForward()` with an error; one transaction; an existing non-forward row: `ErrHostHeld`, nothing written; else the declared columns from `rt`, the observational ones and `CreatedAt` kept, `FleetBox` kept iff `Region` unchanged, every forbidden column written zero.
+ - `func (r *Registry) DeleteForward(host string) (bool, error)`: `DELETE FROM routes WHERE host = ? AND kind = 'forward'`.
+ - `var forwardShape = map[string]string{...}`: every persisted `Route` field name (and `ClaimOwnership`'s) to `"declared" | "binding" | "observational" | "forbidden"`, the Global Constraints table verbatim. `WakeIncarnation` is not persisted and not listed.
+
+- [ ] **Step 1: Write failing tests.**
+ - `TestForwardShapeClassesEveryField`: reflect over `registry.Route` (descending into the embedded `ClaimOwnership`), skip fields tagged `json:"-"`; every field is a key of `forwardShape`, and every key is a field.
+ - `TestInertForwardChecksEachForbiddenField`: for each `forbidden` field, a copy of a valid forward row with only that field set to a non-zero value of its type: `InertForward()` false. A valid row: true. A non-forward row: false.
+ - `TestPutForwardWritesTheExactShape`: put over a forward row that already carries (written by raw SQL in the test) `tunnel='t1'`, `caps='x'`, `unit='u.service'`, `seed='s'`, `dns_status='pointing'`, `cert_expires_at=5`, `fleet_box='box-1'`; read back: forbidden zero, `DNSStatus`/`CertExpiresAt` kept, `FleetBox` kept; a second put with `Region` `fleet/away`: `FleetBox` empty.
+ - `TestPutForwardRefusesAHeldHost`: an instance row at the host: `errors.Is(err, ErrHostHeld)`, the row unchanged (compare `Get` before and after).
+ - `TestDeleteForwardLeavesOtherRows`: a hand row: `false, nil`, row present; a forward row: `true`.
+ - `TestForwardCallsOverRemote`: `PutForward`, `DeleteForward` through the remote fixture; `ErrHostHeld` survives `errors.Is`.
+- [ ] **Step 2: Run** `nice -n 19 go test ./internal/registry/ -run 'TestForwardShape|TestInertForward|TestPutForward|TestDeleteForward|TestForwardCalls' -count=1`. Expected: FAIL (undefined).
+- [ ] **Step 3: Implement.** `PutForward` is one `INSERT ... ON CONFLICT(host) DO UPDATE ... WHERE routes.kind = 'forward'` naming every column, preceded in the same transaction by a `SELECT kind FROM routes WHERE host = ?` that returns `ErrHostHeld` for a non-forward row.
+- [ ] **Step 4: Run** Step 2. Expected: PASS. Show the mutation: drop one forbidden field from `InertForward`; `TestInertForwardChecksEachForbiddenField` fails naming it.
+- [ ] **Step 5: Census** (`make census-card`, reconcile `IsForward`, `InertForward`, `PutForward`, `DeleteForward`, `dispatchRemote`).
+- [ ] **Step 6: Commit.**
+
+### Task 3: Every other writer refuses a forward row
+
+**Files:**
+- Modify: the eight files of §4.2's inventory table (`registry.go`, `routecas.go`, `claimhold.go`, `claimrows.go`, `coldhandover.go`, `recoveryhandover.go`, `importjournal.go`, `aliassocket.go`); `cli.go` (`runAdd` :197, `runRemove` :471, `runRoute` :709)
+- Create: `internal/registry/forward_writers_test.go`, `forward_cli_test.go` (root package)
+- Modify: `approved_fleet_routes_copy_test.go` (`fleetRoutesCopyBuilt` += `FPR-C01`)
+
+**Interfaces:**
+- Consumes: Task 2's `KindForward`, `ErrForwardRow`.
+- Produces: every writer of §4.2's inventory obeys the writer rule. A writer taking a `Route` or claim row of kind forward returns `ErrForwardRow` before any write; a transactional writer reads the target host's `kind` first inside its transaction and returns `ErrForwardRow` before its first write (`SwapForImport` before its journal row, `RetireClaimRows` before `claim_row_retirements`); every `routes` statement carries `kind <> 'forward'`. `SetDNSStatus`, `SetCertExpiresAt` unchanged.
+- `cli.go`: on `errors.Is(err, registry.ErrForwardRow)`, or a `Get` showing `IsForward()` before the write, print FPR-C01 (`host`, `rt.App`, the fleet from `registry.FleetPlacement(rt.Region)`) and exit 1.
+
+- [ ] **Step 1: Write failing tests.**
+ - `TestEveryRouteWriterRefusesAForwardRow`: one table, one entry per writer of §4.2's inventory (each exported writer, and the unexported `upsertRoute`, `insertRouteTx`, `carryAliasesTx` through the exported writer that calls them), each called on a seeded forward row with arguments that would change it. Assertions per entry: the row read back equals the seeded row (`reflect.DeepEqual` on `Get`); the writer returned `ErrForwardRow` or reported no change; for the transactional writers, `import_journal`, `claim_row_retirements` and the timers table have the same row count before and after. Separately `SetDNSStatus` and `SetCertExpiresAt` do stamp it.
+ - `TestRouteWriterInventoryIsComplete`: parse `internal/registry/*.go` (not tests) with `go/ast`; every function containing a string literal with `UPDATE routes`, `DELETE FROM routes`, `INSERT INTO routes`, or the `DELETE FROM `+table pattern of `RetireClaimRows`, is a name in the first test's table or in the five exceptions. A writer added later fails here until it is classed.
+ - `TestForwardHostRefusedByTheCLI` (root package, `carlosTestEnv`, scratch `cmd.Dir`): `carlos add`, `carlos route -host <h> -channel x`, `carlos remove <h>` against a registry holding a forward row print FPR-C01 and exit 1; the row is unchanged.
+- [ ] **Step 2: Run** `nice -n 19 go test ./internal/registry/ -run 'TestEveryRouteWriter|TestRouteWriterInventory' -count=1` and `nice -n 19 go test . -run 'TestForwardHostRefusedByTheCLI|TestFleetRoutesCopy' -count=1`. Expected: FAIL.
+- [ ] **Step 3: Implement** the guard, writer by writer, and the CLI mapping (FPR-C01 approved; id added to `fleetRoutesCopyBuilt`).
+- [ ] **Step 4: Run** Step 2, plus the registry's existing writer tests by package (`-run 'Hold|Import|Claim|Alias|Upsert|Delete|Set'`). Expected: PASS. Show the mutation: remove the guard from `InstallLifetimeIf`; the table test fails on it.
+- [ ] **Step 5: Census.** Expect every changed writer with read sites (spec §7's R3-3 list) and `runAdd`, `runRemove`, `runRoute`; reconcile.
+- [ ] **Step 6: Commit.**
+
+### Task 4: The edge serves a forward row through the tunnel and does no gate or cache work for it
+
+**Files:**
+- Create: `internal/edge/fleetforward.go`, `internal/edge/fleetforward_test.go`
+- Modify: `internal/edge/edge.go` (`Reload` :718-1134; `ServeHTTP` :1798, :2083), `internal/edge/assetcatch.go:256-275`
+
+**Interfaces:**
+- Consumes: Task 2's `IsForward`, `InertForward`.
+- Produces:
+ - `func FleetServeEligible(rt registry.Route, hub bool, owners map[string]string) (ok bool, why string)`: §4.4's rule, exactly; `why` is a log fragment.
+ - `Reload` reads `ListFleets` (and `FleetChannelAuth`) before the routes loop when `e.tunnels != nil`, builds `owners`, and: a new first dispatch case for `t.IsForward()` (eligible: `fleetProxy`, `viaTunnel`; not: no map entry, throttled log); the existing fleet case asks the predicate (refused: no map entry). Path rows whose host is a forward row are not folded.
+ - `ServeHTTP`: `loginPost := r.Method == http.MethodPost && r.URL.Path == gate.LoginPath && !up.route.IsForward()`; `cacheable` gains `&& !up.route.IsForward()`.
+ - `localAssetCatch` returns false for `up.route.IsForward()`.
+ - Test fixture (package `edge`, `fleetforward_test.go`), reused by Task 5: `func forwardHubAndBox(t *testing.T, hubRows, boxRows []registry.Route, boxHandler http.Handler) (hubURL string, hub, box *Edge)`: a hub `Edge` on its own registry with fleet `home` of `bab` and box `box-1` (`UpsertFleet`, `AddFleetBox`), forward rows seeded with `PutForward` (not `Upsert`, which refuses them after Task 3), tunnels enabled as `fleetTestEdge` does (`fleet_route_test.go:39`); a box `Edge` on a second registry holding `boxRows`, dialed in as `home/box-1` by `startFakeRemoteHost` (`tunnel_e2e_test.go:190`, the real `tunnelclient` loop) serving the box `Edge` itself, or `boxHandler` when non-nil. `fleetTestEdge`'s `acme`/`amadan` names are not reused.
+
+- [ ] **Step 1: Write failing tests** (`fleetforward_test.go`, on `forwardHubAndBox`):
+ - `TestFleetServeEligible`: table. Forward rows: hub off -> false; owner match -> true; owner mismatch, unknown fleet, empty raw account, one stray forbidden field -> false. Hand rows (`Kind` instance, placed `fleet/home`): empty raw account -> true; `Account "k3x"` with owner `bab` -> false; `Account "!!"` (invalid, `RouteAccount` gives `OpsAccount`) -> false.
+ - `TestReloadServesOnlyEligibleForwardRows`: owners `home`->`bab`; forward rows `a.example.com` (`bab`), `b.example.com` (`k3x`), `c.example.com` (`bab`, `Tunnel "t1"`): `Allowed(a)` true, `Allowed(b)` and `Allowed(c)` false; a request to `c` never reaches a tunnel named `t1` (a static client `t1` registered in the test records nothing).
+ - `TestForwardResponseCarriesTheBoxVersionOnce`: the box handler sets `X-Carlos-Version: v1`; through the hub, `resp.Header.Values("X-Carlos-Version")` equals `[]string{"v1"}`.
+ - `TestForwardRowsAreNeverCached`: hub with `EnableCache`; the box answers `Cache-Control: public, max-age=300` with a body that counts calls; two GETs: the box sees two.
+ - `TestForwardRowsSkipTheAssetCache`: an armed asset policy naming the host and prefix `/assets/`: `localAssetCatch` false for the forward upstream.
+ - `TestForwardLoginBodyReachesTheFleetEdge`: the box handler records `r.ContentLength`, the body bytes and `r.Header.Get("Content-Type")`; through the hub, `POST /.carlos/gate` with `Content-Type: application/x-www-form-urlencoded`, body `password=right&next=%2Fup`: the box received exactly that body and length; the same with `password=wrong`; a `multipart/form-data` body: received byte for byte. A path row at the hub for the forward host's `/shop` prefix: the POST with `next=/shop/x` still reaches the box.
+ - `TestUngatedLoginPostStill404s`: a non-forward ungated instance row: the login POST is 404 (today's rule kept).
+ - Mutation to show: drop `!up.route.IsForward()` from `loginPost`; the login test fails with a short body at the box.
+- [ ] **Step 2: Run** `TMPDIR=/tmp/g nice -n 19 go test ./internal/edge/ -run 'TestFleetServeEligible|TestReloadServesOnlyEligible|TestForward|TestUngatedLoginPost|TestFleetRoute|TestExplicitTunnel|TestNonFleetRoutes' -count=1`. Expected: FAIL on the new tests.
+- [ ] **Step 3: Implement.**
+- [ ] **Step 4: Run** Step 2 plus the existing gate and cache tests (`-run 'Gate|Cache|Login'`). Expected: PASS.
+- [ ] **Step 5: Census** (`Edge.Reload`, `Edge.ServeHTTP`, `Edge.localAssetCatch`, `FleetServeEligible`).
+- [ ] **Step 6: Commit.**
+
+### Task 5: Request policy for forward rows, enforced once at the hub
+
+**Files:**
+- Modify: `internal/edge/ratelimit.go:124`, `internal/edge/planthrottle.go:53,99`, `internal/host/plans_pass.go:208`
+- Test: `internal/edge/fleetforward_policy_test.go`, `internal/host/plans_pass_test.go`
+
+**Interfaces:**
+- Produces: `rateAdmit`, `planThrottleOf`, `trackUpgrade` and `planThrottleFor` take `up.route.Kind != "instance" && !up.route.IsForward()` (resp. `rt`) as their refusal. The `fromTunnel` exemptions stay.
+
+- [ ] **Step 1: Write failing tests** (on Task 4's `forwardHubAndBox`, the box a real `Edge` whose own row carries the same `RateLimit`, so a second enforcement would show):
+ - `TestForwardRateLimitAtTheHubOnly`: forward row with `RateLimit` of 2 requests per window for the test client, `RateEnforce`; three GETs: the third is 429 from the hub (the box never sees it); the box's own limiter, configured the same, never refuses a tunneled request.
+ - `TestForwardUpgradeIsLimitedAtTheHub`: the same with WebSocket upgrades: the third handshake 429.
+ - `TestForwardPlanThrottleAndUpgradeClose`: `SetPlanThrottleFor` returns an awake throttle for `bab`: an upgrade is refused 429; with plans governing `bab`, an open upgrade is closed by `CloseAccountUpgrades("bab")`.
+ - `TestPlanThrottleForAdmitsForwardRows` (`internal/host`): a throttled `bab` in the snapshot: true for a forward row of `bab`.
+- [ ] **Step 2: Run** `TMPDIR=/tmp/g nice -n 19 go test ./internal/edge/ ./internal/host/ -run 'TestForwardRateLimit|TestForwardUpgrade|TestForwardPlanThrottle|TestPlanThrottleFor' -count=1`. Expected: FAIL.
+- [ ] **Step 3: Implement** the four selector changes.
+- [ ] **Step 4: Run** Step 2 plus `-run 'RateLimit|PlanThrottle'` over both packages. Expected: PASS.
+- [ ] **Step 5: Census** (the four units).
+- [ ] **Step 6: Commit.**
+
+### Task 6: The edges file publishes what the edge serves
+
+**Files:**
+- Modify: `internal/host/edgesfile.go:543-598` (`edgesFileWriteClaims`), its loop's arming (`edgesfile.go:1030`) for the hub flag
+- Test: `internal/host/edgesfile_forward_test.go`, `internal/edge/issuer_forward_test.go`, `internal/edge/testdata/edges-forward-hub.json`
+
+**Interfaces:**
+- Consumes: Task 4's `edge.FleetServeEligible`; Task 1's `hubArmed`.
+- Produces: the writer reads `reg.ListFleets()` once per write into `owners`, takes `hub` from `hubArmed(os.Getenv)` at loop arm, and leaves out every row with `!edge.FleetServeEligible(...)` that would take the fleet arm, every forward row when `!hub`, every alias, instance catch-all and wildcard entry whose primary is left out, and any `assets` block for a forward row.
+
+- [ ] **Step 1: Write failing tests.**
+ - `TestEdgesFilePublishesOnlyEligibleForwardRows`: hub on; owners `home`->`bab`; forward rows for `bab` (eligible) and `k3x` (refused), each with an alias and an instance catch-all; the written file names the eligible row, its alias and catch-all with `account`/`app`, and nothing of the refused row's; no `assets` key on the eligible entry.
+ - `TestEdgesFileOmitsForwardRowsOffTheHub`: hub off: no forward row published.
+ - `TestEdgesFileForwardGolden` (`internal/host`): the first test's written file equals `internal/edge/testdata/edges-forward-hub.json` byte for byte (on mismatch the test prints the new bytes; the file is updated by hand in the same commit).
+ - `TestSeparateIssuerAdmitsOnlyPublishedForwardNames` (`internal/edge`, package `edge`, because `deploymentHost` and `newHomeMap` are unexported and `internal/edge` cannot import `internal/host`): a `DirStore` holding that golden file at `control/edges/hub.json`, read by `newHomeMap(store, "issuer")` into a second `Edge` with no local rows; `deploymentHost` true for the eligible host and its alias, false for the refused host and its alias.
+- [ ] **Step 2: Run** `nice -n 19 go test ./internal/host/ ./internal/edge/ -run 'TestEdgesFilePublishesOnly|TestEdgesFileOmitsForward|TestEdgesFileForwardGolden|TestSeparateIssuer' -count=1`. Expected: FAIL.
+- [ ] **Step 3: Implement** the writer change and check in the golden file.
+- [ ] **Step 4: Run** Step 2 plus `-run 'EdgesFile'`. Expected: PASS.
+- [ ] **Step 5: Census** (`edgesFileWriteClaims`).
+- [ ] **Step 6: Commit.**
+
+### Task 7: The readers that must skip a forward row, root egress included
+
+**Files:**
+- Modify: `internal/host/egress_source.go:59-108` (root), `internal/host/retention.go:50`, `internal/host/agent.go:3356` (`countExpiredCanaries`), `internal/domains/reconcile.go:217-245`
+- Test: `internal/host/forward_readers_test.go`, `internal/domains/forward_trash_test.go`
+
+**Interfaces:**
+- Produces:
+ - `boxWhollyNested`: before the unknown-kind refusal, `case rt.Kind == registry.KindForward:` skip when `rt.InertForward()`, else refuse with reason `"<host> is a forward row with a local backend"`.
+ - `retentionPass` and `countExpiredCanaries` skip `rt.IsForward()`.
+ - Domains whole-app trash loop: `if rt.IsForward() { keptLive = append(keptLive, rt); continue }` ahead of `DeleteIfUnchanged`.
+
+- [ ] **Step 1: Write failing tests.**
+ - `TestEgressNestedWithAnInertForwardRow`: one nested managed local instance and an inert forward row: `boxWhollyNested` true. With the forward row carrying `Socket`: false, reason names the host. A row of kind `"frobnicate"`: false (today's refusal kept). Mutation: skip every forward row regardless of shape; the second arm fails.
+ - `TestRetentionIgnoresForwardRows`: a forward row of app `shop` with a retention record of keep 1 and three versions in the store: `retentionPass` deletes nothing for `shop` (counting store: zero `GetRetention` reads for `shop`).
+ - `TestExpiredCanariesIgnoreForwardRows`: a forward row on `canary/x`: the count is 0 and the store sees no channel read.
+ - `TestDomainsTrashLoopKeepsForwardRows` (`internal/domains`): trashed `shop` with a forward row and trashed `blog` with an instance row: after `Reconcile`, `blog`'s row gone, `shop`'s forward row present.
+ - `TestReadersIgnoreInertForwardRows`: one table asserting false for an inert forward row from `release.Adoptable`, `release.SidecarAdoptable`, `release.CapabilityRoute`, `restartEligible`, `keepsBuildState`, `activator.ActivatorManaged`, and that `ops.FleetDBs` and the staged-version sweep's pins exclude it (spec §4.15).
+- [ ] **Step 2: Run** `nice -n 19 go test ./internal/host/ ./internal/domains/ -run 'TestEgressNestedWith|TestRetentionIgnores|TestExpiredCanariesIgnore|TestDomainsTrashLoopKeeps|TestReadersIgnore' -count=1`. Expected: FAIL.
+- [ ] **Step 3: Implement.**
+- [ ] **Step 4: Run** Step 2 plus `-run 'Egress|Retention|Canar'` (host) and `-run 'Trash'` (domains). Expected: PASS.
+- [ ] **Step 5: Census.** `boxWhollyNested` runs as root: its claim states that an agent-written row can only skip itself and that a non-inert forward row is refused. Also `retentionPass`, `countExpiredCanaries`, domains `Reconcile`.
+- [ ] **Step 6: Commit.**
+
+### Task 8: The release floor on every channel move
+
+**Files:**
+- Modify: `internal/release/layoutintent.go` (after :312), `internal/release/systempointer.go` (`SystemPointer` :46, `SystemPromoteOptions` :265, `PrepareSystemPromotion` :318, `PrepareSystemRollback` :375)
+- Create: `internal/console/fleetfloor.go`, `internal/console/fleetfloor_test.go`
+- Modify: `internal/console/rootfsfloor.go:44-72` (`systemFloorGate`, `systemFloorSnapshot`), `internal/console/hostactivation.go:124,205-306`, `internal/console/apisystemupdate.go:360,428,921,956`, `internal/console/server.go` (`fleetFloorMu sync.Mutex`), `system.go:299,354,584,603`
+- Modify: `approved_fleet_routes_copy_test.go` (+= C02, C03, C04, C05)
+
+**Interfaces:**
+- Produces:
+ - `var FleetForwardFloor = SemVer{Major: 0, Minor: 32, Patch: 0}` (P-1), pinned by `TestFleetForwardFloorIsPinned`.
+ - `func FleetForwardFloorAllows(installed, candidate string) bool`: `RegionalFloorAllows`'s shape with this floor.
+ - `const FleetForwardFloorOverrideFlag = "allow-below-fleet-forward-floor"`; `const FleetForwardFloorOverrideUsage` (C05 with the floor written in).
+ - `SystemPointer.AllowBelowFleetForwardFloor bool` (`json:"allow_below_fleet_forward_floor,omitempty"`), `SystemPromoteOptions.AllowBelowFleetForwardFloor bool`, copied by both `Prepare*` functions as the other two are.
+ - `func (s *Server) fleetForwardFloorJudge(ctx context.Context, channel string, cur *release.SystemPointer, target string, allow bool) error`: §9's three cases; `ListFleets` read only when the move does not pass on version alone; a `ListFleets` error refuses. Errors wrap `errFleetFloorPromotion` with C02 or C03; the override logs C04.
+ - `func (s *Server) fleetFloorPublish(ctx context.Context, channel string, current func() (*release.SystemPointer, error), target string, allow bool, publish func() (*release.SystemPointer, error)) (*release.SystemPointer, error)`: takes `s.fleetFloorMu`, judges on `current()` (a nil pointer is the first-publication case, never skipped) unless `allow`, then calls `publish`. Callers pass the existing `regionalFloorPublish` call as `publish`, so `fleetFloorMu` is held before `regionalMu`.
+ - `systemFloorGate`/`systemFloorSnapshot` gain `allowFleet bool`; the snapshot runs the fleet judge in the not-found branch with `cur == nil` before returning.
+ - `promoteHostUpdate`, `rollbackHostUpdate` (both arms) and the activation identity (`hostactivation.go:124`, `:252`) carry `AllowBelowFleetForwardFloor`; the update and rollback request bodies gain `allow_below_fleet_forward_floor`; `errFleetFloorPromotion` joins the two existing `errors.Is` sites (`apisystemupdate.go:428`, `:956`) with the same status.
+ - `system.go`: the flag on `runSystemUpdate` and `runSystemRollback`, sent as `allow_below_fleet_forward_floor`.
+
+- [ ] **Step 1: Write failing tests.**
+ - `internal/release`: `TestFleetForwardFloorIsPinned` (`v0.32.0`); `TestFleetForwardFloorAllows` (installed `v0.31.0` -> anything true; installed `v0.32.0` -> `v0.31.9` false, `v0.32.1` true, `"junk"` false); `TestPrepareCarriesTheFleetFloorOverride` (both `Prepare*` sign it; a pointer without the field still verifies).
+ - `internal/console` (through the HTTP fixture and `promoteHostUpdate`/`rollbackHostUpdate` directly where the other floors' tests do): `TestFleetFloorRefusesACrossingWhileAFleetExists` (pointer `v0.32.0`, fleet `home`, target `v0.31.0`: 409 with C02; no fleet: allowed; override: allowed and C04 logged); `TestFleetFloorJudgesAFirstPublication` (no pointer, fleet `home`, target `v0.31.0`: refused with C03 by `systemFloorGate` and, with the gate bypassed by a hook, by `fleetFloorPublish`; target `v0.32.0`: allowed); `TestFleetFloorRollback` (history below the floor: refused, held-activation retry with a different override refused); `TestFleetFloorListErrorRefuses`.
+ - Root package: `TestSystemUpdateSendsTheFleetFloorOverride` (the request body carries `allow_below_fleet_forward_floor: true` with the flag), and `TestFleetRoutesCopyBuiltIsApplied` covers C05's text against `FleetForwardFloorOverrideUsage` with `%s` replaced by `"v"+release.FleetForwardFloor.String()`.
+- [ ] **Step 2: Run** `nice -n 19 go test ./internal/release/ ./internal/console/ . -run 'FleetForwardFloor|TestPrepareCarriesTheFleetFloor|TestFleetFloor|TestSystemUpdateSendsTheFleetFloor|TestFleetRoutesCopy|RegionalFloor|RootfsFloor' -count=1`. Expected: FAIL on the new tests.
+- [ ] **Step 3: Implement.**
+- [ ] **Step 4: Run** Step 2. Expected: PASS, the rootfs and regional floor tests unchanged.
+- [ ] **Step 5: Census** (`SystemPointer`, `SystemPromoteOptions`, `PrepareSystemPromotion`, `PrepareSystemRollback`, the new release declarations, `runSystemUpdate`, `runSystemRollback`; the console files are outside the scope).
+- [ ] **Step 6: Commit.**
+
+### Task 9: The fleet-create barrier and the two interleavings
+
+**Files:**
+- Modify: `internal/console/fleetfloor.go`, `internal/console/fleets.go:176` (`handleAPIFleetNew`) and the page form's create handler, `approved_fleet_routes_copy_test.go` (+= C06, C07)
+- Test: `internal/console/fleetfloor_test.go`
+
+**Interfaces:**
+- Consumes: Task 8's `fleetFloorMu`, `fleetFloorPublish`.
+- Produces:
+ - `func (s *Server) fleetCreateFloorRefusal(ctx context.Context) *doorRefusal`: the channels the fresh heartbeats follow (`stable` for a box naming none), as `regionalChannelRefusal` reads them (`apiplacements.go:935-978`); a pointer below the floor or unparseable: 409 C06; unreadable: 503 C07; absent: passes.
+ - Both create doors hold `s.fleetFloorMu` from `fleetCreateFloorRefusal` through the registry write.
+ - Test hooks `fleetFloorHooks struct{ beforeLock, locked func() }` on `Server`, as `regionalFloorHooks`.
+
+- [ ] **Step 1: Write failing tests.**
+ - `TestFleetCreateRefusedWhileAChannelIsBelowTheFloor`: pointer `stable` at `v0.31.0` followed by a fresh box: `carlos fleets create` answers 409 with C06 and no fleet row exists; pointer at `v0.32.0`: created; no pointer: created; pointer unreadable: 503 C07.
+ - `TestFleetFloorInterleavings`: (a) no pointer; an update to `v0.31.0` passes `systemFloorGate` with no fleet; `beforeLock` creates fleet `home` through the door (passes: no pointer); the publication then judges under `fleetFloorMu`, refuses with C03, and `GetSystemPointer` still returns not-found. (b) no pointer, no fleet; the publication of `v0.31.0` holds `fleetFloorMu` (`locked` hook) while a fleet create starts in a goroutine; after it publishes, the create returns 409 C06 and no fleet row exists.
+ - Mutation: release `fleetFloorMu` before `publish`; (a) fails.
+- [ ] **Step 2: Run** `nice -n 19 go test ./internal/console/ -run 'TestFleetCreateRefused|TestFleetFloorInterleavings|TestFleetFloor|TestAPIFleet' -count=1`. Expected: FAIL on the new tests.
+- [ ] **Step 3: Implement.**
+- [ ] **Step 4: Run** Step 2. Expected: PASS.
+- [ ] **Step 5: Commit** (console only; no census unit).
+
+### Task 10: The forward phase of the instance pass (dormant)
+
+**Files:**
+- Create: `internal/provision/forward.go`, `internal/provision/forward_test.go`
+- Modify: `internal/provision/reconcile.go` (`ReconcileConfig` :36; the scan's `inScope` skip :1217; the prefetch :1276-1298; `retirable` :2044; phase order before the mint loop)
+
+**Interfaces:**
+- Consumes: Task 2's `PutForward`, `DeleteForward`, `ErrHostHeld`, `IsForward`.
+- Produces:
+ - `ReconcileConfig.FleetOwners func() (map[string]string, error)` (nil: not a hub).
+ - In `forward.go`: `func forwardRowFor(rec Record) registry.Route` (the declared columns); `type forwardDecision int` with `forwardMint`, `forwardKeep`, `forwardRetire`, `forwardRefuse`; `func decideForward(rec Record, owners map[string]string, inScopeHosts map[string]bool, trash trashState) (forwardDecision, string)` (§4.3 step 3, the string a log reason); `func (p *forwardPhase) run(...)` doing steps 4 and 5.
+ - The scan keeps fleet-placed records skipped only by the fleet boundary; their apps get a marker-only prefetch into the same `tombs` map; `retirable` excludes `IsForward()`; the phase runs before the mint loop; a held host is logged once per host per pass through the pass's throttled report; no retirement unless the scan was whole and nothing failed to read, with snapshot removals re-confirmed against the bucket (`trashOver(freshStore(s), ...)`, `productionClear`).
+
+- [ ] **Step 1: Write failing tests** (fixtures as `reconcile_test.go`'s, a `DirStore`, a real registry, records written with `CreateRecord`):
+ - `TestForwardPhaseMintsForTheFleetOwnerOnly`: owners `home`->`bab`, `away`->`k3x`; records `shop` of `bab` on `fleet/home` (minted, shape = `forwardRowFor`), `shop2` of `bab` on `fleet/away` (none), `x` on `fleet/nowhere` (none), a `role: replica` record and a record with `Pool "p1"` on `fleet/home` (none, logged).
+ - `TestForwardPhaseIsInertWithoutOwners`: `FleetOwners` nil: no forward row minted; an existing one retired on a whole pass.
+ - `TestForwardPhaseTrashDecisions`: trashed, production clear: retired; trashed, flagged production: kept; marker unreadable (a store failing that key): kept, nothing minted for a new record.
+ - `TestForwardPhaseRetiresOnlyOnAWholePass`: a record gone with one other record unreadable: kept; on the next whole pass: retired; over a snapshot missing the record but the bucket holding it: kept.
+ - `TestForwardPhaseLeavesAHeldHostAndReportsIt`: a hand row and a provisioned instance row at fleet-placed hosts: both unchanged after two passes; the report logged once per pass per host.
+ - `TestForwardPhaseMovesBetweenFleetsAndBack`: `fleet/home` -> `fleet/away` (same account): row rewritten, `FleetBox` cleared; -> platform region in scope: forward row gone and an instance row minted in the same pass.
+ - `TestInstancePassNeverRetiresForwardRows` and `TestForwardPhaseNeverTouchesOtherRows` (instance, sidecar, `Platform`, hand rows).
+ - `TestForwardAppsReadOnlyTheMarker`: counting store: for a forward app, one tombstone GET per pass and zero manifest, seed and policy reads.
+- [ ] **Step 2: Run** `nice -n 19 go test ./internal/provision/ -run 'TestForwardPhase|TestInstancePassNeverRetiresForward|TestForwardAppsReadOnlyTheMarker' -count=1`. Expected: FAIL.
+- [ ] **Step 3: Implement.**
+- [ ] **Step 4: Run** Step 2 plus `-run 'Reconcile|Retire|Trash'` over `./internal/provision/`. Expected: PASS. Show the mutation: treat `declineMint` as retire; `TestForwardPhaseTrashDecisions` fails.
+- [ ] **Step 5: Census** (`Reconcile`, the `forward.go` helpers, `ReconcileConfig`; the 9B8 inventory digest for `Reconcile` re-reviewed: `go test ./internal/provision/ -run 'Census' -count=1` shows which entries moved).
+- [ ] **Step 6: Commit.**
+
+### Task 11: The console reads forward rows right
+
+**Files:**
+- Modify: `internal/console/fleets.go:817-829` (`placeAppTarget`), `internal/console/apiinstances.go:405-420` (health) and the REASON assembly (`:1051`), `approved_fleet_routes_copy_test.go` (+= C08)
+- Test: `internal/console/fleetforward_test.go`
+
+**Interfaces:**
+- Produces: `placeAppTarget` no longer calls `reg.SetPlacement`; the health loop treats a local forward row as not local; `func forwardHeldReason(rows map[string]registry.Route, rec provision.Record) string` returns C08 (with the fleet) when the record is fleet-placed and the local row at its host is not a forward row, else `""`; it fills `Reason` only when nothing else has.
+
+- [ ] **Step 1: Write failing tests** (instance fixture, `shop` placed on `home`): `TestPlaceNoLongerStampsRows` (a local instance row of `shop` keeps its `Region` after `apps place --target fleet/home`, the record moves); `TestFleetInstanceHealthIgnoresTheForwardRow` (a forward row at the host: the instance's health is the fleet answer, not the local row's); `TestInstanceListNamesTheHeldHost` (a hand row at the host: `instances list` REASON is C08 naming `home`; a forward row: no such REASON).
+- [ ] **Step 2: Run** `nice -n 19 go test ./internal/console/ . -run 'TestPlaceNoLongerStamps|TestFleetInstanceHealthIgnores|TestInstanceListNamesTheHeldHost|TestFleetRoutesCopy|TestAPIPlace' -count=1`. Expected: FAIL on the new tests.
+- [ ] **Step 3: Implement.**
+- [ ] **Step 4: Run** Step 2. Expected: PASS.
+- [ ] **Step 5: Commit** (console only).
+
+### Task 12: Switch it on at the hub, and the request budget
+
+**Files:**
+- Modify: `internal/host/hub.go` (`hubFleetOwners`), `internal/host/agent.go:3552` (`boxProvisionConfig`)
+- Test: `internal/host/fleet_forward_budget_test.go`
+
+**Interfaces:**
+- Consumes: Task 1's `hubArmed`, Task 10's `FleetOwners`.
+- Produces: `func hubFleetOwners(reg *registry.Registry) func() (map[string]string, error)` (fleet name -> account from `ListFleets`); `boxProvisionConfig` sets `cfg.FleetOwners` when `hubArmed(os.Getenv)`. This is the switch-on.
+
+- [ ] **Step 1: Write failing tests.**
+ - `TestBoxProvisionConfigArmsForwardingOnTheHubOnly`: env with `CARLOS_TUNNEL_HOST`: `FleetOwners` non-nil and returns the registry's fleets; with `CARLOS_FLEET` also set, or neither: nil.
+ - `TestForwardRequestBudget`: §6's comparative test. One `DirStore` wrapped in a counting store keyed by object prefix; one registry; the production functions the loops call (`reconcileSerialized` with `boxProvisionConfig`'s config, `telemetryPass`, `plansPass` with plans on, `retentionPass`, `bs.refreshAll`, `ReconcileFleetBindings`, `edgesFilePass`, `countExpiredCanaries`, `domains.Reconcile` with an apps domain, `aliasPassReporting` with the box's judge) run once over a baseline, then over the baseline plus `shop` of `bab` on `fleet/home` on channel `canary/x` with its forward row. Assert the difference per prefix: one tombstone GET; the telemetry and limits reads of §6 (`A = 1`, `C = 1`); zero manifest, seed, policy, retention and channel-pointer reads for `shop`. Case two: attach an instance catch-all claim for `shop`: exactly one more `List` of `apps/bab/shop/instances/`. Case three: two `shop` instances sharing a label: their two lifetime observations more (record and slot GETs).
+- [ ] **Step 2: Run** `nice -n 19 go test ./internal/host/ -run 'TestBoxProvisionConfigArmsForwarding|TestForwardRequestBudget' -count=1`. Expected: FAIL.
+- [ ] **Step 3: Implement.**
+- [ ] **Step 4: Run** Step 2. Expected: PASS. If the budget test shows a read §6 does not list, stop and update spec §6 (with the reason) in this commit rather than loosening the assertion.
+- [ ] **Step 5: Census** (`boxProvisionConfig`, `hubFleetOwners`).
+- [ ] **Step 6: Commit.**
+
+### Task 13: The production-wired witness
+
+**Files:**
+- Create: `fleet_public_routes_e2e_test.go` (root package)
+
+**Interfaces:**
+- Consumes: everything above, through production constructors only: `console.NewServer` over a temp registry and a `release.DirStore`; the hub `Edge` armed by `enableTunnelsFromEnv` (`CARLOS_TUNNEL_HOST` in the test env) on the same registry; the hub's instance pass through the change-index leg's function with `boxProvisionConfig`'s config; the box: a second `Edge` on its own registry, its instance pass with `CARLOS_FLEET=home`, `CARLOS_REGION=fleet/home`, serving over `tunnelclient.Loop` with the token `fleets add-box` printed; a real process bound at the derived socket answering `/up` with `v1` (the binary instance kind; the tests' existing tiny server binary).
+
+- [ ] **Step 1: Write the test** `TestFleetAppServesThroughTheHub`, no hand rows, no fabricated records, every step through the console's HTTP API as the CLI calls it:
+ 1. Create account `bab`, fleet `home`, box `box-1`; app `shop` with `--place fleet/home`; set a password gate and a rate limit of 5 per window; ship and promote `v1`; create the instance `shop.bab.example.com`.
+ 2. Through the hub's TLS listener (test certificate): `GET /up` is the fleet edge's login form; the form posted back as a browser sends it with a wrong password: the wrong-password page, no cookie; with the right one: the cookie; `GET /up` with it: 200 and `Header.Values("X-Carlos-Version") == []string{"v1"}`; without it: the form again.
+ 3. Requests over the limit: 429 from the hub.
+ 4. Attach a custom parent with an instance catch-all: `<slug>.<parent>` serves 200.
+ 5. Detach `box-1`: 503 with `Retry-After`; re-add it (new token, box redials): 200.
+ 6. Trash `shop` (not production): after the hub's next pass the forward row is gone and the hub refuses the name's TLS handshake.
+ 7. Account `k3x` writes a record placed on `fleet/home` directly to the store: after a pass, no row at its host and no entry in the hub's edges file.
+- [ ] **Step 2: Run** `TMPDIR=/tmp/g nice -n 19 go test . -run 'TestFleetAppServesThroughTheHub' -count=1 -v` (sandbox off). Expected: PASS. Show it can fail: set `FleetOwners` nil in the test's config; step 2 fails with a TLS refusal.
+- [ ] **Step 3: Commit.**
+
+### Task 14: Census, whole-branch review, merge
+
+- [ ] **Step 1:** `make census-card`; reconcile every unit against spec §7 (no difference left unexplained); write CLAIMS from §7's per-unit text; `make census-propose NAME=fleet-public-routes CLAIMS=<file>`.
+- [ ] **Step 2:** Brief Astra from `REVIEW-BRIEF-TEMPLATE.md` for the census and the whole branch (one review, three rounds, stopping rules); focus: the writer guard, the predicate's two callers, `boxWhollyNested`, the floor's mutex.
+- [ ] **Step 3:** Push to amadan; `amadan ci status carlos/platform -branch design-fleet-public-routes` green on the tip; record the census verdict on #280; `amadan branch describe`.
+- [ ] **Step 4:** Paul's merge go, then `amadan branch merge carlos/platform design-fleet-public-routes -squash -expect <full tip> -message "..."`.
+
+### Task 15: Live on dev
+
+- [ ] **Step 1:** A release containing the merge, numbered `v0.32.0` (or Task 8's constant and its pin re-set to the cut's number on a follow-up branch before the cut), rolled to dev: dev boxes, then the dev console (sophie, the hub), the CLI on DOCS-T1.
+- [ ] **Step 2:** From DOCS-T1: `curl -sI https://shop.bab.dev.oncarlos.com/up` answers `200` with exactly one `x-carlos-version: v1`.
+- [ ] **Step 3:** The same through leo: `curl -sI --resolve shop.bab.dev.oncarlos.com:443:18.200.150.210 https://shop.bab.dev.oncarlos.com/up`: 200, one `v1`.
+- [ ] **Step 4:** `curl -sI https://railsdemo.bab.dev.oncarlos.com/up`: still 200 through its hand row; sophie's journal reports the held host; `carlos instances list --app railsdemo --account bab` shows C08.
+- [ ] **Step 5:** The r10r fleet page lists `shop`. Report on #457. No flagship roll until Paul says so.
+
+---
+
+## Self-review
+
+1. **Spec coverage.** §4.2 shape: Task 2; writer rule and inventory: Task 3. §4.3 forward phase, trash, prefetch, order, ownership: Task 10; switch-on: Task 12. §4.4 predicate: Task 4 (serving), Task 6 (publication). §4.5 bindings: Task 1. §4.6 retirement table: Task 10 tests, Task 13 steps 5-6. §4.7 rows already there, `apps place`: Tasks 10, 11. §4.8 request policy: Task 5; gate and caches: Task 4. §4.9 certs: Tasks 4, 6. §4.10 backhaul: Task 15 step 3. §4.11 catch-alls: Task 6, Task 13 step 4; no platform names: Task 7's domains test leaves `firstReadyUpstream` untouched (no change needed, §4.11). §4.12 headers: Task 4. §4.13 hibernation: no change (Task 7's readers table pins `ActivatorManaged`). §4.15 readers: Task 7; console readers: Task 11. §6 budget: Task 12. §7 census: every task's census step, Task 14. §8 tests: distributed as above; the witness: Task 13. §9 floor: Tasks 8, 9; rollout: Task 15.
+2. **Step scan.** No step says "handle" or "as appropriate" without a named rule; code appears only as signatures, the SQL the spec fixes, and the copy table.
+3. **Type consistency.** `SetFleetBoxIf(host, fleet, label string) (bool, error)` (Tasks 1, 2's remote case, 10 never calls it); `DeleteForward(host string) (bool, error)`; `PutForward(rt Route) error`; `FleetServeEligible(rt registry.Route, hub bool, owners map[string]string) (bool, string)` (Tasks 4, 6); `hubArmed(getenv func(string) string) bool` (Tasks 1, 6, 12); `FleetOwners func() (map[string]string, error)` (Tasks 10, 12); `fleetFloorPublish` and `fleetForwardFloorJudge` (Tasks 8, 9).
+4. **Review focus.** Five lines, each with its test in the owning task (Tasks 1, 4, 9, 10, 11).
+5. **Proportion.** The plan carries signatures, test names, assertions and the spec's values; no function bodies beyond the fixed SQL.