Core CLI help metadata is stale and incomplete (#835) - #845
Conversation
Four core registrations described something other than what their handlers do, and three working surfaces appeared nowhere in help. Dispatch renders `summary`/`usage`/`help` straight off the registration (LLP 0009 #central-help-interception), so the registration is the only description a user gets, and nothing was pinning it to the code. - `init`: the walkthrough has asked no retention question since LLP 0137; help now states the pathway defaults (90 team / 120 local) and points at `--retention-days` as the override. - `remote login`: the target name is optional (LLP 0062 #bare-remote), and `--org`/`--host`/`--browser`/`--no-browser` were undocumented. - `daemon restart`: it restarts the installed service; the relaunch instruction is the no-service fallback and moves into long help. - `skills install`: `--client` defaults to `all`, so the usage says so. - `daemon install --platform`: public and documented, now refused outside `--dry-run`, since a cross-platform install can only write the wrong unit and then call the wrong service manager. - `hyp help <command>` is rewritten to `<command> --help` and routed through ordinary dispatch (so it reaches plugin commands) instead of silently answering with the top-level table. - Top-level help gains Global options and Aliases sections, so `--version`, `-V`, and `unattach` are discoverable. LLP 0265 records what a registration owes its handler; LLP 0009 gains the forward-ref. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
`hyp help <command>` is rewritten to `hyp <command> --help`, but the unknown-command diagnostic echoed the rewritten argv, so `hyp help bogus` reported `unknown command 'bogus --help'`: a flag the user never typed. Keep the pre-rewrite argv for the message and cover it with a test. Top-level help's `Global options:` rows now take their spellings from `HELP_FLAGS` / `VERSION_FLAGS` rather than restating them, so a new global flag lists itself the way a new alias already does. Rendered output is byte-identical. Also: README documents the now-public `daemon install --platform`, and the `runSkillsInstall` JSDoc stops contradicting the `--client` default the parser applies. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Neutral review round - head
|
The `hyp help <command...>` rewrite appends `--help` to the end of argv, but the central help interception only fired on a leading help flag. Any token the user wrote after the command name pushed the flag past that test, so `hyp help attach claude` invoked the handler with a stray `--help` (exit 2, `error: unknown argument: --help`) and `hyp help query sql "select 1"` did the same. Core parsers reject the flag; a lenient one would have executed the command, and `hyp purge` is destructive. Carry the rewrite as `helpVerb` and let it satisfy the interception, so the spelled-out form renders the matched command's help however many positionals follow it. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
master merged llp/0265-grep-search-implementation.plan.md (#865) while this PR was open, so both trees claimed 0265. Mechanical renumber only: the document's content and decisions are unchanged. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
|
Renumbered this PR's LLP from 0265 to 0270 (mechanical, no content change). While this PR was open, two LLPs merged to Per CLAUDE.md, "renumbering that does not change meaning (LLP 0156)" is an allowed mechanical edit on an Accepted doc, so the doc that landed second (this one) was moved to the next free number. 0270 was chosen as the next number free across every remote branch, not just Renamed:
References retargeted:
Not one word of the document's context, decisions, or consequences changed - only the four digits and the links that point at them.
Verification in a clean worktree with a fresh
|
Verdict: approve, with one low-severity behaviour finding and two nits. Nothing pushed; the branch stays at 590d4f4.The change does what it claims. I re-derived every claim the four corrected registrations make against the handlers behind them, and all of them hold. Verification (worktree at 590d4f4)
Claim-by-claim check of the corrected help text: all accurate
Findings1. LOW, not fixed. src/core/cli/dispatch.js:509 - Evidence, all reproduced against the built CLI on this head:
So the same user error gets three different answers depending on spelling, and the Why I did not fix it: the obvious guard (force help only when 2. NIT, not fixed. src/core/cli/dispatch.js:404 - The token that is actually unknown is 3. NIT, description only. The PR body understates the new test file and misreports the suite baseline. It says 11 assertions with 10 of 11 failing on master; test/core/cli/help-metadata.test.js contains 14 What I fixedNothing. No commit pushed to |
|
Triage at head Classification of the open findings from the exhausted review rounds:
No finding could cause wrong behaviour, data loss, a security hole, a crash, or a performance regression in production, so the PR can merge safely with #873 carrying the deferrals. |
What drifted
Dispatch renders
summary/usage/helpstraight off the commandregistration (LLP 0009 #central-help-interception), so the registration is the
entire published interface of a command, and nothing was checking that it still
matched the handler. Four registrations had stopped matching, and three working
surfaces had no place to be listed.
hyp init --helphyp remote login --help<name>required, no--org/--host/--browser/--no-browserhyp daemon restart --helphyp skills install --help[--client <name>]--clienttoallhyp daemon install--platformundocumented--version,-V, and theunattachalias all workhyp help queryWhat changed
@refs to theLLPs that constrain them (0137, 0062).
daemon install --platform darwin|linuxis public and documented, and is nowrefused outside
--dry-run. A real install writes into this host's servicedirectory and then calls this host's service manager, so a cross-platform
install can only produce a broken one. Same shape as the existing
--json requires --dry-runrule; no in-repo caller used it any other way.hyp help <command...>is rewritten tohyp <command...> --helpand routedthrough ordinary dispatch. Routing rather than re-answering is what makes it
reach plugin-contributed commands, which only exist after boot. Bare
hyp helpstill renders the top-level table.Global options:andAliases:sections after thecommand table. Alias rows are read off the registry, so a new alias lists
itself. The one-row-per-top-level-token rule for commands is unchanged.
Regression test
test/core/cli/help-metadata.test.js(new, 11 assertions). It asserts semanticclaims, not flag presence: for example "init help does not say the walkthrough
asks for a retention window" was the actual defect, while "init help mentions
--retention-days" was already true inside a false sentence.Before this change 10 of the 11 fail on
master; all 11 pass after.npm testlocally shows 4207 pass / 22 fail, the same 22 failures a cleanorigin/masterrun produces in this environment (parquet pushdown and reportrender, unrelated).
npm run typecheckis clean, andnpm run smoke -- daemon_install_renderand-- command_dispatchare green.Design record
LLP 0265 (Decision, Systems: CLI) records what a registration owes its handler,
the
--platformcall, thehelp <command>routing, and the global-options /aliases sections. LLP 0009 gains the
Extended-by:forward-ref; nothing itsettled is edited.
Fixes #835