carlos / platform Public

gvisor demos: final review fixes and copy

Gate native readiness on retained sandbox files, tolerate cgroup removal,
and keep cleanup refusals local to the affected host. Preserve native
sweep polling and the strict recovery floor, naming host.env failures in
status. Apply the delegated Luna copy and make release attachments explicit.

Refresh the cumulative census; targeted tests, build, vet and cross-builds
pass. Whole affected-package checks follow the separate main merge.
Co-Authored-By: Astra (gpt-6-astra) via codex
claude agent, operated by paul@keymail.dev pushed by paul@keymail.dev d60dd8ac176763fcb81b362167834f2f0887c719 parent 9896905
21 files changed, +386 −95
  • README.md +4 −4
  • docs/superpowers/notes/census-proposal-gvisor-demos.md +14 −6
  • docs/superpowers/plans/2026-10-21-instance-policy-copy.json +1 −1
  • docs/superpowers/runbooks/gvisor-demos.md +14 −30
  • internal/activator/execsandboxstatus_test.go +1 −1
  • internal/activator/unitproc.go +1 −1
  • internal/host/execsandboxstatus.go +13 −0
  • internal/host/execsandboxstatus_test.go +27 −0
  • internal/host/sandboxenv_linux_test.go +40 −0
  • internal/instancectl/gvisor_finalbatch_test.go +170 −0
  • internal/instancectl/gvisor_fix1_test.go +5 −1
  • internal/instancectl/gvisordrain.go +40 −10
  • internal/instancectl/gvisorunit.go +0 −4
  • internal/instancectl/sandbox.go +4 −0
  • internal/instancectl/sandboxstop.go +5 −1
  • internal/instancectl/server.go +12 −1
  • internal/provision/testdata/plan14-root-reads-chain.tsv +1 −1
  • internal/provision/testdata/plan14-root-reads-gvisor-demos.tsv +15 −15
  • region_labels_e2e_test.go +1 −1
  • status_instances.go +5 −5
  • status_instances_test.go +13 −13
