carlos / platform Public

slice 2: review fixes

The whole-branch review (Fable) and the census verdict (Codex) on slice
2, neither with a P1.

Census P2. restorePlain is back in backend_exec.go as the one-line
wrapper, so it keeps its census identity; restorePlainStaging stays the
extraction. Claims corrected and census-propose re-run: the overlay,
chain line and card are regenerated.

P2-1. A fleet box whose door wiring fails stays a fleet box
(eb.CustomerFleet = onFleet). The fleet rules hold and placement fails
at "no seed reader"; it no longer falls back to a region box's rules.

P2-2. PurgeSeedLocalFor decides the old-style temp names by the path's
shape (rt.DBPath is the host's nested path), not by classifying the
row. The region rollbacks pass a route with no socket, which classified
as foreign, so their legacy .seed-sd_* temps were no longer purged.

P3-1. A fleet file seed's replica is its own only with the marker and
the database at the row's path (seedPlacedAt). A marker alone is a
placement that never finished.

P3-3. A 409 from the seeds door is provision.ErrFleetSeedNotAccepted.
The rollback logs it as not accepted; the wake's two reports still take
it as done.

P3-4. The heartbeat's seeds-floor probe resolves the box label once.

P3-2 (a held hostname is re-proved every pass) is a follow-up line in
the plan, not fixed.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Paul Campbell pushed by paul@keymail.dev 957edfd1062fcce9cf73553d8e615a23495b1bf5 parent f0cdb90
16 files changed, +321 −79
  • docs/superpowers/notes/census-fleet-seeded-create-2-claims.tsv +3 −4
  • docs/superpowers/notes/census-proposal-fleet-seeded-create-2.md +5 −12
  • docs/superpowers/plans/2026-11-20-fleet-seeded-create.md +2 −0
  • internal/activator/backend_exec.go +9 −2
  • internal/activator/seedfleet.go +16 −16
  • internal/activator/seedfleet_linux_test.go +115 −10
  • internal/activator/seedplace.go +12 −3
  • internal/activator/seedpurge_linux_test.go +50 −0
  • internal/host/seedfleetdoor.go +16 −6
  • internal/host/seedfleetdoor_test.go +32 −4
  • internal/host/seedsfloorprobe.go +8 −1
  • internal/host/seedwiring.go +5 −1
  • internal/provision/seedfleet.go +16 −3
  • internal/provision/seedfleet_linux_test.go +18 −0
  • internal/provision/testdata/plan14-root-reads-chain.tsv +1 −1
  • internal/provision/testdata/plan14-root-reads-fleet-seeded-create-2.tsv +13 −16

CI failed — run details

diff --git a/docs/superpowers/notes/census-fleet-seeded-create-2-claims.tsv b/docs/superpowers/notes/census-fleet-seeded-create-2-claims.tsv
index e0fcefb01..28be76eca 100644
--- a/docs/superpowers/notes/census-fleet-seeded-create-2-claims.tsv
+++ b/docs/superpowers/notes/census-fleet-seeded-create-2-claims.tsv
@@ -8,16 +8,15 @@ internal/host/seedwiring.go:storeSeedObjects.Open Signature gains two ignored le
internal/provision/seedreconcile.go:seedAction The ready-seed mint question goes through seedMintRefusal(rec, cfg, nested): the same nested() layout read, now also refusing a file seed on a customer fleet whose box cannot report (fleetRollbackArmed). Only more refusals; a nested-only mint, as before for every seed. No read added.
internal/status/snapshot.go:CollectBox Copies Probes.SeedsFloor into BoxMetrics.SeedsFloor and counts it in the metrics gate; a pure copy of a value the agent filled, the same 28 read sites, no read added.
internal/activator/seedplace.go:ExecBackend.seededRestore Fleet file seeds: (1) refuses a flat layout for every seed (paths.layout != LayoutNested, nested only); (2) on a fleet file seed not yet placed lists moves/<host>/ through b.Mirror.List (fleetSeedStagingRefusal) before the replica question, and refuses if anything is staged or the listing fails; (3) when the host has a replica, reads the <db>.seed marker (ReadSeedMarker, a nofollow read of the marker beside the database) and restores only if it names this seed; (4) restores with staging promotion off; (5) reports a coded failure through reportSeedFailure; (6) purges via purgeSeedTarget's held-descriptor PurgeProven. The route reads (+whole:Route x2) are passing rt on to placeSeed and PurgeSeedLocalFor. The agent as carlos, not root; every path it names comes from the registry row, not from a tenant.
-internal/activator/backend_exec.go:ExecBackend.restorePlain Renamed: the body moved to restorePlainStaging, and restorePlain (seedfleet.go) is its one-line wrapper with staging on. Moved, not deleted: nothing it checked is gone.
+internal/activator/backend_exec.go:ExecBackend.restorePlain Now a one-line wrapper in the same file: restorePlainStaging(ctx, rt, true). Its body moved, whole, to restorePlainStaging below it (an extraction, not a deletion: nothing it checked is gone). Reads only rt (whole:Route), passing it on; no read of its own. Every caller but a fleet file seed's retry still reaches the same body with the staging fallback on.
internal/activator/backend_exec.go:ExecBackend.restorePlainStaging The body of the former restorePlain, with one parameter: staging. With false (a fleet file seed's retry alone) the promoteStagedReplica call is skipped, so nothing under moves/<host>/ is read or promoted. With true it is byte-for-byte the former path. It passes b.pathsFor(rt).layout to reconcileSeedMarker. The reads are the former restorePlain's (os.Stat of the database and the route fields), now under this name.
internal/activator/seedfleet.go:ExecBackend.reportSeedFailure Reads the route's account, app and host to hand to b.OnSeedFailed, only for a fleet file seed whose error carries a code (mismatch, not-a-database, copy-exists); no filesystem read. The report is best effort and logged; it writes no record (the door does).
-internal/activator/seedfleet.go:ExecBackend.restorePlain Wrapper: restorePlainStaging(ctx, rt, true). Reads only rt (whole:Route), passing it on; no read of its own.
-internal/activator/seedplace.go:ExecBackend.PurgeSeedLocalFor New: PurgeSeedLocal for rt's database in the layout this backend finds rt in (b.pathsFor(rt).layout) beneath b.DataDir. Reads rt.DBPath and the route; the removal and proof are instancefs.PurgeProven's. Replaces the hook's direct PurgeSeedLocal(rt.DBPath).
+internal/activator/seedplace.go:ExecBackend.PurgeSeedLocalFor New: PurgeSeedLocal for rt's database beneath b.DataDir. Whether old-style .seed-sd_*.tmp names are removed too is decided by the path's shape (rt.DBPath == provision.NestedDBPath(b.DataDir, rt.Host)), not by classifying the row: the rollbacks pass a route built from a path with no socket. Reads rt.DBPath and rt.Host; the removal and proof are instancefs.PurgeProven's, no symlink followed.
internal/activator/seedplace.go:ExecBackend.placeSeed Takes the route rather than the host, to name the fetch temp (seedTempName(base, id), which now carries the database's name so a purge for one flat instance cannot remove another's fetch) and to pass rt.Account, rt.App to the reader. The same fetch, check and rename; the reads are the host and route fields.
internal/activator/seedplace.go:ExecBackend.fetchSeed Takes the route and opens the snapshot with rt.Account, rt.App, rt.Host (a fleet reader's key needs them). Adds only the account and app route fields to the read set; the object read, length and sha256 limits are unchanged.
internal/activator/seedplace.go:PurgeSeedLocal Now PurgeSeedLocal(dataDir, dbPath, layout): resolves the directory beneath dataDir (or its parent when outside) and calls instancefs.PurgeProven with provision.SeedLocalName(base, nested); the former Lstat and purgeSeedTarget reads are inside PurgeProven, so the unit reads nothing itself now. Absent directory is still done; a path that was replaced is ErrNotProven.
internal/activator/seedplace.go:purgeSeedTarget Now purgeSeedTarget(dir, base, legacyTemps): one call to instancefs.PurgeProven(dir, ".", SeedLocalName(base, legacyTemps)) in place of os.ReadDir plus RemoveAllBeneath. The directory is opened once, no symlink followed, and held; so the unit reads nothing itself. Matches only this database's names and, for a nested directory, the old .seed-sd_ temps.
-internal/host/seedwiring.go:wireSeedPlacement On a fleet box (CARLOS_FLEET resolves) it arms the door client and armFleetSeeds; reads the fleet identity and CARLOS_TUNNEL_URL/TOKEN from the environment through Getenv. A fleet box with no door arms nothing. The RemoveLocal hook now calls eb.PurgeSeedLocalFor(rt), which reads the layout from the backend rather than rt.DBPath alone. The DBPath read went into PurgeSeedLocalFor.
+internal/host/seedwiring.go:wireSeedPlacement On a fleet box (CARLOS_FLEET resolves) it sets eb.CustomerFleet, whether or not the door wires, so the fleet placement rules hold on a box that lost its door (which then has no seed reader and places nothing); with the door it arms the door client and armFleetSeeds. Reads the fleet identity and CARLOS_TUNNEL_URL/TOKEN from the environment through Getenv. The RemoveLocal hook now calls eb.PurgeSeedLocalFor(rt), where the DBPath read went.
internal/host/seedfleetdoor.go:fleetSeedObjects.Open New: streams apps/<acct>/<app>/seeds/<host>/<id>/snapshot.db from the deployment store (the store door's client on a fleet box) after ValidAccount, ValidApp and seeds.Check. The two +file:Open sites are release.Opener's Open on a store, and not a local path; the key is built from checked parts, never from tenant input. Refuses a store that cannot stream.
internal/instancefs/purge_linux.go:identityOf New: fstat of an already-open descriptor to get (dev, ino). No path is opened.
internal/instancefs/purge_linux.go:namesIn New: openat(dir, ".") on a held directory descriptor, then Readdirnames: lists the directory the descriptor holds, never a path. The listing is the directory's own entry names, which a tenant could have created; they are only matched against SeedLocalName and removed relative to the descriptor, never opened.
diff --git a/docs/superpowers/notes/census-proposal-fleet-seeded-create-2.md b/docs/superpowers/notes/census-proposal-fleet-seeded-create-2.md
index 74fb5176d..8e1a46589 100644
--- a/docs/superpowers/notes/census-proposal-fleet-seeded-create-2.md
+++ b/docs/superpowers/notes/census-proposal-fleet-seeded-create-2.md
@@ -1,6 +1,6 @@
# Census approval: fleet-seeded-create-2
-Ruling `census-ruling-fleet-seeded-create-2`. The independent reviewer approves or rejects every change below, 14 with a new disposition; nothing goes to the census owner (Paul, #280, 2026-10-26).
+Ruling `census-ruling-fleet-seeded-create-2`. The independent reviewer approves or rejects every change below, 13 with a new disposition; nothing goes to the census owner (Paul, #280, 2026-10-26).
| unit | change | read sites | what changed |
|---|---|---|---|
@@ -13,20 +13,13 @@ Ruling `census-ruling-fleet-seeded-create-2`. The independent reviewer approves
| `internal/host/seedwiring.go` `storeSeedObjects.Open` | body | unchanged (2) | Signature gains two ignored leading parameters (acct, app) to satisfy activator.SeedObjects; a region box still streams seeds/<host>/<id>/snapshot.db from its own data bucket after seeds.Check. No read changed. |
| `internal/provision/seedreconcile.go` `seedAction` | body | unchanged (9) | The ready-seed mint question goes through seedMintRefusal(rec, cfg, nested): the same nested() layout read, now also refusing a file seed on a customer fleet whose box cannot report (fleetRollbackArmed). Only more refusals; a nested-only mint, as before for every seed. No read added. |
| `internal/status/snapshot.go` `CollectBox` | body | unchanged (28) | Copies Probes.SeedsFloor into BoxMetrics.SeedsFloor and counts it in the metrics gate; a pure copy of a value the agent filled, the same 28 read sites, no read added. |
+| `internal/activator/backend_exec.go` `ExecBackend.restorePlain` | sites | -file:Stat, -registry:Host, -whole:Route ×10 | Now a one-line wrapper in the same file: restorePlainStaging(ctx, rt, true). Its body moved, whole, to restorePlainStaging below it (an extraction, not a deletion: nothing it checked is gone). Reads only rt (whole:Route), passing it on; no read of its own. Every caller but a fleet file seed's retry still reaches the same body with the staging fallback on. |
| `internal/activator/seedplace.go` `ExecBackend.seededRestore` | sites | +whole:Route ×2 | Fleet file seeds: (1) refuses a flat layout for every seed (paths.layout != LayoutNested, nested only); (2) on a fleet file seed not yet placed lists moves/<host>/ through b.Mirror.List (fleetSeedStagingRefusal) before the replica question, and refuses if anything is staged or the listing fails; (3) when the host has a replica, reads the <db>.seed marker (ReadSeedMarker, a nofollow read of the marker beside the database) and restores only if it names this seed; (4) restores with staging promotion off; (5) reports a coded failure through reportSeedFailure; (6) purges via purgeSeedTarget's held-descriptor PurgeProven. The route reads (+whole:Route x2) are passing rt on to placeSeed and PurgeSeedLocalFor. The agent as carlos, not root; every path it names comes from the registry row, not from a tenant. |
Envelopes re-pinned: `internal/activator`, `internal/edge`, `internal/host`, `internal/instancefs`, `internal/lease`, `internal/provision`, `internal/seeds`, `internal/status`.
-Removed units: the scan finds neither the declaration nor any of its sites.
-
-| unit | recorded disposition | basis | what changed |
-|---|---|---|---|
-| `internal/activator/backend_exec.go` `ExecBackend.restorePlain` | legacy, task accepted-legacy | accepted-legacy;rev3=census-ruling-seeded-instances;basis=the agent (/opt/carlos/carlos agent, carlos-edge.service, user carlos): body of the frozen ExecBackend.Restore, which is now its dispatcher, with the seed marker reconciled before the warm-cache check; same staging fallback and replica restore;rev3=census-ruling-region-ha-p1a;basis=the agent as carlos: first asks haRestore(ctx, rt) (+whole:Route x2: rt to haRestore and to restoreHA); an HA host restores through restoreHA (hawake.go, a new unit) and never through the warm cache or the staging fallback; an error there fails the restore; a non-HA host takes the unchanged path;rev3=census-ruling-managed-fleets-1b;basis=managed fleets 1b (Task 3, rule 6 start rule): the +whole:Route sites are calls taking rt: reconcileAssignment before the seed-marker check (a labelled row's copy not kept under rt.Assigned is moved into <DataDir>/.superseded/<host>/, never deleted), startAllowed on the warm-cache, restored and fresh paths (a labelled row may refuse with ErrNothingToRestore), and establishAssignment after a restore and before a fresh boot (writes the <db>.assigned marker). Task 6a's record clear after a restore is removed. An unlabelled row (Assigned "") takes none of these. Agent, not root; it refuses more, never less.;rev3=census-ruling-ha-generations;basis=storage generations: an HA host's restore is dispatched to restoreHAWake (generations-aware) instead of restoreHA directly; Task 7: promoteStagedReplica refuses a host with head.json before promotion; read sites unchanged | Renamed: the body moved to restorePlainStaging, and restorePlain (seedfleet.go) is its one-line wrapper with staging on. Moved, not deleted: nothing it checked is gone. |
-
Review: a model from the other family than the author reads the branch's diff against main on the amadan.net remote (`origin` or `amadan`, whichever points at amadan.net) and gives a verdict for every unit and every re-pinned envelope above. For a unit, compare the change with its recorded disposition and basis below; for an envelope, read every changed function in the package and what it reaches. Reject if the change lets root open, run, query or follow anything it did not before from a path or input a tenant, an app or a box agent can create, write or name; if it weakens a check, refusal, validation, argument or environment the basis relies on; or if the diff cannot settle either. Otherwise approve. Record each verdict on #280 with the tip. A rejected unit goes back to the author to correct; nothing escalates to the census owner.
-A removed unit's recorded disposition and basis are in its table above. For a removed unit or a retired envelope, confirm from the diff that the code is deleted and not moved: a read that moved shows on this card as a change to the unit that took it, and a unit moved whole shows as a new unit, a decision. Reject if a check, refusal or validation that root relies on goes with the deleted code and its callers' changes on this card do not account for that.
-
Recorded dispositions, which each change must still satisfy:
- `internal/activator/hawake.go` `ExecBackend.haRestorePrelude`: legacy, task accepted-legacy. Basis: accepted-legacy;rev3=census-ruling-ha-generations;basis=new (Task 5): the containment, seed-obligation and seed-marker checks restoreHA already ran, factored out for both restore paths; same reads
@@ -38,14 +31,14 @@ Recorded dispositions, which each change must still satisfy:
- `internal/host/seedwiring.go` `storeSeedObjects.Open`: legacy, task accepted-legacy. Basis: accepted-legacy;rev3=census-ruling-seeded-instances;basis=the agent (/opt/carlos/carlos agent, carlos-edge.service, user carlos): streams seeds/<host>/<id>/snapshot.db for the seed fallback and refuses a store that cannot stream
- `internal/provision/seedreconcile.go` `seedAction`: legacy, task accepted-legacy. Basis: accepted-legacy;rev3=census-ruling-seeded-instances;basis=the agent (/opt/carlos/carlos agent, carlos-edge.service, user carlos): the per-record dispatch for seeded records: handle as an ordinary record, swap, finish an abort, or skip;rev3=census-ruling-agent-start-demo-3;basis=Dispatch demo-claim seed states to their dedicated fresh-route, gate and abort handling instead of legacy import. Census read-site delta: +registry:ImportGate ×2, +whole:Route ×5.
- `internal/status/snapshot.go` `CollectBox`: legacy, task accepted-legacy. Basis: accepted-legacy;rev3=J1;basis=root-route;rev3=census-ruling-rootfs-apps-2;basis=copies Probes.RootfsReady and RootfsBlocked into BoxMetrics (private, like Layout); the same 28 sites, no read added;rev3=census-ruling-instance-egress-sizes-328-329;basis=#328 plan 2 Task 11 and #329 plan 3 Task 7: copies Probes.Egress and Probes.SizeCommittedMiB into BoxMetrics (private, like Layout) and counts them in the condition that builds Metrics; the same 28 sites, no read added.;rev3=census-ruling-rootfs-apps-3;basis=rootfs Plan 3: comment only, the Hibernate count is left as is (display);rev3=census-ruling-regional-domains-447;basis=#447 Task 7: copies Probes.AliasesRead into BoxMetrics.AliasesRead (json aliases_read, omitempty) and counts it in the condition that builds Metrics; the same 28 sites, no read added;rev3=census-ruling-fleet-alerts-1;basis=copies Probes.DiskFullETAHours into BoxMetrics.DiskFullETAHours (json disk_full_eta_hours, omitempty; private, like Layout) and counts it in the condition that builds Metrics; the same 28 sites, no read added;rev3=census-ruling-edge-held-streams;basis=copies Probes.HeldStreams into BoxMetrics.HeldStreams (json held_streams, omitempty, additive) and counts it in the condition that builds Metrics; the same 28 sites, no read added.;rev3=census-ruling-stateless-replicas-3;basis=Fix round 1 Q20: carry already-supplied ReplicaCopies into a separate optional private BoxMetrics replica_copies field; allow copy evidence alone to create the metrics block. Upstreams retains address probes only. Existing 28 Route read sites unchanged; no filesystem, bucket, console or CLI read.;rev3=census-ruling-agent-start-demo-3;basis=Report claim-seed protocol capability only when explicitly configured and runtime moved readiness only when armed; dormant status keeps its original JSON shape. Census read-site delta: unchanged (28).;rev3=census-ruling-stateless-replicas-4-task5;basis=Task 5 (#511 R16 and its amendment): copies Probes.PrevRelease and Probes.ApplyFinished into BoxMetrics (json prev_release and apply_finished, omitempty; private, like Release) and counts them in the condition that builds Metrics; the same 28 sites, no read added.;rev3=census-ruling-offline-move-stage-refusals-339;basis=#339: copies Probes.OfflineMove into BoxMetrics.OfflineMove (json offline_move, omitempty; private, like Layout) and counts it in the condition that builds Metrics; the same 28 sites, no read added.;rev3=census-ruling-platform-mail-submission;basis=Task 3: copies Probes.MailerArmed into BoxMetrics.MailerArmed (json mailer_armed, omitempty; private, like Layout) and counts it in the condition that builds Metrics; the same 28 sites, no read added.;rev3=census-ruling-named-units-param-114;basis=named-units-param-114 Task 6: copies Probes.NamedUnits into BoxMetrics.NamedUnits (json named_units, omitempty; private) and counts it in the condition that builds Metrics; the same 28 sites, no read added
+- `internal/activator/backend_exec.go` `ExecBackend.restorePlain`: legacy, task accepted-legacy. Basis: accepted-legacy;rev3=census-ruling-seeded-instances;basis=the agent (/opt/carlos/carlos agent, carlos-edge.service, user carlos): body of the frozen ExecBackend.Restore, which is now its dispatcher, with the seed marker reconciled before the warm-cache check; same staging fallback and replica restore;rev3=census-ruling-region-ha-p1a;basis=the agent as carlos: first asks haRestore(ctx, rt) (+whole:Route x2: rt to haRestore and to restoreHA); an HA host restores through restoreHA (hawake.go, a new unit) and never through the warm cache or the staging fallback; an error there fails the restore; a non-HA host takes the unchanged path;rev3=census-ruling-managed-fleets-1b;basis=managed fleets 1b (Task 3, rule 6 start rule): the +whole:Route sites are calls taking rt: reconcileAssignment before the seed-marker check (a labelled row's copy not kept under rt.Assigned is moved into <DataDir>/.superseded/<host>/, never deleted), startAllowed on the warm-cache, restored and fresh paths (a labelled row may refuse with ErrNothingToRestore), and establishAssignment after a restore and before a fresh boot (writes the <db>.assigned marker). Task 6a's record clear after a restore is removed. An unlabelled row (Assigned "") takes none of these. Agent, not root; it refuses more, never less.;rev3=census-ruling-ha-generations;basis=storage generations: an HA host's restore is dispatched to restoreHAWake (generations-aware) instead of restoreHA directly; Task 7: promoteStagedReplica refuses a host with head.json before promotion; read sites unchanged
- `internal/activator/seedplace.go` `ExecBackend.seededRestore`: legacy, task accepted-legacy. Basis: accepted-legacy;rev3=census-ruling-seeded-instances;basis=the agent (/opt/carlos/carlos agent, carlos-edge.service, user carlos): the seed fallback on the plain restore path: the host's own replica if it has one, else the file an earlier wake placed, else the snapshot; never reports fresh; every file through instancefs; fetches no snapshot under the claim flag;rev3=census-ruling-managed-fleets-1b;basis=managed fleets 1b (Task 3, start rule): reconcileAssignment after settleSeedObligation; startAllowed before keeping a placed seed and before placing one; on a labelled row (rt.Assigned set) a local copy still at the path is set aside (localCopyNames, supersede) before the placement's purge; establishAssignment after placement. +registry:Assigned and +whole:Route are these calls. Unlabelled rows unchanged. Agent, not root; it refuses more and deletes less.;rev3=census-ruling-agent-start-demo-3;basis=Refuse unfinished claim seeds and check the current operation-bound destination record under its lease before wake. Census read-site delta: +whole:Route.
New dispositions, which census-propose wrote and the reviewer checks against the unit's reads and the diff:
- new `internal/activator/backend_exec.go:ExecBackend.restorePlainStaging`: reads +file:Stat, +registry:Host, +whole:Route ×12; written legacy, accepted-legacy, frozen
- new `internal/activator/seedfleet.go:ExecBackend.reportSeedFailure`: reads +registry:Account, +registry:App, +registry:Host ×3; written legacy, accepted-legacy, frozen
-- new `internal/activator/seedfleet.go:ExecBackend.restorePlain`: reads +whole:Route; written legacy, accepted-legacy, frozen
-- new `internal/activator/seedplace.go:ExecBackend.PurgeSeedLocalFor`: reads +registry:DBPath, +whole:Route; written legacy, accepted-legacy, frozen
+- new `internal/activator/seedplace.go:ExecBackend.PurgeSeedLocalFor`: reads +registry:DBPath ×2, +registry:Host; written legacy, accepted-legacy, frozen
- new `internal/activator/seedplace.go:ExecBackend.placeSeed`: reads +registry:Host, +whole:Route; written legacy, accepted-legacy, frozen
- new `internal/host/seedfleetdoor.go:fleetSeedObjects.Open`: reads +file:Open ×2; written legacy, accepted-legacy, frozen
- new `internal/instancefs/purge_linux.go:identityOf`: reads +file:Fstat; written legacy, accepted-legacy, frozen
@@ -57,6 +50,6 @@ New dispositions, which census-propose wrote and the reviewer checks against the
- reads `internal/activator/seedplace.go:ExecBackend.fetchSeed`: +registry:Account, +registry:App, +registry:Host; keeps legacy, task accepted-legacy
- reads `internal/host/seedwiring.go:wireSeedPlacement`: -registry:DBPath, +whole:Route; keeps legacy, task accepted-legacy
-Seal: `5ce0990b80e0447439484d36a7a87af70708aa5ce113491aecc09d87167277f0` → `749343f4e948806a0964c1394060cf8b8102d629483a9aca341460548449c4f3`.
+Seal: `5ce0990b80e0447439484d36a7a87af70708aa5ce113491aecc09d87167277f0` → `2e93b15609a094377beb6f17c865ba4407fcde9730755e91af0a3c9fba42d855`.
Overlay: `internal/provision/testdata/plan14-root-reads-fleet-seeded-create-2.tsv`, appended to `internal/provision/testdata/plan14-root-reads-chain.tsv`.
diff --git a/docs/superpowers/plans/2026-11-20-fleet-seeded-create.md b/docs/superpowers/plans/2026-11-20-fleet-seeded-create.md
index 41bc439f0..1cf27542b 100644
--- a/docs/superpowers/plans/2026-11-20-fleet-seeded-create.md
+++ b/docs/superpowers/plans/2026-11-20-fleet-seeded-create.md
@@ -915,6 +915,8 @@ House rules applied: no em dashes; curly apostrophes; placeholders in their orde
- **P3:** SD-N2, SD-N6 and SD-N7 say "<boxes> in <region> are …", which is wrong for one box. Give them the singular-correct wording FS-23, FS-24 and FS-26 use (Paul, 2026-11-20). It changes approved seeds copy, so it goes through the copy review on its own branch.
+- **P3 (slice 2 review, P3-2):** a held hostname is re-proved on every reconcile pass, with no backoff. While a copy stays in the fleet's storage the box fences the host, purges and lists both prefixes, and reports `failed` with `copy-in-storage` again each pass, until the fleet owner clears the prefix. It is correct and idempotent, and it costs two bucket listings and a door call per pass per held seed. Back it off (remember the last answer and re-ask on a longer interval), or have the door say "already known". Not fixed in slice 2.
+
## Out of scope
- `create --from <sibling>` on a fleet (ruling 5). It keeps refusing with its current sentence.
diff --git a/internal/activator/backend_exec.go b/internal/activator/backend_exec.go
index c19e7cc3b..27baefe08 100644
--- a/internal/activator/backend_exec.go
+++ b/internal/activator/backend_exec.go
@@ -1080,8 +1080,15 @@ func (b *ExecBackend) Restore(ctx context.Context, rt registry.Route) (bool, err
return b.restorePlain(ctx, rt)
}
-// restorePlainStaging is restorePlain (seedfleet.go), with the staging
-// fallback on or off. Off is for a fleet file seed's retry alone, which
+// restorePlain is Restore for a row with no seed to place: the warm cache,
+// then the staging fallback, then the host's own replica, and fresh only
+// when there is none of the three.
+func (b *ExecBackend) restorePlain(ctx context.Context, rt registry.Route) (bool, error) {
+ return b.restorePlainStaging(ctx, rt, true)
+}
+
+// restorePlainStaging is restorePlain's body, with the staging fallback on
+// or off. Off is for a fleet file seed's retry alone, which
// never reads staging (fleet seeded create design §3.6, R3-2): the restore
// then reads the host's own prefix and nothing else.
func (b *ExecBackend) restorePlainStaging(ctx context.Context, rt registry.Route, staging bool) (bool, error) {
diff --git a/internal/activator/seedfleet.go b/internal/activator/seedfleet.go
index f7434bf31..a7354c7b2 100644
--- a/internal/activator/seedfleet.go
+++ b/internal/activator/seedfleet.go
@@ -41,13 +41,6 @@ func seedCopyExists(host string, err error) error {
Err: err, code: provision.SeedCodeCopyExists}
}
-// restorePlain is Restore for a row with no seed to place: the warm cache,
-// then the staging fallback, then the host's own replica, and fresh only
-// when there is none of the three.
-func (b *ExecBackend) restorePlain(ctx context.Context, rt registry.Route) (bool, error) {
- return b.restorePlainStaging(ctx, rt, true)
-}
-
// stagingEmpty is the staging probe, over b.Mirror.List (which lists the
// prefix whole): true only for a listing that answered and found nothing.
// A box with no bucket reader cannot answer, which is an error and never
@@ -80,18 +73,25 @@ func (b *ExecBackend) fleetSeedStagingRefusal(ctx context.Context, host string)
}
// fleetSeedReplicaRefusal is the admission rule for a host that has a
-// replica: nil only when the <db>.seed marker beside dbPath names id, which
-// is this seed's own earlier placement (the marker is written before the
-// database is renamed into place, so before any upload). No marker, another
-// seed's, or one that cannot be read does not prove the replica is this
-// seed's: reported, FS-40, and nothing is restored.
+// replica: nil only when this seed's own earlier placement is still at
+// dbPath, which is the database there together with the <db>.seed marker
+// naming id (seedPlacedAt). Both, because the marker is written before the
+// database is renamed into place: a marker alone is a placement that never
+// finished, which uploaded nothing, so a replica beside it is not this
+// seed's. No marker, another seed's, a marker with no database, or either
+// one unreadable does not prove the replica is this seed's: reported,
+// FS-40, and nothing is restored.
func fleetSeedReplicaRefusal(host, id, dbPath string) error {
- marker, err := ReadSeedMarker(dbPath)
+ dir, base, err := splitDBPath(dbPath)
+ if err != nil {
+ return seedCopyExists(host, err)
+ }
+ placed, err := seedPlacedAt(dir, base, id)
if err != nil {
- return seedCopyExists(host, fmt.Errorf("the seed marker beside %s cannot be read: %w", dbPath, err))
+ return seedCopyExists(host, fmt.Errorf("the seed's placement at %s cannot be read: %w", dbPath, err))
}
- if marker != id {
- return seedCopyExists(host, fmt.Errorf("the host has a replica, and the seed marker beside %s names %q", dbPath, marker))
+ if !placed {
+ return seedCopyExists(host, fmt.Errorf("the host has a replica, and %s is not this seed's placed database with its marker", dbPath))
}
return nil
}
diff --git a/internal/activator/seedfleet_linux_test.go b/internal/activator/seedfleet_linux_test.go
index 210620fc1..36971665a 100644
--- a/internal/activator/seedfleet_linux_test.go
+++ b/internal/activator/seedfleet_linux_test.go
@@ -98,8 +98,18 @@ func (r *fleetSeedRig) ownReplica(t *testing.T, has bool) *int {
return &n
}
-// writeMarker leaves this seed's marker beside the row's database, as the
-// placement that made the replica did.
+// writePlaced leaves this seed's database and its marker at the row's
+// path, as the placement that made the replica did.
+func (r *fleetSeedRig) writePlaced(t *testing.T) {
+ t.Helper()
+ r.writeMarker(t, r.id)
+ if err := os.WriteFile(r.rt.DBPath, r.objs.body[r.id], 0o600); err != nil {
+ t.Fatal(err)
+ }
+}
+
+// writeMarker leaves a marker naming id beside the row's database, and no
+// database: a placement cut short between its marker and its rename.
func (r *fleetSeedRig) writeMarker(t *testing.T, id string) {
t.Helper()
if err := os.MkdirAll(filepath.Dir(r.rt.DBPath), 0o700); err != nil {
@@ -279,6 +289,18 @@ func TestFleetFileSeedReplicaWithoutMarkerReportsFailed(t *testing.T) {
"no marker": func(*testing.T, *fleetSeedRig) {},
"another seed's": func(t *testing.T, r *fleetSeedRig) { r.writeMarker(t, other) },
"an empty marker": func(t *testing.T, r *fleetSeedRig) { r.writeMarker(t, "") },
+ // Slice 2 review P3-1: the marker is written before the rename, so
+ // a marker with no database is a placement that never finished and
+ // uploaded nothing. The replica beside it is not this seed's.
+ "this seed's marker and no database": func(t *testing.T, r *fleetSeedRig) { r.writeMarker(t, r.id) },
+ "this seed's marker and a database that is a link": func(t *testing.T, r *fleetSeedRig) {
+ r.writeMarker(t, r.id)
+ target := filepath.Join(t.TempDir(), "db")
+ os.WriteFile(target, r.objs.body[r.id], 0o600)
+ if err := os.Symlink(target, r.rt.DBPath); err != nil {
+ t.Fatal(err)
+ }
+ },
"a marker that is not a file": func(t *testing.T, r *fleetSeedRig) {
if err := os.MkdirAll(r.rt.DBPath+SeedMarkerSuffix, 0o700); err != nil {
t.Fatal(err)
@@ -309,8 +331,8 @@ func TestFleetFileSeedReplicaWithoutMarkerReportsFailed(t *testing.T) {
if r.restored != 0 || r.objs.opens != 0 || len(r.placed) != 0 {
t.Fatalf("restored %d, fetched %d, placed %q; want nothing restored, fetched or recorded", r.restored, r.objs.opens, r.placed)
}
- if _, err := os.Lstat(r.rt.DBPath); !os.IsNotExist(err) {
- t.Fatalf("a database is at the row's path: %v", err)
+ if fi, err := os.Lstat(r.rt.DBPath); err == nil && fi.Mode().IsRegular() {
+ t.Fatal("a database is at the row's path")
}
})
}
@@ -318,15 +340,21 @@ func TestFleetFileSeedReplicaWithoutMarkerReportsFailed(t *testing.T) {
}
func TestFleetFileSeedReplicaWithMarkerRestoresAndReportsPlaced(t *testing.T) {
+ // The lost placed report: this seed's database and marker are on the
+ // box and its replica is in the bucket. The wake keeps the local
+ // database, fetches nothing, and reports placed.
r := fleetFileSeedRig(t, false)
r.ownReplica(t, true)
- r.writeMarker(t, r.id)
+ r.writePlaced(t)
fresh, err := r.b.Restore(context.Background(), r.rt)
if err != nil || fresh {
t.Fatalf("Restore = fresh %v, %v", fresh, err)
}
- if r.restored != 1 || r.objs.opens != 0 {
- t.Fatalf("restored %d, fetched %d; want its own replica restored and no fetch", r.restored, r.objs.opens)
+ if r.objs.opens != 0 {
+ t.Fatalf("fetched %d; want no fetch", r.objs.opens)
+ }
+ if got, _ := os.ReadFile(r.rt.DBPath); !bytes.Equal(got, r.objs.body[r.id]) {
+ t.Fatal("the seed's own database was replaced")
}
if want := []string{"acct/shop/" + r.rt.Host + "/" + r.id}; !reflect.DeepEqual(r.placed, want) {
t.Fatalf("placed = %q, want %q", r.placed, want)
@@ -375,15 +403,15 @@ func TestFleetFileSeedRetryRefusesStaging(t *testing.T) {
// promoted nor dropped.
func TestFleetFileSeedRestoreOwnNeverPromotesStaging(t *testing.T) {
r := fleetFileSeedRig(t, false)
- r.writeMarker(t, r.id)
+ r.writePlaced(t)
staged := MovesPrefix(r.rt.Host) + "generations/a/snapshot"
setKnob(t, &hasOwnReplica, func(context.Context, string, string, string) (bool, error) {
r.mirror.put(r.b.Cfg.Bucket, staged, "e1") // after admission's listing
return true, nil
})
fresh, err := r.b.Restore(context.Background(), r.rt)
- if err != nil || fresh || r.restored != 1 {
- t.Fatalf("Restore = fresh %v, %v, restored %d; want its own replica restored", fresh, err, r.restored)
+ if err != nil || fresh {
+ t.Fatalf("Restore = fresh %v, %v; want its own placement kept", fresh, err)
}
if want := []string{MovesPrefix(r.rt.Host)}; !reflect.DeepEqual(r.mirror.lists, want) {
t.Fatalf("bucket listings = %q, want only admission's %q", r.mirror.lists, want)
@@ -394,6 +422,83 @@ func TestFleetFileSeedRestoreOwnNeverPromotesStaging(t *testing.T) {
if len(r.failed) != 0 {
t.Fatalf("failed reported: %q", r.failed)
}
+
+ // The restore the retry runs, with nothing local to keep: staging off
+ // reads the host's own prefix and never the bucket's staging prefix;
+ // staging on (every other restore) promotes it, as it always did.
+ for _, staging := range []bool{false, true} {
+ r := fleetFileSeedRig(t, false)
+ os.MkdirAll(filepath.Dir(r.rt.DBPath), 0o700) // lease.Restore's own MkdirAll
+ r.mirror.put(r.b.Cfg.Bucket, staged, "e1")
+ fresh, err := r.b.restorePlainStaging(context.Background(), withSeedState(t, r.rt, seeds.StatePlaced), staging)
+ if err != nil || fresh || r.restored != 1 {
+ t.Fatalf("staging %v: fresh %v, %v, restored %d", staging, fresh, err, r.restored)
+ }
+ own := r.keys(r.b.Cfg.hibernatePrefix(r.rt.Host) + "/")
+ if !staging && (len(r.mirror.lists) != 0 || len(own) != 0 || len(r.keys(MovesPrefix(r.rt.Host))) != 1) {
+ t.Fatalf("staging off: listed %q, own prefix %q; want the staged copy neither read nor promoted", r.mirror.lists, own)
+ }
+ if staging && len(own) != 1 {
+ t.Fatalf("staging on: own prefix %q; want the staged copy promoted", own)
+ }
+ }
+}
+
+// Slice 2 review P2-1: a fleet box whose door did not wire is still a fleet
+// box. It has no seed reader and no reporter, and the fleet rules still
+// hold: a replica it cannot prove is its own is never restored, the retry
+// restore never promotes staging, and with no replica the placement fails
+// at the missing reader. It never falls back to a region box's rules.
+func TestMisWiredFleetBoxKeepsFleetRules(t *testing.T) {
+ misWire := func(t *testing.T) *fleetSeedRig {
+ r := fleetFileSeedRig(t, false)
+ r.b.Seeds, r.b.OnSeedPlaced, r.b.OnSeedFailed = nil, nil, nil // wireSeedPlacement's early return
+ return r
+ }
+ t.Run("a replica with no proof is not restored", func(t *testing.T) {
+ r := misWire(t)
+ r.ownReplica(t, true)
+ fresh, err := r.b.Restore(context.Background(), r.rt)
+ requireRefusal(t, fresh, err, "a copy of data already exists")
+ if r.restored != 0 {
+ t.Fatalf("restored %d: the marker check was skipped", r.restored)
+ }
+ })
+ t.Run("staged objects refuse the wake", func(t *testing.T) {
+ r := misWire(t)
+ r.ownReplica(t, true)
+ r.writePlaced(t)
+ staged := MovesPrefix(r.rt.Host) + "generations/a/snapshot"
+ r.mirror.put(r.b.Cfg.Bucket, staged, "e1")
+ fresh, err := r.b.Restore(context.Background(), r.rt)
+ requireRefusal(t, fresh, err, "a copy of data already exists")
+ if got := r.keys(""); !reflect.DeepEqual(got, []string{staged}) {
+ t.Fatalf("the bucket now holds %q: staging was promoted", got)
+ }
+ })
+ t.Run("its own placement is kept with staging off", func(t *testing.T) {
+ r := misWire(t)
+ r.writePlaced(t)
+ staged := MovesPrefix(r.rt.Host) + "generations/a/snapshot"
+ setKnob(t, &hasOwnReplica, func(context.Context, string, string, string) (bool, error) {
+ r.mirror.put(r.b.Cfg.Bucket, staged, "e1")
+ return true, nil
+ })
+ if fresh, err := r.b.Restore(context.Background(), r.rt); err != nil || fresh {
+ t.Fatalf("Restore = fresh %v, %v", fresh, err)
+ }
+ if len(r.mirror.lists) != 1 || !reflect.DeepEqual(r.keys(""), []string{staged}) {
+ t.Fatalf("listed %q, bucket %q: the restore read staging", r.mirror.lists, r.keys(""))
+ }
+ })
+ t.Run("no replica: no seed reader", func(t *testing.T) {
+ r := misWire(t)
+ fresh, err := r.b.Restore(context.Background(), r.rt)
+ requireRefusal(t, fresh, err, "could not be read")
+ if _, err := os.Lstat(r.rt.DBPath); !os.IsNotExist(err) {
+ t.Fatalf("a database is at the row's path: %v", err)
+ }
+ })
}
// Decision D7: a staging listing that fails is not an answer. The wake
diff --git a/internal/activator/seedplace.go b/internal/activator/seedplace.go
index acdae5158..95056688d 100644
--- a/internal/activator/seedplace.go
+++ b/internal/activator/seedplace.go
@@ -410,10 +410,19 @@ func PurgeSeedLocal(dataDir, dbPath string, layout Layout) error {
return instancefs.PurgeProven(root, rel, provision.SeedLocalName(base, layout == LayoutNested))
}
-// PurgeSeedLocalFor is PurgeSeedLocal for rt's database, in the layout this
-// backend finds rt in.
+// PurgeSeedLocalFor is PurgeSeedLocal for rt's database. Whether the
+// directory is a nested one, which holds a single instance and so may lose
+// its old-style temp names, is decided by the path's shape: rt.DBPath is
+// the host's nested database path. Not by classifying the row: the
+// rollbacks hand this a route they built from a path, with no socket,
+// which classifies as neither flat nor nested, and their leftover
+// ".seed-sd_*.tmp" files would then never be removed.
func (b *ExecBackend) PurgeSeedLocalFor(rt registry.Route) error {
- return PurgeSeedLocal(b.DataDir, rt.DBPath, b.pathsFor(rt).layout)
+ layout := LayoutForeign
+ if rt.DBPath == provision.NestedDBPath(b.DataDir, rt.Host) {
+ layout = LayoutNested
+ }
+ return PurgeSeedLocal(b.DataDir, rt.DBPath, layout)
}
// ReadSeedMarker is the seed id the <db>.seed marker beside dbPath names,
diff --git a/internal/activator/seedpurge_linux_test.go b/internal/activator/seedpurge_linux_test.go
index d66f777fb..2f954f5c3 100644
--- a/internal/activator/seedpurge_linux_test.go
+++ b/internal/activator/seedpurge_linux_test.go
@@ -10,6 +10,8 @@ import (
"testing"
"github.com/carlosframework/platform/internal/instancefs"
+ "github.com/carlosframework/platform/internal/provision"
+ "github.com/carlosframework/platform/internal/registry"
)
// PurgeSeedLocal is the import rollback's local removal (preflight M12):
@@ -210,3 +212,51 @@ func TestReadSeedMarker(t *testing.T) {
t.Fatal("a relative path read")
}
}
+
+// Slice 2 review P2-2: the rollbacks hand PurgeSeedLocalFor a route built
+// from a path, with no socket, which classifies as neither flat nor nested.
+// The nested directory is known by the path's shape, so an old-style
+// ".seed-sd_*.tmp" leftover there still goes, as it did before the temp
+// names carried their database. In the flat directory, which every
+// instance shares, an old-style name is left: it may be another's.
+func TestPurgeSeedLocalForASynthesizedRoute(t *testing.T) {
+ b, rt := nestedBackend(t, &fakeControl{}, &fakeUnit{})
+ host := rt.Host
+ const legacy = ".seed-sd_aaaaaaaaaaaaaaaaaaaaaaaaaa.tmp"
+ for _, c := range []struct {
+ name string
+ db string
+ gone bool
+ }{
+ {"the nested path", provision.NestedDBPath(b.DataDir, host), true},
+ {"the flat path", provision.DefaultDBPath(b.DataDir, host), false},
+ } {
+ t.Run(c.name, func(t *testing.T) {
+ dir := filepath.Dir(c.db)
+ if err := os.MkdirAll(dir, 0o700); err != nil {
+ t.Fatal(err)
+ }
+ own := filepath.Join(dir, ".seed-"+filepath.Base(c.db)+"-sd_bbbbbbbbbbbbbbbbbbbbbbbbbb.tmp")
+ for _, p := range []string{c.db, c.db + SeedMarkerSuffix, own, filepath.Join(dir, legacy)} {
+ if err := os.WriteFile(p, []byte("x"), 0o600); err != nil {
+ t.Fatal(err)
+ }
+ }
+ synth := registry.Route{Host: host, Kind: "instance", DBPath: c.db} // as the rollbacks build it
+ if l, _ := b.Layout(synth); l == LayoutNested || l == LayoutFlat {
+ t.Fatalf("the synthesized route classifies as %v; the test proves nothing", l)
+ }
+ if err := b.PurgeSeedLocalFor(synth); err != nil {
+ t.Fatal(err)
+ }
+ for _, p := range []string{c.db, c.db + SeedMarkerSuffix, own} {
+ if _, err := os.Lstat(p); !os.IsNotExist(err) {
+ t.Errorf("%s survived", p)
+ }
+ }
+ if _, err := os.Lstat(filepath.Join(dir, legacy)); os.IsNotExist(err) != c.gone {
+ t.Errorf("the old-style temp: gone %v, want %v", os.IsNotExist(err), c.gone)
+ }
+ })
+ }
+}
diff --git a/internal/host/seedfleetdoor.go b/internal/host/seedfleetdoor.go
index cc37afb40..52a5bac02 100644
--- a/internal/host/seedfleetdoor.go
+++ b/internal/host/seedfleetdoor.go
@@ -77,9 +77,10 @@ type fleetSeedDoorBody struct {
var errSeedDoorNotConsole = errors.New("fleet seeds door: the answer did not come from the console")
// report sends one transition. 200 is done. 409 is the console's record
-// saying otherwise: it is logged and answers nil, because asking again
-// cannot change it, and the next pass decides from the record. Anything
-// else, including an answer that is not the console's, is an error for the
+// saying otherwise: it is logged and answers
+// provision.ErrFleetSeedNotAccepted, so a caller never takes it for the
+// transition applied. Asking again cannot change it, and the next pass
+// decides from the record. Anything else, including an answer that is not the console's, is an error for the
// caller to retry on its next pass.
//
// It sends only the door's vocabulary (decisions D4, D12): an op, a code
@@ -115,7 +116,7 @@ func (d fleetSeedDoor) report(ctx context.Context, acct, app, host, id, op, code
return nil
case http.StatusConflict:
log.Printf("fleet seeds door: %s: seed %s %s: the console's record says otherwise (HTTP 409); the next pass decides from the record", host, id, op)
- return nil
+ return fmt.Errorf("fleet seeds door: %s: seed %s %s: %w", host, id, op, provision.ErrFleetSeedNotAccepted)
}
return fmt.Errorf("fleet seeds door: %s: seed %s %s: HTTP %d", host, id, op, resp.StatusCode)
}
@@ -190,11 +191,20 @@ func fleetSeedWiring(getenv func(string) string) (door fleetSeedDoor, ok bool, e
// so the cause is not a mystery.
func armFleetSeeds(eb *activator.ExecBackend, h *provision.SeedHooks, door fleetSeedDoor, deploy, data release.Store, prefix string) {
eb.Seeds = fleetSeedObjects{deploy}
+ // For the wake's two reports a 409 is done: the record has moved on,
+ // the wake has nothing to retry, and the door logged it. The rollback
+ // (h.Fleet.Report) is handed the answer itself.
+ heard := func(err error) error {
+ if errors.Is(err, provision.ErrFleetSeedNotAccepted) {
+ return nil
+ }
+ return err
+ }
eb.OnSeedPlaced = func(ctx context.Context, acct, app, host, id string) error {
- return door.report(ctx, acct, app, host, id, provision.FleetSeedPlaced, "", "")
+ return heard(door.report(ctx, acct, app, host, id, provision.FleetSeedPlaced, "", ""))
}
eb.OnSeedFailed = func(ctx context.Context, acct, app, host, id, code string) error {
- return door.report(ctx, acct, app, host, id, provision.FleetSeedFailed, code, "")
+ return heard(door.report(ctx, acct, app, host, id, provision.FleetSeedFailed, code, ""))
}
if eb.Mirror == nil {
log.Printf("agent: seed files: this fleet box has no reader for its bucket's staging prefix; no seed file can be placed here")
diff --git a/internal/host/seedfleetdoor_test.go b/internal/host/seedfleetdoor_test.go
index b6268aa07..0e05b1082 100644
--- a/internal/host/seedfleetdoor_test.go
+++ b/internal/host/seedfleetdoor_test.go
@@ -3,6 +3,7 @@ package host
import (
"context"
"encoding/json"
+ "errors"
"io"
"net/http"
"net/http/httptest"
@@ -182,8 +183,10 @@ func TestFleetSeedDoorHeadersAndBody(t *testing.T) {
}
}
-// 409 is the console's record saying otherwise: logged, not an error, and
-// not asked again by the client; the next pass decides from the record.
+// 409 is the console's record saying otherwise: logged, answered with
+// provision.ErrFleetSeedNotAccepted so no caller takes it for the
+// transition applied, and not asked again by the client; the next pass
+// decides from the record.
// Every other answer that is not the console's 200 is an error the caller
// retries.
func TestFleetSeedDoor409IsNotRetried(t *testing.T) {
@@ -191,8 +194,8 @@ func TestFleetSeedDoor409IsNotRetried(t *testing.T) {
sqid, host, id := domains.Sqid(2), "shop-1.example.com", testSeedID(t)
f, d := newFakeSeedDoor(t, http.StatusConflict)
logs := captureLog(t)
- if err := d.report(ctx, sqid, "shop", host, id, provision.FleetSeedRolledBack, "", ""); err != nil {
- t.Fatalf("409 = %v, want nil", err)
+ if err := d.report(ctx, sqid, "shop", host, id, provision.FleetSeedRolledBack, "", ""); !errors.Is(err, provision.ErrFleetSeedNotAccepted) {
+ t.Fatalf("409 = %v, want ErrFleetSeedNotAccepted", err)
}
if n := len(f.seen()); n != 1 {
t.Fatalf("%d calls on a 409, want 1", n)
@@ -313,6 +316,26 @@ func TestWireSeedPlacementFleetUsesDoor(t *testing.T) {
}
})
+ // The wake's two reports take a 409 as done; the rollback's hook is
+ // handed the answer.
+ t.Run("fleet, the record says otherwise", func(t *testing.T) {
+ resetArmedSeedHooks(t)
+ srv := httptest.NewServer(&fakeSeedDoor{code: http.StatusConflict})
+ defer srv.Close()
+ eb := &activator.ExecBackend{ServedPools: testSharedPoolEvidence, NestedOK: func() error { return nil }}
+ wireSeedPlacement(eb, false, storeOpener(data), storeOpener(deploy), box(fleetEnv(srv.URL)))
+ if err := eb.OnSeedPlaced(ctx, sqid, "shop", host, id); err != nil {
+ t.Fatalf("placed on a 409 = %v, want nil", err)
+ }
+ if err := eb.OnSeedFailed(ctx, sqid, "shop", host, id, provision.SeedCodeMismatch); err != nil {
+ t.Fatalf("failed on a 409 = %v, want nil", err)
+ }
+ h := armedSeedHooks.Load()
+ if err := h.Fleet.Report(ctx, sqid, "shop", host, id, provision.FleetSeedRolledBack, "", ""); !errors.Is(err, provision.ErrFleetSeedNotAccepted) {
+ t.Fatalf("the rollback's report on a 409 = %v, want ErrFleetSeedNotAccepted", err)
+ }
+ })
+
t.Run("not a fleet", func(t *testing.T) {
resetArmedSeedHooks(t)
eb := &activator.ExecBackend{ServedPools: testSharedPoolEvidence, NestedOK: func() error { return nil }}
@@ -352,6 +375,11 @@ func TestWireSeedPlacementFleetUsesDoor(t *testing.T) {
if eb.Seeds != nil || eb.OnSeedPlaced != nil || eb.OnSeedFailed != nil || armedSeedHooks.Load() != nil {
t.Fatal("seed placement armed on a fleet box with no door")
}
+ // Still a fleet box: the fleet rules hold, and the placement
+ // fails at the missing reader. Never a region box's rules.
+ if !eb.CustomerFleet {
+ t.Fatal("CustomerFleet cleared on a fleet box whose door did not wire")
+ }
})
}
}
diff --git a/internal/host/seedsfloorprobe.go b/internal/host/seedsfloorprobe.go
index ff24f0b15..afd0e720b 100644
--- a/internal/host/seedsfloorprobe.go
+++ b/internal/host/seedsfloorprobe.go
@@ -2,6 +2,7 @@ package host
import (
"os"
+ "sync"
"github.com/carlosframework/platform/internal/release"
"github.com/carlosframework/platform/internal/status"
@@ -37,12 +38,18 @@ func seedsFloorFields(dataDir, optDir, box string, moves movesFloorContext) stat
}
}
+// seedsFloorProbeBox is this box's label, resolved once for the process:
+// metricsBoxLabel logs when a fleet identity does not resolve, and the
+// status tick would repeat that line every tick. The label is the
+// environment's and the machine id's, which do not change under an agent.
+var seedsFloorProbeBox = sync.OnceValue(func() string { return metricsBoxLabel(os.Getenv, readMachineID()) })
+
// fillSeedsFloorProbe sets the status tick's seeds-floor block from this
// box's own files. The moves context is read the way the edges file loop
// reads it (withMovesFields first), under the same box label the loop uses.
func fillSeedsFloorProbe(p *status.Probes) {
dd, opt := dataDir(), release.OptDir()
- box := metricsBoxLabel(os.Getenv, readMachineID())
+ box := seedsFloorProbeBox()
m := withMovesFields(edgesFile{Box: box}, dd, opt)
r := seedsFloorFields(dd, opt, box, movesFloorContext{State: m.MovesFloorState, Generation: m.MovesFloorGeneration})
p.SeedsFloor = &r
diff --git a/internal/host/seedwiring.go b/internal/host/seedwiring.go
index f18819cf5..4260206bb 100644
--- a/internal/host/seedwiring.go
+++ b/internal/host/seedwiring.go
@@ -162,7 +162,11 @@ type seedBox struct {
func wireSeedPlacement(eb *activator.ExecBackend, claimArmed bool, openData, openDeploy func() (release.Store, error), box seedBox) {
eb.ClaimArmed = claimArmed
door, onFleet, err := fleetSeedWiring(seedGetenv(box))
- eb.CustomerFleet = onFleet && err == nil
+ // A fleet box is a fleet box whether or not its door wired: the fleet
+ // rules (no staging, the marker rule) must hold either way, and with no
+ // reader the placement then fails at "no seed reader". Cleared, a box
+ // that only lost its door would place and restore by the region rules.
+ eb.CustomerFleet = onFleet
if err != nil {
log.Printf("agent: seed files: %v (no seed can be placed on this fleet box)", err)
return
diff --git a/internal/provision/seedfleet.go b/internal/provision/seedfleet.go
index e165980fb..6175be3b2 100644
--- a/internal/provision/seedfleet.go
+++ b/internal/provision/seedfleet.go
@@ -33,13 +33,21 @@ const (
SeedHeldBoth = "both"
)
+// ErrFleetSeedNotAccepted is the console's door answering that its record
+// says otherwise (HTTP 409): another seed id, or a state the transition
+// does not start from. The report was heard and changed nothing. Asking
+// again will not change it, and the next pass decides from the record.
+var ErrFleetSeedNotAccepted = errors.New("the console's record says otherwise")
+
// FleetSeedHooks is what a customer-fleet box needs to finish a file seed
// (design §3.6). A fleet box cannot write records, so every transition it
// makes is reported to the console's door.
type FleetSeedHooks struct {
// Report sends placed, failed or rolledback to the console door. code
// is "" except with failed, and held is "" except with code
- // copy-in-storage (decision D12).
+ // copy-in-storage (decision D12). nil is the door applying it, or
+ // having applied it before. ErrFleetSeedNotAccepted is the door
+ // refusing it against its record.
Report func(ctx context.Context, acct, app, host, id, op, code, held string) error
// ListPrefix lists every key under prefix in the fleet's own bucket,
// exhaustively (release.Store.List, which paginates). An error is "not
@@ -284,12 +292,17 @@ func rollbackFleetFileSeed(ctx context.Context, reg *registry.Registry, cfg Reco
}
held("a copy of its data is still in the fleet's storage (%d object(s) under %s, %d under %s)",
len(replica), FleetSeedReplicaPrefix(h.Fleet.ReplicaPrefix, host), len(staged), FleetSeedStagingPrefix(host))
- if err := h.Fleet.Report(ctx, rec.Account, rec.App, host, id, FleetSeedFailed, SeedCodeCopyInStorage, where); err != nil {
+ if err := h.Fleet.Report(ctx, rec.Account, rec.App, host, id, FleetSeedFailed, SeedCodeCopyInStorage, where); errors.Is(err, ErrFleetSeedNotAccepted) {
+ log.Printf("provision: %s: aborted seed %s: the copy in storage was reported and not accepted: %v", host, id, err)
+ } else if err != nil {
log.Printf("provision: %s: aborted seed %s: the copy in storage was not reported: %v", host, id, err)
}
return
}
- if err := h.Fleet.Report(ctx, rec.Account, rec.App, host, id, FleetSeedRolledBack, "", ""); err != nil {
+ if err := h.Fleet.Report(ctx, rec.Account, rec.App, host, id, FleetSeedRolledBack, "", ""); errors.Is(err, ErrFleetSeedNotAccepted) {
+ held("nothing of it is left, but the console did not accept the rollback: %v", err)
+ return
+ } else if err != nil {
held("nothing of it is left, but the console did not hear so: %v", err)
return
}
diff --git a/internal/provision/seedfleet_linux_test.go b/internal/provision/seedfleet_linux_test.go
index 6ebc8c5aa..7d5a2e751 100644
--- a/internal/provision/seedfleet_linux_test.go
+++ b/internal/provision/seedfleet_linux_test.go
@@ -3,9 +3,12 @@
package provision
import (
+ "bytes"
"context"
"errors"
+ "fmt"
"io/fs"
+ "log"
"os"
"path/filepath"
"reflect"
@@ -249,6 +252,21 @@ func TestFleetFileSeedRollbackReportsRolledBackWhenEmpty(t *testing.T) {
t.Fatalf("a fence was left: %v", box.fenced)
}
requireUntouchedByBox(t, s, cfg, rec)
+ // Slice 2 review P3-3: a rollback the console's record refuses (409) is
+ // logged as not accepted, never as rolled back.
+ var logged bytes.Buffer
+ prev := log.Writer()
+ log.SetOutput(&logged)
+ box.reportErr = fmt.Errorf("door: %w", ErrFleetSeedNotAccepted)
+ err := Reconcile(ctx, s, reg, cfg)
+ log.SetOutput(prev)
+ if err != nil {
+ t.Fatal(err)
+ }
+ if out := logged.String(); !strings.Contains(out, "did not accept the rollback") || strings.Contains(out, "reported rolled back") {
+ t.Fatalf("a refused rollback logged:\n%s", out)
+ }
+ box.reports = nil
// A report the door did not hear is sent again by the next pass.
box.reportErr = errors.New("door unreachable")
box.reports = nil
diff --git a/internal/provision/testdata/plan14-root-reads-chain.tsv b/internal/provision/testdata/plan14-root-reads-chain.tsv
index 8af8cfec5..6c1441e9c 100644
--- a/internal/provision/testdata/plan14-root-reads-chain.tsv
+++ b/internal/provision/testdata/plan14-root-reads-chain.tsv
@@ -266,4 +266,4 @@ plan14-root-reads-replica-wake-gap-ch.tsv 6c3e03c493dbca78fc128355f071caa2b2d5f2
plan14-root-reads-plan-domains-2a.tsv 89f2b0e097f2de04bcef403f0b4aaa7a56a17dc7d0000a87993f033e268fc2fa
plan14-root-reads-edge-held-cap.tsv f06c832e5595b5a0c256639131d094a94da4505d0e64586813c357cb7eea8f33
plan14-root-reads-fleet-seeded-create-1.tsv 5ce0990b80e0447439484d36a7a87af70708aa5ce113491aecc09d87167277f0
-plan14-root-reads-fleet-seeded-create-2.tsv 749343f4e948806a0964c1394060cf8b8102d629483a9aca341460548449c4f3
+plan14-root-reads-fleet-seeded-create-2.tsv 2e93b15609a094377beb6f17c865ba4407fcde9730755e91af0a3c9fba42d855
diff --git a/internal/provision/testdata/plan14-root-reads-fleet-seeded-create-2.tsv b/internal/provision/testdata/plan14-root-reads-fleet-seeded-create-2.tsv
index 1a2e333b1..edc280f77 100644
--- a/internal/provision/testdata/plan14-root-reads-fleet-seeded-create-2.tsv
+++ b/internal/provision/testdata/plan14-root-reads-fleet-seeded-create-2.tsv
@@ -1,7 +1,6 @@
# Census overlay fleet-seeded-create-2, written by census-propose (#369). census-ruling-fleet-seeded-create-2, approved on #280 before the merge; the approval card is docs/superpowers/notes/census-proposal-fleet-seeded-create-2.md.
-# 9 body, 1 sites, 8 envelope: each changed unit re-frozen at its existing disposition with its claim appended.
-# 1 removed: each unit's declaration, or each envelope's directory, is absent from the scanned tree, so its row goes, a frozen declaration is retired as absent, and an envelope is retired.
-# 14 new dispositions: 2 reads re-frozen at their disposition with the claim, 10 new units frozen accepted-legacy, 2 quiet units retired while they read nothing, 0 other.
+# 9 body, 2 sites, 8 envelope: each changed unit re-frozen at its existing disposition with its claim appended.
+# 13 new dispositions: 2 reads re-frozen at their disposition with the claim, 9 new units frozen accepted-legacy, 2 quiet units retired while they read nothing, 0 other.
@legacy d01aea108865cd2ba15c6c38d82ced5010cb1f19048dc45b254ebded978dead8 internal/activator/hawake.go ExecBackend.haRestorePrelude legacy accepted-legacy accepted-legacy;rev3=census-ruling-ha-generations;basis=new (Task 5): the containment, seed-obligation and seed-marker checks restoreHA already ran, factored out for both restore paths; same reads;rev3=census-ruling-fleet-seeded-create-2;basis=Passes the instance's layout (p.layout, from the path set this backend already computed) as a new third argument to reconcileSeedMarker; no read added, and the reads are the same four. The agent as carlos, not root. whole:Route@112,whole:Route@183,whole:Route@226,whole:Route@298 ae0690ce5183fba14432d9cda1c1863f62f2b54a39c4c7381befe85a17b548c8
@legacy 9c643bade7c1572a0ea327465e24b87f437c0cd5d83982f4e9aadf33d5dc94bf internal/activator/seedplace.go reconcileSeedMarker legacy accepted-legacy accepted-legacy;rev3=census-ruling-seeded-instances;basis=the agent (/opt/carlos/carlos agent, carlos-edge.service, user carlos): on the plain restore path, removes a database whose marker names a seed that is not the row's own, before it can count as a warm cache;rev3=census-ruling-fleet-seeded-create-2;basis=Takes the layout as a parameter and passes layout==LayoutNested to purgeSeedTarget, so the old-style .seed-sd_*.tmp names are removed only from a nested directory. Its own reads (the marker, the directory) are unchanged; the purge it calls now goes through instancefs.PurgeProven. The agent as carlos, not root. registry:Host@297,registry:Host@624,registry:Host@767,registry:SeedSource@340 a6c700aea3515a6bbbe1a276932d24c3d010239fbbbfb5b963cf6370664da357
@legacy 1a41ee0b787246c2cf67dcd80c59db699593853e468e0930605aa2b4da1889fb internal/activator/seedplace.go type SeedObjects legacy accepted-legacy accepted-legacy;rev3=census-ruling-seeded-instances;basis=the agent (/opt/carlos/carlos agent, carlos-edge.service, user carlos): declaration only; Open is the interface's method name, not a file open;rev3=census-ruling-fleet-seeded-create-2;basis=Declaration only: Open gains the account and app (acct, app, host, id), which a customer-fleet reader needs to build apps/<acct>/<app>/seeds/<host>/<id>/snapshot.db; a region reader ignores them. Open is the interface's method name, not a file open. No read. file:Open@30 5977483bf8747b733b5ce3f38c45ec03789d6f18fcacd1735dca1d578514ff59
@@ -12,16 +11,16 @@
@legacy 5b485e778557d28607cf8fe643c7a6f310c0b3f791da6d965d560fb7cdbccf38 internal/status/snapshot.go CollectBox legacy accepted-legacy accepted-legacy;rev3=J1;basis=root-route;rev3=census-ruling-rootfs-apps-2;basis=copies Probes.RootfsReady and RootfsBlocked into BoxMetrics (private, like Layout); the same 28 sites, no read added;rev3=census-ruling-instance-egress-sizes-328-329;basis=#328 plan 2 Task 11 and #329 plan 3 Task 7: copies Probes.Egress and Probes.SizeCommittedMiB into BoxMetrics (private, like Layout) and counts them in the condition that builds Metrics; the same 28 sites, no read added.;rev3=census-ruling-rootfs-apps-3;basis=rootfs Plan 3: comment only, the Hibernate count is left as is (display);rev3=census-ruling-regional-domains-447;basis=#447 Task 7: copies Probes.AliasesRead into BoxMetrics.AliasesRead (json aliases_read, omitempty) and counts it in the condition that builds Metrics; the same 28 sites, no read added;rev3=census-ruling-fleet-alerts-1;basis=copies Probes.DiskFullETAHours into BoxMetrics.DiskFullETAHours (json disk_full_eta_hours, omitempty; private, like Layout) and counts it in the condition that builds Metrics; the same 28 sites, no read added;rev3=census-ruling-edge-held-streams;basis=copies Probes.HeldStreams into BoxMetrics.HeldStreams (json held_streams, omitempty, additive) and counts it in the condition that builds Metrics; the same 28 sites, no read added.;rev3=census-ruling-stateless-replicas-3;basis=Fix round 1 Q20: carry already-supplied ReplicaCopies into a separate optional private BoxMetrics replica_copies field; allow copy evidence alone to create the metrics block. Upstreams retains address probes only. Existing 28 Route read sites unchanged; no filesystem, bucket, console or CLI read.;rev3=census-ruling-agent-start-demo-3;basis=Report claim-seed protocol capability only when explicitly configured and runtime moved readiness only when armed; dormant status keeps its original JSON shape. Census read-site delta: unchanged (28).;rev3=census-ruling-stateless-replicas-4-task5;basis=Task 5 (#511 R16 and its amendment): copies Probes.PrevRelease and Probes.ApplyFinished into BoxMetrics (json prev_release and apply_finished, omitempty; private, like Release) and counts them in the condition that builds Metrics; the same 28 sites, no read added.;rev3=census-ruling-offline-move-stage-refusals-339;basis=#339: copies Probes.OfflineMove into BoxMetrics.OfflineMove (json offline_move, omitempty; private, like Layout) and counts it in the condition that builds Metrics; the same 28 sites, no read added.;rev3=census-ruling-platform-mail-submission;basis=Task 3: copies Probes.MailerArmed into BoxMetrics.MailerArmed (json mailer_armed, omitempty; private, like Layout) and counts it in the condition that builds Metrics; the same 28 sites, no read added.;rev3=census-ruling-named-units-param-114;basis=named-units-param-114 Task 6: copies Probes.NamedUnits into BoxMetrics.NamedUnits (json named_units, omitempty; private) and counts it in the condition that builds Metrics; the same 28 sites, no read added;rev3=census-ruling-fleet-seeded-create-2;basis=Copies Probes.SeedsFloor into BoxMetrics.SeedsFloor and counts it in the metrics gate; a pure copy of a value the agent filled, the same 28 read sites, no read added. registry:Alias@4543,registry:CertExpiresAt@3160,registry:CertExpiresAt@3396,registry:CertExpiresAt@4658,registry:DBPath@2495,registry:DBPath@2553,registry:DNSCheckedAt@3365,registry:DNSCheckedAt@4627,registry:DNSStatus@3139,registry:DNSStatus@3334,registry:DNSStatus@4597,registry:Hibernate@3853,registry:Host@2295,registry:Host@2437,registry:Host@2666,registry:Host@3280,registry:Host@3315,registry:Host@4578,registry:Kind@2473,registry:Kind@3807,registry:Platform@2152,registry:ServingVersion@2324,registry:ServingVersion@2447,registry:Socket@4066,registry:Version@2186,registry:Version@2305,whole:Route@1581,whole:RouteAlias@4440 f7572ab133fccd2daa971ac9b75da7d838e85756e1467b34bf3acebeb7a777dc
@legacy dd347da2af279f4c4ac7391e19ff3f78f3b3fe0255e8f92ee9adbc8b9c46d8ef internal/activator/backend_exec.go ExecBackend.restorePlainStaging legacy accepted-legacy accepted-legacy;rev3=census-ruling-fleet-seeded-create-2;basis=The body of the former restorePlain, with one parameter: staging. With false (a fleet file seed's retry alone) the promoteStagedReplica call is skipped, so nothing under moves/<host>/ is read or promoted. With true it is byte-for-byte the former path. It passes b.pathsFor(rt).layout to reconcileSeedMarker. The reads are the former restorePlain's (os.Stat of the database and the route fields), now under this name. file:Stat@1207,registry:Host@375,whole:Route@1041,whole:Route@1121,whole:Route@1144,whole:Route@1420,whole:Route@264,whole:Route@348,whole:Route@395,whole:Route@5668,whole:Route@5758,whole:Route@6335,whole:Route@6566,whole:Route@664 0b1c0a4d5eb7c779d20eb49552f909bd2e25370010e79876493edb871dd74a88
@legacy 60affd92cb2b7fbbc40603742794b23646a20396f28d0ae1fd37b3b7447b8ee3 internal/activator/seedfleet.go ExecBackend.reportSeedFailure legacy accepted-legacy accepted-legacy;rev3=census-ruling-fleet-seeded-create-2;basis=Reads the route's account, app and host to hand to b.OnSeedFailed, only for a fleet file seed whose error carries a code (mismatch, not-a-database, copy-exists); no filesystem read. The report is best effort and logged; it writes no record (the door does). registry:Account@426,registry:App@438,registry:Host@355,registry:Host@446,registry:Host@570 56d4eb7b43e2b44a817a132fa019b058616179513528faf442243292df8ac762
-@legacy abedcbacc6b2e283019e7a09e715327cd49bc0db56ea7b5dd80835185d2553f7 internal/activator/seedfleet.go ExecBackend.restorePlain legacy accepted-legacy accepted-legacy;rev3=census-ruling-fleet-seeded-create-2;basis=Wrapper: restorePlainStaging(ctx, rt, true). Reads only rt (whole:Route), passing it on; no read of its own. whole:Route@126 916c071c395df4780429c0607431c8a2ac8dc6736aa8f309d6546a0802b5693a
-@legacy 2210fdc4fffa22cc9183b6d884a8a132021cb5033560c3d6acf666ab33b232bf internal/activator/seedplace.go ExecBackend.PurgeSeedLocalFor legacy accepted-legacy accepted-legacy;rev3=census-ruling-fleet-seeded-create-2;basis=New: PurgeSeedLocal for rt's database in the layout this backend finds rt in (b.pathsFor(rt).layout) beneath b.DataDir. Reads rt.DBPath and the route; the removal and proof are instancefs.PurgeProven's. Replaces the hook's direct PurgeSeedLocal(rt.DBPath). registry:DBPath@101,whole:Route@123 af6e5005061b3e1f6b9d91200103aa50b426f7d6cd0a87e1ac32e0fce959ef38
+@legacy 14d5afe1b65becf5b34ea9431fe92b68f53e12a4b414e6d0db71111611861018 internal/activator/seedplace.go ExecBackend.PurgeSeedLocalFor legacy accepted-legacy accepted-legacy;rev3=census-ruling-fleet-seeded-create-2;basis=New: PurgeSeedLocal for rt's database beneath b.DataDir. Whether old-style .seed-sd_*.tmp names are removed too is decided by the path's shape (rt.DBPath == provision.NestedDBPath(b.DataDir, rt.Host)), not by classifying the row: the rollbacks pass a route built from a path with no socket. Reads rt.DBPath and rt.Host; the removal and proof are instancefs.PurgeProven's, no symlink followed. registry:DBPath@215,registry:DBPath@96,registry:Host@143 f779220554febfab51a664dff8d7714914d5b9c1cde740cca88c71d9e9c0503e
@legacy f33d3193fc6cbeca9c64e5da3efd3de8250132bb5f17eb66bc8e888fece6161e internal/activator/seedplace.go ExecBackend.placeSeed legacy accepted-legacy accepted-legacy;rev3=census-ruling-fleet-seeded-create-2;basis=Takes the route rather than the host, to name the fetch temp (seedTempName(base, id), which now carries the database's name so a purge for one flat instance cannot remove another's fetch) and to pass rt.Account, rt.App to the reader. The same fetch, check and rename; the reads are the host and route fields. registry:Host@127,whole:Route@334 e7f655c9fd5c549f48de16536448e368ab9b60636fd037f29198972e9200c2b8
@legacy e270202969762891eb4acd8d37cef9a17f04b346e60616dc2819173d0bdc87c2 internal/host/seedfleetdoor.go fleetSeedObjects.Open legacy accepted-legacy accepted-legacy;rev3=census-ruling-fleet-seeded-create-2;basis=New: streams apps/<acct>/<app>/seeds/<host>/<id>/snapshot.db from the deployment store (the store door's client on a fleet box) after ValidAccount, ValidApp and seeds.Check. The two +file:Open sites are release.Opener's Open on a store, and not a local path; the key is built from checked parts, never from tenant input. Refuses a store that cannot stream. file:Open@26,file:Open@498 5483ef2796acff5e19d45e1b041621874f69ccde393066b63b8253ed9acd34c5
@legacy 142b95eeda36e3f0dea218dd814f62d2e1c93a5657ba07272aafa618abae4273 internal/instancefs/purge_linux.go identityOf legacy accepted-legacy accepted-legacy;rev3=census-ruling-fleet-seeded-create-2;basis=New: fstat of an already-open descriptor to get (dev, ino). No path is opened. file:Fstat@85 3e3bfbaf7b3ce62b5526b571c035db405c316f05570c937acd58a925aa73ac3f
@legacy ac3af3b592914f43802b76daba3c6e5018c283c48d60bfd8970da2f3529f2603 internal/instancefs/purge_linux.go namesIn legacy accepted-legacy accepted-legacy;rev3=census-ruling-fleet-seeded-create-2;basis=New: openat(dir, ".") on a held directory descriptor, then Readdirnames: lists the directory the descriptor holds, never a path. The listing is the directory's own entry names, which a tenant could have created; they are only matched against SeedLocalName and removed relative to the descriptor, never opened. file:Openat@67,file:Readdirnames@284 9d84867d09447af82cb5d8d227d28bf185f5b0b6b5974abfe3c231fa96ec074c
@legacy e39d6a5097fdeb3893b0c082d3cd40150486fc0abeadf1d90855a86e3361016a internal/instancefs/purge_linux.go openHeld legacy accepted-legacy accepted-legacy;rev3=census-ruling-fleet-seeded-create-2;basis=New: openat2 of rel beneath a held root descriptor, with the instancefs resolve flags (no symlinks, no leaving the root): ELOOP is ErrSymlink, EXDEV is ErrEscapes, ENOENT is absent. A directory open only; never follows a link a tenant could plant. file:Openat2@260 6452891b3fa51e078d14449c03e57b9bfa4f65702b0f2fdaf8e933515fd9b8e3
-@legacy 1059002d116e5c51f0c5e70e792dd3a9e761b35017a430bbe5c33ea636a538c2 internal/provision/seedfleet.go rollbackFleetFileSeed legacy accepted-legacy accepted-legacy;rev3=census-ruling-fleet-seeded-create-2;basis=New: an aborted file seed's rollback on a customer fleet, run by the agent (carlos, not root) under the host's fence. Reads the registry row (reg.Get, +whole:Route: any row means nothing is removed), purges and proves both the nested and the flat location of the host's data through fleetSeedPurgeProven (instancefs.PurgeProven, held descriptors, names from SeedLocalName only), lists the fleet bucket's replica prefix and moves/<host>/ exhaustively (ListPrefix), and reports rolledback or failed (copy-in-storage) to the console door. It writes no record and deletes no snapshot or replica. Every name is built from a host and seed id that passed seeds.Check. The accepted limit is written on the function. whole:Route@1375 7b95ac34132ffaf42e98d6ca86141812023fdf1246078bfdc416b5b15dac06b4
+@legacy 0f3f0d49cf81317a7f21b94e1a3079e534b0f2ebd099c5414e5762570e056a4e internal/provision/seedfleet.go rollbackFleetFileSeed legacy accepted-legacy accepted-legacy;rev3=census-ruling-fleet-seeded-create-2;basis=New: an aborted file seed's rollback on a customer fleet, run by the agent (carlos, not root) under the host's fence. Reads the registry row (reg.Get, +whole:Route: any row means nothing is removed), purges and proves both the nested and the flat location of the host's data through fleetSeedPurgeProven (instancefs.PurgeProven, held descriptors, names from SeedLocalName only), lists the fleet bucket's replica prefix and moves/<host>/ exhaustively (ListPrefix), and reports rolledback or failed (copy-in-storage) to the console door. It writes no record and deletes no snapshot or replica. Every name is built from a host and seed id that passed seeds.Check. The accepted limit is written on the function. whole:Route@1375 07ad52c71730c60eb9814e829366b16cb6070d2b51121b4fca70c84f13cd7980
@legacy e64451f8f6fc7dc141d462b46f5ab381ddddc59106089895c370f0ab8898402d internal/activator/seedplace.go ExecBackend.fetchSeed legacy accepted-legacy accepted-legacy;rev3=census-ruling-seeded-instances;basis=the agent (/opt/carlos/carlos agent, carlos-edge.service, user carlos): copies seeds/<host>/<id>/snapshot.db into the instance's own directory, checking length and sha256 against the row as it writes;rev3=census-ruling-fleet-seeded-create-2;basis=Takes the route and opens the snapshot with rt.Account, rt.App, rt.Host (a fleet reader's key needs them). Adds only the account and app route fields to the read set; the object read, length and sha256 limits are unchanged. file:Open@161,file:Stat@582,registry:Account@179,registry:App@191,registry:Host@141 08cc1b9a9c4f298c04ba898dcf653a9c7898f785247daf2116c9aa71f8f6563a
-@legacy de5fae80839b04b68da891bbf22dda60731883eae57d478495ba8e88a81c3714 internal/host/seedwiring.go wireSeedPlacement legacy accepted-legacy accepted-legacy;rev3=census-ruling-self-serve-moves-1;basis=the agent (/opt/carlos/carlos agent, carlos-edge.service, user carlos): hands the seed callback the box's lifetime judge (seedBox.Judge); read sites unchanged, offsets moved;rev3=census-ruling-agent-start-demo-3;basis=Install the pre-wake demo-claim seed admission check beside existing seed placement hooks. Census read-site delta: unchanged (1).;rev3=census-ruling-fleet-seeded-create-2;basis=On a fleet box (CARLOS_FLEET resolves) it arms the door client and armFleetSeeds; reads the fleet identity and CARLOS_TUNNEL_URL/TOKEN from the environment through Getenv. A fleet box with no door arms nothing. The RemoveLocal hook now calls eb.PurgeSeedLocalFor(rt), which reads the layout from the backend rather than rt.DBPath alone. The DBPath read went into PurgeSeedLocalFor. whole:Route@1387 3ac7ef373d50ed8a96742951640986888238a2b12227ea0f73eb803f60dcdcf8
+@legacy ad5249a5662af0dff51ad72ea6c95b2f86a48af1ef5da202e4cbd6f31e3b28b4 internal/host/seedwiring.go wireSeedPlacement legacy accepted-legacy accepted-legacy;rev3=census-ruling-self-serve-moves-1;basis=the agent (/opt/carlos/carlos agent, carlos-edge.service, user carlos): hands the seed callback the box's lifetime judge (seedBox.Judge); read sites unchanged, offsets moved;rev3=census-ruling-agent-start-demo-3;basis=Install the pre-wake demo-claim seed admission check beside existing seed placement hooks. Census read-site delta: unchanged (1).;rev3=census-ruling-fleet-seeded-create-2;basis=On a fleet box (CARLOS_FLEET resolves) it sets eb.CustomerFleet, whether or not the door wires, so the fleet placement rules hold on a box that lost its door (which then has no seed reader and places nothing); with the door it arms the door client and armFleetSeeds. Reads the fleet identity and CARLOS_TUNNEL_URL/TOKEN from the environment through Getenv. The RemoveLocal hook now calls eb.PurgeSeedLocalFor(rt), where the DBPath read went. whole:Route@1664 051932a248eca11196782309c154433a2e7a74c11f11fe1c28411466aab8c127
+@legacy 2fc27e5e12fa77277eaa91ac2f84285ab890e2ba8af8476afe8988dbc8928a23 internal/activator/backend_exec.go ExecBackend.restorePlain legacy accepted-legacy accepted-legacy;rev3=census-ruling-seeded-instances;basis=the agent (/opt/carlos/carlos agent, carlos-edge.service, user carlos): body of the frozen ExecBackend.Restore, which is now its dispatcher, with the seed marker reconciled before the warm-cache check; same staging fallback and replica restore;rev3=census-ruling-region-ha-p1a;basis=the agent as carlos: first asks haRestore(ctx, rt) (+whole:Route x2: rt to haRestore and to restoreHA); an HA host restores through restoreHA (hawake.go, a new unit) and never through the warm cache or the staging fallback; an error there fails the restore; a non-HA host takes the unchanged path;rev3=census-ruling-managed-fleets-1b;basis=managed fleets 1b (Task 3, rule 6 start rule): the +whole:Route sites are calls taking rt: reconcileAssignment before the seed-marker check (a labelled row's copy not kept under rt.Assigned is moved into <DataDir>/.superseded/<host>/, never deleted), startAllowed on the warm-cache, restored and fresh paths (a labelled row may refuse with ErrNothingToRestore), and establishAssignment after a restore and before a fresh boot (writes the <db>.assigned marker). Task 6a's record clear after a restore is removed. An unlabelled row (Assigned "") takes none of these. Agent, not root; it refuses more, never less.;rev3=census-ruling-ha-generations;basis=storage generations: an HA host's restore is dispatched to restoreHAWake (generations-aware) instead of restoreHA directly; Task 7: promoteStagedReplica refuses a host with head.json before promotion; read sites unchanged;rev3=census-ruling-fleet-seeded-create-2;basis=Now a one-line wrapper in the same file: restorePlainStaging(ctx, rt, true). Its body moved, whole, to restorePlainStaging below it (an extraction, not a deletion: nothing it checked is gone). Reads only rt (whole:Route), passing it on; no read of its own. Every caller but a fleet file seed's retry still reaches the same body with the staging fallback on. whole:Route@126 916c071c395df4780429c0607431c8a2ac8dc6736aa8f309d6546a0802b5693a
@legacy 61f88208af68f896efae42b2f7092bafb7c7182768a2658467f7ab29b1388473 internal/activator/seedplace.go ExecBackend.seededRestore legacy accepted-legacy accepted-legacy;rev3=census-ruling-seeded-instances;basis=the agent (/opt/carlos/carlos agent, carlos-edge.service, user carlos): the seed fallback on the plain restore path: the host's own replica if it has one, else the file an earlier wake placed, else the snapshot; never reports fresh; every file through instancefs; fetches no snapshot under the claim flag;rev3=census-ruling-managed-fleets-1b;basis=managed fleets 1b (Task 3, start rule): reconcileAssignment after settleSeedObligation; startAllowed before keeping a placed seed and before placing one; on a labelled row (rt.Assigned set) a local copy still at the path is set aside (localCopyNames, supersede) before the placement's purge; establishAssignment after placement. +registry:Assigned and +whole:Route are these calls. Unlabelled rows unchanged. Agent, not root; it refuses more and deletes less.;rev3=census-ruling-agent-start-demo-3;basis=Refuse unfinished claim seeds and check the current operation-bound destination record under its lease before wake. Census read-site delta: +whole:Route.;rev3=census-ruling-fleet-seeded-create-2;basis=Fleet file seeds: (1) refuses a flat layout for every seed (paths.layout != LayoutNested, nested only); (2) on a fleet file seed not yet placed lists moves/<host>/ through b.Mirror.List (fleetSeedStagingRefusal) before the replica question, and refuses if anything is staged or the listing fails; (3) when the host has a replica, reads the <db>.seed marker (ReadSeedMarker, a nofollow read of the marker beside the database) and restores only if it names this seed; (4) restores with staging promotion off; (5) reports a coded failure through reportSeedFailure; (6) purges via purgeSeedTarget's held-descriptor PurgeProven. The route reads (+whole:Route x2) are passing rt on to placeSeed and PurgeSeedLocalFor. The agent as carlos, not root; every path it names comes from the registry row, not from a tenant. registry:Assigned@6277,registry:Host@121,whole:Route@1105,whole:Route@1868,whole:Route@2056,whole:Route@2826,whole:Route@342,whole:Route@4555,whole:Route@5144,whole:Route@5427,whole:Route@5772,whole:Route@6823,whole:Route@7317,whole:Route@7476 619dfd08446999d0740a069891d04653ae2a2472862a80bca52b0222a781d229
internal/activator/hawake.go ExecBackend.haRestorePrelude legacy accepted-legacy accepted-legacy;rev3=census-ruling-ha-generations;basis=new (Task 5): the containment, seed-obligation and seed-marker checks restoreHA already ran, factored out for both restore paths; same reads;rev3=census-ruling-fleet-seeded-create-2;basis=Passes the instance's layout (p.layout, from the path set this backend already computed) as a new third argument to reconcileSeedMarker; no read added, and the reads are the same four. The agent as carlos, not root. whole:Route@112,whole:Route@183,whole:Route@226,whole:Route@298 ae0690ce5183fba14432d9cda1c1863f62f2b54a39c4c7381befe85a17b548c8
internal/activator/seedplace.go reconcileSeedMarker legacy accepted-legacy accepted-legacy;rev3=census-ruling-seeded-instances;basis=the agent (/opt/carlos/carlos agent, carlos-edge.service, user carlos): on the plain restore path, removes a database whose marker names a seed that is not the row's own, before it can count as a warm cache;rev3=census-ruling-fleet-seeded-create-2;basis=Takes the layout as a parameter and passes layout==LayoutNested to purgeSeedTarget, so the old-style .seed-sd_*.tmp names are removed only from a nested directory. Its own reads (the marker, the directory) are unchanged; the purge it calls now goes through instancefs.PurgeProven. The agent as carlos, not root. registry:Host@297,registry:Host@624,registry:Host@767,registry:SeedSource@340 a6c700aea3515a6bbbe1a276932d24c3d010239fbbbfb5b963cf6370664da357
@@ -34,28 +33,26 @@ internal/provision/seedreconcile.go seedAction legacy accepted-legacy accepted-l
internal/status/snapshot.go CollectBox legacy accepted-legacy accepted-legacy;rev3=J1;basis=root-route;rev3=census-ruling-rootfs-apps-2;basis=copies Probes.RootfsReady and RootfsBlocked into BoxMetrics (private, like Layout); the same 28 sites, no read added;rev3=census-ruling-instance-egress-sizes-328-329;basis=#328 plan 2 Task 11 and #329 plan 3 Task 7: copies Probes.Egress and Probes.SizeCommittedMiB into BoxMetrics (private, like Layout) and counts them in the condition that builds Metrics; the same 28 sites, no read added.;rev3=census-ruling-rootfs-apps-3;basis=rootfs Plan 3: comment only, the Hibernate count is left as is (display);rev3=census-ruling-regional-domains-447;basis=#447 Task 7: copies Probes.AliasesRead into BoxMetrics.AliasesRead (json aliases_read, omitempty) and counts it in the condition that builds Metrics; the same 28 sites, no read added;rev3=census-ruling-fleet-alerts-1;basis=copies Probes.DiskFullETAHours into BoxMetrics.DiskFullETAHours (json disk_full_eta_hours, omitempty; private, like Layout) and counts it in the condition that builds Metrics; the same 28 sites, no read added;rev3=census-ruling-edge-held-streams;basis=copies Probes.HeldStreams into BoxMetrics.HeldStreams (json held_streams, omitempty, additive) and counts it in the condition that builds Metrics; the same 28 sites, no read added.;rev3=census-ruling-stateless-replicas-3;basis=Fix round 1 Q20: carry already-supplied ReplicaCopies into a separate optional private BoxMetrics replica_copies field; allow copy evidence alone to create the metrics block. Upstreams retains address probes only. Existing 28 Route read sites unchanged; no filesystem, bucket, console or CLI read.;rev3=census-ruling-agent-start-demo-3;basis=Report claim-seed protocol capability only when explicitly configured and runtime moved readiness only when armed; dormant status keeps its original JSON shape. Census read-site delta: unchanged (28).;rev3=census-ruling-stateless-replicas-4-task5;basis=Task 5 (#511 R16 and its amendment): copies Probes.PrevRelease and Probes.ApplyFinished into BoxMetrics (json prev_release and apply_finished, omitempty; private, like Release) and counts them in the condition that builds Metrics; the same 28 sites, no read added.;rev3=census-ruling-offline-move-stage-refusals-339;basis=#339: copies Probes.OfflineMove into BoxMetrics.OfflineMove (json offline_move, omitempty; private, like Layout) and counts it in the condition that builds Metrics; the same 28 sites, no read added.;rev3=census-ruling-platform-mail-submission;basis=Task 3: copies Probes.MailerArmed into BoxMetrics.MailerArmed (json mailer_armed, omitempty; private, like Layout) and counts it in the condition that builds Metrics; the same 28 sites, no read added.;rev3=census-ruling-named-units-param-114;basis=named-units-param-114 Task 6: copies Probes.NamedUnits into BoxMetrics.NamedUnits (json named_units, omitempty; private) and counts it in the condition that builds Metrics; the same 28 sites, no read added;rev3=census-ruling-fleet-seeded-create-2;basis=Copies Probes.SeedsFloor into BoxMetrics.SeedsFloor and counts it in the metrics gate; a pure copy of a value the agent filled, the same 28 read sites, no read added. registry:Alias@4543,registry:CertExpiresAt@3160,registry:CertExpiresAt@3396,registry:CertExpiresAt@4658,registry:DBPath@2495,registry:DBPath@2553,registry:DNSCheckedAt@3365,registry:DNSCheckedAt@4627,registry:DNSStatus@3139,registry:DNSStatus@3334,registry:DNSStatus@4597,registry:Hibernate@3853,registry:Host@2295,registry:Host@2437,registry:Host@2666,registry:Host@3280,registry:Host@3315,registry:Host@4578,registry:Kind@2473,registry:Kind@3807,registry:Platform@2152,registry:ServingVersion@2324,registry:ServingVersion@2447,registry:Socket@4066,registry:Version@2186,registry:Version@2305,whole:Route@1581,whole:RouteAlias@4440 f7572ab133fccd2daa971ac9b75da7d838e85756e1467b34bf3acebeb7a777dc
internal/activator/backend_exec.go ExecBackend.restorePlainStaging legacy accepted-legacy accepted-legacy;rev3=census-ruling-fleet-seeded-create-2;basis=The body of the former restorePlain, with one parameter: staging. With false (a fleet file seed's retry alone) the promoteStagedReplica call is skipped, so nothing under moves/<host>/ is read or promoted. With true it is byte-for-byte the former path. It passes b.pathsFor(rt).layout to reconcileSeedMarker. The reads are the former restorePlain's (os.Stat of the database and the route fields), now under this name. file:Stat@1207,registry:Host@375,whole:Route@1041,whole:Route@1121,whole:Route@1144,whole:Route@1420,whole:Route@264,whole:Route@348,whole:Route@395,whole:Route@5668,whole:Route@5758,whole:Route@6335,whole:Route@6566,whole:Route@664 0b1c0a4d5eb7c779d20eb49552f909bd2e25370010e79876493edb871dd74a88
internal/activator/seedfleet.go ExecBackend.reportSeedFailure legacy accepted-legacy accepted-legacy;rev3=census-ruling-fleet-seeded-create-2;basis=Reads the route's account, app and host to hand to b.OnSeedFailed, only for a fleet file seed whose error carries a code (mismatch, not-a-database, copy-exists); no filesystem read. The report is best effort and logged; it writes no record (the door does). registry:Account@426,registry:App@438,registry:Host@355,registry:Host@446,registry:Host@570 56d4eb7b43e2b44a817a132fa019b058616179513528faf442243292df8ac762
-internal/activator/seedfleet.go ExecBackend.restorePlain legacy accepted-legacy accepted-legacy;rev3=census-ruling-fleet-seeded-create-2;basis=Wrapper: restorePlainStaging(ctx, rt, true). Reads only rt (whole:Route), passing it on; no read of its own. whole:Route@126 916c071c395df4780429c0607431c8a2ac8dc6736aa8f309d6546a0802b5693a
-internal/activator/seedplace.go ExecBackend.PurgeSeedLocalFor legacy accepted-legacy accepted-legacy;rev3=census-ruling-fleet-seeded-create-2;basis=New: PurgeSeedLocal for rt's database in the layout this backend finds rt in (b.pathsFor(rt).layout) beneath b.DataDir. Reads rt.DBPath and the route; the removal and proof are instancefs.PurgeProven's. Replaces the hook's direct PurgeSeedLocal(rt.DBPath). registry:DBPath@101,whole:Route@123 af6e5005061b3e1f6b9d91200103aa50b426f7d6cd0a87e1ac32e0fce959ef38
+internal/activator/seedplace.go ExecBackend.PurgeSeedLocalFor legacy accepted-legacy accepted-legacy;rev3=census-ruling-fleet-seeded-create-2;basis=New: PurgeSeedLocal for rt's database beneath b.DataDir. Whether old-style .seed-sd_*.tmp names are removed too is decided by the path's shape (rt.DBPath == provision.NestedDBPath(b.DataDir, rt.Host)), not by classifying the row: the rollbacks pass a route built from a path with no socket. Reads rt.DBPath and rt.Host; the removal and proof are instancefs.PurgeProven's, no symlink followed. registry:DBPath@215,registry:DBPath@96,registry:Host@143 f779220554febfab51a664dff8d7714914d5b9c1cde740cca88c71d9e9c0503e
internal/activator/seedplace.go ExecBackend.placeSeed legacy accepted-legacy accepted-legacy;rev3=census-ruling-fleet-seeded-create-2;basis=Takes the route rather than the host, to name the fetch temp (seedTempName(base, id), which now carries the database's name so a purge for one flat instance cannot remove another's fetch) and to pass rt.Account, rt.App to the reader. The same fetch, check and rename; the reads are the host and route fields. registry:Host@127,whole:Route@334 e7f655c9fd5c549f48de16536448e368ab9b60636fd037f29198972e9200c2b8
internal/host/seedfleetdoor.go fleetSeedObjects.Open legacy accepted-legacy accepted-legacy;rev3=census-ruling-fleet-seeded-create-2;basis=New: streams apps/<acct>/<app>/seeds/<host>/<id>/snapshot.db from the deployment store (the store door's client on a fleet box) after ValidAccount, ValidApp and seeds.Check. The two +file:Open sites are release.Opener's Open on a store, and not a local path; the key is built from checked parts, never from tenant input. Refuses a store that cannot stream. file:Open@26,file:Open@498 5483ef2796acff5e19d45e1b041621874f69ccde393066b63b8253ed9acd34c5
internal/instancefs/purge_linux.go identityOf legacy accepted-legacy accepted-legacy;rev3=census-ruling-fleet-seeded-create-2;basis=New: fstat of an already-open descriptor to get (dev, ino). No path is opened. file:Fstat@85 3e3bfbaf7b3ce62b5526b571c035db405c316f05570c937acd58a925aa73ac3f
internal/instancefs/purge_linux.go namesIn legacy accepted-legacy accepted-legacy;rev3=census-ruling-fleet-seeded-create-2;basis=New: openat(dir, ".") on a held directory descriptor, then Readdirnames: lists the directory the descriptor holds, never a path. The listing is the directory's own entry names, which a tenant could have created; they are only matched against SeedLocalName and removed relative to the descriptor, never opened. file:Openat@67,file:Readdirnames@284 9d84867d09447af82cb5d8d227d28bf185f5b0b6b5974abfe3c231fa96ec074c
internal/instancefs/purge_linux.go openHeld legacy accepted-legacy accepted-legacy;rev3=census-ruling-fleet-seeded-create-2;basis=New: openat2 of rel beneath a held root descriptor, with the instancefs resolve flags (no symlinks, no leaving the root): ELOOP is ErrSymlink, EXDEV is ErrEscapes, ENOENT is absent. A directory open only; never follows a link a tenant could plant. file:Openat2@260 6452891b3fa51e078d14449c03e57b9bfa4f65702b0f2fdaf8e933515fd9b8e3
-internal/provision/seedfleet.go rollbackFleetFileSeed legacy accepted-legacy accepted-legacy;rev3=census-ruling-fleet-seeded-create-2;basis=New: an aborted file seed's rollback on a customer fleet, run by the agent (carlos, not root) under the host's fence. Reads the registry row (reg.Get, +whole:Route: any row means nothing is removed), purges and proves both the nested and the flat location of the host's data through fleetSeedPurgeProven (instancefs.PurgeProven, held descriptors, names from SeedLocalName only), lists the fleet bucket's replica prefix and moves/<host>/ exhaustively (ListPrefix), and reports rolledback or failed (copy-in-storage) to the console door. It writes no record and deletes no snapshot or replica. Every name is built from a host and seed id that passed seeds.Check. The accepted limit is written on the function. whole:Route@1375 7b95ac34132ffaf42e98d6ca86141812023fdf1246078bfdc416b5b15dac06b4
+internal/provision/seedfleet.go rollbackFleetFileSeed legacy accepted-legacy accepted-legacy;rev3=census-ruling-fleet-seeded-create-2;basis=New: an aborted file seed's rollback on a customer fleet, run by the agent (carlos, not root) under the host's fence. Reads the registry row (reg.Get, +whole:Route: any row means nothing is removed), purges and proves both the nested and the flat location of the host's data through fleetSeedPurgeProven (instancefs.PurgeProven, held descriptors, names from SeedLocalName only), lists the fleet bucket's replica prefix and moves/<host>/ exhaustively (ListPrefix), and reports rolledback or failed (copy-in-storage) to the console door. It writes no record and deletes no snapshot or replica. Every name is built from a host and seed id that passed seeds.Check. The accepted limit is written on the function. whole:Route@1375 07ad52c71730c60eb9814e829366b16cb6070d2b51121b4fca70c84f13cd7980
internal/activator/seedplace.go ExecBackend.fetchSeed legacy accepted-legacy accepted-legacy;rev3=census-ruling-seeded-instances;basis=the agent (/opt/carlos/carlos agent, carlos-edge.service, user carlos): copies seeds/<host>/<id>/snapshot.db into the instance's own directory, checking length and sha256 against the row as it writes;rev3=census-ruling-fleet-seeded-create-2;basis=Takes the route and opens the snapshot with rt.Account, rt.App, rt.Host (a fleet reader's key needs them). Adds only the account and app route fields to the read set; the object read, length and sha256 limits are unchanged. file:Open@161,file:Stat@582,registry:Account@179,registry:App@191,registry:Host@141 08cc1b9a9c4f298c04ba898dcf653a9c7898f785247daf2116c9aa71f8f6563a
-internal/host/seedwiring.go wireSeedPlacement legacy accepted-legacy accepted-legacy;rev3=census-ruling-self-serve-moves-1;basis=the agent (/opt/carlos/carlos agent, carlos-edge.service, user carlos): hands the seed callback the box's lifetime judge (seedBox.Judge); read sites unchanged, offsets moved;rev3=census-ruling-agent-start-demo-3;basis=Install the pre-wake demo-claim seed admission check beside existing seed placement hooks. Census read-site delta: unchanged (1).;rev3=census-ruling-fleet-seeded-create-2;basis=On a fleet box (CARLOS_FLEET resolves) it arms the door client and armFleetSeeds; reads the fleet identity and CARLOS_TUNNEL_URL/TOKEN from the environment through Getenv. A fleet box with no door arms nothing. The RemoveLocal hook now calls eb.PurgeSeedLocalFor(rt), which reads the layout from the backend rather than rt.DBPath alone. The DBPath read went into PurgeSeedLocalFor. whole:Route@1387 3ac7ef373d50ed8a96742951640986888238a2b12227ea0f73eb803f60dcdcf8
+internal/host/seedwiring.go wireSeedPlacement legacy accepted-legacy accepted-legacy;rev3=census-ruling-self-serve-moves-1;basis=the agent (/opt/carlos/carlos agent, carlos-edge.service, user carlos): hands the seed callback the box's lifetime judge (seedBox.Judge); read sites unchanged, offsets moved;rev3=census-ruling-agent-start-demo-3;basis=Install the pre-wake demo-claim seed admission check beside existing seed placement hooks. Census read-site delta: unchanged (1).;rev3=census-ruling-fleet-seeded-create-2;basis=On a fleet box (CARLOS_FLEET resolves) it sets eb.CustomerFleet, whether or not the door wires, so the fleet placement rules hold on a box that lost its door (which then has no seed reader and places nothing); with the door it arms the door client and armFleetSeeds. Reads the fleet identity and CARLOS_TUNNEL_URL/TOKEN from the environment through Getenv. The RemoveLocal hook now calls eb.PurgeSeedLocalFor(rt), where the DBPath read went. whole:Route@1664 051932a248eca11196782309c154433a2e7a74c11f11fe1c28411466aab8c127
+internal/activator/backend_exec.go ExecBackend.restorePlain legacy accepted-legacy accepted-legacy;rev3=census-ruling-seeded-instances;basis=the agent (/opt/carlos/carlos agent, carlos-edge.service, user carlos): body of the frozen ExecBackend.Restore, which is now its dispatcher, with the seed marker reconciled before the warm-cache check; same staging fallback and replica restore;rev3=census-ruling-region-ha-p1a;basis=the agent as carlos: first asks haRestore(ctx, rt) (+whole:Route x2: rt to haRestore and to restoreHA); an HA host restores through restoreHA (hawake.go, a new unit) and never through the warm cache or the staging fallback; an error there fails the restore; a non-HA host takes the unchanged path;rev3=census-ruling-managed-fleets-1b;basis=managed fleets 1b (Task 3, rule 6 start rule): the +whole:Route sites are calls taking rt: reconcileAssignment before the seed-marker check (a labelled row's copy not kept under rt.Assigned is moved into <DataDir>/.superseded/<host>/, never deleted), startAllowed on the warm-cache, restored and fresh paths (a labelled row may refuse with ErrNothingToRestore), and establishAssignment after a restore and before a fresh boot (writes the <db>.assigned marker). Task 6a's record clear after a restore is removed. An unlabelled row (Assigned "") takes none of these. Agent, not root; it refuses more, never less.;rev3=census-ruling-ha-generations;basis=storage generations: an HA host's restore is dispatched to restoreHAWake (generations-aware) instead of restoreHA directly; Task 7: promoteStagedReplica refuses a host with head.json before promotion; read sites unchanged;rev3=census-ruling-fleet-seeded-create-2;basis=Now a one-line wrapper in the same file: restorePlainStaging(ctx, rt, true). Its body moved, whole, to restorePlainStaging below it (an extraction, not a deletion: nothing it checked is gone). Reads only rt (whole:Route), passing it on; no read of its own. Every caller but a fleet file seed's retry still reaches the same body with the staging fallback on. whole:Route@126 916c071c395df4780429c0607431c8a2ac8dc6736aa8f309d6546a0802b5693a
internal/activator/seedplace.go ExecBackend.seededRestore legacy accepted-legacy accepted-legacy;rev3=census-ruling-seeded-instances;basis=the agent (/opt/carlos/carlos agent, carlos-edge.service, user carlos): the seed fallback on the plain restore path: the host's own replica if it has one, else the file an earlier wake placed, else the snapshot; never reports fresh; every file through instancefs; fetches no snapshot under the claim flag;rev3=census-ruling-managed-fleets-1b;basis=managed fleets 1b (Task 3, start rule): reconcileAssignment after settleSeedObligation; startAllowed before keeping a placed seed and before placing one; on a labelled row (rt.Assigned set) a local copy still at the path is set aside (localCopyNames, supersede) before the placement's purge; establishAssignment after placement. +registry:Assigned and +whole:Route are these calls. Unlabelled rows unchanged. Agent, not root; it refuses more and deletes less.;rev3=census-ruling-agent-start-demo-3;basis=Refuse unfinished claim seeds and check the current operation-bound destination record under its lease before wake. Census read-site delta: +whole:Route.;rev3=census-ruling-fleet-seeded-create-2;basis=Fleet file seeds: (1) refuses a flat layout for every seed (paths.layout != LayoutNested, nested only); (2) on a fleet file seed not yet placed lists moves/<host>/ through b.Mirror.List (fleetSeedStagingRefusal) before the replica question, and refuses if anything is staged or the listing fails; (3) when the host has a replica, reads the <db>.seed marker (ReadSeedMarker, a nofollow read of the marker beside the database) and restores only if it names this seed; (4) restores with staging promotion off; (5) reports a coded failure through reportSeedFailure; (6) purges via purgeSeedTarget's held-descriptor PurgeProven. The route reads (+whole:Route x2) are passing rt on to placeSeed and PurgeSeedLocalFor. The agent as carlos, not root; every path it names comes from the registry row, not from a tenant. registry:Assigned@6277,registry:Host@121,whole:Route@1105,whole:Route@1868,whole:Route@2056,whole:Route@2826,whole:Route@342,whole:Route@4555,whole:Route@5144,whole:Route@5427,whole:Route@5772,whole:Route@6823,whole:Route@7317,whole:Route@7476 619dfd08446999d0740a069891d04653ae2a2472862a80bca52b0222a781d229
@remove internal/activator/seedplace.go PurgeSeedLocal
@removed internal/activator/seedplace.go PurgeSeedLocal H3 census-ruling-fleet-seeded-create-2;basis=Now PurgeSeedLocal(dataDir, dbPath, layout): resolves the directory beneath dataDir (or its parent when outside) and calls instancefs.PurgeProven with provision.SeedLocalName(base, nested); the former Lstat and purgeSeedTarget reads are inside PurgeProven, so the unit reads nothing itself now. Absent directory is still done; a path that was replaced is ErrNotProven.
@remove internal/activator/seedplace.go purgeSeedTarget
@removed internal/activator/seedplace.go purgeSeedTarget H3 census-ruling-fleet-seeded-create-2;basis=Now purgeSeedTarget(dir, base, legacyTemps): one call to instancefs.PurgeProven(dir, ".", SeedLocalName(base, legacyTemps)) in place of os.ReadDir plus RemoveAllBeneath. The directory is opened once, no symlink followed, and held; so the unit reads nothing itself. Matches only this database's names and, for a nested directory, the old .seed-sd_ temps.
-@remove internal/activator/backend_exec.go ExecBackend.restorePlain
-@removed internal/activator/backend_exec.go ExecBackend.restorePlain H3 census-ruling-fleet-seeded-create-2;absent;basis=Renamed: the body moved to restorePlainStaging, and restorePlain (seedfleet.go) is its one-line wrapper with staging on. Moved, not deleted: nothing it checked is gone.
-@coverage internal/activator 93cbe9ba94d5c455c9c1aa4aca8e91ac9ed723bf677302bce3097751345e3344
+@coverage internal/activator b1c873cba97d495771d8dd9efc2770e664300b0ee5b816e5428b31e702a8ee00
@coverage internal/edge 727e9ed36fefd795dff2e170cfa214af78b21ee1df2d390ee34337c94ebb49aa
-@coverage internal/host 92999cea70a0d06c8614e0a386e5a87744e631c6f8b0cbc614a662f0e35d7aea
+@coverage internal/host 6bc00f3cdafec5ebc9040e07fd74a401c46e2c008130051cdfb696b4e0da6ecc
@coverage internal/instancefs e505af631611b9e1c9c7c368f988db28b0c5fa9e524043342d1a158853f42cc5
@coverage internal/lease d34389d3a4c4e06028ebabcc861107bb6db008e946f7d5d488c74b92aead6b0d
-@coverage internal/provision b38827f25a83557a73809d256967ea5af07bf556cb23f41fd281d94e3fa0fd3d
+@coverage internal/provision dc641e56fcbd9068318845354d06a9c973b7e98b0a28cd8edda70407606fc6b2
@coverage internal/seeds 469b06a022d31a0130b478fb7ff1e45de138bb1626650732356d89e9cd907e5d
@coverage internal/status f2c022a4aafd14a18ce471966a4bbde9eab8158f469c936c50452b9b24ee8240