carlos / platform Public

review: named-units copy deck and Luna's delegated pass

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
claude agent, operated by paul@keymail.dev pushed by paul@keymail.dev 75f55b27dc342b88d48ca106617ffb1ea1317439 parent 19be189
3 files changed, +187 −0
  • docs/superpowers/reviews/LUNA-COPY-BRIEF-named-units-param-114.md +17 −0
  • docs/superpowers/reviews/LUNA-COPY-RESULT-named-units-param-114.md +75 −0
  • docs/superpowers/reviews/named-units-param-114-copy-deck.md +95 −0
diff --git a/docs/superpowers/reviews/LUNA-COPY-BRIEF-named-units-param-114.md b/docs/superpowers/reviews/LUNA-COPY-BRIEF-named-units-param-114.md
new file mode 100644
index 000000000..41a8d0f88
--- /dev/null
+++ b/docs/superpowers/reviews/LUNA-COPY-BRIEF-named-units-param-114.md
@@ -0,0 +1,17 @@
+You are the copy-review gate itself for this set. Paul delegated copy review of platform CLI, operator and docs copy to you on 2026-10-25; your verdicts ARE the review. Do NOT run the copy-review skill or start any server. You are writing a review report into a file.
+
+Read docs/superpowers/reviews/named-units-param-114-copy-deck.md (the deck) and, for facts, docs/superpowers/specs/2026-11-19-named-units-from-parameters-design.md. Do not edit any other file.
+
+House rules (Paul's):
+- Plain, direct voice. No jargon a platform operator would not know; no throat-clearing.
+- No em dashes or en dashes anywhere. Use commas, colons, full stops or parentheses.
+- CLI output and errors are plain ASCII (straight quotes). Errors and refusals after a "prefix: " start lower-case, as the rest of this CLI does; full-sentence notices start with a capital.
+- Docs prose (NU-D rows) may use curly quotes for quoted words, but code spans keep straight characters.
+- Keep every <placeholder>, flag, path, JSON literal and command exactly.
+- Neutral examples only (shop, example.com); never a customer name.
+- Say what happened and what to do next, where the reader must act.
+- Do not change facts. If a string contradicts the spec, flag it rather than inventing.
+
+Write your result to docs/superpowers/reviews/LUNA-COPY-RESULT-named-units-param-114.md as:
+1. A table | id | new text | why |, one row per deck id, in deck order. Write "unchanged" in new text when you keep it.
+2. A "Flags for Paul" list: only fact conflicts, unclear placeholders or choices you genuinely could not make. Empty if none.
diff --git a/docs/superpowers/reviews/LUNA-COPY-RESULT-named-units-param-114.md b/docs/superpowers/reviews/LUNA-COPY-RESULT-named-units-param-114.md
new file mode 100644
index 000000000..d1ee63b24
--- /dev/null
+++ b/docs/superpowers/reviews/LUNA-COPY-RESULT-named-units-param-114.md
@@ -0,0 +1,75 @@
+# Luna copy result
+
+| id | new text | why |
+|---|---|---|
+| NU-H01 | unchanged | Clear usage summary; placeholders and commands stay exact. |
+| NU-H02 | install <file> as this box's /etc/carlos/named-units.json. Run it on the box as root. | Removes an unnecessary comma and keeps the action and requirement direct. |
+| NU-H03 | check <file>, then write it to the box's parameter, /carlos/host/named-units/<id>, using your AWS profile. | Makes the sequence and credential requirement explicit. |
+| NU-H04 | print the box's parameter and its last report. | Shorter and clearer. |
+| NU-H05 | unchanged | The example and required flag are clear. |
+| NU-H06 | the AWS region where the box runs (default: your AWS profile's region) | More direct wording without changing the default. |
+| NU-H07 | unchanged | Clear source selection for the report. |
+| NU-H08 | A fixed box's named units (see carlos system named-units help): | Clear section heading. |
+| NU-H09 | unchanged | Clear command summary. |
+| NU-H10 | unchanged | Clear command summary. |
+| NU-H11 | named-units show the box's parameter and its last report | Matches the shorter show wording. |
+| NU-P01 | unchanged | Clear success result with parameter, version and region. |
+| NU-P02 | The box installs it on its next config pass (any config write to an app on that box starts one) or within the hour. | Already states both pickup paths and timing clearly. |
+| NU-P03 | unchanged | Gives a complete next command with the relevant values. |
+| NU-P04 | unchanged | Keeps the validation error and the important no-write result. |
+| NU-P05 | unchanged | Keeps the AWS error and the important no-write result. |
+| NU-P06 | unchanged | The lower-case error text follows the CLI convention. |
+| NU-P07 | unchanged | Clear refusal with the invalid value preserved. |
+| NU-P08 | unchanged | Concise usage errors. |
+| NU-S01 | unchanged | Clear stored-parameter status. |
+| NU-S02 | unchanged | Clearly says that no value is stored. |
+| NU-S03 | unchanged | Clearly distinguishes a read failure from no value. |
+| NU-S04 | unchanged | Clear report-availability error. |
+| NU-S05 | unchanged | Explains the missing row and the possible next checks. |
+| NU-S06 | unchanged | Clear box and heartbeat-age row. |
+| NU-S07 | unchanged | Short stale-state explanation. |
+| NU-S08 | unchanged | Explains both reasons for no record. |
+| NU-S09 | unchanged | Gives the mismatch and the corrective command. |
+| NU-S10 | unchanged | Clearly states the version gap and heartbeat age. |
+| NU-S11 | unchanged | Lower-case text after the error prefix follows the CLI convention. |
+| NU-S12 | unchanged | Clearly explains why direct mode cannot show a console report. |
+| NU-G01 | unchanged | Clear outcome gloss. |
+| NU-G02 | unchanged | Clear outcome gloss. |
+| NU-G03 | unchanged | Clear outcome gloss. |
+| NU-G04 | unchanged | Clear outcome gloss. |
+| NU-G05 | unchanged | Clear outcome gloss and retained-file consequence. |
+| NU-G06 | unchanged | Clear outcome gloss and retry consequence. |
+| NU-G07 | unchanged | Clear outcome gloss. |
+| NU-G08 | unchanged | Clear outcome gloss. |
+| NU-R01 | unchanged | Clear reason and retained-file consequence. |
+| NU-R02 | unchanged | Clear reason, error and retained-file consequence. |
+| NU-R03 | unchanged | Clear reason for holding the install. |
+| NU-R04 | unchanged | Clear reason and error. |
+| NU-R05 | unchanged | Clear file-read failure. |
+| NU-R06 | unchanged | Clear journal record with version and digest. |
+| NU-R07 | unchanged | Clear unchanged journal record. |
+| NU-R08 | unchanged | Clear per-unit refusal reason. |
+| NU-V01 | unchanged | Clear size validation error. |
+| NU-V02 | unchanged | Clear host validation error. |
+| NU-V03 | unchanged | Clear account validation error. |
+| NU-V04 | unchanged | Clear app validation error. |
+| NU-V05 | unchanged | Clear missing-address error. |
+| NU-V06 | unchanged | Clear missing-health-path error. |
+| NU-V07 | unchanged | Clear missing-unit error. |
+| NU-V08 | unchanged | Clear unit-name validation error. |
+| NU-V09 | unchanged | Clear refusal and reason for carlos-app@ units. |
+| NU-V10 | unchanged | Clear duplicate-host error. |
+| NU-V11 | unchanged | Clear duplicate-unit error. |
+| NU-V12 | unchanged | States the exact console-guard requirements. |
+| NU-V13 | unchanged | Clear document-count validation error. |
+| NU-V14 | unchanged | Clear schema validation error. |
+| NU-D01 | A fixed box's named-unit file, `/etc/carlos/named-units.json`, can come from an SSM parameter for that box, so you can change it from your own machine. Root reads `/carlos/host/named-units/<instance-id>` in the box's own AWS region on every config pass. It installs a value only if it passes the same checks as a local install. If the parameter does not exist, the installed file stays as it is. | Leads with the file and removes the ambiguous plural “them.” |
+| NU-D02 | `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; root does not. 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. | Replaces the awkward “and not root” with a direct permission distinction. |
+| NU-D03 | unchanged | Clear pickup timing, clearing value and deletion behavior. |
+| NU-D04 | `carlos system named-units show` prints the stored value and its version, then what the box last reported in its heartbeat: the version it read, what it did with that version, and each unit's delivery state. The box report comes through the console, so you need to be logged in as a system operator. Without a console, `show` still prints the parameter and says why the box report is missing. It also says when the box reads another region, or has not yet taken the stored version. | Replaces the ambiguous second “it” with “that version.” |
+| NU-D05 | unchanged | Clear direct-install use cases, checks and locking behavior. |
+| NU-D06 | unchanged | Clear parity description. |
+
+## Flags for Paul
+
+None.
diff --git a/docs/superpowers/reviews/named-units-param-114-copy-deck.md b/docs/superpowers/reviews/named-units-param-114-copy-deck.md
new file mode 100644
index 000000000..6c4e88b1b
--- /dev/null
+++ b/docs/superpowers/reviews/named-units-param-114-copy-deck.md
@@ -0,0 +1,95 @@
+# Named units from a parameter: copy deck (branch named-units-param-114)
+
+Feature: an operator writes a fixed box's named-unit declarations to an AWS SSM parameter, /carlos/host/named-units/<instance-id>, from their own machine; root on the box installs it on its next config pass and reports what it did through the heartbeat. Readers: platform operators in a terminal.
+Placeholders in <angle brackets> must survive. CLI output is plain ASCII.
+
+## CLI help (carlos system named-units)
+| id | context | text |
+|---|---|---|
+| NU-H01 | group usage, `named-units help` | usage: carlos system named-units install <file> / carlos system named-units put --instance <id> [--aws-region <region>] <file> / carlos system named-units show --instance <id> [--aws-region <region>] |
+| NU-H02 | help line for install | install <file> as this box's /etc/carlos/named-units.json. Run it on the box, as root. |
+| NU-H03 | help line for put | check <file>, then write it to the box's parameter, /carlos/host/named-units/<id>, with your AWS profile. |
+| NU-H04 | help line for show | print the box's parameter and what the box last reported. |
+| NU-H05 | --instance flag help | the box's EC2 instance ID, such as i-0abc1234def567890 (required) |
+| NU-H06 | --aws-region flag help | the AWS region the box runs in (default: your AWS profile's region) |
+| NU-H07 | --console flag help (show) | console to read the box's report from (default: the only logged-in one) |
+| NU-H08 | `carlos system` help section heading | A fixed box's named units (see carlos system named-units help): |
+| NU-H09 | `carlos system` help line | named-units install install a declaration file on the box (root) |
+| NU-H10 | `carlos system` help line | named-units put write a box's declarations to its parameter |
+| NU-H11 | `carlos system` help line | named-units show the box's parameter, and what the box last reported |
+
+## CLI: put output
+| id | context | text |
+|---|---|---|
+| NU-P01 | success, first line | wrote <param> (version <n>) in <region> |
+| NU-P02 | success, second line: when the box picks it up | The box installs it on its next config pass (any config write to an app on that box starts one) or within the hour. |
+| NU-P03 | success, third line | To check: carlos system named-units show --instance <id> --aws-region <region> |
+| NU-P04 | error: file invalid (prefixed "carlos system named-units put: ") | <file>: <validation error>. Nothing was written |
+| NU-P05 | error: AWS open failed | AWS: <err>. Nothing was written |
+| NU-P06 | error: put failed | writing <param>: <err> |
+| NU-P07 | error: bad instance id | --instance "<x>" is not an EC2 instance ID |
+| NU-P08 | usage errors | --instance is required / put takes one file / show takes no arguments |
+
+## CLI: show output
+| id | context | text |
+|---|---|---|
+| NU-S01 | parameter line | parameter <param> version <n> in <region> |
+| NU-S02 | no parameter | parameter <param> in <region>: no value stored |
+| NU-S03 | read failed | parameter <param> in <region>: could not be read: <err> |
+| NU-S04 | console unreachable | box report unavailable: <err> |
+| NU-S05 | no row for the instance | No box has reported instance <id> to this console. The box may be down, on another console, or on a release from before named-units reports. |
+| NU-S06 | box line | box <label>, last heartbeat <age> ago |
+| NU-S07 | appended when stale | (stale: the box may be down) |
+| NU-S08 | box has no record | The box has not reported a named-units record. Its release may be from before named-units reports, or its first pass has not run yet. |
+| NU-S09 | region mismatch | The box reads its parameter in <box region>, and this one is in <region>. Write it there with --aws-region <box region>. |
+| NU-S10 | box behind | The box has not taken version <n> yet: it last read version <m>, and its last heartbeat was <age> ago. |
+| NU-S11 | exit error | carlos system named-units show: the parameter could not be read |
+| NU-S12 | direct mode error | this shell is in direct bucket mode (CARLOS_DEPLOYMENT_BUCKET or CARLOS_DEPLOYMENT_DIR is set), and box reports come from a console |
+| NU-G01 | outcome gloss installed | the box installed this version |
+| NU-G02 | outcome gloss unchanged | the box already had this version installed |
+| NU-G03 | outcome gloss not-found | the box found no parameter at its path |
+| NU-G04 | outcome gloss unreadable | the box could not read the parameter |
+| NU-G05 | outcome gloss invalid | the box refused the value and kept its installed file |
+| NU-G06 | outcome gloss held | a rollback in progress needs the current file, so the box will try again next pass |
+| NU-G07 | outcome gloss skipped | this box does not take declarations from a parameter |
+| NU-G08 | outcome gloss failed | the box could not install the file |
+
+## Reasons root records (shown by `show` as "reason", and in the box journal)
+| id | context | text |
+|---|---|---|
+| NU-R01 | not found | named-units: no parameter <param>; the installed declarations stand |
+| NU-R02 | unreadable | named-units: parameter <param> unreadable: <err>; the installed declarations stand |
+| NU-R03 | held | a recorded rollback of <host> needs the current declarations |
+| NU-R04 | held, check failed | cannot tell whether a recorded rollback of <host> needs the current declarations: <err> |
+| NU-R05 | held, current file unreadable | cannot read the installed file <path>: <err> |
+| NU-R06 | installed (journal) | named-units: installed <path> version <n> from <param> (sha256 <digest>) |
+| NU-R07 | unchanged (journal) | named-units: <param> version <n> unchanged |
+| NU-R08 | per-unit refusal, app has no config | no config is set for <account>/<app>, so there is nothing to deliver |
+
+## Declaration check errors (put and install print these)
+| id | context | text |
+|---|---|---|
+| NU-V01 | too big | named units: file is <n> bytes, the limit is <max> |
+| NU-V02 | bad host | named units: host "<host>" is not a valid host name |
+| NU-V03 | bad account | named units: host <host>: account "<account>" is not valid |
+| NU-V04 | bad app | named units: host <host>: app "<app>" is not valid |
+| NU-V05 | missing addr | named units: host <host>: addr is required |
+| NU-V06 | missing health | named units: host <host>: health.path is required |
+| NU-V07 | missing unit | named units: host <host>: unit is required |
+| NU-V08 | bad unit | named units: host <host>: unit "<unit>" is not a valid unit name |
+| NU-V09 | carlos-app unit | named units: host <host>: unit "<unit>" is a carlos-app@ unit, which cannot be declared |
+| NU-V10 | duplicate host | named units: host <host> is declared twice |
+| NU-V11 | duplicate unit | named units: unit <unit> is declared twice |
+| NU-V12 | console guard | named units: host <host> is the console guard's host and must be app console, unit console.service, no account |
+| NU-V13 | two documents | named units: more than one JSON document |
+| NU-V14 | schema | named units: schema must be 1 |
+
+## Docs: docs/site/cli.md, section "carlos system named-units" (each paragraph is one row)
+| id | context | text |
+|---|---|---|
+| NU-D01 | para 1 | A fixed box's named units, the file `/etc/carlos/named-units.json`, can come from an SSM parameter for that box, so you can change them from your own machine. Root reads `/carlos/host/named-units/<instance-id>` in the box's own AWS region on every config pass. A value is installed only if it passes the same checks as a local install. If the parameter does not exist, the installed file stays as it is. |
+| NU-D02 | para 2 | `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, and not 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. |
+| NU-D03 | para 3 | 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, put `{"schema":1,"units":[]}`. Deleting the parameter does not clear them: the box keeps the file it has. |
+| NU-D04 | para 4 | `carlos system named-units show` prints the stored value and its version, then what the box last reported in its heartbeat: the version it read, what it did with it, and each unit's delivery state. The box report comes through the console, so you need to be logged in as a system operator. Without a console, `show` still prints the parameter and says why the box report is missing. It also says when the box reads another region, or has not yet taken the stored version. |
+| NU-D05 | para 5 | `carlos system named-units install <file>` installs the file on the box directly. Use it for boxes set up without a parameter, and during provisioning. It runs as root only. It checks the file first (schema 1, one JSON document, one line per host and per unit, as shown under `carlos route`), then replaces the live file in one step while holding the lock the config pass holds, so a pass never sees half a change. Editing the file by hand while carlos runs is not supported, and a pass that sees the file change under it does nothing and says so. |
+| NU-D06 | parity row | A fixed box's named-unit declarations, through its parameter. |