carlos / platform Public

census: re-propose gvisor slice 1 after fix round 1 and the main merge

Run and Worker.Build re-claimed for panic-safe turn ownership;
treeRemover.remove for the depth hoist, the vanished-child re-list, the
non-ENOENT mid-walk error and PurgeProven's held-descriptor path.
purgeDemoWithJobs is back to its main body and leaves the card.
Envelope internal/activator re-pinned for the removal seam. Chain line
re-sealed on top of main's chain.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
claude agent, operated by paul@keymail.dev pushed by paul@keymail.dev a15e086cceaa9c59c5511e0a7fbcc4beec997607 parent 6e5bceb
3 files changed, +16 −19
  • docs/superpowers/notes/census-proposal-gvisor-slice1-control-purge.md +4 −6
  • internal/provision/testdata/plan14-root-reads-chain.tsv +1 −1
  • internal/provision/testdata/plan14-root-reads-gvisor-slice1-control-purge.tsv +11 −12
diff --git a/docs/superpowers/notes/census-proposal-gvisor-slice1-control-purge.md b/docs/superpowers/notes/census-proposal-gvisor-slice1-control-purge.md
index fe690c8b7..1e70fb30d 100644
--- a/docs/superpowers/notes/census-proposal-gvisor-slice1-control-purge.md
+++ b/docs/superpowers/notes/census-proposal-gvisor-slice1-control-purge.md
@@ -4,12 +4,11 @@ Ruling `census-ruling-gvisor-slice1-control-purge`. The independent reviewer app
| unit | change | read sites | what changed |
|---|---|---|---|
-| `internal/demobuild/runner.go` `Run` | body | unchanged (1) | F3: after the stop proof and before opening out/app, waits (within the build ctx) for the process-wide one-at-a-time output turn; every failure releases it, success hands it to the caller in BuildOutput. Same no-follow OpenBeneath of out/app; validation moves to readOutput. No new read path or input. |
+| `internal/demobuild/runner.go` `Run` | body | unchanged (1) | F3: after the stop proof and before opening out/app, waits (within the build ctx) for the process-wide one-at-a-time output turn; every failure releases it, success hands it to the caller in BuildOutput. Same no-follow OpenBeneath of out/app; validation moves to readOutput. No new read path or input. F3 fix round 1: the output turn's release is deferred right after it is taken and disarmed only when a validated output hands it to the caller, so a panic in validation (debug/elf over the build's bytes) gives it back too. Same no-follow OpenBeneath of out/app and the same bounded read; no new read path or input. |
| `internal/demobuild/runner.go` `ValidateOutput` | body | unchanged (1) | F3: body split; ELF/segment/digest checks moved verbatim into validateBinary, which ValidateOutput (client side) and readOutput (root) both call. Same bounded ReadAll; checks unchanged. |
-| `internal/demobuild/worker.go` `Worker.Build` | body | unchanged (1) | F3: when scratch cleanup fails and the output is discarded, releases its output turn first. No read change. |
-| `internal/instancectl/demo_cleanup.go` `Server.purgeDemoWithJobs` | body | unchanged (11) | F6: the remove closure logs DEMO-PURGE-OPERATOR (demo id, host, error) when RemoveAllBeneath refuses with ErrTooDeep, then returns the error as before. No read change. |
+| `internal/demobuild/worker.go` `Worker.Build` | body | unchanged (1) | F3: when scratch cleanup fails and the output is discarded, releases its output turn first. No read change. F3 fix round 1: the scratch-cleanup defer releases the output turn and poisons the worker if cleanup panics, as it already did when cleanup failed. No read change. |
-Envelopes re-pinned: `internal/demobuild`, `internal/instancectl`, `internal/instancefs`.
+Envelopes re-pinned: `internal/activator`, `internal/demobuild`, `internal/instancectl`, `internal/instancefs`.
Removed units: the scan finds neither the declaration nor any of its sites.
@@ -26,7 +25,6 @@ Recorded dispositions, which each change must still satisfy:
- `internal/demobuild/runner.go` `Run`: legacy, task accepted-legacy. Basis: accepted-legacy;rev3=census-ruling-agent-start-demo-1;basis=Consumes only its private root-prepared invocation, proves stop, then no-follow reads bounded diagnostics/output beneath that job.;rev3=census-ruling-gvisor-demos;basis=Task 7: retain bounded no-follow diagnostics/output reads after termination proof; filter gVisor runtime timestamp lines before returning compiler diagnostics. No new read. Task 9: Log failing steps through root logger before returning exactly ErrBuild. Existing bounded no-follow reads and termination-before-output retained.
- `internal/demobuild/runner.go` `ValidateOutput`: legacy, task accepted-legacy. Basis: accepted-legacy;rev3=census-ruling-agent-start-demo-1;basis=Reads bounded bytes, ELF header/program headers and computes their SHA-256; never executes output.
- `internal/demobuild/worker.go` `Worker.Build`: legacy, task accepted-legacy. Basis: accepted-legacy;rev3=census-ruling-agent-start-demo-1;basis=Holds the build/purge read lock through cleanup; existing bounded source read remains.;rev3=census-ruling-demo-slice-adopt;basis=Before admission, call the admit hook (nil = reconcileBudget); a pending budget change (errBudgetPending) is retried every 2 s until the job deadline, any other error fails at once. reconcileBudget reads the fixed build slice's systemctl show budget, its cgroup limit files and cgroup.events under the fixed root cgroup path, and list-jobs (a listing at the capture limit defers); only with buildPurge held exclusively, the slice empty and no build or slice job queued does it run systemctl stop on the fixed slice name. No tenant, app or agent input names a path or unit.
-- `internal/instancectl/demo_cleanup.go` `Server.purgeDemoWithJobs`: legacy, task accepted-legacy. Basis: accepted-legacy;rev3=census-ruling-agent-start-demo-1;basis=Checks root config and current registry identity/hold; reads derived unit/cgroup/exe/drop-in state, stops and proves emptiness before no-follow removal. Fix round 1: passes the descriptor host to the root build-scratch cleaner; same registry, cgroup and derived path reads.;rev3=census-ruling-agent-start-demo-3;basis=Share derived unit stop/empty proof with freeze before deleting demo data; directory enumeration moved to stopDemoUnits. Census read-site delta: -file:ReadDir.
New dispositions, which census-propose wrote and the reviewer checks against the unit's reads and the diff:
@@ -36,6 +34,6 @@ New dispositions, which census-propose wrote and the reviewer checks against the
- new `internal/instancefs/dirs_linux.go:treeRemover.remove`: reads +file:Fstatat; written legacy, accepted-legacy, frozen
- new `internal/instancefs/dirs_linux.go:treeRemover.sameTop`: reads +file:Fstat; written legacy, accepted-legacy, frozen
-Seal: `4eda67fee53800e2cfa4177b954c7f0fce6bdfcfbfe1aa2547ddcec3027b668b` → `0b3083a29ed7195a4212fb785cff082b96097ba3b3cb2f69207e56cf2921d532`.
+Seal: `dbdeb2e3a1a89cb8f33584fdb80a3bf1c5adef14ce222fef9d442ed8e059699c` → `2c38f67ce49b4b8ca977ee111a2d13ad4ab8cefde85ca771d944d45279ed6414`.
Overlay: `internal/provision/testdata/plan14-root-reads-gvisor-slice1-control-purge.tsv`, appended to `internal/provision/testdata/plan14-root-reads-chain.tsv`.
diff --git a/internal/provision/testdata/plan14-root-reads-chain.tsv b/internal/provision/testdata/plan14-root-reads-chain.tsv
index cd83be212..2081a57b2 100644
--- a/internal/provision/testdata/plan14-root-reads-chain.tsv
+++ b/internal/provision/testdata/plan14-root-reads-chain.tsv
@@ -301,4 +301,4 @@ plan14-root-reads-static-error-page-headers.tsv 4d4fdb77961d811bcfeae751b17089f0
plan14-root-reads-replica-read-lock-1443.tsv 4d4fdb77961d811bcfeae751b17089f0104d2333923a15b4c1ab5cc05d58d89f
plan14-root-reads-litestream-pin-1443.tsv 022a082b517b59ada965bbd7673e941be7c8bb4ae7547a5632f6be0570c97551
plan14-root-reads-fleet-first-reconcile-speed-5.tsv dbdeb2e3a1a89cb8f33584fdb80a3bf1c5adef14ce222fef9d442ed8e059699c
-plan14-root-reads-gvisor-slice1-control-purge.tsv 0b3083a29ed7195a4212fb785cff082b96097ba3b3cb2f69207e56cf2921d532
+plan14-root-reads-gvisor-slice1-control-purge.tsv 2c38f67ce49b4b8ca977ee111a2d13ad4ab8cefde85ca771d944d45279ed6414
diff --git a/internal/provision/testdata/plan14-root-reads-gvisor-slice1-control-purge.tsv b/internal/provision/testdata/plan14-root-reads-gvisor-slice1-control-purge.tsv
index aec595503..326c58440 100644
--- a/internal/provision/testdata/plan14-root-reads-gvisor-slice1-control-purge.tsv
+++ b/internal/provision/testdata/plan14-root-reads-gvisor-slice1-control-purge.tsv
@@ -1,27 +1,26 @@
# Census overlay gvisor-slice1-control-purge, written by census-propose (#369). census-ruling-gvisor-slice1-control-purge, approved on #280 before the merge; the approval card is docs/superpowers/notes/census-proposal-gvisor-slice1-control-purge.md.
-# 4 body, 0 sites, 3 envelope: each changed unit re-frozen at its existing disposition with its claim appended.
+# 3 body, 0 sites, 4 envelope: each changed unit re-frozen at its existing disposition with its claim appended.
# 1 removed: each unit's declaration, or each envelope's directory, is absent from the scanned tree, so its row goes, a frozen declaration is retired as absent, and an envelope is retired.
# 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 d1ccc0376483b6c5b2dcc9474e6a471f7a83234ca615b1b2a75a58cadde5d0ca internal/demobuild/runner.go Run legacy accepted-legacy accepted-legacy;rev3=census-ruling-agent-start-demo-1;basis=Consumes only its private root-prepared invocation, proves stop, then no-follow reads bounded diagnostics/output beneath that job.;rev3=census-ruling-gvisor-demos;basis=Task 7: retain bounded no-follow diagnostics/output reads after termination proof; filter gVisor runtime timestamp lines before returning compiler diagnostics. No new read. Task 9: Log failing steps through root logger before returning exactly ErrBuild. Existing bounded no-follow reads and termination-before-output retained.;rev3=census-ruling-gvisor-slice1-control-purge;basis=F3: after the stop proof and before opening out/app, waits (within the build ctx) for the process-wide one-at-a-time output turn; every failure releases it, success hands it to the caller in BuildOutput. Same no-follow OpenBeneath of out/app; validation moves to readOutput. No new read path or input. file:ReadAll@584 f8177b5e9c0f7ec9614d8e1c83ed015c120818942022fc4a43151e50801e9408
+@legacy 53ad57ce6e525e9cd9ae366bd5a559273cac9c5a3dee01da00b27daf260789a5 internal/demobuild/runner.go Run legacy accepted-legacy accepted-legacy;rev3=census-ruling-agent-start-demo-1;basis=Consumes only its private root-prepared invocation, proves stop, then no-follow reads bounded diagnostics/output beneath that job.;rev3=census-ruling-gvisor-demos;basis=Task 7: retain bounded no-follow diagnostics/output reads after termination proof; filter gVisor runtime timestamp lines before returning compiler diagnostics. No new read. Task 9: Log failing steps through root logger before returning exactly ErrBuild. Existing bounded no-follow reads and termination-before-output retained.;rev3=census-ruling-gvisor-slice1-control-purge;basis=F3: after the stop proof and before opening out/app, waits (within the build ctx) for the process-wide one-at-a-time output turn; every failure releases it, success hands it to the caller in BuildOutput. Same no-follow OpenBeneath of out/app; validation moves to readOutput. No new read path or input. F3 fix round 1: the output turn's release is deferred right after it is taken and disarmed only when a validated output hands it to the caller, so a panic in validation (debug/elf over the build's bytes) gives it back too. Same no-follow OpenBeneath of out/app and the same bounded read; no new read path or input. file:ReadAll@584 3d24a0d2e321031f74789cd89ff37010c32ed982b79bf44f3f61465da22e3f17
@legacy 1cb47c62b706c88965edfca3983bf53d643cdd02a614cda275508208fbfbf2a3 internal/demobuild/runner.go ValidateOutput legacy accepted-legacy accepted-legacy;rev3=census-ruling-agent-start-demo-1;basis=Reads bounded bytes, ELF header/program headers and computes their SHA-256; never executes output.;rev3=census-ruling-gvisor-slice1-control-purge;basis=F3: body split; ELF/segment/digest checks moved verbatim into validateBinary, which ValidateOutput (client side) and readOutput (root) both call. Same bounded ReadAll; checks unchanged. file:ReadAll@67 a62ad64a8972e972cf152acca76fe58b0600f9bae50bcd7a988f71672c585cee
-@legacy 7686cf000ca3308db6b658cf0dcca389c41e5e9be3a2d46dbc7e95de49d7944a internal/demobuild/worker.go Worker.Build legacy accepted-legacy accepted-legacy;rev3=census-ruling-agent-start-demo-1;basis=Holds the build/purge read lock through cleanup; existing bounded source read remains.;rev3=census-ruling-demo-slice-adopt;basis=Before admission, call the admit hook (nil = reconcileBudget); a pending budget change (errBudgetPending) is retried every 2 s until the job deadline, any other error fails at once. reconcileBudget reads the fixed build slice's systemctl show budget, its cgroup limit files and cgroup.events under the fixed root cgroup path, and list-jobs (a listing at the capture limit defers); only with buildPurge held exclusively, the slice empty and no build or slice job queued does it run systemctl stop on the fixed slice name. No tenant, app or agent input names a path or unit.;rev3=census-ruling-gvisor-slice1-control-purge;basis=F3: when scratch cleanup fails and the output is discarded, releases its output turn first. No read change. file:ReadAll@1087 792953e07fca9fa7f731a81355728babf898d813a4cfaac95e8d02dc14ba1a91
-@legacy 986fe36a12acad4650d3e27d6fa49ad312552dfd97950bf80265e13d22025c43 internal/instancectl/demo_cleanup.go Server.purgeDemoWithJobs legacy accepted-legacy accepted-legacy;rev3=census-ruling-agent-start-demo-1;basis=Checks root config and current registry identity/hold; reads derived unit/cgroup/exe/drop-in state, stops and proves emptiness before no-follow removal. Fix round 1: passes the descriptor host to the root build-scratch cleaner; same registry, cgroup and derived path reads.;rev3=census-ruling-agent-start-demo-3;basis=Share derived unit stop/empty proof with freeze before deleting demo data; directory enumeration moved to stopDemoUnits. Census read-site delta: -file:ReadDir.;rev3=census-ruling-gvisor-slice1-control-purge;basis=F6: the remove closure logs DEMO-PURGE-OPERATOR (demo id, host, error) when RemoveAllBeneath refuses with ErrTooDeep, then returns the error as before. No read change. file:Lstat@1638,registry:Account@833,registry:App@871,registry:DemoExpiresAt@798,registry:DemoHost@676,registry:DemoID@655,registry:DemoLifetime@701,registry:HoldOp@762,registry:Status@734,whole:Route@1374,whole:Route@625 93ed9869b1af4b948621ccad40caba83f216b09a9552ede7c6ed9762e75f0045
+@legacy 380d4df05c08e27ae315aadb157a13f1669ba3af7d9c0809f06eff14a27c62b3 internal/demobuild/worker.go Worker.Build legacy accepted-legacy accepted-legacy;rev3=census-ruling-agent-start-demo-1;basis=Holds the build/purge read lock through cleanup; existing bounded source read remains.;rev3=census-ruling-demo-slice-adopt;basis=Before admission, call the admit hook (nil = reconcileBudget); a pending budget change (errBudgetPending) is retried every 2 s until the job deadline, any other error fails at once. reconcileBudget reads the fixed build slice's systemctl show budget, its cgroup limit files and cgroup.events under the fixed root cgroup path, and list-jobs (a listing at the capture limit defers); only with buildPurge held exclusively, the slice empty and no build or slice job queued does it run systemctl stop on the fixed slice name. No tenant, app or agent input names a path or unit.;rev3=census-ruling-gvisor-slice1-control-purge;basis=F3: when scratch cleanup fails and the output is discarded, releases its output turn first. No read change. F3 fix round 1: the scratch-cleanup defer releases the output turn and poisons the worker if cleanup panics, as it already did when cleanup failed. No read change. file:ReadAll@1087 4687911be61feb14e60cbb801651a3982593de07c2c5430f5676b1174169b179
@legacy 95eb701b556f8512cdf18075320faab42bfda098a9fe694b02b3449a4aaacc82 internal/demobuild/runner.go readOutput legacy accepted-legacy accepted-legacy;rev3=census-ruling-gvisor-slice1-control-purge;basis=F3, new: root reads the already-open out/app (from Run's no-follow OpenBeneath) by fstat size into one exact buffer; refuses non-regular or over BinaryMaxBytes, refuses a file still growing past its size, then validateBinary on exactly those bytes. Reads only the fd it is given. file:Read@304,file:Stat@63 9c0196894754b9a9d323ab7622e86ee28c5c4e71c86f5e5610289edfe27103d4
@legacy 3a12b768f3f978410bfd23a4387d5ebb7721b480485b401dc8f4ddfc47118520 internal/instancefs/dirs_linux.go treeRemover.clear legacy accepted-legacy accepted-legacy;rev3=census-ruling-gvisor-slice1-control-purge;basis=F6, new: getdents in batches of 256 on an open dir fd; per entry fstatat AT_SYMLINK_NOFOLLOW then unlinkat (AT_REMOVEDIR for dirs); a non-empty dir is returned to descend into. Never follows an entry. file:Fstatat@448 5c78478ebb13128d4cae7913afa86bd2473385e7ae868eca10e0b4988bea263d
@legacy 149232ea92f91ea58f48f16d8c3406c80f10bf3ed4f431d55446f27074815f86 internal/instancefs/dirs_linux.go treeRemover.open legacy accepted-legacy accepted-legacy;rev3=census-ruling-gvisor-slice1-control-purge;basis=F6, new: openat2(parentfd, one name, O_RDONLY|O_DIRECTORY|O_NOFOLLOW, RESOLVE_BENEATH|RESOLVE_NO_SYMLINKS|RESOLVE_NO_MAGICLINKS); never a joined path; retries EINTR/EAGAIN. file:Openat2@318 907a0219945d5fec7dd63ad909a3b8121375e3afec270b38b1d7adbf24ec224f
-@legacy 66f2ada03c002f2fa959169aafc0d574f7dbdcbb17cded0084c56997daa657d0 internal/instancefs/dirs_linux.go treeRemover.remove legacy accepted-legacy accepted-legacy;rev3=census-ruling-gvisor-slice1-control-purge;basis=F6, new (replaces removeAt): iterative no-follow removal of a derived child of a root-named dir. fstatat AT_SYMLINK_NOFOLLOW on top; non-dir unlinked; dirs walked by a name stack, each level opened by treeRemover.open from its parent fd; empty dirs removed with unlinkat AT_REMOVEDIR on the parent fd; refuses past 65,536 levels (ErrTooDeep). Re-opens dir only through openDir (RESOLVE_NO_SYMLINKS), as RemoveAllBeneath did, and checks top dev/ino unchanged. file:Fstatat@169 9ba2d23a227b357a760c777a71950add2833cb074d77a1c0edc4dc7b8daa61a4
+@legacy 3a9e8757fd8190193d02a2ec74c5b6cfa72179199fb9524947da98e9d4f28cd4 internal/instancefs/dirs_linux.go treeRemover.remove legacy accepted-legacy accepted-legacy;rev3=census-ruling-gvisor-slice1-control-purge;basis=F6, new (replaces removeAt): iterative no-follow removal of a derived child of a root-named dir. fstatat AT_SYMLINK_NOFOLLOW on top; non-dir unlinked; dirs walked by a name stack, each level opened by treeRemover.open from its parent fd; empty dirs removed with unlinkat AT_REMOVEDIR on the parent fd. Re-opens dir only through openDir (RESOLVE_NO_SYMLINKS), as RemoveAllBeneath did, and checks top dev/ino unchanged. F6 fix round 1: at the 65,536-level bound, instead of refusing, hoists the child into top (treeRemover.hoist: reopens dir via openDir or a dup of the caller's held fd, opens top with the same openat2 BENEATH|NO_SYMLINKS|NO_MAGICLINKS and dev/ino check, then renameat2(cur, child, top, .carlos-removing-N, RENAME_NOREPLACE); follows nothing, both ends inside the tree). A child gone before descent re-lists cur (max 64); a missing stack directory on re-walk is an error that is not ErrNotExist. Merge with main: PurgeProven (#1139) now calls removeAllAt instead of removeAt; there dir is PurgeProven's held descriptor, duplicated (F_DUPFD_CLOEXEC) where RemoveAllBeneath would reopen dir by path. Removal-only, no new read. file:Fstatat@169 e54b222fd6735ac202a30b5d5a6c5e959594d62a24524805b806cf4a9d5455f3
@legacy 2575069725632e38b00793d60ee00431588b8d5d4a68f7512280e85ed6395c9f internal/instancefs/dirs_linux.go treeRemover.sameTop legacy accepted-legacy accepted-legacy;rev3=census-ruling-gvisor-slice1-control-purge;basis=F6, new: fstat of the re-opened top fd; refuses if dev/ino differ from the top the walk began on. file:Fstat@77 ed275affbeee89c9122580e4df3823be61cd02951040897e9f4e63ee2e624e89
-internal/demobuild/runner.go Run legacy accepted-legacy accepted-legacy;rev3=census-ruling-agent-start-demo-1;basis=Consumes only its private root-prepared invocation, proves stop, then no-follow reads bounded diagnostics/output beneath that job.;rev3=census-ruling-gvisor-demos;basis=Task 7: retain bounded no-follow diagnostics/output reads after termination proof; filter gVisor runtime timestamp lines before returning compiler diagnostics. No new read. Task 9: Log failing steps through root logger before returning exactly ErrBuild. Existing bounded no-follow reads and termination-before-output retained.;rev3=census-ruling-gvisor-slice1-control-purge;basis=F3: after the stop proof and before opening out/app, waits (within the build ctx) for the process-wide one-at-a-time output turn; every failure releases it, success hands it to the caller in BuildOutput. Same no-follow OpenBeneath of out/app; validation moves to readOutput. No new read path or input. file:ReadAll@584 f8177b5e9c0f7ec9614d8e1c83ed015c120818942022fc4a43151e50801e9408
+internal/demobuild/runner.go Run legacy accepted-legacy accepted-legacy;rev3=census-ruling-agent-start-demo-1;basis=Consumes only its private root-prepared invocation, proves stop, then no-follow reads bounded diagnostics/output beneath that job.;rev3=census-ruling-gvisor-demos;basis=Task 7: retain bounded no-follow diagnostics/output reads after termination proof; filter gVisor runtime timestamp lines before returning compiler diagnostics. No new read. Task 9: Log failing steps through root logger before returning exactly ErrBuild. Existing bounded no-follow reads and termination-before-output retained.;rev3=census-ruling-gvisor-slice1-control-purge;basis=F3: after the stop proof and before opening out/app, waits (within the build ctx) for the process-wide one-at-a-time output turn; every failure releases it, success hands it to the caller in BuildOutput. Same no-follow OpenBeneath of out/app; validation moves to readOutput. No new read path or input. F3 fix round 1: the output turn's release is deferred right after it is taken and disarmed only when a validated output hands it to the caller, so a panic in validation (debug/elf over the build's bytes) gives it back too. Same no-follow OpenBeneath of out/app and the same bounded read; no new read path or input. file:ReadAll@584 3d24a0d2e321031f74789cd89ff37010c32ed982b79bf44f3f61465da22e3f17
internal/demobuild/runner.go ValidateOutput legacy accepted-legacy accepted-legacy;rev3=census-ruling-agent-start-demo-1;basis=Reads bounded bytes, ELF header/program headers and computes their SHA-256; never executes output.;rev3=census-ruling-gvisor-slice1-control-purge;basis=F3: body split; ELF/segment/digest checks moved verbatim into validateBinary, which ValidateOutput (client side) and readOutput (root) both call. Same bounded ReadAll; checks unchanged. file:ReadAll@67 a62ad64a8972e972cf152acca76fe58b0600f9bae50bcd7a988f71672c585cee
-internal/demobuild/worker.go Worker.Build legacy accepted-legacy accepted-legacy;rev3=census-ruling-agent-start-demo-1;basis=Holds the build/purge read lock through cleanup; existing bounded source read remains.;rev3=census-ruling-demo-slice-adopt;basis=Before admission, call the admit hook (nil = reconcileBudget); a pending budget change (errBudgetPending) is retried every 2 s until the job deadline, any other error fails at once. reconcileBudget reads the fixed build slice's systemctl show budget, its cgroup limit files and cgroup.events under the fixed root cgroup path, and list-jobs (a listing at the capture limit defers); only with buildPurge held exclusively, the slice empty and no build or slice job queued does it run systemctl stop on the fixed slice name. No tenant, app or agent input names a path or unit.;rev3=census-ruling-gvisor-slice1-control-purge;basis=F3: when scratch cleanup fails and the output is discarded, releases its output turn first. No read change. file:ReadAll@1087 792953e07fca9fa7f731a81355728babf898d813a4cfaac95e8d02dc14ba1a91
-internal/instancectl/demo_cleanup.go Server.purgeDemoWithJobs legacy accepted-legacy accepted-legacy;rev3=census-ruling-agent-start-demo-1;basis=Checks root config and current registry identity/hold; reads derived unit/cgroup/exe/drop-in state, stops and proves emptiness before no-follow removal. Fix round 1: passes the descriptor host to the root build-scratch cleaner; same registry, cgroup and derived path reads.;rev3=census-ruling-agent-start-demo-3;basis=Share derived unit stop/empty proof with freeze before deleting demo data; directory enumeration moved to stopDemoUnits. Census read-site delta: -file:ReadDir.;rev3=census-ruling-gvisor-slice1-control-purge;basis=F6: the remove closure logs DEMO-PURGE-OPERATOR (demo id, host, error) when RemoveAllBeneath refuses with ErrTooDeep, then returns the error as before. No read change. file:Lstat@1638,registry:Account@833,registry:App@871,registry:DemoExpiresAt@798,registry:DemoHost@676,registry:DemoID@655,registry:DemoLifetime@701,registry:HoldOp@762,registry:Status@734,whole:Route@1374,whole:Route@625 93ed9869b1af4b948621ccad40caba83f216b09a9552ede7c6ed9762e75f0045
+internal/demobuild/worker.go Worker.Build legacy accepted-legacy accepted-legacy;rev3=census-ruling-agent-start-demo-1;basis=Holds the build/purge read lock through cleanup; existing bounded source read remains.;rev3=census-ruling-demo-slice-adopt;basis=Before admission, call the admit hook (nil = reconcileBudget); a pending budget change (errBudgetPending) is retried every 2 s until the job deadline, any other error fails at once. reconcileBudget reads the fixed build slice's systemctl show budget, its cgroup limit files and cgroup.events under the fixed root cgroup path, and list-jobs (a listing at the capture limit defers); only with buildPurge held exclusively, the slice empty and no build or slice job queued does it run systemctl stop on the fixed slice name. No tenant, app or agent input names a path or unit.;rev3=census-ruling-gvisor-slice1-control-purge;basis=F3: when scratch cleanup fails and the output is discarded, releases its output turn first. No read change. F3 fix round 1: the scratch-cleanup defer releases the output turn and poisons the worker if cleanup panics, as it already did when cleanup failed. No read change. file:ReadAll@1087 4687911be61feb14e60cbb801651a3982593de07c2c5430f5676b1174169b179
internal/demobuild/runner.go readOutput legacy accepted-legacy accepted-legacy;rev3=census-ruling-gvisor-slice1-control-purge;basis=F3, new: root reads the already-open out/app (from Run's no-follow OpenBeneath) by fstat size into one exact buffer; refuses non-regular or over BinaryMaxBytes, refuses a file still growing past its size, then validateBinary on exactly those bytes. Reads only the fd it is given. file:Read@304,file:Stat@63 9c0196894754b9a9d323ab7622e86ee28c5c4e71c86f5e5610289edfe27103d4
internal/instancefs/dirs_linux.go treeRemover.clear legacy accepted-legacy accepted-legacy;rev3=census-ruling-gvisor-slice1-control-purge;basis=F6, new: getdents in batches of 256 on an open dir fd; per entry fstatat AT_SYMLINK_NOFOLLOW then unlinkat (AT_REMOVEDIR for dirs); a non-empty dir is returned to descend into. Never follows an entry. file:Fstatat@448 5c78478ebb13128d4cae7913afa86bd2473385e7ae868eca10e0b4988bea263d
internal/instancefs/dirs_linux.go treeRemover.open legacy accepted-legacy accepted-legacy;rev3=census-ruling-gvisor-slice1-control-purge;basis=F6, new: openat2(parentfd, one name, O_RDONLY|O_DIRECTORY|O_NOFOLLOW, RESOLVE_BENEATH|RESOLVE_NO_SYMLINKS|RESOLVE_NO_MAGICLINKS); never a joined path; retries EINTR/EAGAIN. file:Openat2@318 907a0219945d5fec7dd63ad909a3b8121375e3afec270b38b1d7adbf24ec224f
-internal/instancefs/dirs_linux.go treeRemover.remove legacy accepted-legacy accepted-legacy;rev3=census-ruling-gvisor-slice1-control-purge;basis=F6, new (replaces removeAt): iterative no-follow removal of a derived child of a root-named dir. fstatat AT_SYMLINK_NOFOLLOW on top; non-dir unlinked; dirs walked by a name stack, each level opened by treeRemover.open from its parent fd; empty dirs removed with unlinkat AT_REMOVEDIR on the parent fd; refuses past 65,536 levels (ErrTooDeep). Re-opens dir only through openDir (RESOLVE_NO_SYMLINKS), as RemoveAllBeneath did, and checks top dev/ino unchanged. file:Fstatat@169 9ba2d23a227b357a760c777a71950add2833cb074d77a1c0edc4dc7b8daa61a4
+internal/instancefs/dirs_linux.go treeRemover.remove legacy accepted-legacy accepted-legacy;rev3=census-ruling-gvisor-slice1-control-purge;basis=F6, new (replaces removeAt): iterative no-follow removal of a derived child of a root-named dir. fstatat AT_SYMLINK_NOFOLLOW on top; non-dir unlinked; dirs walked by a name stack, each level opened by treeRemover.open from its parent fd; empty dirs removed with unlinkat AT_REMOVEDIR on the parent fd. Re-opens dir only through openDir (RESOLVE_NO_SYMLINKS), as RemoveAllBeneath did, and checks top dev/ino unchanged. F6 fix round 1: at the 65,536-level bound, instead of refusing, hoists the child into top (treeRemover.hoist: reopens dir via openDir or a dup of the caller's held fd, opens top with the same openat2 BENEATH|NO_SYMLINKS|NO_MAGICLINKS and dev/ino check, then renameat2(cur, child, top, .carlos-removing-N, RENAME_NOREPLACE); follows nothing, both ends inside the tree). A child gone before descent re-lists cur (max 64); a missing stack directory on re-walk is an error that is not ErrNotExist. Merge with main: PurgeProven (#1139) now calls removeAllAt instead of removeAt; there dir is PurgeProven's held descriptor, duplicated (F_DUPFD_CLOEXEC) where RemoveAllBeneath would reopen dir by path. Removal-only, no new read. file:Fstatat@169 e54b222fd6735ac202a30b5d5a6c5e959594d62a24524805b806cf4a9d5455f3
internal/instancefs/dirs_linux.go treeRemover.sameTop legacy accepted-legacy accepted-legacy;rev3=census-ruling-gvisor-slice1-control-purge;basis=F6, new: fstat of the re-opened top fd; refuses if dev/ino differ from the top the walk began on. file:Fstat@77 ed275affbeee89c9122580e4df3823be61cd02951040897e9f4e63ee2e624e89
@remove internal/instancefs/dirs_linux.go removeAt
@removed internal/instancefs/dirs_linux.go removeAt H3 census-ruling-gvisor-slice1-control-purge;absent;basis=F6: deleted, replaced by treeRemover (same no-follow guarantees, no depth-64 refusal, bounded descriptors and memory).
-@coverage internal/demobuild adc39d4c132efea607f93bdfe958750d4fb337039828d7d9357162a4f3afaecf
-@coverage internal/instancectl 334f328e94c5d4bad991a2da02c7b701218bb48119d90ffacf95becc9b504f2e
-@coverage internal/instancefs 7dacabd500557997379167369906e46ad73d14a19c1f7553b6493e70fd2be383
+@coverage internal/activator f6d5f883f0adbe490d06ea7bd5de9fcb5315731c5544b2e6bee46217faacf976
+@coverage internal/demobuild 360e6fa9a34379e14ad47744907481287cb62f69c20cfb1f56097b45acad2cac
+@coverage internal/instancectl 69ac9f9a1de6330e3412e3bf07a2c3d625acd9c2f7a12d62c0bb816b0be8d7e4
+@coverage internal/instancefs 1693c2adadc4da97101dd655254c91bc8fa674ffc3a06d4833971f996cd35b0b