carlos / platform Public

census: re-propose ha-generations for Option A

Claims for acquireClassified and AdoptHost now describe the eligibility
gate (group member with the switch on or fast, read from the process
environment once per wake or adoption, no new read). The activator,
hafresh and lease envelopes re-pin. Seal acb51d5f.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
claude agent, operated by paul@keymail.dev pushed by paul@keymail.dev b9e0267f62d3bbb2fe5d298c0f59d92f19a9b3f9 parent 748d53e
3 files changed, +11 −11
  • docs/superpowers/notes/census-proposal-ha-generations.md +3 −3
  • internal/provision/testdata/plan14-root-reads-chain.tsv +1 −1
  • internal/provision/testdata/plan14-root-reads-ha-generations.tsv +7 −7
diff --git a/docs/superpowers/notes/census-proposal-ha-generations.md b/docs/superpowers/notes/census-proposal-ha-generations.md
index 38eba8548..719c0a791 100644
--- a/docs/superpowers/notes/census-proposal-ha-generations.md
+++ b/docs/superpowers/notes/census-proposal-ha-generations.md
@@ -16,8 +16,8 @@ Ruling `census-ruling-ha-generations`. The independent reviewer approves or reje
| `internal/host/systemunits.go` `ensureSystemUnits` | body | unchanged (0) | Branch fix (storage generations activation floor): first calls noteGenerationsSwitch(etcDir, os.Getenv, logf): when the pass's own environment (the adopt units load /etc/carlos/host.env) has CARLOS_HA_GENERATIONS anything but empty, 0 or off, it os.Lstats /etc/carlos/ha-generations-floor and, when absent, creates it create-only (O_CREATE|O_EXCL, 0600, as root; it never creates /etc/carlos), syncs it and the directory, and logs an ALERT on failure, never fatal. No file content is read. The rest unchanged. |
| `internal/host/units/carlos-system-recover.service` `external` | body | unchanged (1) | Root oneshot. Branch fix (storage generations activation floor): the second branch's && chain gains, last and only after the existing proxy-allows-prev gate has passed, `/opt/carlos/carlos system generations-allows-prev /opt/carlos/carlos.prev`; any non-zero exit falls through to the existing `exec /opt/carlos/carlos system apply --recover`, whose own recovery refuses the same carlos.prev (requirePrevFeatures, now asking for every armed feature). The verb runs as the current binary, accepts exactly the one argument /opt/carlos/carlos.prev (anything else exit 2), exits 0 without running anything unless armed: CARLOS_HA_GENERATIONS anything but empty, 0 or off in its environment (this unit loads EnvironmentFile=-/etc/carlos/host.env) or in /etc/carlos/host.env read by the existing protected reader sandboxHostEnvironmentAt (an error arms it), or /etc/carlos/ha-generations-floor present (os.Lstat only, never opened; any error but not-exist arms it; root-owned 0600, created create-only by root when the switch is seen on, never removed). When armed it first applies the exec-sandbox rule (sandboxAllowsPrev), then runs /opt/carlos/carlos.prev `version --json` (productionSysOps run bounded by systemVersionWait), the binary this branch is about to exec. Guard branch, the other gates and the rest of the shell bytes unchanged; header comment added. |
| `internal/lease/tombstone.go` `readLockFields` | body | unchanged (1) | storage generations: the same single bounded GET of lock.json, with its ETag, now also decodes the body with hafresh.DecodeLock and returns v.Generations(), so Tombstone refuses a storage-generations lock; a lock hafresh.DecodeLock cannot read (a malformed generations field) is an error, and Tombstone refuses on it; no read added (it does not return the Date header) |
-| `internal/activator/haadopt.go` `Service.AdoptHost` | sites | +registry:Host ×2 | storage generations Task 10 fix: marks the host adoption-held after a successful adoption acquire and clears it after a successful release (in-memory only), so the fast same-box row cannot take a lock this process holds; +registry:Host x2 are the host passed to that mark/clear; no storage read added |
-| `internal/activator/hawake.go` `ExecBackend.acquireClassified` | sites | +whole:Route ×3 | 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 |
+| `internal/activator/haadopt.go` `Service.AdoptHost` | sites | +registry:Host ×2 | storage generations Task 10 fix: marks the host adoption-held after a successful adoption acquire and clears it after a successful release (in-memory only), so the fast same-box row cannot take a lock this process holds; +registry:Host x2 are the host passed to that mark/clear; no storage read added Option A (round 2, 8a3d302 for Paul): the adoption acquire's proofs carry GenerationsEligible from generationsEligible(haGetenv), the process environment only (CARLOS_BOX_REFERENCE=group and CARLOS_HA_GENERATIONS on or fast), read once per adoption, no new read; on a fixed box or with the switch off hafresh.DecideAcquire refuses a generations lock before any write. |
+| `internal/activator/hawake.go` `ExecBackend.acquireClassified` | sites | +whole:Route ×3 | 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. |
| `internal/activator/hawake.go` `ExecBackend.restoreFilesClean` | sites | -registry:Host, -whole:Route | storage generations Task 5: split into restoreFilesCleanRead (the same reads, moved) plus the files fence; this unit reads less (-registry:Host, -whole:Route) |
| `internal/activator/hawake.go` `ExecBackend.restoreHA` | sites | -whole:Route | storage generations Task 5: legacy (non-generations) HA restore unchanged, called from restoreHAWake; -whole:Route moved into haRestorePrelude |
@@ -61,6 +61,6 @@ New dispositions, which census-propose wrote and the reviewer checks against the
- new `internal/lease/legacytake.go:readViewClock`: reads +file:ReadAll; written legacy, accepted-legacy, frozen
- quiet `internal/lease/legacytake.go:readView`: reads nothing now; retired while it reads nothing (or its row keeps no sites)
-Seal: `5d4a5eea79394145fdd59aa5eb87115cc1ee396e02e0ab4b21decd2b3a10e3b4` → `bc4446efdbcef47a336e72e7dd679dfe3def166b185bfb48b1b488c4168adccb`.
+Seal: `5d4a5eea79394145fdd59aa5eb87115cc1ee396e02e0ab4b21decd2b3a10e3b4` → `acb51d5f081ef7dbb96ecf5fd4765c009c81362a63b8663e4175bf2a4cf88093`.
Overlay: `internal/provision/testdata/plan14-root-reads-ha-generations.tsv`, appended to `internal/provision/testdata/plan14-root-reads-chain.tsv`.
diff --git a/internal/provision/testdata/plan14-root-reads-chain.tsv b/internal/provision/testdata/plan14-root-reads-chain.tsv
index 7637a7517..f373e694c 100644
--- a/internal/provision/testdata/plan14-root-reads-chain.tsv
+++ b/internal/provision/testdata/plan14-root-reads-chain.tsv
@@ -252,4 +252,4 @@ plan14-root-reads-staticcheck-sa1012.tsv 5fcd060180e923773dad3faee7cc60ee250779a
plan14-root-reads-staticcheck-sa1019.tsv f9be26c06eb1c844b91a75f65faa51997048cb2900f3ed078be2ae28c65c0e98
plan14-root-reads-small-fixes-1246-1248.tsv c6d366dcf2211b714977b7a69180289555b362dfe5f36a5780af90b5ece82998
plan14-root-reads-edge-ppv2-idle.tsv 5d4a5eea79394145fdd59aa5eb87115cc1ee396e02e0ab4b21decd2b3a10e3b4
-plan14-root-reads-ha-generations.tsv bc4446efdbcef47a336e72e7dd679dfe3def166b185bfb48b1b488c4168adccb
+plan14-root-reads-ha-generations.tsv acb51d5f081ef7dbb96ecf5fd4765c009c81362a63b8663e4175bf2a4cf88093
diff --git a/internal/provision/testdata/plan14-root-reads-ha-generations.tsv b/internal/provision/testdata/plan14-root-reads-ha-generations.tsv
index 418d4d5b9..549b2ed4d 100644
--- a/internal/provision/testdata/plan14-root-reads-ha-generations.tsv
+++ b/internal/provision/testdata/plan14-root-reads-ha-generations.tsv
@@ -22,8 +22,8 @@
@legacy 30d341d03c3f18864e4a52866d44e1d90fde0f30d2089b102638b62b5c0909a0 internal/host/genfloor.go generationsFloorMarked legacy accepted-legacy accepted-legacy;rev3=census-ruling-ha-generations;basis=new (branch fix, storage generations activation floor): os.Lstat of <etc>/carlos/ha-generations-floor, presence only; the file is never opened or read, a symlink is not followed, and any error other than not-exist is returned so the guard arms on it. The path is root-owned /etc/carlos (host.env's directory); only root can create or remove the file, and its presence only adds a refusal (it can never lift a guard). file:Lstat@68 ee381a32f0628b1565baf1075f9ac7613606acde20f8763f913317a32e2e5446
@legacy 5f65a32a001237a4188e6f5b959b5cd3b7f47d3f6ab47eaac44a1efae7f0d4a2 internal/host/genfloor.go recordGenerationsFloor legacy accepted-legacy accepted-legacy;rev3=census-ruling-ha-generations;basis=new (branch fix, storage generations activation floor): when generationsFloorMarked finds nothing, creates <etc>/carlos/ha-generations-floor with os.OpenFile(O_WRONLY|O_CREATE|O_EXCL, 0600), so an existing file or symlink there is never opened or followed (EEXIST is success), writes the fixed body "replica-generations-1\n", syncs it and the directory. It never creates <etc>/carlos. Called only by root processes that have seen CARLOS_HA_GENERATIONS on (the activation guards and ensureSystemUnits). No read of the file. file:OpenFile@194 a98aa18c6655bf07f360e204eca27580732c7c6406b9f971130578d68e3247fc
@legacy 8081b965c3c847d3192f400995c3f3a76b369969ecb4d1c6b968cb010b156b73 internal/lease/legacytake.go readViewClock legacy accepted-legacy accepted-legacy;rev3=census-ruling-ha-generations;basis=new (Task 11c): the lock.json GET readView did, also returning the response's Date header (store clock) for retirement ages; same object, same 64 KiB cap file:ReadAll@425 97fce1b57c9ec6f56c416930651507782f3ba3f56289f34d45ac818eb3c0ca69
-@legacy d5e08237a9c82ec4b2a09b2e3bad6fcae946099c7badbc7e135644ad9f56b987 internal/activator/haadopt.go Service.AdoptHost legacy accepted-legacy accepted-legacy;rev3=census-ruling-region-ha-p1b3b-t;basis=Serialize through the existing host operation state. Read local route/revision/receipt plus configured lock/manifest/wake objects; use only restricted ordinary acquire, exact guarded restore, ordinary unclean release and verified readback for adoption. No process launch, local-copy reuse or secret access. B3: pass the optional shared durable termination proof adapter into the existing restricted finalizer acquire. The adapter validates the exact classified peer and current host lifetime, uses the acquire data-bucket client, and cannot bypass expiry or CAS. No new read in this unit. B4: A first scanner import may reuse its staging lock observation; the ordinary acquire still rereads and compares the exact ETag/generation and expiry. Existing receipt replay keeps its fresh read. No new read path or takeover authority.;rev3=census-ruling-region-ha-followups;basis=Attach a per-acquire termination proof observer to finalizer acquisitions so refusals retain alarms; avoid duplicate fallback observations. The observer receives the existing route and departure ref for paging; no new storage read or takeover authority.;rev3=census-ruling-region-ha-g2-fixes;basis=Require local pool eligibility at entry and in HA acquisition proofs; supplied route only; termination, lifetime and emptiness checks remain.;rev3=census-ruling-ha-unclean-marker-waits;basis=Defers adoption, before any import, while the observed lock is an unclean release marker that is not settled and younger than a lease term (hafresh.MarkerOpensAt). No new read: it inspects the lock view the unit already read. Only adds a refusal.;rev3=census-ruling-ha-generations;basis=storage generations Task 10 fix: marks the host adoption-held after a successful adoption acquire and clears it after a successful release (in-memory only), so the fast same-box row cannot take a lock this process holds; +registry:Host x2 are the host passed to that mark/clear; no storage read added registry:AcquiredGeneration@2664,registry:AcquiredGeneration@3037,registry:AcquiredGeneration@3815,registry:AcquiredGeneration@4427,registry:AcquiredGeneration@4518,registry:AcquiredGeneration@5157,registry:AcquiredGeneration@5248,registry:DepartureIID@1912,registry:DepartureIID@6033,registry:DepartureRef@1876,registry:DepartureRef@6017,registry:ExpectedPair@9088,registry:Host@1074,registry:Host@1277,registry:Host@1373,registry:Host@1445,registry:Host@1514,registry:Host@1780,registry:Host@2155,registry:Host@2881,registry:Host@3218,registry:Host@3605,registry:Host@5846,registry:Host@6267,registry:Host@6452,registry:Host@7797,registry:Host@8307,registry:Host@8438,registry:Host@8850,registry:Host@9152,registry:Host@9710,registry:Host@976,registry:Lifetime@6069,registry:Lifetime@9057,registry:LockETag@6104,registry:LockGeneration@1948,registry:LockGeneration@6116,registry:Phase@2996,registry:Phase@3013,registry:Phase@3355,registry:Phase@3393,registry:Phase@3449,registry:Phase@4459,registry:Phase@4551,registry:Phase@5101,registry:Phase@5189,registry:Receipt@6093,registry:Revision@3237,registry:Revision@6081,registry:Sequence@3141,registry:Sequence@3161,registry:WakeDigest@3100,registry:WakeDigest@3122,whole:HAAdoption@3254,whole:HAAdoption@6408,whole:HAWakeImport@3083,whole:HAWakeImport@5988,whole:HAWakeImport@6004,whole:HAWakeImport@6012,whole:HAWakeImport@6286,whole:HAWakeImport@8859,whole:HAWakeImport@9161,whole:HAWakeImport@9253,whole:Pair@3231,whole:Pair@6280,whole:Pair@9094,whole:Pair@9114,whole:Route@1004,whole:Route@1243,whole:Route@1286,whole:Route@1293,whole:Route@138,whole:Route@174,whole:Route@2813,whole:Route@308,whole:Route@3515,whole:Route@4828,whole:Route@568,whole:Route@5935,whole:Route@646,whole:Route@7269,whole:Route@7310,whole:Route@7355,whole:Route@7510,whole:Route@8065,whole:Route@838,whole:Route@8946 1581f9832419cb87d63fe628f57d10408039f4695f41f2e1e2e23a63848f0245
-@legacy 44d6bb39599c5f5a1c34f61978b2e77fa613d99c8943e8e42f307e37e5853162 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 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@4375,whole:Route@4471,whole:Route@589,whole:Route@627 c4e7023bb238df74b2a6a53fb2421d6f021dc6ed57683da36c9665692092fa6a
+@legacy f8c6b3d1305519d4e61a2f675dcf28127d3a1020b120ab05ee22a4ef6d8a33bc internal/activator/haadopt.go Service.AdoptHost legacy accepted-legacy accepted-legacy;rev3=census-ruling-region-ha-p1b3b-t;basis=Serialize through the existing host operation state. Read local route/revision/receipt plus configured lock/manifest/wake objects; use only restricted ordinary acquire, exact guarded restore, ordinary unclean release and verified readback for adoption. No process launch, local-copy reuse or secret access. B3: pass the optional shared durable termination proof adapter into the existing restricted finalizer acquire. The adapter validates the exact classified peer and current host lifetime, uses the acquire data-bucket client, and cannot bypass expiry or CAS. No new read in this unit. B4: A first scanner import may reuse its staging lock observation; the ordinary acquire still rereads and compares the exact ETag/generation and expiry. Existing receipt replay keeps its fresh read. No new read path or takeover authority.;rev3=census-ruling-region-ha-followups;basis=Attach a per-acquire termination proof observer to finalizer acquisitions so refusals retain alarms; avoid duplicate fallback observations. The observer receives the existing route and departure ref for paging; no new storage read or takeover authority.;rev3=census-ruling-region-ha-g2-fixes;basis=Require local pool eligibility at entry and in HA acquisition proofs; supplied route only; termination, lifetime and emptiness checks remain.;rev3=census-ruling-ha-unclean-marker-waits;basis=Defers adoption, before any import, while the observed lock is an unclean release marker that is not settled and younger than a lease term (hafresh.MarkerOpensAt). No new read: it inspects the lock view the unit already read. Only adds a refusal.;rev3=census-ruling-ha-generations;basis=storage generations Task 10 fix: marks the host adoption-held after a successful adoption acquire and clears it after a successful release (in-memory only), so the fast same-box row cannot take a lock this process holds; +registry:Host x2 are the host passed to that mark/clear; no storage read added Option A (round 2, 8a3d302 for Paul): the adoption acquire's proofs carry GenerationsEligible from generationsEligible(haGetenv), the process environment only (CARLOS_BOX_REFERENCE=group and CARLOS_HA_GENERATIONS on or fast), read once per adoption, no new read; on a fixed box or with the switch off hafresh.DecideAcquire refuses a generations lock before any write. registry:AcquiredGeneration@2664,registry:AcquiredGeneration@3037,registry:AcquiredGeneration@3815,registry:AcquiredGeneration@4427,registry:AcquiredGeneration@4518,registry:AcquiredGeneration@5157,registry:AcquiredGeneration@5248,registry:DepartureIID@1912,registry:DepartureIID@6033,registry:DepartureRef@1876,registry:DepartureRef@6017,registry:ExpectedPair@9264,registry:Host@1074,registry:Host@1277,registry:Host@1373,registry:Host@1445,registry:Host@1514,registry:Host@1780,registry:Host@2155,registry:Host@2881,registry:Host@3218,registry:Host@3605,registry:Host@5846,registry:Host@6267,registry:Host@6452,registry:Host@7973,registry:Host@8483,registry:Host@8614,registry:Host@9026,registry:Host@9328,registry:Host@976,registry:Host@9886,registry:Lifetime@6069,registry:Lifetime@9233,registry:LockETag@6104,registry:LockGeneration@1948,registry:LockGeneration@6116,registry:Phase@2996,registry:Phase@3013,registry:Phase@3355,registry:Phase@3393,registry:Phase@3449,registry:Phase@4459,registry:Phase@4551,registry:Phase@5101,registry:Phase@5189,registry:Receipt@6093,registry:Revision@3237,registry:Revision@6081,registry:Sequence@3141,registry:Sequence@3161,registry:WakeDigest@3100,registry:WakeDigest@3122,whole:HAAdoption@3254,whole:HAAdoption@6408,whole:HAWakeImport@3083,whole:HAWakeImport@5988,whole:HAWakeImport@6004,whole:HAWakeImport@6012,whole:HAWakeImport@6286,whole:HAWakeImport@9035,whole:HAWakeImport@9337,whole:HAWakeImport@9429,whole:Pair@3231,whole:Pair@6280,whole:Pair@9270,whole:Pair@9290,whole:Route@1004,whole:Route@1243,whole:Route@1286,whole:Route@1293,whole:Route@138,whole:Route@174,whole:Route@2813,whole:Route@308,whole:Route@3515,whole:Route@4828,whole:Route@568,whole:Route@5935,whole:Route@646,whole:Route@7414,whole:Route@7455,whole:Route@7500,whole:Route@7686,whole:Route@8241,whole:Route@838,whole:Route@9122 4689ffbe76a47370daeb3f1cb82b6653b43a2387c2ddd875570cd152a233f914
+@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 b5dd4f7a3cb91dbcd5c3fb77eee8e007fdca9965f93cd0f193e75b2d18b9aa42 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 registry:Host@135,whole:Route@1121,whole:Route@1570,whole:Route@178,whole:Route@236,whole:Route@301,whole:Route@695,whole:Route@779 109db7ccabdc810c9de1f99ef7bab610e31f2697571555b0fac0ba91a51897c5
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
@@ -51,25 +51,25 @@ internal/dbdoor/generation.go Client.refusal legacy accepted-legacy accepted-leg
internal/host/genfloor.go generationsFloorMarked legacy accepted-legacy accepted-legacy;rev3=census-ruling-ha-generations;basis=new (branch fix, storage generations activation floor): os.Lstat of <etc>/carlos/ha-generations-floor, presence only; the file is never opened or read, a symlink is not followed, and any error other than not-exist is returned so the guard arms on it. The path is root-owned /etc/carlos (host.env's directory); only root can create or remove the file, and its presence only adds a refusal (it can never lift a guard). file:Lstat@68 ee381a32f0628b1565baf1075f9ac7613606acde20f8763f913317a32e2e5446
internal/host/genfloor.go recordGenerationsFloor legacy accepted-legacy accepted-legacy;rev3=census-ruling-ha-generations;basis=new (branch fix, storage generations activation floor): when generationsFloorMarked finds nothing, creates <etc>/carlos/ha-generations-floor with os.OpenFile(O_WRONLY|O_CREATE|O_EXCL, 0600), so an existing file or symlink there is never opened or followed (EEXIST is success), writes the fixed body "replica-generations-1\n", syncs it and the directory. It never creates <etc>/carlos. Called only by root processes that have seen CARLOS_HA_GENERATIONS on (the activation guards and ensureSystemUnits). No read of the file. file:OpenFile@194 a98aa18c6655bf07f360e204eca27580732c7c6406b9f971130578d68e3247fc
internal/lease/legacytake.go readViewClock legacy accepted-legacy accepted-legacy;rev3=census-ruling-ha-generations;basis=new (Task 11c): the lock.json GET readView did, also returning the response's Date header (store clock) for retirement ages; same object, same 64 KiB cap file:ReadAll@425 97fce1b57c9ec6f56c416930651507782f3ba3f56289f34d45ac818eb3c0ca69
-internal/activator/haadopt.go Service.AdoptHost legacy accepted-legacy accepted-legacy;rev3=census-ruling-region-ha-p1b3b-t;basis=Serialize through the existing host operation state. Read local route/revision/receipt plus configured lock/manifest/wake objects; use only restricted ordinary acquire, exact guarded restore, ordinary unclean release and verified readback for adoption. No process launch, local-copy reuse or secret access. B3: pass the optional shared durable termination proof adapter into the existing restricted finalizer acquire. The adapter validates the exact classified peer and current host lifetime, uses the acquire data-bucket client, and cannot bypass expiry or CAS. No new read in this unit. B4: A first scanner import may reuse its staging lock observation; the ordinary acquire still rereads and compares the exact ETag/generation and expiry. Existing receipt replay keeps its fresh read. No new read path or takeover authority.;rev3=census-ruling-region-ha-followups;basis=Attach a per-acquire termination proof observer to finalizer acquisitions so refusals retain alarms; avoid duplicate fallback observations. The observer receives the existing route and departure ref for paging; no new storage read or takeover authority.;rev3=census-ruling-region-ha-g2-fixes;basis=Require local pool eligibility at entry and in HA acquisition proofs; supplied route only; termination, lifetime and emptiness checks remain.;rev3=census-ruling-ha-unclean-marker-waits;basis=Defers adoption, before any import, while the observed lock is an unclean release marker that is not settled and younger than a lease term (hafresh.MarkerOpensAt). No new read: it inspects the lock view the unit already read. Only adds a refusal.;rev3=census-ruling-ha-generations;basis=storage generations Task 10 fix: marks the host adoption-held after a successful adoption acquire and clears it after a successful release (in-memory only), so the fast same-box row cannot take a lock this process holds; +registry:Host x2 are the host passed to that mark/clear; no storage read added registry:AcquiredGeneration@2664,registry:AcquiredGeneration@3037,registry:AcquiredGeneration@3815,registry:AcquiredGeneration@4427,registry:AcquiredGeneration@4518,registry:AcquiredGeneration@5157,registry:AcquiredGeneration@5248,registry:DepartureIID@1912,registry:DepartureIID@6033,registry:DepartureRef@1876,registry:DepartureRef@6017,registry:ExpectedPair@9088,registry:Host@1074,registry:Host@1277,registry:Host@1373,registry:Host@1445,registry:Host@1514,registry:Host@1780,registry:Host@2155,registry:Host@2881,registry:Host@3218,registry:Host@3605,registry:Host@5846,registry:Host@6267,registry:Host@6452,registry:Host@7797,registry:Host@8307,registry:Host@8438,registry:Host@8850,registry:Host@9152,registry:Host@9710,registry:Host@976,registry:Lifetime@6069,registry:Lifetime@9057,registry:LockETag@6104,registry:LockGeneration@1948,registry:LockGeneration@6116,registry:Phase@2996,registry:Phase@3013,registry:Phase@3355,registry:Phase@3393,registry:Phase@3449,registry:Phase@4459,registry:Phase@4551,registry:Phase@5101,registry:Phase@5189,registry:Receipt@6093,registry:Revision@3237,registry:Revision@6081,registry:Sequence@3141,registry:Sequence@3161,registry:WakeDigest@3100,registry:WakeDigest@3122,whole:HAAdoption@3254,whole:HAAdoption@6408,whole:HAWakeImport@3083,whole:HAWakeImport@5988,whole:HAWakeImport@6004,whole:HAWakeImport@6012,whole:HAWakeImport@6286,whole:HAWakeImport@8859,whole:HAWakeImport@9161,whole:HAWakeImport@9253,whole:Pair@3231,whole:Pair@6280,whole:Pair@9094,whole:Pair@9114,whole:Route@1004,whole:Route@1243,whole:Route@1286,whole:Route@1293,whole:Route@138,whole:Route@174,whole:Route@2813,whole:Route@308,whole:Route@3515,whole:Route@4828,whole:Route@568,whole:Route@5935,whole:Route@646,whole:Route@7269,whole:Route@7310,whole:Route@7355,whole:Route@7510,whole:Route@8065,whole:Route@838,whole:Route@8946 1581f9832419cb87d63fe628f57d10408039f4695f41f2e1e2e23a63848f0245
-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 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@4375,whole:Route@4471,whole:Route@589,whole:Route@627 c4e7023bb238df74b2a6a53fb2421d6f021dc6ed57683da36c9665692092fa6a
+internal/activator/haadopt.go Service.AdoptHost legacy accepted-legacy accepted-legacy;rev3=census-ruling-region-ha-p1b3b-t;basis=Serialize through the existing host operation state. Read local route/revision/receipt plus configured lock/manifest/wake objects; use only restricted ordinary acquire, exact guarded restore, ordinary unclean release and verified readback for adoption. No process launch, local-copy reuse or secret access. B3: pass the optional shared durable termination proof adapter into the existing restricted finalizer acquire. The adapter validates the exact classified peer and current host lifetime, uses the acquire data-bucket client, and cannot bypass expiry or CAS. No new read in this unit. B4: A first scanner import may reuse its staging lock observation; the ordinary acquire still rereads and compares the exact ETag/generation and expiry. Existing receipt replay keeps its fresh read. No new read path or takeover authority.;rev3=census-ruling-region-ha-followups;basis=Attach a per-acquire termination proof observer to finalizer acquisitions so refusals retain alarms; avoid duplicate fallback observations. The observer receives the existing route and departure ref for paging; no new storage read or takeover authority.;rev3=census-ruling-region-ha-g2-fixes;basis=Require local pool eligibility at entry and in HA acquisition proofs; supplied route only; termination, lifetime and emptiness checks remain.;rev3=census-ruling-ha-unclean-marker-waits;basis=Defers adoption, before any import, while the observed lock is an unclean release marker that is not settled and younger than a lease term (hafresh.MarkerOpensAt). No new read: it inspects the lock view the unit already read. Only adds a refusal.;rev3=census-ruling-ha-generations;basis=storage generations Task 10 fix: marks the host adoption-held after a successful adoption acquire and clears it after a successful release (in-memory only), so the fast same-box row cannot take a lock this process holds; +registry:Host x2 are the host passed to that mark/clear; no storage read added Option A (round 2, 8a3d302 for Paul): the adoption acquire's proofs carry GenerationsEligible from generationsEligible(haGetenv), the process environment only (CARLOS_BOX_REFERENCE=group and CARLOS_HA_GENERATIONS on or fast), read once per adoption, no new read; on a fixed box or with the switch off hafresh.DecideAcquire refuses a generations lock before any write. registry:AcquiredGeneration@2664,registry:AcquiredGeneration@3037,registry:AcquiredGeneration@3815,registry:AcquiredGeneration@4427,registry:AcquiredGeneration@4518,registry:AcquiredGeneration@5157,registry:AcquiredGeneration@5248,registry:DepartureIID@1912,registry:DepartureIID@6033,registry:DepartureRef@1876,registry:DepartureRef@6017,registry:ExpectedPair@9264,registry:Host@1074,registry:Host@1277,registry:Host@1373,registry:Host@1445,registry:Host@1514,registry:Host@1780,registry:Host@2155,registry:Host@2881,registry:Host@3218,registry:Host@3605,registry:Host@5846,registry:Host@6267,registry:Host@6452,registry:Host@7973,registry:Host@8483,registry:Host@8614,registry:Host@9026,registry:Host@9328,registry:Host@976,registry:Host@9886,registry:Lifetime@6069,registry:Lifetime@9233,registry:LockETag@6104,registry:LockGeneration@1948,registry:LockGeneration@6116,registry:Phase@2996,registry:Phase@3013,registry:Phase@3355,registry:Phase@3393,registry:Phase@3449,registry:Phase@4459,registry:Phase@4551,registry:Phase@5101,registry:Phase@5189,registry:Receipt@6093,registry:Revision@3237,registry:Revision@6081,registry:Sequence@3141,registry:Sequence@3161,registry:WakeDigest@3100,registry:WakeDigest@3122,whole:HAAdoption@3254,whole:HAAdoption@6408,whole:HAWakeImport@3083,whole:HAWakeImport@5988,whole:HAWakeImport@6004,whole:HAWakeImport@6012,whole:HAWakeImport@6286,whole:HAWakeImport@9035,whole:HAWakeImport@9337,whole:HAWakeImport@9429,whole:Pair@3231,whole:Pair@6280,whole:Pair@9270,whole:Pair@9290,whole:Route@1004,whole:Route@1243,whole:Route@1286,whole:Route@1293,whole:Route@138,whole:Route@174,whole:Route@2813,whole:Route@308,whole:Route@3515,whole:Route@4828,whole:Route@568,whole:Route@5935,whole:Route@646,whole:Route@7414,whole:Route@7455,whole:Route@7500,whole:Route@7686,whole:Route@8241,whole:Route@838,whole:Route@9122 4689ffbe76a47370daeb3f1cb82b6653b43a2387c2ddd875570cd152a233f914
+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
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
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 registry:Host@135,whole:Route@1121,whole:Route@1570,whole:Route@178,whole:Route@236,whole:Route@301,whole:Route@695,whole:Route@779 109db7ccabdc810c9de1f99ef7bab610e31f2697571555b0fac0ba91a51897c5
@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 4e19e71c6dc89d7af2c0d56d4d7ff5c9b205516e4bc7243c3f363992e4665ea0
+@coverage internal/activator a918874ec896763c21b717efa02e9f4cc0c1a727b1f7a42cb2b871fe12ff3a0a
@coverage internal/dbdoor 815998a9d98513117aacf850b4b585db0c06fd61357baa0143c55ce856a78a9d
@coverage internal/dbreads 6b803f18ee087eb59532a7bdeeac748f23c666f8a15bf03ca11072b9e59d9bf3
@coverage internal/genselect 2cb4d36f5c6ac1d0f88d506175c6b633827775c29277a1de4a6399f5b3e42d9e
@coverage internal/grouproll d027d26c86d2f881176b557f2f5ea0c0c03421d4473cb85797aecdc412fd9ad6
-@coverage internal/hafresh cbf3c6742bbab284dd2f0bac42d295d39e610c4c59e637ea1eacdb51c2afd670
+@coverage internal/hafresh ef2927697ab3f18c6bc2fa5b6a09f35eed8c8f64855f74371029f1d2440b6cf7
@coverage internal/host c9fdfbf6e2de5cc63702af2feec8b49ba823182137ae0054c732c4ff9706f7fc
@coverage internal/host/units fee4c243945e57e90bc8d3f5600b816a453a4985e40f95574fdf94e42d421f82
@coverage internal/hostbox a656c61012ba600271b99d0ed4f9a74feaaa30eb82f62a4054fa2f077610b0ac
@coverage internal/hostenv 12188a08ec565a5e1b0ec81277dbc806370ed248c33ca9669707510e7014df05
@coverage internal/hostfiles 62330256c3fa798542b0b85ad56639751e3a04ba7bae4f80ac280b8b0d169434
-@coverage internal/lease c19fe01f256560bbc5edbf74cc9fd669cf0eca02a221354ade0cd0f398f1911e
+@coverage internal/lease 6a0ad714b3ca716486f75907dceef994d6012d57662b3e682d894a1488666824
@coverage internal/moves e35b5fef3e5f4de37a496ccf8dee214898c53106c26e35bf0cb440625de80b3a
@coverage internal/ops a8db14fbd952f9af2d3029b9da0bb5662fe9405296dfd51c56a9c688e8e38ce7
@coverage internal/release 62ebbbf9283c889e690adb69bc43292a013cdf9c9b2f5431268d291f7fd9f6f3