carlos / platform Public

plan: #1139 fleet seeded create implementation plan

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
claude agent, operated by paul@keymail.dev pushed by paul@keymail.dev 99cd0994310721e95f472eeb8332494196c6b13a parent 94857de
1 file changed, +763 −0
  • docs/superpowers/plans/2026-11-20-fleet-seeded-create.md +763 −0
diff --git a/docs/superpowers/plans/2026-11-20-fleet-seeded-create.md b/docs/superpowers/plans/2026-11-20-fleet-seeded-create.md
new file mode 100644
index 000000000..eab0921af
--- /dev/null
+++ b/docs/superpowers/plans/2026-11-20-fleet-seeded-create.md
@@ -0,0 +1,763 @@
+# Seeded instances on a customer fleet (#1139): 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:** `carlos instances create --app A --host H --seed-file <db>` creates a new instance whose database starts as the file, on a region (slice 1) and on the account's own fleet (slices 2 and 3). Then Eleven moves its four shared services (push, connect, home, cloud) onto its fleet `eleven` with it (slice 4).
+
+**Architecture:**
+- A third seed kind, `file`, with `--from`'s states (`reserving` → `ready` → `placed`, abandoned `aborted` → `rolled-back`). It reuses the import door's begin (the create body's `import` object, with `kind: "file"`) and its streamed upload (`PUT .../instances/{host}/import?seed=<id>`).
+- Region apps keep today's snapshot key in the region data bucket. Fleet apps get `apps/<sqid>/<app>/seeds/<host>/<id>/snapshot.db` in the deployment bucket, which a fleet box reads through the store door.
+- A fleet box cannot write records, so it reports `placed`, `failed` and `rolledback` to a new console door, `POST /api/fleet/seeds/{account}/{app}/{host}/{op}`, authenticated like the replica doors.
+- On a fleet a hostname is released only when the owning box proves nothing of the seed is left: a fenced local purge, then an exhaustive listing of both restore-capable prefixes. That rule is enforced in one place.
+
+**Tech Stack:** Go; `release.Store` (deployment bucket, region data bucket, the fleet store door through `internal/fleetapi`); the activator's `instancefs`; the console's record CAS (`provision.SetRecordSeed`); the `carlos` CLI (`clireg`, `apiSession`).
+
+**Spec:** `docs/superpowers/specs/2026-11-20-fleet-seeded-create-design.md` (final after three rounds; Paul ruled no fourth). Authority: `docs/superpowers/specs/2026-10-08-seeded-instances-design.md` ("the seeds spec"). Findings: `docs/superpowers/specs/CODEX-FINDINGS-fleet-seeded-create-R{1,2,3}.md`. Executors read the design and §3 of the seeds spec. Every file:line below was checked at `94857de17`.
+
+## Review log
+
+No plan review yet. The design's round history carries into every brief written from this plan (stopping rule 1). Three design rounds: R1 (6 findings), R2 (abandonment family, cut (a)), R3 (R3-1 exhaustive listing, R3-2 staging, R3-3 sweep). The plan review starts at round 1 and has the usual three-round budget.
+
+## Global Constraints
+
+- **Do not reopen the design.** Where the code forced a choice the design did not make, the plan makes it, says so in "Decisions this plan makes", and lists it under "Design gaps found while planning" for Paul.
+- **The invariant (design §3.6, cut (a)).** On a fleet, a `file` seed's hostname is released only when its owning box has proved that nothing of the seed is left: no local file and no object under either restore-capable prefix. Nothing else releases it. The proof is made in one function (`provision.rollbackFleetFileSeed`, Task 11), and the door's `rolledback` op is the only way it is reported.
+- **Fail closed everywhere.** A listing error, a marker that cannot be read, a fence that does not proceed, a heartbeat that is missing or stale: each means "not proven", never "empty".
+- **Nothing a request supplies picks a bucket or a key.** Keys come from `seeds.SnapshotKey` / `seeds.FleetSnapshotKey` on values from the record, after `seeds.Check`.
+- **Wire shapes are additive.** `SeedSource.Kind` gains `"file"`; `BoxMetrics` gains one `omitempty` pointer; `seedImportReq` gains `kind`. A record or heartbeat written before this change parses the same.
+- **Import, `--from` and the swap behave exactly as today** (design §3.7). `--from` on a fleet keeps its current refusal sentence (`seedPlacementRefusal`, `internal/console/apiinstanceseed.go:113-121`).
+- **Protocols (see Decisions D1).** `seeds.FileSeedProtocol = 3` (slice 1, region file seeds) and `seeds.FleetFileSeedProtocol = 4` (slice 2, fleet file seeds). `seeds.ProtocolVersion` becomes 3 in slice 1 and 4 in slice 2. `seeds.RequiredProtocol` (1) is unchanged for the old doors.
+- **Ratchet (`make code-health`).** Do not grow these: `internal/host/agent.go` (file-lines 3214, at its ceiling), `apimode.go` (4199), `(*Edge).ServeHTTP` (421), `(*Server).handleAPIInstanceCreate` (769), `provision.Reconcile` (811), and `runInstancesCreate`'s `log.Fatalf` count (6). New code goes in new files. Moving a function out of one of these files is fine.
+- **Copy.** Every new user-facing string is in the copy table at the end, marked pending. Implementers use the table's text and add a row for anything missing, flagged in the task report. No em dashes; curly apostrophes in prose; CLI errors lowercase with no closing full stop where the surrounding `instances` copy is; neutral examples (`shop`, `example.com`). The UX pass (Task 1) and copy review (Task 2) come before any task that builds copy.
+- **Testing.** Targeted `go test ./<pkg> -run '<Names>' -count=1` only. No full suites, `-race` or e2e locally; CI on amadan runs them. Before handing off a task that touches `internal/host` or the root package: `GOOS=darwin go build ./...` and `GOOS=windows go build ./...`. If socket tests fail on path length, `TMPDIR=/tmp/g` after `mkdir -p /tmp/g`. Leave `GOCACHE` at its default.
+- **Census.** Every slice except slice 3's console-only tasks changes the root binary's source: the root package (CLI), `internal/provision`, `internal/seeds`, `internal/activator`, `internal/host`, `internal/edge`, `internal/status`. Each such slice ends with `make census-card`, a CLAIMS file, `make census-propose NAME=<branch>`, and an Astra verdict recorded on #280 (AGENTS.md "The census"). Record-writing units added or changed also get entries in a per-slice record-write census file (`internal/provision/fleet_seeded_create_<n>_census_test.go`), layered on main's newest inventory at branch time, in the shape of `fleet_secrets_key_census_test.go`.
+- **Reviews.** Per stopping rule 3, only the tasks marked "own review" get one. Everything else is covered by the slice's whole-branch review (Fable) before merge. Each review has the three-round budget and stops at the first round with no P1.
+- **Commits.** Subjects under 80 characters, prefixed by area; body after a blank line; end with `Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>`. Each slice is its own branch, landed through `amadan branch merge -squash` once CI is green.
+
+## Review Focus
+
+1. **The interrupted placement (R2-2, deterministic).** The replica uploads, the `placed` report fails, and the member deletes. The rollback purges local data, finds the replica, reports nothing, and the hostname stays held. Empty the fake fleet bucket's prefix and the next pass reports `rolledback`. A second seed at that hostname places its own snapshot (Task 11, `TestFleetFileSeedInterruptedPlacementHoldsHostname`).
+2. **An orphaned generation (R3-1).** `head.json` is gone but generation objects remain, so `lease.HasReplica` says false. The rollback must still report nothing (Task 11, `TestFleetFileSeedRollbackOrphanedGenerationHolds`).
+3. **Staging under a matching marker (R3-2).** A retry with this seed's marker and objects under `moves/<host>/` reports `failed`. It never promotes or restores them (Task 10, `TestFleetFileSeedRetryRefusesStaging`, `TestFleetFileSeedRestoreOwnNeverPromotesStaging`).
+4. **Two seeds placing at once in one flat directory.** Neither purge touches the other's temp file (Task 9, `TestFlatFleetTwoSeedsPlaceConcurrently`).
+5. **A box that is not the owner.** Its `placed` from another fleet, another box, or naming another seed id changes nothing and answers 409 or the byte-identical 404 (Task 15, `TestFleetSeedDoorRefusals`).
+6. **A fleet with one box below the floor, or missing the new heartbeat block.** The door refuses and names the box (Task 14, `TestSeedFleetReadyNamesBoxes`).
+
+---
+
+## File structure
+
+Create:
+- `instances_seedfile.go` (root): the `--seed-file` path (`runSeedFileCreate`), the file-seed poll, `instanceDelete` (moved out of `apimode.go`), and the pending-delete answer. Test `instances_seedfile_test.go`.
+- `approved_fleet_seeded_copy_test.go` (root): pins the copy table.
+- `internal/console/seedfile.go`: `beginFileSeed`, the file branch of the upload, `seedFileReady` (region) and `seedFleetReady` (fleet). Test `seedfile_test.go`.
+- `internal/console/apifleetseeds.go`: the fleet seeds door. Test `apifleetseeds_test.go`.
+- `internal/console/seedfile_copy.go`: console copy from the table.
+- `internal/activator/seedfleet.go`: fleet admission, the staging check and the failure report. Test `seedfleet_test.go`.
+- `internal/provision/seedfleet.go`: `rollbackFleetFileSeed` and `FleetSeedHooks`. Test `seedfleet_test.go`.
+- `internal/host/seedfleetdoor.go`: the door client and the fleet `SeedObjects`. Test `seedfleetdoor_test.go`.
+- `internal/host/seedsfloorprobe.go`: the heartbeat's seeds-floor block. Test beside it.
+- `internal/provision/fleet_seeded_create_{1,2,3}_census_test.go`: record-write census entries per slice.
+
+Modify (refs at `94857de17`):
+- `internal/seeds/seeds.go` (kinds `:24-31`, keys `:94-136`), `internal/seeds/floor.go` (`ProtocolVersion :28`, `RequiredProtocol :32`).
+- `internal/provision/seed.go` (`Unfinished :68-75`, transitions `:162-209`, `SeedAbortUploadBecause :257-266`), `seedreconcile.go` (`seedAction :151`, `finishAbortedSeed :233-255`, `purgeAbortedFromLocal :291`), `reconcile.go` (`:1963`).
+- `internal/activator/seedplace.go` (`SeedObjects :24-27`, `seededRestore :101-275`, `seedTempName :329`, `purgeSeedTarget :388-409`, `fetchSeed :493`), `backend_exec.go` (`restorePlain :1077`, staging `:1131`).
+- `internal/host/seedwiring.go` (`storeSeedObjects :23-37`, `seedPlacedHook :54-78`, `wireSeedPlacement :149-186`), `seedsfloor.go` (`withSeedsFields :57-68`), `rootseedsfloor.go` (`withRootSeedsFields :143`).
+- `internal/status/snapshot.go` (`Probes :44`, `BoxMetrics :651`, `CollectBox :1125`, presence check `:1299`, literal `:1331`).
+- `internal/edge/storedoor.go` (`aclRead :688-701`), `internal/edge/edge.go` (`:2412`), `internal/edge/replicaconsole.go`.
+- `internal/console/apiinstanceimport.go` (`seedImportReq :35-41`, `beginImport :111-261`, `importGate :305-357`, `handleAPIImportUpload :389-474`, `staleUploadRefusal :498-509`, `runImportUpload :565-656`, `importDeleteRule :977-1070`), `apiinstanceseed.go` (`seedPlacementRefusal :113-121`), `seedfloor.go` (`seedRegionReadyForEdges :41`), `seedsweep.go` (`StartSeedsPass :66`, `seedStale :95-110`, `seedsPass :140`, `snapshotDecision :278`), `seedfinish.go` (`finishSeedOnce :79-146`, `:124`), `routedecls.go` (`:436-438`), `linkedpolicy.go` (`:293-296`).
+- Root: `instances_cli.go` (`runInstancesCreate :316-397`, `runInstancesDelete :805-830`), `instances_seed.go` (`apiSeed :16-26`, `seedCell :29-61`), `apimode.go` (`instanceDelete :4478-4487`, moved out), `parity/parity.tsv` (`:67`, `:267`), `parity/cli.tsv` and `docs/parity.md` (generated), `docs/site/cli.md` (`:1396-1400`, `:3620`).
+
+---
+
+## Slice 1: `--seed-file` for region-placed apps
+
+What Paul sees: on dev, after the boxes roll and the floor is published again, `carlos instances create --app shop --host seeded.<dev> --seed-file shop.db` uploads, checks, prints the instance, and the instance's first wake starts on that data. `instances list` shows it as seeded from a file.
+
+### Task 1: UX pass on the CLI output (all slices)
+
+No code. One pass for every slice's copy, so the copy review sees the whole flow once.
+
+**Model:** Opus. **Own review:** no (Paul looks at the mocks). **Census:** none.
+
+**Files:** this plan (mocks, copy table).
+
+- [ ] **Step 1:** Render each mock below at 80 columns in a terminal (a scratch file under `$TMPDIR`). Check it against AGENTS.md "Every UI change gets a UX pass": state first, label/value pairs, about a dozen words, problems visible as a state. Fix what reads badly in the mocks and the copy table.
+
+```
+$ carlos instances create --app push --host push.bdr.example.com --seed-file push.db
+uploading push.db (24 MB)
+checking push.db. A large database can take a few minutes.
+created instance push.bdr.example.com (channel stable)
+ seeded from a file 3f2a9c1e0b7d, placed when it first starts
+ the host comes live on the next reconcile pass on its box
+
+$ carlos instances list --app push
+HOST CHANNEL REGION SEED
+push.bdr.example.com stable fleet eleven seed file waiting for first start
+mail.bdr.example.com stable fleet eleven not created: a copy of data already exists for this hostname
+old.bdr.example.com stable fleet eleven not created: a copy of its data is still in the fleet’s storage
+
+$ carlos instances create --app push --host push.bdr.example.com --seed-file push.db
+instances create: b1, b2 in fleet eleven are below the seeds floor. Update the platform on those boxes, then try again
+
+$ carlos instances create --app push --host push.bdr.example.com --seed-file push.db
+uploading push.db (24 MB)
+checking push.db. A large database can take a few minutes.
+instances create: the upload is not a database that passes an integrity check, so it was not kept.
+ the hostname stays taken until the fleet’s box has cleaned up
+
+$ carlos instances delete --app push --host push.bdr.example.com
+push.bdr.example.com is being deleted. Its hostname is free once its box has cleaned up.
+```
+
+- [ ] **Step 2:** The begin call goes before the `uploading` line. Today's import prints `uploading` first (`instances_import.go:203`), so a begin refusal would follow an upload line that never happened. Record that order in the mocks.
+- [ ] **Step 3:** Commit the plan edit: `docs: #1139 plan, UX pass on the CLI output`.
+
+### Task 2: Copy review (all slices)
+
+**Model:** the `copy-review` skill (Luna pass), then Paul. **Own review:** the review is the task. **Census:** none.
+
+- [ ] **Step 1:** Run the copy-review skill over the copy table, in the layouts from Task 1. Apply the edits verbatim to the table and mark each row approved.
+- [ ] **Step 2:** Commit: `docs: #1139 plan, approved copy`.
+
+Build tasks below use the approved table only.
+
+### Task 3: The `file` kind and its lifecycle in `provision`
+
+**Model:** Sonnet. **Own review:** no. **Census:** yes (`internal/seeds`, `internal/provision`).
+
+**Files:**
+- Modify: `internal/seeds/seeds.go`, `internal/seeds/floor.go`, `internal/provision/seed.go`
+- Test: `internal/provision/seed_test.go` (table rows), `internal/seeds/seeds_test.go`, `internal/seeds/floor_test.go`
+
+**Interfaces:**
+```go
+// internal/seeds
+const KindFile = "file" // an uploaded file, --from's states (fleet seeded create design §3.2)
+const FileSeedProtocol = 3 // a box that places, and rolls back, a region file seed
+const ProtocolVersion = 3 // was 2
+
+// internal/provision
+// SeedPublishFile is the upload's last step for a file seed: reserving to
+// ready. The sha256 and length were set at begin and checked by the upload.
+func SeedPublishFile(id string) func(*Record) error
+// SeedAbortFileUploadBecause is SeedAbortUploadBecause for a file seed: only
+// while it is still reserving.
+func SeedAbortFileUploadBecause(id, reason string) func(*Record) error
+// SeedFail is a box's terminal placement failure (design §3.6): a file seed
+// from ready to aborted, with Reason. Never an import (SeedRefuse is
+// unchanged). It also accepts an aborted file seed and sets only Reason
+// (Decision D6), so a rollback that finds a copy can say so.
+func SeedFail(id, reason string) func(*Record) error
+```
+- `Unfinished` (`seed.go:72`): a `file` seed at `placed` is finished.
+- `SeedPlace`, `SeedAbort`, `SeedAbortStale`, `SeedRolledBack` are kind-agnostic already (`seed.go:189-201`, `:236-255`, `:276-288`, `:292-294`). Each gets a `file` row anyway.
+- The design calls the publish `provision.SeedReady` and the place `SeedPlaced`. The code's names are `SeedPublishReplica` (`seed.go:165`) and `SeedPlace` (`seed.go:189`). This task adds `SeedPublishFile` beside the replica one and leaves `SeedPublishReplica` replica-only.
+
+- [ ] **Step 1: Failing tests**
+ - `TestSeedLifecycleFileKind`: a table beside the replica and import rows. `SeedPublishFile` accepts `file` from `reserving` and refuses `replica` and `import`. `SeedPublishReplica` still refuses `file`. `SeedPlace` takes `file` from `ready`. `SeedAbort` takes it from `reserving` and from `ready`. `SeedRolledBack` takes it from `aborted`.
+ - `TestUnfinishedFilePlacedIsFinished`: `file`+`placed` is finished. `file`+`ready`, `file`+`aborted` and `file`+`committed` are not.
+ - `TestSeedFailFileOnly`: `ready` → `aborted` with `Reason`. An `aborted` file seed keeps its state and takes the new `Reason`. `import` gets `ErrSeedConflict`, and so do `reserving`, `placed` and another id.
+ - `TestSeedAbortFileUploadOnlyWhileReserving`.
+ - `TestMoveBlockFileUnplaced`: `MoveBlock` answers `SeedMoveUnplaced` until `placed`.
+ - `seeds`: `TestKindFileIsNotAKnownImport`, and the protocol constants (update any test that pins `ProtocolVersion == 2`).
+- [ ] **Step 2:** `go test ./internal/provision -run 'TestSeedLifecycleFileKind|TestUnfinishedFile|TestSeedFailFile|TestSeedAbortFileUpload|TestMoveBlockFile' -count=1` and `go test ./internal/seeds -count=1`. Expect FAIL.
+- [ ] **Step 3:** Implement.
+- [ ] **Step 4:** Run step 2 again: PASS. Run `go test ./internal/provision -run 'TestSeed' -count=1` to see no existing seed test moved.
+- [ ] **Step 5:** Commit: `provision: the file seed kind and its transitions`.
+
+### Task 4: Region boxes handle a `file` seed's abort as a `--from` seed's
+
+**Model:** Sonnet. **Own review:** yes, Opus. It retires rows and deletes replicas, which is termination and production storage. **Census:** yes (`internal/provision`).
+
+**Files:**
+- Modify: `internal/provision/reconcile.go:1963`, `internal/provision/seedreconcile.go:240`
+- Test: `internal/provision/seedreconcile_test.go`
+
+The two kind checks that name `KindReplica` name `KindFile` too (design §3.2). On a region box nothing else changes.
+
+- [ ] **Step 1: Failing tests**
+ - `TestAbortedFileSeedRowRetiredFirst`: an aborted `file` seed with a provisioned row this box minted gets `retireAbortedSeedRow`. The seed stays aborted this pass.
+ - `TestAbortedFileSeedPurgesItsMarkedLocal`: no row, and a marker that names the seed. `purgeAbortedFromLocal` runs, the snapshot goes, and the record goes `rolled-back`. With a marker naming another seed, the file is left and the seed still rolls back, as for `--from`.
+- [ ] **Step 2:** `go test ./internal/provision -run 'TestAbortedFileSeed' -count=1`. Expect FAIL.
+- [ ] **Step 3:** Implement. In `reconcile.go:1963`, replace the condition with a helper (`abortRetiresRow(rec)`) so `Reconcile` does not grow.
+- [ ] **Step 4:** Run step 2 again: PASS. Also run `go test ./internal/provision -run 'TestAborted|TestFinishAborted' -count=1`.
+- [ ] **Step 5:** Commit: `provision: an aborted file seed rolls back as --from does`.
+- [ ] **Step 6: Own review.** Opus, from `REVIEW-BRIEF-TEMPLATE.md`. Name: row retirement before rollback (task-4 review I1 of the seeds series), the marker rule in `purgeAbortedFromLocal`, and that nothing changed for `replica` and `import`.
+
+### Task 5: The console's region door for a file seed
+
+**Model:** Opus. **Own review:** yes, Opus. The door writes to the data bucket, which is production storage. **Census:** none (`internal/console` is out of scope). Record-write census: yes.
+
+**Files:**
+- Create: `internal/console/seedfile.go`, `internal/console/seedfile_copy.go`, `internal/console/seedfile_test.go`
+- Modify: `internal/console/apiinstanceimport.go` (`seedImportReq`, `createImport`/`beginImport` dispatch, `importGate`, `staleUploadRefusal`, `runImportUpload`), `internal/console/seedfloor.go` (`seedRegionReadyForEdges` takes a protocol minimum), `internal/console/seedsweep.go` (`seedStale :104`), `internal/console/seedfinish.go:124`
+- Create: `internal/provision/fleet_seeded_create_1_census_test.go`
+
+**Interfaces:**
+```go
+type seedImportReq struct {
+ // ...existing...
+ Kind string `json:"kind,omitempty"` // "" = import; "file" = a file seed (Decision D2)
+}
+// beginFileSeed: seedOneDoorRefusal and seedCommonRefusal have already run
+// in the create door. Then: file seeds refuse a pool (FS-20) and an HA
+// region (refuseHAImport). A region record must be in this console's region
+// (the import's sentence). Then seedFileReady, size and sha256
+// (importShapeRefusal without replaces), private storage as the import
+// does, then the record as reserving, kind file, SHA256 and Bytes set, no
+// Replaces and no VerifyHash. Answers 201 with the record view. A fleet
+// record is refused here until slice 3 (FS-20's fleet sentence stays
+// seedPlacementRefusal's).
+func (s *Server) beginFileSeed(w http.ResponseWriter, r *http.Request, c seedCreate, req seedImportReq)
+// seedFileReady is seedRegionReady with the file protocol: the published
+// floor's Min must be at least seeds.FileSeedProtocol (FS-25), and every
+// region box must report at least max(FileSeedProtocol, floor.Min). The
+// existing doors keep calling seedRegionReady unchanged (minimum
+// RequiredProtocol). No one-box rule: a region file seed is --from-shaped.
+func (s *Server) seedFileReady(ctx context.Context, region string) *doorRefusal
+```
+- `importGate` gains an `upload bool` argument. Only the PUT passes true, and only the PUT accepts a `file` seed. Stopped, commit and abort still answer SD-N59 for a file seed.
+- `staleUploadRefusal`: a `file` seed waits for its upload while it is `reserving`.
+- `runImportUpload` dispatches on `seed.Kind`. The check, the deadlines and the sentences stay the same. For a file seed: put to `s.cfg.SeedData` at `seeds.SnapshotKey`, then `SeedPublishFile`. On failure, `SeedAbortFileUploadBecause`.
+- `seedStale`: a `file` seed `reserving` for more than `seedReserveTTL` is stale, as `--from` (design §3.3).
+- `seedfinish.go:124`: `KindFile` joins `KindReplica` for the region replica delete. `deleteSeedReplica` already skips anything outside this console's data bucket (`:270`).
+
+- [ ] **Step 1: Failing tests** (`seedfile_test.go`, using the import tests' fixtures in `apiinstanceimport_test.go`):
+ - `TestFileSeedBeginRegionWritesReservingRecord`: 201. The record is `file`, `reserving`, with sha256 and bytes. No snapshot is written yet. No verify token appears in the answer.
+ - `TestFileSeedUploadRegionPutsSnapshotAndPublishes`: the snapshot is at `seeds/<host>/<id>/snapshot.db` in the data bucket, and the seed goes `ready`.
+ - `TestFileSeedUploadMismatchKeepsReserving` (422) and `TestFileSeedUploadBadDatabaseAborts` (`aborted` with SD-N52's sentence).
+ - `TestFileSeedRefusesPool`, `TestFileSeedRefusesFleetUntilSlice3`, `TestFromOnFleetStillRefuses` (the sentence is unchanged).
+ - `TestFileSeedReadyRefusesFloorBelowFileProtocol` and `TestFileSeedReadyNamesBoxBelowFileProtocol`. `TestSeedRegionReadyUnchangedForImport` stays at protocol 1.
+ - `TestImportGateRefusesFileOutsideUpload` (stopped, commit and abort).
+ - `TestSeedsPassAbortsStuckFileReservation` and `TestFinishFileSeedDeletesRegionReplica`.
+ - `TestOldConsoleShapeRefusesFileBegin`: a body with `import.kind=file` and no `replaces`, through `importShapeRefusal` alone, is a 400 with nothing written. That is what an old console does (Decision D2).
+- [ ] **Step 2:** `go test ./internal/console -run 'TestFileSeed|TestFromOnFleet|TestImportGateRefusesFile|TestSeedsPassAbortsStuckFile|TestFinishFileSeed|TestOldConsoleShape|TestSeedRegionReady' -count=1`. Expect FAIL.
+- [ ] **Step 3:** Implement. `handleAPIInstanceCreate` does not change: `req.Import != nil` already routes to `createImport`, which dispatches on `Kind`.
+- [ ] **Step 4:** Run step 2 again, then `go test ./internal/console -run 'TestImport|TestSeed|TestFrom' -count=1`: PASS.
+- [ ] **Step 5:** Record-write census entries for `Server.beginFileSeed` (new, `key:SetRecordSeed` and the create), `Server.runImportUpload` (re-pinned), `Server.seedsPass`/`seedStale` (re-pinned) and `Server.finishSeedOnce` (re-pinned). Run `go test ./internal/provision -run 'Census' -count=1`.
+- [ ] **Step 6:** Commit: `console: file seeds on a region, through the import door`.
+- [ ] **Step 7: Own review.** Opus. Name: nothing a request supplies picks a key; the record is written before the snapshot; the abort runs only while the seed still waits; import and `--from` are unchanged.
+
+### Task 6: The CLI flag, the wait, the list cell, docs and parity
+
+**Model:** Sonnet. **Own review:** no. **Census:** yes (root package).
+
+**Files:**
+- Create: `instances_seedfile.go`, `instances_seedfile_test.go`
+- Modify: `instances_cli.go` (`runInstancesCreate`: the flag, and one shared call for `--from` and `--seed-file` that keeps the existing `log.Fatalf`), `instances_seed.go` (`seedCell`), `apimode.go` (move `instanceDelete` to `instances_seedfile.go`, unchanged for now), `docs/site/cli.md` (`:1396-1400`, `:3620`), `parity/parity.tsv:67` (`--seed-file` in the `instances-create` row)
+
+**Interfaces:**
+```go
+// runSeedFileCreate: stat and hash the file; refuse 0 bytes or over 4 GiB
+// (FS-4); begin (POST .../instances with import{kind:"file",sha256,bytes});
+// then print FS-5 and stream the PUT (importUpload, reused); print FS-6;
+// poll until the seed leaves reserving: ready or placed is done, aborted or
+// rolled-back returns its reason (FS-11), with FS-12 appended for a
+// fleet-placed record. Then the created line and seedCell.
+func (s *apiSession) runSeedFileCreate(ctx context.Context, w io.Writer, a apiAcct, app, host, region, channel, environment, file, message string) error
+```
+- `--seed-file` with `--from` is refused (FS-2). With `--kind`, `--addr` or `--role` the existing SD-N36 answers. With `--restore` the existing restore sentence answers. All of these come back through the one shared seeded-create call's `log.Fatalf`, so the ratchet count stays at 6.
+- `seedCell` gains the `file` rows: FS-7 to FS-10.
+
+- [ ] **Step 1: Failing tests** (an `httptest` console in the shape of `instances_import_test.go`):
+ - `TestSeedFileCreateBeginsThenUploadsThenWaits`: the request order is POST, PUT, GET…; the output matches the Task 1 mock line for line; no `uploading` line appears before begin answers.
+ - `TestSeedFileCreateRefusalBeforeUploadPrintsNoUploadLine`.
+ - `TestSeedFileCreateAbortedPrintsReason`, and `TestSeedFileCreateAbortedOnFleetAddsHoldLine`.
+ - `TestSeedFileAndFromRefused`, `TestSeedFileEmptyOrTooLargeRefusedBeforeBegin`.
+ - `TestSeedCellFileRows` (one row each for reserving, ready, placed, aborted with a reason, and aborted without one).
+ - `go test . -run 'TestParity|TestCLIProjection' -count=1` and `go test ./internal/docsite -count=1` after `make parity-doc`.
+- [ ] **Step 2:** Run the tests above with an anchored `-run '^Test(SeedFile|SeedCellFile)'`. Expect FAIL.
+- [ ] **Step 3:** Implement. `docs/site/cli.md`: one paragraph and one example under the existing `instances create` heading, for the region case. Line 3620 names `--seed-file` beside `--from` and `import`.
+- [ ] **Step 4:** Run step 2 again, `make parity-doc` (expect a clean diff after), and the docsite and parity tests: PASS.
+- [ ] **Step 5:** Commit: `cli: carlos instances create --seed-file`.
+
+### Task 7: Slice 1 finish: copy pin, census, ratchet, branch review
+
+**Model:** Sonnet for steps 1 to 4. Fable for the branch review. Astra for the census verdict.
+
+- [ ] **Step 1:** Create `approved_fleet_seeded_copy_test.go` in the shape of `approved_platform_accounts_copy_test.go`. Pin every row this slice wires (FS-1 to FS-12, FS-20, FS-25 and the docs row). `go test . -run '^TestApprovedFleetSeededCopy' -count=1`: PASS.
+- [ ] **Step 2: Census.** `make census-card`. Write CLAIMS: `internal/seeds/seeds.go` and `floor.go` (constants, no read); `internal/provision/seed.go` (new transitions and `Unfinished`, no read); `internal/provision/reconcile.go` and `seedreconcile.go` (the kind check, no new read); root package files (new flag and command path, no root read). Then `make census-propose NAME=fleet-seeded-create-1 CLAIMS=<file>`.
+- [ ] **Step 3:** `make code-health` (PASS, then `make code-health-record` for the `apimode.go` move), `gofmt -l .` (empty), both cross-builds.
+- [ ] **Step 4:** Push to amadan. Describe the branch (`amadan branch describe`).
+- [ ] **Step 5: Whole-branch review.** Fable, briefed from the template with this slice's diff and the design. The census verdict goes to Astra and is recorded on #280. Budget: three rounds.
+- [ ] **Step 6:** Merge with `amadan branch merge -squash -expect <tip>` once CI is green. Subject: `Seed files for region instances (#1139, slice 1)`.
+- [ ] **Step 7 (dev, after merge):** dev boxes take the release (and carlos.prev is at it, or excluded). Then the dev console. Then `carlos system seeds-floor publish --min-release <release>` on dev, which writes `Min 3`. Then the visible witness: `--seed-file` on a dev region app, first wake, data present, snapshot gone. Record it on the branch discussion.
+
+---
+
+## Slice 2: the box release for fleet file seeds
+
+Ships boxes only. Nothing a member can do changes until slice 3's console opens the door, so a slice-2 box never meets a fleet file seed before the floor carries its protocol. The hub routing (design: slice 3) moves here. The hub is the edge on a platform box, and boxes roll first.
+
+### Task 8: Fleet keys and the fleet protocol
+
+**Model:** Haiku (the code is below). **Own review:** no. **Census:** yes.
+
+**Files:** `internal/seeds/seeds.go`, `internal/seeds/floor.go`, `internal/seeds/seeds_test.go`
+
+```go
+const FleetFileSeedProtocol = 4 // a box that places a file seed on a customer fleet (fleet seeded create design §3.4)
+const ProtocolVersion = 4
+
+// FleetSnapshotPrefix is one fleet file seed's prefix in the deployment
+// bucket: apps/<sqid>/<app>/seeds/<host>/<id>/. Inputs that fail
+// release.ValidAccount, release.ValidApp or Check yield seeds/!invalid/invalid/,
+// as SnapshotPrefix does, so no key built here leaves the seed's own prefix.
+func FleetSnapshotPrefix(sqid, app, host, id string) string
+func FleetSnapshotKey(sqid, app, host, id string) string // + "snapshot.db"
+// FleetSnapshotsPrefix is one app's: apps/<sqid>/<app>/seeds/ (the sweep's listing).
+func FleetSnapshotsPrefix(sqid, app string) string
+func ParseFleetSnapshotKey(key string) (sqid, app, host, id string, ok bool)
+```
+
+- [ ] **Step 1:** Failing tests: `TestFleetSnapshotKeyShape`, `TestFleetSnapshotKeyRefusesBadParts` (`../x`, `ABC`, a bad id, an empty app), and `TestParseFleetSnapshotKeyRoundTrip`. `go test ./internal/seeds -count=1`: FAIL.
+- [ ] **Step 2:** Implement. Run the tests again: PASS.
+- [ ] **Step 3:** Commit: `seeds: fleet snapshot keys and protocol 4`.
+
+### Task 9: Per-instance seed temp files and purge
+
+**Model:** Sonnet. **Own review:** no, Task 10's review covers it (same placement path). **Census:** yes (`internal/activator`).
+
+**Files:** `internal/activator/seedplace.go` (`seedTempName :329`, `purgeSeedTarget :388-409`, `placeSeed :420`), `internal/activator/seedplace_test.go`
+
+- `seedTempName(base, id)` = `".seed-" + base + "-" + id + ".tmp"`. `base` is the database's file name (`<host>.db`), so it is one clean path element.
+- `purgeSeedTarget(dir, base)` removes `.seed-<base>-*` with `.tmp` in the name, for any seed id. It still removes legacy `.seed-sd_*.tmp*` names, but only when `dir` is a nested instance directory, which holds one instance. Add `legacyTemps bool` and have every caller pass `layout == LayoutNested`. `PurgeSeedLocal` and `reconcileSeedMarker` take the layout from their callers.
+
+- [ ] **Step 1: Failing tests**
+ - `TestPurgeSeedTargetRemovesOnlyOwnInstanceTemps`: a flat directory with `.seed-a.example.com.db-sd_x.tmp`, `.seed-b.example.com.db-sd_y.tmp` and a legacy `.seed-sd_z.tmp`. Purging `a.example.com.db` removes only the first. With the nested flag the legacy name goes too.
+ - `TestPurgeSeedTargetRemovesEarlierSeedsLeftover`: an earlier aborted seed id's temp for the same base is removed.
+ - `TestFlatFleetTwoSeedsPlaceConcurrently`: two `placeSeed` calls on one directory for two hosts, with a fake `SeedObjects` that blocks each fetch until both have started. Both place, and neither temp is removed by the other.
+- [ ] **Step 2:** `go test ./internal/activator -run 'TestPurgeSeedTarget|TestFlatFleetTwoSeeds' -count=1`. Expect FAIL.
+- [ ] **Step 3:** Implement. Then run step 2 and `go test ./internal/activator -run 'TestSeed|TestPlaceSeed|TestReconcileSeedMarker' -count=1`: PASS.
+- [ ] **Step 4:** Commit: `activator: seed temp files carry their instance's database name`.
+
+### Task 10: Placement and rollback on a fleet box
+
+This is the task the design names for its own review (stopping rule 3; design §10). Placement (the activator) and rollback (the provision pass) are one task so that one review sees the whole invariant.
+
+**Model:** Fable. Correctness rests on several invariants at once: the fence, the marker, two prefixes and staging, on root-run code with fleet-wide reach. **Own review:** yes, Astra (the other family; it also gives the census verdict on these units). The brief names **R3-1**: the rollback proves emptiness by an exhaustive, paginated listing of both prefixes and never by `lease.HasReplica` (`internal/lease/check.go:412`). It names **R3-2**: an unplaced fleet file seed never reads staging. Admission refuses any object under `moves/<host>/`, and the retry restore runs with staging promotion off. The brief also names R2-2: a replica without this seed's marker is never restored. **Census:** yes (`internal/activator`, `internal/provision`).
+
+**Files:**
+- Create: `internal/activator/seedfleet.go`, `internal/activator/seedfleet_test.go`, `internal/provision/seedfleet.go`, `internal/provision/seedfleet_test.go`
+- Modify: `internal/activator/seedplace.go` (`SeedObjects`, `seededRestore`, `fetchSeed :493`), `internal/activator/backend_exec.go` (`restorePlain :1077`: a `noStaging` variant), `internal/provision/seedreconcile.go` (`seedAction :151`, `finishAbortedSeed`), `internal/provision/reconcile.go` (the dispatch at `:1955-1968`, through a helper)
+
+**Interfaces:**
+```go
+// internal/activator
+type SeedObjects interface {
+ Open(ctx context.Context, acct, app, host, id string) (io.ReadCloser, error)
+}
+// On ExecBackend:
+CustomerFleet bool // set by wireSeedPlacement when CARLOS_FLEET resolves (Task 12)
+// OnSeedFailed reports a terminal file-seed failure (design §3.6) with a
+// reason code: "mismatch", "not-a-database" or "copy-exists". Nil off a
+// fleet: the wake fails and logs, as today.
+OnSeedFailed func(ctx context.Context, acct, app, host, id, code string) error
+// listEmpty is the staging probe, a seam over b.Mirror.List: true only for
+// a listing that answered and found nothing.
+func (b *ExecBackend) stagingEmpty(ctx context.Context, host string) (bool, error)
+
+// internal/provision
+type FleetSeedHooks struct {
+ // Report sends placed|failed|rolledback to the console door.
+ Report func(ctx context.Context, acct, app, host, id, op, code string) error
+ // ListPrefix lists every key under prefix in the fleet's own bucket,
+ // exhaustively (release.Store.List, which paginates). An error is
+ // "not proven".
+ ListPrefix func(ctx context.Context, prefix string) ([]string, error)
+ // ReplicaPrefix is the box's replica key prefix (cfg.Prefix).
+ ReplicaPrefix string
+}
+// On SeedHooks: Fleet *FleetSeedHooks (nil off a fleet).
+
+// rollbackFleetFileSeed is design §3.6 steps 1 to 4, and the only code that
+// may report rolledback. It runs on a pass that found no row for the host.
+func rollbackFleetFileSeed(ctx context.Context, reg *registry.Registry, cfg ReconcileConfig, rec Record, layoutNested func() (bool, error))
+```
+
+The rules, each a numbered test below:
+
+1. **Layout** (design §3.5 item 0). `seedAction` (`seedreconcile.go:151`) mints a `ready` file seed on a box whose `cfg.Region` is a fleet placement (`registry.FleetPlacement`) when the box is flat. `seededRestore` (`seedplace.go:160`) admits `LayoutFlat` when `b.CustomerFleet`. Claim control still refuses, and `LayoutForeign` still refuses.
+2. **Reading.** `fetchSeed` calls `b.Seeds.Open(ctx, rt.Account, rt.App, host, id)`.
+3. **Staging (R3-2).** For an unplaced fleet file seed (the kind is `file`, the state is not `placed`, and the box is on a customer fleet), `seededRestore` first lists `MovesPrefix(host)` through `b.Mirror`. If anything is there, it reports `copy-exists` through `OnSeedFailed` and fails the wake with FS-40. A listing error fails the wake and reports nothing (Decision D7). This runs before step 1's replica question.
+4. **Admission (R2-2).** When `hasOwnReplica` is true for such a seed, `ReadSeedMarker(dbPath)` must name `src.ID`. If it does not, or it cannot be read, report `copy-exists`, fail the wake, and restore nothing. If it does, `restoreOwn` runs through `restorePlain` with staging promotion off.
+5. **Terminal failures.** `seedMismatch` and `seedNotDB` from `placeSeed`, on a fleet file seed, call `OnSeedFailed` with `mismatch` or `not-a-database`, then fail the wake. Every other failure (an unreadable snapshot, the disk, the wake) fails the wake, reports nothing, and is retried (design §3.6).
+6. **Placed.** On a fleet box `OnSeedPlaced` is the door client's `placed` (Task 12). `SeedPlaced` and `finishPlacement` are unchanged.
+7. **Rollback.** `finishAbortedSeed` for a `file` seed on a fleet box calls `rollbackFleetFileSeed` and returns. It never deletes a snapshot or writes the record. In order:
+ 1. `cfg.ownsRecord(rec)` holds, `rollbackArmed(h)` holds, and `h.Fleet != nil`. Otherwise log and return.
+ 2. `NextFenceGen`, then `FenceForRollback(host, gen)`, with `defer LiftFence`. If it does not proceed, return.
+ 3. Under the fence, the host still has no row (`reg.Get`). If a row appeared, return.
+ 4. Purge at the path this box would mint: `NestedDBPath` when `layoutNested()` answers true, `DefaultDBPath` when it answers false, and return when it errors (Decision D5). Unlike the region rule, the purge does not depend on the marker (design step 2). It goes through `h.RemoveLocal` (`PurgeSeedLocal`, which also removes the instance's own temps).
+ 5. Still under the fence, `ListPrefix(HibernatePrefix(ReplicaPrefix, host)+"/")` and `ListPrefix(activator.MovesPrefix(host))`. Any error: log and return. Any key in either: report `failed` with `copy-in-storage` (Decision D6), log, and return.
+ 6. Both empty and step 4 done: `Report(rolledback)`. An error is logged, and the next pass tries again.
+8. **Row retirement.** The dispatch at `reconcile.go:1963` already covers `KindFile` from Task 4. On a fleet box the row goes first, then a later pass with no row rolls back, the same order as `--from`.
+
+- [ ] **Step 1: Failing tests** (activator, with the existing seed fixtures; a fake `SeedObjects`, a fake `Mirror`, `hasOwnReplica` and `OnSeedFailed`):
+ - `TestFleetFileSeedPlacesThroughStoreDoorAndReportsPlaced`: `Open` is called with the account and app, and `OnSeedPlaced` is called once.
+ - `TestFleetFileSeedCheckFailureReportsFailed`: a corrupt snapshot reports `not-a-database` once and fails the wake. No database is at the path, and the manifest's seed command never runs.
+ - `TestFleetFileSeedMismatchReportsFailed`.
+ - `TestFleetFileSeedUnreadReportsNothing`: an `Open` error reports nothing and leaves the seed retryable.
+ - `TestFleetFileSeedReplicaWithoutMarkerReportsFailed`: `hasOwnReplica` is true with no marker. It reports `copy-exists`, nothing is restored, and `restorePlain` is never called.
+ - `TestFleetFileSeedReplicaWithMarkerRestoresAndReportsPlaced`.
+ - `TestFleetFileSeedRetryRefusesStaging`: a matching marker and objects under `moves/<host>/`. It reports `copy-exists`, and `promoteStagedReplica` and the restore are never called.
+ - `TestFleetFileSeedRestoreOwnNeverPromotesStaging`: a matching marker, an empty staging listing that then changes under the restore. `restorePlain` runs with staging off, and the mirror's `List` is called only by admission.
+ - `TestFleetFileSeedStagingListErrorReportsNothing`.
+ - `TestFlatFleetBoxAdmitsFileSeed` and `TestFlatNonFleetBoxStillRefuses`.
+- [ ] **Step 2: Failing tests** (provision, with fake hooks and a temp registry):
+ - `TestFleetFileSeedRollbackReportsRolledBackWhenEmpty`: fence, purge, two listings, then one `rolledback` report. No record write and no snapshot delete.
+ - `TestFleetFileSeedRollbackListingErrorReportsNothing`: an error on the replica prefix, then the same on staging. Each reports nothing.
+ - `TestFleetFileSeedRollbackOrphanedGenerationHolds` (R3-1): the replica prefix lists `g-0001/0000/...` with no `head.json`. The report is `failed` with `copy-in-storage`, never `rolledback`.
+ - `TestFleetFileSeedRollbackWithStagedObjectsHolds` (R3-2).
+ - `TestFleetFileSeedRollbackFenceDeclinedDoesNothing`, and `TestFleetFileSeedRollbackRowAppearedUnderFence`.
+ - `TestFleetFileSeedRollbackPurgesFlatPath`: a flat box purges `DefaultDBPath` and its instance's temps only.
+ - `TestFleetFileSeedRollbackNotOwnerDoesNothing`: a record labelled for another box.
+ - `TestFleetFileSeedInterruptedPlacementHoldsHostname` (R2-2, deterministic): run placement with a fake replica upload, a `placed` report that fails, then `SeedAbort`. The next pass retires the row. The pass after it purges, finds the replica, and holds. Empty the fake bucket's prefix, and the next pass reports `rolledback`. Then a second seed id at that host places its own snapshot. Assert the bytes placed are the second snapshot's.
+ - `TestRegionFileSeedRollbackUnchanged`: off a fleet, Task 4's path.
+- [ ] **Step 3:** `go test ./internal/activator -run 'TestFleetFileSeed|TestFlat' -count=1` and `go test ./internal/provision -run 'TestFleetFileSeed|TestRegionFileSeed' -count=1`. Expect FAIL.
+- [ ] **Step 4:** Implement. Keep `seededRestore`'s new branches in `seedfleet.go` behind one call, so `seededRestore` gains a few lines, not a block.
+- [ ] **Step 5:** Run step 3 again, plus `go test ./internal/activator -run 'TestSeed|TestRestore|TestStaging' -count=1` and `go test ./internal/provision -run 'TestSeed|TestAborted' -count=1`: PASS.
+- [ ] **Step 6:** Commit: `activator, provision: place and roll back file seeds on a fleet box`.
+- [ ] **Step 7: Own review.** Astra, from `REVIEW-BRIEF-TEMPLATE.md`, against this task's diff. The brief quotes design §3.6 whole and names R3-1, R3-2 and R2-2 with their tests. It asks for a verdict on each of the eight rules above, and states the census units this task changes. Three-round budget. Rule 2 applies to the abandonment family: a second round with a finding in it goes to Paul with the cut options, not a third fix.
+
+### Task 11: The heartbeat carries the seeds floor
+
+**Model:** Sonnet. **Own review:** no. **Census:** yes (`internal/host`, `internal/status`).
+
+**Files:**
+- Create: `internal/host/seedsfloorprobe.go`, `internal/host/seedsfloorprobe_test.go`
+- Modify: `internal/host/seedsfloor.go` (`withSeedsFields :57-68`), `internal/host/rootseedsfloor.go` (`withRootSeedsFields :143`), `internal/status/snapshot.go` (`Probes`, `BoxMetrics`, `CollectBox`'s presence check `:1299` and literal `:1331`), and one existing helper that `statusLoop` already calls (`claimReport` or `fillUpdateProbes`) to set the probe. `agent.go` does not grow.
+
+**Interfaces:**
+```go
+// internal/status
+type SeedsFloorReport struct {
+ Protocol int `json:"protocol"` // the build's seeds.ProtocolVersion
+ MinRelease string `json:"min_release,omitempty"` // armed floor; "" = none armed
+ PrevAllowedFor string `json:"prev_allowed_for,omitempty"` // carlos.prev's verdict
+ FloorState string `json:"floor_state,omitempty"` // root floor guard
+ FloorGeneration uint64 `json:"floor_generation,omitempty"`
+ MovesFloorState string `json:"moves_floor_state,omitempty"`
+ MovesFloorGeneration uint64 `json:"moves_floor_generation,omitempty"`
+}
+// Probes.SeedsFloor and BoxMetrics.SeedsFloor *SeedsFloorReport `json:"seeds_floor,omitempty"`.
+// PrevRelease is already in the heartbeat (snapshot.go:671).
+
+// internal/host
+// seedsFloorFields is withSeedsFields' (and withRootSeedsFields') logic as
+// one value, so the edges file and the heartbeat are filled by the same code.
+func seedsFloorFields(dataDir, optDir string) status.SeedsFloorReport
+```
+The design asks for three fields. The region rule the fleet check mirrors reads seven (`seedfloor.go:79-89`), so the heartbeat carries all seven (Decision D3).
+
+- [ ] **Step 1: Failing tests:** `TestSeedsFloorFieldsSameForEdgesFileAndHeartbeat` (both writers, over the same temp dirs, agree field by field, root guard armed and not); `TestCollectBoxCarriesSeedsFloor` (with and without the block, and the presence check unchanged); `TestStatusLoopSetsSeedsFloor` (a source check, in the style of the named-units plan's `TestAdoptRunsNamedUnitsStepBeforeConfigSync`).
+- [ ] **Step 2:** `go test ./internal/host -run 'TestSeedsFloorFields|TestStatusLoopSetsSeedsFloor' -count=1` and `go test ./internal/status -run TestCollectBoxCarriesSeedsFloor -count=1`. Expect FAIL.
+- [ ] **Step 3:** Implement. Run step 2 again and `go test ./internal/host -run 'TestSeedsFloor|TestEdgesFile' -count=1`: PASS.
+- [ ] **Step 4:** Commit: `status: the heartbeat carries the seeds floor`.
+
+### Task 12: Fleet wiring: the snapshot reader, the door client, the floor read
+
+**Model:** Opus. **Own review:** yes, Opus, for the store-door grant (a security gate that root reads through). The wiring is covered by the branch review. **Census:** yes (`internal/host`, `internal/edge`).
+
+**Files:**
+- Create: `internal/host/seedfleetdoor.go`, `internal/host/seedfleetdoor_test.go`
+- Modify: `internal/host/seedwiring.go` (`wireSeedPlacement`), `internal/edge/storedoor.go` (`aclRead :688-701` and its comment), `internal/edge/storedoor_test.go`
+
+**Interfaces:**
+```go
+// fleetSeedObjects streams seeds.FleetSnapshotKey(acct, app, host, id)
+// through the deployment store (the fleet door's release.Opener).
+type fleetSeedObjects struct{ s release.Store }
+// fleetSeedDoor posts {"id":..., "code":...} to
+// /api/fleet/seeds/<acct>/<app>/<host>/<op> with the replica client's
+// headers (internal/host/replicacoordinator.go:104-111): Bearer token and
+// Carlos-Tunnel-Name <fleet>/<box>. 200 is done. 409 is "the record says
+// otherwise" (logged; the next pass decides from the record). Anything else
+// is an error to retry.
+type fleetSeedDoor struct{ base, fleet, box, token string; client *http.Client }
+func (d fleetSeedDoor) report(ctx context.Context, acct, app, host, id, op, code string) error
+```
+- `wireSeedPlacement`: when `resolveFleetIdentity(os.Getenv)` succeeds, set `eb.CustomerFleet`. `eb.Seeds` becomes `fleetSeedObjects{deploy}`, and `eb.OnSeedPlaced` and `eb.OnSeedFailed` go to the door. `h.Fleet` becomes `&provision.FleetSeedHooks{Report, ListPrefix: data.List, ReplicaPrefix: box.Prefix}`. On a fleet `h.DeleteReplica` is nil-safe: `rollbackArmed` keeps requiring it, so it is set to a function that refuses. The fleet path never calls it. `storeSeedObjects.Open` takes and ignores the account and app.
+- `aclRead`: grant exactly `seeds.FloorKey`. It is one more exact key in the `switch` at `:692`, never a prefix. The comment explains why: a deployment-wide floor, no account data, read by the agent and by root (`rootseedsfloor.go:102`). Write stays console-only.
+
+- [ ] **Step 1: Failing tests:** `TestStoreDoorGrantsSeedsFloorReadOnly` (GET is allowed; PUT, DELETE and a listing of `control/` are refused; `control/seeds-protocol.jsonx` and `control/moves-protocol.json` are refused); `TestFleetSeedObjectsOpensFleetKey`; `TestFleetSeedDoorHeadersAndBody`; `TestFleetSeedDoor409IsNotRetried`; `TestWireSeedPlacementFleetUsesDoor` (fleet env set: the door-backed hooks, `CustomerFleet` true; unset: today's hooks).
+- [ ] **Step 2:** `go test ./internal/edge -run TestStoreDoorGrantsSeedsFloor -count=1` and `go test ./internal/host -run 'TestFleetSeed|TestWireSeedPlacementFleet' -count=1`. Expect FAIL.
+- [ ] **Step 3:** Implement. Run step 2 again and `go test ./internal/edge -run 'TestStoreDoor|TestACL' -count=1`: PASS.
+- [ ] **Step 4:** Commit: `host, edge: fleet boxes read seed snapshots and the seeds floor`.
+- [ ] **Step 5: Own review.** Opus, on the `aclRead` change. Name AGENTS.md's "a rule stated as an absence cannot see a second door": the grant must be one exact key, and both listing paths (`aclListScope`, `aclDir`) must stay closed to `control/`.
+
+### Task 13: The hub routes the seeds door to the console
+
+**Model:** Haiku. **Own review:** no. **Census:** yes (`internal/edge`).
+
+**Files:** `internal/edge/replicaconsole.go`, `internal/edge/edge.go:2412`, `internal/edge/replicaconsole_test.go`
+
+```go
+// boxConsolePath: the box doors the hub hands to the local console, POST
+// only, with a clean path and no raw path: /api/fleet/replicas/ and
+// /api/fleet/seeds/.
+func boxConsolePath(r *http.Request) bool
+```
+`edge.go:2412`'s condition becomes `if boxConsolePath(r) {`, so `ServeHTTP` does not grow.
+
+- [ ] **Step 1:** Failing test: `TestHubRoutesFleetSeedsToConsole` (POST is routed; GET, `..` paths and an encoded path are not). Run `go test ./internal/edge -run 'TestHubRoutesFleetSeeds|TestReplicaConsole' -count=1`: FAIL.
+- [ ] **Step 2:** Implement. Run it again: PASS.
+- [ ] **Step 3:** Commit: `edge: the hub routes /api/fleet/seeds/ to the console`.
+
+### Task 14: Slice 2 finish: census, ratchet, branch review
+
+**Model:** Sonnet for the mechanics. Fable for the branch review. Astra for the census verdict.
+
+- [ ] **Step 1: Census.** `make census-card`. CLAIMS, one line per changed unit. Name the reads each unit adds:
+ - `aclRead` grants a read of `control/seeds-protocol.json`;
+ - the root floor refresh now gets an answer through the door on a fleet box, where before it read as absent;
+ - `fleetSeedObjects.Open` reads the deployment bucket through the door;
+ - `rollbackFleetFileSeed` lists two prefixes in the fleet's own bucket and reads the registry under the fence;
+ - `seededRestore` reads the seed marker and lists `moves/<host>/`;
+ - `purgeSeedTarget` reads the directory, with a narrower match.
+
+ Then `make census-propose NAME=fleet-seeded-create-2 CLAIMS=<file>`.
+- [ ] **Step 2:** Record-write census: `rollbackFleetFileSeed` and the door client write no record (they report). If the inventory carries `seedPlacedHook`, re-pin it.
+- [ ] **Step 3:** `make code-health`, `gofmt -l .`, both cross-builds.
+- [ ] **Step 4:** Push and describe the branch. **Whole-branch review:** Fable. The brief carries the design's round history and Task 10's review result. Astra gives the census verdict, recorded on #280.
+- [ ] **Step 5:** Merge once CI is green. Subject: `Box release for seed files on customer fleets (#1139, slice 2)`.
+
+---
+
+## Slice 3: the console's fleet path
+
+### Task 15: The fleet seeds door
+
+**Model:** Opus. **Own review:** yes, Opus. This is a security gate: a box identity writes a record transition. **Census:** none (`internal/console`). Record-write census: yes.
+
+**Files:**
+- Create: `internal/console/apifleetseeds.go`, `internal/console/apifleetseeds_test.go`
+- Modify: `internal/console/routedecls.go` (three declarations after `:438`), `internal/console/linkedpolicy.go` (three `linkedRefuse` rows after `:296`), `parity/parity.tsv:267` (the `box-doors` row gains the three patterns); then `make parity-doc`
+
+**Interfaces:**
+```go
+// POST /api/fleet/seeds/{account}/{app}/{host}/placed|failed|rolledback
+// fleetSeedRecord authenticates exactly as replicaFleetRecord
+// (replicacoordinator.go:22-56): the tunnel name and token belong to the
+// fleet, and the record is placed on "fleet/<fleet>", not retired. Then:
+// the seed is kind file, and the caller owns the record: FleetBox names it,
+// or there is no FleetBox and soleActiveFleetBox answers the caller. Any
+// failure is the byte-identical http.NotFound, before anything about the
+// record is revealed.
+func (s *Server) fleetSeedRecord(r *http.Request) (*provision.Record, string, bool)
+func (s *Server) handleFleetSeedPlaced(w http.ResponseWriter, r *http.Request)
+func (s *Server) handleFleetSeedFailed(w http.ResponseWriter, r *http.Request)
+func (s *Server) handleFleetSeedRolledBack(w http.ResponseWriter, r *http.Request)
+// Body: {"id": "<seed id>", "code": "<code>"}. replicaPayload's rules
+// (DisallowUnknownFields, one document, 8 KiB). code is only for failed:
+// "mismatch" | "not-a-database" | "copy-exists" | "copy-in-storage",
+// mapped to FS-27 to FS-30 here. The box never supplies text (Decision D4).
+```
+Under `withRecordLock`, `fleetSeedRecord` runs again, and then:
+- `placed`: `SeedPlace(id)`. A record already `placed` with this id is a no-op success. Then delete `seeds.FleetSnapshotKey` from `s.cfg.Releases` (absent is fine), and bump the serial.
+- `failed`: `SeedFail(id, sentence)`, then bump the serial.
+- `rolledback`: `SeedRolledBack(id)` (already `rolled-back` with this id is fine). Then `finishSeed`, which deletes the fleet snapshot and the record (Task 16), and bump the serial.
+- `provision.ErrSeedConflict` answers 409 with nothing changed. Any other error answers 502.
+
+- [ ] **Step 1: Failing tests:**
+ - `TestFleetSeedDoorRefusals`: another fleet's token, another box, a labelled record naming another box, an unlabelled record on a fleet with two active boxes, a region record, an `import` or `replica` seed, a malformed host. Each answers the identical 404 body with the record unchanged. A stale seed id answers 409 with the record unchanged.
+ - `TestFleetSeedDoorPlacedDeletesSnapshotOnce`: the first call moves to `placed` and deletes the snapshot. A repeat answers 200 and changes nothing.
+ - `TestFleetSeedDoorFailedMapsCodes`: each code gets its sentence, and an unknown code is a 400.
+ - `TestFleetSeedDoorRolledBackFinishes`: the record is gone, the snapshot is gone, and the hostname can be created again.
+ - `TestFleetSeedDoorRolledBackOnlyFromAborted`: a `ready` seed answers 409.
+ - The route and parity checks: `go test ./internal/console -run 'TestLinkedPolicyCoversEveryAppRoute|TestParityTableCoversConsoleRoutes' -count=1`, then `go test . -run '^TestParity' -count=1` after `make parity-doc`.
+- [ ] **Step 2:** `go test ./internal/console -run 'TestFleetSeedDoor' -count=1`. Expect FAIL.
+- [ ] **Step 3:** Implement. Run step 2 and the route checks: PASS.
+- [ ] **Step 4:** Record-write census: the three handlers (`key:SetRecordSeed`), new.
+- [ ] **Step 5:** Commit: `console: the fleet seeds door`.
+- [ ] **Step 6: Own review.** Opus. Name AGENTS.md's ordered gates and the byte-identical 404. Name ownership, re-checked under the lock. The door acts only on the record's own seed id, and it is the only route to `rolled-back` for a fleet file seed.
+
+### Task 16: Begin, upload, readiness, sweep, finish and delete on a fleet
+
+**Model:** Opus. **Own review:** yes, Opus. The task changes admission, deletes in the deployment bucket, and changes the delete door, which releases hostnames. **Census:** yes for the root CLI change in step 3's delete output. Record-write census: yes.
+
+**Files:**
+- Modify: `internal/console/seedfile.go` (the fleet branch of `beginFileSeed`, `seedFleetReady`), `apiinstanceimport.go` (the fleet key in `runImportUpload`; the `file` rule in `importDeleteRule :1012`), `seedsweep.go` (`StartSeedsPass :66-78`, `seedsPass`, `snapshotDecision`), `seedfinish.go` (`finishSeedOnce :79-146`), `seedfile_copy.go`
+- Modify (root): `instances_seedfile.go` (`instanceDelete` reads a 202 pending answer), `instances_cli.go` (`runInstancesDelete` prints the console's sentence for it, with no new `log.Fatal`)
+- Test: `seedfile_test.go`, `seedsweep_test.go`, `seedfinish_test.go`, `apiinstanceimport_test.go`, `instances_seedfile_test.go`
+
+**Interfaces and rules:**
+```go
+// seedFleetReady (design §3.4): the floor is published and usable, with
+// Min >= seeds.FleetFileSeedProtocol (else FS-25). The fleet's registry
+// boxes with status "active", and the fleet's heartbeats read whole
+// (status.LoadBoxesComplete on the "fleets/<fleet>/" prefix store, as
+// teamFloorCandidates does, teamfloor.go:66-110). For each active box: a
+// fresh heartbeat with Metrics, Layout and SeedsFloor (else FS-22, 503,
+// box logged); SeedsFloor.Protocol >= max(FleetFileSeedProtocol,
+// floor.Min); MinRelease == floor.MinRelease; PrevRelease "none" or
+// PrevAllowedFor == floor.MinRelease; the root rule of seedfloor.go:86
+// (else FS-23, 409, boxes named); no HostClaimEnabled (FS-24); Layout.Mode
+// nested or flat (FS-26). Ownership: the record must be ownable by one box
+// (design §3.4). The seed door runs before fleet labelling
+// (apiinstances.go:2545 vs :2569), so a file seed's record is created
+// unlabelled, and the fleet must have exactly one active box (FS-21;
+// Decision D8). Zero active boxes is FS-22.
+func (s *Server) seedFleetReady(ctx context.Context, fleet string) *doorRefusal
+```
+- **Begin.** A fleet-placed record (`registry.FleetPlacement(c.placed)`) skips the region and data-bucket checks and calls `seedFleetReady`. The rest is as Task 5. A pool is still FS-20.
+- **Upload.** For a fleet record, the put goes to `s.cfg.Releases` at `seeds.FleetSnapshotKey`, create-only (`release.PutObjectFrom` with `""`, as `putSnapshot` does). The upload's readiness re-check calls `seedFleetReady`.
+- **Sweep.** `StartSeedsPass` no longer returns when `SeedData` is nil. Only the region half needs it. A second listing, for each fleet-placed app (`fleetPlacedApps`, `fleetsecretskey.go:361`, over every account with a fleet), runs `ListMod(seeds.FleetSnapshotsPrefix(sqid, app))` on `s.cfg.Releases`. It must be a `release.ModLister`, or the fleet half deletes nothing and logs. `ParseFleetSnapshotKey` and the same `snapshotDecision` decide, so an aborted fleet file seed's snapshot is deleted while its record stays aborted (R3-3). Step 6 (finish `rolled-back`) is unchanged. It only ever meets a fleet file seed that the door moved to `rolled-back`, which is after proof. The sweep never moves a fleet file seed to `rolled-back`.
+- **Finish.** `finishSeedOnce`: a fleet-placed record deletes its snapshot from `s.cfg.Releases` at the fleet key and does not need `SeedData`. The replica delete (`:124`) is skipped for a fleet record. `deleteSeedReplica` already refuses one (`:270`), and that is now explicit.
+- **Delete (Decision D9).** `importDeleteRule :1012` today hands every non-import record to the ordinary delete. For a fleet-placed `file` seed:
+ - not yet `placed` (`reserving`, `ready`): `SeedAbort(id)`, bump the serial, and answer 202 `{"state":"aborting","message":FS-13}`;
+ - `aborted` with no reason: 409 FS-33;
+ - `aborted` with FS-30: 409 FS-34;
+ - `rolled-back`: `finishSeed`;
+ - `placed`: the ordinary delete.
+
+ A region `file` seed keeps `--from`'s ordinary delete.
+
+- [ ] **Step 1: Failing tests:**
+ - `TestFileSeedBeginFleetWritesDeploymentKey`: begin and upload. The record is `ready`, and the snapshot is at `apps/<sqid>/<app>/seeds/<host>/<id>/snapshot.db` in the deployment bucket. Nothing is in the data bucket. A region app is unchanged (Task 5's test still passes).
+ - `TestSeedFleetReadyNamesBoxes`: one box missing `seeds_floor`, then one at protocol 3. Each is refused with the box named. `TestSeedFleetReadyStaleHeartbeat` is a 503. `TestSeedFleetReadyRefusesTwoActiveBoxes`, `TestSeedFleetReadyRefusesClaimControl`, `TestSeedFleetReadyAdmitsFlat`.
+ - `TestFromOnFleetStillRefuses` (kept).
+ - `TestSeedsPassDeletesAbortedFleetFileSnapshotKeepsRecord` (R3-3), `TestSeedsPassAbortsStuckFleetFileReservation`, `TestSeedsPassDeletesOrphanFleetSnapshotAfterAnHour`, `TestSeedsPassFleetHalfRunsWithoutSeedData`.
+ - `TestFleetFileSeedNoOwnerNeverFinished`: an aborted fleet file seed whose fleet has no active box. Sweeps and finishes leave the record alone, and the hostname stays held.
+ - `TestDeleteFleetFileSeedBeforePlacementAborts` and `TestDeleteHeldFleetFileSeedRefuses` (with and without FS-30). `TestDeleteRegionFileSeedIsOrdinary`.
+ - `TestFinishFleetFileSeedUsesDeploymentKey`.
+ - Root: `TestInstancesDeletePendingPrintsSentence`.
+- [ ] **Step 2:** Run the console tests with `-run 'TestFileSeedBeginFleet|TestSeedFleetReady|TestSeedsPass|TestFleetFileSeedNoOwner|TestDelete.*FileSeed|TestFinishFleetFileSeed'` and the root test anchored. Expect FAIL.
+- [ ] **Step 3:** Implement. Run step 2 again, then `go test ./internal/console -run 'TestSeed|TestImport|TestFrom|TestFinish' -count=1`: PASS.
+- [ ] **Step 4:** Record-write census: `beginFileSeed`, `runImportUpload`, `seedsPass`, `finishSeedOnce` and `importDeleteRule`, re-pinned.
+- [ ] **Step 5:** Commit: `console: seed files on a customer fleet`.
+- [ ] **Step 6: Own review.** Opus. Name the invariant: nothing on the console moves a fleet file seed to `rolled-back` or deletes its record except after the door's `rolledback`. Name R3-3: the snapshot goes on abandonment, the record stays. Name the readiness rule against design §3.4.
+
+### Task 17: Slice 3 finish: docs, copy pin, census, branch review
+
+**Model:** Haiku for docs and the copy pin. Fable for the branch review.
+
+- [ ] **Step 1:** `docs/site/cli.md`: the fleet case under `instances create`: the one-box rule, the held hostname, and how a fleet owner frees it (remove the host's prefix in the fleet's bucket). `go test ./internal/docsite -count=1`.
+- [ ] **Step 2:** Pin the rest of the copy table in `approved_fleet_seeded_copy_test.go` (FS-13, FS-20 to FS-34, FS-40). `go test . -run '^TestApprovedFleetSeededCopy' -count=1`.
+- [ ] **Step 3:** Census for the root CLI change (`make census-card`, CLAIMS, `make census-propose NAME=fleet-seeded-create-3`). `make code-health`, `gofmt -l .`, `make parity-doc` (clean).
+- [ ] **Step 4:** Push and describe. **Whole-branch review:** Fable, with Tasks 15 and 16's review results. Astra gives the census verdict.
+- [ ] **Step 5:** Merge once CI is green. Subject: `Seed files on customer fleets (#1139, slice 3)`.
+
+---
+
+## Slice 4: rollout, then Eleven
+
+Order (AGENTS.md "rollout order"; design §6): boxes, then the floor, then the console, dev before flagship. The floor needs two publishes, because the publish door writes the console build's own protocol (`seedfloor.go:201`, Decision D10). Nothing opens before the second publish: the doors require `floor.Min >= 4`.
+
+### Task 18: Dev
+
+**Model:** Opus (operator, through `carlos`, never box commands). **Own review:** no.
+
+- [ ] **Step 1:** Cut the dev release with slices 1 to 3. Dev boxes take it through their system channel. Confirm through `carlos system status` that every dev box, and every box of the dev test fleet, runs it. Confirm that carlos.prev is at it, or excluded, on each.
+- [ ] **Step 2:** `carlos system seeds-floor publish --min-release <release>` on dev (raises `min_release`).
+- [ ] **Step 3:** Roll the dev console. Publish again with the same `--min-release`. The new console writes `Min 4`.
+- [ ] **Step 4: Witness (design §5, end to end).** On a fleet-placed dev app: `carlos instances create --seed-file`, then the first wake. Check that the replica is in the fleet's bucket and that the snapshot has left the deployment bucket (`instances list` shows placed). Then a deliberately corrupt file: the console refuses it at upload. Then a delete before the first wake: the hostname is freed after the box's pass. Record the commands and answers on the branch discussion.
+
+### Task 19: Flagship
+
+**Model:** Opus. Needs Paul's go (production; AGENTS.md scoped approval).
+
+- [ ] **Step 1:** Write the scoped plan for Paul: the release tag, the carloku-infrastructure `?ref=` bump, the order of Task 18 steps 1 to 3, the verification and the rollback (the floor only rises; a console rollback leaves the doors shut). Wait for the go.
+- [ ] **Step 2:** Run it in Task 18's order, with Task 18's checks.
+
+### Task 20: Eleven seeds its four services
+
+**Model:** Opus, with Paul. Eleven-side steps follow the messenger repo's own rules (`./deploy/ops`, no hand-run cookbooks).
+
+- [ ] **Step 1:** Check fleet `eleven`: `carlos fleets` shows exactly one active box (FS-21), or Paul rules on Decision D8 first. A create attempt that is refused names any box that is below the floor or missing the heartbeat block.
+- [ ] **Step 2:** For each of push, connect, home and cloud: take a consistent snapshot of its SQLite database on the old machine, with the service stopped or through SQLite's backup API, through the messenger repo's ops path. Then `carlos instances create --app <svc> --host <host> --seed-file <svc>.db [--environment <env>]`, and wake it once. `instances list` must show it placed.
+- [ ] **Step 3:** Cut each service over (DNS and clients) on Eleven's side. That is outside this platform plan.
+
+---
+
+## Copy table (pending UX pass and copy review)
+
+`%s` and `%d` are filled as named. Reused rows are listed so the copy review sees the whole flow, but they are not re-pinned.
+
+**CLI** (`instances_seedfile.go`, constants `cliSeedFileCopy*`)
+
+| id | text | status |
+|---|---|---|
+| FS-1 | (flag) start the new instance from this SQLite database file, at most 4 GiB. Not with --from | pending |
+| FS-2 | --seed-file and --from can’t be used together | pending |
+| FS-3 | could not read %s. Check the path and try again | pending |
+| FS-4 | %s must be more than 0 bytes and at most 4 GiB | pending |
+| FS-5 | uploading %s (%s) | reused (the import's line, `instances_import.go:203`) |
+| FS-6 | checking %s. A large database can take a few minutes. | pending |
+| FS-7 | (SEED cell, reserving) uploading a seed file | pending |
+| FS-8 | (SEED cell, ready) seed file waiting for first start | pending |
+| FS-9 | (SEED cell, placed) seeded from a file %s | pending |
+| FS-10 | (SEED cell, aborted with a reason) not created: %s | pending |
+| FS-11 | the seed file was not kept, so %s was not created. Try again | pending |
+| FS-12 | the hostname stays taken until the fleet’s box has cleaned up | pending |
+| FS-13 | %s is being deleted. Its hostname is free once its box has cleaned up. | pending (console sends, CLI prints) |
+| — | a seeded instance is an ordinary instance. Drop --kind, --addr and --role. | reused (SD-N36) |
+| — | (create success line and "the host comes live on the next reconcile pass on its box") | reused |
+
+**Console, JSON errors the CLI prints** (`internal/console/seedfile_copy.go`)
+
+| id | text | status |
+|---|---|---|
+| FS-20 | %s places its instances in a pool, so it cannot take a seeded instance. | pending |
+| FS-21 | fleet %s has more than one active box. A seeded instance needs a fleet with one active box for now. | pending |
+| FS-22 | could not confirm every box in fleet %s. Try again in a minute. | pending |
+| FS-23 | %s in fleet %s are below the seeds floor. Update the platform on those boxes, then try again. | pending |
+| FS-24 | %s in fleet %s run with claim control on. Seeded instances are not supported there yet. | pending |
+| FS-25 | This deployment’s seeds floor predates seed files. An operator publishes it again with carlos system seeds-floor publish. | pending |
+| FS-26 | %s in fleet %s run instances in a layout seeds do not support. | pending |
+| FS-27 | the file on the box did not match its upload, so it was not used | pending (Seed.Reason) |
+| FS-28 | the file is not a database that passes an integrity check, so it was not used | pending (Seed.Reason) |
+| FS-29 | a copy of data already exists for this hostname | design §3.6 (Seed.Reason) |
+| FS-30 | a copy of its data is still in the fleet’s storage | design §3.6 (Seed.Reason) |
+| FS-33 | %s is already being deleted. Its hostname is free once its box has cleaned up. | pending |
+| FS-34 | %s keeps its hostname because a copy of its data is still in the fleet’s storage. Remove the host’s copy from the fleet’s bucket, and the hostname is freed on the box’s next pass. | pending |
+| — | the upload is not a database that passes an integrity check, so it was not kept. (and the other upload sentences) | reused (SD-N52, SD-N61, SD-N67) |
+| — | %s places its instances in a pool or on a fleet, so it cannot take a seeded instance. | reused, unchanged, for `--from` and import |
+
+**Member-facing wake sentence** (`internal/activator/seedfleet.go`, through `carlos logs`, as `SeedPlacementError` sentences are)
+
+| id | text | status |
+|---|---|---|
+| FS-40 | %s could not start from its seed: a copy of data already exists for this hostname. | pending |
+
+**Docs** (`docs/site/cli.md`): the `--seed-file` paragraph and example (slice 1); the fleet paragraph (slice 3); the seeds-floor line at `:3620`. All pending, and reviewed as prose in the same pass.
+
+## Decisions this plan makes that the design does not pin
+
+- **D1. Two protocol numbers.** The design gives file seeds one protocol, "one above today's". The plan uses 3 for region file seeds (slice 1) and 4 for fleet file seeds (slice 2). One number shipped in slice 1 would let a slice-1 fleet box pass a fleet check it cannot serve, and holding the bump to slice 2 would make slice 1 invisible (stopping rule 6). Fleet doors therefore require two above today's.
+- **D2. The begin rides the `import` object with `kind: "file"`.** It is the import door's begin, literally. Create bodies are decoded leniently (`authcli.go:656`), so a new top-level field sent to an old console would be dropped, and an empty ordinary instance created. An old console instead refuses the `import` body before writing anything: on a fleet with `seedPlacementRefusal`, on a region with `importShapeRefusal`'s `replaces` sentence. That sentence is confusing, but nothing is written.
+- **D3. The heartbeat carries seven fields, not three** (Task 11). The fleet check is the region check's rule (`seedfloor.go:79-89`), which reads the floor's `min_release` match, carlos.prev's verdict, and the root and moves floor states.
+- **D4. The box sends a reason code, not text.** The console maps each code to an approved sentence, so a box never writes text that a member reads.
+- **D5. The fleet rollback purges at the path the box would mint** (nested or flat, by its layout reader). The design says "the row's own database path", but the rollback runs only on a pass with no row (Gap G4).
+- **D6. `SeedFail` also sets `Reason` on an already-aborted file seed** (code `copy-in-storage`, FS-30). This is how `instances list` can show design §3.6's sentence (Gap G5).
+- **D7. A staging listing error on admission fails the wake and reports nothing.** It is retried. Objects under staging report `failed`. Both readings are fail-closed (Gap G6).
+- **D8. A fleet file seed needs a fleet with exactly one active box.** This is the design's one-box rule, given that the seed door runs before labelling (Gap G1).
+- **D9. The delete door aborts an unplaced fleet file seed** instead of deleting its record, and refuses a second delete while the record holds the hostname (Gap G3).
+- **D10. The floor is published twice in the rollout** (Gap G2).
+- **D11. File seeds refuse an HA region** (`refuseHAImport`), as the import does. The design does not mention HA.
+
+## Design gaps found while planning
+
+- **G1. Fleet seed records are created unlabelled.** The create door hands every seed over before fleet labelling: `unlockFleet` and the handover at `internal/console/apiinstances.go:2545-2557` come before `fleetCreateLabel` at `:2569`. A box treats an unlabelled fleet record as its own (`internal/provision/reconcile.go:553`). On a fleet with two or more active boxes, every box would mint and place the seed, and no box would own it at the door. The plan refuses those fleets (D8). The alternative is to label at begin, which takes the fleet lock during begin; begin is quick for a file seed, because the upload is a separate call. Paul's call. Eleven's fleet must have one active box, or wait for that ruling.
+- **G2. The floor cannot be advanced before the console.** `handleAPISystemSeedsFloor` publishes `Min: seeds.ProtocolVersion` of the console's own build (`internal/console/seedfloor.go:201`), so only the new console can write `Min 4`. Design §6's "floor, then console" becomes a publish of `min_release` before the console and a second publish after it (D10). It stays safe throughout: doors stay shut until `Min >= 4`.
+- **G3. No delete path aborts a non-import seed.** `importDeleteRule` sends every non-import record to the ordinary delete (`internal/console/apiinstanceimport.go:1012`), which would release a fleet file seed's hostname with no proof. Design §3.6 lists "the member (`instances delete` before placement)" as an abort, so the plan adds that path (D9) and two sentences (FS-33, FS-34).
+- **G4. "The row's own database path" is not available at rollback.** The rollback runs only on a pass that finds no row, because `retireAbortedSeedRow` removes it first (`internal/provision/reconcile.go:1963`, `seedreconcile.go:205`). See D5.
+- **G5. Nothing carries "a copy of its data is still in the fleet’s storage" to the record.** When cleanup is unproven, design §3.6 has the box report nothing, but it also wants `instances list` to show that reason. The door's only reason-bearing op, `failed`, moves `ready` to `aborted`. D6 widens `SeedFail` to set the reason on an aborted seed. If Paul declines, the reason is not shown.
+- **G6. "Refuses ... if any object is there or the listing fails"** (design §3.6, staging) can be read as "report `failed`" for a listing error, which would make a transient S3 error terminal. The plan fails the wake and retries (D7). That is fail-closed either way.
+- **G7. A one-hour reserving deadline against the upload's own deadlines.** The sweep aborts a `file` seed reserving for over an hour (`seedReserveTTL`, `internal/console/seedsweep.go:36`). The upload door allows an hour of reading (`apiinstanceimport.go:299`), 30 minutes of checking (`:287`) and 20 minutes of putting (`apiinstanceseed.go:55`). A large upload can be aborted while still progressing, and its put then lands as an orphan the sweep deletes. Eleven's files are tens of MB. A larger file needs a longer TTL for `file`, or a re-stamp when the upload starts.
+- **G8. The design's names differ from the code's.** `provision.SeedReady` is `SeedPublishReplica` (`internal/provision/seed.go:165`), and `SeedPlaced` is `SeedPlace` (`:189`). The floor fields' producer is `withSeedsFields` (`internal/host/seedsfloor.go:57`), not `edgesfile.go:478`, which only declares them.
+- **G9. The floor read arms every customer fleet, not only Eleven's.** The `aclRead` grant is deployment-wide. Once a fleet box runs slice 2 it arms the published floor, and its recovery then refuses a carlos.prev below it (`carlos-system-recover`). That is a behaviour change for every fleet owner, and it should be in the slice 2 release note.
+- **G10. `lock.json` sits under the replica prefix** (`internal/lease/lease.go:232`). It is deleted on release, but kept by `Abandon` (`lease.go:715,722`). An exhaustive listing counts it, so a seed whose lease was abandoned holds its hostname until the fleet owner clears the prefix, even if no data was ever uploaded. This is consistent with the invariant. It may surprise people.
+
+## Out of scope
+
+- `create --from <sibling>` on a fleet (ruling 5). It keeps refusing with its current sentence.
+- Import onto a fleet or a pool, and file seeds in a pool.
+- A fenced fleet-side delete of a leftover replica (design option (c)). The fleet owner clears their own bucket.
+- Labelling a seeded record at create (G1), and multi-box fleets for seeds.
+- Claim-control boxes and consoles (they keep refusing), and foreign layouts.
+- Console UI for seeds (CLI only), and a console page for the held-hostname state.
+- Eleven's DNS and client cutover for the four services, and the old machines' retirement.
+- Changing the region `file` seed's failure handling: a mismatch on a region box fails the wake and is retried, as `--from` does today.