diff --git a/README.md b/README.md
index 8f9d7174f..2ad4f32af 100644
--- a/README.md
+++ b/README.md
@@ -249,14 +249,14 @@ A release is a `vX.Y.Z` tag on this repo plus signed binaries on [carlosframewor
1. **Tag.** `git tag -a vX.Y.Z <sha> -m "carlos vX.Y.Z"` on the `main` commit you are releasing, then `git push origin vX.Y.Z` to the forge.
2. **Build.** Six targets, darwin, linux and windows on amd64 and arm64, each with `make build GOOS=<os> GOARCH=<arch> SHA=vX.Y.Z` from a clean checkout of the tag. Build with `TMPDIR` and `GOCACHE` on a real disk: `/tmp` is a shared tmpfs, and a full one fails the link with "no space left on device". Zip each Windows binary as a lone `carlos.exe`. Build the console the same way, with `make build-console GOOS=linux GOARCH=<arch> SHA=vX.Y.Z` for amd64 and arm64, and name the two `carlos-console-linux-<arch>`. Both targets stamp the tag's full commit into the binary. The console writes that commit into the hostname history's floor, and the console roll script refuses a floor with no commit. `console hosts-used activate` refuses a console that isn't a release build or doesn't name a full commit.
3. **Debs.** One per architecture, built with `dpkg-deb --root-owner-group`, holding `usr/bin/carlos`. Copy the last release's `control` and change the version and the description's last sentence. Wrap the description without breaking on hyphens, or apt shows "step- by-step".
-4. **Runtime assets.** From the release tag's checkout, run `go run ./cmd/runsc-assets -out <artifact-directory>` with the existing release artifact directory. It verifies the pinned archives and extracts five runtime files for each Linux architecture: `runsc`, `gvisor-sentry`, `runsc-fd-parking`, `gvisor-proc-umounter` and `gvisor-sentry-prewarmer`, each suffixed with `-linux-amd64` or `-linux-arm64`. Generate the checksums only after all ten files are present.
+4. **Runtime assets.** From the release tag's checkout, run `go run ./cmd/runsc-assets -out <existing-cut-artifact-directory>` with the existing release artifact directory. It verifies the pinned archives and extracts five runtime files for each Linux architecture: `runsc`, `gvisor-sentry`, `runsc-fd-parking`, `gvisor-proc-umounter` and `gvisor-sentry-prewarmer`, each suffixed with `-linux-amd64` or `-linux-arm64`. Generate the checksums only after all ten files are present.
5. **Sums and signature.** Write `SHA256SUMS.txt` over eighteen files: six CLI downloads, two debs and ten runtime assets. Sign it with the ed25519 seed in SSM `/carlos/cli-update-key`, passed on stdin and never in argv, and write the signature base64-encoded to `SHA256SUMS.txt.sig`. Before signing, check that the key's public half equals `cliUpdatePubKey` in `update.go`. A mismatch publishes a release nobody can update to. Write `CONSOLE_SHA256SUMS.txt` over the two console binaries and sign it the same way, to `CONSOLE_SHA256SUMS.txt.sig`. Keep the console out of `SHA256SUMS.txt`: `carlos update` reads that file. The public self-host guide downloads the console and checks this signature, so a release without it leaves the guide on an older console.
-6. **Release notes.** Draft them, and put them through copy review before anything is published. Lead with what changed for people using the CLI. Add a short section for operators, taken from the release notes below this recipe, about anything to check before rolling.
-7. **Publish.** `gh release create vX.Y.Z -R carlosframework/releases --latest --title vX.Y.Z --notes-file NOTES.md` with all twenty-four files: the eighteen assets, `SHA256SUMS.txt`, its signature and the console's four files. Confirm it is the latest with `gh api repos/carlosframework/releases/releases/latest -q .tag_name`.
+6. **Release notes.** Draft them, and put them through copy review before anything is published. Lead with what changed for people using the CLI. Add a short section for operators, based on the release-specific note below this recipe, about anything to check before rolling.
+7. **Publish.** From the artifact directory, run `gh release create vX.Y.Z -R carlosframework/releases --latest --title vX.Y.Z --notes-file NOTES.md $(awk '{print $2}' SHA256SUMS.txt CONSOLE_SHA256SUMS.txt) SHA256SUMS.txt SHA256SUMS.txt.sig CONSOLE_SHA256SUMS.txt CONSOLE_SHA256SUMS.txt.sig` to attach all twenty-four files: the eighteen assets, `SHA256SUMS.txt`, its signature and the console's four files. Confirm it is the latest with `gh api repos/carlosframework/releases/releases/latest -q .tag_name`.
8. **Homebrew.** In `carlosframework/homebrew-tap`, bump `Formula/carlos.rb`: the version, the four url and sha256 pairs from the published `SHA256SUMS.txt`, and the `carlos vX.Y.Z` test string. Open a PR, check each hash against the sums file, and squash-merge it.
9. **apt.** Download the live tree, `apps/bab/apt-carlosframework/releases/<last>/site.tar.gz` from the flagship bucket, and unpack it. Add the two debs under `pool/main/c/carlos/`, and regenerate each architecture's `Packages` with `dpkg-scanpackages --multiversion`. Delete `Release`, `InRelease` and `Release.gpg`, then rebuild `Release` with `apt-ftparchive release`, passing Origin and Label `CARLOS`, Suite and Codename `stable`, the architectures and the component. Write it outside the tree first, or it lists itself. Sign `InRelease` and `Release.gpg` with the SSM key `/carlos/apt-signing-key` in a throwaway `GNUPGHOME`, set `latest.txt` to the tag, and check both signatures with `gpgv` against the tree's own keyring.
10. **Ship apt.** Ship the directory and let `carlos ship` build the tarball. A hand-made tar with a leading `./` entry took apt down once. With `AWS_PROFILE=keymail` and `CARLOS_DEPLOYMENT_BUCKET` set to the flagship bucket, run `carlos ship -app apt-carlosframework -account-id bab -kind static -version vX.Y.Z-1 site/`, then `carlos promote -app apt-carlosframework -account-id bab vX.Y.Z-1 canary/apt` with `CARLOS_RELEASE_KEY` from SSM `/carlos/release-key` set for that one command. The channel is the literal `canary/apt`.
-11. **Docs and changelog.** Two parts. Part a is owed every release, whatever else is: until 2026-11-06 the docs sync rode on the changelog and kept being put off, and the live site showed 4 of the 10 docs pages.
+11. **Docs and changelog.** This has two parts. The docs sync is required for every release. Until 2026-11-06, it rode on the changelog and kept being put off, and the live site showed 4 of the 10 docs pages.
- **11a. Docs.** In `carlosframework/website`, run `node hack/sync-docs.mjs <checkout>` with the platform checkout at the release tag, so the site shows only released behaviour, then `npm run check`. Open and merge the PR, and ship the site the way its AGENTS.md describes. Check that carlosframework.com/docs/ lists every page in `docs/site/nav.json`.
- **11b. Changelog.** In a full checkout of `main`, with `gh` and `amadan` signed in, run `git fetch origin --tags '+refs/amadan/closed/*:refs/amadan/closed/*'`, then `go run ./cmd/changelog`. Map each of the new release's bullets to the branches behind it in `docs/site/changelog-links.json`, keyed by the bullet's bold lead, and run it again. Land `docs/site/changelog.json` and the links file on a branch. The release tag predates them, so publish them by syncing from a detached checkout of the tag with just those two files taken from `main`: `git checkout --detach <tag> && git checkout origin/main -- docs/site/changelog.json docs/site/changelog-links.json`, then `node hack/sync-docs.mjs <checkout>` and ship as in 11a. Restore the checkout afterwards (`git checkout <tag> -- docs/site`). The page is carlosframework.com/platform/changelog.
12. **Self-host template.** In `carlos/opentofu` on amadan, on a branch from `main`, run `scripts/bump-carlos vX.Y.Z`. It checks the signature on the release's `SHA256SUMS.txt` and rewrites the hosts' pin and checksum in `modules/region/cloud-init.sh.tftpl`. Then compare the release's "For operators" notes, and any change under `infra/modules/region-host/`, with the template: a new required `host.env` key, a changed `carlos bootstrap`, or an IAM or bucket change that a new host needs goes in the same branch. Run `scripts/check`, then land it with `amadan branch merge carlos/opentofu <branch> -squash -expect <full sha> -message "<subject>"` once CI is green. Note the landed commit.
diff --git a/docs/superpowers/notes/census-proposal-gvisor-demos.md b/docs/superpowers/notes/census-proposal-gvisor-demos.md
index a521c9868..af1ba09e8 100644
--- a/docs/superpowers/notes/census-proposal-gvisor-demos.md
+++ b/docs/superpowers/notes/census-proposal-gvisor-demos.md
@@ -38,8 +38,8 @@ Ruling `census-ruling-gvisor-demos`. The independent reviewer approves or reject
| `internal/instancectl/gen.go` `Server.handleParent` | body | unchanged (1) | Validate logical parent input as before, require the demo route in gVisor mode and apply Physical once to the small demo parent. Existing request query read unchanged; shares stay logical. |
| `internal/instancectl/rootfs.go` `Server.runRootfsProbe` | body | unchanged (1) | Refuse sandbox configuration or readiness errors before preparing or starting the native rootfs probe. Existing image read unchanged. Task 6: Effective gVisor refuses ROOTFS explicitly before native/rootfs probe preparation; no fallback. Existing native reads unchanged. |
| `internal/instancectl/server.go` `Server.RunProbe` | body | unchanged (1) | Select the fixed root-private probe family and delegate gVisor to its serialized root/guest proof, with no native/rootfs fallback. Task 6 fix round 1: remove mode drain from probe execution (Ready/ReadyDemo only), and let runGVisorProbe atomically publish the report/runtime identity including start lines once. Existing native report read unchanged. |
-| `internal/instancectl/server.go` `runWithClaim` | body | unchanged (4) | Retain sandbox modes and error; bind host-provided baseline and runtime callbacks without importing host templates. Existing reads unchanged. Task 6: Capture HostClaims once from ControlConfig/hostwrite.Enabled and set the fixed root-owned bundle discovery directory. Existing command and configuration reads unchanged. Task 7: enable gVisor worker construction through fixed unitFamily(roleBuild); readiness proof rechecks sandbox admission and current Ready without reaching the constructor fatal path for transient refusals. Existing command/config reads unchanged. |
-| `internal/instancectl/server.go` `type Server` | body | unchanged (1) | Retain Task 1 mode/error/readiness fields, baseline/runtime callbacks, Task 4 per-host validated staged descriptors and root-selected probe nonce. Fix round 1 adds a private writer-operation seam assigned only in package tests, after the unchanged GVisorID admission check; production defaults still call the same checked constructor, WriteRootfs, WriteBundle and verifier. No new direct read or request-controlled callback. Task 5: private injected removal seam for unprivileged tests; production default removes only root-derived bundle and skeleton after both-family proof inside existing start fence. No new request field or agent-selected unit. Task 6: Retain serialized probe nonce, runtime-set identity verifier/token, fixed claims flag, bundle discovery root, and private unprivileged identity seam. No request-controlled callback or path; existing declaration read-site classification unchanged. Task 6 fix round 1: private gvisorProbeTestOps is set only in package tests; production defaults retain all fixed paths and the checked root output opener. No externally supplied callback or new direct read. |
+| `internal/instancectl/server.go` `runWithClaim` | body | unchanged (4) | Retain sandbox modes and error; bind host-provided baseline and runtime callbacks without importing host templates. Existing reads unchanged. Task 6: Capture HostClaims once from ControlConfig/hostwrite.Enabled and set the fixed root-owned bundle discovery directory. Existing command and configuration reads unchanged. Task 7: enable gVisor worker construction through fixed unitFamily(roleBuild); readiness proof rechecks sandbox admission and current Ready without reaching the constructor fatal path for transient refusals. Existing command/config reads unchanged. Final R1 P2: wire the fixed /var/lib/carlos/oci-rootfs parent for native readiness evidence; no request-supplied path. |
+| `internal/instancectl/server.go` `type Server` | body | unchanged (1) | Retain Task 1 mode/error/readiness fields, baseline/runtime callbacks, Task 4 per-host validated staged descriptors and root-selected probe nonce. Fix round 1 adds a private writer-operation seam assigned only in package tests, after the unchanged GVisorID admission check; production defaults still call the same checked constructor, WriteRootfs, WriteBundle and verifier. No new direct read or request-controlled callback. Task 5: private injected removal seam for unprivileged tests; production default removes only root-derived bundle and skeleton after both-family proof inside existing start fence. No new request field or agent-selected unit. Task 6: Retain serialized probe nonce, runtime-set identity verifier/token, fixed claims flag, bundle discovery root, and private unprivileged identity seam. No request-controlled callback or path; existing declaration read-site classification unchanged. Task 6 fix round 1: private gvisorProbeTestOps is set only in package tests; production defaults retain all fixed paths and the checked root output opener. No externally supplied callback or new direct read. Final R1 P2: retain fixed skeleton parent and concurrent per-instance cleanup refusals; no direct read or external configuration field. |
| `internal/publicrelease/feed.go` `Feed.get` | body | unchanged (1) | Bound release downloads with a one-byte oversize check so a signed prefix cannot authenticate a truncated larger response; existing HTTP body read only, no new root input. |
| `internal/status/dryrun.go` `dryRunFixtures` | body | unchanged (1) | Task 8: add private sandbox status and row fixtures plus leak needles. Fixture data only; public fleet shape unchanged. |
| `status_instances.go` `printStatusLayout` | body | unchanged (1) | Task 8: print draft SANDBOX column and one exec-sandbox summary per reported box from the existing operator API. Missing/stale reports display unknown; no new file read or authority. |
@@ -198,10 +198,10 @@ New dispositions, which census-propose wrote and the reviewer checks against the
- new `internal/host/units/carlos-instance-gvisor@.service:external`: reads +file:external; written legacy, accepted-legacy, frozen
- new `internal/host/units/carlos-runsc.service:external`: reads +file:external; written legacy, accepted-legacy, frozen
- new `internal/instancectl/demo_policy.go:Server.demoCgroupReadback`: reads +file:ReadFile, +file:Stat; written legacy, accepted-legacy, frozen
-- new `internal/instancectl/gvisordrain.go:Server.sandboxUnitEmpty`: reads +file:WalkDir; written legacy, accepted-legacy, frozen
-- new `internal/instancectl/gvisordrain.go:Server.sandboxUnitsFor`: reads +file:WalkDir; written legacy, accepted-legacy, frozen
+- new `internal/instancectl/gvisordrain.go:Server.sandboxFilesPresent`: reads +file:ReadDir; written legacy, accepted-legacy, frozen
- new `internal/instancectl/gvisordrain.go:Server.sweepGVisorBundles`: reads +file:ReadDir; written legacy, accepted-legacy, frozen
- new `internal/instancectl/gvisordrain.go:sandboxGroupEmpty`: reads +file:ReadFile; written legacy, accepted-legacy, frozen
+- new `internal/instancectl/gvisordrain.go:walkSandboxCgroups`: reads +file:WalkDir; written legacy, accepted-legacy, frozen
- new `internal/instancectl/gvisorprobe.go:Server.gvisorProbeKernelLimits`: reads +file:ReadFile; written legacy, accepted-legacy, frozen
- new `internal/instancectl/gvisorprobe.go:Server.runGVisorProbe`: reads +file:Lstat, +file:OpenFile, +file:Read, +file:ReadAll; written legacy, accepted-legacy, frozen
- new `internal/instancectl/gvisorprobe_linux.go:gvisorProbeProcesses`: reads +file:ReadDir, +file:ReadFile ×4, +file:Readlink, +file:WalkDir; written legacy, accepted-legacy, frozen
@@ -223,7 +223,7 @@ New dispositions, which census-propose wrote and the reviewer checks against the
- reads `internal/activator/cmdunit.go:cmdUnit.StopAndSettle`: +registry:Runtime ×2, +whole:Route ×2; keeps legacy, task accepted-legacy
- reads `internal/activator/unitproc.go:unitProc.stopUnit`: +registry:Runtime ×2, +whole:Route; keeps legacy, task accepted-legacy
-Seal: `b970bb28c5a633d2572a1da549030e9258cfdabb6322ddffdd0ebf41b56c464c` → `6f8b2354ccd73a6a0e48f5c675fdb186e7def8c7dd9863c8e898c351201da597`.
+Seal: `b970bb28c5a633d2572a1da549030e9258cfdabb6322ddffdd0ebf41b56c464c` → `4beca9417da58ddc58b25bd3173b91308840c7a0a27806e65b17439ce54bc1b3`.
Overlay: `internal/provision/testdata/plan14-root-reads-gvisor-demos.tsv`, appended to `internal/provision/testdata/plan14-root-reads-chain.tsv`.
@@ -234,7 +234,7 @@ The read census covers `Server.assertGVisorUnit` through the
The controller's Task 9 ruling ratifies this action. The independent reviewer
must include it when deciding the envelope.
-- `internal/instancectl/gvisorunit.go:Server.assertGVisorUnit` (`internal/instancectl/gvisorunit.go:274`, slice start at line 281): Task 9 ratified slice start: after validating the host-derived slice name and verifying its unit properties, start that host slice with systemctl before the kernel cgroup readback. Starting the run unit would start the same slice; the explicit start makes parent cgroup verification possible rather than skipping it. A refused start may leave an empty root-started host slice, which demo cleanup stops. No tenant-selected unit or new filesystem read.
+- `internal/instancectl/gvisorunit.go:Server.assertGVisorUnit` (`internal/instancectl/gvisorunit.go:225`, slice start at line 277): Task 9 ratified slice start: after validating the host-derived slice name and verifying its unit properties, start that host slice with systemctl before the kernel cgroup readback. Starting the run unit would start the same slice; the explicit start makes parent cgroup verification possible rather than skipping it. A refused start may leave an empty root-started host slice, which demo cleanup stops. No tenant-selected unit or new filesystem read.
This claim is retained as an envelope-only comment in the cumulative CLAIMS
file because census-propose rejects a standalone claim for a unit with no
@@ -255,3 +255,11 @@ read-census change. Reproduce this section after regenerating the card.
- `bundleStore.removeDirectory`: an absent derived leaf needs no removal. Existing entries retain all checked-parent, OpenRoot identity and leaf checks.
- `gvisorLoopbackOnly`: pure parsing of fixed guest procfs interface evidence; accepts only one complete lo row.
- The record-write sites and metadata credential-family inventory are individually explained in the controller's `.superpowers/sdd/2026-11-08-gvisor-demos/cifix-report.md`. Independent approval is pending.
+
+## Final batch envelope claims
+
+- `internal/instancectl/gvisorunit.go:Server.assertGVisorUnit` starts at line 225; its host-slice start is line 277. The removed error check followed a successful checked call and was unreachable. All verifications remain.
+- `internal/instancectl/server.go:Server.Ready` runs the full drain in gVisor mode. Systemd mode first checks only fixed bundle/skeleton parents; no retained files means no systemctl query or cgroup walk, as the final controller ruling requires. The two existing parents are listed without recursion, because bootstrap may leave an empty skeleton parent.
+- `internal/instancectl/sandboxstop.go:Server.stopRunFamiliesID` clears a host's stored cleanup refusal only after both proofs and cleanup succeed under its existing fence.
+- `internal/host/execsandboxstatus.go:execSandboxStatusReportWithEnvironment` calls the existing no-follow, bounded host.env reader and resolver to put a host.env cause in blocked status. It does not relax the update/recovery floor or change runtime selection.
+- The root status heading, missing instance observation and activator exit suffix use the delegated Luna text verbatim. No exit status or observed unit-family semantics change.
diff --git a/docs/superpowers/plans/2026-10-21-instance-policy-copy.json b/docs/superpowers/plans/2026-10-21-instance-policy-copy.json
index 63d9b689e..e07e57792 100644
--- a/docs/superpowers/plans/2026-10-21-instance-policy-copy.json
+++ b/docs/superpowers/plans/2026-10-21-instance-policy-copy.json
@@ -83,7 +83,7 @@
{"id": "GAP-1", "file": "internal/updatewords/words_surfaces.go", "text": "usage: carlos instances set <host> [--app <a>] [--updates auto|manual] [--channel <c>] [--major <n>] [--pin <build>] [--size small|standard|large|xlarge|default] (an empty value clears an update setting)"},
{"id": "GAP-2", "file": "apps_swap.go", "text": "usage: carlos apps set <app> [--copies <n>] [--swap overlap|hold] [--swap-concurrency <n>] [--interactive on|off] [--account <sqid|name>] [--account-id <sqid>] [--console <origin>] [--egress-allow <ip,...>] [--size <size>]\n", "superseded_by": "SR-2-C13", "note": "Replaced verbatim by SR-2-C13 in the stateless replicas copy deck for Plan 2 slice 1a."},
{"id": "GAP-3", "file": "apps_swap.go", "text": "app whose swap or instance policy to set"},
- {"id": "IP3-04", "file": "status_instances.go", "text": "BOX REGION HOST LAYOUT SANDBOX SIZE EGRESS REASON"},
+ {"id": "IP3-04", "file": "status_instances.go", "text": "BOX REGION HOST LAYOUT INSTANCE-SANDBOX SIZE EGRESS REASON"},
{"id": "IP3-08", "file": "status_instances.go", "text": "-"},
{"id": "IP3-12", "file": "status_instances.go", "text": "-"},
{"id": "IP3-09", "file": "status_instances.go", "text": "A size after > is the wanted size. A larger size takes effect at the instance's next start or deploy; a smaller size waits for a cold start. Restart the instance to apply the new memory size now."},
diff --git a/docs/superpowers/runbooks/gvisor-demos.md b/docs/superpowers/runbooks/gvisor-demos.md
index 935ec1126..b28066f35 100644
--- a/docs/superpowers/runbooks/gvisor-demos.md
+++ b/docs/superpowers/runbooks/gvisor-demos.md
@@ -1,19 +1,13 @@
-# gVisor demos rollout — draft for Paul's copy review
+# gVisor demos rollout
-Set `CARLOS_EXEC_SANDBOX=gvisor` only on a box where `carlos status --layout`
-already displays the exec-sandbox line. An unaware binary cannot enforce this
-setting. A bootstrap or reimage from an old pointer with a retained gvisor setting
-is outside this build. Keep this setting in internal operator material.
+Set `CARLOS_EXEC_SANDBOX=gvisor` only on a box where `carlos status --layout` already displays the exec-sandbox line. A binary without exec-sandbox support cannot enforce this setting. A bootstrap or reimage from a release pointer that predates this change with gvisor retained is outside this rollout. Keep this setting in internal operator material.
This rollout covers the dev demo box. The flagship is out of scope. `auto` still
selects systemd; changing that default needs a separate change.
## Prepare the release and approval
-Coordinate the version and window with agent manager `8a3d302`. Record Paul's
-quoted go from the design session and follow discussion #421: one live window,
-one release line. Require the merged-SHA root-runner witness before release;
-this runbook does not authorize a runner invocation.
+Get approval for the release version and rollout window. Use one live window and one release line. Before release, require the privileged verification for the merged commit. This runbook does not authorize running that verification.
Before changing any dev resource, domain or host configuration, present the
actual account, region, box, domain and bucket. List the release and channel,
@@ -53,34 +47,32 @@ set ID; it is not the hash of runsc alone.
Every member has its own object at `bootstrap/router/runsc-<setid>/<asset>`.
The console mirrors a complete advertised set for each supported Linux platform
reported by the fleet before promoting the system pointer. It derives the set ID
-from the target release's signed sums, so an older aware console can mirror a
-newer pin. Historical releases with no runtime assets and `--file` uploads do not
+from the target release's signed sums, so an older console with runtime-asset support can mirror a newer runtime set. Historical releases with no runtime assets and `--file` uploads do not
mirror a runtime. A partial set, a missing advertised asset, or a checksum or
signature failure stops the update.
-If the console is too old to mirror runtime assets, the release agent must copy
+If the console does not support runtime-asset mirroring, copy
all five verified members for the dev box's platform once, within the approved
dev bucket scope. Record the five full keys and each read-back SHA256. Verify
those hashes against both the signed sums and the target lock. Do not record
credentials. These are content-addressed objects: never overwrite different
bytes under an existing key.
-Before releasing to the dev demo box, confirm that it can read **all five**
-objects through its own store door or bucket role, and verify the returned bytes
-against the target pin. A successful upload or a read using the release agent's
+Before releasing to the dev demo box, confirm that it can read all five objects through its configured store access or bucket role, and verify the returned bytes against the target runtime set. A successful upload or a read using the release agent's
credentials does not prove box access. If this check fails, stop and ask. Changing
the store door or its permissions is a spec change, not part of this rollout.
## Roll the dev box
-1. Roll the aware release while the box still uses systemd. Wait for adoption and
+The file `/etc/carlos/host.env` must be a root-owned regular file under 1 MiB.
+
+1. Roll the release with exec-sandbox support while the box still uses systemd. Wait for adoption and
for `/opt/carlos/system/router/journal.json` to be absent. Check the newly
installed release and the exec-sandbox line in `carlos status --layout`.
2. Verify that the guard executor `/opt/carlos/system/guard/carlos` and both
trigger files, `/var/lib/carlos-claims/authority/exec/census.json` and
`/opt/carlos/system/guard/moves`, are absent, including dangling symlinks.
- Verify that the installed `carlos-system-recover.service` is the aware
- release's current unit and is the effective unit. Stop on a mismatch.
+ Verify that the installed `carlos-system-recover.service` is the current unit from the release with exec-sandbox support and is the effective unit. Stop on a mismatch.
3. Restart `carlos-instance-control.service` while still in systemd mode.
Control reads `/etc/carlos/host.env` only at startup. Adoption alone does not
refresh its environment or establish that the running controller is aware.
@@ -90,14 +82,11 @@ the store door or its permissions is a spec change, not part of this rollout.
control and the agent under the approved deployment procedure. Control's
startup runs `carlos-runsc.service`, which installs the complete pinned set.
Do not infer a restart from a changed symlink.
-5. Check Ready, the gVisor probe, and all five installed member hashes against
- the target lock. Check the box's exec-sandbox line and the instance sandbox
- column. A start refusal is a failed rollout; do not bypass it or fall back
+5. Check that the box reports Ready, then check the gVisor probe and all five installed member hashes against the target lock. Check the box's exec-sandbox line and the instance-sandbox column. A start refusal is a failed rollout; do not bypass it or fall back
silently to systemd.
6. Create a demo and build the full private-module demo starter under gVisor.
Prove `Worker.Initialize` completes under gVisor, then wake and claim the
- demo. These dev witnesses, including the claim deferred from Task 9, are
- required before calling the rollout verified. Record the demo, build,
+ demo. These dev witnesses, including the deferred claim witness, are required before calling the rollout verified. Record the demo, build,
instance and claim results, and the claimed app's response version.
7. Verify `X-Carlos-Version` over a successful response from the newly built
release using the correct destination and a fresh request. Record the release
@@ -110,12 +99,7 @@ replace a missing member-facing command with an unrecorded box operation.
## Roll back
-Set `CARLOS_EXEC_SANDBOX=systemd` in root-owned host.env, then restart control and
-the agent. Drain the gVisor run family and prove its processes are gone. Verify
-Ready and systemd in the box and instance status before rolling below the
-exec-sandbox awareness floor, if an older release is needed. Do not roll an
+Set `CARLOS_EXEC_SANDBOX=systemd` in root-owned `/etc/carlos/host.env`, then restart control and the agent. Drain the gVisor run family and prove its processes are gone. Verify that the box and instance status report Ready and systemd before rolling back below the minimum release that supports exec-sandbox, if an older release is needed. Do not roll an
unaware binary onto a box that still has gvisor configured.
-Follow up on the branch with a bootstrap-script check that refuses an old-pointer
-bootstrap or reimage when gvisor is retained. Keep that work separate; do not
-reopen the closed design or build the check as part of this task.
+Add a separate bootstrap-script check that refuses a bootstrap or reimage from a release pointer that predates this change when gvisor is retained. Do not reopen the design or include this check in the rollout.
diff --git a/internal/activator/execsandboxstatus_test.go b/internal/activator/execsandboxstatus_test.go
index 564070a1e..765ea7d13 100644
--- a/internal/activator/execsandboxstatus_test.go
+++ b/internal/activator/execsandboxstatus_test.go
@@ -40,7 +40,7 @@ func TestGVisorExitAttribution(t *testing.T) {
}
for _, ok := range []bool{true, false} {
line := p.exitLine(rec, ok)
- if !strings.HasSuffix(line, " (exit status via gVisor)") || strings.Contains(line, "app exited") || strings.Contains(line, "runtime exited") {
+ if !strings.HasSuffix(line, " (gVisor reported the exit; source not identified)") || strings.Contains(line, "app exited") || strings.Contains(line, "runtime exited") {
t.Fatalf("exit attribution: %q", line)
}
}
diff --git a/internal/activator/unitproc.go b/internal/activator/unitproc.go
index ad3f3fffd..91fd64667 100644
--- a/internal/activator/unitproc.go
+++ b/internal/activator/unitproc.go
@@ -541,7 +541,7 @@ func (p *unitProc) exitLine(rec instancectl.ExitRecord, ok bool) string {
line := exitLine(rec, ok)
if _, family := p.UnitIdentity(); family == execsandbox.FamilyGVisor {
// DRAFT: Paul reviews this wording before merge.
- line += " (exit status via gVisor)"
+ line += " (gVisor reported the exit; source not identified)"
}
return line
}
diff --git a/internal/host/execsandboxstatus.go b/internal/host/execsandboxstatus.go
index 04ad61a47..f57e3dd8e 100644
--- a/internal/host/execsandboxstatus.go
+++ b/internal/host/execsandboxstatus.go
@@ -3,6 +3,7 @@ package host
import (
"context"
"errors"
+ "fmt"
"sync/atomic"
"github.com/carlosframework/platform/internal/execsandbox"
@@ -22,6 +23,10 @@ func armExecSandboxStatus(read execSandboxStatusReader) {
// Without a reported configuration, a transport failure or an older root is
// unknown. A reported refusal keeps its pin and blocked reason.
func execSandboxStatusReport() *status.ExecSandbox {
+ return execSandboxStatusReportWithEnvironment(sandboxHostEnvironment)
+}
+
+func execSandboxStatusReportWithEnvironment(readEnv func() (func(string) string, error)) *status.ExecSandbox {
read := armedExecSandboxStatus.Load()
if read == nil {
return nil
@@ -37,5 +42,13 @@ func execSandboxStatusReport() *status.ExecSandbox {
if state.RunscVersion != "" || state.RunscSHA256 != "" {
report.Runsc = &status.RunscStatus{Version: state.RunscVersion, SHA256: state.RunscSHA256}
}
+ getenv, envErr := readEnv()
+ if envErr == nil {
+ _, _, envErr = execsandbox.ResolveFromEnv(getenv)
+ }
+ if envErr != nil {
+ report.Ready = false
+ report.Blocked = fmt.Sprintf("EXEC-SANDBOX-CONFIG: /etc/carlos/host.env: %v", envErr)
+ }
return report
}
diff --git a/internal/host/execsandboxstatus_test.go b/internal/host/execsandboxstatus_test.go
index 9c7e7f858..7d802c32d 100644
--- a/internal/host/execsandboxstatus_test.go
+++ b/internal/host/execsandboxstatus_test.go
@@ -7,6 +7,7 @@ import (
"path/filepath"
"reflect"
"strconv"
+ "strings"
"testing"
"github.com/carlosframework/platform/internal/activator"
@@ -117,3 +118,29 @@ func TestGVisorSizeInForceAllLogicalTiers(t *testing.T) {
t.Fatal("accepted mismatched unit family")
}
}
+
+func TestExecSandboxStatusNamesHostEnvironmentProblem(t *testing.T) {
+ old := armedExecSandboxStatus.Load()
+ t.Cleanup(func() { armedExecSandboxStatus.Store(old) })
+ armExecSandboxStatus(func(context.Context) (execsandbox.State, error) {
+ return execsandbox.State{Configured: execsandbox.Systemd, Effective: execsandbox.EffectiveSystemd, Ready: true}, nil
+ })
+ for _, kind := range []string{"unreadable", "invalid value"} {
+ t.Run(kind, func(t *testing.T) {
+ got := execSandboxStatusReportWithEnvironment(func() (func(string) string, error) {
+ if kind == "unreadable" {
+ return nil, execsandbox.ErrConfig
+ }
+ return func(k string) string {
+ if k == "CARLOS_EXEC_SANDBOX" {
+ return "broken"
+ }
+ return ""
+ }, nil
+ })
+ if got == nil || got.Ready || !strings.Contains(got.Blocked, "/etc/carlos/host.env") {
+ t.Fatalf("status=%+v", got)
+ }
+ })
+ }
+}
diff --git a/internal/host/sandboxenv_linux_test.go b/internal/host/sandboxenv_linux_test.go
index 87fd1ff66..a80c5c699 100644
--- a/internal/host/sandboxenv_linux_test.go
+++ b/internal/host/sandboxenv_linux_test.go
@@ -3,9 +3,11 @@
package host
import (
+ "context"
"errors"
"os"
"path/filepath"
+ "strings"
"testing"
"github.com/carlosframework/platform/internal/execsandbox"
@@ -42,3 +44,41 @@ func TestExecSandboxHostEnvironmentRegularFile(t *testing.T) {
})
}
}
+
+func TestExecSandboxStatusHostEnvironmentFiles(t *testing.T) {
+ old := armedExecSandboxStatus.Load()
+ t.Cleanup(func() { armedExecSandboxStatus.Store(old) })
+ armExecSandboxStatus(func(context.Context) (execsandbox.State, error) {
+ return execsandbox.State{Configured: execsandbox.Systemd, Effective: execsandbox.EffectiveSystemd, Ready: true}, nil
+ })
+ for _, kind := range []string{"fifo", "directory", "symlink", "oversize", "invalid"} {
+ t.Run(kind, func(t *testing.T) {
+ path := filepath.Join(t.TempDir(), "host.env")
+ var err error
+ switch kind {
+ case "fifo":
+ err = unix.Mkfifo(path, 0600)
+ case "directory":
+ err = os.Mkdir(path, 0700)
+ case "symlink":
+ err = os.Symlink("missing", path)
+ case "oversize":
+ err = os.WriteFile(path, make([]byte, (1<<20)+1), 0600)
+ case "invalid":
+ err = os.WriteFile(path, []byte("CARLOS_EXEC_SANDBOX=broken\n"), 0600)
+ }
+ if err != nil {
+ t.Fatal(err)
+ }
+ read := func() (func(string) string, error) { return sandboxHostEnvironmentAt(path) }
+ got := execSandboxStatusReportWithEnvironment(read)
+ if got == nil || got.Ready || !strings.Contains(got.Blocked, "/etc/carlos/host.env") {
+ t.Fatalf("report=%+v", got)
+ }
+ a := systemApplier{sandboxEnvironment: read}
+ if mode, err := a.sandboxMode(); mode != execsandbox.EffectiveGVisor || !errors.Is(err, errExecSandboxFloor) {
+ t.Fatal(mode, err)
+ }
+ })
+ }
+}
diff --git a/internal/instancectl/gvisor_finalbatch_test.go b/internal/instancectl/gvisor_finalbatch_test.go
new file mode 100644
index 000000000..e6846dd70
--- /dev/null
+++ b/internal/instancectl/gvisor_finalbatch_test.go
@@ -0,0 +1,170 @@
+package instancectl
+
+import (
+ "context"
+ "errors"
+ "io/fs"
+ "net/http/httptest"
+ "os"
+ "path/filepath"
+ "strings"
+ "testing"
+ "time"
+
+ "github.com/carlosframework/platform/internal/execsandbox"
+)
+
+func TestGVisorNativeReadyFilesystemGate(t *testing.T) {
+ for _, state := range []string{"absent", "empty parents", "bundle", "skeleton", "unreadable"} {
+ t.Run(state, func(t *testing.T) {
+ s, _ := gvisorStartFixture(t)
+ s.SandboxEffective = execsandbox.EffectiveSystemd
+ root := t.TempDir()
+ s.sandboxBundleRoot, s.sandboxRootfsRoot = filepath.Join(root, "bundles"), filepath.Join(root, "skeletons")
+ calls := 0
+ s.Systemctl = func(_ context.Context, args ...string) (string, error) {
+ calls++
+ if args[0] == "list-units" {
+ return GVisorUnitName("demo.example") + " loaded active running", nil
+ }
+ if args[0] == "show" {
+ return strings.ReplaceAll(systemd257Stopped(GVisorUnitName("demo.example")), "ActiveState=inactive", "ActiveState=active"), nil
+ }
+ return "", nil
+ }
+ if state != "absent" {
+ for _, p := range []string{s.sandboxBundleRoot, s.sandboxRootfsRoot} {
+ if err := os.Mkdir(p, 0700); err != nil {
+ t.Fatal(err)
+ }
+ }
+ }
+ switch state {
+ case "bundle":
+ if err := os.Mkdir(filepath.Join(s.sandboxBundleRoot, "run-demo.example"), 0700); err != nil {
+ t.Fatal(err)
+ }
+ case "skeleton":
+ if err := os.Mkdir(filepath.Join(s.sandboxRootfsRoot, "run-demo.example"), 0700); err != nil {
+ t.Fatal(err)
+ }
+ case "unreadable":
+ s.sandboxBundleRoot = filepath.Join(root, "file")
+ if err := os.WriteFile(s.sandboxBundleRoot, nil, 0600); err != nil {
+ t.Fatal(err)
+ }
+ default:
+ s.CgroupRoot = filepath.Join(root, "not-a-directory")
+ if err := os.WriteFile(s.CgroupRoot, nil, 0600); err != nil {
+ t.Fatal(err)
+ }
+ }
+ rep, ready := s.Ready()
+ want := state == "absent" || state == "empty parents"
+ if ready != want {
+ t.Fatalf("ready=%v report=%+v", ready, rep)
+ }
+ if want && calls != 0 {
+ t.Fatalf("native Ready queried systemd %d times", calls)
+ }
+ if (state == "bundle" || state == "skeleton") && calls == 0 {
+ t.Fatal("retained state did not trigger drain")
+ }
+ })
+ }
+}
+
+func TestGVisorCgroupDisappearsDuringWalk(t *testing.T) {
+ root := t.TempDir()
+ first, last := filepath.Join(root, "a"), filepath.Join(root, "z")
+ for _, p := range []string{first, last} {
+ if err := os.Mkdir(p, 0700); err != nil {
+ t.Fatal(err)
+ }
+ }
+ removed := false
+ err := walkSandboxCgroups(root, func(path string, d fs.DirEntry, err error) error {
+ if err != nil {
+ return err
+ }
+ if path == first {
+ removed = true
+ return os.Remove(last)
+ }
+ return nil
+ })
+ if err != nil || !removed {
+ t.Fatalf("removed=%v walk=%v", removed, err)
+ }
+ if err := walkSandboxCgroups(root, func(string, fs.DirEntry, error) error { return os.ErrPermission }); !errors.Is(err, os.ErrPermission) {
+ t.Fatal("lost permission error", err)
+ }
+}
+
+func TestGVisorSweepFailureStaysWithItsHost(t *testing.T) {
+ s, _ := gvisorStartFixture(t)
+ s.sandboxBundleRoot = t.TempDir()
+ for _, id := range []string{"run-demo.example", "run-other.example"} {
+ if err := os.Mkdir(filepath.Join(s.sandboxBundleRoot, id), 0700); err != nil {
+ t.Fatal(err)
+ }
+ }
+ fail := true
+ s.removeSandbox = func(id string) error {
+ if id == "run-demo.example" && fail {
+ return errors.New("fixture cleanup refused")
+ }
+ return nil
+ }
+ if rep, ready := s.Ready(); !ready {
+ t.Fatalf("one host blocked box: %+v", rep)
+ }
+ w := httptest.NewRecorder()
+ s.handleStart(w, httptest.NewRequest("POST", "/start?host=demo.example&role=run&memory_max=268435456", nil))
+ if w.Code != 503 || !strings.Contains(w.Body.String(), "fixture cleanup refused") {
+ t.Fatal(w.Code, w.Body)
+ }
+ if _, err := s.requestFamily(request{host: "other.example"}, RoleRun); err != nil {
+ t.Fatal("unrelated host refused", err)
+ }
+ fail = false
+ if rep, ready := s.Ready(); !ready {
+ t.Fatal(rep)
+ }
+ if _, err := s.requestFamily(request{host: "demo.example"}, RoleRun); err != nil {
+ t.Fatal("recovered host still refused", err)
+ }
+}
+
+func TestNativeSweepKeepsPollingUntilSettled(t *testing.T) {
+ unit := UnitName(RoleRun, "native.example")
+ polls, stops := 0, 0
+ s := &Server{CgroupRoot: t.TempDir(), cgroupWaitBudget: time.Second}
+ s.Systemctl = func(_ context.Context, args ...string) (string, error) {
+ switch args[0] {
+ case "list-units":
+ return unit + " loaded activating start", nil
+ case "list-jobs":
+ return "", nil
+ case "stop":
+ stops++
+ return "", nil
+ case "show":
+ if strings.Join(args, " ") != "show -p ActiveState --value "+unit {
+ t.Fatalf("unexpected proof %v", args)
+ }
+ polls++
+ if polls < 3 {
+ return "activating\n", nil
+ }
+ return "inactive\n", nil
+ }
+ t.Fatalf("unexpected command %v", args)
+ return "", nil
+ }
+ w := httptest.NewRecorder()
+ s.handleSweep(w, httptest.NewRequest("POST", "/sweep", nil))
+ if w.Code != 200 || stops != 1 || polls != 3 {
+ t.Fatalf("status=%d stops=%d polls=%d: %s", w.Code, stops, polls, w.Body)
+ }
+}
diff --git a/internal/instancectl/gvisor_fix1_test.go b/internal/instancectl/gvisor_fix1_test.go
index 2a066a0d9..5e94374e6 100644
--- a/internal/instancectl/gvisor_fix1_test.go
+++ b/internal/instancectl/gvisor_fix1_test.go
@@ -125,7 +125,11 @@ func TestGVisorFix1ReadyDrainOnce(t *testing.T) {
if rep, ok := s.Ready(); !ok {
t.Fatal(rep)
}
- if lists != 1 || jobs != 1 {
+ want := 1
+ if mode == execsandbox.EffectiveSystemd {
+ want = 0
+ }
+ if lists != want || jobs != want {
t.Fatalf("list-units=%d list-jobs=%d", lists, jobs)
}
})
diff --git a/internal/instancectl/gvisordrain.go b/internal/instancectl/gvisordrain.go
index 0557eb618..89c5845f5 100644
--- a/internal/instancectl/gvisordrain.go
+++ b/internal/instancectl/gvisordrain.go
@@ -4,6 +4,7 @@ import (
"context"
"errors"
"fmt"
+ "io/fs"
"os"
"path/filepath"
"strings"
@@ -71,10 +72,7 @@ func (s *Server) sandboxUnitsFor(ctx context.Context, family execsandbox.Family)
}
}
root := filepath.Join(s.CgroupRoot, "carlos.slice")
- err = filepath.WalkDir(root, func(path string, d os.DirEntry, err error) error {
- if errors.Is(err, os.ErrNotExist) && path == root {
- return nil
- }
+ err = walkSandboxCgroups(root, func(path string, d os.DirEntry, err error) error {
if err != nil {
return err
}
@@ -159,10 +157,7 @@ func (s *Server) assertSandboxDrain(ctx context.Context) error {
func (s *Server) sandboxUnitEmpty(unit string) error {
root := filepath.Join(s.CgroupRoot, "carlos.slice")
- return filepath.WalkDir(root, func(path string, d os.DirEntry, err error) error {
- if errors.Is(err, os.ErrNotExist) && path == root {
- return nil
- }
+ return walkSandboxCgroups(root, func(path string, d os.DirEntry, err error) error {
if err != nil {
return err
}
@@ -241,6 +236,9 @@ func (s *Server) sweepGVisorBundles(ctx context.Context) error {
return err
}
for _, entry := range entries {
+ if ctx.Err() != nil {
+ break
+ }
iid, ok := strings.CutPrefix(entry.Name(), "run-")
if !ok {
continue
@@ -263,10 +261,11 @@ func (s *Server) sweepGVisorBundles(ctx context.Context) error {
if err == nil {
err = s.stopRunFamiliesID(ctx, iid)
}
- release()
if err != nil {
- return fmt.Errorf("%w: %v", errSandboxDrain, err)
+ s.gvisorSweepBlocked.Store(iid, fmt.Errorf("%w: %s: %v", errSandboxDrain, iid, err))
+ s.logf("instance-control: gVisor cleanup %s: %v", iid, err)
}
+ release()
}
return nil
}
@@ -283,3 +282,34 @@ func (s *Server) sweepOriginalRun(ctx context.Context, esc string) error {
}
return s.stopRunFamiliesID(ctx, iid)
}
+
+// Files are created before every gVisor start and removed only after the stop
+// proof. The controller's final P2-1 ruling therefore excludes loaded but
+// inactive units with no retained files from native Ready's drain trigger.
+func (s *Server) sandboxFilesPresent() (bool, error) {
+ for _, root := range []string{s.sandboxBundleRoot, s.sandboxRootfsRoot} {
+ if root == "" {
+ continue
+ }
+ entries, err := os.ReadDir(root)
+ if errors.Is(err, os.ErrNotExist) {
+ continue
+ }
+ if err != nil {
+ return false, fmt.Errorf("%w: %v", errSandboxDrain, err)
+ }
+ if len(entries) > 0 {
+ return true, nil
+ }
+ }
+ return false, nil
+}
+
+func walkSandboxCgroups(root string, visit fs.WalkDirFunc) error {
+ return filepath.WalkDir(root, func(path string, d fs.DirEntry, err error) error {
+ if errors.Is(err, os.ErrNotExist) {
+ return filepath.SkipDir
+ }
+ return visit(path, d, err)
+ })
+}
diff --git a/internal/instancectl/gvisorunit.go b/internal/instancectl/gvisorunit.go
index 5266fa412..603364579 100644
--- a/internal/instancectl/gvisorunit.go
+++ b/internal/instancectl/gvisorunit.go
@@ -265,10 +265,6 @@ func (s *Server) assertGVisorUnit(ctx context.Context, host, unit string) error
return err
}
if role == roleProbe {
-
- if err != nil {
- return err
- }
return gvisorProbeOutputShown(source)
}
out, err = s.Systemctl(ctx, "show", SliceName(host), "-p", "MemoryMax,MemoryHigh,MemorySwapMax,TasksMax,CPUWeight,CPUQuotaPerSecUSec,IOWeight")
diff --git a/internal/instancectl/sandbox.go b/internal/instancectl/sandbox.go
index 252e913a4..aef90ad34 100644
--- a/internal/instancectl/sandbox.go
+++ b/internal/instancectl/sandbox.go
@@ -9,6 +9,7 @@ import (
"github.com/carlosframework/platform/internal/demo"
"github.com/carlosframework/platform/internal/execsandbox"
"github.com/carlosframework/platform/internal/hostwrite"
+ "github.com/carlosframework/platform/internal/provision"
"github.com/carlosframework/platform/internal/registry"
)
@@ -49,6 +50,9 @@ func (s *Server) unitFamily(effective execsandbox.Effective, role Role, route *r
}
func (s *Server) requestFamily(req request, role Role) (execsandbox.Family, error) {
+ if err, blocked := s.gvisorSweepBlocked.Load(provision.InstanceID(req.host)); blocked {
+ return "", err.(error)
+ }
var route *registry.Route
if s.effectiveSandbox() == execsandbox.EffectiveGVisor {
if req.rootfs() {
diff --git a/internal/instancectl/sandboxstop.go b/internal/instancectl/sandboxstop.go
index 4c6767457..2d07420d1 100644
--- a/internal/instancectl/sandboxstop.go
+++ b/internal/instancectl/sandboxstop.go
@@ -46,7 +46,11 @@ func (s *Server) stopRunFamiliesID(ctx context.Context, iid string) error {
if _, err := s.removeGenFiles(sibling, gvisorRemoveBundle); err != nil {
return err
}
- return s.removeGVisorDropIn(ctx, sibling)
+ if err := s.removeGVisorDropIn(ctx, sibling); err != nil {
+ return err
+ }
+ s.gvisorSweepBlocked.Delete(iid)
+ return nil
}
func runInactive(m map[string]string) bool {
diff --git a/internal/instancectl/server.go b/internal/instancectl/server.go
index 4aaa8486f..1c21a293a 100644
--- a/internal/instancectl/server.go
+++ b/internal/instancectl/server.go
@@ -52,6 +52,8 @@ type Server struct {
gvisorVerified execsandbox.RunscVerifier
gvisorProbeIdentity string
sandboxBundleRoot string
+ sandboxRootfsRoot string
+ gvisorSweepBlocked sync.Map
gvisorIdentityTest func() (string, error)
gvisorBundleTestOps *gvisorBundleOps
gvisorProbeTestOps *gvisorProbeOps
@@ -334,6 +336,7 @@ func runWithClaim(args []string, claim, heldRelease http.Handler, view RegistryV
DemoPurgeGuard: view.DemoPurgeGuard,
DemoRunRoot: "/run/carlos/instances",
sandboxBundleRoot: "/run/carlos-control/oci",
+ sandboxRootfsRoot: "/var/lib/carlos/oci-rootfs",
ProbeImage: BuildProbeImage,
ProbeImageFile: ProbeImagePath,
RootfsProbeOut: filepath.Join(controlsock.Dir, "rootfs-probe.out"),
@@ -1406,7 +1409,15 @@ func (s *Server) Ready() (ProbeReport, bool) {
if err := s.sandboxAdmission(ctx); err != nil {
return s.withSandboxState(sandboxReport(err)), false
}
- if s.Systemctl != nil && s.CgroupRoot != "" {
+ drain := s.effectiveSandbox() == execsandbox.EffectiveGVisor
+ if !drain {
+ var err error
+ drain, err = s.sandboxFilesPresent()
+ if err != nil {
+ return s.withSandboxState(sandboxReport(err)), false
+ }
+ }
+ if drain && s.Systemctl != nil && s.CgroupRoot != "" {
if err := s.assertSandboxDrain(ctx); err != nil {
return s.withSandboxState(sandboxReport(err)), false
}
diff --git a/internal/provision/testdata/plan14-root-reads-chain.tsv b/internal/provision/testdata/plan14-root-reads-chain.tsv
index af9878dbe..931c49378 100644
--- a/internal/provision/testdata/plan14-root-reads-chain.tsv
+++ b/internal/provision/testdata/plan14-root-reads-chain.tsv
@@ -128,4 +128,4 @@ plan14-root-reads-fix-activator-backoff-flake.tsv feba66806ddfcbdfaf369d72413bb1
plan14-root-reads-region-ha-dr5.tsv f19eb78c1da1475cbf8e11a3d6c394d828aa1c8f88ae24469fe8d473581b934b
plan14-root-reads-instance-syscall-filter.tsv b970bb28c5a633d2572a1da549030e9258cfdabb6322ddffdd0ebf41b56c464c
plan14-root-reads-instance-restore-658-cli.tsv b970bb28c5a633d2572a1da549030e9258cfdabb6322ddffdd0ebf41b56c464c
-plan14-root-reads-gvisor-demos.tsv 6f8b2354ccd73a6a0e48f5c675fdb186e7def8c7dd9863c8e898c351201da597
+plan14-root-reads-gvisor-demos.tsv 4beca9417da58ddc58b25bd3173b91308840c7a0a27806e65b17439ce54bc1b3
diff --git a/internal/provision/testdata/plan14-root-reads-gvisor-demos.tsv b/internal/provision/testdata/plan14-root-reads-gvisor-demos.tsv
index 9a12a0260..61b5c4ab1 100644
--- a/internal/provision/testdata/plan14-root-reads-gvisor-demos.tsv
+++ b/internal/provision/testdata/plan14-root-reads-gvisor-demos.tsv
@@ -24,7 +24,7 @@
@legacy 82ba9b45321078b468fb92afd835e2f75415a3c7ae7109cb61b08d39e02082c5 internal/instancectl/gen.go Server.handleParent legacy accepted-legacy accepted-legacy;rev3=J2,J4;basis=root-input;rev3=census-ruling-instance-egress-sizes-328-329;basis=#329 plan 3 Task 5: holds the host's slice lock (lockSliceWrites) around its one set-property, so /parent and /size never interleave on one slice. Its one site is still r.URL.Query() of the agent's request (counted as file:Query). The checks in this body are unchanged, though cgroup.ValidParentLimit, which it calls, now accepts one size or the sum of any two from the four-row table (up to 4 GiB, was 2 GiB); no read added.;rev3=census-ruling-agent-start-demo-1;basis=Reads fixed DemoBox and clamps the existing parent memory writer to small.;rev3=census-ruling-gvisor-demos;basis=Validate logical parent input as before, require the demo route in gVisor mode and apply Physical once to the small demo parent. Existing request query read unchanged; shares stay logical. file:Query@78 0646b2e418f426992e35bb05ec9a2c23fa0f916f7af1e4366f3ade14ddc12c69
@legacy d6421b84958c2af443e0556aa224414d7a2a9056ed887f0cd389c7b4c1a759a9 internal/instancectl/rootfs.go Server.runRootfsProbe legacy accepted-legacy accepted-legacy;rev3=census-ruling-rootfs-apps-2;identity=instance control (/opt/carlos/carlos instance-control, carlos-instance-control.service, root);basis=root-input (J2,J4, as Server.RunProbe): new (rootfs Plan 2 Task 7): builds the probe image once per service start, hashes it (fileSHA256), lays out the _probe rootfs exe layout and its box-addrs, starts carlos-instance-rootfs-probe.service and ReadFiles its report from /run/carlos-control/rootfs-probe.out, which PID 1 writes from the probe's stdout; the probe runs the platform binary from root's own probe image, no tenant code; the report only decides readiness, and without an ok root-image line it is never ready, whatever it says;rev3=census-ruling-agent-start-demo-1;basis=Reads DemoBox and refuses before preparing or launching a rootfs probe; ordinary probe behavior unchanged.;rev3=census-ruling-gvisor-demos;basis=Refuse sandbox configuration or readiness errors before preparing or starting the native rootfs probe. Existing image read unchanged. Task 6: Effective gVisor refuses ROOTFS explicitly before native/rootfs probe preparation; no fallback. Existing native reads unchanged. file:ReadFile@2133 9f191518546c42664f607e5b8dbc85bc273fc7abc29bb12283edad58223b73a3
@legacy fba53ebc8c38053a37328dd85a3d3b38d4852b20f20cc55897227a59722cac5a internal/instancectl/server.go Server.RunProbe legacy accepted-legacy accepted-legacy;rev3=J2,J4;basis=root-input;rev3=census-ruling-rootfs-apps-2;basis=after the resolver allow it applies the box-address deny (denyLocalAddrs: set-property IPAddressDeny on carlos-instances.slice from localPrefixes, which reads /proc/net/fib_trie and /proc/net/if_inet6 as LocalAddrs already did), writes the probe's box-addrs under its own exe layout (writeFileExcl, a decision row), and after the binary probe runs the rootfs probe (runRootfsProbe, a decision row); its own direct read, probe.out, is unchanged;rev3=census-ruling-region-ha-p3b;basis=Take shared root hairpin lease for the entire probe so deny refresh and hairpin mutation cannot race it. Indirect reads validate root boot snapshot, root state/fence and interface inventory; existing probe.out direct read remains and lock/config errors fail readiness.;rev3=census-ruling-gvisor-demos;basis=Select the fixed root-private probe family and delegate gVisor to its serialized root/guest proof, with no native/rootfs fallback. Task 6 fix round 1: remove mode drain from probe execution (Ready/ReadyDemo only), and let runGVisorProbe atomically publish the report/runtime identity including start lines once. Existing native report read unchanged. file:ReadFile@2874 d77aeeac7de9d58663980809014bd4c83060235b63ac4c85cf25bcb89827c80b
-@legacy 82605110a6be16960462dabb0f3740520c3204748ff60a8ead26fc4c36d91d90 internal/instancectl/server.go type Server 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. Census ruling 292 reclassified this declaration accepted-legacy (J2,J4) for root's per-host ordering of legacy run starts against stops; this ruling kept the row as main classed it. Its own addition is the cmd start's poll and wait bounds and its per-host lock map: field declarations only;rev3=census-ruling-rootfs-apps-2;basis=new fields: HostRuntime, ProbeImage, ProbeImageFile, RootfsProbeOut, DenyEvery, the deny's lastDeny and denyMu, the rootfs probe's report and lock, the jit reload counters and imageDigests; genStarting counts binary generation starts per unit; rootfsLocksMu and rootfsLocks, one lock entry per rootfs unit name being started or removed right now, held by a start from its layout through systemctl start and its own cleanup and by a removal from its proof through the raw removal, a removal refusing while it is taken, a waiting start giving up when its request ends, an entry dropped with its last holder or waiter (fixes E6, L2, L3); rootfsProvenHook, a test hook run between the proof and the raw removal; field declarations only; no read added;rev3=census-ruling-instance-egress-sizes-328-329;basis=#328 plan 2 and #329 plan 3 Task 5: the declaration gains sliceLocks (one mutex per host slice, taken by /size and /parent) and Egress (the asserter every start path calls), and its comment names the egress allow (plan 3's ControlDropInDir field was deleted in ef38e13b, the P1 EROFS fix); the same one site, the Statfs field, offset moved; no read added.;rev3=census-ruling-rootfs-apps-6;basis=rootfs Plan 6 Task 6: comments only: the one-shot pacing fields cover /cmd and /tty, and cmdLocks is now keyed by (role, host) (oneShotKey, PF-7) so a session's start never waits behind a command's; field declarations unchanged; the same one site, no read added;rev3=census-ruling-agent-start-demo-1;basis=Adds fixed demo configuration, registry views, derived runtime root, synchronization and purge guard.;rev3=census-ruling-region-ha-p3b;basis=Add hairpinActive boolean alongside lastDeny under existing deny synchronization. Field declaration only; existing Statfs selector unchanged, no new read or externally supplied authority.;rev3=census-ruling-region-ha-p3b2-rolls;basis=adds one field holding the current hairpin exit watcher, guarded by the root hairpin flock; no new read;rev3=census-ruling-agent-start-demo-3;basis=Retain the snapshot supervisor in instance-control state; no new request-selected path. Census read-site delta: unchanged (1).;rev3=census-ruling-gvisor-demos;basis=Retain Task 1 mode/error/readiness fields, baseline/runtime callbacks, Task 4 per-host validated staged descriptors and root-selected probe nonce. Fix round 1 adds a private writer-operation seam assigned only in package tests, after the unchanged GVisorID admission check; production defaults still call the same checked constructor, WriteRootfs, WriteBundle and verifier. No new direct read or request-controlled callback. Task 5: private injected removal seam for unprivileged tests; production default removes only root-derived bundle and skeleton after both-family proof inside existing start fence. No new request field or agent-selected unit. Task 6: Retain serialized probe nonce, runtime-set identity verifier/token, fixed claims flag, bundle discovery root, and private unprivileged identity seam. No request-controlled callback or path; existing declaration read-site classification unchanged. Task 6 fix round 1: private gvisorProbeTestOps is set only in package tests; production defaults retain all fixed paths and the checked root output opener. No externally supplied callback or new direct read. file:Statfs@4829 1541a3b0e5f9972f07c1d94b85d1067fa83d1b24099ebf6b65d783716d4a7353
+@legacy 943e4b95e8403b0b443cdfc93ab673596230ef7e6c122bc34f9fc2cadbf44775 internal/instancectl/server.go type Server 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. Census ruling 292 reclassified this declaration accepted-legacy (J2,J4) for root's per-host ordering of legacy run starts against stops; this ruling kept the row as main classed it. Its own addition is the cmd start's poll and wait bounds and its per-host lock map: field declarations only;rev3=census-ruling-rootfs-apps-2;basis=new fields: HostRuntime, ProbeImage, ProbeImageFile, RootfsProbeOut, DenyEvery, the deny's lastDeny and denyMu, the rootfs probe's report and lock, the jit reload counters and imageDigests; genStarting counts binary generation starts per unit; rootfsLocksMu and rootfsLocks, one lock entry per rootfs unit name being started or removed right now, held by a start from its layout through systemctl start and its own cleanup and by a removal from its proof through the raw removal, a removal refusing while it is taken, a waiting start giving up when its request ends, an entry dropped with its last holder or waiter (fixes E6, L2, L3); rootfsProvenHook, a test hook run between the proof and the raw removal; field declarations only; no read added;rev3=census-ruling-instance-egress-sizes-328-329;basis=#328 plan 2 and #329 plan 3 Task 5: the declaration gains sliceLocks (one mutex per host slice, taken by /size and /parent) and Egress (the asserter every start path calls), and its comment names the egress allow (plan 3's ControlDropInDir field was deleted in ef38e13b, the P1 EROFS fix); the same one site, the Statfs field, offset moved; no read added.;rev3=census-ruling-rootfs-apps-6;basis=rootfs Plan 6 Task 6: comments only: the one-shot pacing fields cover /cmd and /tty, and cmdLocks is now keyed by (role, host) (oneShotKey, PF-7) so a session's start never waits behind a command's; field declarations unchanged; the same one site, no read added;rev3=census-ruling-agent-start-demo-1;basis=Adds fixed demo configuration, registry views, derived runtime root, synchronization and purge guard.;rev3=census-ruling-region-ha-p3b;basis=Add hairpinActive boolean alongside lastDeny under existing deny synchronization. Field declaration only; existing Statfs selector unchanged, no new read or externally supplied authority.;rev3=census-ruling-region-ha-p3b2-rolls;basis=adds one field holding the current hairpin exit watcher, guarded by the root hairpin flock; no new read;rev3=census-ruling-agent-start-demo-3;basis=Retain the snapshot supervisor in instance-control state; no new request-selected path. Census read-site delta: unchanged (1).;rev3=census-ruling-gvisor-demos;basis=Retain Task 1 mode/error/readiness fields, baseline/runtime callbacks, Task 4 per-host validated staged descriptors and root-selected probe nonce. Fix round 1 adds a private writer-operation seam assigned only in package tests, after the unchanged GVisorID admission check; production defaults still call the same checked constructor, WriteRootfs, WriteBundle and verifier. No new direct read or request-controlled callback. Task 5: private injected removal seam for unprivileged tests; production default removes only root-derived bundle and skeleton after both-family proof inside existing start fence. No new request field or agent-selected unit. Task 6: Retain serialized probe nonce, runtime-set identity verifier/token, fixed claims flag, bundle discovery root, and private unprivileged identity seam. No request-controlled callback or path; existing declaration read-site classification unchanged. Task 6 fix round 1: private gvisorProbeTestOps is set only in package tests; production defaults retain all fixed paths and the checked root output opener. No externally supplied callback or new direct read. Final R1 P2: retain fixed skeleton parent and concurrent per-instance cleanup refusals; no direct read or external configuration field. file:Statfs@4909 6eb459d77f07ba715fd15078c35a70bad6fd9d10837fedd7ccaa38cd4a6eb720
@legacy ada6718d9612d563ad7856e1086f4a4fcf65eb613b39014856e9be0f2a9f4bdc internal/publicrelease/feed.go Feed.get legacy accepted-legacy accepted-legacy;rev3=J4;basis=root-input;rev3=census-ruling-gvisor-demos;basis=Bound release downloads with a one-byte oversize check so a signed prefix cannot authenticate a truncated larger response; existing HTTP body read only, no new root input. file:ReadAll@518 8da54d4a2ce87c719f1927f1c96d9ea71770fa2475010a220c5029e3086d2752
@legacy 94f529dab8132514e8465d43036503f8d2bf3756fbffef26c885dca3e706b1c1 internal/status/dryrun.go dryRunFixtures legacy accepted-legacy accepted-legacy;rev3=J1;basis=root-route;rev3=census-ruling-gvisor-demos;basis=Task 8: add private sandbox status and row fixtures plus leak needles. Fixture data only; public fleet shape unchanged. whole:Route@5482 8ddd1f1ff4d638b9ec2df0f24fe3f3559fe5a6f2b4d9e347f539aee89d95faf1
@legacy e2acef4737299cc83882f71697f932039ba26522a61138d88aaa2361c120b1db status_instances.go printStatusLayout legacy accepted-legacy accepted-legacy;rev3=J4;basis=root-input;rev3=census-ruling-instance-egress-sizes-328-329;basis=#328 plan 2 Task 12 and #329 plan 3 Task 10: carlos status --layout, in the operator's carlos CLI on the operator's own machine, prints SIZE and EGRESS columns from the console's JSON (statusLayoutRow.Size and Egress), joins the egress reason into REASON and prints one note when a size is pending; the same one site (the /data literal in the mixed-box warning), no read added.;rev3=census-ruling-region-labels;basis=a REGION column (statusRegionCell) from the console's answer; no read added;rev3=census-ruling-gvisor-demos;basis=Task 8: print draft SANDBOX column and one exec-sandbox summary per reported box from the existing operator API. Missing/stale reports display unknown; no new file read or authority. data-literal@2413 28d6e05b336a4c99d9e1a3172116a4f6c03ddc7ae3cacd68d0ba0b304b203687
@@ -64,10 +64,10 @@
@legacy 4de04c1583d5fa335adadb7227f9ce1ec35e28280744d6571ebe92c72b4442f2 internal/host/units/carlos-instance-gvisor@.service external legacy accepted-legacy accepted-legacy;rev3=census-ruling-gvisor-demos;basis=Add the unarmed root gVisor run skeleton with empty ExecStart and all twelve measured host properties. Defines per-instance data/run writable paths and socket output, root runtime directory, mixed kill with SIGCONT, and the existing bounded stop. A root-prepared validated command drop-in is required before it can start; no command or pin placeholder is installed here. file:external@0 914a3c0486d83b6b87ce14c473aab9005ff7bc004cb984040a81ddc60087a5c1
@legacy dd34ca6003fd907b4919382e5d960722556e8d322311cfa1d70b1eb76d96274d 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. file:external@0 215ca2aea9519d14d0e20b5f9b6588b43ff7c5ef7b485982274fbbbfe2cf02b5
@legacy e5a4701c68ee01ad17e15dbad4f8e9bde74c34b59f38fd0b111d1c2f3fea9ac1 internal/instancectl/demo_policy.go Server.demoCgroupReadback legacy accepted-legacy accepted-legacy;rev3=census-ruling-gvisor-demos;basis=Read memory.max/high/swap.max, pids.max, cpu.max/weight and io.weight in the derived parent and validated child cgroups. GVisor uses Physical memory/tasks and logical shares; pre-start only absent groups may defer verification, and post-start requires every file. Native checks remain the existing logical limits. Task 9: Round only expected kernel memory.high for existing run and parent reads; exact memory.max and required kernel files retained. No new read. file:ReadFile@1379,file:Stat@1224 41da87161a8858d3749a461486fff9a6a46b9dccbc421658a4f0643e329e9afd
-@legacy 00c33dceabb209518ceebdc5ad8c399df4101357804a47141965cf01f13e1330 internal/instancectl/gvisordrain.go Server.sandboxUnitEmpty legacy accepted-legacy accepted-legacy;rev3=census-ruling-gvisor-demos;basis=Read the fixed carlos.slice cgroup hierarchy for the named discovered unit and require populated 0; skip other service subtrees. Task 6 fix round 1 confines the opposite-family caller to Ready/ReadyDemo. No request-selected filesystem path or new read site. file:WalkDir@116 e802bfb809b344b2ae4e1b3d7ae9f4896b8e3396dac720de56fa218b203e8994
-@legacy 2f09251e4b1d9e0966073e3ce00e5bdb6810f0e7d483fa7b054fc1d779f171f4 internal/instancectl/gvisordrain.go Server.sandboxUnitsFor legacy accepted-legacy accepted-legacy;rev3=census-ruling-gvisor-demos;basis=Task 6 fix round 1: enumerate systemd units/jobs and the fixed carlos.slice kernel hierarchy, filtering by the requested fixed family. Ready in systemd mode lists only gVisor instance/probe/build patterns and ignores native jobs/services; original gVisor host overlap checks request both families. Never invoked by native per-start admission. Only kernel-owned cgroup directory reads; no tenant-selected path or runsc-state traversal. file:WalkDir@1194 6ce5d5d373840b13e1bf20a1791cbd1390540448fd238e71b2b8abb4acf05216
-@legacy 732a77a4fb010d06211707a09b74525afb694cd4b7d03fecda1fc24eddf98e09 internal/instancectl/gvisordrain.go Server.sweepGVisorBundles legacy accepted-legacy accepted-legacy;rev3=census-ruling-gvisor-demos;basis=List the fixed root-owned OCI directory, accept only validated run IDs, skip live/in-flight work and acquire the original instance-ID fence before both-family stop/delete proof and removal. Never opens /run/carlos-runsc. file:ReadDir@130 0572d9325bd87b5326c195ad30874350114ad25f72d99648731ffe45ea2924a7
+@legacy e17ce3f2cb6a0ecc34ddc280dadf3cb4071e68fc98be8ce46882aa3543f88a27 internal/instancectl/gvisordrain.go Server.sandboxFilesPresent legacy accepted-legacy accepted-legacy;rev3=census-ruling-gvisor-demos;basis=Final controller ruling: check only the two fixed root-owned bundle/skeleton parents, listing only their immediate entries (ReadDir opens directories without blocking on a FIFO), without recursion, systemctl or cgroups. Empty or absent parents mean no retained state; loaded-only inactive units are explicitly excluded because files precede start and removal follows termination proof. Other filesystem errors refuse readiness. file:ReadDir@182 8bf90d0c5cd5d8f856a465549fd96db2f763a6137dc64460728422151285503d
+@legacy 399c3d5adc5338ada7970bcce06fa5ff25583b2c41568d72be12479c17d50d10 internal/instancectl/gvisordrain.go Server.sweepGVisorBundles legacy accepted-legacy accepted-legacy;rev3=census-ruling-gvisor-demos;basis=List the fixed root-owned OCI directory, accept only validated run IDs, skip live/in-flight work and acquire the original instance-ID fence before both-family stop/delete proof and removal. Never opens /run/carlos-runsc. Final R1 P2: keep a cleanup failure keyed to the validated instance ID before releasing its start fence; continue other hosts. No proof or removal check is relaxed; successful fenced stop clears the refusal. file:ReadDir@130 b10eae31d4825bf01a2c11bc4ed6d6d625d2506bdb352ed07059a97a306a71d2
@legacy 289e4e86ceacf4c869115693ea028f091344b330be5a02aecb4a8aac94fc3c08 internal/instancectl/gvisordrain.go sandboxGroupEmpty legacy accepted-legacy accepted-legacy;rev3=census-ruling-gvisor-demos;basis=Read the caller-derived kernel cgroup.events path and require a single populated 0 field; malformed/present nonzero state refuses proof. file:ReadFile@57 4776168285ee07b83941a24023d959616dbe5af6f76491c094f1f12024384ea7
+@legacy 970dace1af1afe0061af511900d05c8fc829c1b636c2c5d6811b222c9a4968c5 internal/instancectl/gvisordrain.go walkSandboxCgroups legacy accepted-legacy accepted-legacy;rev3=census-ruling-gvisor-demos;basis=Consolidate the two existing walks of the fixed cgroup root. ENOENT at any visited path is empty, including a directory deleted after parent enumeration. All other errors and original callbacks propagate unchanged. file:WalkDir@75 e29ef42f1fed7a52865b66214d41918bf836f4a446a00ed219b686af298bded0
@legacy 6d40c9bc5a9d95d37fbcde6ad7537905ebce03da2daf9a56c089c36f022cff91 internal/instancectl/gvisorprobe.go Server.gvisorProbeKernelLimits legacy accepted-legacy accepted-legacy;rev3=census-ruling-gvisor-demos;basis=Read only the fixed probe unit cgroup limit files, requiring the pinned physical memory/tasks and logical CPU/IO contract. Task 9: Round only expected kernel memory.high for fixed probe cgroup reads; exact memory.max retained. No new read. file:ReadFile@408 b9e59399db4166e2c76b29743f1debf4e5eee4e248f08783a9cc38b5195787bd
@legacy 805ba3299be5e00aedcc1bdad6cb8cc70c35355c480019ca24f8f13400465dcf internal/instancectl/gvisorprobe.go Server.runGVisorProbe legacy accepted-legacy accepted-legacy;rev3=census-ruling-gvisor-demos;basis=Task 6 fix round 1, applying the controller rulings: serialized probe construction uses root random nonce/fixed paths, root-only O_EXCL fixture, abstract listener, typed verified bundle/unit and context recheck. Read bounded root-owned nonce-bound output and the guest socket handshake; inspect kernel/proc runtime and limits while guest waits. Termination uses inactive/not-loaded state, no job/PIDs and empty cgroup, never per-command stop-post records. Keep the prior pass during the run and publish report plus runtime identity once, after cleanup; any failed attempt invalidates it and records the bounded diagnostic. A private package-test-only operations struct substitutes paths, executable preparation and output opening; production keeps GVisorProbePaths, fixed output/procfs, ensureExe and execsandbox.OpenRootFile. No new tenant-controlled path, launch/source/database read, or runtime-state read. CI fix: route serialized nonce fixture/output cleanup through existing pinned removeGenFiles owner with closed gVisor selectors and fixed probe paths. Existing reads and stop proof unchanged; no new raw removal owner. file:Lstat@2524,file:OpenFile@1887,file:Read@1577,file:ReadAll@4868 56e6b995e3346e3bc04cf751dc9196f8ddb8e46c1f8885fbca5130ff98720fbd
@legacy 5453c559c4886ff67c038178332bf104aad65ec1475fc16c213c01681d76e29f internal/instancectl/gvisorprobe_linux.go gvisorProbeProcesses legacy accepted-legacy accepted-legacy;rev3=census-ruling-gvisor-demos;basis=Read kernel cgroup.procs under the fixed probe subtree and /proc/<numeric PID> exe, cgroup, cmdline, task directory and children. Require pinned-set executable paths, in-subtree membership, live gofer/Sentry and no descendant outside the unit. PIDs come from kernel/systemd evidence, never a request. file:ReadDir@1895,file:ReadFile@1085,file:ReadFile@1381,file:ReadFile@2022,file:ReadFile@468,file:Readlink@925,file:WalkDir@279 f83c97c76a1584b3ae4ac34d4098902c7b805a970ce6dc5c8378e787c694ab0a
@@ -77,7 +77,7 @@
@legacy 5d9afb4a737882b56f397e19da88961f70bd7a278810cea13944f2d47d72541a internal/instancectl/ocibundle.go gvisorBundlePlan legacy accepted-legacy accepted-legacy;rev3=census-ruling-gvisor-demos;basis=Derive fixed own data/run mount paths from validated host/role/gen; serialize deterministic OCI and shared mount/skeleton layout. Data literal is a mount destination, not a filesystem read. Three platform/app/live binds are explicitly ro. Task 6: Pass the already root-resolved numeric carlos uid/gid alongside the serialized probe nonce in the OCI environment. No added mount, launch parsing, or filesystem read. data-literal@1187 064e8089b8b53b09eed7ebb8d2c050084a7beb091043a8c5667f3266f3cb0977
@legacy 5b7e0982c612178b29e3cbeafb3bdf8f4eeaa560f773345e73df4e7a04406986 internal/instancectl/ocibundle.go gvisorRegularExecutable legacy accepted-legacy accepted-legacy;rev3=census-ruling-gvisor-demos;basis=Fstat resolved app/platform file opened by fixed production OpenRootFile (root-owned, no-follow ancestors, regular single-link file); require regular executable, no content read here. file:Stat@179 9bbfb733f64393dfb54533a8c4ac0f9c1e56b6b23fc0b130f7af9b3680aaed73
@legacy 1c7f28ecd4b8cef8d77feae6c655a4fd8ee46f66480a1709dad41e7e0901df5c internal/instancectl/ocibundle.go readCarlosUser legacy accepted-legacy accepted-legacy;rev3=census-ruling-gvisor-demos;basis=Read fixed /etc/passwd through OpenRootFile, enforcing root owner and no-follow ancestors, bounded to 1 MiB; parse exactly one non-root carlos uid/gid without NSS or tenant input. file:ReadAll@207 83b2b8271c1d3b12e99ea6e0ad1395d0e5db7e823569702314c564ec051390af
-@legacy 4e1e0e30bc8cfd5ed764037291e6cb878a5007fe869f6903931d7ad05b46ae56 internal/instancectl/sandbox.go Server.requestFamily legacy accepted-legacy accepted-legacy;rev3=census-ruling-gvisor-demos;basis=Read the registry route through the existing root-provided HostDemo callback for gVisor public starts and reject held or unsupported routes before preparation. Native registry/egress behavior remains unchanged; fixed policy receives no readiness state. registry:Status@429,whole:Route@318,whole:Route@397,whole:Route@542 dfb40d756f97cc8aa68626b550ad341a9ddd796493de158d3f99ee20c9614fed
+@legacy 964ccc1c4d847434d0613572e4934cd77718bb29e227d830b75ebd07adca50db internal/instancectl/sandbox.go Server.requestFamily legacy accepted-legacy accepted-legacy;rev3=census-ruling-gvisor-demos;basis=Read the registry route through the existing root-provided HostDemo callback for gVisor public starts and reject held or unsupported routes before preparation. Native registry/egress behavior remains unchanged; fixed policy receives no readiness state. Final R1 P2: refuse only the validated instance ID whose retained-file sweep failed. Other hosts keep their existing family/registry admission. No new I/O. registry:Status@546,whole:Route@435,whole:Route@514,whole:Route@659 fe7630a768e94ee0a83468f1f2468fc00c4123b95e4ee1564595259d463b0092
@legacy 43a54aebd894c7b4852e9fbcf3e1dc75d71ceffebe4c51ee7003dffce4d22cb7 internal/instancectl/sandbox.go Server.unitFamily legacy accepted-legacy accepted-legacy;rev3=census-ruling-gvisor-demos;basis=Classify only retained mode, claims/demo flags, role and route runtime/demo shape; gVisor public starts require a route and only private probe/build may omit it. No I/O or readiness-driven fallback. registry:Runtime@630,whole:Route@614,whole:Route@794,whole:Route@852 bed900b96d6b79417c25954e25144ec00c6388a0951ffd405b9788f103851d06
@legacy 5492a4dd126f921302135f7c7a0b7ae6f5b24518ce0f37b745f955d47312d5ea 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. file:ReadFile@853 867b1af5b3f9ded72bd023fd0d7d02a589a131db76046b76156e581738fc90b8
@legacy cec824c9807e579085fc5e14741c1b3fd97bcf58210f8861cd4f9c282d39aa1e internal/instanceexec/probe_gvisor.go checkGVisorFacts legacy accepted-legacy accepted-legacy;rev3=census-ruling-gvisor-demos;basis=Evaluate guest probe facts only. Census labels the boolean Openat2 field as a file read, but this pure evaluator performs no I/O or root action. file:Openat2@845 0fbb701794c0c747fb23628a1e3ed9f791d3024e2001df8040809b8f7544bae1
@@ -149,8 +149,8 @@ internal/instancectl/demo_policy.go Server.demoHandler legacy accepted-legacy ac
internal/instancectl/gen.go Server.handleParent legacy accepted-legacy accepted-legacy;rev3=J2,J4;basis=root-input;rev3=census-ruling-instance-egress-sizes-328-329;basis=#329 plan 3 Task 5: holds the host's slice lock (lockSliceWrites) around its one set-property, so /parent and /size never interleave on one slice. Its one site is still r.URL.Query() of the agent's request (counted as file:Query). The checks in this body are unchanged, though cgroup.ValidParentLimit, which it calls, now accepts one size or the sum of any two from the four-row table (up to 4 GiB, was 2 GiB); no read added.;rev3=census-ruling-agent-start-demo-1;basis=Reads fixed DemoBox and clamps the existing parent memory writer to small.;rev3=census-ruling-gvisor-demos;basis=Validate logical parent input as before, require the demo route in gVisor mode and apply Physical once to the small demo parent. Existing request query read unchanged; shares stay logical. file:Query@78 0646b2e418f426992e35bb05ec9a2c23fa0f916f7af1e4366f3ade14ddc12c69
internal/instancectl/rootfs.go Server.runRootfsProbe legacy accepted-legacy accepted-legacy;rev3=census-ruling-rootfs-apps-2;identity=instance control (/opt/carlos/carlos instance-control, carlos-instance-control.service, root);basis=root-input (J2,J4, as Server.RunProbe): new (rootfs Plan 2 Task 7): builds the probe image once per service start, hashes it (fileSHA256), lays out the _probe rootfs exe layout and its box-addrs, starts carlos-instance-rootfs-probe.service and ReadFiles its report from /run/carlos-control/rootfs-probe.out, which PID 1 writes from the probe's stdout; the probe runs the platform binary from root's own probe image, no tenant code; the report only decides readiness, and without an ok root-image line it is never ready, whatever it says;rev3=census-ruling-agent-start-demo-1;basis=Reads DemoBox and refuses before preparing or launching a rootfs probe; ordinary probe behavior unchanged.;rev3=census-ruling-gvisor-demos;basis=Refuse sandbox configuration or readiness errors before preparing or starting the native rootfs probe. Existing image read unchanged. Task 6: Effective gVisor refuses ROOTFS explicitly before native/rootfs probe preparation; no fallback. Existing native reads unchanged. file:ReadFile@2133 9f191518546c42664f607e5b8dbc85bc273fc7abc29bb12283edad58223b73a3
internal/instancectl/server.go Server.RunProbe legacy accepted-legacy accepted-legacy;rev3=J2,J4;basis=root-input;rev3=census-ruling-rootfs-apps-2;basis=after the resolver allow it applies the box-address deny (denyLocalAddrs: set-property IPAddressDeny on carlos-instances.slice from localPrefixes, which reads /proc/net/fib_trie and /proc/net/if_inet6 as LocalAddrs already did), writes the probe's box-addrs under its own exe layout (writeFileExcl, a decision row), and after the binary probe runs the rootfs probe (runRootfsProbe, a decision row); its own direct read, probe.out, is unchanged;rev3=census-ruling-region-ha-p3b;basis=Take shared root hairpin lease for the entire probe so deny refresh and hairpin mutation cannot race it. Indirect reads validate root boot snapshot, root state/fence and interface inventory; existing probe.out direct read remains and lock/config errors fail readiness.;rev3=census-ruling-gvisor-demos;basis=Select the fixed root-private probe family and delegate gVisor to its serialized root/guest proof, with no native/rootfs fallback. Task 6 fix round 1: remove mode drain from probe execution (Ready/ReadyDemo only), and let runGVisorProbe atomically publish the report/runtime identity including start lines once. Existing native report read unchanged. file:ReadFile@2874 d77aeeac7de9d58663980809014bd4c83060235b63ac4c85cf25bcb89827c80b
-internal/instancectl/server.go runWithClaim authority C,D,G Claim instance controller adds held-release RPC dispatch within existing launch/participation execution boundary.;rev3=census-ruling-rootfs-apps-2;basis=takes a RegistryView (HostApp and HostRuntime) for the bare hostApp, and the production Server literal gains HostRuntime, ProbeImage: BuildProbeImage, ProbeImageFile: ProbeImagePath, RootfsProbeOut under /run/carlos-control and DenyEvery: 10s; this body reads nothing new itself; the readers it wires (instanceRegistryHostRuntime, BuildProbeImage, the rootfs probe's output) are decision rows;rev3=census-ruling-instance-egress-sizes-328-329;basis=#328 plan 2 Task 4 and #329 plan 3 Task 5: takes the egress asserter as a parameter, sets it on the production Server literal (Egress) and starts its 30 s Loop beside probeLoop and diskLoop; the literal also names the fixture check ProbeFixturesOK (renamed in plan 2 Task 14). It sets no control drop-in directory: plan 3's ControlDropInDir default (/run/systemd/system.control) was deleted with removeGenControlDropIn in ef38e13b (the P1 EROFS fix), so instance control names systemd's control directory only to read it (TrustedDropinReader). The same four sites (the two exec.CommandContext closures, statfsBytes, the data literal), offsets moved; no read added.;rev3=census-ruling-agent-start-demo-1;basis=Wires root-owned demo config and existing fixed paths into the service.;rev3=census-ruling-region-ha-p3b;basis=Resume root-owned hairpin state before probes/control service work; verify current systemd agent identity and kernel fence/addresses, restore pidfd watch or revoke stale state. Same direct exec/statfs/data sites; indirect inputs are protected root snapshot/state and kernel evidence, never receipt data.;rev3=census-ruling-agent-start-demo-3;basis=Construct the demo snapshot supervisor for configured demo boxes; startup cleanup gates builder readiness. Census read-site delta: unchanged (4).;rev3=census-ruling-gvisor-demos;basis=Retain sandbox modes and error; bind host-provided baseline and runtime callbacks without importing host templates. Existing reads unchanged. Task 6: Capture HostClaims once from ControlConfig/hostwrite.Enabled and set the fixed root-owned bundle discovery directory. Existing command and configuration reads unchanged. Task 7: enable gVisor worker construction through fixed unitFamily(roleBuild); readiness proof rechecks sandbox admission and current Ready without reaching the constructor fatal path for transient refusals. Existing command/config reads unchanged. data-literal@2476,file:CommandContext@1109,file:CommandContext@1287,file:Statfs@2497 51b727207f3d3b577f428a8d1cdabb214ca7b410de6e813bf1fd916446ef8321
-internal/instancectl/server.go type Server 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. Census ruling 292 reclassified this declaration accepted-legacy (J2,J4) for root's per-host ordering of legacy run starts against stops; this ruling kept the row as main classed it. Its own addition is the cmd start's poll and wait bounds and its per-host lock map: field declarations only;rev3=census-ruling-rootfs-apps-2;basis=new fields: HostRuntime, ProbeImage, ProbeImageFile, RootfsProbeOut, DenyEvery, the deny's lastDeny and denyMu, the rootfs probe's report and lock, the jit reload counters and imageDigests; genStarting counts binary generation starts per unit; rootfsLocksMu and rootfsLocks, one lock entry per rootfs unit name being started or removed right now, held by a start from its layout through systemctl start and its own cleanup and by a removal from its proof through the raw removal, a removal refusing while it is taken, a waiting start giving up when its request ends, an entry dropped with its last holder or waiter (fixes E6, L2, L3); rootfsProvenHook, a test hook run between the proof and the raw removal; field declarations only; no read added;rev3=census-ruling-instance-egress-sizes-328-329;basis=#328 plan 2 and #329 plan 3 Task 5: the declaration gains sliceLocks (one mutex per host slice, taken by /size and /parent) and Egress (the asserter every start path calls), and its comment names the egress allow (plan 3's ControlDropInDir field was deleted in ef38e13b, the P1 EROFS fix); the same one site, the Statfs field, offset moved; no read added.;rev3=census-ruling-rootfs-apps-6;basis=rootfs Plan 6 Task 6: comments only: the one-shot pacing fields cover /cmd and /tty, and cmdLocks is now keyed by (role, host) (oneShotKey, PF-7) so a session's start never waits behind a command's; field declarations unchanged; the same one site, no read added;rev3=census-ruling-agent-start-demo-1;basis=Adds fixed demo configuration, registry views, derived runtime root, synchronization and purge guard.;rev3=census-ruling-region-ha-p3b;basis=Add hairpinActive boolean alongside lastDeny under existing deny synchronization. Field declaration only; existing Statfs selector unchanged, no new read or externally supplied authority.;rev3=census-ruling-region-ha-p3b2-rolls;basis=adds one field holding the current hairpin exit watcher, guarded by the root hairpin flock; no new read;rev3=census-ruling-agent-start-demo-3;basis=Retain the snapshot supervisor in instance-control state; no new request-selected path. Census read-site delta: unchanged (1).;rev3=census-ruling-gvisor-demos;basis=Retain Task 1 mode/error/readiness fields, baseline/runtime callbacks, Task 4 per-host validated staged descriptors and root-selected probe nonce. Fix round 1 adds a private writer-operation seam assigned only in package tests, after the unchanged GVisorID admission check; production defaults still call the same checked constructor, WriteRootfs, WriteBundle and verifier. No new direct read or request-controlled callback. Task 5: private injected removal seam for unprivileged tests; production default removes only root-derived bundle and skeleton after both-family proof inside existing start fence. No new request field or agent-selected unit. Task 6: Retain serialized probe nonce, runtime-set identity verifier/token, fixed claims flag, bundle discovery root, and private unprivileged identity seam. No request-controlled callback or path; existing declaration read-site classification unchanged. Task 6 fix round 1: private gvisorProbeTestOps is set only in package tests; production defaults retain all fixed paths and the checked root output opener. No externally supplied callback or new direct read. file:Statfs@4829 1541a3b0e5f9972f07c1d94b85d1067fa83d1b24099ebf6b65d783716d4a7353
+internal/instancectl/server.go runWithClaim authority C,D,G Claim instance controller adds held-release RPC dispatch within existing launch/participation execution boundary.;rev3=census-ruling-rootfs-apps-2;basis=takes a RegistryView (HostApp and HostRuntime) for the bare hostApp, and the production Server literal gains HostRuntime, ProbeImage: BuildProbeImage, ProbeImageFile: ProbeImagePath, RootfsProbeOut under /run/carlos-control and DenyEvery: 10s; this body reads nothing new itself; the readers it wires (instanceRegistryHostRuntime, BuildProbeImage, the rootfs probe's output) are decision rows;rev3=census-ruling-instance-egress-sizes-328-329;basis=#328 plan 2 Task 4 and #329 plan 3 Task 5: takes the egress asserter as a parameter, sets it on the production Server literal (Egress) and starts its 30 s Loop beside probeLoop and diskLoop; the literal also names the fixture check ProbeFixturesOK (renamed in plan 2 Task 14). It sets no control drop-in directory: plan 3's ControlDropInDir default (/run/systemd/system.control) was deleted with removeGenControlDropIn in ef38e13b (the P1 EROFS fix), so instance control names systemd's control directory only to read it (TrustedDropinReader). The same four sites (the two exec.CommandContext closures, statfsBytes, the data literal), offsets moved; no read added.;rev3=census-ruling-agent-start-demo-1;basis=Wires root-owned demo config and existing fixed paths into the service.;rev3=census-ruling-region-ha-p3b;basis=Resume root-owned hairpin state before probes/control service work; verify current systemd agent identity and kernel fence/addresses, restore pidfd watch or revoke stale state. Same direct exec/statfs/data sites; indirect inputs are protected root snapshot/state and kernel evidence, never receipt data.;rev3=census-ruling-agent-start-demo-3;basis=Construct the demo snapshot supervisor for configured demo boxes; startup cleanup gates builder readiness. Census read-site delta: unchanged (4).;rev3=census-ruling-gvisor-demos;basis=Retain sandbox modes and error; bind host-provided baseline and runtime callbacks without importing host templates. Existing reads unchanged. Task 6: Capture HostClaims once from ControlConfig/hostwrite.Enabled and set the fixed root-owned bundle discovery directory. Existing command and configuration reads unchanged. Task 7: enable gVisor worker construction through fixed unitFamily(roleBuild); readiness proof rechecks sandbox admission and current Ready without reaching the constructor fatal path for transient refusals. Existing command/config reads unchanged. Final R1 P2: wire the fixed /var/lib/carlos/oci-rootfs parent for native readiness evidence; no request-supplied path. data-literal@2527,file:CommandContext@1109,file:CommandContext@1287,file:Statfs@2548 5b41b8778e48880ed81b2deb1619d0977f654664cb1df1ca9021753dda9c2ce1
+internal/instancectl/server.go type Server 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. Census ruling 292 reclassified this declaration accepted-legacy (J2,J4) for root's per-host ordering of legacy run starts against stops; this ruling kept the row as main classed it. Its own addition is the cmd start's poll and wait bounds and its per-host lock map: field declarations only;rev3=census-ruling-rootfs-apps-2;basis=new fields: HostRuntime, ProbeImage, ProbeImageFile, RootfsProbeOut, DenyEvery, the deny's lastDeny and denyMu, the rootfs probe's report and lock, the jit reload counters and imageDigests; genStarting counts binary generation starts per unit; rootfsLocksMu and rootfsLocks, one lock entry per rootfs unit name being started or removed right now, held by a start from its layout through systemctl start and its own cleanup and by a removal from its proof through the raw removal, a removal refusing while it is taken, a waiting start giving up when its request ends, an entry dropped with its last holder or waiter (fixes E6, L2, L3); rootfsProvenHook, a test hook run between the proof and the raw removal; field declarations only; no read added;rev3=census-ruling-instance-egress-sizes-328-329;basis=#328 plan 2 and #329 plan 3 Task 5: the declaration gains sliceLocks (one mutex per host slice, taken by /size and /parent) and Egress (the asserter every start path calls), and its comment names the egress allow (plan 3's ControlDropInDir field was deleted in ef38e13b, the P1 EROFS fix); the same one site, the Statfs field, offset moved; no read added.;rev3=census-ruling-rootfs-apps-6;basis=rootfs Plan 6 Task 6: comments only: the one-shot pacing fields cover /cmd and /tty, and cmdLocks is now keyed by (role, host) (oneShotKey, PF-7) so a session's start never waits behind a command's; field declarations unchanged; the same one site, no read added;rev3=census-ruling-agent-start-demo-1;basis=Adds fixed demo configuration, registry views, derived runtime root, synchronization and purge guard.;rev3=census-ruling-region-ha-p3b;basis=Add hairpinActive boolean alongside lastDeny under existing deny synchronization. Field declaration only; existing Statfs selector unchanged, no new read or externally supplied authority.;rev3=census-ruling-region-ha-p3b2-rolls;basis=adds one field holding the current hairpin exit watcher, guarded by the root hairpin flock; no new read;rev3=census-ruling-agent-start-demo-3;basis=Retain the snapshot supervisor in instance-control state; no new request-selected path. Census read-site delta: unchanged (1).;rev3=census-ruling-gvisor-demos;basis=Retain Task 1 mode/error/readiness fields, baseline/runtime callbacks, Task 4 per-host validated staged descriptors and root-selected probe nonce. Fix round 1 adds a private writer-operation seam assigned only in package tests, after the unchanged GVisorID admission check; production defaults still call the same checked constructor, WriteRootfs, WriteBundle and verifier. No new direct read or request-controlled callback. Task 5: private injected removal seam for unprivileged tests; production default removes only root-derived bundle and skeleton after both-family proof inside existing start fence. No new request field or agent-selected unit. Task 6: Retain serialized probe nonce, runtime-set identity verifier/token, fixed claims flag, bundle discovery root, and private unprivileged identity seam. No request-controlled callback or path; existing declaration read-site classification unchanged. Task 6 fix round 1: private gvisorProbeTestOps is set only in package tests; production defaults retain all fixed paths and the checked root output opener. No externally supplied callback or new direct read. Final R1 P2: retain fixed skeleton parent and concurrent per-instance cleanup refusals; no direct read or external configuration field. file:Statfs@4909 6eb459d77f07ba715fd15078c35a70bad6fd9d10837fedd7ccaa38cd4a6eb720
internal/publicrelease/feed.go Feed.get legacy accepted-legacy accepted-legacy;rev3=J4;basis=root-input;rev3=census-ruling-gvisor-demos;basis=Bound release downloads with a one-byte oversize check so a signed prefix cannot authenticate a truncated larger response; existing HTTP body read only, no new root input. file:ReadAll@518 8da54d4a2ce87c719f1927f1c96d9ea71770fa2475010a220c5029e3086d2752
internal/status/dryrun.go dryRunFixtures legacy accepted-legacy accepted-legacy;rev3=J1;basis=root-route;rev3=census-ruling-gvisor-demos;basis=Task 8: add private sandbox status and row fixtures plus leak needles. Fixture data only; public fleet shape unchanged. whole:Route@5482 8ddd1f1ff4d638b9ec2df0f24fe3f3559fe5a6f2b4d9e347f539aee89d95faf1
status_instances.go printStatusLayout legacy accepted-legacy accepted-legacy;rev3=J4;basis=root-input;rev3=census-ruling-instance-egress-sizes-328-329;basis=#328 plan 2 Task 12 and #329 plan 3 Task 10: carlos status --layout, in the operator's carlos CLI on the operator's own machine, prints SIZE and EGRESS columns from the console's JSON (statusLayoutRow.Size and Egress), joins the egress reason into REASON and prints one note when a size is pending; the same one site (the /data literal in the mixed-box warning), no read added.;rev3=census-ruling-region-labels;basis=a REGION column (statusRegionCell) from the console's answer; no read added;rev3=census-ruling-gvisor-demos;basis=Task 8: print draft SANDBOX column and one exec-sandbox summary per reported box from the existing operator API. Missing/stale reports display unknown; no new file read or authority. data-literal@2413 28d6e05b336a4c99d9e1a3172116a4f6c03ddc7ae3cacd68d0ba0b304b203687
@@ -192,10 +192,10 @@ internal/host/units/carlos-instance-gvisor-probe.service external legacy accepte
internal/host/units/carlos-instance-gvisor@.service external legacy accepted-legacy accepted-legacy;rev3=census-ruling-gvisor-demos;basis=Add the unarmed root gVisor run skeleton with empty ExecStart and all twelve measured host properties. Defines per-instance data/run writable paths and socket output, root runtime directory, mixed kill with SIGCONT, and the existing bounded stop. A root-prepared validated command drop-in is required before it can start; no command or pin placeholder is installed here. file:external@0 914a3c0486d83b6b87ce14c473aab9005ff7bc004cb984040a81ddc60087a5c1
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. file:external@0 215ca2aea9519d14d0e20b5f9b6588b43ff7c5ef7b485982274fbbbfe2cf02b5
internal/instancectl/demo_policy.go Server.demoCgroupReadback legacy accepted-legacy accepted-legacy;rev3=census-ruling-gvisor-demos;basis=Read memory.max/high/swap.max, pids.max, cpu.max/weight and io.weight in the derived parent and validated child cgroups. GVisor uses Physical memory/tasks and logical shares; pre-start only absent groups may defer verification, and post-start requires every file. Native checks remain the existing logical limits. Task 9: Round only expected kernel memory.high for existing run and parent reads; exact memory.max and required kernel files retained. No new read. file:ReadFile@1379,file:Stat@1224 41da87161a8858d3749a461486fff9a6a46b9dccbc421658a4f0643e329e9afd
-internal/instancectl/gvisordrain.go Server.sandboxUnitEmpty legacy accepted-legacy accepted-legacy;rev3=census-ruling-gvisor-demos;basis=Read the fixed carlos.slice cgroup hierarchy for the named discovered unit and require populated 0; skip other service subtrees. Task 6 fix round 1 confines the opposite-family caller to Ready/ReadyDemo. No request-selected filesystem path or new read site. file:WalkDir@116 e802bfb809b344b2ae4e1b3d7ae9f4896b8e3396dac720de56fa218b203e8994
-internal/instancectl/gvisordrain.go Server.sandboxUnitsFor legacy accepted-legacy accepted-legacy;rev3=census-ruling-gvisor-demos;basis=Task 6 fix round 1: enumerate systemd units/jobs and the fixed carlos.slice kernel hierarchy, filtering by the requested fixed family. Ready in systemd mode lists only gVisor instance/probe/build patterns and ignores native jobs/services; original gVisor host overlap checks request both families. Never invoked by native per-start admission. Only kernel-owned cgroup directory reads; no tenant-selected path or runsc-state traversal. file:WalkDir@1194 6ce5d5d373840b13e1bf20a1791cbd1390540448fd238e71b2b8abb4acf05216
-internal/instancectl/gvisordrain.go Server.sweepGVisorBundles legacy accepted-legacy accepted-legacy;rev3=census-ruling-gvisor-demos;basis=List the fixed root-owned OCI directory, accept only validated run IDs, skip live/in-flight work and acquire the original instance-ID fence before both-family stop/delete proof and removal. Never opens /run/carlos-runsc. file:ReadDir@130 0572d9325bd87b5326c195ad30874350114ad25f72d99648731ffe45ea2924a7
+internal/instancectl/gvisordrain.go Server.sandboxFilesPresent legacy accepted-legacy accepted-legacy;rev3=census-ruling-gvisor-demos;basis=Final controller ruling: check only the two fixed root-owned bundle/skeleton parents, listing only their immediate entries (ReadDir opens directories without blocking on a FIFO), without recursion, systemctl or cgroups. Empty or absent parents mean no retained state; loaded-only inactive units are explicitly excluded because files precede start and removal follows termination proof. Other filesystem errors refuse readiness. file:ReadDir@182 8bf90d0c5cd5d8f856a465549fd96db2f763a6137dc64460728422151285503d
+internal/instancectl/gvisordrain.go Server.sweepGVisorBundles legacy accepted-legacy accepted-legacy;rev3=census-ruling-gvisor-demos;basis=List the fixed root-owned OCI directory, accept only validated run IDs, skip live/in-flight work and acquire the original instance-ID fence before both-family stop/delete proof and removal. Never opens /run/carlos-runsc. Final R1 P2: keep a cleanup failure keyed to the validated instance ID before releasing its start fence; continue other hosts. No proof or removal check is relaxed; successful fenced stop clears the refusal. file:ReadDir@130 b10eae31d4825bf01a2c11bc4ed6d6d625d2506bdb352ed07059a97a306a71d2
internal/instancectl/gvisordrain.go sandboxGroupEmpty legacy accepted-legacy accepted-legacy;rev3=census-ruling-gvisor-demos;basis=Read the caller-derived kernel cgroup.events path and require a single populated 0 field; malformed/present nonzero state refuses proof. file:ReadFile@57 4776168285ee07b83941a24023d959616dbe5af6f76491c094f1f12024384ea7
+internal/instancectl/gvisordrain.go walkSandboxCgroups legacy accepted-legacy accepted-legacy;rev3=census-ruling-gvisor-demos;basis=Consolidate the two existing walks of the fixed cgroup root. ENOENT at any visited path is empty, including a directory deleted after parent enumeration. All other errors and original callbacks propagate unchanged. file:WalkDir@75 e29ef42f1fed7a52865b66214d41918bf836f4a446a00ed219b686af298bded0
internal/instancectl/gvisorprobe.go Server.gvisorProbeKernelLimits legacy accepted-legacy accepted-legacy;rev3=census-ruling-gvisor-demos;basis=Read only the fixed probe unit cgroup limit files, requiring the pinned physical memory/tasks and logical CPU/IO contract. Task 9: Round only expected kernel memory.high for fixed probe cgroup reads; exact memory.max retained. No new read. file:ReadFile@408 b9e59399db4166e2c76b29743f1debf4e5eee4e248f08783a9cc38b5195787bd
internal/instancectl/gvisorprobe.go Server.runGVisorProbe legacy accepted-legacy accepted-legacy;rev3=census-ruling-gvisor-demos;basis=Task 6 fix round 1, applying the controller rulings: serialized probe construction uses root random nonce/fixed paths, root-only O_EXCL fixture, abstract listener, typed verified bundle/unit and context recheck. Read bounded root-owned nonce-bound output and the guest socket handshake; inspect kernel/proc runtime and limits while guest waits. Termination uses inactive/not-loaded state, no job/PIDs and empty cgroup, never per-command stop-post records. Keep the prior pass during the run and publish report plus runtime identity once, after cleanup; any failed attempt invalidates it and records the bounded diagnostic. A private package-test-only operations struct substitutes paths, executable preparation and output opening; production keeps GVisorProbePaths, fixed output/procfs, ensureExe and execsandbox.OpenRootFile. No new tenant-controlled path, launch/source/database read, or runtime-state read. CI fix: route serialized nonce fixture/output cleanup through existing pinned removeGenFiles owner with closed gVisor selectors and fixed probe paths. Existing reads and stop proof unchanged; no new raw removal owner. file:Lstat@2524,file:OpenFile@1887,file:Read@1577,file:ReadAll@4868 56e6b995e3346e3bc04cf751dc9196f8ddb8e46c1f8885fbca5130ff98720fbd
internal/instancectl/gvisorprobe_linux.go gvisorProbeProcesses legacy accepted-legacy accepted-legacy;rev3=census-ruling-gvisor-demos;basis=Read kernel cgroup.procs under the fixed probe subtree and /proc/<numeric PID> exe, cgroup, cmdline, task directory and children. Require pinned-set executable paths, in-subtree membership, live gofer/Sentry and no descendant outside the unit. PIDs come from kernel/systemd evidence, never a request. file:ReadDir@1895,file:ReadFile@1085,file:ReadFile@1381,file:ReadFile@2022,file:ReadFile@468,file:Readlink@925,file:WalkDir@279 f83c97c76a1584b3ae4ac34d4098902c7b805a970ce6dc5c8378e787c694ab0a
@@ -205,7 +205,7 @@ internal/instancectl/ocibundle.go Server.gvisorExecutableWith legacy accepted-le
internal/instancectl/ocibundle.go gvisorBundlePlan legacy accepted-legacy accepted-legacy;rev3=census-ruling-gvisor-demos;basis=Derive fixed own data/run mount paths from validated host/role/gen; serialize deterministic OCI and shared mount/skeleton layout. Data literal is a mount destination, not a filesystem read. Three platform/app/live binds are explicitly ro. Task 6: Pass the already root-resolved numeric carlos uid/gid alongside the serialized probe nonce in the OCI environment. No added mount, launch parsing, or filesystem read. data-literal@1187 064e8089b8b53b09eed7ebb8d2c050084a7beb091043a8c5667f3266f3cb0977
internal/instancectl/ocibundle.go gvisorRegularExecutable legacy accepted-legacy accepted-legacy;rev3=census-ruling-gvisor-demos;basis=Fstat resolved app/platform file opened by fixed production OpenRootFile (root-owned, no-follow ancestors, regular single-link file); require regular executable, no content read here. file:Stat@179 9bbfb733f64393dfb54533a8c4ac0f9c1e56b6b23fc0b130f7af9b3680aaed73
internal/instancectl/ocibundle.go readCarlosUser legacy accepted-legacy accepted-legacy;rev3=census-ruling-gvisor-demos;basis=Read fixed /etc/passwd through OpenRootFile, enforcing root owner and no-follow ancestors, bounded to 1 MiB; parse exactly one non-root carlos uid/gid without NSS or tenant input. file:ReadAll@207 83b2b8271c1d3b12e99ea6e0ad1395d0e5db7e823569702314c564ec051390af
-internal/instancectl/sandbox.go Server.requestFamily legacy accepted-legacy accepted-legacy;rev3=census-ruling-gvisor-demos;basis=Read the registry route through the existing root-provided HostDemo callback for gVisor public starts and reject held or unsupported routes before preparation. Native registry/egress behavior remains unchanged; fixed policy receives no readiness state. registry:Status@429,whole:Route@318,whole:Route@397,whole:Route@542 dfb40d756f97cc8aa68626b550ad341a9ddd796493de158d3f99ee20c9614fed
+internal/instancectl/sandbox.go Server.requestFamily legacy accepted-legacy accepted-legacy;rev3=census-ruling-gvisor-demos;basis=Read the registry route through the existing root-provided HostDemo callback for gVisor public starts and reject held or unsupported routes before preparation. Native registry/egress behavior remains unchanged; fixed policy receives no readiness state. Final R1 P2: refuse only the validated instance ID whose retained-file sweep failed. Other hosts keep their existing family/registry admission. No new I/O. registry:Status@546,whole:Route@435,whole:Route@514,whole:Route@659 fe7630a768e94ee0a83468f1f2468fc00c4123b95e4ee1564595259d463b0092
internal/instancectl/sandbox.go Server.unitFamily legacy accepted-legacy accepted-legacy;rev3=census-ruling-gvisor-demos;basis=Classify only retained mode, claims/demo flags, role and route runtime/demo shape; gVisor public starts require a route and only private probe/build may omit it. No I/O or readiness-driven fallback. registry:Runtime@630,whole:Route@614,whole:Route@794,whole:Route@852 bed900b96d6b79417c25954e25144ec00c6388a0951ffd405b9788f103851d06
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. file:ReadFile@853 867b1af5b3f9ded72bd023fd0d7d02a589a131db76046b76156e581738fc90b8
internal/instanceexec/probe_gvisor.go checkGVisorFacts legacy accepted-legacy accepted-legacy;rev3=census-ruling-gvisor-demos;basis=Evaluate guest probe facts only. Census labels the boolean Openat2 field as a file read, but this pure evaluator performs no I/O or root action. file:Openat2@845 0fbb701794c0c747fb23628a1e3ed9f791d3024e2001df8040809b8f7544bae1
@@ -250,13 +250,13 @@ internal/activator/unitproc.go ExecBackend.observe legacy accepted-legacy accept
internal/host/systemapply.go systemApplier.stageCandidate legacy accepted-legacy accepted-legacy;rev3=J4;basis=root-input;rev3=census-ruling-region-ha-p3b;basis=Require groupStageDigest before staging/candidate execution; action and new digest come from root-owned operator permit bound to boot marker. Existing signed pointer/artifact verification and two direct read sites remain.;rev3=census-ruling-gvisor-demos;basis=Pass the already-open regular file fstat size to bounded preflight. Allocate payload once at exactly that size, use ReadFull then confirm EOF; hash and scan those same bytes before staging. Root-owned staged target is still checked before execution. Preserve staging on floor refusal for apply/install-channel. file:Stat@694 ea8c519d19786af346500c289fc768bd7047639d90154af6ec6ecefdfb41d57f
@remove internal/instancectl/demo_policy.go Server.demoCgroup
@removed internal/instancectl/demo_policy.go Server.demoCgroup H3 census-ruling-gvisor-demos;basis=Delegate the existing readback to demoCgroupReadback; wrapper has no direct read and retains its callers.
-@coverage . e81de2dad7f3ecf8f6adbb426b8f6e8f732b7dff5b7e909a273f0e40194307b5
-@coverage internal/activator d326609be0b7846d7bcbb4b20856ef9d3a9ffdf70bfb091e3ac7566fa78613de
+@coverage . 5b175426bd461d91b7d9220d2595abd07c1ac13c3299ea0317439267aa83e648
+@coverage internal/activator 0fd4583c21e9d045a044e1e848de40dc01c58734c7f127463cf0bb730202f453
@coverage internal/demobuild 60f5e9d6c2acb85d8943d848f013349157bf985bba71e69e99d4ed6e831c1dd7
@coverage internal/execsandbox 8f4069cb40c57bc0f01a934f44c49c9fdb549879c509b374d97474b859538569
-@coverage internal/host f7ecb38917955e3e89c323b3f8d730271d9df28a0967459151552b0471e59149
+@coverage internal/host 796f22458033815166ae66d2d2432e6478d3dabeb197237414fa47a671437284
@coverage internal/host/units 93402572d2fc9c32b563820a36d565afa2ed951637bde9561fe2e845137a6524
-@coverage internal/instancectl 1a3a46e781273b5487fdf5291f9b2d2329c89db8363ac0558561497b229d6b6b
+@coverage internal/instancectl 7d894962764bc41cef03cbdc274ccb4763c48697cb0c845ba0d49607d3ec4eaa
@coverage internal/instanceexec 8ab54471e06294387badbe91bf51e0e4a2e0ccde6a5dee51b75cfe817dcac5ae
@coverage internal/publicrelease 4b98543d38d648c60009592dac6c1e8a012ecca42e52d95d12404c0f9506457c
@coverage internal/status 549f4bf5833dd6d85709bf86f84766736c1a0b531cf5cabdaf6ca26924c67ea8
diff --git a/region_labels_e2e_test.go b/region_labels_e2e_test.go
index 0adc5c5fd..1e1e3c511 100644
--- a/region_labels_e2e_test.go
+++ b/region_labels_e2e_test.go
@@ -196,7 +196,7 @@ func TestRegionLabelsStatusThroughTheConsole(t *testing.T) {
if err := statusLayout(&out, ""); err != nil {
t.Fatal(err)
}
- if !strings.Contains(out.String(), "BOX REGION HOST LAYOUT SANDBOX SIZE EGRESS REASON") || !strings.Contains(out.String(), labelsUKBox+" London (UK) "+host) {
+ if !strings.Contains(out.String(), "BOX REGION HOST LAYOUT INSTANCE-SANDBOX SIZE EGRESS REASON") || !strings.Contains(out.String(), labelsUKBox+" London (UK) "+host) {
t.Fatalf("status --layout:\n%s", out.String())
}
}
diff --git a/status_instances.go b/status_instances.go
index 57b8dcea2..366c15748 100644
--- a/status_instances.go
+++ b/status_instances.go
@@ -178,10 +178,10 @@ type statusLayoutRow struct {
}
// Copy for `carlos status --layout`. The pending-size text is approved
-// (plan 3 IP3-04 and IP3-09); the sandbox addition is draft.
+// (plan 3 IP3-04 and IP3-09); the sandbox copy follows the delegated Luna review.
const (
- // DRAFT: Paul reviews the SANDBOX heading before merge.
- statusLayoutHeading = "BOX REGION HOST LAYOUT SANDBOX SIZE EGRESS REASON"
+ // Instance sandbox heading approved by the delegated Luna review.
+ statusLayoutHeading = "BOX REGION HOST LAYOUT INSTANCE-SANDBOX SIZE EGRESS REASON"
statusLayoutSizePending = "A size after > is the wanted size. A larger size takes effect at the instance's next start or deploy; a smaller size waits for a cold start. Restart the instance to apply the new memory size now."
)
@@ -358,10 +358,10 @@ type statusRunsc struct {
SHA256 string `json:"sha256"`
}
-// DRAFT: new status wording awaits Paul's copy review before merge.
+// Empty instance observations follow the existing missing-value convention.
func sandboxWord(value string) string {
if value == "" {
- return "unknown"
+ return "-"
}
return value
}
diff --git a/status_instances_test.go b/status_instances_test.go
index 1b116222c..5a0e9a254 100644
--- a/status_instances_test.go
+++ b/status_instances_test.go
@@ -78,7 +78,7 @@ func TestPrintStatusLayoutRendersSortedAndMarksStale(t *testing.T) {
out := buf.String()
// REGION joined the heading with the region labels (RL-C1).
- if !strings.Contains(out, "BOX REGION HOST LAYOUT SANDBOX SIZE EGRESS REASON") {
+ if !strings.Contains(out, "BOX REGION HOST LAYOUT INSTANCE-SANDBOX SIZE EGRESS REASON") {
t.Fatalf("missing the approved heading:\n%s", out)
}
if !strings.Contains(out, "alpha (stale)") {
@@ -188,11 +188,11 @@ func TestStatusLayoutShowsEgress(t *testing.T) {
printStatusLayout(&buf, boxes)
out := buf.String()
for _, want := range []string{
- "BOX REGION HOST LAYOUT SANDBOX SIZE EGRESS REASON\n",
- "ie-1 - shop-a.example.com nested unknown - !10.0.5.20,fd00:5::20 -\n",
- "ie-1 - shop-b.example.com foreign unknown - 10.0.5.20 !refused db and socket are neither default; egress: 10.0.5.1: an address of this box\n",
- "ie-1 - shop-c.example.com nested unknown - - !box not wholly nested egress: flat row shop-d.example.com\n",
- "ie-1 - shop-d.example.com flat unknown - - -\n",
+ "BOX REGION HOST LAYOUT INSTANCE-SANDBOX SIZE EGRESS REASON\n",
+ "ie-1 - shop-a.example.com nested - - !10.0.5.20,fd00:5::20 -\n",
+ "ie-1 - shop-b.example.com foreign - - 10.0.5.20 !refused db and socket are neither default; egress: 10.0.5.1: an address of this box\n",
+ "ie-1 - shop-c.example.com nested - - - !box not wholly nested egress: flat row shop-d.example.com\n",
+ "ie-1 - shop-d.example.com flat - - - -\n",
} {
if !strings.Contains(out, want) {
t.Errorf("missing %q in:\n%s", want, out)
@@ -270,15 +270,15 @@ func TestStatusLayoutShowsSize(t *testing.T) {
var buf bytes.Buffer
printStatusLayout(&buf, boxes)
out := buf.String()
- if !strings.HasPrefix(out, "BOX REGION HOST LAYOUT SANDBOX SIZE EGRESS REASON\n") {
+ if !strings.HasPrefix(out, "BOX REGION HOST LAYOUT INSTANCE-SANDBOX SIZE EGRESS REASON\n") {
t.Fatalf("heading is not the draft, byte for byte:\n%s", out)
}
for _, want := range []string{
- "ie-1 - shop-a.example.com nested unknown large - ",
- "ie-1 - shop-b.example.com nested unknown large>small - ",
- "ie-1 - shop-c.example.com nested unknown swap - ",
- "ie-1 - shop-d.example.com flat unknown - - ",
- "ie-2 - shop-e.example.com nested unknown standard>xlarge - ",
+ "ie-1 - shop-a.example.com nested - large - ",
+ "ie-1 - shop-b.example.com nested - large>small - ",
+ "ie-1 - shop-c.example.com nested - swap - ",
+ "ie-1 - shop-d.example.com flat - - - ",
+ "ie-2 - shop-e.example.com nested - standard>xlarge - ",
} {
if !strings.Contains(out, want) {
t.Errorf("missing %q in:\n%s", want, out)
@@ -309,7 +309,7 @@ func TestStatusLayoutSandbox(t *testing.T) {
}
var out bytes.Buffer
printStatusLayout(&out, boxes)
- for _, want := range []string{"LAYOUT SANDBOX SIZE", "nested gvisor small", "nested unknown", "fresh exec-sandbox: configured=auto effective=gvisor ready=false runsc=release-20261102.0 sha256=pin blocked=probe-blocked", "old exec-sandbox: unknown", "stale exec-sandbox: unknown (stale report)"} {
+ for _, want := range []string{"LAYOUT INSTANCE-SANDBOX SIZE", "nested gvisor small", "nested -", "fresh exec-sandbox: configured=auto effective=gvisor ready=false runsc=release-20261102.0 sha256=pin blocked=probe-blocked", "old exec-sandbox: unknown", "stale exec-sandbox: unknown (stale report)"} {
if !strings.Contains(out.String(), want) {
t.Errorf("missing %q:\n%s", want, &out)
}