carlos / platform Public

ha: preserve duty restrictions through HA discovery

Keep background provenance when a cached legacy row discovers an HA lock, and recheck held ownership before run pickup. Update the relay fixture and freeze the B1 census proposal. Targeted and race checks, both cross-builds, and census tests pass; the full package run has baseline claims failures and a deadline timing failure documented in the task report.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Paul Campbell pushed by claude agent, operated by paul@keymail.dev e41439a6d819aa4dc2ba4e4551ae48f8935ba4e1 parent 129d3f8
10 files changed, +226 −13
  • docs/superpowers/notes/census-proposal-region-ha-p1b3b-t.md +60 −0
  • docs/superpowers/notes/census-region-ha-p1b3b-t-claims.md +28 −0
  • internal/activator/haduties.go +8 −7
  • internal/activator/haduties_test.go +30 −5
  • internal/host/haduties_wiring_test.go +16 −0
  • internal/host/runrelay_linux_test.go +1 −0
  • internal/host/runs.go +18 −0
  • internal/provision/testdata/plan14-root-reads-chain.tsv +1 −0
  • internal/provision/testdata/plan14-root-reads-region-ha-p1b3b-t.tsv +63 −0
  • internal/registry/timers.go +1 −1

CI passed — run details

Intent

Attributed to this commit: 18.2 g CO₂e (2,160,582 tokens). This is an attribution, not a measurement — usage counted from this commit's own marker forward to the next one on region-ha-p1b3b-duties, never backward from it. A turn that produced more than one commit books all of its tokens to the last one, and a concurrent session on this branch can add to the same figure. Some of it was priced using the shared default rate, because no model-specific factor row exists yet for at least one model involved. The Carbon view has the repo total, which is never derived from this attribution.

