carlos / platform Public

probe: enforce pts-private only under a probe unit that advertises it (rootfs plan 6)

Task 5 fix round 1 (Astra P2). A roll replaces /opt/carlos/carlos before
it installs the units, so the new binary probe can run under the old
probe unit, whose namespace still shows the host's /dev/pts, and drop
NestedOK until the units land.

carlos-instance-probe.service sets Environment=CARLOS_PROBE_PTS_PRIVATE=1
outside the shared namespace block (instancectl.ProbePtsPrivateEnv).
productionProbeEnv reads it; the binary probe checks pts-private only
when it is exactly "1", and otherwise reports the line "unverified",
which never blocks readiness. The rootfs probe always checks.

Census overlay rootfs-apps-6 re-proposed (probe unit and
productionProbeEnv claims updated).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Paul Campbell pushed by claude agent, operated by paul@keymail.dev d5986010319586db811397d66cae69f1a92e18ba parent 24d2bb2
8 files changed, +142 −17
  • docs/superpowers/notes/census-proposal-rootfs-apps-6.md +3 −3
  • internal/host/units/carlos-instance-probe.service +5 −0
  • internal/host/units_isolation_test.go +30 −0
  • internal/instancectl/names.go +8 −0
  • internal/instanceexec/probe.go +19 −5
  • internal/instanceexec/probe_test.go +69 −1
  • internal/provision/testdata/plan14-root-reads-chain.tsv +1 −1
  • internal/provision/testdata/plan14-root-reads-rootfs-apps-6.tsv +7 −7

Intent

Human

<task-notification> <task-id>a34ee56d494f61538</task-id> <tool-use-id>toolu_012uDkDtq5cKZxGE6Y4ZW57F</tool-use-id> <output-file>/home/paulca/.cache/tmp/claude-1001/-home-paulca-amadan-net-carlos-platform/ba9fa944-a429-4788-9b3c-f2b2f42617f3/tasks/a34ee56d494f61538.output</output-file> <status>completed</status> <summary>Agent "Plan 6 Task 5: tty role, templates" finished</summary> <note>A task-notification fires each time this agent stops with no live background children of its own. The user can send it another message and resume it, so the same task-id may notify more than once.</note> <result>**Status:** DONE_WITH_CONCERNS **Commit:** 24d2bb23 (base 91271850). It is not pushed. git printed the expected packed-refs.lock error, but the commit is in the log. **Tests:** The brief's Step 2 tests failed before the code (RED) and pass now (GREEN). The full instancectl, instanceexec and layout packages pass. A broad set of host unit/template tests and the provision census tests pass. Build, vet, gofmt and the darwin/windows/linux-arm64 cross-builds are clean. All 14 mutations were caught. **What was built:** - **Names:** `RoleTTY` is the sixth role `ParseRole` accepts, with the two tty unit prefixes, `TTYExeApp`/`TTYExeLive`, `TTYHello` and `OneShot`. The binary and rootfs unit-name functions all know the tty units. - **Templates:** both are new. Each is held to its cmd counterpart by a test that compares every line outside the named swaps. The rootfs one uses `instance-exit --rootfs tty %I` and `rootfs/tty/` paths. - **`/dev/pts`:** `TemporaryFileSystem=/dev/pts:ro` is now in the namespace block of every binary template. The block is still byte-identical across all seven, including the new tty one. - **Probe:** the binary probe has a `pts-private` line, and its production env now sets `devPts` and `openPtmx` (PF-8). The rootfs probe's env inherits them. - **Layout:** `launch.tty.json` is one more fixed name in `NestedPlatformNames`. **Census:** I re-proposed the branch's `rootfs-apps-6` overlay: 8 changed units, 2 of them new, new seal `5491ec58…`. It still needs Astra's approval on #280; I did not request it. **Concerns:** 1. **Roll order:** the binary probe now fails `pts-private` on any box whose installed probe unit lacks the `/dev/pts:ro` line. If the new binary's probe runs before the new units are installed, the box loses nested readiness. For Task 15: dev first, and watch nested readiness. 2. **`instance-exec tty` / `instance-exit tty` already parse:** because `ParseRole` accepts `tty`, both now accept it on the binary path, before Task 7 handles `tty` properly. Nothing starts a tty unit until Task 6. Their error messages still list five roles; that copy belongs to Task 7. 3. **I didn't add the rootfs tty template to `TestInstanceTemplatesShareOneNamespace`,** although the brief says to add both. That test looks for the binary block's marker, which the rootfs block doesn't have. `rootfsTemplates` covers it instead. 4. **Stale comment left in place:** the rootfs block still says "the five rootfs units"; there are now six. Fixing it would touch the rootfs block, which the brief says not to edit. 5. **Session timeout:** the tty templates keep the cmd's `TimeoutStartSec=6h5m`, since the brief allows only the named swaps. The full report (RED/GREEN, the mutation table, callers, departures, census card) is in `/home/paulca/amadan.net/carlos/platform/.claude/worktrees/rootfs-apps-6/.superpowers/sdd/2026-10-24-rootfs-apps-6-interactive/task-5-report.md`. New unit files are in `/home/paulca/amadan.net/carlos/platform/.claude/worktrees/rootfs-apps-6/internal/host/units/`: - `carlos-instance-tty@.service` - `carlos-instance-rootfs-tty@.service`</result> <usage><subagent_tokens>204687</subagent_tokens><tool_uses>73</tool_uses><duration_ms>1023803</duration_ms></usage> </task-notification>

Human

<task-notification> <task-id>buegipyui</task-id> <tool-use-id>toolu_01TCs4cqrVnFSwk4psYLRpvy</tool-use-id> <output-file>/home/paulca/.cache/tmp/claude-1001/-home-paulca-amadan-net-carlos-platform/ba9fa944-a429-4788-9b3c-f2b2f42617f3/tasks/buegipyui.output</output-file> <status>completed</status> <summary>Background command "Package Plan 6 Task 5 and run its Astra review" completed (exit code 0)</summary> </task-notification>

Human

<task-notification> <task-id>afebcf3315033b41a</task-id> <tool-use-id>toolu_01WSRSaYW74Ua6SR7uXjjjzT</tool-use-id> <output-file>/home/paulca/.cache/tmp/claude-1001/-home-paulca-amadan-net-carlos-platform/ba9fa944-a429-4788-9b3c-f2b2f42617f3/tasks/afebcf3315033b41a.output</output-file> <status>completed</status> <summary>Agent "#471 Task 4: reload mutex, sweep" finished</summary> <note>A task-notification fires each time this agent stops with no live background children of its own. The user can send it another message and resume it, so the same task-id may notify more than once.</note> <result>**Status: DONE_WITH_CONCERNS.** The concerns are notes; none blocks the task. **Commit:** `f7754746` "edge: one reload mutex, and the sweep of open upgrades (#471 Task 4)", on top of `e5d2d14b`. Not pushed. **Tests:** all seven new tests pass, ten times over under `-race`. RED came first: with the lock and the sweep taken out, every new test failed except `TestReservationRacesTheSwap/refused at reservation`, which Task 3's check already covers. The existing `TestWatch*` and `TestReload*` tests pass under `-race`, and so do the 547 tests in the edge files that call Reload, the host layout tests that drive `layoutReload`, the layout and fleetapi packages, and the root `TestFleetAppServesThroughTheHub`. Build, vet, gofmt and the darwin, windows and linux/arm64 cross-builds are clean. **Mutations:** I ran ten. Removing the lock fails all three two-Reload sub-tests at the first `TryLock` with "TryLock succeeded while A holds the reload". Moving the `Store` into a helper makes the guard name it: `(*Edge).publish`. **Reload callers:** every production caller (`New`, `Watch`, SIGHUP, `EnableStatic`, `enableTunnelsFromEnv`, `layoutReload` in `agent.go:1038`) calls `Reload` itself, so each takes the lock. No test calls `Reload` while holding a lock that `Reload` takes. **Census:** the card shows no new unit; spec §7 gains a Task 4 paragraph saying so. **Concerns:** 1. I used `fwdOther` ("baj") for the owner change instead of the brief's `k3x`, following the Task 3 ruling. 2. The OnReload hooks (wildcard refresh, cert warm nudge) now run under `reloadMu`. They already ran inside Reload, so a single Reload takes no longer, but a second Reload now waits for them. The wildcard manager's `refreshMu` now nests inside `reloadMu`; nothing that holds it waits for `reloadMu`, so there is no cycle. 3. `beforePublish` runs after `SetDynamicAuth` and the prober sync, so an error there (tests only) leaves those applied but the map not swapped. Only `afterRead` means "nothing applied yet". 4. Spec case 19 says Reload's first statement takes the lock. As the brief allows, the enter-hook guard comes first, and the guard test pins exactly those two statements. 5. I added one test beyond the brief, `TestSweepReleasesOffTheReload`: Reload returns while a swept stream's close is blocked. 6. The sweep test seam `afterInsert` is my name; the brief named only `beforeReserve`. The full report (RED/GREEN output, mutation table, caller list, census card) is at `/home/paulca/amadan.net/carlos/platform/.claude/worktrees/design-tunnel-websockets-471/.superpowers/sdd/2026-10-30-tunnel-websockets/task-4-report.md`.</result> <usage><subagent_tokens>214098</subagent_tokens><tool_uses>88</tool_uses><duration_ms>1524169</duration_ms></usage> </task-notification>

