carlos / platform Public

Restore live EC2 takeover for unbound HA peers

Keep verified identities on durable termination proofs. Report adapter refusals through the rate-limited takeover alarm and preserve the finalizer cause. Unbound peers skip departure enrollment while retaining expiry and lifetime checks.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Paul Campbell pushed by claude agent, operated by paul@keymail.dev 1947902e3b0167c5c42b677679c44884c36055a6 parent 160a85e
11 files changed, +187 −43
  • docs/superpowers/notes/census-proposal-region-ha-p1b3b-t.md +5 −5
  • docs/superpowers/notes/census-region-ha-p1b3b-t-claims.md +3 −2
  • internal/activator/hatakeover.go +23 −12
  • internal/activator/hawake.go +8 −1
  • internal/activator/termination_proof_test.go +55 −2
  • internal/host/hadepartures.go +4 −3
  • internal/host/hadepartures_wiring_test.go +51 −0
  • internal/lease/termination_proof.go +15 −1
  • internal/lease/termination_proof_test.go +11 −7
  • internal/provision/testdata/plan14-root-reads-chain.tsv +1 −1
  • internal/provision/testdata/plan14-root-reads-region-ha-p1b3b-t.tsv +11 −9

Intent

Human

<task-notification> <task-id>bfitykwtc</task-id> <tool-use-id>toolu_01G2gcuuLUGYEcS1WxHsqTpq</tool-use-id> <output-file>/home/paulca/.cache/tmp/claude-1001/-home-paulca-amadan-net-carlos-platform/22c9817b-87ae-432b-b6d2-3ebbc209af38/tasks/bfitykwtc.output</output-file> <status>completed</status> <summary>Background command "Wait for Astra merge" completed (exit code 0)</summary> </task-notification>

Human

<task-notification> <task-id>bskw5y0v4</task-id> <tool-use-id>toolu_01Wetjh4q6GvE2m4CuVPx8VR</tool-use-id> <output-file>/home/paulca/.cache/tmp/claude-1001/-home-paulca-amadan-net-carlos-platform/22c9817b-87ae-432b-b6d2-3ebbc209af38/tasks/bskw5y0v4.output</output-file> <status>completed</status> <summary>Background command "Wait for CI on merge tip" completed (exit code 0)</summary> </task-notification>

