carlos / platform Public

census: drain quiesce #1062 after the status byte bound

Only the internal/host envelope moves; same units and claims.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
claude agent, operated by paul@keymail.dev pushed by paul@keymail.dev 41938d655e5dcb50f0935a9dcec1550dd3457d32 parent 7f5f642
1 file changed, +1 −1
  • internal/provision/testdata/plan14-root-reads-drain-quiesce-1062.tsv +1 −1

CI passed — run details

Intent

Human

<task-notification> <task-id>aca00d9c48ad46392</task-id> <tool-use-id>toolu_0196zz732YXa9by4UdvQa9ar</tool-use-id> <output-file>/home/paulca/.cache/tmp/claude-1001/-home-paulca-amadan-net-carlos-platform/ac77363b-5830-422c-9f38-d7f2540dd398/tasks/aca00d9c48ad46392.output</output-file> <status>completed</status> <summary>Agent "Build #1062 drain quiesce fixes" 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>- **Status:** done. Each name is now cut at 128 bytes and marked "(cut)". Names are then dropped, last count first, until the `waiting` block fits in 2048 encoded bytes, and a new `truncated` field says when that happened. Counts stay exact, and the log line and refusal use the same trimmed names. - **Commit:** 7f5f642a, on top of your census commit 1f2c336b. Nothing pushed. - **Tests:** the new `TestDrainVerbStatusBoundsHostileNames` passes. It fills every count with five 500-byte names made of `&lt;` and checks the whole status answer stays at or under 8192 bytes, the counts are exact, `truncated` is set, and the refusal still says "recovering 5". The host and activator test sets from before, vet and the darwin build all pass. I didn't run it against the old code first, so there's no failing-first run for this one.</result> <usage><subagent_tokens>200287</subagent_tokens><tool_uses>8</tool_uses><duration_ms>172861</duration_ms></usage> </task-notification>

