carlos / platform Public

Named-unit declarations from an operator parameter (#114)

Root's adopt pass now reads /carlos/host/named-units/<instance-id> (an
SSM String an operator writes with `carlos system named-units put`, in
the box's own region, read with root's own IMDS identity) and installs it
as /etc/carlos/named-units.json under the config-sync flock, so declaring
a unit needs no SSM session (Paul, 2026-11-19: approach A). A value is
installed only if both the delivery and the release-path decoders accept
it and the console guard rule holds; an absent parameter or a read error
never touches the file; equal bytes are never rewritten; the install is
held while the release path may still compare the file's identity
(in-flight rollback or pending history completion, incl. the guarded
console host). Group and fleet boxes skip with no network call.
Outcomes (installed, unchanged, not-found, unreadable, invalid, held,
skipped, failed) and each declared unit's final delivery state
(delivered, refused, no-route) are written to a public root store and
carried in the heartbeat (BoxMetrics.named_units); `carlos system
named-units show` prints the parameter beside the box's report.

Reviews: Astra plan R1-R2, branch R1 (P1 code-health, P2 drift outcome,
fixed) and R2 READY; census approved (#280); record-write census
classed; copy by Luna (delegated), one fact correction. P3 follow-ups in
#1278. Not released.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

Prompts:

  Go ahead.

  <task-notification>
  <task-id>aed9a74739e6e96d5</task-id>
  <tool-use-id>toolu_01Pj7K4wpBJJBfkHPBTXn5Ho</tool-use-id>
  <output-file>/home/paulca/.cache/tmp/claude-1001/-home-paulca-amadan-net-carlos-platform/95f33cc2-8998-4fa5-abb8-8043c3daeffb/tasks/aed9a74739e6e96d5.output</output-file>
  <status>completed</status>
  <summary>Agent "Implement Task 4: root fetch step" 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. Root's adopt pass now reads the box's parameter, checks it, and installs it as `/etc/carlos/named-units.json` under the config-sync lock, writing the status record before the release key parse.
  
  Commits:
  - 66dca9a3 `host: console guard host comes from the marker itself`
  - 7ca8abda `host: root installs named-units from the box's parameter`
  
  Tests: every brief test, the reworked guard and install tests and the existing proofnamed ones pass in `internal/host`, and `internal/status` passes. Two deliberate breakages each made a test fail, and I put them back. The darwin and windows builds pass; off-linux vet shows only the known `haingress_alias_test.go` failure.
  
  "History pending": I followed the recovery code, which differs from the plan in two places:
  - **Failed or recovering, never verified:** a settled attempt like this is not in use, because `resumeHistoryRestart` returns at once without re-binding the host. The plan's wording could hold the install forever.
  - **Independent:** a settled independent attempt is not in use, because `settleHistory` never checks `Pending` for it.
  
  `Pending` also writes the record's exact bytes back, so the test checks both stores are unchanged rather than never written.
  
  Concerns:
  1. **Extra outcome:** I added `failed` for a lock that can't be taken or a write that fails after every check passed. None of the spec's seven fits, and Tasks 6 and 7 will need to show it.
  2. **Unreadable current file:** if root can't safely read the installed file, the outcome is `held`. That box can't be repaired through the parameter until the file is fixed on the box.
  3. **Two small additions to the brief:** an `openDst` field on `namedUnitsFetch`, because tests can't use the root-only opener on a temp dir. The fleet skip also covers a box with `CARLOS_FLEET` set but invalid.
  4. **Legacy mode:** an unsettled attempt with history still pending would hold its host, though the recovery code never settles it there. A legacy box shouldn't have such attempts, so I left it.
  5. **Marker readers disagree:** a marker that names no valid live host (for example one with a trailing newline) now refuses installs. The release path treats the same marker as "no host guarded". This is what ruling 1 asked for.
  
  Report: /home/paulca/amadan.net/carlos/platform/.claude/worktrees/named-units-param-114/.superpowers/sdd/2026-11-19-named-units-from-parameters/task-4-report.md</result>
  <usage><subagent_tokens>186147</subagent_tokens><tool_uses>61</tool_uses><duration_ms>930988</duration_ms></usage>
  </task-notification>

  … and 1 more, on the branch's Prompts tab.

Squashed from named-units-param-114 into main.
claude agent, operated by paul@keymail.dev bde64b543f327c4606e220884a02499e54665964 parent ade9635
52 files changed, +4,842 −207
  • commands.go +3 −0
  • docs/parity.md +2 −1
  • docs/site/cli.md +42 −9
  • docs/superpowers/notes/census-proposal-named-units-param-114.md +57 −0
  • docs/superpowers/plans/2026-11-19-named-units-from-parameters.md +433 −0
  • docs/superpowers/reviews/CODEX-FINDINGS-named-units-param-114-branch-R1.md +62 −0
  • docs/superpowers/reviews/CODEX-FINDINGS-named-units-param-114-branch-R2.md +21 −0
  • docs/superpowers/reviews/CODEX-FINDINGS-named-units-param-114-plan-R1.md +25 −0
  • docs/superpowers/reviews/CODEX-FINDINGS-named-units-param-114-plan-R2.md +16 −0
  • docs/superpowers/reviews/CODEX-REVIEW-BRIEF-named-units-param-114-branch.md +41 −0
  • docs/superpowers/reviews/CODEX-REVIEW-BRIEF-named-units-param-114-plan.md +18 −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
  • docs/superpowers/reviews/named-units-param-114-deferred-and-rulings.md +30 −0
  • docs/superpowers/specs/2026-11-19-named-units-from-parameters-design.md +333 −0
  • internal/appconfig/sync.go +47 −31
  • internal/appconfig/unitsync.go +170 −29
  • internal/appconfig/unitsync_test.go +260 −0
  • internal/console/apisystemupdate.go +9 −1
  • internal/console/apisystemupdate_test.go +49 −0
  • internal/host/agent.go +18 −8
  • internal/host/namedunitsfetch.go +366 −0
  • internal/host/namedunitsfetch_test.go +667 −0
  • internal/host/namedunitsprobe.go +42 −0
  • internal/host/namedunitsprobe_linux_test.go +43 −0
  • internal/host/namedunitsprobe_test.go +22 −0
  • internal/host/proofnamed.go +7 −24
  • internal/host/proofnamed_linux_test.go +45 −0
  • internal/host/rootrollback.go +43 −0
  • internal/host/unitops.go +134 −16
  • internal/host/unitops_guard_linux_test.go +209 −0
  • internal/host/unitops_test.go +64 −0
  • internal/hostenv/awsssm.go +16 −0
  • internal/hostenv/namedunits.go +87 −0
  • internal/hostenv/namedunits_test.go +73 −0
  • internal/namedunits/namedunits.go +113 −0
  • internal/namedunits/namedunits_test.go +129 −0
  • internal/provision/named_units_param_114_census_test.go +62 −0
  • internal/provision/plan9_b8_census_test.go +1 −1
  • internal/provision/testdata/plan14-root-reads-chain.tsv +1 −0
  • internal/provision/testdata/plan14-root-reads-named-units-param-114.tsv +50 −0
  • internal/status/namedunits_probe_test.go +19 −0
  • internal/status/snapshot.go +39 −1
  • main.go +67 −6
  • parity/cli.tsv +3 −1
  • parity/parity.tsv +2 −1
  • scripts/gitleaks-gate/notscanned.go +1 −0
  • system.go +17 −3
  • system_namedunits.go +377 −0
  • system_namedunits_test.go +235 −0
  • testdata/clireg-golden.jsonl +85 −75

CI passed — run details

landed from named-units-param-114

commands.go

Loading diff…

docs/parity.md

Loading diff…

docs/site/cli.md

Loading diff…

docs/superpowers/notes/census-proposal-named-units-param-114.md

Loading diff…

docs/superpowers/plans/2026-11-19-named-units-from-parameters.md

Loading diff…

docs/superpowers/reviews/CODEX-FINDINGS-named-units-param-114-branch-R1.md

Loading diff…

docs/superpowers/reviews/CODEX-FINDINGS-named-units-param-114-branch-R2.md

Loading diff…

docs/superpowers/reviews/CODEX-FINDINGS-named-units-param-114-plan-R1.md

Loading diff…

docs/superpowers/reviews/CODEX-FINDINGS-named-units-param-114-plan-R2.md

Loading diff…

docs/superpowers/reviews/CODEX-REVIEW-BRIEF-named-units-param-114-branch.md

Loading diff…

docs/superpowers/reviews/CODEX-REVIEW-BRIEF-named-units-param-114-plan.md

Loading diff…

docs/superpowers/reviews/LUNA-COPY-BRIEF-named-units-param-114.md

Loading diff…

docs/superpowers/reviews/LUNA-COPY-RESULT-named-units-param-114.md

Loading diff…

docs/superpowers/reviews/named-units-param-114-copy-deck.md

Loading diff…

docs/superpowers/reviews/named-units-param-114-deferred-and-rulings.md

Loading diff…

docs/superpowers/specs/2026-11-19-named-units-from-parameters-design.md

Loading diff…

internal/appconfig/sync.go

Loading diff…

internal/appconfig/unitsync.go

Loading diff…

internal/appconfig/unitsync_test.go

Loading diff…

internal/console/apisystemupdate.go

Loading diff…

internal/console/apisystemupdate_test.go

Loading diff…

internal/host/agent.go

Loading diff…

internal/host/namedunitsfetch.go

Loading diff…

internal/host/namedunitsfetch_test.go

Loading diff…

internal/host/namedunitsprobe.go

Loading diff…

internal/host/namedunitsprobe_linux_test.go

Loading diff…

internal/host/namedunitsprobe_test.go

Loading diff…

internal/host/proofnamed.go

Loading diff…

internal/host/proofnamed_linux_test.go

Loading diff…

internal/host/rootrollback.go

Loading diff…

internal/host/unitops.go

Loading diff…

internal/host/unitops_guard_linux_test.go

Loading diff…

internal/host/unitops_test.go

Loading diff…

internal/hostenv/awsssm.go

Loading diff…

internal/hostenv/namedunits.go

Loading diff…

internal/hostenv/namedunits_test.go

Loading diff…

internal/namedunits/namedunits.go

Loading diff…

internal/namedunits/namedunits_test.go

Loading diff…

internal/provision/named_units_param_114_census_test.go

Loading diff…

internal/provision/plan9_b8_census_test.go

Loading diff…

internal/provision/testdata/plan14-root-reads-chain.tsv

Loading diff…

internal/provision/testdata/plan14-root-reads-named-units-param-114.tsv

Loading diff…

internal/status/namedunits_probe_test.go

Loading diff…

internal/status/snapshot.go

Loading diff…

main.go

Loading diff…

parity/cli.tsv

Loading diff…

parity/parity.tsv

Loading diff…

scripts/gitleaks-gate/notscanned.go

Loading diff…

system.go

Loading diff…

system_namedunits.go

Loading diff…

system_namedunits_test.go

Loading diff…

testdata/clireg-golden.jsonl

Loading diff…