diff --git a/docs/superpowers/notes/census-proposal-region-ha-p1b3b-t.md b/docs/superpowers/notes/census-proposal-region-ha-p1b3b-t.md
index f36349bfa..914b00bd0 100644
--- a/docs/superpowers/notes/census-proposal-region-ha-p1b3b-t.md
+++ b/docs/superpowers/notes/census-proposal-region-ha-p1b3b-t.md
@@ -1,6 +1,6 @@
# Census approval: region-ha-p1b3b-t
-Ruling `census-ruling-region-ha-p1b3b-t`. The independent reviewer approves or rejects every change below, 91 with a new disposition; nothing goes to the census owner (Paul, #280, 2026-10-26).
+Ruling `census-ruling-region-ha-p1b3b-t`. The independent reviewer approves or rejects every change below, 93 with a new disposition; nothing goes to the census owner (Paul, #280, 2026-10-26).
| unit | change | read sites | what changed |
|---|---|---|---|
@@ -17,8 +17,7 @@ Ruling `census-ruling-region-ha-p1b3b-t`. The independent reviewer approves or r
| `internal/activator/activator.go` `Service.ServeScheduled` | sites | +whole:Route ×2 | Run the local scheduled request under WithDuty and retain existing HTTP refusal text; add route arguments to background admission and error handling. No forwarding. |
| `internal/activator/activator.go` `Service.wake` | sites | +whole:Route | Install the successful-acquire observer and restrict due, worker and resident starts before doWake, off a.mu. Add a whole-route argument to restriction; refused work has known-no-start evidence. |
| `internal/activator/harelease.go` `Service.releaseHAClean` | sites | +whole:Route | Record advisory local-release basis only after ReleaseMarker succeeds. Add a whole-route argument to local duty bookkeeping; release order and lease authority unchanged. |
-| `internal/activator/hatakeover.go` `ExecBackend.ownerTerminated` | sites | +registry:Host | Read route Host for structured departure-finalize telemetry; retain the same confirmation callback and visitor alarm behavior. |
-| `internal/activator/hawake.go` `ExecBackend.acquireClassified` | sites | +whole:Route | 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. |
+| `internal/activator/hawake.go` `ExecBackend.acquireClassified` | sites | +whole:Route ×2 | 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. |
| `internal/host/schedule_wiring.go` `activatorDeliverer.deliverSelected` | sites | +whole:Route ×2 | Wrap local delivery in WithDuty so lease loss returns a deferred control result before timer bookkeeping. Add whole-route arguments; no remote forwarding. |
| `internal/schedule/runner.go` `Runner.fire` | sites | -registry:Host ×4, -registry:Name ×2, -whole:Route ×5, -whole:Timer ×2 | Call WithDuty before token preparation; record non-deferred pre-delivery wake errors through the existing retry and event policy after timerStillDue. Adds spec and whole timer/route reads for record. Advance only known non-owner recurring occurrences through the existing registration/DueAt guard; no second outcome after callback execution. |
@@ -41,7 +40,6 @@ Recorded dispositions, which each change must still satisfy:
- `internal/activator/activator.go` `Service.ServeScheduled`: legacy, task accepted-legacy. Basis: accepted-legacy;rev3=J1;basis=root-route;rev3=census-ruling-plans-4d-lapse;basis=answers a scheduled request to a route the turned-off hook names with the maintenance response before serve (plans 4d). One more whole-row read: the row handed to the hook (a.disabled), as the fence and maxRunFor are asked.;rev3=census-ruling-region-ha-p1a;basis=the agent as carlos: wraps the proxy so that, after the wake, fillScheduledToken(r, rt) sets an HA host's tick bearer token from its restored env file; an error there logs (+registry:Host, rt.Host) and answers 503 with Retry-After: 5; a non-HA host's tick is left as the runner built it; +whole:Route is rt handed to fillScheduledToken; keeps legacy;rev3=census-ruling-rootfs-apps-3;basis=rootfs Plan 3 Task 5: the activator-managed test is Route.ActivatorOwned (a hibernating instance, or an instance with a runtime) instead of Kind and Hibernate inline; reads the same fields plus Runtime through the method
- `internal/activator/activator.go` `Service.wake`: legacy, task accepted-legacy. Basis: accepted-legacy;rev3=census-ruling-carlos-run;basis=Re-digested at the pre-land merge: the body includes main's own change under census ruling 292, with no further change from this branch. the agent (/opt/carlos/carlos agent, carlos-edge.service, user carlos): main's body; the stop now carries its reason for a run it interrupts (beginStopLocked's why argument); read sites unchanged, offsets moved;rev3=census-ruling-wake-latency-1;identity=the agent (/opt/carlos/carlos agent, carlos-edge.service, user carlos);basis=logs that timer's breakdown to the journal after a successful wake (w.steps.String(), e.host, w.wakeTook); no read added;rev3=census-ruling-plans-4d-lapse;basis=cancels a wake whose row the turned-off hook names, like a fence, unless it is a move's active probe (plans 4d). One more whole-row read: the row handed to the hook (a.disabled). Only refuses.;rev3=census-ruling-rootfs-apps-3;basis=rootfs Plan 3 Tasks 7 and 8: a refusal before the lease is reported once per change (noteRootfsRefusal) instead of a wake-failure event; the proc, generation and replica are installed through installProcLocked (which puts a resident under its lease watch before the fence); residency notes the outcome (noteResidentWakeLocked); same generation values;rev3=census-ruling-rootfs-apps-3-release;basis=rootfs Plan 3 Group R [pf R3.5]: the wake's context ceiling is wakeCeilingFor(e.route): the old 5 minutes for a binary row, 5 minutes plus runs.MaxTimeout for a rootfs row (room for a release inside the wake); new site +whole:Route (e.route to wakeCeilingFor, which reads Runtime only); no other change;rev3=census-ruling-managed-fleets-1b;basis=managed fleets 1b (branch review R1 P1-1): the wake's context is also cancelled before doWake when RetireExcept has marked the entry retired (e.retired, in memory under a.mu), as it is for a fence or a shutdown. Read sites unchanged (13). Agent, not root; it only refuses more.;rev3=census-ruling-stateless-replicas-1;basis=Task 3a: Carry successful hold preparation into its wake, preserve actual mode in the generation and OnWake projection, and project serving version/mode through the narrow registry writer before releasing wake waiters. Final review I1: SetServingMode only for non-worker successful wakes with a nonempty spawned version and either a stateless generation or a mode transition from the route. Ordinary stateful wakes leave rollout status and the wake critical path unchanged.;rev3=census-ruling-edge-held-streams;basis=the agent (/opt/carlos/carlos agent, carlos-edge.service, user carlos): adds a.cancelHeldLegsLocked(e, 0) on the failed-wake path before the entry is deleted, and after close(e.ready) on success calls a.noteHeldAdmissible(e.host), the non-blocking held wake callback, outside a.mu. No read added.;rev3=census-ruling-wake-storm-cap;basis=the agent (/opt/carlos/carlos agent, carlos-edge.service, user carlos): waits for a box-wide wake slot (acquireWakeSlot, an in-memory buffered channel) before doWake; the fence/shutdown/retired/disabled refusals move into refuseWakeLocked and are asked again after admission (one fewer direct whole-Route read here: a.disabled(e.route) now runs inside refuseWakeLocked, same value); e.wakeStart is set at admission and e.admitted marks it. Only waits and refuses more; no new read.
- `internal/activator/harelease.go` `Service.releaseHAClean`: legacy, task accepted-legacy. Basis: accepted-legacy;rev3=census-ruling-region-ha-p1a;basis=new: an HA entry's release, in order: host slice read empty through haHostEmpty (else errHostSliceUnproven and nothing written; the same check, moved into that helper by final fix F1), stop and join the files publisher, its final publish (2 min budget), the replica's final sync (Finish, 30 s), the local release record, then the release marker PUT (10 s), clean only when the final publish was complete and the sync and record succeeded; a failed PUT is a persisted lease obligation; +registry:Host, +whole:Route x4
-- `internal/activator/hatakeover.go` `ExecBackend.ownerTerminated`: legacy, task accepted-legacy. Basis: accepted-legacy;rev3=census-ruling-region-ha-p1b1;basis=new (region HA P1b-1): returns nil without eb.OwnerTerminated; else a closure calling it with the lock owner's instance id (from the HA lock, written by a box agent) and logging rt.Host on a takeover and, at most once a minute per host, on an error; the id goes only to EC2 DescribeInstances in this box's own account and region and is checked against the reply (termfence.SameAccountTerminated); root never calls it
- `internal/activator/hawake.go` `ExecBackend.acquireClassified`: legacy, task accepted-legacy. Basis: 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.
- `internal/host/schedule_wiring.go` `activatorDeliverer.deliverSelected`: legacy, task accepted-legacy. Basis: accepted-legacy;rev3=J1;basis=root-route
- `internal/schedule/runner.go` `Runner.fire`: hint, task E2. Basis: accepted-legacy;rev3=census-ruling-moves-offline-fixes;basis=root-route (main: J1) PROPOSED E46: captured claim selection and root journal mutation; root RPC outside service host exclusion; SQL/route data never grants root authority. Executing identity: service controller; root for inventory/retirement callbacks. moves-offline-fixes: with Skip set (only the agent's runner sets it, scheduleSkip), the row is read again before the token and a skipped host gets no token and no record; class and task unchanged
@@ -68,6 +66,7 @@ New dispositions, which census-propose wrote and the reviewer checks against the
- new `internal/activator/haduties.go:Service.saveDuty`: reads +registry:Revision ×5, +whole:DutyState ×6; written legacy, accepted-legacy, frozen
- new `internal/activator/haduties.go:dutyBackend`: reads +whole:Route ×2; written legacy, accepted-legacy, frozen
- new `internal/activator/haduties.go:dutyRefusal`: reads +registry:HolderIID, +registry:HolderRef ×3, +registry:NotBefore; written legacy, accepted-legacy, frozen
+- new `internal/activator/hatakeover.go:ExecBackend.reportTakeover`: reads +registry:Host ×3; written legacy, accepted-legacy, frozen
- new `internal/activator/hawake.go:ExecBackend.TerminationLifetime`: reads +whole:Route ×2; written legacy, accepted-legacy, frozen
- new `internal/edge/wakeplacement.go:Edge.DutySnapshot`: reads +whole:Route; written legacy, accepted-legacy, frozen
- new `internal/host/hadeparture_identity.go:departureIdentities.Observe`: reads +registry:Account, +registry:Digest ×2, +registry:IID ×4, +registry:Observation, +registry:Raw, +registry:Ref ×2, +whole:HABoxIdentity ×4; written legacy, accepted-legacy, frozen
@@ -136,10 +135,11 @@ New dispositions, which census-propose wrote and the reviewer checks against the
- new `internal/schedule/runner.go:Runner.fireOwned`: reads +registry:Host ×4, +registry:Name ×2, +registry:Spec ×2, +whole:Route ×9, +whole:Timer ×8; written legacy, accepted-legacy, frozen
- new `internal/termfence/termination_proof.go:readTerminationProof`: reads +file:ReadAll; written legacy, accepted-legacy, frozen
- other `changed registry schema`: closed only if it is the registry schema (re-pinned)
+- reads `internal/activator/hatakeover.go:ExecBackend.ownerTerminated`: -registry:Host ×2, +whole:Route; keeps legacy, task accepted-legacy
- reads `internal/host/runs.go:runsWorker.pickup`: +registry:HA, +whole:Route; keeps legacy, task accepted-legacy
- reads `internal/hostfiles/wake.go:ImportWake`: +whole:HAWakeImport, -whole:Route, -whole:Timer ×3; keeps legacy, task accepted-legacy
- reads `internal/registry/remote_dispatch.go:Registry.dispatchRemote`: +registry:Adoption ×2, +registry:Changed ×5, +registry:Duty ×3, +registry:Expected, +registry:HAJournal ×2, +registry:Host ×9, +registry:Import, +registry:Lifetime ×5, +registry:Pair ×3, +registry:Receipt, +registry:Revision ×3, +registry:Wake ×2, +whole:DutyState ×3, +whole:HAAdoption ×2, +whole:HAWakeImport ×2, +whole:Pair ×3, +whole:haJournalRequest, +whole:haJournalResponse; keeps hint, task E2
-Seal: `744b16d970f22476b79982e57c326157ca5137fa96ccaee4a7ae10c25248d124` → `8361b4e7b8b4975c6eab77717af17c479326da351e8e5aa506e94f9a7162ebe9`.
+Seal: `744b16d970f22476b79982e57c326157ca5137fa96ccaee4a7ae10c25248d124` → `9f8eedbae2944b4ba6590b3c11d71b54645620c4dd9e28807f757dbd4bdec8bb`.
Overlay: `internal/provision/testdata/plan14-root-reads-region-ha-p1b3b-t.tsv`, appended to `internal/provision/testdata/plan14-root-reads-chain.tsv`.
diff --git a/docs/superpowers/notes/census-region-ha-p1b3b-t-claims.md b/docs/superpowers/notes/census-region-ha-p1b3b-t-claims.md
index 7b7decadf..06285cc17 100644
--- a/docs/superpowers/notes/census-region-ha-p1b3b-t-claims.md
+++ b/docs/superpowers/notes/census-region-ha-p1b3b-t-claims.md
@@ -4,7 +4,7 @@ internal/activator/activator.go:type Service Add the B2 DutyStore interface fiel
internal/activator/activator.go:Service.ServeScheduled Run the local scheduled request under WithDuty and retain existing HTTP refusal text; add route arguments to background admission and error handling. No forwarding.
internal/activator/activator.go:Service.wake Install the successful-acquire observer and restrict due, worker and resident starts before doWake, off a.mu. Add a whole-route argument to restriction; refused work has known-no-start evidence.
internal/activator/harelease.go:Service.releaseHAClean Record advisory local-release basis only after ReleaseMarker succeeds. Add a whole-route argument to local duty bookkeeping; release order and lease authority unchanged.
-internal/activator/hawake.go:ExecBackend.acquireClassified 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.
+internal/activator/hawake.go:ExecBackend.acquireClassified 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.
internal/edge/wakeplacement.go:homeMap.wakeSnapshot Expose fresh compatible peer membership separately from per-host eligible serving entries for suppression invalidation. Existing home/pool/scope filtering remains; no new reads.
internal/host/agent.go:runAgent Wire Service.SetDutyView to the live edge DutySnapshot in the ready callback. No new read; no new loop or cloud operation. B2 wires the registry as the persistent DutyStore before service startup; no new cloud or filesystem path. B3b: arm one journal-backed termination consumer before service startup using agentCtx and the shared confirmer; expose edge tick and join at edge shutdown. No new direct read sites.
internal/host/schedule_wiring.go:newScheduleDeps Wire Runner.WithDuty before token access through the existing Service. No new read.
@@ -27,7 +27,7 @@ internal/registry/timers.go:Registry.AdvanceDutyTimer Update only local recurrin
internal/schedule/runner.go:OldDutyTick Read timer kind and natural due occurrence; only recurring occurrences at least 15 minutes old qualify. No writes.
internal/schedule/runner.go:Runner.fireOwned Existing fire body moved beneath admission; deferred delivery now returns without recording a failure. Same token preparation, parsing, guarded row checks and delivery authority.
internal/registry/registry.go:Registry.migrate Create local HA duty/replay tables and revision triggers in the existing registry connection; no new database path.
-internal/activator/hatakeover.go:ExecBackend.ownerTerminated Read route Host for structured departure-finalize telemetry; retain the same confirmation callback and visitor alarm behavior.
+internal/activator/hatakeover.go:ExecBackend.ownerTerminated Read route Host for structured departure-finalize telemetry; retain the same confirmation callback and visitor alarm behavior. Final fix P2-1: report the live confirmer result through the shared telemetry helper. No added reads.
internal/activator/haadopt.go:ExecBackend.adoptionCurrent Read the current registry route and authoritative lifetime index/record; compare Pair, account, app, DB path, kind and admission fields before effects. Refusal only.
internal/activator/haadopt.go:ExecBackend.adoptionWake Read only the configured files manifest and its validated wake object. Validate wire state and reuse only bytes already checked against an equal digest; never fetch DB, file-tree or secret objects.
internal/activator/haadopt.go:ExecBackend.bindDutyLifetime Read existing local duty revision and bind only current record facts to the registry Pair; changed binding invalidates old authority and receipt access. B2 fix r1: delegate to the shared DutyStore binding helper; the same current-record precondition and guarded Pair/revision binding remain.
@@ -105,3 +105,4 @@ internal/host/hadepartures_metrics.go:Controller.Metrics B5: Read local aggregat
internal/host/hadepartures_scan.go:Controller.adoptMeasured B5: Invoke the existing importer once and measure result/latency with bound inventory and departure fields. No new read or authority.
internal/registry/ha_departures.go:ValidHAAdoptionTransition B5: Pure extracted phase and generation guard, identical to the prior inline expression. Reads only the supplied adoption fields.
internal/registry/ha_journal.go:Registry.DepartureSummary B5: Invoke the read-only summary operation on the existing journal RPC; return count and oldest pending timestamp without host labels.
+internal/activator/hatakeover.go:ExecBackend.reportTakeover Final fix P2-1: report all refused proof results through the per-host alarm and distinguish visitor from departure-finalize. No reads or authority.
diff --git a/internal/activator/hatakeover.go b/internal/activator/hatakeover.go
index 4d81e201c..82d2653eb 100644
--- a/internal/activator/hatakeover.go
+++ b/internal/activator/hatakeover.go
@@ -7,6 +7,7 @@ import (
"time"
"github.com/carlosframework/platform/internal/registry"
+ "github.com/carlosframework/platform/internal/termfence"
)
// Region HA P1b-1, the takeover of a terminated holder's host.
@@ -30,19 +31,28 @@ func (b *ExecBackend) ownerTerminated(ctx context.Context, rt registry.Route) fu
}
return func(iid string) (bool, error) {
gone, err := b.OwnerTerminated(ctx, iid)
- if ctx.Value(adoptionCauseKey{}) == true {
- log.Printf("ha_takeover host=%s iid=%s cause=departure-finalize confirmed=%t error=%t", rt.Host, iid, gone, err != nil)
- return gone, err
- }
- if err != nil {
- b.takeover.alarm(rt.Host, iid, err)
- return false, err
- }
- if gone {
- log.Printf("activator: %s: the holder %s is terminated (EC2) and its lease expired; taking the host over", rt.Host, iid)
+ b.reportTakeover(ctx, rt, iid, gone, err)
+ return gone, err
+ }
+}
+
+func (b *ExecBackend) reportTakeover(ctx context.Context, rt registry.Route, iid string, gone bool, err error) {
+ cause := "visitor"
+ if ctx.Value(adoptionCauseKey{}) == true {
+ cause = "departure-finalize"
+ }
+ if !gone || err != nil {
+ if err == nil {
+ err = termfence.ErrTerminationProof
}
- return gone, nil
+ b.takeover.alarm(rt.Host, iid, cause, err)
+ return
+ }
+ if cause == "departure-finalize" {
+ log.Printf("ha_takeover host=%s iid=%s cause=departure-finalize confirmed=%t error=%t", rt.Host, iid, gone, err != nil)
+ return
}
+ log.Printf("activator: %s: the holder %s is terminated (EC2) and its lease expired; taking the host over", rt.Host, iid)
}
// takeoverAlarmEvery is how often one host's failed takeover proof is
@@ -57,7 +67,7 @@ type takeoverState struct {
// alarm logs a takeover refused because EC2 could not be asked, at most
// once a minute per host (the twin of sameBoxState.alarm).
-func (s *takeoverState) alarm(host, iid string, why error) {
+func (s *takeoverState) alarm(host, iid, cause string, why error) {
s.mu.Lock()
now := time.Now()
last, seen := s.alarmed[host]
@@ -70,5 +80,6 @@ func (s *takeoverState) alarm(host, iid string, why error) {
}
s.alarmed[host] = now
s.mu.Unlock()
+ log.Printf("ha_takeover host=%s iid=%s cause=%s confirmed=false error=true", host, iid, cause)
log.Printf("activator: ALERT %s: the takeover of %s's expired HA lock is refused: EC2 did not answer whether it is terminated: %v (the host stays down until EC2 confirms the holder terminated)", host, iid, why)
}
diff --git a/internal/activator/hawake.go b/internal/activator/hawake.go
index 1a786069f..34979c890 100644
--- a/internal/activator/hawake.go
+++ b/internal/activator/hawake.go
@@ -363,8 +363,15 @@ func (b *ExecBackend) acquireClassified(ctx context.Context, rt registry.Route)
}
}
- ctx = lease.WithTerminationProof(ctx, b.TerminationProofs)
proofs := hafresh.Proofs{SameBoxEmpty: b.sameBoxEmpty(ctx, rt), OwnerTerminated: b.ownerTerminated(ctx, rt)}
+ if b.TerminationProofs != nil {
+ adapter := *b.TerminationProofs
+ adapter.Observe = func(iid string, gone bool, err error) { b.reportTakeover(ctx, rt, iid, gone, err) }
+ if b.OwnerTerminated != nil {
+ proofs.OwnerTerminated = func(iid string) (bool, error) { return b.OwnerTerminated(ctx, iid) }
+ }
+ ctx = lease.WithTerminationProof(ctx, &adapter)
+ }
var held *lease.Held
if duty, ok := ctx.Value(dutyContextKey{}).(dutyRestriction); ok {
held, err = lease.AcquireHAForDuty(ctx, b.Cfg.Bucket, prefix, b.Cfg.Region, hafresh.Marker{Lifetime: entry.ID}, proofs, duty.allow)
diff --git a/internal/activator/termination_proof_test.go b/internal/activator/termination_proof_test.go
index 09172fd05..21ad20353 100644
--- a/internal/activator/termination_proof_test.go
+++ b/internal/activator/termination_proof_test.go
@@ -16,6 +16,7 @@ import (
func TestTerminationProofWiring(t *testing.T) {
for _, mode := range []string{"visitor", "due", "finalizer"} {
t.Run(mode, func(t *testing.T) {
+ logs := captureLog(t)
s, req := haAdoptionFixture(t)
s.b.Cfg.Region = "eu-west-1"
ctx := context.Background()
@@ -27,7 +28,7 @@ func TestTerminationProofWiring(t *testing.T) {
t.Fatal(err)
}
fallbacks, resolves := 0, 0
- s.b.OwnerTerminated = func(context.Context, string) (bool, error) { fallbacks++; return true, nil }
+ s.b.OwnerTerminated = func(context.Context, string) (bool, error) { fallbacks++; return false, nil }
s.b.TerminationProofs = &lease.TerminationProofAdapter{Cache: &termfence.ProofCache{}, Resolve: func(context.Context, string, string) (termfence.ProofIdentity, error) {
resolves++
return termfence.ProofIdentity{}, errors.New("unverified")
@@ -50,9 +51,16 @@ func TestTerminationProofWiring(t *testing.T) {
t.Fatal("unverified identity granted acquire")
}
}
- if fallbacks != 0 || resolves != 1 {
+ if fallbacks != 1 || resolves != 1 {
t.Fatalf("fallbacks=%d resolves=%d", fallbacks, resolves)
}
+ cause := "visitor"
+ if mode == "finalizer" {
+ cause = "departure-finalize"
+ }
+ if !strings.Contains(logs.String(), "ALERT") || !strings.Contains(logs.String(), "cause="+cause) {
+ t.Fatalf("missing refusal telemetry: %s", logs)
+ }
for _, r := range s.fx.Requests()[before:] {
if strings.HasPrefix(r, "PUT ") {
t.Fatal("refusal wrote", r)
@@ -61,3 +69,48 @@ func TestTerminationProofWiring(t *testing.T) {
})
}
}
+
+func TestTerminationProofUnboundTakeover(t *testing.T) {
+ for _, mode := range []string{"expired", "unexpired", "lifetime", "adapter"} {
+ t.Run(mode, func(t *testing.T) {
+ expiry := time.Now().Add(-time.Hour)
+ if mode == "unexpired" {
+ expiry = time.Now().Add(time.Hour)
+ }
+ oracle := &terminatedOracle{yes: map[string]bool{"i-b": true}}
+ b, rt, _ := takeoverBackend(t, expiry, oracle)
+ b.Cfg.Region = "eu-west-1"
+ logs := captureLog(t)
+ b.TerminationProofs = &lease.TerminationProofAdapter{Cache: &termfence.ProofCache{}, Resolve: func(context.Context, string, string) (termfence.ProofIdentity, error) {
+ return termfence.ProofIdentity{}, errors.New("unverified")
+ }, Lifetime: func(context.Context, string, string, string) (string, error) {
+ if mode == "lifetime" {
+ return "wrong", nil
+ }
+ return haFixOf(b).lifetime, nil
+ }}
+ if mode == "adapter" {
+ b.TerminationProofs.Cache = nil
+ }
+ held, err := b.Acquire(t.Context(), rt)
+ if held != nil {
+ releaseHALease(t, held)
+ }
+ if (err == nil) != (mode == "expired") {
+ t.Fatalf("acquire: %v", err)
+ }
+ want := 0
+ if mode == "expired" {
+ want = 1
+ }
+ if len(oracle.calls()) != want {
+ t.Fatalf("calls: %v", oracle.calls())
+ }
+ if mode == "lifetime" || mode == "adapter" {
+ if !strings.Contains(logs.String(), "ALERT") {
+ t.Fatalf("silent refusal: %s", logs)
+ }
+ }
+ })
+ }
+}
diff --git a/internal/host/hadepartures.go b/internal/host/hadepartures.go
index d59e48b74..8a4734360 100644
--- a/internal/host/hadepartures.go
+++ b/internal/host/hadepartures.go
@@ -235,12 +235,13 @@ func (c *Controller) enqueue(ctx context.Context, box hadeparture.BoxObservation
}
func (c *Controller) confirmed(ctx context.Context, iid string) error {
box, ok, err := c.cfg.Identities.Resolve(ctx, "", iid)
+ // Unbound peers retain live-EC2 takeover without departure enrollment.
+ if errors.Is(err, errDepartureIdentity) || (err == nil && (!ok || !box.Known || box.PlacementNull)) {
+ return nil
+ }
if err != nil {
return err
}
- if !ok {
- return errDepartureIdentity
- }
return c.Enqueue(ctx, box)
}
func (c *Controller) Suspect(ref string) {
diff --git a/internal/host/hadepartures_wiring_test.go b/internal/host/hadepartures_wiring_test.go
index 6216a6080..866546730 100644
--- a/internal/host/hadepartures_wiring_test.go
+++ b/internal/host/hadepartures_wiring_test.go
@@ -569,3 +569,54 @@ func TestTerminationUnreadIdentityRetainsPending(t *testing.T) {
t.Fatal("an unidentifiable record cannot certify unrelated", hints, err)
}
}
+
+func TestTerminationUnboundFixedPeerFallback(t *testing.T) {
+ t.Cleanup(lease.ProcessStateForTest())
+ fx := locktest.NewLockFixture(t)
+ a, _, describes := departureArmFixtureBucket(t, fx.Bucket)
+ getenv := a.Getenv
+ a.Getenv = func(k string) string {
+ if k == departureBindingsEnv {
+ return ""
+ }
+ return getenv(k)
+ }
+ a.Backend.Registry = a.Registry
+ a.Backend.Cfg.Record = func(context.Context, registry.Route) (activator.RecordFacts, error) {
+ return activator.RecordFacts{LifetimeEntry: provision.LifetimeEntry{ID: "life", HA: true}}, nil
+ }
+ a.Backend.OwnerTerminated = a.Confirmer.Terminated
+ a.ProofStore = nil
+ lease.SetSelf(hafresh.Self{Ref: a.Self.Ref, IID: a.Self.InstanceID, Account: a.Self.Account, Region: a.Self.Scope.CloudRegion})
+ if err := lease.SetObligationDir(t.TempDir()); err != nil {
+ t.Fatal(err)
+ }
+ if err := a.Registry.Upsert(registry.Route{Host: "shop.example.com", Kind: "instance", Provisioned: true, HA: true}); err != nil {
+ t.Fatal(err)
+ }
+ ctx, cancel := context.WithCancel(t.Context())
+ defer cancel()
+ c, l, err := armHADepartures(ctx, a)
+ if err != nil {
+ t.Fatal(err)
+ }
+ defer l.Stop(context.Background())
+ if _, err = c.cfg.Identities.Observe(ctx, hadeparture.BoxObservation{Known: true, Box: hadeparture.Box{Ref: "dead", Scope: a.Self.Scope}, EdgesKey: "control/edges/dead.json", EdgesETag: "exact"}); err == nil {
+ t.Fatal("unbound peer enrolled")
+ }
+ body, _ := json.Marshal(hafresh.Lock{Generation: 1, Owner: hafresh.OwnerFor(hafresh.Self{Ref: "dead", IID: "i-1123456789abcdef0"}, 1, true), ExpiresAt: time.Now().Add(-time.Hour)})
+ fx.PutLock("instances/shop.example.com", body)
+ held, err := lease.AcquireHA(lease.WithTerminationProof(ctx, a.Backend.TerminationProofs), fx.Bucket, "instances/shop.example.com", a.Self.Scope.CloudRegion, hafresh.Marker{Lifetime: "life"}, hafresh.Proofs{OwnerTerminated: func(iid string) (bool, error) { return a.Backend.OwnerTerminated(ctx, iid) }})
+ if err != nil {
+ t.Fatal(err)
+ }
+ _ = held.Release(ctx)
+ if *describes != 1 {
+ t.Fatalf("describes=%d", *describes)
+ }
+ for _, r := range fx.Requests() {
+ if strings.Contains(r, "terminations/") {
+ t.Fatalf("unbound proof request %s", r)
+ }
+ }
+}
diff --git a/internal/lease/termination_proof.go b/internal/lease/termination_proof.go
index db1547f7d..ce04d220a 100644
--- a/internal/lease/termination_proof.go
+++ b/internal/lease/termination_proof.go
@@ -18,6 +18,7 @@ type TerminationProofAdapter struct {
Confirmer *termfence.Confirmer
Resolve func(context.Context, string, string) (termfence.ProofIdentity, error)
Lifetime func(context.Context, string, string, string) (string, error)
+ Observe func(string, bool, error)
}
type terminationProofKey struct{}
@@ -34,7 +35,13 @@ func bindTerminationProof(ctx context.Context, client *s3.Client, bucket, prefix
}
// The closure belongs to this classification round. DecideAcquire invokes it
// only for an expired foreign owner. A CAS retry gets a fresh closure.
- p.OwnerTerminated = func(iid string) (bool, error) {
+ fallback := p.OwnerTerminated
+ p.OwnerTerminated = func(iid string) (gone bool, result error) {
+ defer func() {
+ if adapter != nil && adapter.Observe != nil {
+ adapter.Observe(iid, gone, result)
+ }
+ }()
owner, ok := hafresh.ParseOwner(v.Lock.Owner)
if !ok || !owner.HA || owner.IID != iid || iid == self.IID || v.Absent || v.Lock.Release != nil || base.Lifetime == "" || region != self.Region || adapter == nil || adapter.Cache == nil || adapter.Resolve == nil || adapter.Lifetime == nil {
return false, termfence.ErrTerminationProof
@@ -56,6 +63,13 @@ func bindTerminationProof(ctx context.Context, client *s3.Client, bucket, prefix
}
binding, err := adapter.Resolve(ctx, owner.Ref, iid)
if err != nil {
+ if fallback != nil {
+ gone, err := fallback(iid)
+ if !gone || err != nil {
+ return false, err
+ }
+ return currentLifetime()
+ }
return false, err
}
e := binding.Evidence()
diff --git a/internal/lease/termination_proof_test.go b/internal/lease/termination_proof_test.go
index ee9c8055d..a86b1e3a2 100644
--- a/internal/lease/termination_proof_test.go
+++ b/internal/lease/termination_proof_test.go
@@ -35,7 +35,7 @@ func (p *proofEC2) DescribeInstances(ctx context.Context, in *ec2.DescribeInstan
return &ec2.DescribeInstancesOutput{Reservations: []ec2types.Reservation{{OwnerId: aws.String("111122223333"), Instances: []ec2types.Instance{{InstanceId: aws.String(in.InstanceIds[0]), State: &ec2types.InstanceState{Name: state}}}}}}, nil
}
func TestTerminationProofAcquireOnly(t *testing.T) {
- for _, mode := range []string{"expired", "unexpired", "equality", "same box", "malformed", "wrong lifetime", "lifetime changes during proof", "owner CAS", "bucket", "region", "restart"} {
+ for _, mode := range []string{"expired", "unexpired", "equality", "unbound", "unbound equality", "same box", "malformed", "wrong lifetime", "lifetime changes during proof", "owner CAS", "bucket", "region", "restart"} {
t.Run(mode, func(t *testing.T) {
ResetForTest()
t.Cleanup(ResetForTest)
@@ -64,7 +64,7 @@ func TestTerminationProofAcquireOnly(t *testing.T) {
}, API: func(context.Context, string) (termfence.EC2, error) { return api, nil }, Logf: func(string, ...any) {}}
lifetimeReads := 0
adapter := &TerminationProofAdapter{Cache: &termfence.ProofCache{}, Confirmer: confirm, Resolve: func(ctx context.Context, ref, iid string) (termfence.ProofIdentity, error) {
- if ref != "departed" || iid != "i-1123456789abcdef0" {
+ if strings.HasPrefix(mode, "unbound") || ref != "departed" || iid != "i-1123456789abcdef0" {
return termfence.ProofIdentity{}, errors.New("unbound")
}
return binding, nil
@@ -91,7 +91,7 @@ func TestTerminationProofAcquireOnly(t *testing.T) {
if mode == "unexpired" {
expiry = at.Add(time.Hour)
}
- if mode == "equality" {
+ if mode == "equality" || mode == "unbound equality" {
expiry = at
}
if mode == "same box" {
@@ -103,9 +103,9 @@ func TestTerminationProofAcquireOnly(t *testing.T) {
body, _ := json.Marshal(hafresh.Lock{Generation: 1, Owner: owner, ExpiresAt: expiry})
fx.PutLock("instances/shop", body)
fallback := 0
- p := hafresh.Proofs{OwnerTerminated: func(string) (bool, error) { fallback++; return true, nil }}
+ p := hafresh.Proofs{OwnerTerminated: func(iid string) (bool, error) { fallback++; return iid == "i-1123456789abcdef0", nil }}
ctx := WithTerminationProof(context.Background(), adapter)
- if mode == "equality" {
+ if mode == "equality" || mode == "unbound equality" {
v, err := readView(ctx, client, fx.Bucket, "instances/shop/lock.json")
if err != nil {
t.Fatal(err)
@@ -124,7 +124,7 @@ func TestTerminationProofAcquireOnly(t *testing.T) {
})
}
held, err := AcquireHA(ctx, fx.Bucket, "instances/shop", region, hafresh.Marker{Lifetime: "life"}, p)
- want := mode == "expired" || mode == "restart"
+ want := mode == "expired" || mode == "restart" || mode == "unbound"
if (err == nil) != want {
t.Fatalf("err=%v want=%t requests=%v", err, want, fx.Requests())
}
@@ -132,7 +132,11 @@ func TestTerminationProofAcquireOnly(t *testing.T) {
_ = held.Release(context.Background())
}
}
- if fallback != 0 {
+ wantFallback := 0
+ if mode == "unbound" || mode == "owner CAS" {
+ wantFallback = 1
+ }
+ if fallback != wantFallback {
t.Fatal("live callback bypassed proof")
}
wantDescribe := 0
diff --git a/internal/provision/testdata/plan14-root-reads-chain.tsv b/internal/provision/testdata/plan14-root-reads-chain.tsv
index 257e811c2..aed0d33b0 100644
--- a/internal/provision/testdata/plan14-root-reads-chain.tsv
+++ b/internal/provision/testdata/plan14-root-reads-chain.tsv
@@ -74,4 +74,4 @@ plan14-root-reads-wake-storm-cap.tsv b0fc198c53bb0dacba33a54c3d8bf8fe5ac07d94b76
plan14-root-reads-domains-check-country.tsv b0fc198c53bb0dacba33a54c3d8bf8fe5ac07d94b76a31b8a69e9411115ecd85
plan14-root-reads-static-stream-extract.tsv 7fb932b118e67e23b33a374c6a4020b38976667c7ec4cfb855c0f8b598b1756b
plan14-root-reads-ls284.tsv 744b16d970f22476b79982e57c326157ca5137fa96ccaee4a7ae10c25248d124
-plan14-root-reads-region-ha-p1b3b-t.tsv 8361b4e7b8b4975c6eab77717af17c479326da351e8e5aa506e94f9a7162ebe9
+plan14-root-reads-region-ha-p1b3b-t.tsv 9f8eedbae2944b4ba6590b3c11d71b54645620c4dd9e28807f757dbd4bdec8bb
diff --git a/internal/provision/testdata/plan14-root-reads-region-ha-p1b3b-t.tsv b/internal/provision/testdata/plan14-root-reads-region-ha-p1b3b-t.tsv
index 5f8e0bdab..b819b45f6 100644
--- a/internal/provision/testdata/plan14-root-reads-region-ha-p1b3b-t.tsv
+++ b/internal/provision/testdata/plan14-root-reads-region-ha-p1b3b-t.tsv
@@ -1,6 +1,6 @@
# Census overlay region-ha-p1b3b-t, written by census-propose (#369). census-ruling-region-ha-p1b3b-t, approved on #280 before the merge; the approval card is docs/superpowers/notes/census-proposal-region-ha-p1b3b-t.md.
-# 10 body, 7 sites, 17 envelope: each changed unit re-frozen at its existing disposition with its claim appended.
-# 91 new dispositions: 3 reads re-frozen at their disposition with the claim, 87 new units frozen accepted-legacy, 0 quiet units retired while they read nothing, 1 other.
+# 10 body, 6 sites, 17 envelope: each changed unit re-frozen at its existing disposition with its claim appended.
+# 93 new dispositions: 4 reads re-frozen at their disposition with the claim, 88 new units frozen accepted-legacy, 0 quiet units retired while they read nothing, 1 other.
@legacy 76aeefcc3063f48d5e854bd81482a114455b6182ba9544399042a8cb07dbb79a internal/activator/activator.go Service.begin legacy accepted-legacy accepted-legacy;rev3=census-ruling-carlos-run;basis=Re-digested at the pre-land merge: the body includes main's own change under census ruling 292, with no further change from this branch. the agent (/opt/carlos/carlos agent, carlos-edge.service, user carlos): main's body; the stop now carries its reason for a run it interrupts (beginStopLocked's why argument); read sites unchanged, offsets moved;rev3=census-ruling-edge-request-records;basis=gains a req *http.Request parameter and one edge.MarkWoke(req) call on the path that starts a wake, so the edge's request record can say which request woke the app; no read added;rev3=census-ruling-remote-instance-metrics;basis=the entries-map insertion goes through putEntryLocked (which also notes the route's tenant in memory for the metrics sampler); no read added;rev3=census-ruling-rootfs-apps-3;basis=rootfs Plan 3 Tasks 7 and 8: before an entry is made, a resident inside its backoff answers errResidentBackoff, and a rootfs row must pass the locked admission (rootfsRefusalLocked) and then the backend's rootfs gates off a.mu (rootfsStartRefusal, within the request's wait bound) before Acquire, Restore or the live link; the gate key is recorded on the entry; adds refusals before the lease only;rev3=census-ruling-stateless-replicas-1;basis=Task 3a: Read serving lease health through servingError: stateless generations use local lifecycle/process supervision, while stateful generations keep the existing lease checks. No new I/O.;rev3=census-ruling-region-ha-p1b3b-t;basis=Carry background-duty provenance into a new singleflight entry; a visitor waiting on its deferred refusal retries with ordinary visitor authority. No read added. registry:Host@1146,registry:Host@1457,registry:Host@3513,registry:Host@3670,registry:Host@562,whole:Route@2011,whole:Route@2098,whole:Route@2179,whole:Route@2440,whole:Route@2550,whole:Route@2724,whole:Route@3522,whole:Route@3529 6dfb9ff708ed5fc62b5184ff03fb2df8e1e9fe5d84244b4c9979f3c27f3d7168
@legacy ee74269fe59778aca77cdc1c5ccca3fb0cb3322a7e8de49686c4966a86388d6c internal/activator/activator.go Service.sweepOnce legacy accepted-legacy accepted-legacy;rev3=PROPOSED-seed;basis=census-ruling-FS-R6; registry remains legacy; PROPOSED-plans-2-box-limits: the sweep also narrows an entry's idle window to its account's plan idle through the SetIdleFor hook (never lengthens it; always-on workers and held probe entries are untouched; the hibernate, inflight and held-for-tick guards are unchanged).;rev3=census-ruling-plans-4c-box-throttle;basis=after the worker max_run branch, stops a non-worker entry past the plans continuous-awake ceiling (maxRunFor, passed the row), busy or not, never mid-command (plans 4c). One more whole-row read: the row handed to the hook, as idleFor already is. This bypasses the inflight and held-for-tick protections the idle stop keeps, on purpose: escalated by Astra and ACCEPTED by Paul (census owner), 2026-10-25.;rev3=census-ruling-plans-4d-lapse;basis=stops a live entry the turned-off hook names (never mid-command, never a move's active probe), stands down an exited worker it names instead of restarting it (Astra finding 4), and skips such rows in the due loop and the always-on arm so they are not woken (plans 4d). Four more whole-row reads: the row handed to the hook (a.disabled), as idleFor and maxRunFor already are. Only stops or skips.;rev3=census-ruling-remote-instance-metrics;basis=its two entries-map insertions go through putEntryLocked (which also notes the route's tenant in memory for the metrics sampler); no read added;rev3=census-ruling-region-ha-p1a;basis=the agent as carlos: one more call at the top, a.retryOwedMarkers() (harelease.go), which starts at most one background lease.RetryPending pass over owed region HA release markers, off a.mu; the due query, idle, max-run and lapse logic are unchanged; the same 38 sites, no read added; merge of origin/main d7ae1d76: main's change is kept as main has it (census-ruling-remote-instance-metrics: its two entries-map insertions go through putEntryLocked); this branch's change is the same as above; read sites the same 38, offsets moved;rev3=census-ruling-rootfs-apps-3;basis=rootfs Plan 3 Task 8: a resident (Route.Resident) is never stopped for idleness or by the continuous-awake ceiling; the due-wake check is left on Hibernate (comment); stops less, not more;rev3=census-ruling-rootfs-apps-3-release;basis=rootfs Plan 3 Group R: an entry whose host has a release record open (the in-memory a.releaseOps[e.host]) is not stopped by its plan's turn-off, by idleness or by the continuous-awake ceiling until the record goes; one more sweep pass, reapReleaseOpsLocked, retries an unproven release's stop (through finishPendingStops); the same 39 read sites, no read added; stops less, not more;rev3=census-ruling-rootfs-apps-6;basis=rootfs Plan 6 Task 9 (PF-18): the four checks that left an entry with a run attached alone (e.cmd == nil) now read holdsAttachedLocked(e), a run or a session attached, so a session holds the idle sleep, the plans awake ceiling, the plans turned-off stop and the turned-off worker's stand-down as a run does; in-memory under a.mu; only keeps an entry awake longer; no read added, read sites unchanged;rev3=census-ruling-stateless-replicas-1;basis=Task 3a: Read serving lease health through servingError: stateless generations use local lifecycle/process supervision, while stateful generations keep the existing lease checks. No new I/O.;rev3=census-ruling-region-ha-p1b3b-t;basis=Tag due entries as background duties; the wake evaluates the gate off a.mu before acquire or token preparation. No read added. registry:Hibernate@10805,registry:Hibernate@14563,registry:Hibernate@23821,registry:Hibernate@5680,registry:Hibernate@7879,registry:Host@23890,registry:Host@23948,registry:Host@24415,registry:Host@24508,registry:Host@25260,registry:Host@25361,registry:Host@26425,registry:Host@26712,registry:Host@26768,registry:NextDue@25198,registry:Status@23837,whole:Route@10807,whole:Route@11666,whole:Route@14565,whole:Route@16498,whole:Route@18208,whole:Route@18398,whole:Route@18691,whole:Route@18863,whole:Route@19010,whole:Route@23221,whole:Route@23997,whole:Route@24912,whole:Route@25269,whole:Route@25276,whole:Route@26240,whole:Route@26541,whole:Route@26745,whole:Route@5491,whole:Route@5682,whole:Route@7712,whole:Route@7881,whole:Route@8074,whole:Route@8537 bb62b361b6dff7e47fa68665994a5b73860a499107a67c32af002c608bc936fd
@legacy ebed63ce52f359e7554f0fa5c285656548b89ff2aa30032636c28ec98d37fe65 internal/edge/wakeplacement.go homeMap.wakeSnapshot legacy accepted-legacy accepted-legacy;rev3=census-ruling-region-ha-p1b3a;basis=Project cold-wake candidates from one immutable cached edges fold using the local route's canonical host, release.RouteAccount and app. Reads only in-memory route fields, cached publication additions and mirrored signing keys; no filesystem, registry, store or root authority added. Reject malformed placement evidence independently of the unchanged holder decoder; preserve explicit local safety denials even when stale.;rev3=census-ruling-region-ha-home-placement;basis=none: accepts the omitted/empty home placement, refuses explicit null; same in-memory fold reads, no new read;rev3=census-ruling-region-ha-p1b3b-t;basis=Expose fresh compatible peer membership separately from per-host eligible serving entries for suppression invalidation. Existing home/pool/scope filtering remains; no new reads. registry:App@2370,registry:Host@1412,whole:Route@1443 35b52d47574c903f65776ba3c476ab38457c93caf027279263774e084023c03d
@@ -29,6 +29,7 @@
@legacy 243829e68aa653933558a1a469de10e1e15e4d8ba75b1e4242f6b2f5c6ca6d3a internal/activator/haduties.go Service.saveDuty legacy accepted-legacy accepted-legacy;rev3=census-ruling-region-ha-p1b3b-t;basis=DutyState is now an alias of registry.DutyState, so existing revision and state reads enter the registry census. Save behavior and CAS remain advisory. registry:Revision@185,registry:Revision@454,registry:Revision@487,registry:Revision@531,registry:Revision@547,whole:DutyState@199,whole:DutyState@359,whole:DutyState@386,whole:DutyState@463,whole:DutyState@574,whole:DutyState@588 6e3777127af58cf8987bf71aa05d53f8ef97ca228668b4e1994312e7c70bf47f
@legacy f75c174a45a57feeca885d61031026907fee317ebf2b2dacba6a25202e070187 internal/activator/haduties.go dutyBackend legacy accepted-legacy accepted-legacy;rev3=census-ruling-region-ha-p1b3b-t;basis=Dispatch the existing backend by local route through SplitBackend, for HA classification and self identity. No new I/O. whole:Route@235,whole:Route@240 835097870b1a956888da998aee935491325c48d7847d7bc5ba650a23306e2db2
@legacy 4598c4202fca743b3c7e08038176ebef0aed7794a56574ae0978094952752e14 internal/activator/haduties.go dutyRefusal legacy accepted-legacy accepted-legacy;rev3=census-ruling-region-ha-p1b3b-t;basis=DutyState alias makes the existing holder and deadline reads visible to the registry census; refusal behavior unchanged. registry:HolderIID@306,registry:HolderRef@223,registry:HolderRef@245,registry:HolderRef@276,registry:NotBefore@167 7d8646a06d8d37ce9e8c736b1fb1e59b8046ba245e1957e0301791fd9032910d
+@legacy da0e7440f9c57906aad3e18fc31111c083e4f7f72e5443e2913e4f62acfdec6f internal/activator/hatakeover.go ExecBackend.reportTakeover legacy accepted-legacy accepted-legacy;rev3=census-ruling-region-ha-p1b3b-t;basis=Final fix P2-1: report all refused proof results through the per-host alarm and distinguish visitor from departure-finalize. No reads or authority. registry:Host@317,registry:Host@481,registry:Host@633 89018a2869f5db2a6b14fcd38c6457e0de548ca447b581ddd615f4653df5b449
@legacy 9d74212f181039ff692d2e83653397bb7951d9c75b330b3d10e7df9f50fb2e67 internal/activator/hawake.go ExecBackend.TerminationLifetime legacy accepted-legacy accepted-legacy;rev3=census-ruling-region-ha-p1b3b-t;basis=B3 fix r1: Read the host route from the existing registry and reuse isHA record/lifetime-index classification. Missing, legacy or lifetime-free hosts refuse. Inventory completeness is not takeover authority. whole:Route@242,whole:Route@329 4f9acf54553193732df400d99d23291f3be27cd09007ca3980075d3da05535b4
@legacy 780da2b6b37d2fc6e2baa16c11257cb492226e4e553679ecc244186fb90d70d4 internal/edge/wakeplacement.go Edge.DutySnapshot legacy accepted-legacy accepted-legacy;rev3=census-ruling-region-ha-p1b3b-t;basis=Pass the route to the existing cached home projection; no store reads, network reads or new publication. whole:Route@108 fa66b0bb586cb9a3214d818fbe40181f3ca7d5655f5af4ac259377cf4d5c133d
@legacy 69da0045e9bb64b0e01dec7903eeb3730347445516a83c68d0f42a4ed058b0df internal/host/hadeparture_identity.go departureIdentities.Observe legacy accepted-legacy accepted-legacy;rev3=census-ruling-region-ha-p1b3b-t;basis=B3b: read immutable box bytes and local verified bindings; require AWS signature plus independent fixed/group binding, unique ref/iid, exact digest and known scope. Unknown walks persist one 1000-key page and at most 32 new GETs per turn; errors never prove absence. B3 fix r1: Open the existing deployment store lazily; same immutable record verification and independently bound iid. No new record path. B4 fix r2: Reload the exact signed box record when independent fixed configuration changes the expected iid. Verify configured account/region and persist the new incarnation without changing historical observations. Warm unchanged identities add no S3 reads. B4 fix r3: A failed configured replacement retains and refreshes only the current verified incarnation observation. Share exact-key reload refusals with the event walk; cached bindings still pass signature/digest checks and the new configured iid gains nothing until verification succeeds. B4 fix r4/P18: On refused fixed-ref replacement, resolve and return the stored verified incarnation observation without saving the incoming edges ETag or scope. No new remote read or authority. registry:Account@1330,registry:Digest@1240,registry:Digest@1362,registry:IID@1195,registry:IID@1307,registry:IID@558,registry:IID@711,registry:Observation@1372,registry:Raw@1111,registry:Ref@1136,registry:Ref@704,whole:HABoxIdentity@1432,whole:HABoxIdentity@641,whole:HABoxIdentity@645,whole:HABoxIdentity@906 5941fee3b26d60191dcb028ac63ac9a2b48b2ba3a6834262a4d3783e6517ef3b
@@ -96,13 +97,13 @@
@legacy 7c6c9fedebd681f46078f51a51142fb1c5df461465e20fb86abf88bf3a2bb964 internal/schedule/runner.go OldDutyTick legacy accepted-legacy accepted-legacy;rev3=census-ruling-region-ha-p1b3b-t;basis=Read timer kind and natural due occurrence; only recurring occurrences at least 15 minutes old qualify. No writes. registry:Kind@82,whole:Timer@71 b7f99aa2e76858e06675d9aa6b9266600423714cfd7585860eeed12021eaa0f0
@legacy 351bcef78f571f8c2b6d857aa635cc7e6806782b7a9741ec83fd10c7696da63f internal/schedule/runner.go Runner.fireOwned legacy accepted-legacy accepted-legacy;rev3=census-ruling-region-ha-p1b3b-t;basis=Existing fire body moved beneath admission; deferred delivery now returns without recording a failure. Same token preparation, parsing, guarded row checks and delivery authority. registry:Host@248,registry:Host@390,registry:Host@696,registry:Host@842,registry:Name@257,registry:Name@399,registry:Spec@153,registry:Spec@265,whole:Route@1010,whole:Route@1207,whole:Route@1509,whole:Route@1572,whole:Route@1776,whole:Route@667,whole:Route@747,whole:Route@773,whole:Route@884,whole:Timer@1014,whole:Timer@113,whole:Timer@1211,whole:Timer@1311,whole:Timer@1513,whole:Timer@1780,whole:Timer@322,whole:Timer@888 6cfedad07127980fe70c6206ec8e2f994c2b6ffc2017b60ddaaeba4faeb0e25f
@legacy f28f1e806b403a52e5ac8aef1f28b0429e24db894553196ed6ac9d58280e0e22 internal/termfence/termination_proof.go readTerminationProof legacy accepted-legacy accepted-legacy;rev3=census-ruling-region-ha-p1b3b-t;basis=Read at most 2049 bytes from the existing regional data-bucket S3 client at a key derived solely from independently bound, signature-verified immutable box identity. Reject bodies over 2048 bytes, duplicate/missing/unknown fields, invalid provenance and identity mismatch. Only acquire consumes validated proof as authority after expiry and current owner/lifetime checks. No filesystem path or tenant prefix is read. file:ReadAll@753 3cae6540aba3e76210c4bf5e57a6f6b2c5160a0be8a531c74b823438c085e060
+@legacy 82d58213965f3b2fd35bdda3e8b68a802a9b823e4c76e38865111a66594264c8 internal/activator/hatakeover.go ExecBackend.ownerTerminated legacy accepted-legacy accepted-legacy;rev3=census-ruling-region-ha-p1b1;basis=new (region HA P1b-1): returns nil without eb.OwnerTerminated; else a closure calling it with the lock owner's instance id (from the HA lock, written by a box agent) and logging rt.Host on a takeover and, at most once a minute per host, on an error; the id goes only to EC2 DescribeInstances in this box's own account and region and is checked against the reply (termfence.SameAccountTerminated); root never calls it;rev3=census-ruling-region-ha-p1b3b-t;basis=Read route Host for structured departure-finalize telemetry; retain the same confirmation callback and visitor alarm behavior. Final fix P2-1: report the live confirmer result through the shared telemetry helper. No added reads. whole:Route@266 be2e65e8c9fc0505e3228f82991e99a03fccadf559a7b5bc07aef8d8b1343ea6
@legacy c4860d69f95a542d19c0664c392a5981581b38837d90a3d8294d6cd0a25f0757 internal/host/runs.go runsWorker.pickup legacy accepted-legacy accepted-legacy;rev3=census-ruling-self-serve-moves-1;basis=the agent (/opt/carlos/carlos agent, carlos-edge.service, user carlos), its runs worker: a picked run's detached execution runs under provision.WithLifetimes of the worker's judge, so execute's record writes refuse a stale record; read sites unchanged, offsets moved;rev3=census-ruling-rootfs-apps-6;basis=rootfs Plan 6 Task 16 (ruling R7): on a fleet box a run already let go is skipped before any read; the pickup CAS moves behind the run's sink (sinkFor: the bucket's, as before, or on a fleet box the run door relay once a grant verifies); one more whole-Route site, the row this box already owns passed to sinkFor; nothing new opened, run or followed;rev3=census-ruling-region-ha-p1b3b-t;basis=Wrap both bucket and relay pickup in the service duty gate; refuse an HA route when no gate exists. Reads HA and passes the route; existing pickup moved to pickupOwned. registry:HA@343,whole:Route@244,whole:Route@308,whole:Route@388 42cb4d25952fb42237296d5050bd2e21b7ecc6ff5bdb1ebae1a13d26efe648bf
@legacy d0746eb23c748ad143658bd480e66e3604bacf56875576adeb83254efa4e436d internal/hostfiles/wake.go ImportWake legacy accepted-legacy accepted-legacy;rev3=J1,J2,J4;basis=root-route;rev3=census-ruling-region-ha-p1b3b-t;basis=Delegate validated conversion to one atomic ReplaceHAWake transaction instead of three independent writes; no lease or file effect. B2 fix r1: ordinary acquired-lease restore converts legacy wire rows without adoption-only timer grammar restrictions. Version, host and replication remain checked before the atomic exact replacement. whole:HAWakeImport@200 b3d3c13dc1a985b2e4c333b29658a129e808dc3cc2b1321a7acddec9d01cf7e0
@legacy 338c8f8dbc28811430676648d55a97266f32903b9b1e56a4b9683ca287446de5 internal/activator/activator.go Service.ServeScheduled legacy accepted-legacy accepted-legacy;rev3=J1;basis=root-route;rev3=census-ruling-plans-4d-lapse;basis=answers a scheduled request to a route the turned-off hook names with the maintenance response before serve (plans 4d). One more whole-row read: the row handed to the hook (a.disabled), as the fence and maxRunFor are asked.;rev3=census-ruling-region-ha-p1a;basis=the agent as carlos: wraps the proxy so that, after the wake, fillScheduledToken(r, rt) sets an HA host's tick bearer token from its restored env file; an error there logs (+registry:Host, rt.Host) and answers 503 with Retry-After: 5; a non-HA host's tick is left as the runner built it; +whole:Route is rt handed to fillScheduledToken; keeps legacy;rev3=census-ruling-rootfs-apps-3;basis=rootfs Plan 3 Task 5: the activator-managed test is Route.ActivatorOwned (a hibernating instance, or an instance with a runtime) instead of Kind and Hibernate inline; reads the same fields plus Runtime through the method;rev3=census-ruling-region-ha-p1b3b-t;basis=Run the local scheduled request under WithDuty and retain existing HTTP refusal text; add route arguments to background admission and error handling. No forwarding. registry:Host@669,registry:Status@146,registry:Status@165,whole:Route@1143,whole:Route@248,whole:Route@600,whole:Route@883,whole:Route@964 41bcecc8605bfc52536690da309860ffc7464646dd4e2dbf577fc2bd287c9061
@legacy 7336624d293af88c809c3360d8a5ef0aab71e94cf9c13f80eb02a302092026fe internal/activator/activator.go Service.wake legacy accepted-legacy accepted-legacy;rev3=census-ruling-carlos-run;basis=Re-digested at the pre-land merge: the body includes main's own change under census ruling 292, with no further change from this branch. the agent (/opt/carlos/carlos agent, carlos-edge.service, user carlos): main's body; the stop now carries its reason for a run it interrupts (beginStopLocked's why argument); read sites unchanged, offsets moved;rev3=census-ruling-wake-latency-1;identity=the agent (/opt/carlos/carlos agent, carlos-edge.service, user carlos);basis=logs that timer's breakdown to the journal after a successful wake (w.steps.String(), e.host, w.wakeTook); no read added;rev3=census-ruling-plans-4d-lapse;basis=cancels a wake whose row the turned-off hook names, like a fence, unless it is a move's active probe (plans 4d). One more whole-row read: the row handed to the hook (a.disabled). Only refuses.;rev3=census-ruling-rootfs-apps-3;basis=rootfs Plan 3 Tasks 7 and 8: a refusal before the lease is reported once per change (noteRootfsRefusal) instead of a wake-failure event; the proc, generation and replica are installed through installProcLocked (which puts a resident under its lease watch before the fence); residency notes the outcome (noteResidentWakeLocked); same generation values;rev3=census-ruling-rootfs-apps-3-release;basis=rootfs Plan 3 Group R [pf R3.5]: the wake's context ceiling is wakeCeilingFor(e.route): the old 5 minutes for a binary row, 5 minutes plus runs.MaxTimeout for a rootfs row (room for a release inside the wake); new site +whole:Route (e.route to wakeCeilingFor, which reads Runtime only); no other change;rev3=census-ruling-managed-fleets-1b;basis=managed fleets 1b (branch review R1 P1-1): the wake's context is also cancelled before doWake when RetireExcept has marked the entry retired (e.retired, in memory under a.mu), as it is for a fence or a shutdown. Read sites unchanged (13). Agent, not root; it only refuses more.;rev3=census-ruling-stateless-replicas-1;basis=Task 3a: Carry successful hold preparation into its wake, preserve actual mode in the generation and OnWake projection, and project serving version/mode through the narrow registry writer before releasing wake waiters. Final review I1: SetServingMode only for non-worker successful wakes with a nonempty spawned version and either a stateless generation or a mode transition from the route. Ordinary stateful wakes leave rollout status and the wake critical path unchanged.;rev3=census-ruling-edge-held-streams;basis=the agent (/opt/carlos/carlos agent, carlos-edge.service, user carlos): adds a.cancelHeldLegsLocked(e, 0) on the failed-wake path before the entry is deleted, and after close(e.ready) on success calls a.noteHeldAdmissible(e.host), the non-blocking held wake callback, outside a.mu. No read added.;rev3=census-ruling-wake-storm-cap;basis=the agent (/opt/carlos/carlos agent, carlos-edge.service, user carlos): waits for a box-wide wake slot (acquireWakeSlot, an in-memory buffered channel) before doWake; the fence/shutdown/retired/disabled refusals move into refuseWakeLocked and are asked again after admission (one fewer direct whole-Route read here: a.disabled(e.route) now runs inside refuseWakeLocked, same value); e.wakeStart is set at admission and e.admitted marks it. Only waits and refuses more; no new read.;rev3=census-ruling-region-ha-p1b3b-t;basis=Install the successful-acquire observer and restrict due, worker and resident starts before doWake, off a.mu. Add a whole-route argument to restriction; refused work has known-no-start evidence. registry:Socket@8514,registry:Socket@8675,registry:Stateless@10009,registry:Stateless@10757,whole:Route@10000,whole:Route@10055,whole:Route@10759,whole:Route@1713,whole:Route@3228,whole:Route@3355,whole:Route@3412,whole:Route@417,whole:Route@6762,whole:Route@8467,whole:Route@8516,whole:Route@8677 993666cc32a33e4fc4a87400d1b14124d538a839ed3323af08adafae5cbdee85
@legacy 099d44a548d58566d3366996f115bda81c0e28a4fbc089adee218f5dea8476fb internal/activator/harelease.go Service.releaseHAClean legacy accepted-legacy accepted-legacy;rev3=census-ruling-region-ha-p1a;basis=new: an HA entry's release, in order: host slice read empty through haHostEmpty (else errHostSliceUnproven and nothing written; the same check, moved into that helper by final fix F1), stop and join the files publisher, its final publish (2 min budget), the replica's final sync (Finish, 30 s), the local release record, then the release marker PUT (10 s), clean only when the final publish was complete and the sync and record succeeded; a failed PUT is a persisted lease obligation; +registry:Host, +whole:Route x4;rev3=census-ruling-region-ha-p1b3b-t;basis=Record advisory local-release basis only after ReleaseMarker succeeds. Add a whole-route argument to local duty bookkeeping; release order and lease authority unchanged. registry:Host@1825,whole:Route@102,whole:Route@1098,whole:Route@1236,whole:Route@1734,whole:Route@244 1d28991be7fe53f505751cde1f9822ffee9598d2eea3834eda94f42406315236
-@legacy 3a8138aa3c125359a30ff09994bbf3afc480d6d5420cdd809c9979c6e89f977f internal/activator/hatakeover.go ExecBackend.ownerTerminated legacy accepted-legacy accepted-legacy;rev3=census-ruling-region-ha-p1b1;basis=new (region HA P1b-1): returns nil without eb.OwnerTerminated; else a closure calling it with the lock owner's instance id (from the HA lock, written by a box agent) and logging rt.Host on a takeover and, at most once a minute per host, on an error; the id goes only to EC2 DescribeInstances in this box's own account and region and is checked against the reply (termfence.SameAccountTerminated); root never calls it;rev3=census-ruling-region-ha-p1b3b-t;basis=Read route Host for structured departure-finalize telemetry; retain the same confirmation callback and visitor alarm behavior. registry:Host@378,registry:Host@472,registry:Host@638 7082fa0f1b04d12676d4e0abf5d7bafaf4041fa3910e89c230ff4eba1949d785
-@legacy 816f258c0b7915cfd3e9b21809ee4c2138bfeee525cf8bea940fa50e57d558be 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. registry:Host@106,whole:Route@1137,whole:Route@1429,whole:Route@1474,whole:Route@195,whole:Route@2071,whole:Route@2167,whole:Route@533,whole:Route@584,whole:Route@834 502bfdec82020c6baa0d1d61913692a821176577b552728b7c3b0850cae894fe
+@legacy a49539b45dc97d6faa13cec8af688ef44a4d23d41ebd1ff62a21622b7abce695 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. registry:Host@106,whole:Route@1137,whole:Route@1369,whole:Route@1414,whole:Route@1569,whole:Route@195,whole:Route@2370,whole:Route@2466,whole:Route@533,whole:Route@584,whole:Route@834 042d8a6a5359107f22f473b3fe03388ea0d4d077c9d4b3dddaa7b73e9b5f2f20
@legacy b63fb307ecc0f675fab8628b5615fdb07abad1986396b70bc968395c561033cd internal/host/schedule_wiring.go activatorDeliverer.deliverSelected legacy accepted-legacy accepted-legacy;rev3=J1;basis=root-route;rev3=census-ruling-region-ha-p1b3b-t;basis=Wrap local delivery in WithDuty so lease loss returns a deferred control result before timer bookkeeping. Add whole-route arguments; no remote forwarding. registry:Host@539,registry:Host@821,registry:Socket@185,registry:Socket@2615,registry:Socket@861,whole:Route@1741,whole:Route@1865,whole:Route@1941,whole:Route@2014,whole:Route@759 afd339dd7acde53dc86f0f55c0a83fa41845bb23825b94ac7fb11ace3330b648
internal/activator/activator.go Service.begin legacy accepted-legacy accepted-legacy;rev3=census-ruling-carlos-run;basis=Re-digested at the pre-land merge: the body includes main's own change under census ruling 292, with no further change from this branch. the agent (/opt/carlos/carlos agent, carlos-edge.service, user carlos): main's body; the stop now carries its reason for a run it interrupts (beginStopLocked's why argument); read sites unchanged, offsets moved;rev3=census-ruling-edge-request-records;basis=gains a req *http.Request parameter and one edge.MarkWoke(req) call on the path that starts a wake, so the edge's request record can say which request woke the app; no read added;rev3=census-ruling-remote-instance-metrics;basis=the entries-map insertion goes through putEntryLocked (which also notes the route's tenant in memory for the metrics sampler); no read added;rev3=census-ruling-rootfs-apps-3;basis=rootfs Plan 3 Tasks 7 and 8: before an entry is made, a resident inside its backoff answers errResidentBackoff, and a rootfs row must pass the locked admission (rootfsRefusalLocked) and then the backend's rootfs gates off a.mu (rootfsStartRefusal, within the request's wait bound) before Acquire, Restore or the live link; the gate key is recorded on the entry; adds refusals before the lease only;rev3=census-ruling-stateless-replicas-1;basis=Task 3a: Read serving lease health through servingError: stateless generations use local lifecycle/process supervision, while stateful generations keep the existing lease checks. No new I/O.;rev3=census-ruling-region-ha-p1b3b-t;basis=Carry background-duty provenance into a new singleflight entry; a visitor waiting on its deferred refusal retries with ordinary visitor authority. No read added. registry:Host@1146,registry:Host@1457,registry:Host@3513,registry:Host@3670,registry:Host@562,whole:Route@2011,whole:Route@2098,whole:Route@2179,whole:Route@2440,whole:Route@2550,whole:Route@2724,whole:Route@3522,whole:Route@3529 6dfb9ff708ed5fc62b5184ff03fb2df8e1e9fe5d84244b4c9979f3c27f3d7168
internal/activator/activator.go Service.sweepOnce legacy accepted-legacy accepted-legacy;rev3=PROPOSED-seed;basis=census-ruling-FS-R6; registry remains legacy; PROPOSED-plans-2-box-limits: the sweep also narrows an entry's idle window to its account's plan idle through the SetIdleFor hook (never lengthens it; always-on workers and held probe entries are untouched; the hibernate, inflight and held-for-tick guards are unchanged).;rev3=census-ruling-plans-4c-box-throttle;basis=after the worker max_run branch, stops a non-worker entry past the plans continuous-awake ceiling (maxRunFor, passed the row), busy or not, never mid-command (plans 4c). One more whole-row read: the row handed to the hook, as idleFor already is. This bypasses the inflight and held-for-tick protections the idle stop keeps, on purpose: escalated by Astra and ACCEPTED by Paul (census owner), 2026-10-25.;rev3=census-ruling-plans-4d-lapse;basis=stops a live entry the turned-off hook names (never mid-command, never a move's active probe), stands down an exited worker it names instead of restarting it (Astra finding 4), and skips such rows in the due loop and the always-on arm so they are not woken (plans 4d). Four more whole-row reads: the row handed to the hook (a.disabled), as idleFor and maxRunFor already are. Only stops or skips.;rev3=census-ruling-remote-instance-metrics;basis=its two entries-map insertions go through putEntryLocked (which also notes the route's tenant in memory for the metrics sampler); no read added;rev3=census-ruling-region-ha-p1a;basis=the agent as carlos: one more call at the top, a.retryOwedMarkers() (harelease.go), which starts at most one background lease.RetryPending pass over owed region HA release markers, off a.mu; the due query, idle, max-run and lapse logic are unchanged; the same 38 sites, no read added; merge of origin/main d7ae1d76: main's change is kept as main has it (census-ruling-remote-instance-metrics: its two entries-map insertions go through putEntryLocked); this branch's change is the same as above; read sites the same 38, offsets moved;rev3=census-ruling-rootfs-apps-3;basis=rootfs Plan 3 Task 8: a resident (Route.Resident) is never stopped for idleness or by the continuous-awake ceiling; the due-wake check is left on Hibernate (comment); stops less, not more;rev3=census-ruling-rootfs-apps-3-release;basis=rootfs Plan 3 Group R: an entry whose host has a release record open (the in-memory a.releaseOps[e.host]) is not stopped by its plan's turn-off, by idleness or by the continuous-awake ceiling until the record goes; one more sweep pass, reapReleaseOpsLocked, retries an unproven release's stop (through finishPendingStops); the same 39 read sites, no read added; stops less, not more;rev3=census-ruling-rootfs-apps-6;basis=rootfs Plan 6 Task 9 (PF-18): the four checks that left an entry with a run attached alone (e.cmd == nil) now read holdsAttachedLocked(e), a run or a session attached, so a session holds the idle sleep, the plans awake ceiling, the plans turned-off stop and the turned-off worker's stand-down as a run does; in-memory under a.mu; only keeps an entry awake longer; no read added, read sites unchanged;rev3=census-ruling-stateless-replicas-1;basis=Task 3a: Read serving lease health through servingError: stateless generations use local lifecycle/process supervision, while stateful generations keep the existing lease checks. No new I/O.;rev3=census-ruling-region-ha-p1b3b-t;basis=Tag due entries as background duties; the wake evaluates the gate off a.mu before acquire or token preparation. No read added. registry:Hibernate@10805,registry:Hibernate@14563,registry:Hibernate@23821,registry:Hibernate@5680,registry:Hibernate@7879,registry:Host@23890,registry:Host@23948,registry:Host@24415,registry:Host@24508,registry:Host@25260,registry:Host@25361,registry:Host@26425,registry:Host@26712,registry:Host@26768,registry:NextDue@25198,registry:Status@23837,whole:Route@10807,whole:Route@11666,whole:Route@14565,whole:Route@16498,whole:Route@18208,whole:Route@18398,whole:Route@18691,whole:Route@18863,whole:Route@19010,whole:Route@23221,whole:Route@23997,whole:Route@24912,whole:Route@25269,whole:Route@25276,whole:Route@26240,whole:Route@26541,whole:Route@26745,whole:Route@5491,whole:Route@5682,whole:Route@7712,whole:Route@7881,whole:Route@8074,whole:Route@8537 bb62b361b6dff7e47fa68665994a5b73860a499107a67c32af002c608bc936fd
@@ -134,6 +135,7 @@ internal/activator/haduties.go Service.restrictDuty legacy accepted-legacy accep
internal/activator/haduties.go Service.saveDuty legacy accepted-legacy accepted-legacy;rev3=census-ruling-region-ha-p1b3b-t;basis=DutyState is now an alias of registry.DutyState, so existing revision and state reads enter the registry census. Save behavior and CAS remain advisory. registry:Revision@185,registry:Revision@454,registry:Revision@487,registry:Revision@531,registry:Revision@547,whole:DutyState@199,whole:DutyState@359,whole:DutyState@386,whole:DutyState@463,whole:DutyState@574,whole:DutyState@588 6e3777127af58cf8987bf71aa05d53f8ef97ca228668b4e1994312e7c70bf47f
internal/activator/haduties.go dutyBackend legacy accepted-legacy accepted-legacy;rev3=census-ruling-region-ha-p1b3b-t;basis=Dispatch the existing backend by local route through SplitBackend, for HA classification and self identity. No new I/O. whole:Route@235,whole:Route@240 835097870b1a956888da998aee935491325c48d7847d7bc5ba650a23306e2db2
internal/activator/haduties.go dutyRefusal legacy accepted-legacy accepted-legacy;rev3=census-ruling-region-ha-p1b3b-t;basis=DutyState alias makes the existing holder and deadline reads visible to the registry census; refusal behavior unchanged. registry:HolderIID@306,registry:HolderRef@223,registry:HolderRef@245,registry:HolderRef@276,registry:NotBefore@167 7d8646a06d8d37ce9e8c736b1fb1e59b8046ba245e1957e0301791fd9032910d
+internal/activator/hatakeover.go ExecBackend.reportTakeover legacy accepted-legacy accepted-legacy;rev3=census-ruling-region-ha-p1b3b-t;basis=Final fix P2-1: report all refused proof results through the per-host alarm and distinguish visitor from departure-finalize. No reads or authority. registry:Host@317,registry:Host@481,registry:Host@633 89018a2869f5db2a6b14fcd38c6457e0de548ca447b581ddd615f4653df5b449
internal/activator/hawake.go ExecBackend.TerminationLifetime legacy accepted-legacy accepted-legacy;rev3=census-ruling-region-ha-p1b3b-t;basis=B3 fix r1: Read the host route from the existing registry and reuse isHA record/lifetime-index classification. Missing, legacy or lifetime-free hosts refuse. Inventory completeness is not takeover authority. whole:Route@242,whole:Route@329 4f9acf54553193732df400d99d23291f3be27cd09007ca3980075d3da05535b4
internal/edge/wakeplacement.go Edge.DutySnapshot legacy accepted-legacy accepted-legacy;rev3=census-ruling-region-ha-p1b3b-t;basis=Pass the route to the existing cached home projection; no store reads, network reads or new publication. whole:Route@108 fa66b0bb586cb9a3214d818fbe40181f3ca7d5655f5af4ac259377cf4d5c133d
internal/host/hadeparture_identity.go departureIdentities.Observe legacy accepted-legacy accepted-legacy;rev3=census-ruling-region-ha-p1b3b-t;basis=B3b: read immutable box bytes and local verified bindings; require AWS signature plus independent fixed/group binding, unique ref/iid, exact digest and known scope. Unknown walks persist one 1000-key page and at most 32 new GETs per turn; errors never prove absence. B3 fix r1: Open the existing deployment store lazily; same immutable record verification and independently bound iid. No new record path. B4 fix r2: Reload the exact signed box record when independent fixed configuration changes the expected iid. Verify configured account/region and persist the new incarnation without changing historical observations. Warm unchanged identities add no S3 reads. B4 fix r3: A failed configured replacement retains and refreshes only the current verified incarnation observation. Share exact-key reload refusals with the event walk; cached bindings still pass signature/digest checks and the new configured iid gains nothing until verification succeeds. B4 fix r4/P18: On refused fixed-ref replacement, resolve and return the stored verified incarnation observation without saving the incoming edges ETag or scope. No new remote read or authority. registry:Account@1330,registry:Digest@1240,registry:Digest@1362,registry:IID@1195,registry:IID@1307,registry:IID@558,registry:IID@711,registry:Observation@1372,registry:Raw@1111,registry:Ref@1136,registry:Ref@704,whole:HABoxIdentity@1432,whole:HABoxIdentity@641,whole:HABoxIdentity@645,whole:HABoxIdentity@906 5941fee3b26d60191dcb028ac63ac9a2b48b2ba3a6834262a4d3783e6517ef3b
@@ -201,26 +203,26 @@ internal/registry/timers.go Registry.AdvanceDutyTimer legacy accepted-legacy acc
internal/schedule/runner.go OldDutyTick legacy accepted-legacy accepted-legacy;rev3=census-ruling-region-ha-p1b3b-t;basis=Read timer kind and natural due occurrence; only recurring occurrences at least 15 minutes old qualify. No writes. registry:Kind@82,whole:Timer@71 b7f99aa2e76858e06675d9aa6b9266600423714cfd7585860eeed12021eaa0f0
internal/schedule/runner.go Runner.fireOwned legacy accepted-legacy accepted-legacy;rev3=census-ruling-region-ha-p1b3b-t;basis=Existing fire body moved beneath admission; deferred delivery now returns without recording a failure. Same token preparation, parsing, guarded row checks and delivery authority. registry:Host@248,registry:Host@390,registry:Host@696,registry:Host@842,registry:Name@257,registry:Name@399,registry:Spec@153,registry:Spec@265,whole:Route@1010,whole:Route@1207,whole:Route@1509,whole:Route@1572,whole:Route@1776,whole:Route@667,whole:Route@747,whole:Route@773,whole:Route@884,whole:Timer@1014,whole:Timer@113,whole:Timer@1211,whole:Timer@1311,whole:Timer@1513,whole:Timer@1780,whole:Timer@322,whole:Timer@888 6cfedad07127980fe70c6206ec8e2f994c2b6ffc2017b60ddaaeba4faeb0e25f
internal/termfence/termination_proof.go readTerminationProof legacy accepted-legacy accepted-legacy;rev3=census-ruling-region-ha-p1b3b-t;basis=Read at most 2049 bytes from the existing regional data-bucket S3 client at a key derived solely from independently bound, signature-verified immutable box identity. Reject bodies over 2048 bytes, duplicate/missing/unknown fields, invalid provenance and identity mismatch. Only acquire consumes validated proof as authority after expiry and current owner/lifetime checks. No filesystem path or tenant prefix is read. file:ReadAll@753 3cae6540aba3e76210c4bf5e57a6f6b2c5160a0be8a531c74b823438c085e060
+internal/activator/hatakeover.go ExecBackend.ownerTerminated legacy accepted-legacy accepted-legacy;rev3=census-ruling-region-ha-p1b1;basis=new (region HA P1b-1): returns nil without eb.OwnerTerminated; else a closure calling it with the lock owner's instance id (from the HA lock, written by a box agent) and logging rt.Host on a takeover and, at most once a minute per host, on an error; the id goes only to EC2 DescribeInstances in this box's own account and region and is checked against the reply (termfence.SameAccountTerminated); root never calls it;rev3=census-ruling-region-ha-p1b3b-t;basis=Read route Host for structured departure-finalize telemetry; retain the same confirmation callback and visitor alarm behavior. Final fix P2-1: report the live confirmer result through the shared telemetry helper. No added reads. whole:Route@266 be2e65e8c9fc0505e3228f82991e99a03fccadf559a7b5bc07aef8d8b1343ea6
internal/host/runs.go runsWorker.pickup legacy accepted-legacy accepted-legacy;rev3=census-ruling-self-serve-moves-1;basis=the agent (/opt/carlos/carlos agent, carlos-edge.service, user carlos), its runs worker: a picked run's detached execution runs under provision.WithLifetimes of the worker's judge, so execute's record writes refuse a stale record; read sites unchanged, offsets moved;rev3=census-ruling-rootfs-apps-6;basis=rootfs Plan 6 Task 16 (ruling R7): on a fleet box a run already let go is skipped before any read; the pickup CAS moves behind the run's sink (sinkFor: the bucket's, as before, or on a fleet box the run door relay once a grant verifies); one more whole-Route site, the row this box already owns passed to sinkFor; nothing new opened, run or followed;rev3=census-ruling-region-ha-p1b3b-t;basis=Wrap both bucket and relay pickup in the service duty gate; refuse an HA route when no gate exists. Reads HA and passes the route; existing pickup moved to pickupOwned. registry:HA@343,whole:Route@244,whole:Route@308,whole:Route@388 42cb4d25952fb42237296d5050bd2e21b7ecc6ff5bdb1ebae1a13d26efe648bf
internal/hostfiles/wake.go ImportWake legacy accepted-legacy accepted-legacy;rev3=J1,J2,J4;basis=root-route;rev3=census-ruling-region-ha-p1b3b-t;basis=Delegate validated conversion to one atomic ReplaceHAWake transaction instead of three independent writes; no lease or file effect. B2 fix r1: ordinary acquired-lease restore converts legacy wire rows without adoption-only timer grammar restrictions. Version, host and replication remain checked before the atomic exact replacement. whole:HAWakeImport@200 b3d3c13dc1a985b2e4c333b29658a129e808dc3cc2b1321a7acddec9d01cf7e0
internal/registry/remote_dispatch.go Registry.dispatchRemote hint E2 rev3=census-ruling-self-serve-moves-1;basis=the registry child (carlos __registry-child, the service user a root pass forks): plan14-root-reads-e's mixed declaration (E2 adds only the ArtifactHosts read; every other arm is the local method of the same name), with three more write arms, SetHoldIfSeq, ReleaseHoldSeq and InstallLifetimeIf, each calling the local setter; no read operation added; self-serve moves 1 Task 7;rev3=census-ruling-instance-egress-sizes-328-329;identity=the registry child (carlos __registry-child, the service user a root pass forks);basis=#328/#329 plan 1 Task 4: one more write arm, SetPolicy, calling the local Registry.SetPolicy with the request's Host, EgressAllow, Size and PolicyExpiresAt (remoteRequest fields sent by the remote handle's holder); the new kinds registry:EgressAllow, registry:Size and registry:PolicyExpiresAt, one site each, plus one more registry:Host site, all of the request; no read operation added; the read-only worker never reaches it (serveRemote's method gate); no production root pass sends SetPolicy;rev3=census-ruling-region-ha-p1a;basis=the registry child (carlos __registry-child, the service user a root pass forks): one more write arm, SetHA, calling the local Registry.SetHA with the request's Host (+registry:Host); no read operation added; only the provision pass sends it;rev3=census-ruling-rootfs-apps-3;basis=rootfs Plan 3 Tasks 2 and 8: two new remote methods, UpsertUnlessRootfs (carlos add's guarded write) and ResidentInstances (the residency sweep's list), each calling the same-named Registry method;rev3=census-ruling-regional-domains-447;basis=#447 Task 4: two more methods on the existing remote registry transport, ListRegional and ReplaceRegionalSet (request field RDs, response field Regional), each calling the local method of the same name, which validates its own input; no new kind of read;rev3=census-ruling-fleet-secrets-key;basis=one new case, SetFleetSecretsKey, reading the request's Name, Pub, KeyFP, By and At fields and calling SetFleetSecretsKey;rev3=census-ruling-fleet-public-routes;basis=fleet public routes (spec 2026-10-29 rev 4, §4.2 writer rule): Tasks 1-2: three new cases (SetFleetBoxIf reads the request's Fleet and answers Changed; PutForward reads TValue, a whole Route; DeleteForward reads Host and answers Changed); SetFleetBox gone (+registry:Changed x2, +registry:Fleet, +registry:Host, +registry:TValue, +whole:Route). Each case calls the local writer with its own guards.;rev3=census-ruling-managed-fleets-1b;basis=managed fleets 1b (Tasks 2 and 6b): three more remote methods dispatched to their local forms, SetFleetBoxDraining (q.Fleet, q.Label, q.At, answering Number64), MarkFleetBoxLabelled (q.Fleet, q.Label, q.At) and SetFleetAssignment (q.Host, q.Assigned, q.Moved); remoteRequest gains Assigned and Moved. The registry child, not root.;rev3=census-ruling-stateless-replicas-1;basis=Task 3a: Add SetServingMode dispatch using the existing remote request Host, Ver and On fields; the same local narrow writer handles it. No new transport or root path. Task 4 R24: dispatch SeedStateless with the existing Observed Route and On carriers to its symmetric guarded local method. No new transport; the existing read-only service gate still refuses writes.;rev3=census-ruling-region-ha-p1b3b-t;basis=Dispatch typed duty, import, exact replacement and guarded receipt operations through the existing service-user registry transport, preserving comparisons and errors. B2 fix r1: dispatch AdvanceHADuty through the existing service-user registry channel and error mapping, reading the request Host only. Read-only method allowlist remains unchanged. B3b: transport bounded typed local journal requests and results over the existing authenticated registry channel; no arbitrary SQL or disk path. registry:A@8518,registry:Account@5280,registry:Accounts@3942,registry:Addr@5857,registry:Addrs@5865,registry:Adoption@1013,registry:Adoption@818,registry:Alias@8566,registry:Alias@8630,registry:Alias@8718,registry:Aliases@8440,registry:Alive@10393,registry:Args@8142,registry:AssetGen@6007,registry:AssetsOff@5994,registry:Assigned@6485,registry:At@10141,registry:At@3096,registry:At@3485,registry:At@3570,registry:At@7379,registry:At@8649,registry:At@8727,registry:Attempts@10163,registry:B@3145,registry:Backing@5676,registry:BuildState@6244,registry:By@3090,registry:Changed@10073,registry:Changed@2860,registry:Changed@322,registry:Changed@4365,registry:Changed@4452,registry:Changed@4541,registry:Changed@4612,registry:Changed@464,registry:Changed@4716,registry:Changed@4803,registry:Changed@4896,registry:Changed@4978,registry:Changed@564,registry:Changed@6832,registry:Changed@6969,registry:Changed@832,registry:Changed@929,registry:Channel@5340,registry:Channel@6675,registry:Channel@7224,registry:CheckedAt@7305,registry:Class@5795,registry:DoneBefore@10402,registry:Due@10185,registry:Due@7843,registry:Due@7907,registry:Duty@312,registry:Duty@390,registry:Duty@634,registry:EgressAllow@6147,registry:Env@6743,registry:Env@7135,registry:Env@7235,registry:ExcludeHosts@9868,registry:ExcludeHosts@9963,registry:ExpectGood@7504,registry:ExpectOp@4420,registry:ExpectOp@4670,registry:ExpectPair@4850,registry:Expected@1001,registry:Expected@1153,registry:Expected@1626,registry:Expected@1803,registry:Expected@2114,registry:F@2832,registry:F@2893,registry:Fleet@2918,registry:Fleet@3203,registry:Fleet@3285,registry:Fleet@3366,registry:Fleet@3467,registry:Fleet@3552,registry:Fleet@3641,registry:Fleet@6875,registry:FleetBoxes@3602,registry:Fleets@2976,registry:From@5451,registry:From@5512,registry:FromDB@5587,registry:FromOp@4508,registry:FromSock@5597,registry:HAJournal@183,registry:HAJournal@221,registry:Hash@6549,registry:Health@5874,registry:Host@10024,registry:Host@10109,registry:Host@10241,registry:Host@10322,registry:Host@10485,registry:Host@1136,registry:Host@1888,registry:Host@1999,registry:Host@286,registry:Host@350,registry:Host@4126,registry:Host@4167,registry:Host@422,registry:Host@4320,registry:Host@4396,registry:Host@4482,registry:Host@4574,registry:Host@4646,registry:Host@4752,registry:Host@4842,registry:Host@4930,registry:Host@501,registry:Host@5022,registry:Host@5272,registry:Host@5332,registry:Host@5390,registry:Host@5443,registry:Host@5504,registry:Host@5579,registry:Host@5668,registry:Host@5722,registry:Host@5787,registry:Host@5849,registry:Host@5927,registry:Host@5986,registry:Host@602,registry:Host@6074,registry:Host@6139,registry:Host@6236,registry:Host@6301,registry:Host@6362,registry:Host@6412,registry:Host@6477,registry:Host@6541,registry:Host@6602,registry:Host@6735,registry:Host@6789,registry:Host@6867,registry:Host@694,registry:Host@7004,registry:Host@7057,registry:Host@7287,registry:Host@7371,registry:Host@7428,registry:Host@7496,registry:Host@7644,registry:Host@772,registry:Host@7720,registry:Host@7780,registry:Host@7835,registry:Host@7899,registry:Host@8083,registry:Host@8134,registry:Host@8201,registry:Host@8276,registry:Host@8339,registry:Host@869,registry:Host@8936,registry:Host@9062,registry:Host@9216,registry:Host@9504,registry:Host@9568,registry:Host@9627,registry:Host@9710,registry:Host@973,registry:Host@9793,registry:Hosts@1051,registry:Hosts@4005,registry:Hosts@6666,registry:Hosts@7126,registry:Hosts@7215,registry:Id@2108,registry:Id@2419,registry:Id@2518,registry:Id@2598,registry:Id@2749,registry:IdValue@3761,registry:Idle@8209,registry:Import@734,registry:Journal@1306,registry:Journal@2126,registry:Journal@2425,registry:Journal@2604,registry:Keep@10501,registry:KeyFP@3081,registry:Kind@10330,registry:Kind@10493,registry:Label@3212,registry:Label@3294,registry:Label@3375,registry:Label@3476,registry:Label@3561,registry:Label@6884,registry:Lifetime@358,registry:Lifetime@430,registry:Lifetime@517,registry:Lifetime@610,registry:Lifetime@877,registry:Limit@9859,registry:Limit@9954,registry:MaxRun@8217,registry:Method@151,registry:Moved@6497,registry:Ms@10157,registry:Name@10032,registry:Name@10117,registry:Name@10249,registry:Name@1896,registry:Name@2007,registry:Name@2946,registry:Name@3066,registry:Name@3780,registry:Name@9576,registry:Name@9635,registry:Name@9718,registry:Next@1165,registry:NextAt@10175,registry:NextGood@7518,registry:NextValue@2678,registry:NextValue@2776,registry:Now@10040,registry:Now@2031,registry:Now@8410,registry:Now@9852,registry:Now@9947,registry:Number64@3425,registry:Number64@3868,registry:Number@10290,registry:Number@10361,registry:Number@10446,registry:Observed@1229,registry:Observed@7577,registry:ObservedValue@1507,registry:Old@2671,registry:Old@2769,registry:On@7589,registry:On@7659,registry:On@7788,registry:On@8284,registry:On@8347,registry:Op@4338,registry:Op@4414,registry:Op@4582,registry:Op@4664,registry:Op@4760,registry:Op@4938,registry:Op@5030,registry:Owner@1144,registry:Owner@1241,registry:Owner@1524,registry:P@9170,registry:Pair@4682,registry:Pair@4766,registry:Pair@4864,registry:Pair@509,registry:Pair@780,registry:Pair@981,registry:Path@9401,registry:Paths@9098,registry:PolicyExpiresAt@6170,registry:Prefix@9224,registry:Prev@7443,registry:Pub@3074,registry:RDs@9070,registry:RateLimit@6610,registry:Receipt@889,registry:Regional@8968,registry:Registration@10125,registry:Registration@1904,registry:Registration@2015,registry:Registration@9726,registry:Replica@6370,registry:Replicas@6309,registry:Retirement@2755,registry:Revision@529,registry:Revision@622,registry:Revision@989,registry:Route@4103,registry:Routes@4061,registry:Routes@5056,registry:Routes@7941,registry:Routes@8008,registry:Routes@8377,registry:Rows@9512,registry:Seed@8091,registry:Size@6162,registry:Sqid@3772,registry:Sqid@3835,registry:Sqid@3914,registry:Status@10147,registry:Status@10257,registry:Status@1920,registry:Status@3384,registry:Status@4328,registry:Status@4404,registry:Status@4490,registry:Status@4654,registry:Status@5398,registry:Status@7295,registry:Status@8639,registry:Steering@5935,registry:StringMap@3678,registry:T@1621,registry:T@1715,registry:T@1798,registry:T@9452,registry:TValue@4208,registry:TValue@4275,registry:TValue@6934,registry:Tags@3303,registry:Target@7065,registry:Targets@1317,registry:Text@2324,registry:Text@2471,registry:Text@3882,registry:Text@9257,registry:Text@9320,registry:Timer@1573,registry:Timer@1755,registry:Timer@9540,registry:Timers@9763,registry:Timers@9822,registry:Timers@9911,registry:Times@10535,registry:To@5459,registry:To@5520,registry:ToDB@5609,registry:ToOp@4500,registry:ToSock@5617,registry:TokenHash@3221,registry:Tunnel@6797,registry:Unit@5730,registry:UpdateSettings@6082,registry:Ver@7436,registry:Ver@7652,registry:Ver@7728,registry:W@8870,registry:Wake@702,registry:Wake@788,registry:Wildcards@8764,whole:Account@3946,whole:ClaimOwnership@1146,whole:ClaimOwnership@1243,whole:ClaimOwnership@1526,whole:ClaimRow@1319,whole:ClaimRowArchive@1425,whole:ClaimRowArchive@1435,whole:ColdRows@2673,whole:ColdRows@2680,whole:ColdRows@2771,whole:ColdRows@2778,whole:DutyState@316,whole:DutyState@394,whole:DutyState@636,whole:Fleet@2834,whole:Fleet@2895,whole:Fleet@2922,whole:Fleet@2980,whole:FleetBox@3147,whole:FleetBox@3606,whole:GoodBuild@7506,whole:GoodBuild@7520,whole:HAAdoption@1015,whole:HAAdoption@822,whole:HAWakeImport@704,whole:HAWakeImport@790,whole:Pair@4684,whole:Pair@4768,whole:Pair@4852,whole:Pair@4866,whole:Pair@511,whole:Pair@782,whole:Pair@983,whole:RegionalDomain@8972,whole:RegionalDomain@9072,whole:Route@1231,whole:Route@4065,whole:Route@4107,whole:Route@4210,whole:Route@4277,whole:Route@5060,whole:Route@5215,whole:Route@5221,whole:Route@6936,whole:Route@7579,whole:Route@7945,whole:Route@8012,whole:Route@8381,whole:RouteAlias@8444,whole:RouteAlias@8520,whole:RoutePath@9102,whole:RoutePath@9172,whole:Timer@1509,whole:Timer@1577,whole:Timer@1623,whole:Timer@1717,whole:Timer@1759,whole:Timer@1800,whole:Timer@9454,whole:Timer@9514,whole:Timer@9544,whole:Timer@9767,whole:Timer@9826,whole:Timer@9915,whole:WildcardDomain@8768,whole:WildcardDomain@8872,whole:haJournalRequest@223,whole:haJournalResponse@187 f2f59c16991d22179f27168680491ee00e531b699c6948f671aa4f3350acbd08
internal/activator/activator.go Service.ServeScheduled legacy accepted-legacy accepted-legacy;rev3=J1;basis=root-route;rev3=census-ruling-plans-4d-lapse;basis=answers a scheduled request to a route the turned-off hook names with the maintenance response before serve (plans 4d). One more whole-row read: the row handed to the hook (a.disabled), as the fence and maxRunFor are asked.;rev3=census-ruling-region-ha-p1a;basis=the agent as carlos: wraps the proxy so that, after the wake, fillScheduledToken(r, rt) sets an HA host's tick bearer token from its restored env file; an error there logs (+registry:Host, rt.Host) and answers 503 with Retry-After: 5; a non-HA host's tick is left as the runner built it; +whole:Route is rt handed to fillScheduledToken; keeps legacy;rev3=census-ruling-rootfs-apps-3;basis=rootfs Plan 3 Task 5: the activator-managed test is Route.ActivatorOwned (a hibernating instance, or an instance with a runtime) instead of Kind and Hibernate inline; reads the same fields plus Runtime through the method;rev3=census-ruling-region-ha-p1b3b-t;basis=Run the local scheduled request under WithDuty and retain existing HTTP refusal text; add route arguments to background admission and error handling. No forwarding. registry:Host@669,registry:Status@146,registry:Status@165,whole:Route@1143,whole:Route@248,whole:Route@600,whole:Route@883,whole:Route@964 41bcecc8605bfc52536690da309860ffc7464646dd4e2dbf577fc2bd287c9061
internal/activator/activator.go Service.wake legacy accepted-legacy accepted-legacy;rev3=census-ruling-carlos-run;basis=Re-digested at the pre-land merge: the body includes main's own change under census ruling 292, with no further change from this branch. the agent (/opt/carlos/carlos agent, carlos-edge.service, user carlos): main's body; the stop now carries its reason for a run it interrupts (beginStopLocked's why argument); read sites unchanged, offsets moved;rev3=census-ruling-wake-latency-1;identity=the agent (/opt/carlos/carlos agent, carlos-edge.service, user carlos);basis=logs that timer's breakdown to the journal after a successful wake (w.steps.String(), e.host, w.wakeTook); no read added;rev3=census-ruling-plans-4d-lapse;basis=cancels a wake whose row the turned-off hook names, like a fence, unless it is a move's active probe (plans 4d). One more whole-row read: the row handed to the hook (a.disabled). Only refuses.;rev3=census-ruling-rootfs-apps-3;basis=rootfs Plan 3 Tasks 7 and 8: a refusal before the lease is reported once per change (noteRootfsRefusal) instead of a wake-failure event; the proc, generation and replica are installed through installProcLocked (which puts a resident under its lease watch before the fence); residency notes the outcome (noteResidentWakeLocked); same generation values;rev3=census-ruling-rootfs-apps-3-release;basis=rootfs Plan 3 Group R [pf R3.5]: the wake's context ceiling is wakeCeilingFor(e.route): the old 5 minutes for a binary row, 5 minutes plus runs.MaxTimeout for a rootfs row (room for a release inside the wake); new site +whole:Route (e.route to wakeCeilingFor, which reads Runtime only); no other change;rev3=census-ruling-managed-fleets-1b;basis=managed fleets 1b (branch review R1 P1-1): the wake's context is also cancelled before doWake when RetireExcept has marked the entry retired (e.retired, in memory under a.mu), as it is for a fence or a shutdown. Read sites unchanged (13). Agent, not root; it only refuses more.;rev3=census-ruling-stateless-replicas-1;basis=Task 3a: Carry successful hold preparation into its wake, preserve actual mode in the generation and OnWake projection, and project serving version/mode through the narrow registry writer before releasing wake waiters. Final review I1: SetServingMode only for non-worker successful wakes with a nonempty spawned version and either a stateless generation or a mode transition from the route. Ordinary stateful wakes leave rollout status and the wake critical path unchanged.;rev3=census-ruling-edge-held-streams;basis=the agent (/opt/carlos/carlos agent, carlos-edge.service, user carlos): adds a.cancelHeldLegsLocked(e, 0) on the failed-wake path before the entry is deleted, and after close(e.ready) on success calls a.noteHeldAdmissible(e.host), the non-blocking held wake callback, outside a.mu. No read added.;rev3=census-ruling-wake-storm-cap;basis=the agent (/opt/carlos/carlos agent, carlos-edge.service, user carlos): waits for a box-wide wake slot (acquireWakeSlot, an in-memory buffered channel) before doWake; the fence/shutdown/retired/disabled refusals move into refuseWakeLocked and are asked again after admission (one fewer direct whole-Route read here: a.disabled(e.route) now runs inside refuseWakeLocked, same value); e.wakeStart is set at admission and e.admitted marks it. Only waits and refuses more; no new read.;rev3=census-ruling-region-ha-p1b3b-t;basis=Install the successful-acquire observer and restrict due, worker and resident starts before doWake, off a.mu. Add a whole-route argument to restriction; refused work has known-no-start evidence. registry:Socket@8514,registry:Socket@8675,registry:Stateless@10009,registry:Stateless@10757,whole:Route@10000,whole:Route@10055,whole:Route@10759,whole:Route@1713,whole:Route@3228,whole:Route@3355,whole:Route@3412,whole:Route@417,whole:Route@6762,whole:Route@8467,whole:Route@8516,whole:Route@8677 993666cc32a33e4fc4a87400d1b14124d538a839ed3323af08adafae5cbdee85
internal/activator/harelease.go Service.releaseHAClean legacy accepted-legacy accepted-legacy;rev3=census-ruling-region-ha-p1a;basis=new: an HA entry's release, in order: host slice read empty through haHostEmpty (else errHostSliceUnproven and nothing written; the same check, moved into that helper by final fix F1), stop and join the files publisher, its final publish (2 min budget), the replica's final sync (Finish, 30 s), the local release record, then the release marker PUT (10 s), clean only when the final publish was complete and the sync and record succeeded; a failed PUT is a persisted lease obligation; +registry:Host, +whole:Route x4;rev3=census-ruling-region-ha-p1b3b-t;basis=Record advisory local-release basis only after ReleaseMarker succeeds. Add a whole-route argument to local duty bookkeeping; release order and lease authority unchanged. registry:Host@1825,whole:Route@102,whole:Route@1098,whole:Route@1236,whole:Route@1734,whole:Route@244 1d28991be7fe53f505751cde1f9822ffee9598d2eea3834eda94f42406315236
-internal/activator/hatakeover.go ExecBackend.ownerTerminated legacy accepted-legacy accepted-legacy;rev3=census-ruling-region-ha-p1b1;basis=new (region HA P1b-1): returns nil without eb.OwnerTerminated; else a closure calling it with the lock owner's instance id (from the HA lock, written by a box agent) and logging rt.Host on a takeover and, at most once a minute per host, on an error; the id goes only to EC2 DescribeInstances in this box's own account and region and is checked against the reply (termfence.SameAccountTerminated); root never calls it;rev3=census-ruling-region-ha-p1b3b-t;basis=Read route Host for structured departure-finalize telemetry; retain the same confirmation callback and visitor alarm behavior. registry:Host@378,registry:Host@472,registry:Host@638 7082fa0f1b04d12676d4e0abf5d7bafaf4041fa3910e89c230ff4eba1949d785
-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. registry:Host@106,whole:Route@1137,whole:Route@1429,whole:Route@1474,whole:Route@195,whole:Route@2071,whole:Route@2167,whole:Route@533,whole:Route@584,whole:Route@834 502bfdec82020c6baa0d1d61913692a821176577b552728b7c3b0850cae894fe
+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. registry:Host@106,whole:Route@1137,whole:Route@1369,whole:Route@1414,whole:Route@1569,whole:Route@195,whole:Route@2370,whole:Route@2466,whole:Route@533,whole:Route@584,whole:Route@834 042d8a6a5359107f22f473b3fe03388ea0d4d077c9d4b3dddaa7b73e9b5f2f20
internal/host/schedule_wiring.go activatorDeliverer.deliverSelected legacy accepted-legacy accepted-legacy;rev3=J1;basis=root-route;rev3=census-ruling-region-ha-p1b3b-t;basis=Wrap local delivery in WithDuty so lease loss returns a deferred control result before timer bookkeeping. Add whole-route arguments; no remote forwarding. registry:Host@539,registry:Host@821,registry:Socket@185,registry:Socket@2615,registry:Socket@861,whole:Route@1741,whole:Route@1865,whole:Route@1941,whole:Route@2014,whole:Route@759 afd339dd7acde53dc86f0f55c0a83fa41845bb23825b94ac7fb11ace3330b648
internal/schedule/runner.go Runner.fire hint E2 accepted-legacy;rev3=census-ruling-moves-offline-fixes;basis=root-route (main: J1) PROPOSED E46: captured claim selection and root journal mutation; root RPC outside service host exclusion; SQL/route data never grants root authority. Executing identity: service controller; root for inventory/retirement callbacks. moves-offline-fixes: with Skip set (only the agent's runner sets it, scheduleSkip), the row is read again before the token and a skipped host gets no token and no record; class and task unchanged;rev3=census-ruling-region-ha-p1b3b-t;basis=Call WithDuty before token preparation; record non-deferred pre-delivery wake errors through the existing retry and event policy after timerStillDue. Adds spec and whole timer/route reads for record. Advance only known non-owner recurring occurrences through the existing registration/DueAt guard; no second outcome after callback execution. registry:Spec@410,registry:Spec@626,whole:Route@125,whole:Route@200,whole:Route@269,whole:Route@454,whole:Timer@129,whole:Timer@273,whole:Timer@374,whole:Timer@458,whole:Timer@589,whole:Timer@801 7e8eb8e42de11c2c7a6f21d02a424875f74809343673be4e0009624765d63ac2
@coverage . ad11fb4d8b0a34d0b0e4bd317d522459960e8505e94553fcdcffaa65c425f3d8
-@coverage internal/activator 8dd9e6d4ef654dd1ea77f937eb6beddff9abdfc7c6e668c37277602c0e1dcf7a
+@coverage internal/activator 10ebf6ce24d96d797c3b512e8dcf59c99d89516a9588cfa23cd8f5b16d6b9426
@coverage internal/awsterminations 61f7e5a5f85d4eed6b855f7b9f3061c72ee0c23b871745d4ab0c75fd16f7c20d
@coverage internal/boxchoice 6b3d6aaacf54a2c2705f5c93d7799e0d9790712e165c90ead6de91e845ae8b09
@coverage internal/edge 4c522d8c7a17a7508be62e248126a9f66978dd09bdb096678dacf9c9bdffb1a2
@coverage internal/hadeparture 96414c792279b1616004f4d5a3ec00b5eb9f7da3a71888c5a70f85f6649ab0e4
-@coverage internal/host 73cc968923f5d1bc3c2c41aecdb9cb0b20ef75f32105f312a9b5e0449b593d8b
+@coverage internal/host 20580ef5959f5e9d8f027669222fde35304235848453cb331f8a7519350fe2e0
@coverage internal/hostenv 73e273b78febb9102acb9baf06b441e5001b70f5c96b38fefc64bb50c6e726a7
@coverage internal/hostfiles 21a32d89c6143031af13cb18bc1a2227353ed8595ab23bde7abd1e9d2df92eaf
-@coverage internal/lease 32c154a9fffb59e3a42cf2b4bebefd40621ecabb8be054b182ff95e918fd2b8c
+@coverage internal/lease 46a3a2a7f3215d5f717bd23655bdaec7b78307f58dad0decb8a5fecbe06912f5
@coverage internal/metrics f6382028853ea94ef1f962546281cfd1d0351dd597193f73f593d70623f695d0
@coverage internal/provision ff304ed0b6c9445a18262ace1880fcbb2d536b49131a600a06257947bc2062ca
@coverage internal/registry 5848d30ac8f296017dd4eabdcbe56f519b196174dc59bd8909c7070b39e7e708