Skip to content

feat(prism-code): system and auth command groups (Part of #446) - #621

Merged
afflom merged 20 commits into
mainfrom
claude/project-thread-4igtmt
Nov 12, 2026
Merged

afflom merged 20 commits into
mainfrom
claude/project-thread-4igtmt

Conversation

@afflom

@afflom afflom commented Nov 12, 2026

Copy link
Copy Markdown
Member

Requested by Alex · project thread

v0.5 workstream WS4: the CLI half of #446 (prism.system) and login/logout of #447 (prism.auth).

What

  • src/cli/system.mjs: prism-code system info|version|events|df|prune. info and version name the package, holo format, runtime, and the toolchain and builder image the project's prismpm.lock pins (--project, the current folder by default). There is no daemon, so events reads create/start/die from the container records and reports a record that disappears as destroy. It follows the store until --until or Ctrl-C, and takes --since/--until as ISO 8601, Unix seconds or 10m, plus --filter action=|event=|id=|container=. df -v lists the records. prune asks on a terminal and needs --force without one. Every verb takes --json.
  • src/cli/auth.mjs: prism-code auth login|logout, exporting aliases for the top-level login/logout. login checks the credential with the registry (GET /v2/, through a new ping() on the registry client) before it stores anything, as docker login does. The password comes only from --password-stdin or a prompt that does not echo. -p, --password and --password= are refused without quoting them, and a stray positional word is counted, not printed. logout warns when GHCR_TOKEN still supplies a token, without printing the token.
  • Each module exports { verbs, help }. Each verb is async (argv, io) => exitCode, and a usage error prints the group's help and returns 64. Per the lead's conventions, bin/prism-code.mjs is untouched; the lead wires these in when the group dispatcher lands.
  • DK-44: test/system-auth-cli.test.mjs (15 tests) with a conformance case, a feature scenario, and SPEC.md/CONFORMANCE.md regenerated. The fake registry now challenges GET /v2/.
  • The package allowance is scripts/package-allowances/system-auth-cli.json (20 KiB). This branch merges ci(prism-code): sum the package cap from one allowance file per change (Part of #441) #618's branch, so the cap is computed the new way. When ci(prism-code): sum the package cap from one allowance file per change (Part of #441) #618 lands, that part of the diff goes away.
  • No new error codes: usage errors exit 64, and refusals reuse registry.auth and store.credential-input.

Test

  • node --test test/system-auth-cli.test.mjs: 15/15 pass.
  • npm test: everything passes except reference-archives.test.mjs, which fails locally on main too.
  • cargo xtask validate-model: clean, 247 ids.
  • cargo test -p repo-conformance --test conformance conformance_dk_44: passes.

Generated by Claude Code

…iew's glossary (#347)

The developer view of #346 is declared once, as the LexLean model
bindings/src/Foundation/Views/V1/Developer.lex.tex: the Docker-aligned
terms over the canonical terms they name, the other words of the surface
and the deprecated aliases. Its certified export is vendored into xtask,
and `cargo xtask check-developer-view` (part of `cargo xtask validate`)
runs it over sdk/npm/prism-code/developer-surface.json, refusing a name
outside the glossary, a canonical term the view renames, a Docker verb
taken before Prism has its behaviour, and an undeclared alias. The model
renders docs/developer-glossary.md.

A prism-code test keeps developer-surface.json equal to the CLI help, the
delegated verbs and the client. The check found two canonical terms on the
surface, now renamed with deprecated aliases through 0.8 that each print
one warning: `history` is `record`, and `--holo` (replay, dev) is
`--image`. Verbs handed to prismpm keep prismpm's flags.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013Asa3N4k8eo7mrfwURU1WM
…#347)

check-developer-view compares docs/developer-glossary.md byte for byte with
the page the model renders, so a CRLF checkout would report drift. Pin it
to LF, as COMPLIANCE.md is.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013Asa3N4k8eo7mrfwURU1WM
…nt (#347)

The glossary maps the developer view's words onto the canonical terms and
names the issues that build the waiting verbs, as docs/vocabulary.md maps
the docs' terms onto the repository's names, so it is excluded with it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013Asa3N4k8eo7mrfwURU1WM
PACKAGE_LIMIT was one comment line that every change growing the package
edited, so parallel v0.5 PRs would all conflict on it. The cap is now the
sum of scripts/package-allowances/*.json, each holding a kib and a reason.
The 19 allowances on the old line move over unchanged (1584 KiB in total,
the same 1622016 bytes), and the package test reads the limit instead of
repeating the number.

Part of #441

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013Asa3QVSkS6PGopegNeztG
prism-code system info|version|events|df|prune and prism-code auth
login|logout as src/cli/<module>.mjs modules exporting { verbs, help },
each verb async (argv, io) => exitCode, for the group dispatcher to wire.

- info and version name the toolchain and builder image the project's
  prismpm.lock pins; events reads create/start/die/destroy from the
  container store and follows it until --until; prune asks unless --force.
- login checks the credential with GET /v2/ (new registry client ping)
  before storing it where Docker would; the password comes only from
  --password-stdin or a non-echoing prompt, -p/--password are refused,
  and no secret reaches stdout, stderr or an error.
- DK-44 owns test/system-auth-cli.test.mjs (15 tests).
- Package allowance: scripts/package-allowances/system-auth-cli.json, 20 KiB.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013Asa3P3wYbBfAqXcoqi2cd
… of #446)

The follow test raced a slow runner against a 1.5 s --until: the run's
start and die landed after it. Follow now also ends on io.signal, the test
stops it once the run and removal are seen, and a separate test covers an
--until still ahead. Without --since, events already in the store are not
replayed, so only what happens from now on is new, as with docker events.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013Asa3P3wYbBfAqXcoqi2cd
# Conflicts:
#	sdk/npm/prism-code/scripts/check-package.mjs
#	sdk/npm/prism-code/test/package.test.mjs
The group files compose several modules, as the client does, so the
whole folder is owned by client and check-modules rule 2 holds.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013Asa3P3wYbBfAqXcoqi2cd
`prism-code <module> <verb>` dispatches through src/cli/index.mjs to one
file per module, so each workstream adds verbs to its own file and never
to bin/prism-code.mjs. `images build|inspect|pull|push|verify` and
`containers run|rm|inspect` name the flat verbs, which stay. A group file
may also give its verbs as functions with a verbatim `help` block, and
`aliases` for top-level spellings (`login` for `auth login`).

The developer surface reads a group line's verb as the word after the
module, so `images push` is checked against the glossary as `push`.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013Asa3QVSkS6PGopegNeztG
… (Part of #446)

Merges the group dispatcher branch (#625), adds system and auth to FILES
in src/cli/index.mjs, and regenerates developer-surface.json;
check-developer-view passes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013Asa3P3wYbBfAqXcoqi2cd
…and own src/cli/

cli.json is compared with the verbs --help prints, so the two group words
join it, and the generated skill table follows. src/cli/ is owned by the
client, which composes the modules, with the same entry as #621.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013Asa3QVSkS6PGopegNeztG
… skill (Part of #446)

The docs test compares cli.json's verbs with the words --help prints, so
system, auth, login and logout get rows (usage without pipes, which the
skill's command table would escape), the alias help is one line per verb,
and the skill and its package copy are regenerated.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013Asa3P3wYbBfAqXcoqi2cd
…Part of #446)

A client keeps each container it has read, so following through one
client saw a container that was created and later started as created
forever. events now lists through a new client each turn, and a record
removed between listing and reading is read again on the next turn. The
follow test now starts a container the stream has already seen.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013Asa3P3wYbBfAqXcoqi2cd
…-4igtmt

# Conflicts:
#	STABILITY.md
#	sdk/npm/prism-code/CHANGELOG.md
…-4igtmt

# Conflicts:
#	CHANGELOG.md
#	sdk/npm/prism-code/CHANGELOG.md
…-4igtmt

# Conflicts:
#	sdk/npm/prism-code/bin/prism-code.mjs
#	sdk/npm/prism-code/developer-surface.json
#	sdk/npm/prism-code/src/cli/index.mjs
#	sdk/npm/prism-code/test/fixtures/package-files.json
@afflom
afflom merged commit 15aa26a into main Nov 12, 2026
33 checks passed
afflom pushed a commit that referenced this pull request Nov 12, 2026
…ore (Part of #349)

#621's system verbs were written before the store existed. df now counts
images (and lists them with -v), info gives the stored count, and prune
takes -a|--all and prints the images it deleted.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013Asa3NmrRTpngJ3TFNocur
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants