| index 534033de9..eef8e176b 100644 |
| --- a/internal/provision/testdata/plan14-root-reads-gvisor-update-dirs.tsv |
| +++ b/internal/provision/testdata/plan14-root-reads-gvisor-update-dirs.tsv |
| @@ -1,7 +1,29 @@ |
| # Census overlay gvisor-update-dirs, written by census-propose (#369). census-ruling-gvisor-update-dirs, approved on #280 before the merge; the approval card is docs/superpowers/notes/census-proposal-gvisor-update-dirs.md. |
| -# 2 body, 0 sites, 2 envelope: each changed unit re-frozen at its existing disposition with its claim appended. |
| +# 5 body, 1 sites, 5 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 a31d936c380a6060704b40c6d6e569e0fb4b00b52894baf52728b5ef8328b092 internal/host/systemunits.go ensureSystemUnitsWithGuard legacy accepted-legacy accepted-legacy;rev3=census-ruling-region-ha-p3b;basis=Move unit-repair body here with existing lock/unit/host.env reads; under lock require operator repair permit on groups before writes and each systemctl effect, preserve root masks/drop-in and omit automatic update/recovery units. New indirect protected marker/permit reads, never agent receipt; fixed repair unchanged.;rev3=census-ruling-gvisor-demos;basis=Create runtime/rootfs directories and repair installer plus three measured workload templates without arming them. Existing unit/host.env reads unchanged.;rev3=census-ruling-gvisor-update-dirs;basis=Create the two live sandbox directories (the same fixed ensureSandboxDirectories paths) before the apply lock and the early returns on non-group boxes; group members still create them only after the maintenance permit. A creation error still ends the pass at the original point. Then call refreshControlSandboxRootfs. No new path, input or systemctl verb beyond the try-restart below. file:OpenFile@985,file:ReadFile@5626,file:ReadFile@5759,file:ReadFile@7163,file:Stat@5535 6965ff178aa9e83348531a6efde9079afb5b854fedd7f3ef7c583ddd85b7ab53 |
| @legacy 2a09834a13b7680f82c908ba234f22ec57d6132d078ab506dd434bc8b39f979f internal/host/units/carlos-runsc.service external legacy accepted-legacy accepted-legacy;rev3=census-ruling-gvisor-demos;basis=Root oneshot reads fixed root-owned host.env through its applet and installs compiled runtime set only under /opt/carlos/runsc; no RemainAfterExit.;rev3=census-ruling-gvisor-update-dirs;basis=Make the existing /opt/carlos/runsc writable-path entry optional when absent so systemd-mode installation exits successfully on old boxes; gvisor still refuses absent runtime directories with EXEC-SANDBOX-RUNSC. No new path or root read. file:external@0 04810deed46d3bbfaf189b86e44cf68bf716f09b7ea3349ef007c4bceb085431 |
| +@legacy 2af8c4ae54d94dc8925e0760c52d1b03c456d36914cb67abddd2e8b1c45c4199 internal/instancectl/demo_cleanup.go Server.stopDemoUnits legacy accepted-legacy accepted-legacy;rev3=census-ruling-agent-start-demo-3;basis=Enumerate derived instance units, stop them and prove unit/cgroup emptiness before freeze or purge proceeds. Census read-site delta: +file:ReadDir.;rev3=census-ruling-gvisor-demos;basis=Acquire the existing original-run fence, stop/prove both original families, finish the retained runsc delete hook and remove the gVisor bundle/skeleton/drop-in before freeze or purge may stream data. Discover queued generation jobs as well as loaded units and retained generation files. Existing ReadDir inputs remain derived controller roots.;rev3=census-ruling-gvisor-update-dirs;basis=Skip the post-stop ActiveState show for the host's gVisor sibling only when gvisorUnitNeverLoaded proves it never loaded; the slice-level cgroup-empty wait still runs. No new read. file:ReadDir@1365 d8ff73c6f7f669aa9f6bd850c2e9d3d46bebf50d6bd4af46bf2c684a9b3779b0 |
| +@legacy a28f4924a540c362a66074dd29a18ff2a17afbbcf6e965fd411c9e59df95fd8f internal/instancectl/sandboxstop.go Server.proveRunGone legacy accepted-legacy accepted-legacy;rev3=census-ruling-gvisor-demos;basis=Task 5: read only the validated host-derived systemd cgroup.events path under the configured root. Require complete inactive/dead state, zero jobs/MainPID/ControlPID, expected ControlGroup and exact populated 0 or absent cgroup; unreadable or malformed proof refuses cleanup. Fix round 1 C1/I1: accept the captured systemd 257 empty Job field as no queued job, also zero. Do not infer running state from LoadState; keep required-property presence, inactive/failed plus dead/failed, zero MainPID/ControlPID, expected ControlGroup and empty/absent cgroup proof. Native cleanup runs before sibling ID derivation. No new read path. Task 9: Treat omitted empty Job, InvocationID and ControlGroup as their captured systemd 257 unset defaults. Require explicit LoadState, ActiveState, SubState, MainPID and ControlPID; retain no-job, zero-PID, terminal-state, expected-group and empty/absent-cgroup checks. Same fixed derived path and read.;rev3=census-ruling-gvisor-update-dirs;basis=For a carlos-instance-gvisor@ unit only, return proven-gone without naming it to systemctl when gvisorUnitNeverLoaded holds (no cgroup dir, no drop-in dir, not listed by systemd). Every other unit, and any doubt or error, keeps the existing show/cgroup proof unchanged. file:ReadFile@916 5d67a0f1f76f5582b6a1a2a8690f7355c4724f2a0518ed59f1d5850ddfe675a2 |
| +@legacy 796be076f07a5138618981ef1c0b304f4cd1eed6d4eaf84796f184255dd9fb46 internal/activator/backend_exec.go ExecBackend.gvisorSiblingNeverLoaded legacy accepted-legacy accepted-legacy;rev3=census-ruling-gvisor-update-dirs;basis=New, agent side: Lstat of /run/systemd/system/<sibling>.d, the existing unitEvents cgroup read, and the read-only list-units family glob via UnitsListed. All must say absent; any error returns false so the full proof runs. No root decision. file:Lstat@322,whole:Route@455 70df41b956a2c1b4ce6d0c769a36f81f3facb6943229e9a744ce62fe3a5fda20 |
| +@legacy f5399a6f15da500e625eac9cfd36448779ea1051b7f7b9e5f3fe54dcba973114 internal/activator/control.go systemctlUnitsListed legacy accepted-legacy accepted-legacy;rev3=census-ruling-gvisor-update-dirs;basis=New, agent side: `systemctl list-units --all --plain --no-legend --no-pager <glob>`, read-only; the spawn guard's read-only verb list gains list-units. file:CommandContext@91 52c36953bba90fadc4ff0684877f8efe0b9d951d97693077faded8b1123ab373 |
| +@legacy 4f253ef4ab6554ec49ac67c7c0bc3fc5d5efa02ef3a3979fa494c0e011227272 internal/demobuild/unit.go gvisorBuildNeverLoaded legacy accepted-legacy accepted-legacy;rev3=census-ruling-gvisor-update-dirs;basis=New: Lstat of the build cgroup dir (emptyBuildCgroup's path) and of the job drop-in dir under unitRoot, then list-units with the fixed carlos-demo-build-gvisor@*.service glob and an exact match. Only when all say absent does stopBuildContext skip show/stop of the gVisor build unit; any error keeps the full proof. file:Lstat@191 75075033174ee5c506e13aae5b1a1b9d3bc114d944ff96b0edd954991c0d1810 |
| +@legacy 10541080f448c9a0092472990d4d844931c7f9d27d6a4e3b8f4e95e805707913 internal/host/execsandboxfloor.go var controlMountinfo legacy accepted-legacy accepted-legacy;rev3=census-ruling-gvisor-update-dirs;basis=New seam: reads /proc/<pid>/mountinfo of instance-control's MainPID (digits only, from systemctl show -p MainPID --value carlos-instance-control.service) to see whether systemd mounted /var/lib/carlos/oci-rootfs writable in its namespace. Kernel-owned file; the only effect is one try-restart of carlos-instance-control.service in effective gVisor mode (host.env read through the existing sandboxHostEnvironmentAt) when the mount is absent. Unreadable or anything unexpected: no restart. file:ReadFile@66 5cc66076a36cf77ea5add013814e51d7231576e3e07482965f6907032c30ce6d |
| +@legacy 5ef56f0c8f8c9f406f11356586c550e8d64d2f0f08c492138c3a78204c3730fb internal/instancectl/sandboxstop.go Server.gvisorUnitNeverLoaded legacy accepted-legacy accepted-legacy;rev3=census-ruling-gvisor-update-dirs;basis=New: Lstat of the host-derived cgroup directory under the configured cgroup root and of <DropInDir>/<unit>.d (both must be absent), then `systemctl list-units --all --plain --no-legend --no-pager carlos-instance-gvisor@*.service` (fixed family glob) and an exact-name match in Go. Any error or presence returns false so the full proof runs. file:Lstat@379 6c51d378fd35d05545483615163fc5a28431b97359a4de8b4c2437c6d5a4b06c |
| +@legacy 1c1fe1e038d3f677379ebd06d48c81c9cdb7b02a658529b51eeb21b3a010225e internal/activator/backend_exec.go ExecBackend.LegacyRunGone legacy accepted-legacy accepted-legacy;rev3=census-ruling-292;basis=Census ruling 292: new unit; stops the host's original run unit through instance-control's existing /stop and proves it gone from systemctl show state and cgroup.events, as the exit observer reads. The termination proof only decides release-or-keep, and never starts, wakes or admits anything; unknown or error means keep. Boundary: agent-side shutdown gates running as carlos; they refuse or stop new work once shutdown begins, and a cancelled wake releases its lease; no new read and no root decision; plus the legacy run unit's termination proof (systemctl show state and cgroup.events, as the exit observer reads), and a retried conditional lease delete of the same record.;rev3=census-ruling-rootfs-apps-2;identity=the agent (/opt/carlos/carlos agent, carlos-edge.service, user carlos);basis=a rootfs row's original run unit is the rootfs template's: it is named by unitNameFor and stopped through stopRole (the rootfs verb), and its cgroup proven by unitEvents, which for a rootfs row also reads the control group systemd reports; the Host sites became Route sites (the route passed to those three); the proof's rule is unchanged: unknown or error keeps the lease; no root decision;rev3=census-ruling-gvisor-demos;basis=Task 5: after root fenced Stop succeeds, check both native and gVisor original siblings using the existing systemd/cgroup readers; rootfs retains its existing path. A failed root proof returns immediately and keeps the lease. No mode-dependent cleanup.;rev3=census-ruling-gvisor-update-dirs;basis=Agent side (carlos user): skip the gVisor sibling's show-based proof only when gvisorSiblingNeverLoaded holds; the native unit's proof is unchanged and any doubt keeps the lease as before. registry:Host@174,registry:Host@606,whole:Route@393,whole:Route@448,whole:Route@665,whole:Route@783 036ffb949da93314622f0e15d128e5e8db794971c2546a96ddbac217209a4415 |
| +internal/host/systemunits.go ensureSystemUnitsWithGuard legacy accepted-legacy accepted-legacy;rev3=census-ruling-region-ha-p3b;basis=Move unit-repair body here with existing lock/unit/host.env reads; under lock require operator repair permit on groups before writes and each systemctl effect, preserve root masks/drop-in and omit automatic update/recovery units. New indirect protected marker/permit reads, never agent receipt; fixed repair unchanged.;rev3=census-ruling-gvisor-demos;basis=Create runtime/rootfs directories and repair installer plus three measured workload templates without arming them. Existing unit/host.env reads unchanged.;rev3=census-ruling-gvisor-update-dirs;basis=Create the two live sandbox directories (the same fixed ensureSandboxDirectories paths) before the apply lock and the early returns on non-group boxes; group members still create them only after the maintenance permit. A creation error still ends the pass at the original point. Then call refreshControlSandboxRootfs. No new path, input or systemctl verb beyond the try-restart below. file:OpenFile@985,file:ReadFile@5626,file:ReadFile@5759,file:ReadFile@7163,file:Stat@5535 6965ff178aa9e83348531a6efde9079afb5b854fedd7f3ef7c583ddd85b7ab53 |
| internal/host/units/carlos-instance-control.service external authority B3,C,D,E1,J4 root-input;kept=B3,C,D,E1;scope=protected-decision-only;rev3=census-ruling-agent-start-demo-3;basis=Correct the runtime-write comment to include escaped demo snapshot .mount units alongside per-generation drop-ins; service directives are unchanged.;rev3=census-ruling-region-ha-graceful-terminate-t1;basis=Region HA T1/DR-4 final fix: retain After=nftables.service without Wants or Requires; add Restart=on-failure and RestartSec=1 so a crashed control restarts before a later edge stop can block socket activation and shutdown proofs; rewrap the header and explain this ordering. Same ExecStart and protections; no new root read, input, path, command or capability.;rev3=census-ruling-gvisor-demos;basis=Add Wants/After installer and narrowly writable rootfs parent. Keep one host.env EnvironmentFile and other hardening.;rev3=census-ruling-gvisor-update-dirs;basis=Make the existing /var/lib/carlos/oci-rootfs writable-path entry optional when absent so old updaters can start the new control unit; retain ProtectSystem=strict and the same path and environment. No new root read. file:external@0 b9d8a5520b25dc0508a0c2684d39445dfc45085776cdbb51159ecb1cee93b39c |
| internal/host/units/carlos-runsc.service external legacy accepted-legacy accepted-legacy;rev3=census-ruling-gvisor-demos;basis=Root oneshot reads fixed root-owned host.env through its applet and installs compiled runtime set only under /opt/carlos/runsc; no RemainAfterExit.;rev3=census-ruling-gvisor-update-dirs;basis=Make the existing /opt/carlos/runsc writable-path entry optional when absent so systemd-mode installation exits successfully on old boxes; gvisor still refuses absent runtime directories with EXEC-SANDBOX-RUNSC. No new path or root read. file:external@0 04810deed46d3bbfaf189b86e44cf68bf716f09b7ea3349ef007c4bceb085431 |
| -@coverage internal/host 75675fb32a8efd8ec4ab6b7eaf3283ed72aeaeb56a82f0096081734e5e08d8d5 |
| +internal/instancectl/demo_cleanup.go Server.stopDemoUnits legacy accepted-legacy accepted-legacy;rev3=census-ruling-agent-start-demo-3;basis=Enumerate derived instance units, stop them and prove unit/cgroup emptiness before freeze or purge proceeds. Census read-site delta: +file:ReadDir.;rev3=census-ruling-gvisor-demos;basis=Acquire the existing original-run fence, stop/prove both original families, finish the retained runsc delete hook and remove the gVisor bundle/skeleton/drop-in before freeze or purge may stream data. Discover queued generation jobs as well as loaded units and retained generation files. Existing ReadDir inputs remain derived controller roots.;rev3=census-ruling-gvisor-update-dirs;basis=Skip the post-stop ActiveState show for the host's gVisor sibling only when gvisorUnitNeverLoaded proves it never loaded; the slice-level cgroup-empty wait still runs. No new read. file:ReadDir@1365 d8ff73c6f7f669aa9f6bd850c2e9d3d46bebf50d6bd4af46bf2c684a9b3779b0 |
| +internal/instancectl/sandboxstop.go Server.proveRunGone legacy accepted-legacy accepted-legacy;rev3=census-ruling-gvisor-demos;basis=Task 5: read only the validated host-derived systemd cgroup.events path under the configured root. Require complete inactive/dead state, zero jobs/MainPID/ControlPID, expected ControlGroup and exact populated 0 or absent cgroup; unreadable or malformed proof refuses cleanup. Fix round 1 C1/I1: accept the captured systemd 257 empty Job field as no queued job, also zero. Do not infer running state from LoadState; keep required-property presence, inactive/failed plus dead/failed, zero MainPID/ControlPID, expected ControlGroup and empty/absent cgroup proof. Native cleanup runs before sibling ID derivation. No new read path. Task 9: Treat omitted empty Job, InvocationID and ControlGroup as their captured systemd 257 unset defaults. Require explicit LoadState, ActiveState, SubState, MainPID and ControlPID; retain no-job, zero-PID, terminal-state, expected-group and empty/absent-cgroup checks. Same fixed derived path and read.;rev3=census-ruling-gvisor-update-dirs;basis=For a carlos-instance-gvisor@ unit only, return proven-gone without naming it to systemctl when gvisorUnitNeverLoaded holds (no cgroup dir, no drop-in dir, not listed by systemd). Every other unit, and any doubt or error, keeps the existing show/cgroup proof unchanged. file:ReadFile@916 5d67a0f1f76f5582b6a1a2a8690f7355c4724f2a0518ed59f1d5850ddfe675a2 |
| +internal/activator/backend_exec.go ExecBackend.gvisorSiblingNeverLoaded legacy accepted-legacy accepted-legacy;rev3=census-ruling-gvisor-update-dirs;basis=New, agent side: Lstat of /run/systemd/system/<sibling>.d, the existing unitEvents cgroup read, and the read-only list-units family glob via UnitsListed. All must say absent; any error returns false so the full proof runs. No root decision. file:Lstat@322,whole:Route@455 70df41b956a2c1b4ce6d0c769a36f81f3facb6943229e9a744ce62fe3a5fda20 |
| +internal/activator/control.go systemctlUnitsListed legacy accepted-legacy accepted-legacy;rev3=census-ruling-gvisor-update-dirs;basis=New, agent side: `systemctl list-units --all --plain --no-legend --no-pager <glob>`, read-only; the spawn guard's read-only verb list gains list-units. file:CommandContext@91 52c36953bba90fadc4ff0684877f8efe0b9d951d97693077faded8b1123ab373 |
| +internal/demobuild/unit.go gvisorBuildNeverLoaded legacy accepted-legacy accepted-legacy;rev3=census-ruling-gvisor-update-dirs;basis=New: Lstat of the build cgroup dir (emptyBuildCgroup's path) and of the job drop-in dir under unitRoot, then list-units with the fixed carlos-demo-build-gvisor@*.service glob and an exact match. Only when all say absent does stopBuildContext skip show/stop of the gVisor build unit; any error keeps the full proof. file:Lstat@191 75075033174ee5c506e13aae5b1a1b9d3bc114d944ff96b0edd954991c0d1810 |
| +internal/host/execsandboxfloor.go var controlMountinfo legacy accepted-legacy accepted-legacy;rev3=census-ruling-gvisor-update-dirs;basis=New seam: reads /proc/<pid>/mountinfo of instance-control's MainPID (digits only, from systemctl show -p MainPID --value carlos-instance-control.service) to see whether systemd mounted /var/lib/carlos/oci-rootfs writable in its namespace. Kernel-owned file; the only effect is one try-restart of carlos-instance-control.service in effective gVisor mode (host.env read through the existing sandboxHostEnvironmentAt) when the mount is absent. Unreadable or anything unexpected: no restart. file:ReadFile@66 5cc66076a36cf77ea5add013814e51d7231576e3e07482965f6907032c30ce6d |
| +internal/instancectl/sandboxstop.go Server.gvisorUnitNeverLoaded legacy accepted-legacy accepted-legacy;rev3=census-ruling-gvisor-update-dirs;basis=New: Lstat of the host-derived cgroup directory under the configured cgroup root and of <DropInDir>/<unit>.d (both must be absent), then `systemctl list-units --all --plain --no-legend --no-pager carlos-instance-gvisor@*.service` (fixed family glob) and an exact-name match in Go. Any error or presence returns false so the full proof runs. file:Lstat@379 6c51d378fd35d05545483615163fc5a28431b97359a4de8b4c2437c6d5a4b06c |
| +internal/activator/backend_exec.go ExecBackend.LegacyRunGone legacy accepted-legacy accepted-legacy;rev3=census-ruling-292;basis=Census ruling 292: new unit; stops the host's original run unit through instance-control's existing /stop and proves it gone from systemctl show state and cgroup.events, as the exit observer reads. The termination proof only decides release-or-keep, and never starts, wakes or admits anything; unknown or error means keep. Boundary: agent-side shutdown gates running as carlos; they refuse or stop new work once shutdown begins, and a cancelled wake releases its lease; no new read and no root decision; plus the legacy run unit's termination proof (systemctl show state and cgroup.events, as the exit observer reads), and a retried conditional lease delete of the same record.;rev3=census-ruling-rootfs-apps-2;identity=the agent (/opt/carlos/carlos agent, carlos-edge.service, user carlos);basis=a rootfs row's original run unit is the rootfs template's: it is named by unitNameFor and stopped through stopRole (the rootfs verb), and its cgroup proven by unitEvents, which for a rootfs row also reads the control group systemd reports; the Host sites became Route sites (the route passed to those three); the proof's rule is unchanged: unknown or error keeps the lease; no root decision;rev3=census-ruling-gvisor-demos;basis=Task 5: after root fenced Stop succeeds, check both native and gVisor original siblings using the existing systemd/cgroup readers; rootfs retains its existing path. A failed root proof returns immediately and keeps the lease. No mode-dependent cleanup.;rev3=census-ruling-gvisor-update-dirs;basis=Agent side (carlos user): skip the gVisor sibling's show-based proof only when gvisorSiblingNeverLoaded holds; the native unit's proof is unchanged and any doubt keeps the lease as before. registry:Host@174,registry:Host@606,whole:Route@393,whole:Route@448,whole:Route@665,whole:Route@783 036ffb949da93314622f0e15d128e5e8db794971c2546a96ddbac217209a4415 |
| +@coverage internal/activator 10892f693ca6b72fa9cac7ec90ed25edb3cff03888f2a7365ce3d3e4d8f57ca4 |
| +@coverage internal/demobuild 205010e865d8048b1c506e188cf43b21b78ace9c35db3ba270a22590c9361790 |
| +@coverage internal/host 63d1d3f937551607d28e42bb9d4882b428646a1e94570bb7347d53a79fb6b507 |
| @coverage internal/host/units da7a1e3e835538ee4b56d31d0e19d671aa2b80d40d4ac3e5341806aaab13cf19 |
| +@coverage internal/instancectl 3b705c0428138f9cb85849fc917b964e4de3576d4499ce8c382ab45ae690822e |