| index edc280f77..d7515b8f1 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 |
| @@ -21,7 +21,7 @@ |
| @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 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 |
| +@legacy 9293458a1ff628f426f58fbb140e9b546c54ff86a0cb8d790185975aa72fd1c7 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, accepts it as this seed's only when this seed's own placement is still at the row's path: the marker naming this seed together with the database, both read through seedPlacedAt (instancefs, no symlink followed). A marker alone, another seed's, or either unreadable refuses (copy-exists) and nothing is restored. That probe runs under the start rule, after settleSeedObligation and reconcileAssignment (a labelled row's copy not kept under its assignment is set aside first), and the kept copy then passes startAllowed in the restore; (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 x4) are rt passed on: to placeSeed, to reportSeedFailure, and to the two start-rule calls before the own-placement probe (settleSeedObligation, reconcileAssignment), both of which it already made further down for every seed. The agent as carlos, not root; every path it names comes from the registry row, not from a tenant. registry:Assigned@6940,registry:Host@121,whole:Route@1105,whole:Route@1868,whole:Route@2056,whole:Route@2826,whole:Route@342,whole:Route@4830,whole:Route@4923,whole:Route@5218,whole:Route@5807,whole:Route@6090,whole:Route@6435,whole:Route@7486,whole:Route@7980,whole:Route@8139 856eddb5a454191e82f47164b8de84280549804cec7a35f0b1db6caca8ec2b4a |
| 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 |
| 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 |
| @@ -43,12 +43,12 @@ internal/provision/seedfleet.go rollbackFleetFileSeed legacy accepted-legacy acc |
| 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 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 |
| +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, accepts it as this seed's only when this seed's own placement is still at the row's path: the marker naming this seed together with the database, both read through seedPlacedAt (instancefs, no symlink followed). A marker alone, another seed's, or either unreadable refuses (copy-exists) and nothing is restored. That probe runs under the start rule, after settleSeedObligation and reconcileAssignment (a labelled row's copy not kept under its assignment is set aside first), and the kept copy then passes startAllowed in the restore; (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 x4) are rt passed on: to placeSeed, to reportSeedFailure, and to the two start-rule calls before the own-placement probe (settleSeedObligation, reconcileAssignment), both of which it already made further down for every seed. The agent as carlos, not root; every path it names comes from the registry row, not from a tenant. registry:Assigned@6940,registry:Host@121,whole:Route@1105,whole:Route@1868,whole:Route@2056,whole:Route@2826,whole:Route@342,whole:Route@4830,whole:Route@4923,whole:Route@5218,whole:Route@5807,whole:Route@6090,whole:Route@6435,whole:Route@7486,whole:Route@7980,whole:Route@8139 856eddb5a454191e82f47164b8de84280549804cec7a35f0b1db6caca8ec2b4a |
| @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. |
| -@coverage internal/activator b1c873cba97d495771d8dd9efc2770e664300b0ee5b816e5428b31e702a8ee00 |
| +@coverage internal/activator a198a58bcb7ef31a9f1e2e3b00bfaf17b3775deadfe2968db5fb5597a9d399bd |
| @coverage internal/edge 727e9ed36fefd795dff2e170cfa214af78b21ee1df2d390ee34337c94ebb49aa |
| @coverage internal/host 6bc00f3cdafec5ebc9040e07fd74a401c46e2c008130051cdfb696b4e0da6ecc |
| @coverage internal/instancefs e505af631611b9e1c9c7c368f988db28b0c5fa9e524043342d1a158853f42cc5 |