| index 84945b2d7..0b0e1493b 100644 |
| --- a/internal/provision/testdata/plan14-root-reads-ha-generations.tsv |
| +++ b/internal/provision/testdata/plan14-root-reads-ha-generations.tsv |
| @@ -1,7 +1,7 @@ |
| # Census overlay ha-generations, written by census-propose (#369). census-ruling-ha-generations, approved on #280 before the merge; the approval card is docs/superpowers/notes/census-proposal-ha-generations.md. |
| # 12 body, 4 sites, 18 envelope: each changed unit re-frozen at its existing disposition with its claim appended. |
| # 14 new dispositions: 0 reads re-frozen at their disposition with the claim, 13 new units frozen accepted-legacy, 1 quiet units retired while they read nothing, 0 other. |
| -@legacy 206775f68cc04f280bc2d3b5648b3ef56b7c788fd8201288c3e4f9093382451b internal/activator/activator.go Service.doWake legacy accepted-legacy accepted-legacy;rev3=census-ruling-292fix;basis=the agent (/opt/carlos/carlos agent, carlos-edge.service, user carlos): main's body (census ruling 292's legacy start mark and lease give-back; census ruling owed's pending record) with the seeded change ruled under census-ruling-seeded-instances (the refreshed row checked against the row the wake began from, twice; the seed's first upload recorded after the wake), and now one more line on a failed start: a start its pre-exec gate refused (launchNotStarted: the exec gate, the pending record or its recheck answered no before root was asked) is recorded as known not started (stopObservation.notStarted) instead of uncertain, only when the wake has started nothing else (wakeStartedNothing); otherwise it goes through cleanupFailedWake and its proofs. A refusal before its lease (step 1), which has started nothing, is recorded the same way. Read sites unchanged; no new read and no root decision;rev3=census-ruling-wake-latency-1;identity=the agent (/opt/carlos/carlos agent, carlos-edge.service, user carlos);basis=marks the end of each wake step on the woken instance's journal timer (wakeSteps: a.now() and a slice append, journal only); no read added, no step reordered;rev3=census-ruling-region-ha-p1a;basis=the agent as carlos: (1) after the restore it asks the backend for the replication class an HA restore imported from the host's published wake state (restoredReplication(rt)) and, if it differs, logs it and sets rt.Replication and the entry's route to it; (2) an HA lease of the stream class replicates with a 1 s monitor interval (SetMonitorInterval); (3) after Replicate, an HA replica opens the entry's files publisher (openEntryFiles(ctx, e, rt)) and starts it, and a publisher that will not open fails the wake through cleanupFailedWake; (4) every cleanupFailedWake call passes e; (5) final fix F1: the two start-error arms that gave the lease straight back (a start its pre-exec gate refused with nothing started, and the default arm) now call giveBackAfterStart(ctx, rt, w, lease), which gives a legacy lease back exactly as before and an HA one only over an empty host slice. New sites: registry:Replication x5 (the class compare, the log line, the assignment and the HA sync-interval check) and whole:Route x6 (rt handed to restoredReplication, openEntryFiles, the cleanup calls and giveBackAfterStart); no file read in this body; only adds a condition before an HA release, no check removed;rev3=census-ruling-rootfs-apps-3;basis=rootfs Plan 3 Tasks 7 and 8: the rootfs admission runs before the claim path and before Acquire on the refreshed row (rootfsWakeRefusal), again in full if a re-read under the lock changed any gate field, and a resident wake re-checks residentRunnable; for a rootfs row a held lease or refused config is an ownership refusal; a rootfs first boot (no good version, fresh) places the empty database under the lease (placeRootfsDB) and uploads it once (syncRootfsPlaceholder), while fresh with a good version is refused as a lost database; declared processes are logged after the wake (rootfsProcessesHook); binary rows unchanged; fix wave 1 and 2 (6189a9db, then the r2 ruling "refuse interrupted init"): a fresh rootfs first boot goes through rootfsFirstBoot (rootfsmarker.go) instead of placeRootfsDB alone: under the lease it reads the lifetime's first-boot marker from the hibernate bucket (present or unreadable refuses, present as errRootfsReplicaMissing), writes it create-only, reads it back (only a read back that finds it confirms it; a write conflict proves nothing), and only then places the database; a warm wake does nothing with the marker (fix wave 1's settleRootfsFirstBoot call and its whole:Route site are gone, no local pending record); adds refusals only, binary rows unchanged;rev3=census-ruling-rootfs-apps-3-release;basis=rootfs Plan 3 Group R, R3: (1) refuses (errWakeUnproven) while another entry's release record of the host is open; (2) a rootfs row with a plan or a pin reads its declared processes before the lease (declaredProcesses(rt, g): the existing staged-manifest read of ExecBackend.Processes, the manifest root's staging wrote, checked against the identity's path and digest) and refuses before Acquire on an error; (3) the staged-identity start runs releaseInWake(ctx, e, rt, id, lease) before startGenExe, under this wake's lease, and a release that did not pass fails the wake; (4) a rootfs row with no plan, no pin and no staged identity is refused, the lease given back, nothing started; (5) a start error whose release is not proven stopped hands the lease to the release record (oweWakeLeaseToRelease) instead of giving it back. New sites +whole:Route x2 (rt to declaredProcesses and releaseInWake); no new file read beyond the existing staged-manifest read; binary rows unchanged;rev3=census-ruling-rootfs-apps-3-workers;basis=rootfs Plan 3 Group W, W1: step 7 no longer calls rootfsProcessesHook (log only); it calls declareRootfsWorkers(e, rt, w), which registers the workers the wake's generation declares as pending and starts nothing (the resident tick starts them once the entry is awake under its lease watch); a worker is never a failure of the wake; the read of the declaration is the existing staged-manifest read (see registerRootfsWorkers); the same read sites in this body, no new read;rev3=census-ruling-region-ha-p1b2;basis=region HA P1b-2: a successful acquire drops the host's holder-cache entry; same reads;rev3=census-ruling-managed-fleets-1b;basis=managed fleets 1b (branch review R1 P1-1 and the controller ruling after it): after the lease, doWake asks routeCurrentUnderLease(ctx, rt, e.worker) (the +whole:Route site), which re-reads the host's row from the box's own registry and, for a labelled row on a fleet box, reads the instance record once; a row that is not this box's and current gives the lease back and refuses the wake, nothing restored or started. Its checks up to the spawn ask wakeGoesOn(e), which adds the entry's in-memory retired mark (set by RetireExcept) to the fence test. Task 6a's awake record call is removed. Agent, not root; it only refuses more.;rev3=census-ruling-stateless-replicas-1;basis=Task 3a: Keep the original entrypoint at its existing census path. Run doWakeOnce, and retry a selected fallback only after the failed generation is proven stopped, no release or stray obligation remains, and a stateful lease was returned. Carry the fallback canonical selection and original outcome metadata.;rev3=census-ruling-ha-generations;basis=region HA storage generations Task 5: doWake re-runs doWakeOnce once when the failed wake's error is lease.ErrHeadMoved or a files-fence conflict, after the same proven give-back checks as the wakeModeChange retry; no read added whole:Route@486 5c4be08e18de95a89222214ebb8d7c887f182f9c76e735099e22d00ab1720e18 |
| +@legacy 3b488d8383e0ffbd81ae8f8feee01da46519207da464c22a6c90fbfcb19377a8 internal/activator/activator.go Service.doWake legacy accepted-legacy accepted-legacy;rev3=census-ruling-292fix;basis=the agent (/opt/carlos/carlos agent, carlos-edge.service, user carlos): main's body (census ruling 292's legacy start mark and lease give-back; census ruling owed's pending record) with the seeded change ruled under census-ruling-seeded-instances (the refreshed row checked against the row the wake began from, twice; the seed's first upload recorded after the wake), and now one more line on a failed start: a start its pre-exec gate refused (launchNotStarted: the exec gate, the pending record or its recheck answered no before root was asked) is recorded as known not started (stopObservation.notStarted) instead of uncertain, only when the wake has started nothing else (wakeStartedNothing); otherwise it goes through cleanupFailedWake and its proofs. A refusal before its lease (step 1), which has started nothing, is recorded the same way. Read sites unchanged; no new read and no root decision;rev3=census-ruling-wake-latency-1;identity=the agent (/opt/carlos/carlos agent, carlos-edge.service, user carlos);basis=marks the end of each wake step on the woken instance's journal timer (wakeSteps: a.now() and a slice append, journal only); no read added, no step reordered;rev3=census-ruling-region-ha-p1a;basis=the agent as carlos: (1) after the restore it asks the backend for the replication class an HA restore imported from the host's published wake state (restoredReplication(rt)) and, if it differs, logs it and sets rt.Replication and the entry's route to it; (2) an HA lease of the stream class replicates with a 1 s monitor interval (SetMonitorInterval); (3) after Replicate, an HA replica opens the entry's files publisher (openEntryFiles(ctx, e, rt)) and starts it, and a publisher that will not open fails the wake through cleanupFailedWake; (4) every cleanupFailedWake call passes e; (5) final fix F1: the two start-error arms that gave the lease straight back (a start its pre-exec gate refused with nothing started, and the default arm) now call giveBackAfterStart(ctx, rt, w, lease), which gives a legacy lease back exactly as before and an HA one only over an empty host slice. New sites: registry:Replication x5 (the class compare, the log line, the assignment and the HA sync-interval check) and whole:Route x6 (rt handed to restoredReplication, openEntryFiles, the cleanup calls and giveBackAfterStart); no file read in this body; only adds a condition before an HA release, no check removed;rev3=census-ruling-rootfs-apps-3;basis=rootfs Plan 3 Tasks 7 and 8: the rootfs admission runs before the claim path and before Acquire on the refreshed row (rootfsWakeRefusal), again in full if a re-read under the lock changed any gate field, and a resident wake re-checks residentRunnable; for a rootfs row a held lease or refused config is an ownership refusal; a rootfs first boot (no good version, fresh) places the empty database under the lease (placeRootfsDB) and uploads it once (syncRootfsPlaceholder), while fresh with a good version is refused as a lost database; declared processes are logged after the wake (rootfsProcessesHook); binary rows unchanged; fix wave 1 and 2 (6189a9db, then the r2 ruling "refuse interrupted init"): a fresh rootfs first boot goes through rootfsFirstBoot (rootfsmarker.go) instead of placeRootfsDB alone: under the lease it reads the lifetime's first-boot marker from the hibernate bucket (present or unreadable refuses, present as errRootfsReplicaMissing), writes it create-only, reads it back (only a read back that finds it confirms it; a write conflict proves nothing), and only then places the database; a warm wake does nothing with the marker (fix wave 1's settleRootfsFirstBoot call and its whole:Route site are gone, no local pending record); adds refusals only, binary rows unchanged;rev3=census-ruling-rootfs-apps-3-release;basis=rootfs Plan 3 Group R, R3: (1) refuses (errWakeUnproven) while another entry's release record of the host is open; (2) a rootfs row with a plan or a pin reads its declared processes before the lease (declaredProcesses(rt, g): the existing staged-manifest read of ExecBackend.Processes, the manifest root's staging wrote, checked against the identity's path and digest) and refuses before Acquire on an error; (3) the staged-identity start runs releaseInWake(ctx, e, rt, id, lease) before startGenExe, under this wake's lease, and a release that did not pass fails the wake; (4) a rootfs row with no plan, no pin and no staged identity is refused, the lease given back, nothing started; (5) a start error whose release is not proven stopped hands the lease to the release record (oweWakeLeaseToRelease) instead of giving it back. New sites +whole:Route x2 (rt to declaredProcesses and releaseInWake); no new file read beyond the existing staged-manifest read; binary rows unchanged;rev3=census-ruling-rootfs-apps-3-workers;basis=rootfs Plan 3 Group W, W1: step 7 no longer calls rootfsProcessesHook (log only); it calls declareRootfsWorkers(e, rt, w), which registers the workers the wake's generation declares as pending and starts nothing (the resident tick starts them once the entry is awake under its lease watch); a worker is never a failure of the wake; the read of the declaration is the existing staged-manifest read (see registerRootfsWorkers); the same read sites in this body, no new read;rev3=census-ruling-region-ha-p1b2;basis=region HA P1b-2: a successful acquire drops the host's holder-cache entry; same reads;rev3=census-ruling-managed-fleets-1b;basis=managed fleets 1b (branch review R1 P1-1 and the controller ruling after it): after the lease, doWake asks routeCurrentUnderLease(ctx, rt, e.worker) (the +whole:Route site), which re-reads the host's row from the box's own registry and, for a labelled row on a fleet box, reads the instance record once; a row that is not this box's and current gives the lease back and refuses the wake, nothing restored or started. Its checks up to the spawn ask wakeGoesOn(e), which adds the entry's in-memory retired mark (set by RetireExcept) to the fence test. Task 6a's awake record call is removed. Agent, not root; it only refuses more.;rev3=census-ruling-stateless-replicas-1;basis=Task 3a: Keep the original entrypoint at its existing census path. Run doWakeOnce, and retry a selected fallback only after the failed generation is proven stopped, no release or stray obligation remains, and a stateful lease was returned. Carry the fallback canonical selection and original outcome metadata.;rev3=census-ruling-ha-generations;basis=region HA storage generations Task 5: doWake re-runs doWakeOnce once when the failed wake's error is lease.ErrHeadMoved or a files-fence conflict, after the same proven give-back checks as the wakeModeChange retry; no read added; code-health fix: the take retry call and retryTake moved verbatim from activator.go to haretrytake.go (doWakeRetryingTake calls doWakeOnce, then retryTake when takeRaced), no change whole:Route@431 8947407ae09bdc2d122d1a0975fb19bc09da80c52f9d4019ddc61b56a739c822 |
| @legacy 8a33cbba9be29b6a7cef97d29ea43e2801f368f9ff05eef95e6a153f85326153 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 file:Stat@1163,registry:Host@354,whole:Route@1020,whole:Route@1100,whole:Route@1376,whole:Route@243,whole:Route@327,whole:Route@374,whole:Route@5613,whole:Route@5703,whole:Route@6280,whole:Route@643,whole:Route@6511 27131b2433327d4619bf78499a30e525303a4bd38462e82455ef2ff6c6c3240e |
| @legacy e09d8597abefbf56e38b037013692a12e335f5d21a34c48e9f88920c39d3c268 internal/activator/hasecrets.go ExecBackend.haManifestFound legacy accepted-legacy accepted-legacy;rev3=census-ruling-region-ha-p1a;basis=new: whether the host's files manifest exists: from the wake's or entry's publisher if there is one, else one hostfiles.Load of <hibernate prefix>/files/0/ from the files store; +registry:Host x2;rev3=census-ruling-ha-generations;basis=storage generations Task 5 fix: a found manifest is decoded with no defaults and a files-fence placeholder (v2, lock_generation > 0, seq 0, no entries, platform or origins) counts as no manifest so the first generations wake can mint; any other manifest still counts as found; no read added (Astra + Fable reviewed) registry:Host@149,registry:Host@373 ecc25f3bf7b916e4e32881ac91938c5d2005c1aa1b9f40f308f5420a28051bfc |
| @legacy 7975d7f26e8896a6cc8c55cdcc65abf0115dd9d4c2ce03793651e9d304027999 internal/activator/poolwithdrawal.go Service.poolWithdrawalProof legacy accepted-legacy accepted-legacy;rev3=census-ruling-region-ha-g2-fixes;basis=New withdrawal proof uses existing fence/stop, cgroup, record/lifetime, holder-lock, obligation, local release-record/stat and registry timer/route readers. Requires proven stop and clean release or safe never-started state; retains outstanding duties and special rows. No new path namespace or record write; local files use existing backend layout.;rev3=census-ruling-region-ha-g2r-fixes;basis=W1: each pending return wraps the error that caused it (cgroup/nested readiness, record, lock) instead of discarding it. Same readers and proof conditions; no new read or write.;rev3=census-ruling-ha-generations;basis=storage generations Task 1: compares the released marker with Marker.SameRecord (ignores the decode-only Gen flag) so a generations marker confirms the release; same readers registry:Addr@1111,registry:Addrs@1128,registry:Args@1185,registry:DBPath@1146,registry:HA@1351,registry:Hibernate@1076,registry:Host@1597,registry:Host@2113,registry:Host@2373,registry:Host@2582,registry:Host@279,registry:Host@4086,registry:Host@4179,registry:Host@434,registry:Host@469,registry:Host@508,registry:Host@539,registry:Host@621,registry:Host@658,registry:Host@897,registry:Kind@1034,registry:Kind@1292,registry:Kind@1396,registry:NextDue@4342,registry:Runtime@1165,registry:Socket@1092,registry:WakeIncarnation@1263,registry:WakeIncarnation@1876,whole:Route@115,whole:Route@1452,whole:Route@1681,whole:Route@2208,whole:Route@2368,whole:Route@2631,whole:Route@4206,whole:Route@4250,whole:Route@4273,whole:Route@4296,whole:Route@977,whole:Timer@4370 5d4bec521ea0e1aeed4d00b9d7c76057254c6821012a3dab696e09d92cfa1e23 |
| @@ -26,7 +26,7 @@ |
| @legacy 9b3f242e2070f6fb1a25f072c64729e6268a49b581c9108d22acc3b330412cd5 internal/activator/hawake.go ExecBackend.acquireClassified legacy accepted-legacy accepted-legacy;rev3=census-ruling-region-ha-p1a;basis=new: the acquire's classification: a legacy route (sidecar, hand-added or not an instance) takes lease.Acquire and refuses on an HA-format lock; otherwise isHA (a record read error fails the wake, never falls back to legacy); not HA takes lease.Acquire, and an HA-format lock there marks the host HA for good and continues; HA requires haContained before any lock request, then lease.AcquireHA with the same-box proof; held and refused leases map to errLeaseHeld and errLeaseRefused (leaseError); +registry:Host, +whole:Route x7;rev3=census-ruling-region-ha-p1b1;basis=region HA P1b-1: the HA acquire's Proofs gain OwnerTerminated (b.ownerTerminated(ctx, rt)) beside SameBoxEmpty; one more whole:Route site passes the route to ownerTerminated; nothing new is read; the proof is consulted only by hafresh.DecideAcquire for another box's expired HA lock;rev3=census-ruling-managed-fleets-1b;basis=managed fleets 1b (Task 7, two-box fleet test): the two legacy acquires call b.acquireLegacy(ctx, prefix), which is acquireLegacyLease exactly when ExecBackend.LeaseIdentity is nil and LeaseTTL is 0 (the agent never sets them), otherwise lease.AcquireAs with that identity and TTL. The classification, the HA path and every refusal are unchanged. Read sites unchanged (9). Agent, not root.;rev3=census-ruling-region-ha-p1b3b-t;basis=Select the restriction-only AcquireHAForDuty for background contexts, including sticky HA reclassification; observe successful ordinary acquires to clear stale suppression. Add a whole-route observer argument; no new authority. B2 binds the current authoritative lifetime and advances local revision before HA acquire, invalidating concurrent adoption I/O. Ordinary lease authority and restore ordering remain unchanged. B2 fix r1: advance the local duty revision with an unconditional registry UPDATE before acquire; remove pre-acquire lifetime CAS and basis clearing. Failed acquire preserves adopted state. Existing lease validation and successful-acquire observer remain. B3: pass the same optional durable termination proof adapter to visitor and duty acquires. Nil retains the existing path until controller arming; configured proof failures refuse, with no fallback to a live boolean. No new read in this unit. Final fix P2-1: copy the shared proof adapter per acquire to attach the existing takeover telemetry; retain a live confirmer fallback for unverified identities. Existing classified owner, lifetime, expiry and CAS guards remain.;rev3=census-ruling-agent-start-demo-1;basis=Reads demo shape/layout and takes the existing legacy renewing lease for demos; never falls through to HA acquisition. Merge integration against origin/main 9bd45488 retains main's HA duty/termination proof wiring after the demo legacy-lease branch; the added whole-route passes are main's existing checks.;rev3=census-ruling-region-ha-p1b3b-s;basis=Before any HA sidecar write require a known canonical lifetime, files store and valid shared sealer; unstamped sidecars cannot upgrade from an HA lock. Reuse existing containment, AcquireHAForDuty, restore and release paths.;rev3=census-ruling-region-ha-g2-fixes;basis=Pass local pool eligibility and classified-refusal observer into HA acquire; additional whole-route uses, no additional direct external read; existing lifetime and termination proofs remain.;rev3=census-ruling-ha-generations;basis=storage generations Tasks 1, 5, 10: passes GenerationsOn (box switch) to the HA acquire and the fast-row proofs (LiveOwnerTerminated, LiveSameBoxEmpty without alarms) and Proofs.GenerationsFast; +whole:Route x3 are rt passed to those proof closures; no direct read added Option A (round 2, 8a3d302 for Paul): GenerationsOn and the proofs' GenerationsFast are now set only when generationsEligible(haGetenv) holds (a group member, CARLOS_BOX_REFERENCE=group, with the switch on or fast), read from the process environment once per wake, no new read; the proofs carry GenerationsEligible, so on a fixed box or with the switch off hafresh.DecideAcquire refuses every generations lock (held, expired or marker) before any write, and lease.acquireHARestricted ignores GenerationsOn without it. registry:Host@106,whole:Route@1064,whole:Route@1115,whole:Route@1365,whole:Route@1668,whole:Route@1964,whole:Route@221,whole:Route@2421,whole:Route@2471,whole:Route@2522,whole:Route@2569,whole:Route@2624,whole:Route@2676,whole:Route@278,whole:Route@2834,whole:Route@2942,whole:Route@4536,whole:Route@4632,whole:Route@589,whole:Route@627 c5e37c425ef475415fc30b2c96960de8be7064de1c01ec2539ee223d30a4062b |
| @legacy d54e9b4cf4667eb21e2ccffbe31f68eeb162fa98dfa6d1427cf87550ffab5a3e internal/activator/hawake.go ExecBackend.restoreFilesClean legacy accepted-legacy accepted-legacy;rev3=census-ruling-region-ha-p1a;basis=new: restores the HA host's published files into a fresh <host>.restore directory beneath the instance data dir (instancefs, no link followed), renames it into place without replacing anything, writes the manifest's env item as <host>.env (instancefs.WriteAtomic, 0600) and imports the manifest's wake state into the registry (hostfiles.ImportWake, then the class for restoredReplication); the source is the host's files manifest in the hibernate bucket, written by the agents of the boxes that held the host; every failure fails the wake; +registry:Host, +whole:Route x2;rev3=census-ruling-durability-3a-escrow;basis=durability 3a Task 3 (fix round 1: sealed precedence before any fetch): the restore into <host>.restore is now RestoreRootBaselineShadowed with sealedShadow(host), a pure function of the manifest already read and validated: a live raw instance.key or report.token entry whose sealed item the manifest holds is neither fetched nor written (so a missing or corrupt raw object cannot fail the wake, and a sealed item that does not open fails it with no raw fallback); every other entry is restored as before, and the baseline the wake's publisher continues from is the manifest as read. Then each sealed trio item the manifest holds (instance.key.sealed, report.token.sealed) is fetched and opened with hostfiles.ReadSealed (key, sha256, v2 envelope, binding and MAC checked) and written with instancefs.WriteAtomic (openat2 directory, no symlink, O_EXCL temp, rename, 0600) into the restore directory this function created, then that directory is synced; then the same no-replace rename. The env file comes from the sealed env item through ReadSealed when present, else from the raw env item as before, written as before. The source is still the host's files manifest in the hibernate bucket; the destinations are the same restore directory and env file; no new path is opened, followed or named from input; the sealer (sealerFor) is built only when a sealed item is present. Durability 3a Task 5: after RestoreRootBaselineShadowed, noteRawSecrets(host, rm) on the manifest just restored from. Reads only manifests this process already holds (no request, no file opened); calls the detector, which logs and calls ExecBackend.OnRawSecret; nothing else changes. Read sites unchanged. Durability 3a Task 5 fix round 1: the restore is RestoreRootBaselineObserved (the same read and restore as RestoreRootBaselineShadowed) with a checked callback, noteRawSecrets(host, m), run once the manifest is read and validated and before any entry is removed, fetched or written, so a restore that then fails still shows the detector the manifest; the later noteRawSecrets call is gone. No request, open or write added; read sites unchanged.;rev3=census-ruling-region-ha-p1b3b-t;basis=Final fix P3-1: select the HA ordinary-wake importer after the same acquired-lease manifest restore. It alone permits generation of legacy non-claim timer registrations; claim-owned empty registrations remain refused. All file, key and manifest reads are unchanged.;rev3=census-ruling-ha-generations;basis=storage generations Task 5: split into restoreFilesCleanRead (the same reads, moved) plus the files fence; this unit reads less (-registry:Host, -whole:Route) whole:Route@196,whole:Route@249 3963dc6503598dd6bbf6eb6cb1c35214864a8a02ab74f9b05a2485464449c106 |
| @legacy f36ad02e83d074b31c34dd604c214042b12cc178cdf3d18f31a3022dc5ededf7 internal/activator/hawake.go ExecBackend.restoreHA legacy accepted-legacy accepted-legacy;rev3=census-ruling-region-ha-p1a;basis=new: an HA host's restore: haContained again, the existing seed-obligation and seed-marker checks, then on a first wake (lock absent) sets the local copy aside and boots fresh; otherwise keeps the local copy only when hafresh.DecideKeep over the acquire's view, this box's identity, the lifetime and the local state (readLocalNow) says so, else sets it aside (instancefs renames and removes beneath their directories), restores the replica (lease.Restore, CheckDB, quarantine on corruption) and the files (restoreFilesClean); every error fails the wake; +registry:Host, +whole:Route x8;rev3=census-ruling-ha-generations;basis=storage generations Task 5: legacy (non-generations) HA restore unchanged, called from restoreHAWake; -whole:Route moved into haRestorePrelude Branch fix (MinIO two-box budget): after refuseHeadWithoutGenerations has read head.json once and found none, the database restore binds the root layout directly (restoreRootReplica = lease.RestoreRoot: BindReplica at replicagen.Root, then the same litestream restore Restore runs), so the wake makes one head.json GET, not two; the same replica reads otherwise, no read added. None can appear meanwhile: only a generations take writes head.json, and it needs the lock this wake holds. registry:Host@135,whole:Route@1121,whole:Route@1778,whole:Route@178,whole:Route@236,whole:Route@301,whole:Route@695,whole:Route@779 d77d3106cfcfafd92d1dc149eae48837db0fb88a6a5b38103e3246bee34854ef |
| -internal/activator/activator.go Service.doWake legacy accepted-legacy accepted-legacy;rev3=census-ruling-292fix;basis=the agent (/opt/carlos/carlos agent, carlos-edge.service, user carlos): main's body (census ruling 292's legacy start mark and lease give-back; census ruling owed's pending record) with the seeded change ruled under census-ruling-seeded-instances (the refreshed row checked against the row the wake began from, twice; the seed's first upload recorded after the wake), and now one more line on a failed start: a start its pre-exec gate refused (launchNotStarted: the exec gate, the pending record or its recheck answered no before root was asked) is recorded as known not started (stopObservation.notStarted) instead of uncertain, only when the wake has started nothing else (wakeStartedNothing); otherwise it goes through cleanupFailedWake and its proofs. A refusal before its lease (step 1), which has started nothing, is recorded the same way. Read sites unchanged; no new read and no root decision;rev3=census-ruling-wake-latency-1;identity=the agent (/opt/carlos/carlos agent, carlos-edge.service, user carlos);basis=marks the end of each wake step on the woken instance's journal timer (wakeSteps: a.now() and a slice append, journal only); no read added, no step reordered;rev3=census-ruling-region-ha-p1a;basis=the agent as carlos: (1) after the restore it asks the backend for the replication class an HA restore imported from the host's published wake state (restoredReplication(rt)) and, if it differs, logs it and sets rt.Replication and the entry's route to it; (2) an HA lease of the stream class replicates with a 1 s monitor interval (SetMonitorInterval); (3) after Replicate, an HA replica opens the entry's files publisher (openEntryFiles(ctx, e, rt)) and starts it, and a publisher that will not open fails the wake through cleanupFailedWake; (4) every cleanupFailedWake call passes e; (5) final fix F1: the two start-error arms that gave the lease straight back (a start its pre-exec gate refused with nothing started, and the default arm) now call giveBackAfterStart(ctx, rt, w, lease), which gives a legacy lease back exactly as before and an HA one only over an empty host slice. New sites: registry:Replication x5 (the class compare, the log line, the assignment and the HA sync-interval check) and whole:Route x6 (rt handed to restoredReplication, openEntryFiles, the cleanup calls and giveBackAfterStart); no file read in this body; only adds a condition before an HA release, no check removed;rev3=census-ruling-rootfs-apps-3;basis=rootfs Plan 3 Tasks 7 and 8: the rootfs admission runs before the claim path and before Acquire on the refreshed row (rootfsWakeRefusal), again in full if a re-read under the lock changed any gate field, and a resident wake re-checks residentRunnable; for a rootfs row a held lease or refused config is an ownership refusal; a rootfs first boot (no good version, fresh) places the empty database under the lease (placeRootfsDB) and uploads it once (syncRootfsPlaceholder), while fresh with a good version is refused as a lost database; declared processes are logged after the wake (rootfsProcessesHook); binary rows unchanged; fix wave 1 and 2 (6189a9db, then the r2 ruling "refuse interrupted init"): a fresh rootfs first boot goes through rootfsFirstBoot (rootfsmarker.go) instead of placeRootfsDB alone: under the lease it reads the lifetime's first-boot marker from the hibernate bucket (present or unreadable refuses, present as errRootfsReplicaMissing), writes it create-only, reads it back (only a read back that finds it confirms it; a write conflict proves nothing), and only then places the database; a warm wake does nothing with the marker (fix wave 1's settleRootfsFirstBoot call and its whole:Route site are gone, no local pending record); adds refusals only, binary rows unchanged;rev3=census-ruling-rootfs-apps-3-release;basis=rootfs Plan 3 Group R, R3: (1) refuses (errWakeUnproven) while another entry's release record of the host is open; (2) a rootfs row with a plan or a pin reads its declared processes before the lease (declaredProcesses(rt, g): the existing staged-manifest read of ExecBackend.Processes, the manifest root's staging wrote, checked against the identity's path and digest) and refuses before Acquire on an error; (3) the staged-identity start runs releaseInWake(ctx, e, rt, id, lease) before startGenExe, under this wake's lease, and a release that did not pass fails the wake; (4) a rootfs row with no plan, no pin and no staged identity is refused, the lease given back, nothing started; (5) a start error whose release is not proven stopped hands the lease to the release record (oweWakeLeaseToRelease) instead of giving it back. New sites +whole:Route x2 (rt to declaredProcesses and releaseInWake); no new file read beyond the existing staged-manifest read; binary rows unchanged;rev3=census-ruling-rootfs-apps-3-workers;basis=rootfs Plan 3 Group W, W1: step 7 no longer calls rootfsProcessesHook (log only); it calls declareRootfsWorkers(e, rt, w), which registers the workers the wake's generation declares as pending and starts nothing (the resident tick starts them once the entry is awake under its lease watch); a worker is never a failure of the wake; the read of the declaration is the existing staged-manifest read (see registerRootfsWorkers); the same read sites in this body, no new read;rev3=census-ruling-region-ha-p1b2;basis=region HA P1b-2: a successful acquire drops the host's holder-cache entry; same reads;rev3=census-ruling-managed-fleets-1b;basis=managed fleets 1b (branch review R1 P1-1 and the controller ruling after it): after the lease, doWake asks routeCurrentUnderLease(ctx, rt, e.worker) (the +whole:Route site), which re-reads the host's row from the box's own registry and, for a labelled row on a fleet box, reads the instance record once; a row that is not this box's and current gives the lease back and refuses the wake, nothing restored or started. Its checks up to the spawn ask wakeGoesOn(e), which adds the entry's in-memory retired mark (set by RetireExcept) to the fence test. Task 6a's awake record call is removed. Agent, not root; it only refuses more.;rev3=census-ruling-stateless-replicas-1;basis=Task 3a: Keep the original entrypoint at its existing census path. Run doWakeOnce, and retry a selected fallback only after the failed generation is proven stopped, no release or stray obligation remains, and a stateful lease was returned. Carry the fallback canonical selection and original outcome metadata.;rev3=census-ruling-ha-generations;basis=region HA storage generations Task 5: doWake re-runs doWakeOnce once when the failed wake's error is lease.ErrHeadMoved or a files-fence conflict, after the same proven give-back checks as the wakeModeChange retry; no read added whole:Route@486 5c4be08e18de95a89222214ebb8d7c887f182f9c76e735099e22d00ab1720e18 |
| +internal/activator/activator.go Service.doWake legacy accepted-legacy accepted-legacy;rev3=census-ruling-292fix;basis=the agent (/opt/carlos/carlos agent, carlos-edge.service, user carlos): main's body (census ruling 292's legacy start mark and lease give-back; census ruling owed's pending record) with the seeded change ruled under census-ruling-seeded-instances (the refreshed row checked against the row the wake began from, twice; the seed's first upload recorded after the wake), and now one more line on a failed start: a start its pre-exec gate refused (launchNotStarted: the exec gate, the pending record or its recheck answered no before root was asked) is recorded as known not started (stopObservation.notStarted) instead of uncertain, only when the wake has started nothing else (wakeStartedNothing); otherwise it goes through cleanupFailedWake and its proofs. A refusal before its lease (step 1), which has started nothing, is recorded the same way. Read sites unchanged; no new read and no root decision;rev3=census-ruling-wake-latency-1;identity=the agent (/opt/carlos/carlos agent, carlos-edge.service, user carlos);basis=marks the end of each wake step on the woken instance's journal timer (wakeSteps: a.now() and a slice append, journal only); no read added, no step reordered;rev3=census-ruling-region-ha-p1a;basis=the agent as carlos: (1) after the restore it asks the backend for the replication class an HA restore imported from the host's published wake state (restoredReplication(rt)) and, if it differs, logs it and sets rt.Replication and the entry's route to it; (2) an HA lease of the stream class replicates with a 1 s monitor interval (SetMonitorInterval); (3) after Replicate, an HA replica opens the entry's files publisher (openEntryFiles(ctx, e, rt)) and starts it, and a publisher that will not open fails the wake through cleanupFailedWake; (4) every cleanupFailedWake call passes e; (5) final fix F1: the two start-error arms that gave the lease straight back (a start its pre-exec gate refused with nothing started, and the default arm) now call giveBackAfterStart(ctx, rt, w, lease), which gives a legacy lease back exactly as before and an HA one only over an empty host slice. New sites: registry:Replication x5 (the class compare, the log line, the assignment and the HA sync-interval check) and whole:Route x6 (rt handed to restoredReplication, openEntryFiles, the cleanup calls and giveBackAfterStart); no file read in this body; only adds a condition before an HA release, no check removed;rev3=census-ruling-rootfs-apps-3;basis=rootfs Plan 3 Tasks 7 and 8: the rootfs admission runs before the claim path and before Acquire on the refreshed row (rootfsWakeRefusal), again in full if a re-read under the lock changed any gate field, and a resident wake re-checks residentRunnable; for a rootfs row a held lease or refused config is an ownership refusal; a rootfs first boot (no good version, fresh) places the empty database under the lease (placeRootfsDB) and uploads it once (syncRootfsPlaceholder), while fresh with a good version is refused as a lost database; declared processes are logged after the wake (rootfsProcessesHook); binary rows unchanged; fix wave 1 and 2 (6189a9db, then the r2 ruling "refuse interrupted init"): a fresh rootfs first boot goes through rootfsFirstBoot (rootfsmarker.go) instead of placeRootfsDB alone: under the lease it reads the lifetime's first-boot marker from the hibernate bucket (present or unreadable refuses, present as errRootfsReplicaMissing), writes it create-only, reads it back (only a read back that finds it confirms it; a write conflict proves nothing), and only then places the database; a warm wake does nothing with the marker (fix wave 1's settleRootfsFirstBoot call and its whole:Route site are gone, no local pending record); adds refusals only, binary rows unchanged;rev3=census-ruling-rootfs-apps-3-release;basis=rootfs Plan 3 Group R, R3: (1) refuses (errWakeUnproven) while another entry's release record of the host is open; (2) a rootfs row with a plan or a pin reads its declared processes before the lease (declaredProcesses(rt, g): the existing staged-manifest read of ExecBackend.Processes, the manifest root's staging wrote, checked against the identity's path and digest) and refuses before Acquire on an error; (3) the staged-identity start runs releaseInWake(ctx, e, rt, id, lease) before startGenExe, under this wake's lease, and a release that did not pass fails the wake; (4) a rootfs row with no plan, no pin and no staged identity is refused, the lease given back, nothing started; (5) a start error whose release is not proven stopped hands the lease to the release record (oweWakeLeaseToRelease) instead of giving it back. New sites +whole:Route x2 (rt to declaredProcesses and releaseInWake); no new file read beyond the existing staged-manifest read; binary rows unchanged;rev3=census-ruling-rootfs-apps-3-workers;basis=rootfs Plan 3 Group W, W1: step 7 no longer calls rootfsProcessesHook (log only); it calls declareRootfsWorkers(e, rt, w), which registers the workers the wake's generation declares as pending and starts nothing (the resident tick starts them once the entry is awake under its lease watch); a worker is never a failure of the wake; the read of the declaration is the existing staged-manifest read (see registerRootfsWorkers); the same read sites in this body, no new read;rev3=census-ruling-region-ha-p1b2;basis=region HA P1b-2: a successful acquire drops the host's holder-cache entry; same reads;rev3=census-ruling-managed-fleets-1b;basis=managed fleets 1b (branch review R1 P1-1 and the controller ruling after it): after the lease, doWake asks routeCurrentUnderLease(ctx, rt, e.worker) (the +whole:Route site), which re-reads the host's row from the box's own registry and, for a labelled row on a fleet box, reads the instance record once; a row that is not this box's and current gives the lease back and refuses the wake, nothing restored or started. Its checks up to the spawn ask wakeGoesOn(e), which adds the entry's in-memory retired mark (set by RetireExcept) to the fence test. Task 6a's awake record call is removed. Agent, not root; it only refuses more.;rev3=census-ruling-stateless-replicas-1;basis=Task 3a: Keep the original entrypoint at its existing census path. Run doWakeOnce, and retry a selected fallback only after the failed generation is proven stopped, no release or stray obligation remains, and a stateful lease was returned. Carry the fallback canonical selection and original outcome metadata.;rev3=census-ruling-ha-generations;basis=region HA storage generations Task 5: doWake re-runs doWakeOnce once when the failed wake's error is lease.ErrHeadMoved or a files-fence conflict, after the same proven give-back checks as the wakeModeChange retry; no read added; code-health fix: the take retry call and retryTake moved verbatim from activator.go to haretrytake.go (doWakeRetryingTake calls doWakeOnce, then retryTake when takeRaced), no change whole:Route@431 8947407ae09bdc2d122d1a0975fb19bc09da80c52f9d4019ddc61b56a739c822 |
| 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 file:Stat@1163,registry:Host@354,whole:Route@1020,whole:Route@1100,whole:Route@1376,whole:Route@243,whole:Route@327,whole:Route@374,whole:Route@5613,whole:Route@5703,whole:Route@6280,whole:Route@643,whole:Route@6511 27131b2433327d4619bf78499a30e525303a4bd38462e82455ef2ff6c6c3240e |
| internal/activator/hasecrets.go ExecBackend.haManifestFound legacy accepted-legacy accepted-legacy;rev3=census-ruling-region-ha-p1a;basis=new: whether the host's files manifest exists: from the wake's or entry's publisher if there is one, else one hostfiles.Load of <hibernate prefix>/files/0/ from the files store; +registry:Host x2;rev3=census-ruling-ha-generations;basis=storage generations Task 5 fix: a found manifest is decoded with no defaults and a files-fence placeholder (v2, lock_generation > 0, seq 0, no entries, platform or origins) counts as no manifest so the first generations wake can mint; any other manifest still counts as found; no read added (Astra + Fable reviewed) registry:Host@149,registry:Host@373 ecc25f3bf7b916e4e32881ac91938c5d2005c1aa1b9f40f308f5420a28051bfc |
| internal/activator/poolwithdrawal.go Service.poolWithdrawalProof legacy accepted-legacy accepted-legacy;rev3=census-ruling-region-ha-g2-fixes;basis=New withdrawal proof uses existing fence/stop, cgroup, record/lifetime, holder-lock, obligation, local release-record/stat and registry timer/route readers. Requires proven stop and clean release or safe never-started state; retains outstanding duties and special rows. No new path namespace or record write; local files use existing backend layout.;rev3=census-ruling-region-ha-g2r-fixes;basis=W1: each pending return wraps the error that caused it (cgroup/nested readiness, record, lock) instead of discarding it. Same readers and proof conditions; no new read or write.;rev3=census-ruling-ha-generations;basis=storage generations Task 1: compares the released marker with Marker.SameRecord (ignores the decode-only Gen flag) so a generations marker confirms the release; same readers registry:Addr@1111,registry:Addrs@1128,registry:Args@1185,registry:DBPath@1146,registry:HA@1351,registry:Hibernate@1076,registry:Host@1597,registry:Host@2113,registry:Host@2373,registry:Host@2582,registry:Host@279,registry:Host@4086,registry:Host@4179,registry:Host@434,registry:Host@469,registry:Host@508,registry:Host@539,registry:Host@621,registry:Host@658,registry:Host@897,registry:Kind@1034,registry:Kind@1292,registry:Kind@1396,registry:NextDue@4342,registry:Runtime@1165,registry:Socket@1092,registry:WakeIncarnation@1263,registry:WakeIncarnation@1876,whole:Route@115,whole:Route@1452,whole:Route@1681,whole:Route@2208,whole:Route@2368,whole:Route@2631,whole:Route@4206,whole:Route@4250,whole:Route@4273,whole:Route@4296,whole:Route@977,whole:Timer@4370 5d4bec521ea0e1aeed4d00b9d7c76057254c6821012a3dab696e09d92cfa1e23 |
| @@ -58,7 +58,7 @@ internal/activator/hawake.go ExecBackend.restoreHA legacy accepted-legacy accept |
| @remove internal/lease/legacytake.go readView |
| @removed internal/lease/legacytake.go readView H3 census-ruling-ha-generations;basis=quiet: now delegates to readViewClock |
| @coverage . bd84b8515b6876b883f527a9327b7b82a0934048d46f36bd7abd6a7100a0bb50 |
| -@coverage internal/activator 6de59247341815cdd7e474bd0e993d29b947e8d83b557086556dcafbc3797317 |
| +@coverage internal/activator 9f392797aeb4d36eede3630e949608fda33b9c1ad26a257d180b71ca7a23ad85 |
| @coverage internal/dbdoor 815998a9d98513117aacf850b4b585db0c06fd61357baa0143c55ce856a78a9d |
| @coverage internal/dbreads 6b803f18ee087eb59532a7bdeeac748f23c666f8a15bf03ca11072b9e59d9bf3 |
| @coverage internal/genselect 2cb4d36f5c6ac1d0f88d506175c6b633827775c29277a1de4a6399f5b3e42d9e |