carlos / platform Public

fix: clear stop uncertainty when a stateless cleanup is proven (#511)

Final re-review 2, concern 2 (P1b after start). A stateless cold wake
that starts and then fails its health check went through
cleanupFailedWake. Even when failedWakeStopped proved its generation
stopped, the stateless branch set only replicaClosed and leaseReleased,
leaving the wake's initial uncertainty and the sidecar stages open. No
retained wake was left for the reaper, so StopUncertain stayed true and
a restarted permit holder's permit could never resolve.

The branch now records a complete stop when that proof ran and held
(main stopped and exited, uncertainty cleared, sidecar stages held when
the wake started no sidecar), as the reaper does. Nothing is cleared
when no proof ran, a legacy start is unproven, or the proof failed.
Ordinary stateless wakes at copies=1 take the same path and are covered.

Witness: TestReplicaRestartedHolderStartedWakeFails (proven: answers
switched-failed past replicaRestartBound, ACK resolves, retry allowed;
not proven: StopUncertain stays true, the step stays open).

Census: stateless-replicas-4-final re-proposed with a claim for
cleanupFailedWake (body, read sites unchanged); make census-card clean.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
claude agent, operated by paul@keymail.dev pushed by paul@keymail.dev 871987c04025f80828744211c05cdf9e51518276 parent 86e4ace
5 files changed, +127 −5
  • docs/superpowers/notes/census-proposal-stateless-replicas-4-final.md +3 −1
  • internal/activator/maintenance.go +17 −1
  • internal/activator/replicaswitchfail_test.go +102 −0
  • internal/provision/testdata/plan14-root-reads-chain.tsv +1 −1
  • internal/provision/testdata/plan14-root-reads-stateless-replicas-4-final.tsv +4 −2

CI passed — run details

Intent

Human

<task-notification> <task-id>afa5772d77ea2ee57</task-id> <tool-use-id>toolu_01L55AqQ9FbeM5TdJoEPXziM</tool-use-id> <output-file>/home/paulca/.cache/tmp/claude-1001/-home-paulca-amadan-net-carlos-platform/72128d15-58b8-452f-9f7e-8e864e8854d2/tasks/afa5772d77ea2ee57.output</output-file> <status>completed</status> <summary>Agent "Micro-fix two P1s on Plan 4" finished</summary> <note>A task-notification fires each time this agent stops with no live background children of its own. The user can send it another message and resume it, so the same task-id may notify more than once.</note> <result>All four items are fixed in one commit, `86e4ace9` on top of `994f0ea3`, not pushed. The report section is appended to `final-wave-report.md`, but `.superpowers` is gitignored, so it is on disk only. - **P1a (empty baseline):** records now carry a new `BaselineSet` field, so an empty baseline means "run nothing until permitted" and never falls back to `LastGood`. Legacy records get explicit entries when the next attempt begins. Witnesses cover a bootstrap halt (retry and new build) and a legacy released record; both fail without the fix. - **P1b (stuck permit):** an always-on permit holder whose agent restarted rebuilds the evidence from the record, the staged target and the lack of any running generation. After `replicaRestartBound` (`residentPoll + workerStartBound`) it answers "switched, failed" and a retry can begin. The witness runs exactly the scenario in the brief. - **P2:** `replicaSwitchFailure` now reads the awake state while it holds `a.mu`. **Cost:** a sleeping copy's proof-only step does no staging or hashing (a counting test shows 0 reads, against 7 before); an awake copy is still verified. - **Census:** `stateless-replicas-4-final` is re-proposed and `make census-card` is clean. The #280 review of the changed card is still owed. - **Tests:** all the commands you listed pass: replicas, provision and rollout; activator and console with `-run 'Replica|Stateless|Floor|Copies'`; the census tests; and the darwin/arm64, windows/amd64 and linux/arm64 builds. Scratch `/tmp/g/sr4micro.8M0P` is removed. - **Concerns:** (1) after a restart, a box that never actually switched but has had nothing running for the whole bound is also marked switched; the ruling accepts this. (2) In the test fake, a cold wake that starts and then fails leaves its stop unproven, which holds back the P1b answer. The witness therefore uses a wake that fails before anything starts. If production behaves the same, the answer could be delayed. (3) For a legacy released record, no box may cold-start the old target while the next attempt is pending.</result> <usage><subagent_tokens>253770</subagent_tokens><tool_uses>112</tool_uses><duration_ms>1743818</duration_ms></usage> </task-notification>

Human

<task-notification> <task-id>b325414cp</task-id> <tool-use-id>toolu_01U4xqMgpWermKSgZiYsUy8T</tool-use-id> <output-file>/home/paulca/.cache/tmp/claude-1001/-home-paulca-amadan-net-carlos-platform/72128d15-58b8-452f-9f7e-8e864e8854d2/tasks/b325414cp.output</output-file> <status>completed</status> <summary>Background command "Astra re-check of micro-fix" completed (exit code 0)</summary> </task-notification>

Human

<task-notification> <task-id>budxz1y1c</task-id> <tool-use-id>toolu_01H9macag5RM4aKHvYFapjKx</tool-use-id> <output-file>/home/paulca/.cache/tmp/claude-1001/-home-paulca-amadan-net-carlos-platform/72128d15-58b8-452f-9f7e-8e864e8854d2/tasks/budxz1y1c.output</output-file> <status>completed</status> <summary>Background command "Wait for CI on micro-fix tip" completed (exit code 0)</summary> </task-notification>

Attributed to this commit: 148 g CO₂e (11,312,292 tokens). This is an attribution, not a measurement — usage counted from this commit's own marker forward to the next one on stateless-replicas-4, 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-stateless-replicas-4-final.md b/docs/superpowers/notes/census-proposal-stateless-replicas-4-final.md
index 471db1345..81e9dd170 100644
--- a/docs/superpowers/notes/census-proposal-stateless-replicas-4-final.md
+++ b/docs/superpowers/notes/census-proposal-stateless-replicas-4-final.md
@@ -5,6 +5,7 @@ Ruling `census-ruling-stateless-replicas-4-final`. The independent reviewer appr
| unit | change | read sites | what changed |
|---|---|---|---|
| `internal/activator/activator.go` `type Service` | body | unchanged (0) | #511 final wave item 3: adds replicaSwitched, an in-memory map of the permit each set row switched under (host -> permit key, time, resident flag); no read added; #511 micro-fix P1b: adds replicaNoGen, an in-memory map (host -> permit key and when first seen) that is only the bound's clock for a restarted permit holder with no generation; no read added |
+| `internal/activator/maintenance.go` `Service.cleanupFailedWake` | body | unchanged (15) | #511 P1b after start (final re-review 2, concern 2): when a stateless wake's failed generation is proven stopped by the proof that already ran here (failedWakeStopped), the stateless branch also records the stop as complete (main stopped and exited, uncertainty cleared, sidecar stages held when the wake started none), as the reaper does for a retained one; an unproven stop, a legacy start left unproven, or a wake with nothing proven keeps its uncertainty. The same 15 read sites; no read added; no root decision |
| `internal/activator/rootfsworkers.go` `Service.registerRootfsWorkers` | body | unchanged (5) | #511 final wave item 4: a failed worker registration (unreadable or invalid declaration, no worker backend, no staged identity) now also records the generation on the entry (workersUnregistered) under a.mu; the same declaration read as before, no read added |
| `internal/host/agent.go` `runAgent` | body | unchanged (9) | #511 final wave item 2: wires the swap worker's drive (armedReplicaDrive, the armed rollout manager's DriveReplicaRelease); no read added |
| `internal/activator/replicadeploy.go` `Service.ReplicaSwap` | sites | +whole:Route ×2 | #511 final wave item 3: records the switch per permit (noteReplicaSwitch) and, for a later step of that permit, replicaSwitchFailure may stop the switched generation with proof (FenceAndStopAs, LiftFenceAs) and answer switched-failed; the two new whole:Route sites pass the entry's route (already held) to noteReplicaSwitch for its Resident flag; no new path, file or input read; #511 micro-fix: clears replicaNoGen while the copy is awake; with no switch evidence and no entry, asks replicaRestartedFailure; a ProofOnly attempt (a sleeping copy's step) abandons before Swap or any start gate; no new read site |
@@ -17,6 +18,7 @@ Review: a model from the other family than the author reads the branch's diff ag
Recorded dispositions, which each change must still satisfy:
- `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.;rev3=census-ruling-wake-storm-cap;basis=the agent as carlos: one field, wakeSlots (chan struct{}, the wake semaphore made by New from Config.WakeSlots, default 4); declaration only, no read.;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. B2 adds the verified-successor identity callback; no read in the declaration. B3b adds a nonblocking departure-suspicion callback, invoked only after an accepted holder-forward failure and after cache locks release; it cannot authorize a take.;rev3=census-ruling-region-ha-p3a;basis=P3a Task 3: immutable callbacks installed before Start for tenant admission, local start permission, fixed route exemptions and shutdown closure; nil callbacks preserve switch-off behavior; no new reads. Fix R1: add an immutable startup-phase callback for response copy, set before service startup. No new read or execution authority.;rev3=census-ruling-region-ha-g2-fixes;basis=Add in-memory HA loss state and pool withdrawal jobs; no new read.;rev3=census-ruling-region-ha-held-build;basis=region HA held-requests Task 1: one new field, drain (drainSources: two atomic func pointers for this box's and peers' drain state); no read added. region HA held-requests Task 2: one new field, moves (moveTable: per-host move state, hold counts and admission tickets in memory, under mu); no read added;rev3=census-ruling-held-move-speed;basis=the agent as carlos: one new field, moveStreams (per-host in-memory set of edge.StreamEnd for requests in flight, own mutex), for the move's early stream cut; actEntry gains drainRelease (bool, under a.mu), set by DrainStop; declarations only, no read added;rev3=census-ruling-fix-silent-start-kill-861;basis=#861: two fields, wakeFailMu and wakeFailLogged (per-host in-memory note of the last journalled wake failure); declaration only, no read;rev3=census-ruling-w6-ingress-drain;basis=new field TenantStartsClosed func() bool; when it answers true tenantStartRefusal refuses every start, exempt routes included. Wired only by fixedAdmission.bind to the ingress drain's closed flag. Struct field only; no read added.;rev3=census-ruling-stateless-replicas-4-task2;basis=Task 2: one field, replicaPolicies (host to the newest observed replica deploy and this box label, under mu), set only by SetReplicaDeploy; declaration only, no read.;rev3=census-ruling-stateless-replicas-4-task2-fix1;basis=Task 2 fix round 1: one more in-memory field, replicaFailed (host to the permit whose successor failed here, under mu), so that step only proves what it kept; declaration only, no read.;rev3=census-ruling-stateless-replicas-4-task3f;basis=Task 3F fix round 3 (#511 F11): two hook fields, MarkReplicaRelease and ReplicaReleaseMark (the failure book's per-host release mark on this box's disk). No read site.;rev3=census-ruling-stateless-replicas-4-task5;basis=Task 5 first commit (#511 F11): one in-memory field, heldSeen (host to the last held release attempt, error class and when it was met), under the existing wakeFailMu. Declaration only, no read.;rev3=census-ruling-stateless-replicas-4-merge-main;basis=Merge of main 5fac2ff1: both sides changed it. Main (27d3f501) adds the background atomic.Int64 field that tests wait on; this branch keeps its replica fields. Both kept as-is; no read added.
+- `internal/activator/maintenance.go` `Service.cleanupFailedWake`: legacy, task accepted-legacy. Basis: accepted-legacy;rev3=census-ruling-292fix;basis=the agent (/opt/carlos/carlos agent, carlos-edge.service, user carlos): census ruling 292's body; when #292's whole proof holds for an aborted legacy start (legacyRunGone: the unit stopped and its cgroup empty) this wake's uncertainty is discharged and the stages it never reached (no sidecar, no replica) are recorded as held; when the proof fails the start is retained exactly as before, now named as the owner of this wake's uncertainty (owedBy). Read sites unchanged; the proof still only decides release-or-keep; no new read and no root decision;rev3=census-ruling-region-ha-p1a;basis=the agent as carlos: takes the wake's entry e as a new first argument and, when it is not nil, stops and joins the entry's HA files publisher (stopFiles) before anything else. Final fix F1: once the process's own proof has passed, an HA wake (haHeld(lease, w.rep)) is released only when haHostEmpty(rt) reads the host slice empty; otherwise it logs, marks the stop uncertain and retains the wake as unproven (retainUnprovenWake, with owedBy for a legacy start), keeping the lease and replica for the reaper. A non-HA wake's stop, proofs and give-back are unchanged. New sites +registry:Host (the log line) and +whole:Route x3 (rt to haHostEmpty and in the retained unprovenWake); no file read; only holds an HA release back;rev3=census-ruling-rootfs-apps-3-release;basis=rootfs Plan 3 Group R [pf R3.1]: when the wake's own release ended with its unit not proven stopped, the wake's lease is handed to the release record (oweWakeLeaseToRelease) and nothing is given back here; the record gives the lease back only after the unit is proven gone; the same 15 read sites, no read added; only holds a lease back;rev3=census-ruling-stateless-replicas-1;basis=Task 3a: Retain all existing termination proofs and unproven-wake obligations. A proven stateless failed wake has no replica or lease to release; use its actual generation mode, not the refreshed route projection.
- `internal/activator/rootfsworkers.go` `Service.registerRootfsWorkers`: legacy, task accepted-legacy. Basis: accepted-legacy;rev3=census-ruling-rootfs-apps-3-workers;basis=rootfs Plan 3 Group W: the one place a generation's declared workers are registered; reads the workers the generation declares through the existing staged-manifest read of the backend's Processes (the manifest root's staging wrote, checked against the identity's path and digest), registers each as pending on the host's own entry; an unreadable or invalid declaration registers none and web serves; starts nothing;rev3=census-ruling-stateless-replicas-4-task2-fix3;basis=Task 2 fix round 3: each registered worker records its registration time (registered: a.now()), an in-memory field the proof reads; no read added.
- `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.;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. B2 wires the registry as the persistent DutyStore before service startup; no new cloud or filesystem path. B3b: arm one journal-backed termination consumer before service startup using agentCtx and the shared confirmer; expose edge tick and join at edge shutdown. No new direct read sites.;rev3=census-ruling-agent-start-demo-1;basis=Passes the existing registry, data store and hibernation prefix into the demo worker, and the existing instance-control client into the demo before-exec hook. No alternate data store or polling loop. Merge resolution against origin/main 9bd45488 retains main's HA departure controller, lifecycle and duty wiring alongside the demo data store and worker; no read site added by the resolution.;rev3=census-ruling-region-ha-p3a;basis=P3a Task 3: install closed fixed admission before every launch source, bind activator/backend and edge, wire the real termination Started lifecycle and role reader after the change index; close before cancellation/child shutdown. No new external reads or cloud authority. Fix R1: move bind/lifecycle/edge-option wiring into wireAgentAdmission and worker listing into runWorkerBootPassAfterAdmission. Worker boot waits for admission before listing then uses unchanged bounded wakes and per-host serialization; whole Route read moves to the helper. No new storage, cloud, or root execution authority. Preserve merged main's agent wiring and census basis; the branch removes one whole Route use by moving worker iteration to the helper, with no added read kind.;rev3=census-ruling-stateless-replicas-2;basis=Slice 3b: arms a fleet-only worker using the existing registry, activator, backend and authenticated console transport. Owned worker stops and joins at shutdown. No new bucket reader. merge of origin/main 9b8b2c50: retain HA duty/departure lifecycle, wake-slot and existing agent wiring alongside the replica placement worker; no new read introduced by resolution. merge of origin/main 6be08467: Retain main demo configuration, admission, build and expiry wiring alongside the replica worker; merge-only body change, no additional read. merge of origin/main 7920cccf: Retain main box-role/group admission wiring and boot publication beside the owned replica worker and shutdown; main moves the boot registry List into runWorkerBootPassAfterAdmission, removing its inline whole Route site. No new read introduced by conflict resolution.;rev3=census-ruling-stateless-replicas-3;basis=Task 1 fix round 1 M3: retain the private snapshot source and cancel/join ownership, but use the replica-health-specific retry loop. It logs its first failure only and retains the existing exponential backoff capped at 30 seconds; unsupported builds return nil. Existing five direct read sites unchanged; no new credentials, bucket reader or app lifecycle action. Fix round 1 Q20: publish Edge.ReplicaSnapshots as a separate in-memory status source, leaving the tenant-visible Upstreams source unchanged. No new external reader or authority.;rev3=census-ruling-region-ha-p3b;basis=Load root-written group marker/configuration, configure signed boot binding and agent receipt completer, wire cancellable admission into departure work and expose cached GroupReaderSnapshot. New indirect boot reads use protected root files; agent-owned receipt controls duplicate initial completion only, never root restart permission. Same five direct sites. Merge 45cebde4 retains the replica health socket lifecycle and setReplicaSource beside GroupReaderSnapshot; no extra read beyond main.;rev3=census-ruling-agent-start-demo-2;basis=agent.go:309-329 opens demo-traffic.db beside the operator-configured registry when a demo domain exists, closes it at shutdown and wires drain-before-purge; :1010-1019 shares the worker and write gate; :1164-1177 installs the fleet identity and closed-until-worker serving callback. One added whole Route pass; the new indirect filesystem/SQL reads are claimed in openDemoTraffic and worker/store units. No request chooses the database pathname.;rev3=census-ruling-region-ha-p1b3b-s;basis=Wire the service duty view to authoritative cached sidecar manifest placement in LifetimeIndex and the edge sidecar projection; missing policy denies duty. Existing instance duty wiring remains.;rev3=census-ruling-region-ha-g2-t3;basis=T3a: wire eb.Page = PageOperator beside OwnerTerminated before departures arm, so suspect-holder pages work if departure setup fails; no new read; existing nine sites and authority unchanged; pages through the existing sink. T3b: publish the same backend through an atomic pointer for the metrics observer, and clear it on return; no new external read or authority.;rev3=census-ruling-agent-start-demo-3;basis=Wire the claim activator and root snapshot client into the demo worker; pass moved readiness to status reporting. Census read-site delta: unchanged (9).;rev3=census-ruling-region-ha-g2-fixes;basis=Wire local pool evidence, live withdrawal activator, startup ingress scan and alias publication, and edge lookup; no new direct sites; new indirect record/claim reads use existing store/judge paths described in ingress helpers.;rev3=census-ruling-region-ha-g2r-fixes;basis=W3: starts the existing record-view backstop loop with a departure-inventory listener (non-blocking, coalesced signal) even without an armed RecordView; it requests the existing full pass (backstopFullDue) there. Same nine read sites; no new read or authority.;rev3=census-ruling-region-ha-graceful-terminate-t2;basis=Derive one signal-time deadline with a 90-second budget; cap departure stop and startup/seed/service shutdown joins by it. No read added.;rev3=census-ruling-static-sweep-periodic;basis=in the edge-ready callback, publishes e.LargestStaticTree in staticTreeSource for the disk alert line (diskAlertFrac in the metrics loop); in-memory wiring only, no read added; read sites unchanged (9);rev3=census-ruling-edge-page-cache-1;basis=wires the exec backend's CurrentInputs into the edge cache (wireCurrentInputs) and, in the ready hook after armEdgeAssetCache (whose returned store it now keeps), calls armEdgePageCache, which does nothing unless CARLOS_PAGE_CACHE=1; read sites unchanged (9); no read added;rev3=census-ruling-gvisor-demos;basis=Capture sandbox resolution and refusal once; log errors once; gate route admission and BeforeExec before process launch. No new root read. Task 5: pass the once-captured sandbox effective mode/config error into ExecBackend, UnitBackend and the immutable Client expectation. Same startup environment/registry reads; swapArming declines gVisor before placement. Task 8: arm read-only status projection with the existing Client.SandboxStatus callback. Agent status now queries the existing root /ready endpoint; no new root authority or guest-file input. Merge2 e8a1ddde: retain main wireCurrentInputs and armEdgePageCache through the existing asset-store ready hook alongside branch once-captured sandbox mode, wake gates and root status wiring. No new direct read; main page-cache helpers retain their own census overlays.;rev3=census-ruling-region-ha-held-build;basis=wires the drain state: svc.SetDrainingSource(boxDrain.IsDraining), svc.SetPeerDrainView(e.PeerDraining), e.SetPeerDrainedHook(svc.DropHoldersNaming); in-memory only; no read added; region HA held-requests Task 5: on group members, starts the drain driver over the activator, the edge and boxDrain, and serves its root-only drain socket; no read added beyond the socket's own Branch review r1: the drain state follows the root start fence on group members (the fence reader is the existing fenceLocation.read, a root-owned fixed path); e.SetPeerUndrainedHook(svc.AllowHoldersNaming) beside the drained hook (memory only); the drain socket serves only the agent's own user. No read added.;rev3=census-ruling-security-review-mitigations;basis=Wire the cached operator flat-layout choice into the exec backend's new-resident refusal; no read source added, existing authority retained.;rev3=census-ruling-w6-ingress-drain;basis=agent (user carlos), not root. Builds the ingress drain (newIngressDrain) with arming read at ask time from os.Getenv (CARLOS_REGION_HA, CARLOS_INGRESS_TARGET_GROUPS, both from the root-owned host.env), the fixed admission and lease.CurrentSelf (existing IMDS identity); its reader is awstg.Load, the box role's credentials calling ELB DescribeTargetHealth/DescribeTargetGroupAttributes (new AWS reads, by the agent). Wires admission.closeStartsForIngressDrain, the lbhealth drain condition, ingress.setEdge, and ingress.shutdownStarted in WithShutdownStarted. The drain socket (/run/carlos/.ha-drain/drain.sock, agent-user only, existing) is now also served on a fixed box with the drain configured (was group members only), routing /v1/ingress/* to the ingress drain and the group drain verbs to 404 there. armHADepartures now takes fixtureDepartureGetenv() and MakeQueue fixtureDepartureQueue(), which in a production (non-rootrunner) build are os.Getenv and nil, as before. Read sites unchanged (9).;rev3=census-ruling-stateless-replicas-4-task1;basis=Arms the fleet-only replica swap worker next to the placement worker: same console URL and fleet token as the existing replicaCoordinatorAPI, the existing activator Service; stops and joins at shutdown. No new read site, credential or bucket reader.;rev3=census-ruling-stateless-replicas-4-task2;basis=Task 2: sets deployWorker.step to the rollout scheduler answer for the record permit (replicaStepOf over armedRollout), an in-memory callback; no read site, credential or bucket reader added.;rev3=census-ruling-stateless-replicas-4-task2-fix2;basis=Task 2 fix round 2: the swap worker step is armedReplicaStep, the same lazy scheduler lookup as before as a named function; no read site added.;rev3=census-ruling-stateless-replicas-4-merge-main;basis=Merge of main 5fac2ff1: both sides changed it. Main (01d6ca78, linked-deployments-slice1) starts linkLoop beside tunnelLoop; this branch keeps its replica coordinator wiring. Both kept as-is; no read added.
- `internal/activator/replicadeploy.go` `Service.ReplicaSwap`: legacy, task accepted-legacy. Basis: accepted-legacy;rev3=census-ruling-stateless-replicas-4-task2;basis=Task 2: new. Checks the permit (box label, phase released, not halted, ActiveBox, build), refuses a hold, asks tenantStartRefusal on the in-memory entry route, then either re-proves an existing switch (replicaSettle) or runs the existing Swap as a canary and checks replicaStepProven. Reads the in-memory entry route only; no store, file or root call of its own.;rev3=census-ruling-stateless-replicas-4-task2-fix1;basis=Task 2 fix round 1: proof-only steps (an already switched copy, a halted permit, a permit whose successor failed here) skip the start gates because nothing starts; a failed successor answers kept only after replicaKeptProven (its stop proven, an empty operation set). Reads only the in-memory entry route; no store, file or root call.;rev3=census-ruling-stateless-replicas-4-task2-fix2;basis=Task 2 fix round 2: the switch proof is replicaSwitchProof, which also reports WorkersFailed (switched, the new workers crashed or did not start within the settle window) so the step answers instead of staying open. Reads only the in-memory entry; no store, file or root call.;rev3=census-ruling-stateless-replicas-4-task2-fix3;basis=Task 2 fix round 3: replicaSwitchProof keeps the step open while a worker start is in flight or a gate-refused start waits for its retry, and judges a never-started worker only after residentPoll + workerStartBound from registration (Service clock); a crash or restart still answers workers failed. Reads only the in-memory entry; no store, file or root call.
@@ -30,6 +32,6 @@ New dispositions, which census-propose wrote and the reviewer checks against the
- new `internal/rollout/replicas.go:Manager.DriveReplicaRelease`: reads +registry:App, +registry:FleetBoxes, +registry:ReplicaIncarnation, +whole:Route ×4; written legacy, accepted-legacy, frozen
- new `internal/rollout/replicas.go:Manager.proofOnlyAttempt`: reads +file:Stat, +registry:App, +whole:Route; written legacy, accepted-legacy, frozen
-Seal: `93c4edaeb1b8b692499da65ae7649217787cf996e9739ea0bf9ad0f229885ec7` → `8d27f2345572f43c3bd49a3db38e2429e648f981b7e31288f49a32fedc5e89dd`.
+Seal: `93c4edaeb1b8b692499da65ae7649217787cf996e9739ea0bf9ad0f229885ec7` → `52cf21b091a6a5a0c954bd92f60401dbd335806712024c2b736d50c532438564`.
Overlay: `internal/provision/testdata/plan14-root-reads-stateless-replicas-4-final.tsv`, appended to `internal/provision/testdata/plan14-root-reads-chain.tsv`.
diff --git a/internal/activator/maintenance.go b/internal/activator/maintenance.go
index 86915f0d9..4786173e8 100644
--- a/internal/activator/maintenance.go
+++ b/internal/activator/maintenance.go
@@ -444,7 +444,8 @@ func (a *Service) cleanupFailedWake(ctx context.Context, e *actEntry, rt registr
w.stopOutcome.replicaClosed = true
}
}
- if !legacy && (a.gens || w.genUnproven || w.proc != nil) && !a.failedWakeStopped(rt, w.gen, w.proc, w.launchLayout) {
+ checked := !legacy && (a.gens || w.genUnproven || w.proc != nil)
+ if checked && !a.failedWakeStopped(rt, w.gen, w.proc, w.launchLayout) {
// Its leader did not exit (ErrStillRunning, a failed kill) or its
// child is not proven empty.
w.stopOutcome.mainExited = false
@@ -492,6 +493,21 @@ func (a *Service) cleanupFailedWake(ctx context.Context, e *actEntry, rt registr
}
if w.gen.Stateless && lease == nil {
w.stopOutcome.replicaClosed, w.stopOutcome.leaseReleased = true, true
+ // A stateless wake's only uncertainty is its generation (it
+ // starts no replica, and its sidecar comes after a healthy start).
+ // Proven stopped above, that uncertainty is discharged, as the
+ // reaper discharges a retained one: otherwise StopUncertain stays
+ // true with no retained wake left to clear it, and a restarted
+ // permit holder's failed cold wake wedges its permit (#511, P1b).
+ // A legacy start's proof already did this; a start left with an
+ // unproven legacy unit, or with nothing proven, keeps it.
+ if checked && !w.legacyUncertain {
+ w.stopOutcome.mainStop, w.stopOutcome.mainExited = true, true
+ w.stopOutcome.uncertain = false
+ if w.sidecar == nil {
+ w.stopOutcome.sidecarStop, w.stopOutcome.sidecarExited = true, true
+ }
+ }
return
}
w.stopOutcome.leaseReleased = a.giveBack(ctx, rt.Host, lease)
diff --git a/internal/activator/replicaswitchfail_test.go b/internal/activator/replicaswitchfail_test.go
index d2fc8ed1c..15994e16b 100644
--- a/internal/activator/replicaswitchfail_test.go
+++ b/internal/activator/replicaswitchfail_test.go
@@ -203,6 +203,108 @@ func TestReplicaRestartedHolderResolves(t *testing.T) {
}
}
+// TestReplicaRestartedHolderStartedWakeFails (#511, P1b after start;
+// Astra final re-review 2, concern 2): as TestReplicaRestartedHolderResolves,
+// but each cold wake of the target STARTS and then fails its health check.
+// Its cleanup proves the generation stopped, so the stop is complete and,
+// past replicaRestartBound, the permit resolves "switched, failed" and a
+// retry can begin. Unproven (the started generation does not stop), the
+// stop stays uncertain and the step stays open.
+func TestReplicaRestartedHolderStartedWakeFails(t *testing.T) {
+ for _, proven := range []bool{true, false} {
+ name := "stop proven"
+ if !proven {
+ name = "stop not proven"
+ }
+ t.Run(name, func(t *testing.T) {
+ r, _ := switchedRig(t)
+ r.a.mu.Lock()
+ n := r.a.entries[r.rt.Host].gen.N
+ r.a.mu.Unlock()
+ r.b.procOf(n).exit()
+ r.a.sweepOnce()
+ waitFor(t, "the recycled entry", func() bool {
+ r.a.mu.Lock()
+ defer r.a.mu.Unlock()
+ return r.a.entries[r.rt.Host] == nil
+ })
+ r.a.mu.Lock()
+ r.a.replicaSwitched, r.a.replicaFailed, r.a.replicaPolicies, r.a.replicaNoGen = nil, nil, nil, nil
+ r.a.stopHistory = nil
+ r.a.mu.Unlock()
+ // Every cold wake of the target starts its generation, which
+ // then fails its health check. Unproven, the started process
+ // does not stop when asked.
+ var started []*fakeProc
+ r.a.genHealth = func(_ context.Context, g Gen) error {
+ if g.Build != "v2" {
+ return nil
+ }
+ p := r.b.procOf(g.N)
+ started = append(started, p)
+ if !proven {
+ p.mu.Lock()
+ p.stuck = true
+ p.mu.Unlock()
+ t.Cleanup(p.exit)
+ }
+ return errors.New("GET / answered 500")
+ }
+ coldWake := func() {
+ t.Helper()
+ r.setPlan(WakePlan{Boot: r.next, Mode: ModeOverlap, Token: 2})
+ if err := waitErr(t, r.wake(r.a)); err == nil {
+ t.Fatal("the cold wake served")
+ }
+ r.a.mu.Lock()
+ defer r.a.mu.Unlock()
+ if r.a.entries[r.rt.Host] != nil {
+ t.Fatal("a failed cold wake left a generation")
+ }
+ }
+ at := Attempt{Host: r.rt.Host, Cause: CauseRelease, Build: "v2", Mode: ModeOverlap, SchedRev: 1, ProofOnly: true, StagedPath: r.next.StagedPath}
+ step := func() SwapResult {
+ return r.a.ReplicaSwap(context.Background(), at, *r.store.snapshot(), "b", newestOne)
+ }
+ // Past the resident backoff the web's death started, so the
+ // cold wake reaches its start.
+ r.clk.advance(time.Minute)
+ coldWake()
+ if len(started) == 0 {
+ t.Fatal("the cold wake did not start its generation")
+ }
+ if got := r.a.StopUncertain(r.rt.Host); got == proven {
+ t.Fatalf("StopUncertain = %t after a failed started wake, stop proven %t", got, proven)
+ }
+ if res := step(); res.Proven || res.WebFailed {
+ t.Fatalf("answered with no bound passed: %+v", res)
+ }
+ r.clk.advance(replicaRestartBound + time.Second)
+ res := step()
+ if !proven {
+ if res.Proven || res.WebFailed {
+ t.Fatalf("answered over an unproven stop: %+v", res)
+ }
+ if !r.a.StopUncertain(r.rt.Host) || !r.store.snapshot().PermitOutstanding() {
+ t.Fatal("an unproven stop let the permit resolve")
+ }
+ return
+ }
+ webFailedAnswer(t, r, res)
+ cur := *r.store.snapshot()
+ ack := replicas.DeployChange{Op: "ack", ID: cur.ID, Box: "b", Revision: cur.Revision, Target: cur.Target, Permit: cur.Swap.Permit, Switched: true, WebFailed: true}
+ next, err := replicas.NextDeploy(cur, ack, replicas.Coordinator{}, time.Now())
+ if err != nil || next.PermitOutstanding() || !next.Swap.Halted || next.Swap.WebFailed != "b" || !replicas.Retryable(&next) {
+ t.Fatalf("ack: %v %+v", err, next.Swap)
+ }
+ next.RetryOf = next.ID
+ if err := replicas.NewAttemptAllowed(&next, replicas.Deploy{ID: "deploy-v2-retry", Incarnation: next.Incarnation, Target: next.Target, Phase: "pending", RetryOf: next.ID}); err != nil {
+ t.Fatalf("retry refused: %v", err)
+ }
+ })
+ }
+}
+
// TestReplicaUnreadableWorkersAreFailedWorkers (#511 final wave, item 4;
// Astra I4): a generation whose worker declaration could not be read
// registered nothing, and its switch proof answers workers failed, never
diff --git a/internal/provision/testdata/plan14-root-reads-chain.tsv b/internal/provision/testdata/plan14-root-reads-chain.tsv
index a5655eff1..34759f26b 100644
--- a/internal/provision/testdata/plan14-root-reads-chain.tsv
+++ b/internal/provision/testdata/plan14-root-reads-chain.tsv
@@ -185,4 +185,4 @@ plan14-root-reads-stateless-replicas-4-task3.tsv e69d405a8729ff5d74817448f3c36bb
plan14-root-reads-stateless-replicas-4-task3f.tsv 2b9fbe8fe47f96f2f5fc54665c851df40839dbd3ac3493d386425532737a2bc1
plan14-root-reads-stateless-replicas-4-task5.tsv 76928a781fc03ae001dce640d4e7543f09a0e51a9a70312d716999a086b1353c
plan14-root-reads-stateless-replicas-4-merge-main.tsv 93c4edaeb1b8b692499da65ae7649217787cf996e9739ea0bf9ad0f229885ec7
-plan14-root-reads-stateless-replicas-4-final.tsv 8d27f2345572f43c3bd49a3db38e2429e648f981b7e31288f49a32fedc5e89dd
+plan14-root-reads-stateless-replicas-4-final.tsv 52cf21b091a6a5a0c954bd92f60401dbd335806712024c2b736d50c532438564
diff --git a/internal/provision/testdata/plan14-root-reads-stateless-replicas-4-final.tsv b/internal/provision/testdata/plan14-root-reads-stateless-replicas-4-final.tsv
index 7cc2d972b..592a82ce9 100644
--- a/internal/provision/testdata/plan14-root-reads-stateless-replicas-4-final.tsv
+++ b/internal/provision/testdata/plan14-root-reads-stateless-replicas-4-final.tsv
@@ -1,6 +1,7 @@
# Census overlay stateless-replicas-4-final, written by census-propose (#369). census-ruling-stateless-replicas-4-final, approved on #280 before the merge; the approval card is docs/superpowers/notes/census-proposal-stateless-replicas-4-final.md.
-# 3 body, 2 sites, 7 envelope: each changed unit re-frozen at its existing disposition with its claim appended.
+# 4 body, 2 sites, 7 envelope: each changed unit re-frozen at its existing disposition with its claim appended.
# 5 new dispositions: 0 reads re-frozen at their disposition with the claim, 5 new units frozen accepted-legacy, 0 quiet units retired while they read nothing, 0 other.
+@legacy c7a750ff57a3d570e6a1da163ad3b28ab5f432495e5e5fd4b5ff5f19f838110b internal/activator/maintenance.go Service.cleanupFailedWake legacy accepted-legacy accepted-legacy;rev3=census-ruling-292fix;basis=the agent (/opt/carlos/carlos agent, carlos-edge.service, user carlos): census ruling 292's body; when #292's whole proof holds for an aborted legacy start (legacyRunGone: the unit stopped and its cgroup empty) this wake's uncertainty is discharged and the stages it never reached (no sidecar, no replica) are recorded as held; when the proof fails the start is retained exactly as before, now named as the owner of this wake's uncertainty (owedBy). Read sites unchanged; the proof still only decides release-or-keep; no new read and no root decision;rev3=census-ruling-region-ha-p1a;basis=the agent as carlos: takes the wake's entry e as a new first argument and, when it is not nil, stops and joins the entry's HA files publisher (stopFiles) before anything else. Final fix F1: once the process's own proof has passed, an HA wake (haHeld(lease, w.rep)) is released only when haHostEmpty(rt) reads the host slice empty; otherwise it logs, marks the stop uncertain and retains the wake as unproven (retainUnprovenWake, with owedBy for a legacy start), keeping the lease and replica for the reaper. A non-HA wake's stop, proofs and give-back are unchanged. New sites +registry:Host (the log line) and +whole:Route x3 (rt to haHostEmpty and in the retained unprovenWake); no file read; only holds an HA release back;rev3=census-ruling-rootfs-apps-3-release;basis=rootfs Plan 3 Group R [pf R3.1]: when the wake's own release ended with its unit not proven stopped, the wake's lease is handed to the release record (oweWakeLeaseToRelease) and nothing is given back here; the record gives the lease back only after the unit is proven gone; the same 15 read sites, no read added; only holds a lease back;rev3=census-ruling-stateless-replicas-1;basis=Task 3a: Retain all existing termination proofs and unproven-wake obligations. A proven stateless failed wake has no replica or lease to release; use its actual generation mode, not the refreshed route projection.;rev3=census-ruling-stateless-replicas-4-final;basis=#511 P1b after start (final re-review 2, concern 2): when a stateless wake's failed generation is proven stopped by the proof that already ran here (failedWakeStopped), the stateless branch also records the stop as complete (main stopped and exited, uncertainty cleared, sidecar stages held when the wake started none), as the reaper does for a retained one; an unproven stop, a legacy start left unproven, or a wake with nothing proven keeps its uncertainty. The same 15 read sites; no read added; no root decision registry:Host@2332,registry:Host@2845,registry:Host@3816,registry:Host@4156,registry:Host@4848,registry:Host@6483,whole:Route@2199,whole:Route@2438,whole:Route@2442,whole:Route@3498,whole:Route@4181,whole:Route@4185,whole:Route@4751,whole:Route@4884,whole:Route@4888 fd3a9115502770879d8ee6ae1e412c5805206aeeae1660c3eec3315f56136163
@legacy a34916ddc5704dc7ef9be9b8ceddf7e25f3d25dc97a3350b9bf9013fbe1893bc internal/activator/rootfsworkers.go Service.registerRootfsWorkers legacy accepted-legacy accepted-legacy;rev3=census-ruling-rootfs-apps-3-workers;basis=rootfs Plan 3 Group W: the one place a generation's declared workers are registered; reads the workers the generation declares through the existing staged-manifest read of the backend's Processes (the manifest root's staging wrote, checked against the identity's path and digest), registers each as pending on the host's own entry; an unreadable or invalid declaration registers none and web serves; starts nothing;rev3=census-ruling-stateless-replicas-4-task2-fix3;basis=Task 2 fix round 3: each registered worker records its registration time (registered: a.now()), an in-memory field the proof reads; no read added.;rev3=census-ruling-stateless-replicas-4-final;basis=#511 final wave item 4: a failed worker registration (unreadable or invalid declaration, no worker backend, no staged identity) now also records the generation on the entry (workersUnregistered) under a.mu; the same declaration read as before, no read added registry:Host@1125,registry:Host@1311,registry:Host@610,registry:Host@823,whole:Route@475 844e8909e88752166a3b92a297a408841a45e745982c83ad4151601c88d87bf6
@legacy 2dc393d1099043d32479bc6c04f7a0e6d0cf8a578d1dc4ffa5e8747226b006e4 internal/activator/replicadeploy.go Service.replicaRestartedFailure legacy accepted-legacy accepted-legacy;rev3=census-ruling-stateless-replicas-4-final;basis=#511 micro-fix P1b (new): for an always-on set row holding this box's permit with no entry and no switch evidence, reads the host's registry row (Routes.Get: Resident, FleetBoxes, ReplicaIncarnation) and stats at.StagedPath (the root-staged release.VersionPath the rollout named; metadata only, never opened, read or run); past replicaRestartBound it fences (FenceAndStopAs), checks releaseOps and StopUncertain, lifts its own fence (LiftFenceAs) and answers switched-failed; starts nothing file:Stat@483,registry:FleetBoxes@367,registry:ReplicaIncarnation@390,whole:Route@336 b63c3eb2a1b337b4a0555dedd38eee637f7842a8d9fc166795b6ee306493356d
@legacy 8d34823ae162690b8f94eb4524c26297141e722c1c0831c9d64b86409ac1c3ca internal/activator/replicadeploy.go Service.replicaSwitchFailure legacy accepted-legacy accepted-legacy;rev3=census-ruling-stateless-replicas-4-final;basis=#511 final wave item 3 (new): for a set row that switched under a permit, reads the host's own activator entry (route, generation) under a.mu, asks genHealthy past replicaWebFailBound, and stops the failed generation with proof through the existing FenceAndStopAs/LiftFenceAs; the Route reads are the entry's in-memory registry row, no path, file or tenant input; #511 micro-fix P2: snapshots whether the entry is awake under a.mu instead of reading e.state after the unlock; no read added whole:Route@435,whole:Route@447,whole:Route@636 f82af6fd86450f86ab9699815d582d19f0eb697b03b0e628506fe0381c88b1a2
@@ -10,6 +11,7 @@
@legacy 5eed85bad6a7c4ce4649c6f42570b98ab71dff9558797f40674d6cb84870565d internal/activator/replicadeploy.go Service.ReplicaSwap legacy accepted-legacy accepted-legacy;rev3=census-ruling-stateless-replicas-4-task2;basis=Task 2: new. Checks the permit (box label, phase released, not halted, ActiveBox, build), refuses a hold, asks tenantStartRefusal on the in-memory entry route, then either re-proves an existing switch (replicaSettle) or runs the existing Swap as a canary and checks replicaStepProven. Reads the in-memory entry route only; no store, file or root call of its own.;rev3=census-ruling-stateless-replicas-4-task2-fix1;basis=Task 2 fix round 1: proof-only steps (an already switched copy, a halted permit, a permit whose successor failed here) skip the start gates because nothing starts; a failed successor answers kept only after replicaKeptProven (its stop proven, an empty operation set). Reads only the in-memory entry route; no store, file or root call.;rev3=census-ruling-stateless-replicas-4-task2-fix2;basis=Task 2 fix round 2: the switch proof is replicaSwitchProof, which also reports WorkersFailed (switched, the new workers crashed or did not start within the settle window) so the step answers instead of staying open. Reads only the in-memory entry; no store, file or root call.;rev3=census-ruling-stateless-replicas-4-task2-fix3;basis=Task 2 fix round 3: replicaSwitchProof keeps the step open while a worker start is in flight or a gate-refused start waits for its retry, and judges a never-started worker only after residentPoll + workerStartBound from registration (Service clock); a crash or restart still answers workers failed. Reads only the in-memory entry; no store, file or root call.;rev3=census-ruling-stateless-replicas-4-final;basis=#511 final wave item 3: records the switch per permit (noteReplicaSwitch) and, for a later step of that permit, replicaSwitchFailure may stop the switched generation with proof (FenceAndStopAs, LiftFenceAs) and answer switched-failed; the two new whole:Route sites pass the entry's route (already held) to noteReplicaSwitch for its Resident flag; no new path, file or input read; #511 micro-fix: clears replicaNoGen while the copy is awake; with no switch evidence and no entry, asks replicaRestartedFailure; a ProofOnly attempt (a sleeping copy's step) abandons before Swap or any start gate; no new read site registry:FleetBoxes@1837,whole:Route@2199,whole:Route@2733,whole:Route@2978,whole:Route@557,whole:Route@567 3fdf514278e4e1da500d4605907063a09838db3a47403687972bad56febd31de
@legacy 226e1624fe58bc0b25c9877596e475371aa5597acf2a0a528026506a14ab1ad1 internal/rollout/scheduler.go scheduler.execute legacy accepted-legacy accepted-legacy;rev3=J1;basis=root-route;rev3=census-ruling-stateless-replicas-4-task2;basis=Task 2: a dispatch marked Replica (this box permitted step) calls Manager.replicaStep, which calls activator ReplicaSwap, instead of Swap, and emits the swapping event only when the step moves; the added Host and whole Route reads are the same registry row this unit already reads (rt). Agent, not root.;rev3=census-ruling-stateless-replicas-4-final;basis=#511 final wave item 3: the swapping event for a replica step is emitted only for an awake copy on another build, so a sleeping permit holder's proof-only step emits none; no read added; #511 micro-fix (cost): a ProofOnly replica dispatch whose copy is still asleep (Act.Current) skips resolve (no staging, manifest read or hash) and takes Manager.proofOnlyAttempt; every other dispatch resolves as before; the added Host and whole Route sites are the same registry row this unit already reads (rt) registry:App@436,registry:GoodVersion@1739,registry:GoodVersion@1777,registry:Host@2958,registry:Host@5156,registry:Host@6163,registry:Host@6408,whole:Route@129,whole:Route@3225,whole:Route@3269,whole:Route@3312,whole:Route@3746,whole:Route@386,whole:Route@415,whole:Route@6118,whole:Route@6456,whole:Route@6590 7f34270be36dacd7e07097864f96a3f6a8fdcce853299c2384871dadcac814fd
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-wake-storm-cap;basis=the agent as carlos: one field, wakeSlots (chan struct{}, the wake semaphore made by New from Config.WakeSlots, default 4); declaration only, no read.;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. B2 adds the verified-successor identity callback; no read in the declaration. B3b adds a nonblocking departure-suspicion callback, invoked only after an accepted holder-forward failure and after cache locks release; it cannot authorize a take.;rev3=census-ruling-region-ha-p3a;basis=P3a Task 3: immutable callbacks installed before Start for tenant admission, local start permission, fixed route exemptions and shutdown closure; nil callbacks preserve switch-off behavior; no new reads. Fix R1: add an immutable startup-phase callback for response copy, set before service startup. No new read or execution authority.;rev3=census-ruling-region-ha-g2-fixes;basis=Add in-memory HA loss state and pool withdrawal jobs; no new read.;rev3=census-ruling-region-ha-held-build;basis=region HA held-requests Task 1: one new field, drain (drainSources: two atomic func pointers for this box's and peers' drain state); no read added. region HA held-requests Task 2: one new field, moves (moveTable: per-host move state, hold counts and admission tickets in memory, under mu); no read added;rev3=census-ruling-held-move-speed;basis=the agent as carlos: one new field, moveStreams (per-host in-memory set of edge.StreamEnd for requests in flight, own mutex), for the move's early stream cut; actEntry gains drainRelease (bool, under a.mu), set by DrainStop; declarations only, no read added;rev3=census-ruling-fix-silent-start-kill-861;basis=#861: two fields, wakeFailMu and wakeFailLogged (per-host in-memory note of the last journalled wake failure); declaration only, no read;rev3=census-ruling-w6-ingress-drain;basis=new field TenantStartsClosed func() bool; when it answers true tenantStartRefusal refuses every start, exempt routes included. Wired only by fixedAdmission.bind to the ingress drain's closed flag. Struct field only; no read added.;rev3=census-ruling-stateless-replicas-4-task2;basis=Task 2: one field, replicaPolicies (host to the newest observed replica deploy and this box label, under mu), set only by SetReplicaDeploy; declaration only, no read.;rev3=census-ruling-stateless-replicas-4-task2-fix1;basis=Task 2 fix round 1: one more in-memory field, replicaFailed (host to the permit whose successor failed here, under mu), so that step only proves what it kept; declaration only, no read.;rev3=census-ruling-stateless-replicas-4-task3f;basis=Task 3F fix round 3 (#511 F11): two hook fields, MarkReplicaRelease and ReplicaReleaseMark (the failure book's per-host release mark on this box's disk). No read site.;rev3=census-ruling-stateless-replicas-4-task5;basis=Task 5 first commit (#511 F11): one in-memory field, heldSeen (host to the last held release attempt, error class and when it was met), under the existing wakeFailMu. Declaration only, no read.;rev3=census-ruling-stateless-replicas-4-merge-main;basis=Merge of main 5fac2ff1: both sides changed it. Main (27d3f501) adds the background atomic.Int64 field that tests wait on; this branch keeps its replica fields. Both kept as-is; no read added.;rev3=census-ruling-stateless-replicas-4-final;basis=#511 final wave item 3: adds replicaSwitched, an in-memory map of the permit each set row switched under (host -> permit key, time, resident flag); no read added; #511 micro-fix P1b: adds replicaNoGen, an in-memory map (host -> permit key and when first seen) that is only the bound's clock for a restarted permit holder with no generation; no read added 67800134553f072daba7481cddbdb55b41778c92203eb0f2eef705f9dde000cf
+internal/activator/maintenance.go Service.cleanupFailedWake legacy accepted-legacy accepted-legacy;rev3=census-ruling-292fix;basis=the agent (/opt/carlos/carlos agent, carlos-edge.service, user carlos): census ruling 292's body; when #292's whole proof holds for an aborted legacy start (legacyRunGone: the unit stopped and its cgroup empty) this wake's uncertainty is discharged and the stages it never reached (no sidecar, no replica) are recorded as held; when the proof fails the start is retained exactly as before, now named as the owner of this wake's uncertainty (owedBy). Read sites unchanged; the proof still only decides release-or-keep; no new read and no root decision;rev3=census-ruling-region-ha-p1a;basis=the agent as carlos: takes the wake's entry e as a new first argument and, when it is not nil, stops and joins the entry's HA files publisher (stopFiles) before anything else. Final fix F1: once the process's own proof has passed, an HA wake (haHeld(lease, w.rep)) is released only when haHostEmpty(rt) reads the host slice empty; otherwise it logs, marks the stop uncertain and retains the wake as unproven (retainUnprovenWake, with owedBy for a legacy start), keeping the lease and replica for the reaper. A non-HA wake's stop, proofs and give-back are unchanged. New sites +registry:Host (the log line) and +whole:Route x3 (rt to haHostEmpty and in the retained unprovenWake); no file read; only holds an HA release back;rev3=census-ruling-rootfs-apps-3-release;basis=rootfs Plan 3 Group R [pf R3.1]: when the wake's own release ended with its unit not proven stopped, the wake's lease is handed to the release record (oweWakeLeaseToRelease) and nothing is given back here; the record gives the lease back only after the unit is proven gone; the same 15 read sites, no read added; only holds a lease back;rev3=census-ruling-stateless-replicas-1;basis=Task 3a: Retain all existing termination proofs and unproven-wake obligations. A proven stateless failed wake has no replica or lease to release; use its actual generation mode, not the refreshed route projection.;rev3=census-ruling-stateless-replicas-4-final;basis=#511 P1b after start (final re-review 2, concern 2): when a stateless wake's failed generation is proven stopped by the proof that already ran here (failedWakeStopped), the stateless branch also records the stop as complete (main stopped and exited, uncertainty cleared, sidecar stages held when the wake started none), as the reaper does for a retained one; an unproven stop, a legacy start left unproven, or a wake with nothing proven keeps its uncertainty. The same 15 read sites; no read added; no root decision registry:Host@2332,registry:Host@2845,registry:Host@3816,registry:Host@4156,registry:Host@4848,registry:Host@6483,whole:Route@2199,whole:Route@2438,whole:Route@2442,whole:Route@3498,whole:Route@4181,whole:Route@4185,whole:Route@4751,whole:Route@4884,whole:Route@4888 fd3a9115502770879d8ee6ae1e412c5805206aeeae1660c3eec3315f56136163
internal/activator/rootfsworkers.go Service.registerRootfsWorkers legacy accepted-legacy accepted-legacy;rev3=census-ruling-rootfs-apps-3-workers;basis=rootfs Plan 3 Group W: the one place a generation's declared workers are registered; reads the workers the generation declares through the existing staged-manifest read of the backend's Processes (the manifest root's staging wrote, checked against the identity's path and digest), registers each as pending on the host's own entry; an unreadable or invalid declaration registers none and web serves; starts nothing;rev3=census-ruling-stateless-replicas-4-task2-fix3;basis=Task 2 fix round 3: each registered worker records its registration time (registered: a.now()), an in-memory field the proof reads; no read added.;rev3=census-ruling-stateless-replicas-4-final;basis=#511 final wave item 4: a failed worker registration (unreadable or invalid declaration, no worker backend, no staged identity) now also records the generation on the entry (workersUnregistered) under a.mu; the same declaration read as before, no read added registry:Host@1125,registry:Host@1311,registry:Host@610,registry:Host@823,whole:Route@475 844e8909e88752166a3b92a297a408841a45e745982c83ad4151601c88d87bf6
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. B2 wires the registry as the persistent DutyStore before service startup; no new cloud or filesystem path. B3b: arm one journal-backed termination consumer before service startup using agentCtx and the shared confirmer; expose edge tick and join at edge shutdown. No new direct read sites.;rev3=census-ruling-agent-start-demo-1;basis=Passes the existing registry, data store and hibernation prefix into the demo worker, and the existing instance-control client into the demo before-exec hook. No alternate data store or polling loop. Merge resolution against origin/main 9bd45488 retains main's HA departure controller, lifecycle and duty wiring alongside the demo data store and worker; no read site added by the resolution.;rev3=census-ruling-region-ha-p3a;basis=P3a Task 3: install closed fixed admission before every launch source, bind activator/backend and edge, wire the real termination Started lifecycle and role reader after the change index; close before cancellation/child shutdown. No new external reads or cloud authority. Fix R1: move bind/lifecycle/edge-option wiring into wireAgentAdmission and worker listing into runWorkerBootPassAfterAdmission. Worker boot waits for admission before listing then uses unchanged bounded wakes and per-host serialization; whole Route read moves to the helper. No new storage, cloud, or root execution authority. Preserve merged main's agent wiring and census basis; the branch removes one whole Route use by moving worker iteration to the helper, with no added read kind.;rev3=census-ruling-stateless-replicas-2;basis=Slice 3b: arms a fleet-only worker using the existing registry, activator, backend and authenticated console transport. Owned worker stops and joins at shutdown. No new bucket reader. merge of origin/main 9b8b2c50: retain HA duty/departure lifecycle, wake-slot and existing agent wiring alongside the replica placement worker; no new read introduced by resolution. merge of origin/main 6be08467: Retain main demo configuration, admission, build and expiry wiring alongside the replica worker; merge-only body change, no additional read. merge of origin/main 7920cccf: Retain main box-role/group admission wiring and boot publication beside the owned replica worker and shutdown; main moves the boot registry List into runWorkerBootPassAfterAdmission, removing its inline whole Route site. No new read introduced by conflict resolution.;rev3=census-ruling-stateless-replicas-3;basis=Task 1 fix round 1 M3: retain the private snapshot source and cancel/join ownership, but use the replica-health-specific retry loop. It logs its first failure only and retains the existing exponential backoff capped at 30 seconds; unsupported builds return nil. Existing five direct read sites unchanged; no new credentials, bucket reader or app lifecycle action. Fix round 1 Q20: publish Edge.ReplicaSnapshots as a separate in-memory status source, leaving the tenant-visible Upstreams source unchanged. No new external reader or authority.;rev3=census-ruling-region-ha-p3b;basis=Load root-written group marker/configuration, configure signed boot binding and agent receipt completer, wire cancellable admission into departure work and expose cached GroupReaderSnapshot. New indirect boot reads use protected root files; agent-owned receipt controls duplicate initial completion only, never root restart permission. Same five direct sites. Merge 45cebde4 retains the replica health socket lifecycle and setReplicaSource beside GroupReaderSnapshot; no extra read beyond main.;rev3=census-ruling-agent-start-demo-2;basis=agent.go:309-329 opens demo-traffic.db beside the operator-configured registry when a demo domain exists, closes it at shutdown and wires drain-before-purge; :1010-1019 shares the worker and write gate; :1164-1177 installs the fleet identity and closed-until-worker serving callback. One added whole Route pass; the new indirect filesystem/SQL reads are claimed in openDemoTraffic and worker/store units. No request chooses the database pathname.;rev3=census-ruling-region-ha-p1b3b-s;basis=Wire the service duty view to authoritative cached sidecar manifest placement in LifetimeIndex and the edge sidecar projection; missing policy denies duty. Existing instance duty wiring remains.;rev3=census-ruling-region-ha-g2-t3;basis=T3a: wire eb.Page = PageOperator beside OwnerTerminated before departures arm, so suspect-holder pages work if departure setup fails; no new read; existing nine sites and authority unchanged; pages through the existing sink. T3b: publish the same backend through an atomic pointer for the metrics observer, and clear it on return; no new external read or authority.;rev3=census-ruling-agent-start-demo-3;basis=Wire the claim activator and root snapshot client into the demo worker; pass moved readiness to status reporting. Census read-site delta: unchanged (9).;rev3=census-ruling-region-ha-g2-fixes;basis=Wire local pool evidence, live withdrawal activator, startup ingress scan and alias publication, and edge lookup; no new direct sites; new indirect record/claim reads use existing store/judge paths described in ingress helpers.;rev3=census-ruling-region-ha-g2r-fixes;basis=W3: starts the existing record-view backstop loop with a departure-inventory listener (non-blocking, coalesced signal) even without an armed RecordView; it requests the existing full pass (backstopFullDue) there. Same nine read sites; no new read or authority.;rev3=census-ruling-region-ha-graceful-terminate-t2;basis=Derive one signal-time deadline with a 90-second budget; cap departure stop and startup/seed/service shutdown joins by it. No read added.;rev3=census-ruling-static-sweep-periodic;basis=in the edge-ready callback, publishes e.LargestStaticTree in staticTreeSource for the disk alert line (diskAlertFrac in the metrics loop); in-memory wiring only, no read added; read sites unchanged (9);rev3=census-ruling-edge-page-cache-1;basis=wires the exec backend's CurrentInputs into the edge cache (wireCurrentInputs) and, in the ready hook after armEdgeAssetCache (whose returned store it now keeps), calls armEdgePageCache, which does nothing unless CARLOS_PAGE_CACHE=1; read sites unchanged (9); no read added;rev3=census-ruling-gvisor-demos;basis=Capture sandbox resolution and refusal once; log errors once; gate route admission and BeforeExec before process launch. No new root read. Task 5: pass the once-captured sandbox effective mode/config error into ExecBackend, UnitBackend and the immutable Client expectation. Same startup environment/registry reads; swapArming declines gVisor before placement. Task 8: arm read-only status projection with the existing Client.SandboxStatus callback. Agent status now queries the existing root /ready endpoint; no new root authority or guest-file input. Merge2 e8a1ddde: retain main wireCurrentInputs and armEdgePageCache through the existing asset-store ready hook alongside branch once-captured sandbox mode, wake gates and root status wiring. No new direct read; main page-cache helpers retain their own census overlays.;rev3=census-ruling-region-ha-held-build;basis=wires the drain state: svc.SetDrainingSource(boxDrain.IsDraining), svc.SetPeerDrainView(e.PeerDraining), e.SetPeerDrainedHook(svc.DropHoldersNaming); in-memory only; no read added; region HA held-requests Task 5: on group members, starts the drain driver over the activator, the edge and boxDrain, and serves its root-only drain socket; no read added beyond the socket's own Branch review r1: the drain state follows the root start fence on group members (the fence reader is the existing fenceLocation.read, a root-owned fixed path); e.SetPeerUndrainedHook(svc.AllowHoldersNaming) beside the drained hook (memory only); the drain socket serves only the agent's own user. No read added.;rev3=census-ruling-security-review-mitigations;basis=Wire the cached operator flat-layout choice into the exec backend's new-resident refusal; no read source added, existing authority retained.;rev3=census-ruling-w6-ingress-drain;basis=agent (user carlos), not root. Builds the ingress drain (newIngressDrain) with arming read at ask time from os.Getenv (CARLOS_REGION_HA, CARLOS_INGRESS_TARGET_GROUPS, both from the root-owned host.env), the fixed admission and lease.CurrentSelf (existing IMDS identity); its reader is awstg.Load, the box role's credentials calling ELB DescribeTargetHealth/DescribeTargetGroupAttributes (new AWS reads, by the agent). Wires admission.closeStartsForIngressDrain, the lbhealth drain condition, ingress.setEdge, and ingress.shutdownStarted in WithShutdownStarted. The drain socket (/run/carlos/.ha-drain/drain.sock, agent-user only, existing) is now also served on a fixed box with the drain configured (was group members only), routing /v1/ingress/* to the ingress drain and the group drain verbs to 404 there. armHADepartures now takes fixtureDepartureGetenv() and MakeQueue fixtureDepartureQueue(), which in a production (non-rootrunner) build are os.Getenv and nil, as before. Read sites unchanged (9).;rev3=census-ruling-stateless-replicas-4-task1;basis=Arms the fleet-only replica swap worker next to the placement worker: same console URL and fleet token as the existing replicaCoordinatorAPI, the existing activator Service; stops and joins at shutdown. No new read site, credential or bucket reader.;rev3=census-ruling-stateless-replicas-4-task2;basis=Task 2: sets deployWorker.step to the rollout scheduler answer for the record permit (replicaStepOf over armedRollout), an in-memory callback; no read site, credential or bucket reader added.;rev3=census-ruling-stateless-replicas-4-task2-fix2;basis=Task 2 fix round 2: the swap worker step is armedReplicaStep, the same lazy scheduler lookup as before as a named function; no read site added.;rev3=census-ruling-stateless-replicas-4-merge-main;basis=Merge of main 5fac2ff1: both sides changed it. Main (01d6ca78, linked-deployments-slice1) starts linkLoop beside tunnelLoop; this branch keeps its replica coordinator wiring. Both kept as-is; no read added.;rev3=census-ruling-stateless-replicas-4-final;basis=#511 final wave item 2: wires the swap worker's drive (armedReplicaDrive, the armed rollout manager's DriveReplicaRelease); no read added file:Exec@20408,file:Open@2191,file:Statfs@55346,registry:App@13287,registry:Host@50710,whole:Route@13279,whole:Route@49057,whole:Route@50833,whole:Route@50895 b3e5fc20dba69f3b1c5f40605efe66b757b0b348d2184799290f58ce8d625375
internal/activator/replicadeploy.go Service.replicaRestartedFailure legacy accepted-legacy accepted-legacy;rev3=census-ruling-stateless-replicas-4-final;basis=#511 micro-fix P1b (new): for an always-on set row holding this box's permit with no entry and no switch evidence, reads the host's registry row (Routes.Get: Resident, FleetBoxes, ReplicaIncarnation) and stats at.StagedPath (the root-staged release.VersionPath the rollout named; metadata only, never opened, read or run); past replicaRestartBound it fences (FenceAndStopAs), checks releaseOps and StopUncertain, lifts its own fence (LiftFenceAs) and answers switched-failed; starts nothing file:Stat@483,registry:FleetBoxes@367,registry:ReplicaIncarnation@390,whole:Route@336 b63c3eb2a1b337b4a0555dedd38eee637f7842a8d9fc166795b6ee306493356d
@@ -20,7 +22,7 @@ internal/rollout/replicas.go Manager.proofOnlyAttempt legacy accepted-legacy acc
internal/activator/replicadeploy.go Service.ReplicaSwap legacy accepted-legacy accepted-legacy;rev3=census-ruling-stateless-replicas-4-task2;basis=Task 2: new. Checks the permit (box label, phase released, not halted, ActiveBox, build), refuses a hold, asks tenantStartRefusal on the in-memory entry route, then either re-proves an existing switch (replicaSettle) or runs the existing Swap as a canary and checks replicaStepProven. Reads the in-memory entry route only; no store, file or root call of its own.;rev3=census-ruling-stateless-replicas-4-task2-fix1;basis=Task 2 fix round 1: proof-only steps (an already switched copy, a halted permit, a permit whose successor failed here) skip the start gates because nothing starts; a failed successor answers kept only after replicaKeptProven (its stop proven, an empty operation set). Reads only the in-memory entry route; no store, file or root call.;rev3=census-ruling-stateless-replicas-4-task2-fix2;basis=Task 2 fix round 2: the switch proof is replicaSwitchProof, which also reports WorkersFailed (switched, the new workers crashed or did not start within the settle window) so the step answers instead of staying open. Reads only the in-memory entry; no store, file or root call.;rev3=census-ruling-stateless-replicas-4-task2-fix3;basis=Task 2 fix round 3: replicaSwitchProof keeps the step open while a worker start is in flight or a gate-refused start waits for its retry, and judges a never-started worker only after residentPoll + workerStartBound from registration (Service clock); a crash or restart still answers workers failed. Reads only the in-memory entry; no store, file or root call.;rev3=census-ruling-stateless-replicas-4-final;basis=#511 final wave item 3: records the switch per permit (noteReplicaSwitch) and, for a later step of that permit, replicaSwitchFailure may stop the switched generation with proof (FenceAndStopAs, LiftFenceAs) and answer switched-failed; the two new whole:Route sites pass the entry's route (already held) to noteReplicaSwitch for its Resident flag; no new path, file or input read; #511 micro-fix: clears replicaNoGen while the copy is awake; with no switch evidence and no entry, asks replicaRestartedFailure; a ProofOnly attempt (a sleeping copy's step) abandons before Swap or any start gate; no new read site registry:FleetBoxes@1837,whole:Route@2199,whole:Route@2733,whole:Route@2978,whole:Route@557,whole:Route@567 3fdf514278e4e1da500d4605907063a09838db3a47403687972bad56febd31de
internal/rollout/scheduler.go scheduler.execute legacy accepted-legacy accepted-legacy;rev3=J1;basis=root-route;rev3=census-ruling-stateless-replicas-4-task2;basis=Task 2: a dispatch marked Replica (this box permitted step) calls Manager.replicaStep, which calls activator ReplicaSwap, instead of Swap, and emits the swapping event only when the step moves; the added Host and whole Route reads are the same registry row this unit already reads (rt). Agent, not root.;rev3=census-ruling-stateless-replicas-4-final;basis=#511 final wave item 3: the swapping event for a replica step is emitted only for an awake copy on another build, so a sleeping permit holder's proof-only step emits none; no read added; #511 micro-fix (cost): a ProofOnly replica dispatch whose copy is still asleep (Act.Current) skips resolve (no staging, manifest read or hash) and takes Manager.proofOnlyAttempt; every other dispatch resolves as before; the added Host and whole Route sites are the same registry row this unit already reads (rt) registry:App@436,registry:GoodVersion@1739,registry:GoodVersion@1777,registry:Host@2958,registry:Host@5156,registry:Host@6163,registry:Host@6408,whole:Route@129,whole:Route@3225,whole:Route@3269,whole:Route@3312,whole:Route@3746,whole:Route@386,whole:Route@415,whole:Route@6118,whole:Route@6456,whole:Route@6590 7f34270be36dacd7e07097864f96a3f6a8fdcce853299c2384871dadcac814fd
@coverage . 8a0429c65e29d735b1b99f1dbd98c5c815ce9d307c0d7cf03bfa1b2b56c3f6e3
-@coverage internal/activator 55a32534b8c5e7b2b29b8342b68849ad40779d0e872fec87dc154b527f1a4136
+@coverage internal/activator 89b61d04ece517760e874fa2a5eb5245857c67048440f8ee1d08e1c8df21486a
@coverage internal/edge 97284617ae7ac412bfa1df0f4d19718c1fb1b117691c66c9ba1cb5208fd9b57e
@coverage internal/host 0d25995e238484f1265fc4d68b76d54b1a15104d21a81e6e9c00e97d85f0dd34
@coverage internal/provision 771079c84e16cb831649400403d4512adeedb504bf8d3f44ec69eaed6a1fb472