diff --git a/docs/superpowers/notes/census-proposal-region-ha-p1b3b-t.md b/docs/superpowers/notes/census-proposal-region-ha-p1b3b-t.md
new file mode 100644
index 000000000..37837b18c
--- /dev/null
+++ b/docs/superpowers/notes/census-proposal-region-ha-p1b3b-t.md
@@ -0,0 +1,60 @@
+# Census approval: region-ha-p1b3b-t
+
+Ruling `census-ruling-region-ha-p1b3b-t`. The independent reviewer approves or rejects every change below, 16 with a new disposition; nothing goes to the census owner (Paul, #280, 2026-10-26).
+
+| unit | change | read sites | what changed |
+|---|---|---|---|
+| `internal/activator/activator.go` `Service.begin` | body | unchanged (13) | Carry background-duty provenance into a new singleflight entry; a visitor waiting on its deferred refusal retries with ordinary visitor authority. No read added. |
+| `internal/activator/activator.go` `Service.sweepOnce` | body | unchanged (39) | Tag due entries as background duties; the wake evaluates the gate off a.mu before acquire or token preparation. No read added. |
+| `internal/activator/activator.go` `type Service` | body | unchanged (0) | Add the B2 DutyStore interface field and process-local duty view, suppression and invalidation state. No read added. |
+| `internal/edge/wakeplacement.go` `homeMap.wakeSnapshot` | body | unchanged (3) | 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` | body | unchanged (6) | Wire Service.SetDutyView to the live edge DutySnapshot in the ready callback. No new read; no new loop or cloud operation. |
+| `internal/host/schedule_wiring.go` `newScheduleDeps` | body | unchanged (6) | Wire Runner.WithDuty before token access through the existing Service. No new read. |
+| `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/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. |
+| `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, -registry:Spec, -whole:Route ×6, -whole:Timer ×4 | Move existing delivery body to fireOwned; call WithDuty before token preparation and conditionally advance old recurring occurrences through one guarded registry method. Fewer direct timer/route reads in this wrapper. |
+
+Envelopes re-pinned: `internal/activator`, `internal/boxchoice`, `internal/edge`, `internal/host`, `internal/lease`, `internal/registry`, `internal/schedule`.
+
+Review: a model from the other family than the author reads the branch's diff against main on the amadan.net remote (`origin` or `amadan`, whichever points at amadan.net) and gives a verdict for every unit and every re-pinned envelope above. For a unit, compare the change with its recorded disposition and basis below; for an envelope, read every changed function in the package and what it reaches. Reject if the change lets root open, run, query or follow anything it did not before from a path or input a tenant, an app or a box agent can create, write or name; if it weakens a check, refusal, validation, argument or environment the basis relies on; or if the diff cannot settle either. Otherwise approve. Record each verdict on #280 with the tip. A rejected unit goes back to the author to correct; nothing escalates to the census owner.
+
+Recorded dispositions, which each change must still satisfy:
+
+- `internal/activator/activator.go` `Service.begin`: 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-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.
+- `internal/activator/activator.go` `Service.sweepOnce`: legacy, task accepted-legacy. Basis: 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.
+- `internal/activator/activator.go` `type Service`: authority, task B,C,D,F,J4. Basis: rev3=PROPOSED-seed; existing activator lifecycle and due-wake state plus owned seed exclusion and incarnation-keyed diagnostics; normal refusal and preparation ordering remain authoritative; PROPOSED-plans-2-box-limits adds the idleFor hook field, which only narrows idle windows;rev3=census-ruling-plans-4c-box-throttle;basis=gains the maxRunFor hook field beside idleFor (plans 4c). No read added.;rev3=census-ruling-plans-4d-lapse;basis=gains the disabledFor hook field beside maxRunFor (plans 4d). No read added.;rev3=census-ruling-remote-instance-metrics;basis=gains tenancySeq, hostTenants and hostMixed, in-memory fields for Tenancies; no read added;rev3=census-ruling-region-ha-p1a;basis=the agent as carlos: one more field, markers (markerRetry: an atomic running flag and the last log time) for retryOwedMarkers; no read added; merge of origin/main d7ae1d76: main's fields are kept as main has them (census-ruling-remote-instance-metrics: tenancySeq, hostTenants, hostMixed); this branch's change is the same as above;rev3=census-ruling-rootfs-apps-3;basis=rootfs Plan 3 Tasks 7 and 8: new fields for rootfs admission (rootfsArmed, rootfsSwept), the per-host gate ask and refusal memo, and residency state (lister, backoff, start ceiling, cursor, test seam); no read;rev3=census-ruling-rootfs-apps-3-release;basis=rootfs Plan 3 Group R: one new field, releaseOps (host to the in-memory release record, under a.mu); no read;rev3=census-ruling-rootfs-apps-3-workers;basis=rootfs Plan 3 Group W: one new field, leaseNow (a clock seam for a worker start's headroom against the lease deadline, nil is the real clock); no read;rev3=census-ruling-region-ha-p1b2;basis=region HA P1b-2: gains the holder cache and its single-flight state; no read;rev3=census-ruling-managed-fleets-1b;basis=managed fleets 1b (controller ruling after branch review R1, and Paul's R2 ruling): one field, Fleet (activator.FleetWake: the box's fleet state, not on a fleet by default, on a fleet with a known label and a record reader, or on a fleet with an invalid identity), set by the agent before Start and read only by routeCurrentUnderLease. No read in the declaration. Agent, not root.;rev3=census-ruling-rootfs-apps-6;basis=rootfs Plan 6 Task 7a fix round 1: one field, drainBudget (time.Duration), which New copies from residentDrainBudget and a rootfs entry's lease watch reads in its place, so a test's change of the package var never races a watch goroutine; declaration only, reads nothing; merge of origin/main 6f1f6ca6: main's one field, Fleet (activator.FleetWake), is kept as main has it (census-ruling-managed-fleets-1b); this branch's change is the same as above;rev3=census-ruling-region-ha-p1b3a;basis=Add bounded placement peer and diagnostic state and the over-capacity callback; no read in this declaration and no new root authority.;rev3=census-ruling-stateless-replicas-1;basis=Add coordinator, existing-record observation callback and per-host preparation locks; no read in the declaration. Task 3a: Add optional canonical storage-selection and durable deploy-ID callbacks; declaration only, no read or authority in these fields.;rev3=census-ruling-edge-held-streams;basis=the agent (/opt/carlos/carlos agent, carlos-edge.service, user carlos): adds the heldLegs map to actEntry (legs by id, under a.mu) and heldWakeHook (atomic pointer to a callback) and heldLegSeq (atomic counter) to Service. State only, in memory; no read of tenant, app or box-agent-writable input.
+- `internal/edge/wakeplacement.go` `homeMap.wakeSnapshot`: legacy, task accepted-legacy. Basis: 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
+- `internal/host/agent.go` `runAgent`: authority, task B,C,D,F. Basis: rev3=census-ruling-self-serve-moves-1;basis=the agent (/opt/carlos/carlos agent, carlos-edge.service, user carlos): builds the box's lifetime judge once (newBoxJudge, nil with host claims on) and hands it to the seed placement, the moves and runs workers and every loop it starts; read sites unchanged, offsets moved; B,C,D,F authority retained; self-serve moves 1 Task 8: derives the box's lifetimes switch from the judge once (lifetimes := boxJudge != nil) and hands it to the edges file loop; read sites unchanged, offsets moved;rev3=census-ruling-plans-4d-lapse;basis=arms two more plans hooks from the same snapshot: e.SetPlanDisabledFor(planDisabledFor) beside SetPlanGovernedFor, and svc.SetDisabledFor(planDisabledRoute) beside SetMaxRunFor (plans 4d); the reads live in those units (plans-4d-units decision); read sites unchanged, offsets moved;rev3=census-ruling-rootfs-apps-2;basis=main's body as of the merge of origin/main 9b81d97b (with main's plan rate ceiling, edge request records, regional box names, self-serve moves plan 1, plans 4d-1 lapse and its other later changes under main's own census rulings) plus the rootfs placement wiring in the activator start: an agentRootfs built from eb.NestedOK, CARLOS_DEPLOYMENT_SINGLE_TENANT, CARLOS_POOLS, the claim flag, swapArming's answer, the control client's /ready/rootfs and, on a fleet box whose identity resolved, fleetOwnerCheck over the deploy store main already opens for the fleet label (fleetStore), then arm and armedRootfs.Store; this body reads nothing new itself; the closures it wires read later, at a rootfs wake and each status tick: GET /ready/rootfs over the control socket, NestedOK's checks, and release.FleetOwnerKey for the judged row's own account and this box's fleet from the deploy store;rev3=census-ruling-instance-egress-sizes-328-329;basis=#328 plan 2 Tasks 7 and 11, #329 plan 3 Task 7 and plan 1 Task 7's policy cache: the control client is built once and handed to eb.Control, to the status tick (egressStatus) and to a new egressNudgeLoop goroutine; armSizeSource(svc, "/sys/fs/cgroup") after the activator Service; armPolicyCache() after armChangeIndex; statusLoop takes egressStatus. The reads are those units' own (decision rows); this body reads nothing new: the same five sites, offsets moved, in the agent; B,C,D,F authority retained.;rev3=census-ruling-remote-instance-metrics;basis=builds the metrics loop's owners closure (metricsOwners over the agent's registry, the activator and cgm.Leftover) when an activator exists and hands it to metricsLoop; reads nothing new itself;rev3=census-ruling-edge-asset-cache-3;basis=adds file:Statfs. runAgent keeps its authority (B,C,D,F). The new site is assetcache.Statfs, an exported assetcache.FS interface value (var Statfs FS = statfsFS{}), not a function value and not a call in runAgent: the ready hook passes it to armEdgeAssetCache as the store's filesystem, and armEdgeAssetCache calls its Space method on the configured data directory (dataDir(): $CARLOS_DATA_DIR, else /data), which calls unix.Statfs there (statfsFS.Space, accepted legacy at census-ruling-edge-asset-cache-2). No request-supplied pathname reaches it.;rev3=census-ruling-remote-metrics-nested;basis=main's body (merged origin/main acfa4f80, under main's own census rulings) plus: snapshots the nested layout (snapshotNestedUnits over /sys/fs/cgroup/carlos.slice/carlos-instances.slice) once at start, before the activator, and hands the metrics loop a unitSources struct (stamped units, routeHostNames, that root and the snapshot); reads nothing new itself;rev3=census-ruling-region-ha-p1a;basis=the agent (/opt/carlos/carlos agent, carlos-edge.service, user carlos): wires region HA P1a into the activator: cfg.Record = haRecordFacts(openDeployStore, boxJudge) (the box's lifetime judge this body already builds with newBoxJudge, nil with host claims on; CI fix) and cfg.Self = lease.CurrentSelf; eb.Lifetimes (the process's lifetime index), eb.Registry, eb.StartupSwept (seedSweptAtStart.Load), eb.FilesStore from newProductionFilesStore (now lease.NewFilesStore, rootaws-loaded, a log line on failure) and lease.SetObligationDir(<data>/.ha-owed) (logged on failure; HA acquires then refuse); this body reads nothing new itself, the same five sites; the reads are those units' own (haRecordFacts and lease's SetObligationDir are new rows on this card); merge of origin/main d7ae1d76: main's own later changes to this body are kept as main has them, under main's rulings (census-ruling-remote-instance-metrics: the metricsOwners closure for metricsLoop; census-ruling-edge-asset-cache-3: the +file:Statfs site, assetcache.Statfs handed to the asset ready hook); this branch's change is the same as above;rev3=census-ruling-region-ha-p1b1;basis=region HA P1b-1: builds one termfence.Confirmer (Self from lease.CurrentSelf at each call, EC2 DescribeInstances method only, client from rootaws.LoadDefaultConfig with retries off, built lazily on first use) and sets eb.OwnerTerminated; this body reads nothing new itself, the same six sites;rev3=census-ruling-rootfs-apps-3;basis=rootfs Plan 3 Task 7: the startup Sweep literal hands its answer to startupSwept, which logs as before and, only on a clean sweep, marks rootfs admission swept (MarkRootfsSwept); same Sweep call, no read added;rev3=census-ruling-managed-fleets-1b;basis=managed fleets 1b (controller ruling after branch review R1, and Paul's R2 ruling): sets svc.Fleet = fleetWakeFor(os.Getenv, identity, identErr, fleetStore) from the identity it already resolves once and the deployment store the fleet loops already opened, and logs an ERROR naming the identity error when the box is on a fleet with an invalid identity. fleetWakeFor reads CARLOS_REGION and CARLOS_FLEET from the same environment. Read sites unchanged (6). Agent, not root; a platform box is unchanged.;rev3=census-ruling-rootfs-apps-6;basis=rootfs Plan 6 Task 12: one call more beside armRunsPass, armInteractivePass(svc, reg, rolloutSink, boxJudge), in the same activator Configure hook, handing it the same box judge; fix round 1 (Astra P2, shutdown): after svc.Shutdown(ctx), shutdownInteractive(ctx) ends and joins every interactive session under the same shutdown budget; the worker's own reads are its units' (interactive.go); this body reads nothing new, the same six sites; merge of origin/main 6f1f6ca6: main's svc.Fleet = fleetWakeFor(...) and its invalid-identity ERROR line are kept as main has them (census-ruling-managed-fleets-1b); this branch's change is the same as above; read sites unchanged (6);rev3=census-ruling-fix-set-aside-exdev;basis=set-aside EXDEV fix: one field more on the agent ExecBackend literal, RawInstanceDir: layout.RawInstanceDir (a pure path join: <dataDir>/.instances/<InstanceID(host)>), so the start rule set-aside moves a copy out through the raw directory instead of through the nosymfollow bind; this body reads nothing new, the same six sites;rev3=census-ruling-durability-3a-escrow;basis=durability 3a Task 3: one more assignment beside eb.FilesStore: eb.EscrowKey = haEscrowKey(os.Getenv("CARLOS_SECRETS_KEY")), the agent's own environment parsed by appconfig.ParsePrivateKey as the moves pass parses it (unset or unparseable: a log line and nil, and HA publication refuses on the box). No path is opened or read, no read site added; the same six sites, offsets moved; B,C,D,F authority retained. Durability 3a Task 4: one more goroutine beside configSyncLoop: go escrowLoop(agentCtx, reg, svc), the escrow sweep every 30 s over the same registry and Service. This body reads nothing new itself; the same six sites, offsets moved; B,C,D,F authority retained. Durability 3a Task 5: one more call beside eb.EscrowKey: wireRawSecretPages(eb, PageOperator, metricsBoxLabel(os.Getenv, readMachineID())), which sets eb.OnRawSecret to page an operator (alerting.Page through PageOperator, LevelIncident) on its own goroutine with a 20 s timeout; metricsBoxLabel and readMachineID are the reads this body already makes for the moves refusal log; no new read site; the same six sites, offsets moved; B,C,D,F authority retained. Merge of origin/main 90c4d3aa: main's own later changes to this body are kept as main has them, under main's rulings; this branch's change is the same as above. Merge of origin/main 00bf5b8c (fleet set-aside EXDEV fix): main's change to this body is kept as main has it, under its own census ruling; this branch's change is unchanged.;rev3=census-ruling-probe-burst-limit;basis=two more sink wirings beside setAnalyticsSink: setProtectionSink(e.SetProtectionRecordOnly) and setAssetOwnersSource(e.AssetOwners), function values the telemetry pass calls; this body reads nothing new, the same six sites; authority B,C,D,F retained; no new root read or write kind;rev3=census-ruling-region-ha-p1b3a;basis=Arm HA placement exactly once on the existing Service before activatorStart and edges publication, wiring AwakeApps and the PageOperator callback; existing six read sites unchanged, no new root authority.;rev3=census-ruling-stateless-replicas-1;basis=Final review I3: start the concrete coordinator's renewal worker with agent setup; existing closeReplicaCoordinator shutdown cancels and joins it before release. No new read sites or credentials. Merge origin/main c59715e7: retain main's armHAPlacement(svc, PageOperator) wiring beside the existing activator setup; stateless coordinator and shutdown wiring remain. Same read sites; no new root read or credential.;rev3=census-ruling-edge-held-streams;basis=the agent (/opt/carlos/carlos agent, carlos-edge.service, user carlos): in the edge-ready callback, calls act.SetHeldWakeHook(e.HeldWake) when act is non-nil (installing the non-blocking wake callback) and stores e.HeldStreamsForStatus in heldStreamsSource. Wiring of in-memory callbacks only; no read added.
+- `internal/host/schedule_wiring.go` `newScheduleDeps`: legacy, task accepted-legacy. Basis: accepted-legacy;rev3=census-ruling-moves-offline-fixes;basis=root-route (J1, main's disposition); the agent (/opt/carlos/carlos agent, carlos-edge.service, user carlos), from armSchedule: main's body with the runner's Skip set to scheduleSkip; no new read site
+- `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.
+- `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/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
+
+New dispositions, which census-propose wrote and the reviewer checks against the unit's reads and the diff:
+
+- new `internal/activator/haduties.go:DutyForTick`: reads +whole:Timer; written legacy, accepted-legacy, frozen
+- new `internal/activator/haduties.go:Service.Duty`: reads +whole:Route; written legacy, accepted-legacy, frozen
+- new `internal/activator/haduties.go:Service.WithDuty`: reads +registry:Host ×2, +whole:Route ×3; written legacy, accepted-legacy, frozen
+- new `internal/activator/haduties.go:Service.allowDuty`: reads +registry:Host ×2, +whole:Route ×2; written legacy, accepted-legacy, frozen
+- new `internal/activator/haduties.go:Service.dutyInput`: reads +registry:HA, +registry:Host ×4, +registry:ImportGate, +registry:Replica, +registry:Status ×2, +registry:Tunnel, +whole:Route ×5; written legacy, accepted-legacy, frozen
+- new `internal/activator/haduties.go:Service.rememberDutyAcquired`: reads +registry:Host ×2; written legacy, accepted-legacy, frozen
+- new `internal/activator/haduties.go:Service.rememberDutyRelease`: reads +registry:Host ×2; written legacy, accepted-legacy, frozen
+- new `internal/activator/haduties.go:Service.restrictDuty`: reads +whole:Route ×2; written legacy, accepted-legacy, frozen
+- new `internal/activator/haduties.go:dutyBackend`: 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/runs.go:runsWorker.dutyStillOwned`: reads +registry:HA, +registry:Host, +whole:Route; written legacy, accepted-legacy, frozen
+- new `internal/host/runs.go:runsWorker.pickupOwned`: reads +whole:Route ×5; written legacy, accepted-legacy, frozen
+- new `internal/registry/timers.go:Registry.AdvanceDutyTimer`: reads +file:Exec, +registry:DueAt, +registry:Host, +registry:Kind, +registry:Name, +registry:NextAt ×2, +registry:Registration, +registry:remote, +registry:sql, +whole:remoteClient; written legacy, accepted-legacy, frozen
+- new `internal/schedule/runner.go:OldDutyTick`: reads +registry:Kind, +whole:Timer; written legacy, accepted-legacy, frozen
+- 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
+- reads `internal/host/runs.go:runsWorker.pickup`: +registry:HA, +whole:Route; keeps legacy, task accepted-legacy
+
+Seal: `7e30dee4fb52370555ad173512d7f03782f0fbed725a8a6bf4f7e31f52c23668` → `de4605eaca89fe6173bb9c52b25f5dbe65a59dfe1a94bd4a13e46b6fd2a223ee`.
+
+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
new file mode 100644
index 000000000..cf03111da
--- /dev/null
+++ b/docs/superpowers/notes/census-region-ha-p1b3b-t-claims.md
@@ -0,0 +1,28 @@
+internal/activator/activator.go:Service.begin Carry background-duty provenance into a new singleflight entry; a visitor waiting on its deferred refusal retries with ordinary visitor authority. No read added.
+internal/activator/activator.go:Service.sweepOnce Tag due entries as background duties; the wake evaluates the gate off a.mu before acquire or token preparation. No read added.
+internal/activator/activator.go:type Service Add the B2 DutyStore interface field and process-local duty view, suppression and invalidation state. No read added.
+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.
+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.
+internal/host/schedule_wiring.go:newScheduleDeps Wire Runner.WithDuty before token access through the existing Service. No new read.
+internal/host/schedule_wiring.go:activatorDeliverer.deliverSelected 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 Move existing delivery body to fireOwned; call WithDuty before token preparation and conditionally advance old recurring occurrences through one guarded registry method. Fewer direct timer/route reads in this wrapper.
+internal/activator/haduties.go:DutyForTick Read the observed timer through the shared old-occurrence predicate; once-timers are never aged out.
+internal/activator/haduties.go:Service.Duty Pass the local route into dutyInput and the pure chooser. Advisory decision only; no acquire or start.
+internal/activator/haduties.go:Service.WithDuty Read route host for owned-awake checks and pass provisioned managed instances to restricted singleflight wake before producer writes, including cached legacy rows that discover sticky HA at acquire. Other route kinds keep their path; no authority bypass.
+internal/activator/haduties.go:Service.allowDuty Read current lifetime, local state and cached view for each classified lease CAS round; invoke the pure restriction table and persist suppression or an expiry deadline. May refuse, never override ordinary acquire.
+internal/activator/haduties.go:Service.dutyInput Read HA classification/lifetime from the existing backend and route host, HA, replica, tunnel, import gate and status; read advisory DutyStore state and cached home projection outside a.mu. No new filesystem or bucket path.
+internal/activator/haduties.go:Service.rememberDutyAcquired Read route host to clear peer suppression only after ordinary acquire succeeds, including visitor wakes. Local advisory state cannot authorize the lease.
+internal/activator/haduties.go:Service.rememberDutyRelease Read route host to record successful local release basis keyed to the acquired host lifetime. Failed marker writes never reach this hook.
+internal/activator/haduties.go:Service.restrictDuty Pass the route into the chooser and callback; carry a private background context restriction and bind its host lifetime. No new I/O beyond dutyInput.
+internal/activator/haduties.go:dutyBackend Dispatch the existing backend by local route through SplitBackend, for HA classification and self identity. No new I/O.
+internal/edge/wakeplacement.go:Edge.DutySnapshot Pass the route to the existing cached home projection; no store reads, network reads or new publication.
+internal/host/runs.go:runsWorker.dutyStillOwned Read route HA/host and existing service classification; after sink construction require an HA route still held awake locally before RunPick. Refusal only.
+internal/host/runs.go:runsWorker.pickupOwned Move existing pickup body here under WithDuty; recheck held ownership after sink construction and gate detached execution too. Whole-route arguments added; existing request and record validation retained.
+internal/host/runs.go:runsWorker.pickup 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.
+internal/registry/timers.go:Registry.AdvanceDutyTimer Update only local recurring timer progress with registration, DueAt and NextAt comparisons. Read timer fields and existing registry sql/remote handles; no last-delivery stamp, once deletion or external path.
+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.
diff --git a/internal/activator/haduties.go b/internal/activator/haduties.go
index e70dc1af6..68dc2aa41 100644
--- a/internal/activator/haduties.go
+++ b/internal/activator/haduties.go
@@ -193,6 +193,7 @@ func (a *Service) dutyInput(ctx context.Context, rt registry.Route) (DutyInput,
return i, DutyState{}, err
}
i.HA = ha
+ i.Lifetime = life.ID
if !ha {
return i, DutyState{}, nil
}
@@ -273,18 +274,15 @@ func (a *Service) restrictDuty(ctx context.Context, rt registry.Route) (context.
if DecideDuty(i) == Defer {
return ctx, ErrDutyDeferred
}
- if !i.HA {
- return ctx, nil
- }
- return context.WithValue(ctx, dutyContextKey{}, dutyRestriction{allow: func(v hafresh.View) error { return a.allowDuty(ctx, rt, v) }}), nil
+ return context.WithValue(ctx, dutyContextKey{}, dutyRestriction{allow: func(v hafresh.View) error { return a.allowDuty(ctx, rt, i.Lifetime, v) }}), nil
}
-func (a *Service) allowDuty(ctx context.Context, rt registry.Route, v hafresh.View) error {
+func (a *Service) allowDuty(ctx context.Context, rt registry.Route, lifetime string, v hafresh.View) error {
i, st, err := a.dutyInput(ctx, rt)
if err != nil {
return err
}
- if !i.HA || DecideDuty(i) == Defer {
+ if !i.HA || (lifetime != "" && i.Lifetime != lifetime) || DecideDuty(i) == Defer {
return ErrDutyDeferred
}
i.Observed = &v
@@ -330,7 +328,10 @@ func (a *Service) WithDuty(ctx context.Context, rt registry.Route, work func(con
if err != nil {
return err
}
- if call.Value(dutyContextKey{}) == nil {
+ // A provisioned instance can discover sticky HA only at its lock read.
+ // Complete that ordinary wake before producer writes even when the cached
+ // record currently says legacy. Other route kinds retain their old path.
+ if haLegacyRoute(rt) || !rt.ActivatorOwned() {
return work(call)
}
done, err := a.begin(call, rt, false, nil)
diff --git a/internal/activator/haduties_test.go b/internal/activator/haduties_test.go
index 5bf9f7d63..74243a4c2 100644
--- a/internal/activator/haduties_test.go
+++ b/internal/activator/haduties_test.go
@@ -15,6 +15,7 @@ import (
"github.com/carlosframework/platform/internal/boxchoice"
"github.com/carlosframework/platform/internal/edge"
"github.com/carlosframework/platform/internal/hafresh"
+ "github.com/carlosframework/platform/internal/provision"
"github.com/carlosframework/platform/internal/registry"
"github.com/carlosframework/platform/internal/release"
)
@@ -180,11 +181,8 @@ func TestHADutyBeforeEveryProducer(t *testing.T) {
case "worker boot":
_ = s.a.WakeWorker(s.rt)
case "worker sweep":
- s.a.mu.Lock()
- e := s.a.newWorkerEntry(s.rt)
- s.a.putEntryLocked(s.rt.Host, e)
- s.a.mu.Unlock()
- go s.a.wake(e)
+ s.a.due = &dutyDueStore{Registry: s.b.Registry, always: []registry.Route{s.rt}}
+ s.a.sweepOnce()
}
waitFor(t, "duty probe", func() bool { return lockGets(s.b, s.rt) == 1 })
waitFor(t, "refusal settled", func() bool { return !s.a.Owns(s.rt.Host) })
@@ -347,3 +345,30 @@ func TestHADutyVisitorAcquireClearsSuppressionBeforeFailedWake(t *testing.T) {
t.Fatalf("stale peer after local acquisition: %+v %v", st, err)
}
}
+
+type dutyDueStore struct {
+ *registry.Registry
+ always []registry.Route
+}
+
+func (d *dutyDueStore) AlwaysOnWorkers() ([]registry.Route, error) { return d.always, nil }
+
+func TestHADutyStaleLegacyClassification(t *testing.T) {
+ s := haService(t, "shop.example.com")
+ s.rt.HA = false
+ rec := haFixOf(s.b).records[s.rt.Host]
+ rec.HA = false
+ s.b.Lifetimes = &provision.LifetimeIndex{}
+ s.b.Lifetimes.Merge(map[string]provision.Record{s.rt.Host: rec})
+ putLockFor(t, s.b, s.rt, markerBody(t, "b", "i-b", haFixOf(s.b).lifetime, 5, false))
+ err := s.a.WithDuty(context.Background(), s.rt, func(ctx context.Context) error {
+ done, err := s.a.begin(ctx, s.rt, false, nil)
+ if done != nil {
+ done()
+ }
+ return err
+ })
+ if !errors.Is(err, ErrDutyDeferred) || s.wokeHere() {
+ t.Fatalf("stale legacy bypass: err=%v woke=%v", err, s.wokeHere())
+ }
+}
diff --git a/internal/host/haduties_wiring_test.go b/internal/host/haduties_wiring_test.go
index fb41c9765..a02ccbd8a 100644
--- a/internal/host/haduties_wiring_test.go
+++ b/internal/host/haduties_wiring_test.go
@@ -82,3 +82,19 @@ func TestHADutyBeforeEveryProducer(t *testing.T) {
})
}
}
+
+// The relay fixture has no activator; mirror its existing holds seam at the
+// new pickup admission boundary instead of weakening production admission.
+type runDutyFixture struct {
+ runLauncher
+ holds func(string) bool
+}
+
+func (d runDutyFixture) WithDuty(ctx context.Context, rt registry.Route, work func(context.Context) error) error {
+ if rt.HA && !d.holds(rt.Host) {
+ return activator.ErrDutyDeferred
+ }
+ return work(ctx)
+}
+func (d runDutyFixture) IsHA(_ context.Context, rt registry.Route) (bool, error) { return rt.HA, nil }
+func (d runDutyFixture) HoldsAwake(host string) bool { return d.holds(host) }
diff --git a/internal/host/runrelay_linux_test.go b/internal/host/runrelay_linux_test.go
index 9247d70c4..88614e8c8 100644
--- a/internal/host/runrelay_linux_test.go
+++ b/internal/host/runrelay_linux_test.go
@@ -292,6 +292,7 @@ func newRelayWorld(t *testing.T, rt registry.Route) *relayWorld {
events := &eventLog{}
w.events = events
w.relay = newRunRelay(pub, func() (string, string, bool) { return "home/b1", "fleet-bearer", true }, func(string) bool { return true })
+ w.launch = runDutyFixture{runLauncher: l, holds: func(host string) bool { return w.relay.holds(host) }}
w.relay.openWait, w.relay.alive, w.relay.lostAfter = 2*time.Second, 200*time.Millisecond, 2*time.Second
return &relayWorld{bucket: bucket, box: box, door: door, w: w, rec: *got, id: id, events: events, priv: priv, launcher: l, handle: h}
}
diff --git a/internal/host/runs.go b/internal/host/runs.go
index a22ac9d5f..96b3c4df2 100644
--- a/internal/host/runs.go
+++ b/internal/host/runs.go
@@ -276,6 +276,11 @@ func (w *runsWorker) pickupOwned(ctx context.Context, rec provision.Record, rt r
}
return
}
+ if !w.dutyStillOwned(ctx, rt) {
+ sink.close()
+ w.forget(id)
+ return
+ }
got, err := sink.Pickup(ctx, rec, *req)
if err != nil {
sink.close()
@@ -475,3 +480,16 @@ func runRunsBootPass(ctx context.Context) {
w.bootPass(ctx)
}
}
+
+// A relay connection can wait after admission. Recheck the held lease
+// before either sink changes the queued record to picked.
+func (w *runsWorker) dutyStillOwned(ctx context.Context, rt registry.Route) bool {
+ if svc, ok := w.launch.(interface {
+ IsHA(context.Context, registry.Route) (bool, error)
+ HoldsAwake(string) bool
+ }); ok {
+ ha, err := svc.IsHA(ctx, rt)
+ return err == nil && (!ha || svc.HoldsAwake(rt.Host))
+ }
+ return !rt.HA
+}
diff --git a/internal/provision/testdata/plan14-root-reads-chain.tsv b/internal/provision/testdata/plan14-root-reads-chain.tsv
index aab448fae..e530d55ee 100644
--- a/internal/provision/testdata/plan14-root-reads-chain.tsv
+++ b/internal/provision/testdata/plan14-root-reads-chain.tsv
@@ -67,3 +67,4 @@ plan14-root-reads-domains-zone-credentials.tsv 3b6cd29b87d2728254936722ab45fdadc
plan14-root-reads-devbox-identity.tsv 66a5df05f18f70c3162ad05aa316c1e69c0f053d54f8b682262c266d6aa50772
plan14-root-reads-region-ha-home-placement.tsv b0304f75d2c5f1b9818d0f282b89c00c00b33e3f9bf974031687527c191fb161
plan14-root-reads-storedoor-stream-get.tsv 7e30dee4fb52370555ad173512d7f03782f0fbed725a8a6bf4f7e31f52c23668
+plan14-root-reads-region-ha-p1b3b-t.tsv de4605eaca89fe6173bb9c52b25f5dbe65a59dfe1a94bd4a13e46b6fd2a223ee
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
new file mode 100644
index 000000000..c4caadf74
--- /dev/null
+++ b/internal/provision/testdata/plan14-root-reads-region-ha-p1b3b-t.tsv
@@ -0,0 +1,63 @@
+# 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.
+# 6 body, 6 sites, 7 envelope: each changed unit re-frozen at its existing disposition with its claim appended.
+# 16 new dispositions: 1 reads re-frozen at their disposition with the claim, 15 new units frozen accepted-legacy, 0 quiet units retired while they read nothing, 0 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
+@legacy 9b219c8225b21f0a817d1cc9445fc2e4e2ef6a9a8775023ba4b8aefd6e2ac151 internal/host/schedule_wiring.go newScheduleDeps legacy accepted-legacy accepted-legacy;rev3=census-ruling-moves-offline-fixes;basis=root-route (J1, main's disposition); the agent (/opt/carlos/carlos agent, carlos-edge.service, user carlos), from armSchedule: main's body with the runner's Skip set to scheduleSkip; no new read site;rev3=census-ruling-region-ha-p1b3b-t;basis=Wire Runner.WithDuty before token access through the existing Service. No new read. registry:App@1535,registry:App@388,registry:Host@1602,registry:Host@396,whole:Route@1530,whole:Route@383 2ff029a7052cfa470acdcac13e011f4f34174410d670554f5846b75b6952fb1b
+@legacy 33abbadcf662e15febe8dd2b8f8866c830890cc4bd4c77583470d246a9094d65 internal/activator/haduties.go DutyForTick legacy accepted-legacy accepted-legacy;rev3=census-ruling-region-ha-p1b3b-t;basis=Read the observed timer through the shared old-occurrence predicate; once-timers are never aged out. whole:Timer@120 f9a9c2fce154cf37b1d1e5ef03319ad0c4c546ad88a1aa78812b7401428995e5
+@legacy 008e2ff03d5955fe5de43f0c98b7e5d7ec91773a58ed35544263401989edd905 internal/activator/haduties.go Service.Duty legacy accepted-legacy accepted-legacy;rev3=census-ruling-region-ha-p1b3b-t;basis=Pass the local route into dutyInput and the pure chooser. Advisory decision only; no acquire or start. whole:Route@118 15122e8a380cccc304994a0f390ed0de98eb37a765d2362df73a0f6b79dae78e
+@legacy 2506ebeb35560294d55dd2429da67f210297deb7283930c371c0ad3b3463e97e internal/activator/haduties.go Service.WithDuty legacy accepted-legacy accepted-legacy;rev3=census-ruling-region-ha-p1b3b-t;basis=Read route host for owned-awake checks and pass provisioned managed instances to restricted singleflight wake before producer writes, including cached legacy rows that discover sticky HA at acquire. Other route kinds keep their path; no authority bypass. registry:Host@584,registry:Host@673,whole:Route@143,whole:Route@422,whole:Route@503 69e34dcb9430c114b0765adffc97be60b72ea939c5c38296bffd7a3bec0d804d
+@legacy b3313445468ffe9a9eddabf7c87220ba985c729f53d3a0b1fc2dc58a9a41c3f4 internal/activator/haduties.go Service.allowDuty legacy accepted-legacy accepted-legacy;rev3=census-ruling-region-ha-p1b3b-t;basis=Read current lifetime, local state and cached view for each classified lease CAS round; invoke the pure restriction table and persist suppression or an expiry deadline. May refuse, never override ordinary acquire. registry:Host@1203,registry:Host@521,whole:Route@141,whole:Route@940 9e78355eed5edc26cfdbf789bbedc148656b534a36c09e350b5f086fec3e571e
+@legacy 53ab473449de8d43122285c04d75ebac9dcbe370ff2105273450fceac91bdd0c internal/activator/haduties.go Service.dutyInput legacy accepted-legacy accepted-legacy;rev3=census-ruling-region-ha-p1b3b-t;basis=Read HA classification/lifetime from the existing backend and route host, HA, replica, tunnel, import gate and status; read advisory DutyStore state and cached home projection outside a.mu. No new filesystem or bucket path. registry:HA@244,registry:Host@1079,registry:Host@122,registry:Host@510,registry:Host@576,registry:ImportGate@690,registry:Replica@657,registry:Status@714,registry:Status@733,registry:Tunnel@671,whole:Route@149,whole:Route@216,whole:Route@312,whole:Route@604,whole:Route@885 9cdbbbd19a900153cc5dd6959366c5ec6042816dcb7f97b46d85476823eaf1c5
+@legacy b1d9a2c7b74809dbbf147374dd8f26208ccded1ed8b7ffee62f57e5aa632219e internal/activator/haduties.go Service.rememberDutyAcquired legacy accepted-legacy accepted-legacy;rev3=census-ruling-region-ha-p1b3b-t;basis=Read route host to clear peer suppression only after ordinary acquire succeeds, including visitor wakes. Local advisory state cannot authorize the lease. registry:Host@163,registry:Host@234 74cb5761e354994ad43172ae0f4c4e4c5410a2792492f69d32d100c2dbabed46
+@legacy dd7e1dea5a8679407e0e60ca4833e4f768ed3df6209f4029796adfa5df53ee7f internal/activator/haduties.go Service.rememberDutyRelease legacy accepted-legacy accepted-legacy;rev3=census-ruling-region-ha-p1b3b-t;basis=Read route host to record successful local release basis keyed to the acquired host lifetime. Failed marker writes never reach this hook. registry:Host@162,registry:Host@233 80319f17d46f84e3164bb46ff6ca0bd834f624288644c3f1b3a9fa0b789dc616
+@legacy c4d6d29d207ae6dc1a5c39be66fe25bba8d3ae9909d69a2e8b1e8a923d45a5e1 internal/activator/haduties.go Service.restrictDuty legacy accepted-legacy accepted-legacy;rev3=census-ruling-region-ha-p1b3b-t;basis=Pass the route into the chooser and callback; carry a private background context restriction and bind its host lifetime. No new I/O beyond dutyInput. whole:Route@129,whole:Route@358 f97b6c06627dae97df6828ad57330d6e5b919fa999d9df13148cbae92f58d44b
+@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 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 e154d74a30627fba72d2c1f0dd79786d939df5bb9d54a7866d799ec855d90465 internal/host/runs.go runsWorker.dutyStillOwned legacy accepted-legacy accepted-legacy;rev3=census-ruling-region-ha-p1b3b-t;basis=Read route HA/host and existing service classification; after sink construction require an HA route still held awake locally before RunPick. Refusal only. registry:HA@309,registry:Host@287,whole:Route@237 d7b9c563b32e042e798ffbd98633be9a8eb13eaa68b574693be5937b1cd95ded
+@legacy 0d9991b3248e1e05976753ae839c6455b55ed1ccfdf0a9a9580f534bb946de6b internal/host/runs.go runsWorker.pickupOwned legacy accepted-legacy accepted-legacy;rev3=census-ruling-region-ha-p1b3b-t;basis=Move existing pickup body here under WithDuty; recheck held ownership after sink construction and gate detached execution too. Whole-route arguments added; existing request and record validation retained. whole:Route@1180,whole:Route@1927,whole:Route@1989,whole:Route@2050,whole:Route@956 2d17082c44e377da7680f5fa7e1af0fd052dfa3c6bf3f8c50ad71d1086937659
+@legacy 15e8e57aa35412027f3907fd0de751274f9e72641e5c16f6da4b88cb2acf7a37 internal/registry/timers.go Registry.AdvanceDutyTimer legacy accepted-legacy accepted-legacy;rev3=census-ruling-region-ha-p1b3b-t;basis=Update only local recurring timer progress with registration, DueAt and NextAt comparisons. Read timer fields and existing registry sql/remote handles; no last-delivery stamp, once deletion or external path. file:Exec@218,registry:DueAt@416,registry:Host@384,registry:Kind@143,registry:Name@392,registry:NextAt@171,registry:NextAt@425,registry:Registration@400,registry:remote@77,registry:sql@218,whole:remoteClient@79 ce0f893ed21cc2f5df3ca365f9b27d9904b969fd8fff1d68b4cd4f4676d0bb69
+@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 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 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 1bfd691c54e4630c5bb20af14bc1150e618f977ab487206a9baac77d59366876 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-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@8151,registry:Socket@8312,registry:Stateless@10394,registry:Stateless@9646,whole:Route@10396,whole:Route@1047,whole:Route@1350,whole:Route@2865,whole:Route@2992,whole:Route@3049,whole:Route@417,whole:Route@6399,whole:Route@8104,whole:Route@8153,whole:Route@8314,whole:Route@9637,whole:Route@9692 6204eb606d27d250370fc2a8a821195ea3eb3b8648e7656c52a25d1488a8c2b7
+@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 289335850fa4fd291988c44bb717b11054cb934fe8432b339f74c843d5db3379 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. registry:Host@106,whole:Route@1137,whole:Route@1256,whole:Route@1301,whole:Route@1898,whole:Route@195,whole:Route@1994,whole:Route@533,whole:Route@584,whole:Route@834 8b8632218aa6092a07d95d9eb9b19746693fdfb956363a4eadb64f864bfd4588
+@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
+internal/activator/activator.go type Service authority B,C,D,F,J4 rev3=PROPOSED-seed; existing activator lifecycle and due-wake state plus owned seed exclusion and incarnation-keyed diagnostics; normal refusal and preparation ordering remain authoritative; PROPOSED-plans-2-box-limits adds the idleFor hook field, which only narrows idle windows;rev3=census-ruling-plans-4c-box-throttle;basis=gains the maxRunFor hook field beside idleFor (plans 4c). No read added.;rev3=census-ruling-plans-4d-lapse;basis=gains the disabledFor hook field beside maxRunFor (plans 4d). No read added.;rev3=census-ruling-remote-instance-metrics;basis=gains tenancySeq, hostTenants and hostMixed, in-memory fields for Tenancies; no read added;rev3=census-ruling-region-ha-p1a;basis=the agent as carlos: one more field, markers (markerRetry: an atomic running flag and the last log time) for retryOwedMarkers; no read added; merge of origin/main d7ae1d76: main's fields are kept as main has them (census-ruling-remote-instance-metrics: tenancySeq, hostTenants, hostMixed); this branch's change is the same as above;rev3=census-ruling-rootfs-apps-3;basis=rootfs Plan 3 Tasks 7 and 8: new fields for rootfs admission (rootfsArmed, rootfsSwept), the per-host gate ask and refusal memo, and residency state (lister, backoff, start ceiling, cursor, test seam); no read;rev3=census-ruling-rootfs-apps-3-release;basis=rootfs Plan 3 Group R: one new field, releaseOps (host to the in-memory release record, under a.mu); no read;rev3=census-ruling-rootfs-apps-3-workers;basis=rootfs Plan 3 Group W: one new field, leaseNow (a clock seam for a worker start's headroom against the lease deadline, nil is the real clock); no read;rev3=census-ruling-region-ha-p1b2;basis=region HA P1b-2: gains the holder cache and its single-flight state; no read;rev3=census-ruling-managed-fleets-1b;basis=managed fleets 1b (controller ruling after branch review R1, and Paul's R2 ruling): one field, Fleet (activator.FleetWake: the box's fleet state, not on a fleet by default, on a fleet with a known label and a record reader, or on a fleet with an invalid identity), set by the agent before Start and read only by routeCurrentUnderLease. No read in the declaration. Agent, not root.;rev3=census-ruling-rootfs-apps-6;basis=rootfs Plan 6 Task 7a fix round 1: one field, drainBudget (time.Duration), which New copies from residentDrainBudget and a rootfs entry's lease watch reads in its place, so a test's change of the package var never races a watch goroutine; declaration only, reads nothing; merge of origin/main 6f1f6ca6: main's one field, Fleet (activator.FleetWake), is kept as main has it (census-ruling-managed-fleets-1b); this branch's change is the same as above;rev3=census-ruling-region-ha-p1b3a;basis=Add bounded placement peer and diagnostic state and the over-capacity callback; no read in this declaration and no new root authority.;rev3=census-ruling-stateless-replicas-1;basis=Add coordinator, existing-record observation callback and per-host preparation locks; no read in the declaration. Task 3a: Add optional canonical storage-selection and durable deploy-ID callbacks; declaration only, no read or authority in these fields.;rev3=census-ruling-edge-held-streams;basis=the agent (/opt/carlos/carlos agent, carlos-edge.service, user carlos): adds the heldLegs map to actEntry (legs by id, under a.mu) and heldWakeHook (atomic pointer to a callback) and heldLegSeq (atomic counter) to Service. State only, in memory; no read of tenant, app or box-agent-writable input.;rev3=census-ruling-region-ha-p1b3b-t;basis=Add the B2 DutyStore interface field and process-local duty view, suppression and invalidation state. No read added. 17e0490fd371ac6b9c429da224167c2052914748946a62384f6fd90654dbedde
+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
+internal/host/agent.go runAgent authority B,C,D,F rev3=census-ruling-self-serve-moves-1;basis=the agent (/opt/carlos/carlos agent, carlos-edge.service, user carlos): builds the box's lifetime judge once (newBoxJudge, nil with host claims on) and hands it to the seed placement, the moves and runs workers and every loop it starts; read sites unchanged, offsets moved; B,C,D,F authority retained; self-serve moves 1 Task 8: derives the box's lifetimes switch from the judge once (lifetimes := boxJudge != nil) and hands it to the edges file loop; read sites unchanged, offsets moved;rev3=census-ruling-plans-4d-lapse;basis=arms two more plans hooks from the same snapshot: e.SetPlanDisabledFor(planDisabledFor) beside SetPlanGovernedFor, and svc.SetDisabledFor(planDisabledRoute) beside SetMaxRunFor (plans 4d); the reads live in those units (plans-4d-units decision); read sites unchanged, offsets moved;rev3=census-ruling-rootfs-apps-2;basis=main's body as of the merge of origin/main 9b81d97b (with main's plan rate ceiling, edge request records, regional box names, self-serve moves plan 1, plans 4d-1 lapse and its other later changes under main's own census rulings) plus the rootfs placement wiring in the activator start: an agentRootfs built from eb.NestedOK, CARLOS_DEPLOYMENT_SINGLE_TENANT, CARLOS_POOLS, the claim flag, swapArming's answer, the control client's /ready/rootfs and, on a fleet box whose identity resolved, fleetOwnerCheck over the deploy store main already opens for the fleet label (fleetStore), then arm and armedRootfs.Store; this body reads nothing new itself; the closures it wires read later, at a rootfs wake and each status tick: GET /ready/rootfs over the control socket, NestedOK's checks, and release.FleetOwnerKey for the judged row's own account and this box's fleet from the deploy store;rev3=census-ruling-instance-egress-sizes-328-329;basis=#328 plan 2 Tasks 7 and 11, #329 plan 3 Task 7 and plan 1 Task 7's policy cache: the control client is built once and handed to eb.Control, to the status tick (egressStatus) and to a new egressNudgeLoop goroutine; armSizeSource(svc, "/sys/fs/cgroup") after the activator Service; armPolicyCache() after armChangeIndex; statusLoop takes egressStatus. The reads are those units' own (decision rows); this body reads nothing new: the same five sites, offsets moved, in the agent; B,C,D,F authority retained.;rev3=census-ruling-remote-instance-metrics;basis=builds the metrics loop's owners closure (metricsOwners over the agent's registry, the activator and cgm.Leftover) when an activator exists and hands it to metricsLoop; reads nothing new itself;rev3=census-ruling-edge-asset-cache-3;basis=adds file:Statfs. runAgent keeps its authority (B,C,D,F). The new site is assetcache.Statfs, an exported assetcache.FS interface value (var Statfs FS = statfsFS{}), not a function value and not a call in runAgent: the ready hook passes it to armEdgeAssetCache as the store's filesystem, and armEdgeAssetCache calls its Space method on the configured data directory (dataDir(): $CARLOS_DATA_DIR, else /data), which calls unix.Statfs there (statfsFS.Space, accepted legacy at census-ruling-edge-asset-cache-2). No request-supplied pathname reaches it.;rev3=census-ruling-remote-metrics-nested;basis=main's body (merged origin/main acfa4f80, under main's own census rulings) plus: snapshots the nested layout (snapshotNestedUnits over /sys/fs/cgroup/carlos.slice/carlos-instances.slice) once at start, before the activator, and hands the metrics loop a unitSources struct (stamped units, routeHostNames, that root and the snapshot); reads nothing new itself;rev3=census-ruling-region-ha-p1a;basis=the agent (/opt/carlos/carlos agent, carlos-edge.service, user carlos): wires region HA P1a into the activator: cfg.Record = haRecordFacts(openDeployStore, boxJudge) (the box's lifetime judge this body already builds with newBoxJudge, nil with host claims on; CI fix) and cfg.Self = lease.CurrentSelf; eb.Lifetimes (the process's lifetime index), eb.Registry, eb.StartupSwept (seedSweptAtStart.Load), eb.FilesStore from newProductionFilesStore (now lease.NewFilesStore, rootaws-loaded, a log line on failure) and lease.SetObligationDir(<data>/.ha-owed) (logged on failure; HA acquires then refuse); this body reads nothing new itself, the same five sites; the reads are those units' own (haRecordFacts and lease's SetObligationDir are new rows on this card); merge of origin/main d7ae1d76: main's own later changes to this body are kept as main has them, under main's rulings (census-ruling-remote-instance-metrics: the metricsOwners closure for metricsLoop; census-ruling-edge-asset-cache-3: the +file:Statfs site, assetcache.Statfs handed to the asset ready hook); this branch's change is the same as above;rev3=census-ruling-region-ha-p1b1;basis=region HA P1b-1: builds one termfence.Confirmer (Self from lease.CurrentSelf at each call, EC2 DescribeInstances method only, client from rootaws.LoadDefaultConfig with retries off, built lazily on first use) and sets eb.OwnerTerminated; this body reads nothing new itself, the same six sites;rev3=census-ruling-rootfs-apps-3;basis=rootfs Plan 3 Task 7: the startup Sweep literal hands its answer to startupSwept, which logs as before and, only on a clean sweep, marks rootfs admission swept (MarkRootfsSwept); same Sweep call, no read added;rev3=census-ruling-managed-fleets-1b;basis=managed fleets 1b (controller ruling after branch review R1, and Paul's R2 ruling): sets svc.Fleet = fleetWakeFor(os.Getenv, identity, identErr, fleetStore) from the identity it already resolves once and the deployment store the fleet loops already opened, and logs an ERROR naming the identity error when the box is on a fleet with an invalid identity. fleetWakeFor reads CARLOS_REGION and CARLOS_FLEET from the same environment. Read sites unchanged (6). Agent, not root; a platform box is unchanged.;rev3=census-ruling-rootfs-apps-6;basis=rootfs Plan 6 Task 12: one call more beside armRunsPass, armInteractivePass(svc, reg, rolloutSink, boxJudge), in the same activator Configure hook, handing it the same box judge; fix round 1 (Astra P2, shutdown): after svc.Shutdown(ctx), shutdownInteractive(ctx) ends and joins every interactive session under the same shutdown budget; the worker's own reads are its units' (interactive.go); this body reads nothing new, the same six sites; merge of origin/main 6f1f6ca6: main's svc.Fleet = fleetWakeFor(...) and its invalid-identity ERROR line are kept as main has them (census-ruling-managed-fleets-1b); this branch's change is the same as above; read sites unchanged (6);rev3=census-ruling-fix-set-aside-exdev;basis=set-aside EXDEV fix: one field more on the agent ExecBackend literal, RawInstanceDir: layout.RawInstanceDir (a pure path join: <dataDir>/.instances/<InstanceID(host)>), so the start rule set-aside moves a copy out through the raw directory instead of through the nosymfollow bind; this body reads nothing new, the same six sites;rev3=census-ruling-durability-3a-escrow;basis=durability 3a Task 3: one more assignment beside eb.FilesStore: eb.EscrowKey = haEscrowKey(os.Getenv("CARLOS_SECRETS_KEY")), the agent's own environment parsed by appconfig.ParsePrivateKey as the moves pass parses it (unset or unparseable: a log line and nil, and HA publication refuses on the box). No path is opened or read, no read site added; the same six sites, offsets moved; B,C,D,F authority retained. Durability 3a Task 4: one more goroutine beside configSyncLoop: go escrowLoop(agentCtx, reg, svc), the escrow sweep every 30 s over the same registry and Service. This body reads nothing new itself; the same six sites, offsets moved; B,C,D,F authority retained. Durability 3a Task 5: one more call beside eb.EscrowKey: wireRawSecretPages(eb, PageOperator, metricsBoxLabel(os.Getenv, readMachineID())), which sets eb.OnRawSecret to page an operator (alerting.Page through PageOperator, LevelIncident) on its own goroutine with a 20 s timeout; metricsBoxLabel and readMachineID are the reads this body already makes for the moves refusal log; no new read site; the same six sites, offsets moved; B,C,D,F authority retained. Merge of origin/main 90c4d3aa: main's own later changes to this body are kept as main has them, under main's rulings; this branch's change is the same as above. Merge of origin/main 00bf5b8c (fleet set-aside EXDEV fix): main's change to this body is kept as main has it, under its own census ruling; this branch's change is unchanged.;rev3=census-ruling-probe-burst-limit;basis=two more sink wirings beside setAnalyticsSink: setProtectionSink(e.SetProtectionRecordOnly) and setAssetOwnersSource(e.AssetOwners), function values the telemetry pass calls; this body reads nothing new, the same six sites; authority B,C,D,F retained; no new root read or write kind;rev3=census-ruling-region-ha-p1b3a;basis=Arm HA placement exactly once on the existing Service before activatorStart and edges publication, wiring AwakeApps and the PageOperator callback; existing six read sites unchanged, no new root authority.;rev3=census-ruling-stateless-replicas-1;basis=Final review I3: start the concrete coordinator's renewal worker with agent setup; existing closeReplicaCoordinator shutdown cancels and joins it before release. No new read sites or credentials. Merge origin/main c59715e7: retain main's armHAPlacement(svc, PageOperator) wiring beside the existing activator setup; stateless coordinator and shutdown wiring remain. Same read sites; no new root read or credential.;rev3=census-ruling-edge-held-streams;basis=the agent (/opt/carlos/carlos agent, carlos-edge.service, user carlos): in the edge-ready callback, calls act.SetHeldWakeHook(e.HeldWake) when act is non-nil (installing the non-blocking wake callback) and stores e.HeldStreamsForStatus in heldStreamsSource. Wiring of in-memory callbacks only; no read added.;rev3=census-ruling-region-ha-p1b3b-t;basis=Wire Service.SetDutyView to the live edge DutySnapshot in the ready callback. No new read; no new loop or cloud operation. file:Exec@17719,file:Open@1150,file:Statfs@45853,registry:App@11474,whole:Route@11466,whole:Route@29433 2de8f7353b97b13fd429a1aab5c15d89873649be8bb39bde6150ed24ff95faf2
+internal/host/schedule_wiring.go newScheduleDeps legacy accepted-legacy accepted-legacy;rev3=census-ruling-moves-offline-fixes;basis=root-route (J1, main's disposition); the agent (/opt/carlos/carlos agent, carlos-edge.service, user carlos), from armSchedule: main's body with the runner's Skip set to scheduleSkip; no new read site;rev3=census-ruling-region-ha-p1b3b-t;basis=Wire Runner.WithDuty before token access through the existing Service. No new read. registry:App@1535,registry:App@388,registry:Host@1602,registry:Host@396,whole:Route@1530,whole:Route@383 2ff029a7052cfa470acdcac13e011f4f34174410d670554f5846b75b6952fb1b
+internal/activator/haduties.go DutyForTick legacy accepted-legacy accepted-legacy;rev3=census-ruling-region-ha-p1b3b-t;basis=Read the observed timer through the shared old-occurrence predicate; once-timers are never aged out. whole:Timer@120 f9a9c2fce154cf37b1d1e5ef03319ad0c4c546ad88a1aa78812b7401428995e5
+internal/activator/haduties.go Service.Duty legacy accepted-legacy accepted-legacy;rev3=census-ruling-region-ha-p1b3b-t;basis=Pass the local route into dutyInput and the pure chooser. Advisory decision only; no acquire or start. whole:Route@118 15122e8a380cccc304994a0f390ed0de98eb37a765d2362df73a0f6b79dae78e
+internal/activator/haduties.go Service.WithDuty legacy accepted-legacy accepted-legacy;rev3=census-ruling-region-ha-p1b3b-t;basis=Read route host for owned-awake checks and pass provisioned managed instances to restricted singleflight wake before producer writes, including cached legacy rows that discover sticky HA at acquire. Other route kinds keep their path; no authority bypass. registry:Host@584,registry:Host@673,whole:Route@143,whole:Route@422,whole:Route@503 69e34dcb9430c114b0765adffc97be60b72ea939c5c38296bffd7a3bec0d804d
+internal/activator/haduties.go Service.allowDuty legacy accepted-legacy accepted-legacy;rev3=census-ruling-region-ha-p1b3b-t;basis=Read current lifetime, local state and cached view for each classified lease CAS round; invoke the pure restriction table and persist suppression or an expiry deadline. May refuse, never override ordinary acquire. registry:Host@1203,registry:Host@521,whole:Route@141,whole:Route@940 9e78355eed5edc26cfdbf789bbedc148656b534a36c09e350b5f086fec3e571e
+internal/activator/haduties.go Service.dutyInput legacy accepted-legacy accepted-legacy;rev3=census-ruling-region-ha-p1b3b-t;basis=Read HA classification/lifetime from the existing backend and route host, HA, replica, tunnel, import gate and status; read advisory DutyStore state and cached home projection outside a.mu. No new filesystem or bucket path. registry:HA@244,registry:Host@1079,registry:Host@122,registry:Host@510,registry:Host@576,registry:ImportGate@690,registry:Replica@657,registry:Status@714,registry:Status@733,registry:Tunnel@671,whole:Route@149,whole:Route@216,whole:Route@312,whole:Route@604,whole:Route@885 9cdbbbd19a900153cc5dd6959366c5ec6042816dcb7f97b46d85476823eaf1c5
+internal/activator/haduties.go Service.rememberDutyAcquired legacy accepted-legacy accepted-legacy;rev3=census-ruling-region-ha-p1b3b-t;basis=Read route host to clear peer suppression only after ordinary acquire succeeds, including visitor wakes. Local advisory state cannot authorize the lease. registry:Host@163,registry:Host@234 74cb5761e354994ad43172ae0f4c4e4c5410a2792492f69d32d100c2dbabed46
+internal/activator/haduties.go Service.rememberDutyRelease legacy accepted-legacy accepted-legacy;rev3=census-ruling-region-ha-p1b3b-t;basis=Read route host to record successful local release basis keyed to the acquired host lifetime. Failed marker writes never reach this hook. registry:Host@162,registry:Host@233 80319f17d46f84e3164bb46ff6ca0bd834f624288644c3f1b3a9fa0b789dc616
+internal/activator/haduties.go Service.restrictDuty legacy accepted-legacy accepted-legacy;rev3=census-ruling-region-ha-p1b3b-t;basis=Pass the route into the chooser and callback; carry a private background context restriction and bind its host lifetime. No new I/O beyond dutyInput. whole:Route@129,whole:Route@358 f97b6c06627dae97df6828ad57330d6e5b919fa999d9df13148cbae92f58d44b
+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/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/runs.go runsWorker.dutyStillOwned legacy accepted-legacy accepted-legacy;rev3=census-ruling-region-ha-p1b3b-t;basis=Read route HA/host and existing service classification; after sink construction require an HA route still held awake locally before RunPick. Refusal only. registry:HA@309,registry:Host@287,whole:Route@237 d7b9c563b32e042e798ffbd98633be9a8eb13eaa68b574693be5937b1cd95ded
+internal/host/runs.go runsWorker.pickupOwned legacy accepted-legacy accepted-legacy;rev3=census-ruling-region-ha-p1b3b-t;basis=Move existing pickup body here under WithDuty; recheck held ownership after sink construction and gate detached execution too. Whole-route arguments added; existing request and record validation retained. whole:Route@1180,whole:Route@1927,whole:Route@1989,whole:Route@2050,whole:Route@956 2d17082c44e377da7680f5fa7e1af0fd052dfa3c6bf3f8c50ad71d1086937659
+internal/registry/timers.go Registry.AdvanceDutyTimer legacy accepted-legacy accepted-legacy;rev3=census-ruling-region-ha-p1b3b-t;basis=Update only local recurring timer progress with registration, DueAt and NextAt comparisons. Read timer fields and existing registry sql/remote handles; no last-delivery stamp, once deletion or external path. file:Exec@218,registry:DueAt@416,registry:Host@384,registry:Kind@143,registry:Name@392,registry:NextAt@171,registry:NextAt@425,registry:Registration@400,registry:remote@77,registry:sql@218,whole:remoteClient@79 ce0f893ed21cc2f5df3ca365f9b27d9904b969fd8fff1d68b4cd4f4676d0bb69
+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/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/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-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@8151,registry:Socket@8312,registry:Stateless@10394,registry:Stateless@9646,whole:Route@10396,whole:Route@1047,whole:Route@1350,whole:Route@2865,whole:Route@2992,whole:Route@3049,whole:Route@417,whole:Route@6399,whole:Route@8104,whole:Route@8153,whole:Route@8314,whole:Route@9637,whole:Route@9692 6204eb606d27d250370fc2a8a821195ea3eb3b8648e7656c52a25d1488a8c2b7
+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/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. registry:Host@106,whole:Route@1137,whole:Route@1256,whole:Route@1301,whole:Route@1898,whole:Route@195,whole:Route@1994,whole:Route@533,whole:Route@584,whole:Route@834 8b8632218aa6092a07d95d9eb9b19746693fdfb956363a4eadb64f864bfd4588
+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=Move existing delivery body to fireOwned; call WithDuty before token preparation and conditionally advance old recurring occurrences through one guarded registry method. Fewer direct timer/route reads in this wrapper. registry:Spec@335,whole:Route@125,whole:Route@168,whole:Route@225,whole:Timer@129,whole:Timer@229,whole:Timer@298,whole:Timer@510 25c46087c5c8a2c94c9cfc471250388cf2f5573216b56b78b7549681e0ba497f
+@coverage internal/activator 48d49bb9e0bdd2818a615543a78f596e7eccbfd92ed5c72c11cc363767526261
+@coverage internal/boxchoice 6b3d6aaacf54a2c2705f5c93d7799e0d9790712e165c90ead6de91e845ae8b09
+@coverage internal/edge 269c0490df6ee888eee703c1735881c4047f21bf78a104fc76b604313e9ae5a7
+@coverage internal/host 0f63fae6019558fce00632dacc864dd5f9bc3709b47354c0043dccca8eaa3cc0
+@coverage internal/lease 99d42caf6e5253517696871e30beead3c37ad74a3cc61a763ec2e931bd2d8606
+@coverage internal/registry d69a90af3d18e665f38f352423e92c1a344d5ec8ab5e7ee1220ea44e84a10058
+@coverage internal/schedule 94e801452a72b586d5b8530bdfd605e510c765d8db567245a97c61b2846bd71a
diff --git a/internal/registry/timers.go b/internal/registry/timers.go
index 0867f7cec..2beef11bf 100644
--- a/internal/registry/timers.go
+++ b/internal/registry/timers.go
@@ -514,7 +514,7 @@ func (r *Registry) AdvanceDutyTimer(t Timer, next int64) (bool, error) {
if t.Kind == "once" || next <= t.NextAt {
return false, nil
}
- res, err := r.sql.Exec(`UPDATE timers SET next_at=?, due_at=?, attempts=0 WHERE host=? AND name=? AND registration=? AND due_at=? AND next_at=? AND kind<> 'once'`, next, next, t.Host, t.Name, t.Registration, t.DueAt, t.NextAt)
+ res, err := r.sql.Exec(`UPDATE timers SET next_at=?, due_at=?, attempts=0 WHERE host=? AND name=? AND registration=? AND due_at=? AND next_at=? AND kind='schedule'`, next, next, t.Host, t.Name, t.Registration, t.DueAt, t.NextAt)
if err != nil {
return false, err
}