carlos / platform Public

named units: correct the pickup and put wording (rehearsal finding)

A config write starts root's pass only for an app that runs as a named unit on that box, so a first declaration waits for the hourly pass; put checks format and fields, the box checks the console guard. Reason text for an untrusted guard chain shortened. Copy: Luna (delegated); its 'this app' corrected to 'the app you write to' (put has no app). Census re-proposed (envelopes only).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
claude agent, operated by paul@keymail.dev pushed by paul@keymail.dev 933016ff8748007c2678033242ce4e351bfa8ce1 parent b247fe7
9 files changed, +34 −17
  • docs/site/cli.md +7 −5
  • docs/superpowers/notes/census-proposal-named-units-guard-fix.md +2 −2
  • docs/superpowers/reviews/LUNA-COPY-RESULT-named-units-guard-fix.md +6 −0
  • docs/superpowers/reviews/named-units-guard-fix-copy-deck.md +8 −0
  • internal/host/unitops.go +1 −1
  • internal/provision/testdata/plan14-root-reads-chain.tsv +1 −1
  • internal/provision/testdata/plan14-root-reads-named-units-guard-fix.tsv +7 −6
  • system_namedunits.go +1 −1
  • system_namedunits_test.go +1 −1

CI cancelled — superseded by a newer push — run details

