carlos / platform Public

cli: system words in the registry

system becomes a subtree: one child list replaces systemVerb's case list
and runSystem's arms; router is a transparent child and the fallback
keeps systemUnknownVerbMessage's three cases (router read from
consumed). antivirus, pdf, layout, geoip, managed-fleets, seeds-floor,
legacy-routes, lifetimes, hosts-used, box, group and demos (reports with
an unnamed list default) split into word nodes, each fallback copied
from today. Box plumbing (guard-exec, group-maintenance, files, host-env,
named-units) stays one leaf each; no internal package changes.
runSystem and systemVerb stay for their tests, read from the tree.
Corpus re-recorded from 7f4bdf3a: 194 lines added, none changed; replay
clean.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
claude agent, operated by paul@keymail.dev pushed by paul@keymail.dev b1abd1d13bbad300829c8c883c7b279960e3c70b parent 60ec807
13 files changed, +596 −216
  • clireg_golden_test.go +28 −0
  • commands.go +1 −1
  • parity/cli.tsv +43 −1
  • system.go +181 −124
  • system_demos.go +43 −19
  • system_geoip.go +23 −17
  • system_hostsused.go +3 −7
  • system_legacy_routes.go +3 −7
  • system_lifetimes.go +3 −7
  • system_managedfleets.go +31 −14
  • system_roles.go +40 −12
  • system_seeds.go +3 −7
  • testdata/clireg-golden.jsonl +194 −0

Intent

Human

<task-notification> <task-id>a9dfa4fdc7b7a75a4</task-id> <tool-use-id>toolu_01Af2GnN2Hg83ZEXmvbmPUmj</tool-use-id> <output-file>/home/paulca/.cache/tmp/claude-1001/-home-paulca-amadan-net-carlos-platform/27979b8d-cc90-4f50-88f6-87ba41433627/tasks/a9dfa4fdc7b7a75a4.output</output-file> <status>completed</status> <summary>Agent "Implement Task 6 box/host words" 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>Task 6 is done and committed as **60ec807c** "cli: box and host words in the registry" on `cli-registry-words`. Git printed a `packed-refs.lock` error during the commit, but `git log -1` shows the commit on the branch and the worktree is clean. The corpus replay against the branch binary shows zero differences. **Nodes created** - **`ops`** is now a branch (Operator, `NoUpdateHint`), defined in `opsCommand()` at `/home/paulca/amadan.net/carlos/platform/.claude/worktrees/cli-registry-words/hostclaim_cli.go:38`. It has no default. Its fallback is the new `boxops.Fallback`: the old `Run`'s help and unknown-verb arms, moved verbatim. So bare `ops` and an unknown word still exit 2, and `help`/`-h`/`--help` still print usage to stderr with exit 0. - **`ops host`** (Operator) has `When: hostClaimEnabled(os.Getenv("CARLOS_HOST_CLAIM"))`. That reuses the exact `TrimSpace != ""` test the old `runOps` made. Its fallback is `runOpsHost(args)`, so any word other than `resolve`, or none, still prints the old `usage: carlos ops host resolve ...` and exits 1. - **`ops host resolve`** (Operator) is a raw leaf. - **`ops litestream`, `ops restore-verify`, `ops hibernate-verify`** (BoxLocal) are raw leaves exported by `internal/ops`. `Commands()` and `Fallback()` are at `internal/ops/ops.go:40` and `:53`. - `ops.Run` keeps its signature as a one-line `clireg.Dispatch` wrapper (`ops.go:34`). The old `runOps` is deleted; nothing called it. - **Unchanged leaves:** `vet` (`vet.Run` only parses flags, so no `vet.Command()`), `edge`, `agent`, `adopt`, `bootstrap`, `add`, `remove`, `status`, `update` and `instance-control/exec/exit/stop/probe`. Their Audience and corpus skips from Task 2 match the parity rows. **Corpus** - It went from 710 to 737 lines: 27 added, none changed or removed (`git diff --numstat`: 27 / 0), all re-recorded from base 7f4bdf3a. - `goldenWhenEnv` already had `ops host`, and `goldenExtra` already supported `Env`, so I only added three explicit cases: - `ops host resolve -h` with the variable set: `unknown option "-h"`, exit 1. - `ops host resolve -h` without it: `ops: unknown verb "host"` plus usage, exit 2. - `ops zz`: unknown verb, exit 2. - The generator also covers every `ops host` case with the variable both on and off. - `make parity-doc` replaced the `ops` row in `parity/cli.tsv` with the four leaf rows. `docs/parity.md` did not change. **Checks run (all pass)** - `TestCLIGolden` replay. - `go test .` with `-run` covering the command tree, projection, top-level words, update hint, golden cases, host claim and ops (18 tests). - `go test` for `internal/ops`, `internal/vet`, `internal/parity`, `internal/docsite` and `internal/clireg`. - `gofmt` and `go vet`. - `go build ./...`, plus `GOOS=darwin` and `GOOS=windows` builds of the root package. **Decisions the plan didn't settle** 1. The `resolve` leaf adds its own word back in front of the arguments before calling `runOpsHost` (`hostclaim_cli.go:48`). This keeps `parseHostResolve` unchanged, because `hostclaim_cli_test.go:34,44` call it with `"resolve"` first. Its `args[0] != "resolve"` check stays inside the parser until the args step, the same way `move` was handled. 2. The `ops host` fallback reuses `runOpsHost(args)` (`hostclaim_cli.go:51`) rather than copying the usage string, so the message and exit 1 come from the same code as before. 3. `instance-control`'s exact-match `--group-hairpin-*` arguments (`internal/host/claimstop_run.go:25`) look like flags but act as words. I left that a raw leaf, as spec B6 lists it. 4. The "host claim on" extra repeats the generated `ops host resolve | -h` case under a different key. I kept it because the task named it explicitly. **Cleanup:** I deleted the stray `platform` binary my own `go build .` left in the worktree, and the scratch copy of the corpus in `$TMPDIR`.</result> <usage><subagent_tokens>100833</subagent_tokens><tool_uses>32</tool_uses><duration_ms>282448</duration_ms></usage> </task-notification>

clireg_golden_test.go

Loading diff…

commands.go

Loading diff…

parity/cli.tsv

Loading diff…

system.go

Loading diff…

system_demos.go

Loading diff…

system_geoip.go

Loading diff…

system_hostsused.go

Loading diff…

system_legacy_routes.go

Loading diff…

system_lifetimes.go

Loading diff…

system_managedfleets.go

Loading diff…

system_roles.go

Loading diff…

system_seeds.go

Loading diff…

testdata/clireg-golden.jsonl

Loading diff…