Attributed to this commit: 34.4 g CO₂e (4,521,376 tokens). This is an attribution, not a measurement — usage counted from this commit's own marker forward to the next one on drain-quiesce-1062, 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/internal/provision/testdata/plan14-root-reads-drain-quiesce-1062.tsv b/internal/provision/testdata/plan14-root-reads-drain-quiesce-1062.tsv
index cf5a7608a..ce0abca4d 100644
--- a/internal/provision/testdata/plan14-root-reads-drain-quiesce-1062.tsv
+++ b/internal/provision/testdata/plan14-root-reads-drain-quiesce-1062.tsv
@@ -5,4 +5,4 @@
internal/activator/activator.go Service.finishStop legacy accepted-legacy accepted-legacy;rev3=census-ruling-carlos-run;basis=the agent (/opt/carlos/carlos agent, carlos-edge.service, user carlos): main's body with a run's settle checked before replication closes, which keeps the stop pending until the run is proven stopped; read sites unchanged, offsets moved;rev3=census-ruling-region-ha-p1a;basis=the agent as carlos: an HA entry (its replica is an HA one, haEntryRep) now releases through releaseHAClean (a new unit on this card) instead of e.rep.Close; when that answers errHostSliceUnproven the stop is kept pending (keepPendingLocked) with the lease held and renewing, and the sweep finishes it once proven; a non-HA entry is unchanged; the same five sites, no read added;rev3=census-ruling-rootfs-apps-3;basis=rootfs Plan 3 Task 8: a forgotten entry's stop is noted for its resident (noteResidentStopLocked: crash or lost lease backs off, any other stop restarts on the next tick) and its ownerDone channel is closed; no read added;rev3=census-ruling-rootfs-apps-3-release;basis=rootfs Plan 3 Group R: while the host has a release command's record (a.releaseOps[e.host], running or not proven stopped), replication and the lease stay and the stop is kept pending (keepPendingLocked) until the record's proof; the same five read sites, no read added; only holds a release back;rev3=census-ruling-rootfs-apps-3-workers;basis=rootfs Plan 3 Group W, W1.20: while a rootfs worker may run or is a stray (rootfsWorkersLiveLocked, in-memory, read under a.mu), replication and the lease stay and the stop is kept pending (keepPendingLocked) until the workers are proven stopped; the same five read sites, no read added; only holds a release back;rev3=census-ruling-rootfs-apps-6;basis=rootfs Plan 6 Task 7a fix round 1 (Astra P1): beside the worker check, under the same lock, a stop with a lease stop of its commands outstanding (e.leaseStops) is kept pending, the replica and lease held, and the sweep finishes it once they have returned; the entry is never released while a kill captured for it may still reach its unit; the same five read sites, no read added Task 9 (PF-3): the count is pendingLeaseStopsLocked(e), the sum of e.leaseStops over both one-shot roles (now a map per role, cmd and tty), so a session's lease stop of the tty unit keeps the stop pending, the replica and lease held, as a run's does; the same five read sites, no read added;rev3=census-ruling-stateless-replicas-1;basis=Task 3a: Retain command, worker, release and cgroup proofs. For an actual stateless generation no replica needs closing; close local lifecycle ownership only once those proofs finish.;rev3=census-ruling-edge-held-streams;basis=the agent (/opt/carlos/carlos agent, carlos-edge.service, user carlos): adds a.cancelHeldLegsLocked(e, 0) under a.mu just before the entry is deleted; it only calls the legs' context cancel functions. No read added, none removed.;rev3=census-ruling-region-ha-g2-fixes;basis=Latch HA loss if release leaves an obligation; stopping proofs still precede entry removal; no new read.;rev3=census-ruling-region-ha-held-build;basis=region HA held-requests Task 5 fix 1: records the finished stop's release outcome (marker written, clean) in the drain transaction's in-memory release log while a drain records (noteDrainReleaseLocked); memory only; no read added;rev3=census-ruling-fleet-record-labels-m1;basis=fleet record labels R2: a non-HA replica of a fleet-placed row releases through closeFleetCheckpoint (CloseProven) instead of Close; an unproven final checkpoint keeps the stop pending (keepPendingLocked) with the lease held and renewing, or ends unclean without a release over a lost lease (ErrCheckpointAbandoned); at Shutdown it is only named (C45) and the lease runs to its TTL; never releases over an unproven checkpoint; platform-region rows unchanged; the same five read sites, no read added;rev3=census-ruling-drain-quiesce-1062;basis=#1062: before deleting the entry, calls endHARecoveryLocked(e) (in-memory, under a.mu), which clears a lost host's l.recovery when e was its recovery entry; the loss stays latched; read sites unchanged, no read added registry:Socket@4908,registry:Socket@5013,whole:Route@4858,whole:Route@4910,whole:Route@5015 aa710c395b18608c65414b72f90d479c62a4b8aba1f20d72433665094e8295af
internal/activator/activator.go Service.wake legacy accepted-legacy accepted-legacy;rev3=census-ruling-carlos-run;basis=Re-digested at the pre-land merge: the body includes main's own change under census ruling 292, with no further change from this branch. the agent (/opt/carlos/carlos agent, carlos-edge.service, user carlos): main's body; the stop now carries its reason for a run it interrupts (beginStopLocked's why argument); read sites unchanged, offsets moved;rev3=census-ruling-wake-latency-1;identity=the agent (/opt/carlos/carlos agent, carlos-edge.service, user carlos);basis=logs that timer's breakdown to the journal after a successful wake (w.steps.String(), e.host, w.wakeTook); no read added;rev3=census-ruling-plans-4d-lapse;basis=cancels a wake whose row the turned-off hook names, like a fence, unless it is a move's active probe (plans 4d). One more whole-row read: the row handed to the hook (a.disabled). Only refuses.;rev3=census-ruling-rootfs-apps-3;basis=rootfs Plan 3 Tasks 7 and 8: a refusal before the lease is reported once per change (noteRootfsRefusal) instead of a wake-failure event; the proc, generation and replica are installed through installProcLocked (which puts a resident under its lease watch before the fence); residency notes the outcome (noteResidentWakeLocked); same generation values;rev3=census-ruling-rootfs-apps-3-release;basis=rootfs Plan 3 Group R [pf R3.5]: the wake's context ceiling is wakeCeilingFor(e.route): the old 5 minutes for a binary row, 5 minutes plus runs.MaxTimeout for a rootfs row (room for a release inside the wake); new site +whole:Route (e.route to wakeCeilingFor, which reads Runtime only); no other change;rev3=census-ruling-managed-fleets-1b;basis=managed fleets 1b (branch review R1 P1-1): the wake's context is also cancelled before doWake when RetireExcept has marked the entry retired (e.retired, in memory under a.mu), as it is for a fence or a shutdown. Read sites unchanged (13). Agent, not root; it only refuses more.;rev3=census-ruling-stateless-replicas-1;basis=Task 3a: Carry successful hold preparation into its wake, preserve actual mode in the generation and OnWake projection, and project serving version/mode through the narrow registry writer before releasing wake waiters. Final review I1: SetServingMode only for non-worker successful wakes with a nonempty spawned version and either a stateless generation or a mode transition from the route. Ordinary stateful wakes leave rollout status and the wake critical path unchanged.;rev3=census-ruling-edge-held-streams;basis=the agent (/opt/carlos/carlos agent, carlos-edge.service, user carlos): adds a.cancelHeldLegsLocked(e, 0) on the failed-wake path before the entry is deleted, and after close(e.ready) on success calls a.noteHeldAdmissible(e.host), the non-blocking held wake callback, outside a.mu. No read added.;rev3=census-ruling-wake-storm-cap;basis=the agent (/opt/carlos/carlos agent, carlos-edge.service, user carlos): waits for a box-wide wake slot (acquireWakeSlot, an in-memory buffered channel) before doWake; the fence/shutdown/retired/disabled refusals move into refuseWakeLocked and are asked again after admission (one fewer direct whole-Route read here: a.disabled(e.route) now runs inside refuseWakeLocked, same value); e.wakeStart is set at admission and e.admitted marks it. Only waits and refuses more; no new read.;rev3=census-ruling-region-ha-p1b3b-t;basis=Install the successful-acquire observer and restrict due, worker and resident starts before doWake, off a.mu. Add a whole-route argument to restriction; refused work has known-no-start evidence.;rev3=census-ruling-region-ha-g2-fixes;basis=Bind recovery wakes to the service lifetime; no new read.;rev3=census-ruling-edge-page-cache-1;basis=the generation-current call is now noteCurrent(e) instead of noteCurrent(e.host, e.gen.N), so the new noteCurrent can also publish the process's page cache launch inputs; read sites unchanged (16); no read added;rev3=census-ruling-fix-silent-start-kill-861;basis=#861: a failed wake that journalledWakeFailure counts as a real failure is logged through logWakeFailure (rate-limited per host, in memory); a successful wake calls clearWakeFailure. Agent, not root; reads the error already in hand; no read added;rev3=census-ruling-stateless-replicas-4-task5;basis=Task 5 first commit (#511 F11 log dedupe): before a failed wake's member event, noteHeldWake (in-memory, per host, under the leaf wakeFailMu) tells whether the failure is held by a release attempt with no backoff and is the same (attempt ID, error class) as the host's last one; a repeat writes no event, a first or changed one writes one journal line and the event. Reads only the error in hand; no read site added.;rev3=census-ruling-stateless-replicas-4-merge-main;basis=Merge of main 5fac2ff1: both sides changed it. Main (27d3f501, activator-settle-wait) adds the background counter increment and deferred decrement at entry; this branch (Task 5) keeps its own changes. Both kept as-is; no read added.;rev3=census-ruling-g6-fence;basis=G6 F-C Task 3, the agent as carlos: a wakeReturned test seam (nil in production) after doWake; on a failed wake of an entry the write fence marked (e.writeFenced, in memory) e.err wraps ErrHALeaseUnavailable; at the awake transition a marked entry begins the existing StopLeaseLost stop before e.ready closes. Only refuses and stops more; no read added; no kill, no root call.;rev3=census-ruling-drain-quiesce-1062;basis=#1062: the failed-wake cleanup calls endHARecoveryLocked(e) as it removes the entry (in-memory, under a.mu); read sites unchanged, no read added registry:Socket@9240,registry:Socket@9401,registry:Stateless@11109,registry:Stateless@11857,whole:Route@11100,whole:Route@11155,whole:Route@11859,whole:Route@1811,whole:Route@3420,whole:Route@3693,whole:Route@3850,whole:Route@515,whole:Route@7502,whole:Route@9193,whole:Route@9242,whole:Route@9403 bafa960a58b9e97bcf1348de427e244470982499822465480d2820b472af4640
@coverage internal/activator 4df3c1a2fda87ae19b9d48e2b96eadfdea51bb53e436f545a74d4e3422c046a9
-@coverage internal/host 41781d52bf2ad77f8ec40fbce1642c054ea4ec921ef2c5b331282ed119b9899b
+@coverage internal/host 341112c90b3e8ced207e4c4efd55432a64706e6effa4e7dde76236652a3c8936