diff --git a/docs/site/cli.md b/docs/site/cli.md
index de570b33e..cf2f6d58e 100644
--- a/docs/site/cli.md
+++ b/docs/site/cli.md
@@ -3351,16 +3351,18 @@ exist, the installed file stays as it is.
`carlos system named-units put` checks a declaration file, then writes
it to the box's parameter with your AWS profile. You need
-`ssm:PutParameter` on that path. You do not need root. A file that would
-fail on the box is refused before anything is written. `--aws-region`
-must be the box's region; without it, your profile's region is used.
+`ssm:PutParameter` on that path. You do not need root. `put` checks
+only the file's format and fields. The box checks the console-guard rule
+separately. `--aws-region` must be the box's region; without it, your
+profile's region is used.
```sh
carlos system named-units put --instance i-0abc1234def567890 --aws-region eu-west-1 named-units.json
```
-The box installs it on its next config pass (any config write to an app
-on that box starts one) or within the hour. To clear a box's units,
+The box installs it on its next config pass, within the hour. A config
+write starts an earlier pass only when the app you write to runs as a
+named unit on that box. To clear a box's units,
put `{"schema":1,"units":[]}`. Deleting the parameter does not clear
them: the box keeps the file it has.
diff --git a/docs/superpowers/notes/census-proposal-named-units-guard-fix.md b/docs/superpowers/notes/census-proposal-named-units-guard-fix.md
index d48048ae7..92db4d093 100644
--- a/docs/superpowers/notes/census-proposal-named-units-guard-fix.md
+++ b/docs/superpowers/notes/census-proposal-named-units-guard-fix.md
@@ -7,7 +7,7 @@ Ruling `census-ruling-named-units-guard-fix`. The independent reviewer approves
| `internal/host/unitops.go` `RunSystemNamedUnitsInstall` | body | unchanged (1) | InstallNamedUnits now also returns the unguarded reason; the verb prints it beside the installed path. No new read |
| `internal/host/unitops.go` `consoleGuardHost` | body | unchanged (1) | the guard read now distinguishes an untrusted chain, which is treated as unguarded (Paul's ruling 2026-11-19): it walks <opt>/system/guard first with rootstate.OpenTrustedDir (same root-trusted walk as before); os.ErrPermission from that walk is ok=false, no error, with an unguarded reason; absent is ok=false as before; then it opens console-ready.json in the walked directory with rootstate.OpenTrustedFileIn (same file checks as OpenTrustedFile: no symlink, root-owned, one link, not group/other-writable) and an untrusted, oversized or hostless marker still refuses. No new read: the same marker through the same checks, split in two |
-Envelopes re-pinned: `internal/host`, `internal/rootstate`.
+Envelopes re-pinned: `.`, `internal/host`, `internal/rootstate`.
Review: a model from the other family than the author reads the branch's diff against main on the amadan.net remote (`origin` or `amadan`, whichever points at amadan.net) and gives a verdict for every unit and every re-pinned envelope above. For a unit, compare the change with its recorded disposition and basis below; for an envelope, read every changed function in the package and what it reaches. Reject if the change lets root open, run, query or follow anything it did not before from a path or input a tenant, an app or a box agent can create, write or name; if it weakens a check, refusal, validation, argument or environment the basis relies on; or if the diff cannot settle either. Otherwise approve. Record each verdict on #280 with the tip. A rejected unit goes back to the author to correct; nothing escalates to the census owner.
@@ -21,6 +21,6 @@ New dispositions, which census-propose wrote and the reviewer checks against the
- new `internal/rootstate/file_linux.go:OpenTrustedDir`: reads +file:Open; written legacy, accepted-legacy, frozen
- new `internal/rootstate/file_linux.go:OpenTrustedFileIn`: reads +file:Fstat; written legacy, accepted-legacy, frozen
-Seal: `879cc401365966a2ca23962245ce9dff4b7879fe7a27b7691c3d91a4e70ff6e8` → `39c41bd9c393bebfd68a1c48abf6f25c0d701615445f9085952790ba9178a04b`.
+Seal: `879cc401365966a2ca23962245ce9dff4b7879fe7a27b7691c3d91a4e70ff6e8` → `aa2c0729fe761d6438d2e8b9ef4ef2c1a20699f5e81dded1783c9a008dfafba9`.
Overlay: `internal/provision/testdata/plan14-root-reads-named-units-guard-fix.tsv`, appended to `internal/provision/testdata/plan14-root-reads-chain.tsv`.
diff --git a/docs/superpowers/reviews/LUNA-COPY-RESULT-named-units-guard-fix.md b/docs/superpowers/reviews/LUNA-COPY-RESULT-named-units-guard-fix.md
new file mode 100644
index 000000000..9b342b12d
--- /dev/null
+++ b/docs/superpowers/reviews/LUNA-COPY-RESULT-named-units-guard-fix.md
@@ -0,0 +1,6 @@
+| id | new text | why |
+|---|---|---|
+| G-1 | console guard not readable here, so treated as unguarded | Plain lower-case reason. |
+| G-2 | The box installs it on its next config pass, within the hour. A config write starts an earlier pass only when this app runs as a named unit on that box. | Matches the hourly pass and unit-backed route. |
+| G-3 | `put` checks only the file's format and fields. The box checks the console-guard rule separately. | Removes the false claim that `put` checks the box's rule before writing. |
+| G-4 | The box installs it on its next config pass, within the hour. A config write starts an earlier pass only when this app runs as a named unit on that box. | Matches the hourly pass and unit-backed route. |
\ No newline at end of file
diff --git a/docs/superpowers/reviews/named-units-guard-fix-copy-deck.md b/docs/superpowers/reviews/named-units-guard-fix-copy-deck.md
new file mode 100644
index 000000000..fd93654a6
--- /dev/null
+++ b/docs/superpowers/reviews/named-units-guard-fix-copy-deck.md
@@ -0,0 +1,8 @@
+Feature: an operator writes a fixed box's named-unit declarations to an AWS SSM parameter; root on the box reads it on its own passes and installs it. Readers: platform operators in a terminal. Facts: root's full pass runs hourly (carlos-adopt.timer); a config write only starts an earlier pass when the write's app runs as a named unit on that box (a unit-backed route). `put` checks the file's format and fields only; the box additionally checks the console-guard rule, if it has an armed console guard. On some boxes the directory holding the guard marker isn't root-only, so root can't trust it, and the box is treated as having no guard.
+
+| id | where | current text |
+|---|---|---|
+| G-1 | reason in `named-units show` and the box journal | console guard not readable here (an ancestor directory is not root-owned), treated as unguarded |
+| G-2 | line printed by `put` after writing | The box installs it on its next config pass (any config write to an app on that box starts one) or within the hour. |
+| G-3 | docs sentence (cli.md, put paragraph) | A file that would fail on the box is refused before anything is written. |
+| G-4 | docs sentence (cli.md, pickup paragraph; keep the rest of the paragraph) | The box installs it on its next config pass (any config write to an app on that box starts one) or within the hour. |
diff --git a/internal/host/unitops.go b/internal/host/unitops.go
index 19c68f955..6ba84fb57 100644
--- a/internal/host/unitops.go
+++ b/internal/host/unitops.go
@@ -164,7 +164,7 @@ var openConsoleGuardDir = rootstate.OpenTrustedDir
// consoleGuardUntrustedChain is consoleGuardHost's unguarded reason for a
// box whose directory chain to the marker fails the trust walk.
-const consoleGuardUntrustedChain = "console guard not readable here (an ancestor directory is not root-owned), treated as unguarded"
+const consoleGuardUntrustedChain = "console guard not readable here, so treated as unguarded"
// consoleGuardHost is for the install callers only; proofnamed.go keeps its
// own read, its error handling and its binding evidence. A trusted read of
diff --git a/internal/provision/testdata/plan14-root-reads-chain.tsv b/internal/provision/testdata/plan14-root-reads-chain.tsv
index 8caa517e0..87f1ac29c 100644
--- a/internal/provision/testdata/plan14-root-reads-chain.tsv
+++ b/internal/provision/testdata/plan14-root-reads-chain.tsv
@@ -256,4 +256,4 @@ plan14-root-reads-flake-lease-teardown.tsv 5d4a5eea79394145fdd59aa5eb87115cc1ee3
plan14-root-reads-ha-generations.tsv 5bf2d00767807be812b004a474352ec184788be3ce65607a45c37b04956714a2
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 39c41bd9c393bebfd68a1c48abf6f25c0d701615445f9085952790ba9178a04b
+plan14-root-reads-named-units-guard-fix.tsv aa2c0729fe761d6438d2e8b9ef4ef2c1a20699f5e81dded1783c9a008dfafba9
diff --git a/internal/provision/testdata/plan14-root-reads-named-units-guard-fix.tsv b/internal/provision/testdata/plan14-root-reads-named-units-guard-fix.tsv
index 8bf02b069..6992f2c09 100644
--- a/internal/provision/testdata/plan14-root-reads-named-units-guard-fix.tsv
+++ b/internal/provision/testdata/plan14-root-reads-named-units-guard-fix.tsv
@@ -1,13 +1,14 @@
# Census overlay named-units-guard-fix, written by census-propose (#369). census-ruling-named-units-guard-fix, approved on #280 before the merge; the approval card is docs/superpowers/notes/census-proposal-named-units-guard-fix.md.
-# 2 body, 0 sites, 2 envelope: each changed unit re-frozen at its existing disposition with its claim appended.
+# 2 body, 0 sites, 3 envelope: each changed unit re-frozen at its existing disposition with its claim appended.
# 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 460768a56c895733c6e75efa36f0f9c80d8edd8cd7eea6a79cd99560312e44f0 internal/host/unitops.go RunSystemNamedUnitsInstall legacy accepted-legacy accepted-legacy;rev3=census-ruling-named-units-param-114;basis=new (Task 7, renamed from RunSystemNamedUnits): carlos system named-units install <file>: refuses unless euid 0, reads the operator-given <file> by root's own choice at the command line and hands it to InstallNamedUnits, which now also runs both decoders and the console guard rule under the lock;rev3=census-ruling-named-units-guard-fix;basis=InstallNamedUnits now also returns the unguarded reason; the verb prints it beside the installed path. No new read file:ReadFile@278 03ab2984b8866a2a590a9867cf8b04fd1af853e1286b654c5f992ac46afa1c10
@legacy 52bd09a6e1493f6816db6ca3ff4875fa7912f0f853df4253b0ae95daf70d19c6 internal/host/unitops.go consoleGuardHost legacy accepted-legacy accepted-legacy;rev3=census-ruling-named-units-param-114;basis=new (Task 2/4): root's trusted read (rootstate.OpenTrustedFile, MaxRecord cap) of <opt>/system/guard/console-ready.json, the marker root's guard-arm writes; absent is unguarded, any other failure or a marker naming no valid live host is an error that refuses the install; the host is taken only when the bytes equal release.LiveLink(opt, host);rev3=census-ruling-named-units-guard-fix;basis=the guard read now distinguishes an untrusted chain, which is treated as unguarded (Paul's ruling 2026-11-19): it walks <opt>/system/guard first with rootstate.OpenTrustedDir (same root-trusted walk as before); os.ErrPermission from that walk is ok=false, no error, with an unguarded reason; absent is ok=false as before; then it opens console-ready.json in the walked directory with rootstate.OpenTrustedFileIn (same file checks as OpenTrustedFile: no symlink, root-owned, one link, not group/other-writable) and an untrusted, oversized or hostless marker still refuses. No new read: the same marker through the same checks, split in two file:ReadAll@623 e7372aa14ec47f8b6deb88f20c8a8d15cccab06c7d6b0db7589ac85b6dfc23e6
-@legacy fd0ef2ab251290b608f54ff6b03a2f6df56d638b43b7da33aeb13185815bd006 internal/rootstate/file_linux.go OpenTrustedDir legacy accepted-legacy accepted-legacy;rev3=census-ruling-named-units-guard-fix;basis=new: OpenTrustedFile's directory walk on its own (Open(path, false, true), every directory from / root-owned, not group/other-writable, r-x for both), returning the directory's descriptor; reads nothing new file:Open@64 de0f8222d4721aa93a5588b7cdb9953700c970a9c467d74ad6bc0fb72b378d33
-@legacy e3755aca1755d5cd80b474d720c4c7ea73f0bc12890220d75219f65ed516f58a internal/rootstate/file_linux.go OpenTrustedFileIn legacy accepted-legacy accepted-legacy;rev3=census-ruling-named-units-guard-fix;basis=new: OpenTrustedFile's file half: opens one name in a descriptor OpenTrustedDir or OpenTrustedDirFrom returned, through safefile.OpenFileAt (O_NOFOLLOW, regular, one link) and trusted() against the directory's owner (root for OpenTrustedDir); reads nothing new file:Fstat@101 988166d41e2f4702db8df21a2c56dad5b8d7fd0e34dc9ee0a76f5a501a22a842
+@legacy bb1e7584c8e088b68f36d4c71c40734308624b42a3928d09a9b65a262bfc4bb2 internal/rootstate/file_linux.go OpenTrustedDir legacy accepted-legacy accepted-legacy;rev3=census-ruling-named-units-guard-fix;basis=new: the directory half of OpenTrustedFile, the same trusted walk (root-owned, not group/other-writable, r-x for group and others) from / to dir, returning the directory descriptor; no other read file:Open@64 de0f8222d4721aa93a5588b7cdb9953700c970a9c467d74ad6bc0fb72b378d33
+@legacy 34eeabb86db74ab9a38a9c8680fd72e475d3436d2a20de032cb05cd98881e829 internal/rootstate/file_linux.go OpenTrustedFileIn legacy accepted-legacy accepted-legacy;rev3=census-ruling-named-units-guard-fix;basis=new: the file half of OpenTrustedFile: opens a name inside a trusted directory descriptor with O_NOFOLLOW and requires a root-owned regular file, one link, not group/other-writable; no other read file:Fstat@101 988166d41e2f4702db8df21a2c56dad5b8d7fd0e34dc9ee0a76f5a501a22a842
internal/host/unitops.go RunSystemNamedUnitsInstall legacy accepted-legacy accepted-legacy;rev3=census-ruling-named-units-param-114;basis=new (Task 7, renamed from RunSystemNamedUnits): carlos system named-units install <file>: refuses unless euid 0, reads the operator-given <file> by root's own choice at the command line and hands it to InstallNamedUnits, which now also runs both decoders and the console guard rule under the lock;rev3=census-ruling-named-units-guard-fix;basis=InstallNamedUnits now also returns the unguarded reason; the verb prints it beside the installed path. No new read file:ReadFile@278 03ab2984b8866a2a590a9867cf8b04fd1af853e1286b654c5f992ac46afa1c10
internal/host/unitops.go consoleGuardHost legacy accepted-legacy accepted-legacy;rev3=census-ruling-named-units-param-114;basis=new (Task 2/4): root's trusted read (rootstate.OpenTrustedFile, MaxRecord cap) of <opt>/system/guard/console-ready.json, the marker root's guard-arm writes; absent is unguarded, any other failure or a marker naming no valid live host is an error that refuses the install; the host is taken only when the bytes equal release.LiveLink(opt, host);rev3=census-ruling-named-units-guard-fix;basis=the guard read now distinguishes an untrusted chain, which is treated as unguarded (Paul's ruling 2026-11-19): it walks <opt>/system/guard first with rootstate.OpenTrustedDir (same root-trusted walk as before); os.ErrPermission from that walk is ok=false, no error, with an unguarded reason; absent is ok=false as before; then it opens console-ready.json in the walked directory with rootstate.OpenTrustedFileIn (same file checks as OpenTrustedFile: no symlink, root-owned, one link, not group/other-writable) and an untrusted, oversized or hostless marker still refuses. No new read: the same marker through the same checks, split in two file:ReadAll@623 e7372aa14ec47f8b6deb88f20c8a8d15cccab06c7d6b0db7589ac85b6dfc23e6
-internal/rootstate/file_linux.go OpenTrustedDir legacy accepted-legacy accepted-legacy;rev3=census-ruling-named-units-guard-fix;basis=new: OpenTrustedFile's directory walk on its own (Open(path, false, true), every directory from / root-owned, not group/other-writable, r-x for both), returning the directory's descriptor; reads nothing new file:Open@64 de0f8222d4721aa93a5588b7cdb9953700c970a9c467d74ad6bc0fb72b378d33
-internal/rootstate/file_linux.go OpenTrustedFileIn legacy accepted-legacy accepted-legacy;rev3=census-ruling-named-units-guard-fix;basis=new: OpenTrustedFile's file half: opens one name in a descriptor OpenTrustedDir or OpenTrustedDirFrom returned, through safefile.OpenFileAt (O_NOFOLLOW, regular, one link) and trusted() against the directory's owner (root for OpenTrustedDir); reads nothing new file:Fstat@101 988166d41e2f4702db8df21a2c56dad5b8d7fd0e34dc9ee0a76f5a501a22a842
-@coverage internal/host 00220429cf36f35b91261358f6748fe08aeae19defa5562f93ef749bb10ec53a
+internal/rootstate/file_linux.go OpenTrustedDir legacy accepted-legacy accepted-legacy;rev3=census-ruling-named-units-guard-fix;basis=new: the directory half of OpenTrustedFile, the same trusted walk (root-owned, not group/other-writable, r-x for group and others) from / to dir, returning the directory descriptor; no other read file:Open@64 de0f8222d4721aa93a5588b7cdb9953700c970a9c467d74ad6bc0fb72b378d33
+internal/rootstate/file_linux.go OpenTrustedFileIn legacy accepted-legacy accepted-legacy;rev3=census-ruling-named-units-guard-fix;basis=new: the file half of OpenTrustedFile: opens a name inside a trusted directory descriptor with O_NOFOLLOW and requires a root-owned regular file, one link, not group/other-writable; no other read file:Fstat@101 988166d41e2f4702db8df21a2c56dad5b8d7fd0e34dc9ee0a76f5a501a22a842
+@coverage . b26a2fbc95e2325125f3fd52a3abd1db269e562a52a0faccee76b995670b9657
+@coverage internal/host 5d386497a965577b76c5e5b6d357bad9f9c35320d455f9d6b8e8bd2b2943fe58
@coverage internal/rootstate fa81cd055bfc3b6f0c19075b65ada2e0798cf14ca6ecb4ff8657159e915fd6d4
diff --git a/system_namedunits.go b/system_namedunits.go
index 8553698a8..6b027cca6 100644
--- a/system_namedunits.go
+++ b/system_namedunits.go
@@ -43,7 +43,7 @@ const namedUnitsUsage = `usage: carlos system named-units install <file>
// namedUnitsPickup is the line put prints after a write: when the box
// takes the value.
-const namedUnitsPickup = "The box installs it on its next config pass (any config write to an app on that box starts one) or within the hour."
+const namedUnitsPickup = "The box installs it on its next config pass, within the hour. A config write starts an earlier pass only when the app you write to runs as a named unit on that box."
// namedUnitsOutcomeText says what each outcome in root's record means.
var namedUnitsOutcomeText = map[string]string{
diff --git a/system_namedunits_test.go b/system_namedunits_test.go
index 6c6ea9edd..20f759e16 100644
--- a/system_namedunits_test.go
+++ b/system_namedunits_test.go
@@ -128,7 +128,7 @@ func TestNamedUnitsPutPrintsPathVersionAndPickup(t *testing.T) {
"/carlos/host/named-units/" + testIID,
"version 3",
"eu-west-1",
- "box installs it on its next config pass (any config write to an app on that box starts one) or within the hour",
+ "box installs it on its next config pass, within the hour. A config write starts an earlier pass only when the app you write to runs as a named unit on that box",
"carlos system named-units show --instance " + testIID,
} {
if !strings.Contains(s, want) {