carlos / platform Public

instance-control: renderer accepts the 64M and 256M anchors (#1291 R1)

system apply renders the candidate's staged control template with the
installed binary's renderer. On rollback this renderer meets v0.40.1's
64M template, so the claims and build-worker memory rewrites now match
either line and render the same as from this build's template.

On upgrade a v0.40.1 updater leaves 256M unreplaced (claims lose
GOMEMLIMIT, a build worker its 1 GiB) until the new binary's adopt
pass re-renders and rewrites control. The controlChanged decision moves
verbatim into claimControlStale, and a test drives it on the simulated
legacy render to prove the adopt pass flags it.

Census overlay instance-control-memory-1291 re-proposed.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
claude agent, operated by paul@keymail.dev pushed by paul@keymail.dev dde07131e5a2b671db39bf3232b11fa8ee4512f0 parent 7ae493b
6 files changed, +115 −9
  • docs/superpowers/notes/census-proposal-instance-control-memory-1291.md +4 −2
  • internal/host/claimunit.go +20 −2
  • internal/host/claimunit_test.go +75 −0
  • internal/host/systemunits.go +10 −1
  • internal/provision/testdata/plan14-root-reads-chain.tsv +1 −1
  • internal/provision/testdata/plan14-root-reads-instance-control-memory-1291.tsv +5 −3

Intent

Human

<task-notification> <task-id>bxd0b8pfm</task-id> <tool-use-id>toolu_01Y7pZ1tDJcBZPBPg6HXQUTQ</tool-use-id> <output-file>/home/paulca/.cache/tmp/claude-1001/-home-paulca-amadan-net-carlos-platform/95f33cc2-8998-4fa5-abb8-8043c3daeffb/tasks/bxd0b8pfm.output</output-file> <status>completed</status> <summary>Background command "Run Astra's review of the memory fix" completed (exit code 0)</summary> </task-notification>

diff --git a/docs/superpowers/notes/census-proposal-instance-control-memory-1291.md b/docs/superpowers/notes/census-proposal-instance-control-memory-1291.md
index b1fcf5d56..ece30269c 100644
--- a/docs/superpowers/notes/census-proposal-instance-control-memory-1291.md
+++ b/docs/superpowers/notes/census-proposal-instance-control-memory-1291.md
@@ -4,7 +4,8 @@ Ruling `census-ruling-instance-control-memory-1291`. The independent reviewer ap
| unit | change | read sites | what changed |
|---|---|---|---|
-| `internal/host/claimunit.go` `claimUnitContent` | body | unchanged (1) | The demo build worker and claims memory rewrites now key on one constant, claimControlMemoryMax (MemoryMax=256M), matching the control unit (#1291); otherwise the unit change would have made them silently drop the build worker 1 GiB cap with GOMEMLIMIT=768MiB, and the claims GOMEMLIMIT. Build worker and claims renderings are unchanged from main; off and demo-box renderings carry the unit new 256M. No read, path, input or permission change. |
+| `internal/host/claimunit.go` `claimUnitContent` | body | unchanged (1) | The demo build worker and claims memory rewrites go through replaceClaimControlMemory, which matches this build line (claimControlMemoryMax, MemoryMax=256M) or v0.40.1 MemoryMax=64M (#1291, R1): system apply renders the candidate template with the installed renderer, so both versions must render. Build worker and claims renderings are unchanged from main on either template; off and demo-box renderings carry the template own value. No read, path, input or permission change. |
+| `internal/host/systemunits.go` `ensureSystemUnitsWithGuard` | body | unchanged (7) | The adopt pass controlChanged expression moved verbatim into claimControlStale so tests can drive it (#1291 R1): same inputs, same decision, same rewrite and restart. No read, path, input or permission change. |
| `internal/host/units/carlos-instance-control.service` `external` | body | unchanged (1) | MemoryMax=64M raised to 256M with a two-line comment (#1291): registry-read children share this cgroup and four overlapping starts OOM-killed control at 64M. A ceiling only; no ExecStart, path, environment, capability or protection change. No new root read. |
Envelopes re-pinned: `internal/host`, `internal/host/units`.
@@ -14,8 +15,9 @@ Review: a model from the other family than the author reads the branch's diff ag
Recorded dispositions, which each change must still satisfy:
- `internal/host/claimunit.go` `claimUnitContent`: authority, task E1,E3. Basis: rev3=PROPOSED-p3;identity=root claim/adoption controller uid 0;basis=adds write permission for exactly the public retry directory only when the root settings reader has verified a complete census and prepared that directory;rev3=census-ruling-agent-start-demo-1;basis=Demo-only ReadWritePaths for instance data/runtime, staged files and root release lock; ordinary rendering unchanged.;rev3=census-ruling-agent-start-demo-1-followups;basis=In demo box mode, declare StateDirectory=carlos-release/private with mode 0700 so systemd creates root-owned release state before namespace setup and keeps it writable. Existing ReadWritePaths and ordinary/claims rendering stay unchanged. No new read site or caller-controlled path.;rev3=census-ruling-agent-start-demo-3;basis=Declare /var/lib/carlos-demo-snapshots as root-owned StateDirectory with mode 0700 only for configured demo boxes, including recovery with admission off. Ordinary claims units retain their original directories. The shared unit template is unchanged from main; no file read is added.;rev3=census-ruling-gvisor-demos;basis=Mark only claim/demo renderings explicitly; common host.env remains loaded. Ordinary rendering masks CARLOS_HOST_CLAIM with UnsetEnvironment, removed only for a successfully parsed enabled claim rendering. Existing template read unchanged. Task 7: render aggregate build slice through SlicePropertiesFor using the resolved host mode, with 32 MiB and 64-task gVisor overhead per slot. Existing control permissions unchanged.;rev3=census-ruling-same-box-edge-fence;basis=Root unit rendering (claims mode). The control unit's families line is now `RestrictAddressFamilies=AF_UNIX AF_NETLINK`; the claims rewrite matches that line (it matched the old one exactly, and would otherwise have silently dropped AF_INET/AF_INET6) and renders `AF_UNIX AF_NETLINK AF_INET AF_INET6`. No read added; no other directive changed.
+- `internal/host/systemunits.go` `ensureSystemUnitsWithGuard`: legacy, task accepted-legacy. Basis: accepted-legacy;rev3=census-ruling-region-ha-p3b;basis=Move unit-repair body here with existing lock/unit/host.env reads; under lock require operator repair permit on groups before writes and each systemctl effect, preserve root masks/drop-in and omit automatic update/recovery units. New indirect protected marker/permit reads, never agent receipt; fixed repair unchanged.;rev3=census-ruling-gvisor-demos;basis=Create runtime/rootfs directories and repair installer plus three measured workload templates without arming them. Existing unit/host.env reads unchanged.;rev3=census-ruling-gvisor-update-dirs;basis=Create the two live sandbox directories (the same fixed ensureSandboxDirectories paths) before the apply lock and the early returns on non-group boxes; group members still create them only after the maintenance permit. A creation error still ends the pass at the original point. Then call refreshControlSandboxRootfs. No new path, input or systemctl verb beyond the try-restart below.;rev3=census-ruling-demo-slice-adopt;basis=Compare the installed carlos-demo-builds.slice (fixed root unit path, embedded unit) with its host.env rendering, and ask systemd for the slice's loaded MemoryMax/TasksMax (systemctl show on the fixed name). A definite difference is a reinstall (existing write loop + daemon-reload). No live budget change, no new path, input or write target.
- `internal/host/units/carlos-instance-control.service` `external`: authority, task B3,C,D,E1,J4. Basis: root-input;kept=B3,C,D,E1;scope=protected-decision-only;rev3=census-ruling-agent-start-demo-3;basis=Correct the runtime-write comment to include escaped demo snapshot .mount units alongside per-generation drop-ins; service directives are unchanged.;rev3=census-ruling-region-ha-graceful-terminate-t1;basis=Region HA T1/DR-4 final fix: retain After=nftables.service without Wants or Requires; add Restart=on-failure and RestartSec=1 so a crashed control restarts before a later edge stop can block socket activation and shutdown proofs; rewrap the header and explain this ordering. Same ExecStart and protections; no new root read, input, path, command or capability.;rev3=census-ruling-gvisor-demos;basis=Add Wants/After installer and narrowly writable rootfs parent. Keep one host.env EnvironmentFile and other hardening.;rev3=census-ruling-gvisor-update-dirs;basis=Make the existing /var/lib/carlos/oci-rootfs writable-path entry optional when absent so old updaters can start the new control unit; retain ProtectSystem=strict and the same path and environment. No new root read.;rev3=census-ruling-same-box-edge-fence;basis=RestrictAddressFamilies gains AF_NETLINK (nft talks netlink), with a comment; the group drop-in already granted it on group boxes. No capability, path, environment or ExecStart change. Without it nft fails and the whole #367 deny stays.
-Seal: `aa2c0729fe761d6438d2e8b9ef4ef2c1a20699f5e81dded1783c9a008dfafba9` → `aa2c0729fe761d6438d2e8b9ef4ef2c1a20699f5e81dded1783c9a008dfafba9`.
+Seal: `aa2c0729fe761d6438d2e8b9ef4ef2c1a20699f5e81dded1783c9a008dfafba9` → `70ca25987f5a18849d7ae880e30628a47475375d6dde2409a505232d78abb872`.
Overlay: `internal/provision/testdata/plan14-root-reads-instance-control-memory-1291.tsv`, appended to `internal/provision/testdata/plan14-root-reads-chain.tsv`.
diff --git a/internal/host/claimunit.go b/internal/host/claimunit.go
index 30f3f8a59..c7fde5a17 100644
--- a/internal/host/claimunit.go
+++ b/internal/host/claimunit.go
@@ -30,6 +30,24 @@ const claimControlUnset = "UnsetEnvironment=CARLOS_HOST_CLAIM\n"
// fails if the unit's line and this constant ever drift apart.
const claimControlMemoryMax = "MemoryMax=256M\n"
+// claimControlMemoryLines are the memory lines the renderer replaces: this
+// build's and v0.40.1's 64M. system apply renders the candidate's staged
+// template with the installed binary's renderer, so a rollback hands this
+// renderer the 64M template. On upgrade an older updater looks only for
+// 64M and leaves 256M as is (claims lose GOMEMLIMIT, a build worker its
+// 1 GiB): transient, as the new binary's adopt pass (ensureSystemUnits)
+// re-renders, sees the difference and rewrites and restarts control (#1291).
+var claimControlMemoryLines = []string{claimControlMemoryMax, "MemoryMax=64M\n"}
+
+func replaceClaimControlMemory(content []byte, with string) []byte {
+ for _, line := range claimControlMemoryLines {
+ if bytes.Contains(content, []byte(line)) {
+ return bytes.Replace(content, []byte(line), []byte(with), 1)
+ }
+ }
+ return content
+}
+
// Older rendered units have state directories but no explicit marker.
func claimControlRendered(content []byte) bool {
lines := append([]byte("\n"), content...)
@@ -168,7 +186,7 @@ func claimUnitContent(name string, content []byte, cfg claimUnitSettings) []byte
content = bytes.Replace(content, []byte("[Service]\n"), []byte("[Service]\nReadWritePaths=/data /run/carlos/instances /opt/carlos/live /opt/carlos/versions /var/lib/carlos-release/private\n"), 1)
if cfg.demo.BuildWorker {
content = bytes.Replace(content, []byte("[Service]\n"), []byte("[Service]\nStateDirectory=carlos-demo-builds\nStateDirectoryMode=0700\nReadWritePaths=/var/lib/carlos-demo-builds\n"), 1)
- content = bytes.Replace(content, []byte(claimControlMemoryMax), []byte("MemoryMax=1073741824\nEnvironment=GOMEMLIMIT=768MiB\n"), 1)
+ content = replaceClaimControlMemory(content, "MemoryMax=1073741824\nEnvironment=GOMEMLIMIT=768MiB\n")
}
return content
}
@@ -196,7 +214,7 @@ func claimUnitContent(name string, content []byte, cfg claimUnitSettings) []byte
// (up to 16 MiB of decoded, validated and re-marshalled rows) and the AWS
// fence pass to this process. GOMEMLIMIT makes the collector work before
// the 256M cap.
- return bytes.Replace(content, []byte(claimControlMemoryMax), []byte(claimControlMemoryMax+"Environment=GOMEMLIMIT=192MiB\n"), 1)
+ return replaceClaimControlMemory(content, claimControlMemoryMax+"Environment=GOMEMLIMIT=192MiB\n")
}
func claimControlChanged(before, after []byte) bool {
diff --git a/internal/host/claimunit_test.go b/internal/host/claimunit_test.go
index e050d8651..bfabb17a6 100644
--- a/internal/host/claimunit_test.go
+++ b/internal/host/claimunit_test.go
@@ -442,3 +442,78 @@ func TestClaimUnitMemoryReplacementsApplyToShippedUnit(t *testing.T) {
}
}
}
+
+// claimControlMemoryComment is the comment #1291 added above the memory
+// line; it and 64M are the only differences from v0.40.1's control unit.
+const claimControlMemoryComment = "# Registry-read children share this cgroup, about 10-17 MB each, so 256M\n# covers roughly twelve concurrent starts (#1291). A ceiling, not a reservation.\n"
+
+// legacyControlTemplate returns v0.40.1's control unit (origin/main 40d7a9cf),
+// rebuilt from the shipped one by undoing exactly the #1291 change.
+func legacyControlTemplate(t *testing.T) (shipped, legacy []byte) {
+ t.Helper()
+ shipped, err := unitsFS.ReadFile("units/" + claimControlUnit)
+ if err != nil {
+ t.Fatal(err)
+ }
+ current := claimControlMemoryComment + "MemoryMax=256M\n"
+ if bytes.Count(shipped, []byte(current)) != 1 {
+ t.Fatal("shipped control unit no longer carries the #1291 memory block; update this fixture")
+ }
+ return shipped, bytes.Replace(shipped, []byte(current), []byte("MemoryMax=64M\n"), 1)
+}
+
+func claimUnitMemoryModes() map[string]claimUnitSettings {
+ return map[string]claimUnitSettings{
+ "off": {},
+ "demo box": {demo: demo.Config{Account: "shop", Fleet: "demo", Domain: "example.com"}},
+ "build worker": {demo: demo.Config{Account: "shop", Fleet: "demo", Domain: "example.com", BuildWorker: true, BuildConcurrency: 1}},
+ "claims": {enabled: true, data: "/data", opt: "/opt/carlos"},
+ }
+}
+
+// Rollback direction (#1291 R1): system apply renders the candidate's staged
+// template with the installed binary's renderer, so this renderer can meet
+// v0.40.1's 64M template. Claims and the build worker must render exactly
+// what they do from this build's template; off and demo box keep the old
+// template's own 64M.
+func TestClaimUnitRendererAcceptsLegacyMemoryTemplate(t *testing.T) {
+ shipped, legacy := legacyControlTemplate(t)
+ for name, cfg := range claimUnitMemoryModes() {
+ want := strings.Replace(string(claimUnitContent(claimControlUnit, shipped, cfg)), claimControlMemoryComment, "", 1)
+ if !cfg.enabled && !cfg.demo.BuildWorker {
+ want = strings.Replace(want, "\nMemoryMax=256M\n", "\nMemoryMax=64M\n", 1)
+ }
+ if got := string(claimUnitContent(claimControlUnit, legacy, cfg)); got != want {
+ t.Errorf("%s: legacy template rendered\n%s\nwant\n%s", name, got, want)
+ }
+ }
+}
+
+// Upgrade direction (#1291 R1): a v0.40.1 updater renders this build's
+// template with its own renderer, which looks only for 64M. Claims and the
+// build worker come out wrong for a while; the new binary's adopt pass must
+// then see the installed unit as stale so it rewrites and restarts control.
+func TestClaimUnitLegacyRendererUpgradeHealsAtAdopt(t *testing.T) {
+ shipped, _ := legacyControlTemplate(t)
+ lines := claimControlMemoryLines
+ t.Cleanup(func() { claimControlMemoryLines = lines })
+ transient := map[string][]byte{}
+ claimControlMemoryLines = []string{"MemoryMax=64M\n"} // v0.40.1's single anchor
+ for name, cfg := range claimUnitMemoryModes() {
+ transient[name] = claimUnitContent(claimControlUnit, shipped, cfg)
+ }
+ claimControlMemoryLines = lines
+ for name, cfg := range claimUnitMemoryModes() {
+ wrong := cfg.enabled || cfg.demo.BuildWorker
+ got := string(transient[name])
+ if wrong && (strings.Contains(got, "GOMEMLIMIT=") || !strings.Contains(got, "\nMemoryMax=256M\n")) {
+ t.Errorf("%s: legacy renderer did not leave the 256M line unreplaced:\n%s", name, got)
+ }
+ if stale := claimControlStale(transient[name], nil, shipped, cfg, nil); stale != wrong {
+ t.Errorf("%s: adopt pass stale = %v, want %v", name, stale, wrong)
+ }
+ if claimControlStale(claimUnitContent(claimControlUnit, shipped, cfg), nil, shipped, cfg, nil) {
+ t.Errorf("%s: a current render is stale", name)
+ }
+ }
+}
diff --git a/internal/host/systemunits.go b/internal/host/systemunits.go
index 8974d711f..de81c39b0 100644
--- a/internal/host/systemunits.go
+++ b/internal/host/systemunits.go
@@ -207,7 +207,7 @@ func ensureSystemUnitsWithGuard(etcDir, lockPath string, systemctl, probe func(a
logf("adopt: instance-control unit: %v", err)
return
}
- controlChanged := settingsErr == nil && (claimSettings.enabled || claimSettings.demo.BoxMode() || claimControlRendered(installed)) && (err != nil || !bytes.Equal(installed, claimUnitContent(claimControlUnit, control, claimSettings)))
+ controlChanged := claimControlStale(installed, err, control, claimSettings, settingsErr)
// The demo build budget slice is rendered from host.env too: the build
// concurrency and the effective exec sandbox size it. A host.env change
// alone (a box switched to gVisor) touches no other unit, so without this
@@ -304,6 +304,15 @@ func ensureSystemUnitsWithGuard(etcDir, lockPath string, systemctl, probe func(a
logf("adopt: self-update units installed and armed")
}
+// claimControlStale reports whether the adopt pass must rewrite the
+// installed control unit: it is claim- or demo-rendered (or should be) and
+// differs from what this binary renders from its own template, or is
+// missing. This is what heals an older updater's render of a newer
+// template (#1291).
+func claimControlStale(installed []byte, installedErr error, control []byte, settings claimUnitSettings, settingsErr error) bool {
+ return settingsErr == nil && (settings.enabled || settings.demo.BoxMode() || claimControlRendered(installed)) && (installedErr != nil || !bytes.Equal(installed, claimUnitContent(claimControlUnit, control, settings)))
+}
+
// parseIsEnabled maps `systemctl is-enabled`'s vocabulary onto "armed for
// the next boot, or not", as probes.go's parseIsActive maps is-active's onto
// "running now". enabled and enabled-runtime are the wants-symlink states;
diff --git a/internal/provision/testdata/plan14-root-reads-chain.tsv b/internal/provision/testdata/plan14-root-reads-chain.tsv
index 3f0f926b5..8119dbae5 100644
--- a/internal/provision/testdata/plan14-root-reads-chain.tsv
+++ b/internal/provision/testdata/plan14-root-reads-chain.tsv
@@ -257,4 +257,4 @@ plan14-root-reads-ha-generations.tsv 5bf2d00767807be812b004a474352ec184788be3ce6
plan14-root-reads-named-units-param-114.tsv 8daea28ba9b419e8680e8eb0d44a577c68ec01e02663a878288441dc579cc9f7
plan14-root-reads-race-activator-1249.tsv 879cc401365966a2ca23962245ce9dff4b7879fe7a27b7691c3d91a4e70ff6e8
plan14-root-reads-named-units-guard-fix.tsv aa2c0729fe761d6438d2e8b9ef4ef2c1a20699f5e81dded1783c9a008dfafba9
-plan14-root-reads-instance-control-memory-1291.tsv aa2c0729fe761d6438d2e8b9ef4ef2c1a20699f5e81dded1783c9a008dfafba9
+plan14-root-reads-instance-control-memory-1291.tsv 70ca25987f5a18849d7ae880e30628a47475375d6dde2409a505232d78abb872
diff --git a/internal/provision/testdata/plan14-root-reads-instance-control-memory-1291.tsv b/internal/provision/testdata/plan14-root-reads-instance-control-memory-1291.tsv
index e3edb6c5c..4ec91776d 100644
--- a/internal/provision/testdata/plan14-root-reads-instance-control-memory-1291.tsv
+++ b/internal/provision/testdata/plan14-root-reads-instance-control-memory-1291.tsv
@@ -1,6 +1,8 @@
# Census overlay instance-control-memory-1291, written by census-propose (#369). census-ruling-instance-control-memory-1291, approved on #280 before the merge; the approval card is docs/superpowers/notes/census-proposal-instance-control-memory-1291.md.
-# 2 body, 0 sites, 2 envelope: each changed unit re-frozen at its existing disposition with its claim appended.
-internal/host/claimunit.go claimUnitContent authority E1,E3 rev3=PROPOSED-p3;identity=root claim/adoption controller uid 0;basis=adds write permission for exactly the public retry directory only when the root settings reader has verified a complete census and prepared that directory;rev3=census-ruling-agent-start-demo-1;basis=Demo-only ReadWritePaths for instance data/runtime, staged files and root release lock; ordinary rendering unchanged.;rev3=census-ruling-agent-start-demo-1-followups;basis=In demo box mode, declare StateDirectory=carlos-release/private with mode 0700 so systemd creates root-owned release state before namespace setup and keeps it writable. Existing ReadWritePaths and ordinary/claims rendering stay unchanged. No new read site or caller-controlled path.;rev3=census-ruling-agent-start-demo-3;basis=Declare /var/lib/carlos-demo-snapshots as root-owned StateDirectory with mode 0700 only for configured demo boxes, including recovery with admission off. Ordinary claims units retain their original directories. The shared unit template is unchanged from main; no file read is added.;rev3=census-ruling-gvisor-demos;basis=Mark only claim/demo renderings explicitly; common host.env remains loaded. Ordinary rendering masks CARLOS_HOST_CLAIM with UnsetEnvironment, removed only for a successfully parsed enabled claim rendering. Existing template read unchanged. Task 7: render aggregate build slice through SlicePropertiesFor using the resolved host mode, with 32 MiB and 64-task gVisor overhead per slot. Existing control permissions unchanged.;rev3=census-ruling-same-box-edge-fence;basis=Root unit rendering (claims mode). The control unit's families line is now `RestrictAddressFamilies=AF_UNIX AF_NETLINK`; the claims rewrite matches that line (it matched the old one exactly, and would otherwise have silently dropped AF_INET/AF_INET6) and renders `AF_UNIX AF_NETLINK AF_INET AF_INET6`. No read added; no other directive changed.;rev3=census-ruling-instance-control-memory-1291;basis=The demo build worker and claims memory rewrites now key on one constant, claimControlMemoryMax (MemoryMax=256M), matching the control unit (#1291); otherwise the unit change would have made them silently drop the build worker 1 GiB cap with GOMEMLIMIT=768MiB, and the claims GOMEMLIMIT. Build worker and claims renderings are unchanged from main; off and demo-box renderings carry the unit new 256M. No read, path, input or permission change. data-literal@1504 ce41a99eb192c8c4285750ac5bbdb028eaebfc38f3362aff8c8babadf67ed255
+# 3 body, 0 sites, 2 envelope: each changed unit re-frozen at its existing disposition with its claim appended.
+@legacy f3f002d480ed0795879a3bf57eb48d676a525ffd0060885557c674b166921a84 internal/host/systemunits.go ensureSystemUnitsWithGuard legacy accepted-legacy accepted-legacy;rev3=census-ruling-region-ha-p3b;basis=Move unit-repair body here with existing lock/unit/host.env reads; under lock require operator repair permit on groups before writes and each systemctl effect, preserve root masks/drop-in and omit automatic update/recovery units. New indirect protected marker/permit reads, never agent receipt; fixed repair unchanged.;rev3=census-ruling-gvisor-demos;basis=Create runtime/rootfs directories and repair installer plus three measured workload templates without arming them. Existing unit/host.env reads unchanged.;rev3=census-ruling-gvisor-update-dirs;basis=Create the two live sandbox directories (the same fixed ensureSandboxDirectories paths) before the apply lock and the early returns on non-group boxes; group members still create them only after the maintenance permit. A creation error still ends the pass at the original point. Then call refreshControlSandboxRootfs. No new path, input or systemctl verb beyond the try-restart below.;rev3=census-ruling-demo-slice-adopt;basis=Compare the installed carlos-demo-builds.slice (fixed root unit path, embedded unit) with its host.env rendering, and ask systemd for the slice's loaded MemoryMax/TasksMax (systemctl show on the fixed name). A definite difference is a reinstall (existing write loop + daemon-reload). No live budget change, no new path, input or write target.;rev3=census-ruling-instance-control-memory-1291;basis=The adopt pass controlChanged expression moved verbatim into claimControlStale so tests can drive it (#1291 R1): same inputs, same decision, same rewrite and restart. No read, path, input or permission change. file:OpenFile@985,file:ReadFile@5626,file:ReadFile@5759,file:ReadFile@6502,file:ReadFile@6644,file:ReadFile@8403,file:Stat@5535 4ec15721391b0165591a749932b27f2d2afe642c47e1c383be7bde419b510d8c
+internal/host/claimunit.go claimUnitContent authority E1,E3 rev3=PROPOSED-p3;identity=root claim/adoption controller uid 0;basis=adds write permission for exactly the public retry directory only when the root settings reader has verified a complete census and prepared that directory;rev3=census-ruling-agent-start-demo-1;basis=Demo-only ReadWritePaths for instance data/runtime, staged files and root release lock; ordinary rendering unchanged.;rev3=census-ruling-agent-start-demo-1-followups;basis=In demo box mode, declare StateDirectory=carlos-release/private with mode 0700 so systemd creates root-owned release state before namespace setup and keeps it writable. Existing ReadWritePaths and ordinary/claims rendering stay unchanged. No new read site or caller-controlled path.;rev3=census-ruling-agent-start-demo-3;basis=Declare /var/lib/carlos-demo-snapshots as root-owned StateDirectory with mode 0700 only for configured demo boxes, including recovery with admission off. Ordinary claims units retain their original directories. The shared unit template is unchanged from main; no file read is added.;rev3=census-ruling-gvisor-demos;basis=Mark only claim/demo renderings explicitly; common host.env remains loaded. Ordinary rendering masks CARLOS_HOST_CLAIM with UnsetEnvironment, removed only for a successfully parsed enabled claim rendering. Existing template read unchanged. Task 7: render aggregate build slice through SlicePropertiesFor using the resolved host mode, with 32 MiB and 64-task gVisor overhead per slot. Existing control permissions unchanged.;rev3=census-ruling-same-box-edge-fence;basis=Root unit rendering (claims mode). The control unit's families line is now `RestrictAddressFamilies=AF_UNIX AF_NETLINK`; the claims rewrite matches that line (it matched the old one exactly, and would otherwise have silently dropped AF_INET/AF_INET6) and renders `AF_UNIX AF_NETLINK AF_INET AF_INET6`. No read added; no other directive changed.;rev3=census-ruling-instance-control-memory-1291;basis=The demo build worker and claims memory rewrites go through replaceClaimControlMemory, which matches this build line (claimControlMemoryMax, MemoryMax=256M) or v0.40.1 MemoryMax=64M (#1291, R1): system apply renders the candidate template with the installed renderer, so both versions must render. Build worker and claims renderings are unchanged from main on either template; off and demo-box renderings carry the template own value. No read, path, input or permission change. data-literal@1504 02d0f82424f04cc7059d5261003a3d3bcc972f73cdbf38e41a7e5536d1dedf4d
+internal/host/systemunits.go ensureSystemUnitsWithGuard legacy accepted-legacy accepted-legacy;rev3=census-ruling-region-ha-p3b;basis=Move unit-repair body here with existing lock/unit/host.env reads; under lock require operator repair permit on groups before writes and each systemctl effect, preserve root masks/drop-in and omit automatic update/recovery units. New indirect protected marker/permit reads, never agent receipt; fixed repair unchanged.;rev3=census-ruling-gvisor-demos;basis=Create runtime/rootfs directories and repair installer plus three measured workload templates without arming them. Existing unit/host.env reads unchanged.;rev3=census-ruling-gvisor-update-dirs;basis=Create the two live sandbox directories (the same fixed ensureSandboxDirectories paths) before the apply lock and the early returns on non-group boxes; group members still create them only after the maintenance permit. A creation error still ends the pass at the original point. Then call refreshControlSandboxRootfs. No new path, input or systemctl verb beyond the try-restart below.;rev3=census-ruling-demo-slice-adopt;basis=Compare the installed carlos-demo-builds.slice (fixed root unit path, embedded unit) with its host.env rendering, and ask systemd for the slice's loaded MemoryMax/TasksMax (systemctl show on the fixed name). A definite difference is a reinstall (existing write loop + daemon-reload). No live budget change, no new path, input or write target.;rev3=census-ruling-instance-control-memory-1291;basis=The adopt pass controlChanged expression moved verbatim into claimControlStale so tests can drive it (#1291 R1): same inputs, same decision, same rewrite and restart. No read, path, input or permission change. file:OpenFile@985,file:ReadFile@5626,file:ReadFile@5759,file:ReadFile@6502,file:ReadFile@6644,file:ReadFile@8403,file:Stat@5535 4ec15721391b0165591a749932b27f2d2afe642c47e1c383be7bde419b510d8c
internal/host/units/carlos-instance-control.service external authority B3,C,D,E1,J4 root-input;kept=B3,C,D,E1;scope=protected-decision-only;rev3=census-ruling-agent-start-demo-3;basis=Correct the runtime-write comment to include escaped demo snapshot .mount units alongside per-generation drop-ins; service directives are unchanged.;rev3=census-ruling-region-ha-graceful-terminate-t1;basis=Region HA T1/DR-4 final fix: retain After=nftables.service without Wants or Requires; add Restart=on-failure and RestartSec=1 so a crashed control restarts before a later edge stop can block socket activation and shutdown proofs; rewrap the header and explain this ordering. Same ExecStart and protections; no new root read, input, path, command or capability.;rev3=census-ruling-gvisor-demos;basis=Add Wants/After installer and narrowly writable rootfs parent. Keep one host.env EnvironmentFile and other hardening.;rev3=census-ruling-gvisor-update-dirs;basis=Make the existing /var/lib/carlos/oci-rootfs writable-path entry optional when absent so old updaters can start the new control unit; retain ProtectSystem=strict and the same path and environment. No new root read.;rev3=census-ruling-same-box-edge-fence;basis=RestrictAddressFamilies gains AF_NETLINK (nft talks netlink), with a comment; the group drop-in already granted it on group boxes. No capability, path, environment or ExecStart change. Without it nft fails and the whole #367 deny stays.;rev3=census-ruling-instance-control-memory-1291;basis=MemoryMax=64M raised to 256M with a two-line comment (#1291): registry-read children share this cgroup and four overlapping starts OOM-killed control at 64M. A ceiling only; no ExecStart, path, environment, capability or protection change. No new root read. file:external@0 4a09e4936244d92b52ca9014cc9e5b6bfe3f3fb7dd30ea357097e959f493f62b
-@coverage internal/host b98ace9629286aef475231eb30740899269f77d63abf8699aa1e0fe74d2364d4
+@coverage internal/host 25bba4d425aa44f37ede40bb37ec95e1bdae284d6889457cae456dbc7bc6727e
@coverage internal/host/units 73ac9551af5c339f0217789cad60c4661e4e2d101573ad80a1dbcca896084ebf