Human

<task-notification> <task-id>bxma48gle</task-id> <tool-use-id>toolu_015Q9bg4zqoFtJdemBdfNy46</tool-use-id> <output-file>/home/paulca/.cache/tmp/claude-1001/-home-paulca-amadan-net-carlos-platform/ba9fa944-a429-4788-9b3c-f2b2f42617f3/tasks/bxma48gle.output</output-file> <status>completed</status> <summary>Background command "Package #471 Task 4 and run its Astra review" completed (exit code 0)</summary> </task-notification>

Attributed to this commit: 36.7 g CO₂e (4,826,384 tokens). This is an attribution, not a measurement — usage counted from this commit's own marker forward to the next one on rootfs-apps-6-interactive, never backward from it. A turn that produced more than one commit books all of its tokens to the last one, and a concurrent session on this branch can add to the same figure. Some of it was priced using the shared default rate, because no model-specific factor row exists yet for at least one model involved. The Carbon view has the repo total, which is never derived from this attribution.

diff --git a/docs/superpowers/notes/census-proposal-rootfs-apps-6.md b/docs/superpowers/notes/census-proposal-rootfs-apps-6.md
index dfc73f51f..40769356e 100644
--- a/docs/superpowers/notes/census-proposal-rootfs-apps-6.md
+++ b/docs/superpowers/notes/census-proposal-rootfs-apps-6.md
@@ -6,11 +6,11 @@ Ruling `census-ruling-rootfs-apps-6`. The independent reviewer approves or rejec
|---|---|---|---|
| `internal/host/units/carlos-instance-cmd@.service` `external` | body | unchanged (1) | rootfs Plan 6 Task 5: the same one namespace-block line, TemporaryFileSystem=/dev/pts:ro, as carlos-instance@.service; nothing else |
| `internal/host/units/carlos-instance-gen@.service` `external` | body | unchanged (1) | rootfs Plan 6 Task 5: the same one namespace-block line, TemporaryFileSystem=/dev/pts:ro, as carlos-instance@.service; nothing else |
-| `internal/host/units/carlos-instance-probe.service` `external` | body | unchanged (1) | rootfs Plan 6 Task 5: the same one namespace-block line, TemporaryFileSystem=/dev/pts:ro, as carlos-instance@.service, so the probe proves what the tenants get (its new pts-private line); nothing else |
+| `internal/host/units/carlos-instance-probe.service` `external` | body | unchanged (1) | rootfs Plan 6 Task 5: the same one namespace-block line, TemporaryFileSystem=/dev/pts:ro, as carlos-instance@.service, so the probe proves what the tenants get (its new pts-private line); fix round 1 (Astra P2, roll order): one line outside the namespace block, Environment=CARLOS_PROBE_PTS_PRIVATE=1, a constant the unit sets for its own process (the probe, as carlos, in the namespace); it names no path, adds no bind source or Exec line, and root reads nothing new |
| `internal/host/units/carlos-instance-seed@.service` `external` | body | unchanged (1) | rootfs Plan 6 Task 5: the same one namespace-block line, TemporaryFileSystem=/dev/pts:ro, as carlos-instance@.service; nothing else |
| `internal/host/units/carlos-instance-sidecar@.service` `external` | body | unchanged (1) | rootfs Plan 6 Task 5: the same one namespace-block line, TemporaryFileSystem=/dev/pts:ro, as carlos-instance@.service; nothing else |
| `internal/host/units/carlos-instance@.service` `external` | body | unchanged (1) | rootfs Plan 6 Task 5: one namespace-block line added after TemporaryFileSystem=/dev/mqueue:ro, TemporaryFileSystem=/dev/pts:ro (with its comment): PID 1 mounts an empty read-only tmpfs over the private /dev/pts, hiding the host devpts PrivateDevices= binds in; no bind source, Exec line, user or path read by root added; the block stays byte-identical across the binary templates (TestInstanceTemplatesShareOneNamespace) |
-| `internal/instanceexec/probe.go` `productionProbeEnv` | body | unchanged (1) | rootfs Plan 6 Task 5 (PF-8): the binary probe env sets devPts=/dev/pts and openPtmx (open /dev/ptmx O_RDWR|O_NOCTTY and close at once), the fields the rootfs probe env already set; read by the new pts-private line inside the probe unit (as carlos, in the namespace); the same direct site, no new root read |
+| `internal/instanceexec/probe.go` `productionProbeEnv` | body | unchanged (1) | rootfs Plan 6 Task 5 (PF-8): the binary probe env sets devPts=/dev/pts and openPtmx (open /dev/ptmx O_RDWR|O_NOCTTY and close at once), the fields the rootfs probe env already set; read by the new pts-private line inside the probe unit (as carlos, in the namespace); fix round 1: also reads its own environment, CARLOS_PROBE_PTS_PRIVATE (exactly "1" enforces pts-private; otherwise the line is reported unverified), which the probe unit sets; the same direct site, no new root read |
| `internal/layout/plan.go` `NestedPlatformNames` | body | unchanged (1) | rootfs Plan 6 Task 5: the fixed role list gains RoleTTY, so launch.tty.json is one more fixed platform name; still reads nothing |
| `internal/provision/reconcile.go` `Reconcile` | body | unchanged (178) | rootfs Plan 6 Task 3: in the per-record loop, beside the RunSeen call, calls cfg.InteractiveSeen(rec) when the hook is set and the in-scope record carries an interactive-session marker (rec.Interactive != nil), once per record per pass, before the pass acts on it; the hook is the box worker's non-blocking note (Task 12). Same record keys and literal; no read added (registry read sites unchanged, 178); nothing written by the call |
@@ -35,6 +35,6 @@ New dispositions, which census-propose wrote and the reviewer checks against the
- new `internal/host/units/carlos-instance-rootfs-tty@.service:external`: reads +file:external; written legacy, accepted-legacy, frozen
- new `internal/host/units/carlos-instance-tty@.service:external`: reads +file:external; written legacy, accepted-legacy, frozen
-Seal: `1379d066c8dd2335d95d5f6e9c7bce65ff57f00b2b287a308d9b3f47911ae5e7` → `5491ec585a12b07e249fe1e680cadc7463c985f63fefcea1330c03dbf38f82ed`.
+Seal: `1379d066c8dd2335d95d5f6e9c7bce65ff57f00b2b287a308d9b3f47911ae5e7` → `83f9adb63fe0eae7ad2cd5175000678f05f6a5c646828e05e663b0a03d67f106`.
Overlay: `internal/provision/testdata/plan14-root-reads-rootfs-apps-6.tsv`, appended to `internal/provision/testdata/plan14-root-reads-chain.tsv`.
diff --git a/internal/host/units/carlos-instance-probe.service b/internal/host/units/carlos-instance-probe.service
index 838a4ad16..540dad33e 100644
--- a/internal/host/units/carlos-instance-probe.service
+++ b/internal/host/units/carlos-instance-probe.service
@@ -34,6 +34,11 @@ BindReadOnlyPaths=/run/carlos-control/exe/_probe/app:/opt/carlos/app /run/carlos
# sources above. No instance template binds it; an instance has no
# business knowing them.
BindReadOnlyPaths=/run/carlos-control/exe/_probe/box-addrs:/opt/carlos/box-addrs
+# This unit's namespace block hides /dev/pts (TemporaryFileSystem=/dev/pts:ro),
+# and says so: a roll replaces the binary before it installs the units, so
+# a new probe can run under an old probe unit, and it enforces its
+# pts-private line only when this is set (instancectl.ProbePtsPrivateEnv).
+Environment=CARLOS_PROBE_PTS_PRIVATE=1
# --- the namespace (titogo@.service, 2026-07-31 design, on systemd 257) ---
ProtectSystem=strict
diff --git a/internal/host/units_isolation_test.go b/internal/host/units_isolation_test.go
index b81ba72fa..867706119 100644
--- a/internal/host/units_isolation_test.go
+++ b/internal/host/units_isolation_test.go
@@ -5,6 +5,8 @@ import (
"path/filepath"
"strings"
"testing"
+
+ "github.com/carlosframework/platform/internal/instancectl"
)
func readUnit(t *testing.T, name string) string {
@@ -482,6 +484,34 @@ func TestCmdTemplateEqualsSeedOutsideTheNamedLines(t *testing.T) {
}
}
+// The binary probe unit advertises that its namespace hides /dev/pts
+// (Task 5 fix round 1): a roll replaces the binary before it installs the
+// units, so the new probe enforces pts-private only under a unit that
+// says it carries the line. The advertisement sits outside the shared
+// block (which stays byte-identical with the tenants'), exactly once, and
+// only in the binary probe: no tenant template and not the rootfs probe,
+// whose check is unconditional.
+func TestOnlyTheBinaryProbeAdvertisesPtsPrivate(t *testing.T) {
+ want := "Environment=" + instancectl.ProbePtsPrivateEnv + "=1"
+ u := readUnit(t, "carlos-instance-probe.service")
+ if n := strings.Count("\n"+u, "\n"+want+"\n"); n != 1 {
+ t.Errorf("carlos-instance-probe.service carries %q %d times, want 1", want, n)
+ }
+ start, end := strings.Index(u, "# --- the namespace"), strings.Index(u, "# --- per-service resources")
+ if i := strings.Index(u, want); start < 0 || end < 0 || (i > start && i < end) {
+ t.Errorf("the advertisement is inside the shared namespace block")
+ }
+ if !hasDirective(u, "TemporaryFileSystem=/dev/pts:ro") {
+ t.Error("the probe advertises /dev/pts:ro and lacks it")
+ }
+ for _, name := range []string{"carlos-instance@.service", "carlos-instance-gen@.service", "carlos-instance-seed@.service", "carlos-instance-sidecar@.service", "carlos-instance-cmd@.service", "carlos-instance-tty@.service",
+ "carlos-instance-rootfs@.service", "carlos-instance-rootfs-gen@.service", "carlos-instance-rootfs-worker@.service", "carlos-instance-rootfs-cmd@.service", "carlos-instance-rootfs-tty@.service", "carlos-instance-rootfs-probe.service"} {
+ if strings.Contains(readUnit(t, name), instancectl.ProbePtsPrivateEnv) {
+ t.Errorf("%s carries %s; only the binary probe advertises it", name, instancectl.ProbePtsPrivateEnv)
+ }
+ }
+}
+
// unitDirectives is a unit's directives in order: comments and blank lines
// dropped, each line trimmed.
func unitDirectives(t *testing.T, name string) []string {
diff --git a/internal/instancectl/names.go b/internal/instancectl/names.go
index d107b17ed..5ca31391b 100644
--- a/internal/instancectl/names.go
+++ b/internal/instancectl/names.go
@@ -563,6 +563,14 @@ const (
ProbeBoxAddrsName = "box-addrs"
)
+// ProbePtsPrivateEnv is the binary probe unit's advertisement that its
+// namespace hides /dev/pts: Environment=CARLOS_PROBE_PTS_PRIVATE=1 in
+// carlos-instance-probe.service, outside the shared block. A roll replaces
+// the binary before it installs the units, so a new probe can run under an
+// old probe unit; it enforces pts-private only when its unit says "1"
+// (rootfs Plan 6, Task 5 fix round 1). The rootfs probe always enforces.
+const ProbePtsPrivateEnv = "CARLOS_PROBE_PTS_PRIVATE"
+
// RootfsProbeMarker is the file at the root of the probe image
// (BuildProbeImage): the rootfs probe's root-image line finds it there
// when its root is that image and not the host's or another's.
diff --git a/internal/instanceexec/probe.go b/internal/instanceexec/probe.go
index c76ace648..6ff4134cb 100644
--- a/internal/instanceexec/probe.go
+++ b/internal/instanceexec/probe.go
@@ -76,6 +76,12 @@ type probeEnv struct {
// probes' pts-private line (rootfs Plan 6 added the binary one).
devPts string
openPtmx func() error
+ // ptsEnforced is the installed probe unit's advertisement that its
+ // namespace hides /dev/pts (instancectl.ProbePtsPrivateEnv). The
+ // binary probe's pts-private line is enforced only when it is set; a
+ // new binary under an old unit during a roll reports it unverified.
+ // The rootfs probe ignores it and always enforces.
+ ptsEnforced bool
// boxAddrs is instancectl.BoxAddrsPath: root's list of the box's own
// interface addresses, one per line, which the box-addr line must find
// closed (#367). Both probes read it.
@@ -145,8 +151,9 @@ func productionProbeEnv() probeEnv {
// The pts-private line (rootfs Plan 6, PF-8): the namespace block
// hides /dev/pts, and these are what the line reads. openPtmx is
// the real open on Linux and the !linux stub elsewhere.
- devPts: "/dev/pts",
- openPtmx: openPtmx,
+ devPts: "/dev/pts",
+ openPtmx: openPtmx,
+ ptsEnforced: os.Getenv(instancectl.ProbePtsPrivateEnv) == "1",
boxAddrs: instancectl.BoxAddrsPath,
mmapWX: realMmapWX,
@@ -251,9 +258,16 @@ func runChecks(e probeEnv) instancectl.ProbeReport {
etcCarlosCheck(e, v)
shmPrivateCheck(e, v)
// The host's terminals are out of reach (rootfs Plan 6): the block's
- // TemporaryFileSystem=/dev/pts:ro, as in the rootfs probe.
- detail, ok = ptsPrivate(e)
- v.pass("pts-private", detail, ok)
+ // TemporaryFileSystem=/dev/pts:ro, as in the rootfs probe. Enforced
+ // only under a probe unit that advertises the line: a roll replaces
+ // the binary before the units, and an old unit's namespace still
+ // shows the host's /dev/pts (Task 5 fix round 1).
+ if e.ptsEnforced {
+ detail, ok = ptsPrivate(e)
+ v.pass("pts-private", detail, ok)
+ } else {
+ v.add("pts-private", "unverified", "the probe unit does not set "+instancectl.ProbePtsPrivateEnv+"=1 (installed before /dev/pts:ro); not checked")
+ }
symlinkChecks(e, v)
imdsChecks(e, v)
diff --git a/internal/instanceexec/probe_test.go b/internal/instanceexec/probe_test.go
index 257710765..88f90241e 100644
--- a/internal/instanceexec/probe_test.go
+++ b/internal/instanceexec/probe_test.go
@@ -97,7 +97,9 @@ func goodEnv(t *testing.T) probeEnv {
// link to pts/ptmx in a private /dev) has nothing behind it.
devPts: pts,
openPtmx: func() error { return syscall.ENOENT },
- boxAddrs: boxAddrs,
+ // The installed probe unit advertises its /dev/pts:ro line.
+ ptsEnforced: true,
+ boxAddrs: boxAddrs,
// MemoryDenyWriteExecute=yes as systemd 257 sets it on a 6.3+
// kernel (PR_SET_MDWE).
mmapWX: func() error { return syscall.EACCES },
@@ -463,3 +465,69 @@ func TestBinaryProbeEnvWiresPts(t *testing.T) {
t.Errorf("productionRootfsProbeEnv() devPts=%q openPtmx nil=%v", re.devPts, re.openPtmx == nil)
}
}
+
+// The fix to Astra's P2 on Task 5: a roll replaces the binary before it
+// installs the units, so the new probe can run under the OLD probe unit,
+// whose namespace still shows the host's /dev/pts. The binary probe checks
+// pts-private only when its unit advertises the line
+// (CARLOS_PROBE_PTS_PRIVATE=1); under an old unit the line is reported
+// "unverified", which never blocks readiness, and the terminals are not
+// even looked at.
+func TestBinaryProbeChecksPtsOnlyUnderAUnitThatAdvertisesIt(t *testing.T) {
+ visible := func(e *probeEnv) *int {
+ if err := os.WriteFile(filepath.Join(e.devPts, "0"), nil, 0o600); err != nil {
+ t.Fatal(err)
+ }
+ calls := 0
+ e.openPtmx = func() error { calls++; return nil }
+ return &calls
+ }
+ // Old unit, /dev/pts visible: ready, the line unverified and named.
+ e := goodEnv(t)
+ e.ptsEnforced = false
+ calls := visible(&e)
+ r := runChecks(e)
+ if !r.Ready || verdict(r, "pts-private") != "unverified" || countLines(r, "pts-private") != 1 {
+ t.Fatalf("old unit: ready=%v pts-private=%s %s", r.Ready, verdict(r, "pts-private"), detail(r, "pts-private"))
+ }
+ if !strings.Contains(detail(r, "pts-private"), instancectl.ProbePtsPrivateEnv) {
+ t.Errorf("old unit: the unverified line does not say why: %q", detail(r, "pts-private"))
+ }
+ if *calls != 0 {
+ t.Errorf("old unit: openPtmx called %d times", *calls)
+ }
+ // New unit, /dev/pts visible: fails.
+ e = goodEnv(t)
+ visible(&e)
+ if r := runChecks(e); r.Ready || verdict(r, "pts-private") != "fail" {
+ t.Errorf("new unit, visible /dev/pts: ready=%v pts-private=%s", r.Ready, verdict(r, "pts-private"))
+ }
+ // New unit, /dev/pts hidden: passes.
+ if r := runChecks(goodEnv(t)); !r.Ready || verdict(r, "pts-private") != "ok" {
+ t.Errorf("new unit, hidden /dev/pts: ready=%v pts-private=%s %s", r.Ready, verdict(r, "pts-private"), detail(r, "pts-private"))
+ }
+ // The rootfs probe always checks: its block has carried the line since
+ // Plan 2, so there is no old rootfs unit without it.
+ re := goodRootfsEnv(t)
+ re.ptsEnforced = false
+ if err := os.WriteFile(filepath.Join(re.devPts, "0"), nil, 0o600); err != nil {
+ t.Fatal(err)
+ }
+ if r := runRootfsChecks(re); r.Ready || verdict(r, "pts-private") != "fail" {
+ t.Errorf("rootfs probe, flag absent, visible /dev/pts: ready=%v pts-private=%s", r.Ready, verdict(r, "pts-private"))
+ }
+}
+
+// productionProbeEnv reads the unit's advertisement from its environment:
+// exactly "1" enforces, anything else (absent, empty, "0") does not.
+func TestProductionProbeEnvReadsThePtsAdvertisement(t *testing.T) {
+ for v, want := range map[string]bool{"1": true, "": false, "0": false, "yes": false} {
+ t.Setenv(instancectl.ProbePtsPrivateEnv, v)
+ if got := productionProbeEnv().ptsEnforced; got != want {
+ t.Errorf("%s=%q: ptsEnforced = %v, want %v", instancectl.ProbePtsPrivateEnv, v, got, want)
+ }
+ }
+ if instancectl.ProbePtsPrivateEnv != "CARLOS_PROBE_PTS_PRIVATE" {
+ t.Errorf("ProbePtsPrivateEnv = %q", instancectl.ProbePtsPrivateEnv)
+ }
+}
diff --git a/internal/provision/testdata/plan14-root-reads-chain.tsv b/internal/provision/testdata/plan14-root-reads-chain.tsv
index 907c6465b..95e727792 100644
--- a/internal/provision/testdata/plan14-root-reads-chain.tsv
+++ b/internal/provision/testdata/plan14-root-reads-chain.tsv
@@ -43,4 +43,4 @@ plan14-root-reads-region-ha-dead-holder-backoff.tsv 8f6a1865b0abcea9d4fb68232cc2
plan14-root-reads-managed-fleets-1c-451.tsv af326671321edda76c7e6217a47892605a9e3b886fa880ad6d049c2f28f63873
plan14-root-reads-fleet-public-routes.tsv bca6ef741a96b72767b1747789cd01b3111d61b68548cbe368258c31f3d53a2e
plan14-root-reads-fleet-routes-followups.tsv 1379d066c8dd2335d95d5f6e9c7bce65ff57f00b2b287a308d9b3f47911ae5e7
-plan14-root-reads-rootfs-apps-6.tsv 5491ec585a12b07e249fe1e680cadc7463c985f63fefcea1330c03dbf38f82ed
+plan14-root-reads-rootfs-apps-6.tsv 83f9adb63fe0eae7ad2cd5175000678f05f6a5c646828e05e663b0a03d67f106
diff --git a/internal/provision/testdata/plan14-root-reads-rootfs-apps-6.tsv b/internal/provision/testdata/plan14-root-reads-rootfs-apps-6.tsv
index 9f9abb140..c4277ddaa 100644
--- a/internal/provision/testdata/plan14-root-reads-rootfs-apps-6.tsv
+++ b/internal/provision/testdata/plan14-root-reads-rootfs-apps-6.tsv
@@ -3,30 +3,30 @@
# 2 new dispositions: 0 reads re-frozen at their disposition with the claim, 2 new units frozen accepted-legacy, 0 quiet units retired while they read nothing, 0 other.
@legacy ee96c9cf9e4e6b0dea8325a3eaf0053773b3a20d3940afe881a0db8aa71b2d23 internal/host/units/carlos-instance-cmd@.service external legacy accepted-legacy accepted-legacy;rev3=census-ruling-carlos-run;basis=the cmd unit template (applied by PID 1 as root; its process runs as carlos): extends the J4 seed pattern to the run role. The template equals the seed template outside named lines, and the template-equality test pins that. Root lays out a staged executable validated by the same refuseStagedExe the seed and generation paths use, then starts this unit, which runs as carlos with the instance's own reach. No new trust of registry, /data or agent-asserted content beyond the seed path;rev3=census-ruling-rootfs-apps-6;basis=rootfs Plan 6 Task 5: the same one namespace-block line, TemporaryFileSystem=/dev/pts:ro, as carlos-instance@.service; nothing else file:external@0 925113f4c51c091f0da65c2c67c5902aa35ab37abbe6491ca935820517e8149d
@legacy c986824bab7acb9d785c21f3a48d18f8e678d9252eaea80839ec869f52787a5e internal/host/units/carlos-instance-gen@.service external legacy accepted-legacy accepted-legacy;rev3=J4;basis=root-input;rev3=census-ruling-rootfs-apps-6;basis=rootfs Plan 6 Task 5: the same one namespace-block line, TemporaryFileSystem=/dev/pts:ro, as carlos-instance@.service; nothing else file:external@0 0bd25fefd9306449d55e235e9bd8986466bc4cd68ad56b5614d32596ce39c262
-@legacy 21c72b17e5c5abd6e63a6ab3df1976ddc9afacf88a0e4b3e2e27b6e881c73b9d internal/host/units/carlos-instance-probe.service external legacy accepted-legacy accepted-legacy;rev3=J4;basis=root-input;rev3=census-ruling-rootfs-apps-2;basis=one more BindReadOnlyPaths= line, so PID 1 opens one more bind source: /run/carlos-control/exe/_probe/box-addrs, bound to /opt/carlos/box-addrs, root's list of the box's own addresses, which RunProbe writes before every run (#367) in the root-only directory the unit already binds from; no tenant, app or agent input names or writes it;rev3=census-ruling-rootfs-apps-6;basis=rootfs Plan 6 Task 5: the same one namespace-block line, TemporaryFileSystem=/dev/pts:ro, as carlos-instance@.service, so the probe proves what the tenants get (its new pts-private line); nothing else file:external@0 0eaa68abc2c041aeac8ae3b52bc512bd28cf1dacf7580c29b05630d14ef80a67
+@legacy 4cb19ff14f607602d752f0e329036d5c52eb64f4b1547b2116918b77cb5f4af1 internal/host/units/carlos-instance-probe.service external legacy accepted-legacy accepted-legacy;rev3=J4;basis=root-input;rev3=census-ruling-rootfs-apps-2;basis=one more BindReadOnlyPaths= line, so PID 1 opens one more bind source: /run/carlos-control/exe/_probe/box-addrs, bound to /opt/carlos/box-addrs, root's list of the box's own addresses, which RunProbe writes before every run (#367) in the root-only directory the unit already binds from; no tenant, app or agent input names or writes it;rev3=census-ruling-rootfs-apps-6;basis=rootfs Plan 6 Task 5: the same one namespace-block line, TemporaryFileSystem=/dev/pts:ro, as carlos-instance@.service, so the probe proves what the tenants get (its new pts-private line); fix round 1 (Astra P2, roll order): one line outside the namespace block, Environment=CARLOS_PROBE_PTS_PRIVATE=1, a constant the unit sets for its own process (the probe, as carlos, in the namespace); it names no path, adds no bind source or Exec line, and root reads nothing new file:external@0 a803c8e83ffd95ceca691e0c47e623acfa50e88dcddd3166e6660473aa86695b
@legacy 455d36b55c3d97593df35538d23dbb6a698875cdc63451f11eb09da0507ac05d internal/host/units/carlos-instance-seed@.service external legacy accepted-legacy accepted-legacy;rev3=J4;basis=root-input;rev3=census-ruling-rootfs-apps-6;basis=rootfs Plan 6 Task 5: the same one namespace-block line, TemporaryFileSystem=/dev/pts:ro, as carlos-instance@.service; nothing else file:external@0 bfc1af41ba6317bdd8595b8f25869cc45835649966ca2ab89373f4ececd8fd73
@legacy eb66783c14afecf46fc2add7bddc9544847f396658626ce8139d7a028f5905cf internal/host/units/carlos-instance-sidecar@.service external legacy accepted-legacy accepted-legacy;rev3=J4;basis=root-input;rev3=census-ruling-rootfs-apps-6;basis=rootfs Plan 6 Task 5: the same one namespace-block line, TemporaryFileSystem=/dev/pts:ro, as carlos-instance@.service; nothing else file:external@0 aed2039fd622fc3fa8455d21d9da0e55cd73ddc02b399482d75d546e0b310a30
@legacy 1572962cee0ed81c0ec52934c14b5f762d0b6643047c8790ec85daa26db14d0a internal/host/units/carlos-instance@.service external legacy accepted-legacy accepted-legacy;rev3=J4;basis=root-input;rev3=census-ruling-rootfs-apps-6;basis=rootfs Plan 6 Task 5: one namespace-block line added after TemporaryFileSystem=/dev/mqueue:ro, TemporaryFileSystem=/dev/pts:ro (with its comment): PID 1 mounts an empty read-only tmpfs over the private /dev/pts, hiding the host devpts PrivateDevices= binds in; no bind source, Exec line, user or path read by root added; the block stays byte-identical across the binary templates (TestInstanceTemplatesShareOneNamespace) file:external@0 9454117e9e93f85aded1e9ee9ef27d7a90c99e0e3b6ceecd4ea82eed9e30cf4c
-@legacy 91c30b88818f28be789a268b87d768fb3e77986e1c0316ccb54b897e5bb1dad4 internal/instanceexec/probe.go productionProbeEnv legacy accepted-legacy accepted-legacy;rev3=J4;basis=root-input;rev3=census-ruling-rootfs-apps-2;basis=the binary probe's env gains boxAddrs (instancectl.BoxAddrsPath, /opt/carlos/box-addrs), which boxAddrClosed (a decision row) reads inside the probe unit, and mmapWX (realMmapWX, an anonymous mapping); the same one direct site;rev3=census-ruling-rootfs-apps-6;basis=rootfs Plan 6 Task 5 (PF-8): the binary probe env sets devPts=/dev/pts and openPtmx (open /dev/ptmx O_RDWR|O_NOCTTY and close at once), the fields the rootfs probe env already set; read by the new pts-private line inside the probe unit (as carlos, in the namespace); the same direct site, no new root read data-literal@67 e03d88c7883f4f64e132fc751c9641aa4c8adb54eff113a6e9eed0511be67315
+@legacy eaf433e09f4fce09c3df3357d5811657d4db19eb29eccd96df40666f382fb49d internal/instanceexec/probe.go productionProbeEnv legacy accepted-legacy accepted-legacy;rev3=J4;basis=root-input;rev3=census-ruling-rootfs-apps-2;basis=the binary probe's env gains boxAddrs (instancectl.BoxAddrsPath, /opt/carlos/box-addrs), which boxAddrClosed (a decision row) reads inside the probe unit, and mmapWX (realMmapWX, an anonymous mapping); the same one direct site;rev3=census-ruling-rootfs-apps-6;basis=rootfs Plan 6 Task 5 (PF-8): the binary probe env sets devPts=/dev/pts and openPtmx (open /dev/ptmx O_RDWR|O_NOCTTY and close at once), the fields the rootfs probe env already set; read by the new pts-private line inside the probe unit (as carlos, in the namespace); fix round 1: also reads its own environment, CARLOS_PROBE_PTS_PRIVATE (exactly "1" enforces pts-private; otherwise the line is reported unverified), which the probe unit sets; the same direct site, no new root read data-literal@67 9de3096aec14bb54d72ee47eceb866cc2b6b80fcda8206cf9a4d5476f0f0d177
@legacy 7282b3718ce918bbd9d7e4dce31a4737bca6eddb45048749c502c8261c740cf8 internal/layout/plan.go NestedPlatformNames legacy accepted-legacy accepted-legacy;rev3=census-ruling-moves-offline;basis=root-input (J4, as main's moves units); the agent (/opt/carlos/carlos agent, carlos-edge.service, user carlos): new, called only from the agent's offline sealer and source retire (IsNestedPlatformName): a fixed list of names, reads nothing;rev3=census-ruling-rootfs-apps-6;basis=rootfs Plan 6 Task 5: the fixed role list gains RoleTTY, so launch.tty.json is one more fixed platform name; still reads nothing data-literal@84 faf3813dcb08f2e153a45b53f4461899327775c298419fc7fe817e80110119d0
@legacy 438a9858d01281800b89923ab2c4bf47bba5c3eab23e07fe43af9a5e3a9ae755 internal/provision/reconcile.go Reconcile legacy accepted-legacy accepted-legacy;rev3=census-ruling-self-serve-moves-1;basis=the agent (/opt/carlos/carlos agent, carlos-edge.service, user carlos), from its reconcile loops: each listed record is observed through the box's lifetime judge (ObserveWith: the record, then its host incarnation slot) before the shape, channel and scope checks, a stale record is left out and an unjudgeable one protected; the removal phase observes a row's own record key when the pass holds none for it under that key, and deletes a held row whose record is gone or stale through DeleteIfHold; a nil judge (claims on) is main's body; registry read sites unchanged, offsets moved; fix round 1: the removal phase observes a row's own key only under an account the listing trusts, so a retired or unmaterialised account's row keeps record gone, and the pass arms its own context with the judge; Task 7: under a judge an existing provisioned row of the record's own app and account follows the existing-row rules (heldByVanishedPredecessor and retireHeldPredecessor's DeleteIfHold first, the record then minted on the same pass; the hold; installRowLifetime), each a separate write under the host's hold lock; registry read sites unchanged, offsets moved;rev3=census-ruling-instance-egress-sizes-328-329;identity=the agent (/opt/carlos/carlos agent, carlos-edge.service, user carlos);basis=#328/#329 plan 1 Task 7: the pass reads its apps' policy objects (control/app-policy/<sqid>/<app>.json in the bucket) through the agent's PolicyCache, each verified with ReleasePub by apppolicy.VerifyKey (ed25519 over the policy's own domain line, bound to the account and app, unexpired, not future-dated; anything else is no policy), and carries the columns into its rows. New kinds registry:EgressAllow, registry:Size and registry:PolicyExpiresAt, one site each, all the assignment of a fresh row's columns (nr) from policies.cols; plus one whole:Route site, the existing row handed to policies.forRow. Other read sites unchanged, offsets moved; the agent's own pass, no root decision;rev3=census-ruling-region-ha-p1a;basis=the agent as carlos, from its reconcile loops: after the scan, hands the in-scope records to cfg.Lifetimes (the box's lifetime index): Merge after a failed read or partial listing, Replace after a complete one, nothing on a dry run or with no index; the scan, judge and removal phases unchanged; the same 166 sites, no read added;rev3=census-ruling-rootfs-apps-3;basis=rootfs Plan 3 Tasks 2 and 5 (D5, spec §5.0): a seeded record over a row with a runtime is skipped and logged; a row with a runtime (or a new record with one) takes no seed; runtime and a rootfs row's hibernation are never converged from a record (a mismatch is logged; a record claiming a runtime its row lacks is not applied); reads Runtime of the record and the row; the box writes less; fix wave 1 (ceea6353, whole-branch P1-2): before minting a row for a record with no runtime and no row (both mint paths), the pass reads the app's kind marker once per app per pass (release.ReadAppKindMarker: one GET of the create-only kind.json from the release store s, through freshStore, validated by readAppKindMarker); a rootfs marker leaves the record unmaterialized and logged (an older console stripped its runtime), and a marker that cannot be read defers the mint this pass; a refusal before minting only, registry read sites unchanged, the box writes less; fix wave 2 (whole-branch r2 P1): the kind-marker read and its refusal apply only to a socket-backed instance record (DerivesPaths), so a static or upstream-backed record of a rootfs app, which carries no runtime by design, is minted as before with no read; fewer reads, registry read sites unchanged;rev3=census-ruling-fleet-public-routes;basis=fleet public routes (spec 2026-10-29 rev 4, §4.2 writer rule): Task 10: the forward phase on the hub (FleetOwners set): the scan keeps the fleet-placed records it skips and counts records per host; a trash-only marker prefetch; disputed (failed-GET) hosts; armed, a host an in-scope and a fleet record both name is given neither, its journal waits and the removal phase keeps its row (+registry:Account, +registry:App, +registry:Host x2: the collision guard, its log line and report mark); the instance loop leaves a forward host; retirable excludes forward rows. Same record keys; writes only the registry (PutForward, DeleteForward); no bucket write.;rev3=census-ruling-rootfs-apps-6;basis=rootfs Plan 6 Task 3: in the per-record loop, beside the RunSeen call, calls cfg.InteractiveSeen(rec) when the hook is set and the in-scope record carries an interactive-session marker (rec.Interactive != nil), once per record per pass, before the pass acts on it; the hook is the box worker's non-blocking note (Task 12). Same record keys and literal; no read added (registry read sites unchanged, 178); nothing written by the call registry:Account@36233,registry:Account@37498,registry:Account@55577,registry:Account@55623,registry:Account@56467,registry:Account@56844,registry:Account@57070,registry:Account@57137,registry:Account@57183,registry:Account@57276,registry:Account@57318,registry:Account@57966,registry:Account@58224,registry:Account@58764,registry:Account@58812,registry:Account@59185,registry:Account@59231,registry:Account@59476,registry:Account@59901,registry:Account@60389,registry:Account@61125,registry:Account@61318,registry:Account@61664,registry:Account@62229,registry:App@36206,registry:App@37471,registry:App@55597,registry:App@55635,registry:App@56479,registry:App@56856,registry:App@57082,registry:App@57157,registry:App@57195,registry:App@57296,registry:App@57978,registry:App@58236,registry:App@58776,registry:App@58824,registry:App@59205,registry:App@59243,registry:App@59488,registry:App@59913,registry:App@60401,registry:App@61137,registry:App@61330,registry:App@61676,registry:App@62241,registry:ClaimOwnership@36820,registry:DBPath@45677,registry:DBPath@45692,registry:DBPath@45938,registry:DBPath@46541,registry:DBPath@46554,registry:EgressAllow@35319,registry:Gate@42022,registry:Gate@42162,registry:Gate@42449,registry:Hibernate@40694,registry:Hibernate@40892,registry:Hibernate@40957,registry:Hibernate@41296,registry:Hibernate@41647,registry:Hibernate@41957,registry:HoldOp@60870,registry:HoldOp@60961,registry:HoldOp@61096,registry:HoldOp@61472,registry:Host@26327,registry:Host@55556,registry:Host@56443,registry:Host@56820,registry:Host@56984,registry:Host@57090,registry:Host@57986,registry:Host@58192,registry:Host@59068,registry:Host@59340,registry:Host@59455,registry:Host@59778,registry:Host@59875,registry:Host@60266,registry:Host@60363,registry:Host@60577,registry:Host@60952,registry:Host@61087,registry:Host@61291,registry:Host@61364,registry:Host@61463,registry:Host@61638,registry:Host@61713,registry:Host@61799,registry:Host@62206,registry:Kind@36962,registry:Kind@37225,registry:Kind@45595,registry:Kind@45608,registry:Kind@45718,registry:Kind@45731,registry:Kind@46452,registry:Kind@46463,registry:Kind@54680,registry:Kind@60568,registry:Kind@61078,registry:Kind@61454,registry:Kind@61629,registry:Kind@61790,registry:PolicyExpiresAt@35344,registry:Pool@54766,registry:Provisioned@36182,registry:Provisioned@37447,registry:Provisioned@54725,registry:RateLimit@42535,registry:RateLimit@42686,registry:RateLimit@42973,registry:Region@54755,registry:Replication@41381,registry:Replication@41508,registry:Runtime@28984,registry:Runtime@29162,registry:Runtime@31367,registry:Runtime@40061,registry:Runtime@40115,registry:Runtime@40319,registry:Seed@44075,registry:SeedSource@43558,registry:Size@35335,registry:Socket@45643,registry:Socket@45658,registry:Socket@45955,registry:Socket@46511,registry:Socket@46524,registry:Unit@45561,registry:Unit@45574,registry:Unit@46478,registry:Unit@46489,whole:ClaimOwnership@36823,whole:ClaimOwnership@36840,whole:Route@26309,whole:Route@26320,whole:Route@26338,whole:Route@27619,whole:Route@29479,whole:Route@29486,whole:Route@29526,whole:Route@29887,whole:Route@30225,whole:Route@30672,whole:Route@30723,whole:Route@30760,whole:Route@32432,whole:Route@32641,whole:Route@32980,whole:Route@32989,whole:Route@33035,whole:Route@35268,whole:Route@35827,whole:Route@36298,whole:Route@36308,whole:Route@36665,whole:Route@36672,whole:Route@36740,whole:Route@37063,whole:Route@38096,whole:Route@41047,whole:Route@45787,whole:Route@47373,whole:Route@47418,whole:Route@47428,whole:Route@48298,whole:Route@49325,whole:Route@54791,whole:Route@54939,whole:Route@56036,whole:Route@56395,whole:Route@56777,whole:Route@61551,whole:Route@62136,whole:Route@62186 be1b699f14a2f8d6935d959dee168bdf6fb556cd78da458f5ba8a1c0e8512a17
@legacy a51e04d46da95100335449f3aeeb490bf419c089a5924e26288ccfe192257535 internal/host/units/carlos-instance-rootfs-tty@.service external legacy accepted-legacy accepted-legacy;rev3=census-ruling-rootfs-apps-6;basis=rootfs Plan 6 Task 5, new: the rootfs tty template, carlos-instance-rootfs-cmd@.service outside named lines held by TestRootfsTTYTemplateEqualsRootfsCmdOutsideTheNamedLines: Description (tty), ExecStart/ExecStopPost instance-exec/instance-exit --rootfs tty %I, StandardInput=file:/run/carlos/logs/%I.tty.sock with StandardOutput/StandardError=journal, and RootImage plus the two BindReadOnlyPaths sources under /run/carlos-control/exe/%I/rootfs/tty/ (root-only exe layout) instead of rootfs/cmd/. The rootfs namespace block byte for byte (TestRootfsTemplatesShareOneNamespace), runs as carlos, binds only the instance own and root paths (TestRootfsTemplatesBindOnlyTheInstancesOwnAndRoots). Nothing starts it yet (Task 6) file:external@0 d57f6d6fbe553e5ba5a5762ab2bd72586835ce1db748b67044edd1bf90af6953
@legacy dc75d2ec43e68117fd04c29c2c90eb33b8eaa4cc3b4aa7531e423eb1c2d012ac internal/host/units/carlos-instance-tty@.service external legacy accepted-legacy accepted-legacy;rev3=census-ruling-rootfs-apps-6;basis=rootfs Plan 6 Task 5, new: the binary tty template, carlos-instance-cmd@.service outside six named lines held by TestTTYTemplateEqualsCmdOutsideTheNamedLines: Description (tty), ExecStart/ExecStopPost instance-exec/instance-exit tty %I (the same root binary as every template), StandardInput=file:/run/carlos/logs/%I.tty.sock replacing the cmd StandardOutput socket (PID 1 opens it as root on the nosymfollow logs mount, as the cmd streams), StandardOutput=journal, StandardError=journal, and BindReadOnlyPaths sources tty-app/tty-live under /run/carlos-control/exe/%I (root-only exe layout, as cmd-app/cmd-live). Same namespace block byte for byte, runs as carlos. Nothing starts it yet (Task 6 adds POST /tty) file:external@0 060295d0956afad52db77dba1988c508cf4289f9b5a18242a206a315145b8e0d
internal/host/units/carlos-instance-cmd@.service external legacy accepted-legacy accepted-legacy;rev3=census-ruling-carlos-run;basis=the cmd unit template (applied by PID 1 as root; its process runs as carlos): extends the J4 seed pattern to the run role. The template equals the seed template outside named lines, and the template-equality test pins that. Root lays out a staged executable validated by the same refuseStagedExe the seed and generation paths use, then starts this unit, which runs as carlos with the instance's own reach. No new trust of registry, /data or agent-asserted content beyond the seed path;rev3=census-ruling-rootfs-apps-6;basis=rootfs Plan 6 Task 5: the same one namespace-block line, TemporaryFileSystem=/dev/pts:ro, as carlos-instance@.service; nothing else file:external@0 925113f4c51c091f0da65c2c67c5902aa35ab37abbe6491ca935820517e8149d
internal/host/units/carlos-instance-gen@.service external legacy accepted-legacy accepted-legacy;rev3=J4;basis=root-input;rev3=census-ruling-rootfs-apps-6;basis=rootfs Plan 6 Task 5: the same one namespace-block line, TemporaryFileSystem=/dev/pts:ro, as carlos-instance@.service; nothing else file:external@0 0bd25fefd9306449d55e235e9bd8986466bc4cd68ad56b5614d32596ce39c262
-internal/host/units/carlos-instance-probe.service external legacy accepted-legacy accepted-legacy;rev3=J4;basis=root-input;rev3=census-ruling-rootfs-apps-2;basis=one more BindReadOnlyPaths= line, so PID 1 opens one more bind source: /run/carlos-control/exe/_probe/box-addrs, bound to /opt/carlos/box-addrs, root's list of the box's own addresses, which RunProbe writes before every run (#367) in the root-only directory the unit already binds from; no tenant, app or agent input names or writes it;rev3=census-ruling-rootfs-apps-6;basis=rootfs Plan 6 Task 5: the same one namespace-block line, TemporaryFileSystem=/dev/pts:ro, as carlos-instance@.service, so the probe proves what the tenants get (its new pts-private line); nothing else file:external@0 0eaa68abc2c041aeac8ae3b52bc512bd28cf1dacf7580c29b05630d14ef80a67
+internal/host/units/carlos-instance-probe.service external legacy accepted-legacy accepted-legacy;rev3=J4;basis=root-input;rev3=census-ruling-rootfs-apps-2;basis=one more BindReadOnlyPaths= line, so PID 1 opens one more bind source: /run/carlos-control/exe/_probe/box-addrs, bound to /opt/carlos/box-addrs, root's list of the box's own addresses, which RunProbe writes before every run (#367) in the root-only directory the unit already binds from; no tenant, app or agent input names or writes it;rev3=census-ruling-rootfs-apps-6;basis=rootfs Plan 6 Task 5: the same one namespace-block line, TemporaryFileSystem=/dev/pts:ro, as carlos-instance@.service, so the probe proves what the tenants get (its new pts-private line); fix round 1 (Astra P2, roll order): one line outside the namespace block, Environment=CARLOS_PROBE_PTS_PRIVATE=1, a constant the unit sets for its own process (the probe, as carlos, in the namespace); it names no path, adds no bind source or Exec line, and root reads nothing new file:external@0 a803c8e83ffd95ceca691e0c47e623acfa50e88dcddd3166e6660473aa86695b
internal/host/units/carlos-instance-seed@.service external legacy accepted-legacy accepted-legacy;rev3=J4;basis=root-input;rev3=census-ruling-rootfs-apps-6;basis=rootfs Plan 6 Task 5: the same one namespace-block line, TemporaryFileSystem=/dev/pts:ro, as carlos-instance@.service; nothing else file:external@0 bfc1af41ba6317bdd8595b8f25869cc45835649966ca2ab89373f4ececd8fd73
internal/host/units/carlos-instance-sidecar@.service external legacy accepted-legacy accepted-legacy;rev3=J4;basis=root-input;rev3=census-ruling-rootfs-apps-6;basis=rootfs Plan 6 Task 5: the same one namespace-block line, TemporaryFileSystem=/dev/pts:ro, as carlos-instance@.service; nothing else file:external@0 aed2039fd622fc3fa8455d21d9da0e55cd73ddc02b399482d75d546e0b310a30
internal/host/units/carlos-instance@.service external legacy accepted-legacy accepted-legacy;rev3=J4;basis=root-input;rev3=census-ruling-rootfs-apps-6;basis=rootfs Plan 6 Task 5: one namespace-block line added after TemporaryFileSystem=/dev/mqueue:ro, TemporaryFileSystem=/dev/pts:ro (with its comment): PID 1 mounts an empty read-only tmpfs over the private /dev/pts, hiding the host devpts PrivateDevices= binds in; no bind source, Exec line, user or path read by root added; the block stays byte-identical across the binary templates (TestInstanceTemplatesShareOneNamespace) file:external@0 9454117e9e93f85aded1e9ee9ef27d7a90c99e0e3b6ceecd4ea82eed9e30cf4c
-internal/instanceexec/probe.go productionProbeEnv legacy accepted-legacy accepted-legacy;rev3=J4;basis=root-input;rev3=census-ruling-rootfs-apps-2;basis=the binary probe's env gains boxAddrs (instancectl.BoxAddrsPath, /opt/carlos/box-addrs), which boxAddrClosed (a decision row) reads inside the probe unit, and mmapWX (realMmapWX, an anonymous mapping); the same one direct site;rev3=census-ruling-rootfs-apps-6;basis=rootfs Plan 6 Task 5 (PF-8): the binary probe env sets devPts=/dev/pts and openPtmx (open /dev/ptmx O_RDWR|O_NOCTTY and close at once), the fields the rootfs probe env already set; read by the new pts-private line inside the probe unit (as carlos, in the namespace); the same direct site, no new root read data-literal@67 e03d88c7883f4f64e132fc751c9641aa4c8adb54eff113a6e9eed0511be67315
+internal/instanceexec/probe.go productionProbeEnv legacy accepted-legacy accepted-legacy;rev3=J4;basis=root-input;rev3=census-ruling-rootfs-apps-2;basis=the binary probe's env gains boxAddrs (instancectl.BoxAddrsPath, /opt/carlos/box-addrs), which boxAddrClosed (a decision row) reads inside the probe unit, and mmapWX (realMmapWX, an anonymous mapping); the same one direct site;rev3=census-ruling-rootfs-apps-6;basis=rootfs Plan 6 Task 5 (PF-8): the binary probe env sets devPts=/dev/pts and openPtmx (open /dev/ptmx O_RDWR|O_NOCTTY and close at once), the fields the rootfs probe env already set; read by the new pts-private line inside the probe unit (as carlos, in the namespace); fix round 1: also reads its own environment, CARLOS_PROBE_PTS_PRIVATE (exactly "1" enforces pts-private; otherwise the line is reported unverified), which the probe unit sets; the same direct site, no new root read data-literal@67 9de3096aec14bb54d72ee47eceb866cc2b6b80fcda8206cf9a4d5476f0f0d177
internal/layout/plan.go NestedPlatformNames legacy accepted-legacy accepted-legacy;rev3=census-ruling-moves-offline;basis=root-input (J4, as main's moves units); the agent (/opt/carlos/carlos agent, carlos-edge.service, user carlos): new, called only from the agent's offline sealer and source retire (IsNestedPlatformName): a fixed list of names, reads nothing;rev3=census-ruling-rootfs-apps-6;basis=rootfs Plan 6 Task 5: the fixed role list gains RoleTTY, so launch.tty.json is one more fixed platform name; still reads nothing data-literal@84 faf3813dcb08f2e153a45b53f4461899327775c298419fc7fe817e80110119d0
internal/provision/reconcile.go Reconcile legacy accepted-legacy accepted-legacy;rev3=census-ruling-self-serve-moves-1;basis=the agent (/opt/carlos/carlos agent, carlos-edge.service, user carlos), from its reconcile loops: each listed record is observed through the box's lifetime judge (ObserveWith: the record, then its host incarnation slot) before the shape, channel and scope checks, a stale record is left out and an unjudgeable one protected; the removal phase observes a row's own record key when the pass holds none for it under that key, and deletes a held row whose record is gone or stale through DeleteIfHold; a nil judge (claims on) is main's body; registry read sites unchanged, offsets moved; fix round 1: the removal phase observes a row's own key only under an account the listing trusts, so a retired or unmaterialised account's row keeps record gone, and the pass arms its own context with the judge; Task 7: under a judge an existing provisioned row of the record's own app and account follows the existing-row rules (heldByVanishedPredecessor and retireHeldPredecessor's DeleteIfHold first, the record then minted on the same pass; the hold; installRowLifetime), each a separate write under the host's hold lock; registry read sites unchanged, offsets moved;rev3=census-ruling-instance-egress-sizes-328-329;identity=the agent (/opt/carlos/carlos agent, carlos-edge.service, user carlos);basis=#328/#329 plan 1 Task 7: the pass reads its apps' policy objects (control/app-policy/<sqid>/<app>.json in the bucket) through the agent's PolicyCache, each verified with ReleasePub by apppolicy.VerifyKey (ed25519 over the policy's own domain line, bound to the account and app, unexpired, not future-dated; anything else is no policy), and carries the columns into its rows. New kinds registry:EgressAllow, registry:Size and registry:PolicyExpiresAt, one site each, all the assignment of a fresh row's columns (nr) from policies.cols; plus one whole:Route site, the existing row handed to policies.forRow. Other read sites unchanged, offsets moved; the agent's own pass, no root decision;rev3=census-ruling-region-ha-p1a;basis=the agent as carlos, from its reconcile loops: after the scan, hands the in-scope records to cfg.Lifetimes (the box's lifetime index): Merge after a failed read or partial listing, Replace after a complete one, nothing on a dry run or with no index; the scan, judge and removal phases unchanged; the same 166 sites, no read added;rev3=census-ruling-rootfs-apps-3;basis=rootfs Plan 3 Tasks 2 and 5 (D5, spec §5.0): a seeded record over a row with a runtime is skipped and logged; a row with a runtime (or a new record with one) takes no seed; runtime and a rootfs row's hibernation are never converged from a record (a mismatch is logged; a record claiming a runtime its row lacks is not applied); reads Runtime of the record and the row; the box writes less; fix wave 1 (ceea6353, whole-branch P1-2): before minting a row for a record with no runtime and no row (both mint paths), the pass reads the app's kind marker once per app per pass (release.ReadAppKindMarker: one GET of the create-only kind.json from the release store s, through freshStore, validated by readAppKindMarker); a rootfs marker leaves the record unmaterialized and logged (an older console stripped its runtime), and a marker that cannot be read defers the mint this pass; a refusal before minting only, registry read sites unchanged, the box writes less; fix wave 2 (whole-branch r2 P1): the kind-marker read and its refusal apply only to a socket-backed instance record (DerivesPaths), so a static or upstream-backed record of a rootfs app, which carries no runtime by design, is minted as before with no read; fewer reads, registry read sites unchanged;rev3=census-ruling-fleet-public-routes;basis=fleet public routes (spec 2026-10-29 rev 4, §4.2 writer rule): Task 10: the forward phase on the hub (FleetOwners set): the scan keeps the fleet-placed records it skips and counts records per host; a trash-only marker prefetch; disputed (failed-GET) hosts; armed, a host an in-scope and a fleet record both name is given neither, its journal waits and the removal phase keeps its row (+registry:Account, +registry:App, +registry:Host x2: the collision guard, its log line and report mark); the instance loop leaves a forward host; retirable excludes forward rows. Same record keys; writes only the registry (PutForward, DeleteForward); no bucket write.;rev3=census-ruling-rootfs-apps-6;basis=rootfs Plan 6 Task 3: in the per-record loop, beside the RunSeen call, calls cfg.InteractiveSeen(rec) when the hook is set and the in-scope record carries an interactive-session marker (rec.Interactive != nil), once per record per pass, before the pass acts on it; the hook is the box worker's non-blocking note (Task 12). Same record keys and literal; no read added (registry read sites unchanged, 178); nothing written by the call registry:Account@36233,registry:Account@37498,registry:Account@55577,registry:Account@55623,registry:Account@56467,registry:Account@56844,registry:Account@57070,registry:Account@57137,registry:Account@57183,registry:Account@57276,registry:Account@57318,registry:Account@57966,registry:Account@58224,registry:Account@58764,registry:Account@58812,registry:Account@59185,registry:Account@59231,registry:Account@59476,registry:Account@59901,registry:Account@60389,registry:Account@61125,registry:Account@61318,registry:Account@61664,registry:Account@62229,registry:App@36206,registry:App@37471,registry:App@55597,registry:App@55635,registry:App@56479,registry:App@56856,registry:App@57082,registry:App@57157,registry:App@57195,registry:App@57296,registry:App@57978,registry:App@58236,registry:App@58776,registry:App@58824,registry:App@59205,registry:App@59243,registry:App@59488,registry:App@59913,registry:App@60401,registry:App@61137,registry:App@61330,registry:App@61676,registry:App@62241,registry:ClaimOwnership@36820,registry:DBPath@45677,registry:DBPath@45692,registry:DBPath@45938,registry:DBPath@46541,registry:DBPath@46554,registry:EgressAllow@35319,registry:Gate@42022,registry:Gate@42162,registry:Gate@42449,registry:Hibernate@40694,registry:Hibernate@40892,registry:Hibernate@40957,registry:Hibernate@41296,registry:Hibernate@41647,registry:Hibernate@41957,registry:HoldOp@60870,registry:HoldOp@60961,registry:HoldOp@61096,registry:HoldOp@61472,registry:Host@26327,registry:Host@55556,registry:Host@56443,registry:Host@56820,registry:Host@56984,registry:Host@57090,registry:Host@57986,registry:Host@58192,registry:Host@59068,registry:Host@59340,registry:Host@59455,registry:Host@59778,registry:Host@59875,registry:Host@60266,registry:Host@60363,registry:Host@60577,registry:Host@60952,registry:Host@61087,registry:Host@61291,registry:Host@61364,registry:Host@61463,registry:Host@61638,registry:Host@61713,registry:Host@61799,registry:Host@62206,registry:Kind@36962,registry:Kind@37225,registry:Kind@45595,registry:Kind@45608,registry:Kind@45718,registry:Kind@45731,registry:Kind@46452,registry:Kind@46463,registry:Kind@54680,registry:Kind@60568,registry:Kind@61078,registry:Kind@61454,registry:Kind@61629,registry:Kind@61790,registry:PolicyExpiresAt@35344,registry:Pool@54766,registry:Provisioned@36182,registry:Provisioned@37447,registry:Provisioned@54725,registry:RateLimit@42535,registry:RateLimit@42686,registry:RateLimit@42973,registry:Region@54755,registry:Replication@41381,registry:Replication@41508,registry:Runtime@28984,registry:Runtime@29162,registry:Runtime@31367,registry:Runtime@40061,registry:Runtime@40115,registry:Runtime@40319,registry:Seed@44075,registry:SeedSource@43558,registry:Size@35335,registry:Socket@45643,registry:Socket@45658,registry:Socket@45955,registry:Socket@46511,registry:Socket@46524,registry:Unit@45561,registry:Unit@45574,registry:Unit@46478,registry:Unit@46489,whole:ClaimOwnership@36823,whole:ClaimOwnership@36840,whole:Route@26309,whole:Route@26320,whole:Route@26338,whole:Route@27619,whole:Route@29479,whole:Route@29486,whole:Route@29526,whole:Route@29887,whole:Route@30225,whole:Route@30672,whole:Route@30723,whole:Route@30760,whole:Route@32432,whole:Route@32641,whole:Route@32980,whole:Route@32989,whole:Route@33035,whole:Route@35268,whole:Route@35827,whole:Route@36298,whole:Route@36308,whole:Route@36665,whole:Route@36672,whole:Route@36740,whole:Route@37063,whole:Route@38096,whole:Route@41047,whole:Route@45787,whole:Route@47373,whole:Route@47418,whole:Route@47428,whole:Route@48298,whole:Route@49325,whole:Route@54791,whole:Route@54939,whole:Route@56036,whole:Route@56395,whole:Route@56777,whole:Route@61551,whole:Route@62136,whole:Route@62186 be1b699f14a2f8d6935d959dee168bdf6fb556cd78da458f5ba8a1c0e8512a17
internal/host/units/carlos-instance-rootfs-tty@.service external legacy accepted-legacy accepted-legacy;rev3=census-ruling-rootfs-apps-6;basis=rootfs Plan 6 Task 5, new: the rootfs tty template, carlos-instance-rootfs-cmd@.service outside named lines held by TestRootfsTTYTemplateEqualsRootfsCmdOutsideTheNamedLines: Description (tty), ExecStart/ExecStopPost instance-exec/instance-exit --rootfs tty %I, StandardInput=file:/run/carlos/logs/%I.tty.sock with StandardOutput/StandardError=journal, and RootImage plus the two BindReadOnlyPaths sources under /run/carlos-control/exe/%I/rootfs/tty/ (root-only exe layout) instead of rootfs/cmd/. The rootfs namespace block byte for byte (TestRootfsTemplatesShareOneNamespace), runs as carlos, binds only the instance own and root paths (TestRootfsTemplatesBindOnlyTheInstancesOwnAndRoots). Nothing starts it yet (Task 6) file:external@0 d57f6d6fbe553e5ba5a5762ab2bd72586835ce1db748b67044edd1bf90af6953
internal/host/units/carlos-instance-tty@.service external legacy accepted-legacy accepted-legacy;rev3=census-ruling-rootfs-apps-6;basis=rootfs Plan 6 Task 5, new: the binary tty template, carlos-instance-cmd@.service outside six named lines held by TestTTYTemplateEqualsCmdOutsideTheNamedLines: Description (tty), ExecStart/ExecStopPost instance-exec/instance-exit tty %I (the same root binary as every template), StandardInput=file:/run/carlos/logs/%I.tty.sock replacing the cmd StandardOutput socket (PID 1 opens it as root on the nosymfollow logs mount, as the cmd streams), StandardOutput=journal, StandardError=journal, and BindReadOnlyPaths sources tty-app/tty-live under /run/carlos-control/exe/%I (root-only exe layout, as cmd-app/cmd-live). Same namespace block byte for byte, runs as carlos. Nothing starts it yet (Task 6 adds POST /tty) file:external@0 060295d0956afad52db77dba1988c508cf4289f9b5a18242a206a315145b8e0d
@coverage . fbc28f10f89cd03cac31bae0d798ae7f707eb7671284a6115abd8c1c214369b6
@coverage internal/appconfig cac8d8ef7538a456d034801c95ce6508a4983e5516b3bbbd302bec0fbafdd479
-@coverage internal/host/units a437b93c66cdb75ca57ff6e609800fb17fc9c975c1db8f429030cbfd1830c843
-@coverage internal/instancectl 0823bfcfed9770a548fb1444047b9bf22f74fecdf770e4f9443dae778465ca5f
-@coverage internal/instanceexec 437d5d54657ec32281d6f23d697302a177be9a4f54039ce3d1e71912a6376005
+@coverage internal/host/units c3cc4f3b917fdb938f20d406b1704ec54e24553851c298e312056d397d10b0e1
+@coverage internal/instancectl d76867d3677604d151b617220b8cc201fc21998275d6660acff6e1baae3db203
+@coverage internal/instanceexec 16221b476a2d996eb5325ce97a683329639679144b4dcc136b2a018b7abdd9df
@coverage internal/layout 1527c3b31d87743798002b1ebefcd2cb0dc422a8642f72a3ff8dbefbd2c84d9b
@coverage internal/provision e1ecfdc3d169773ac6dd9dc09a6d0feea768ceb1b80195199c5ef74b2f0e6f5c