test(cli): cover generic setup alias#207
Conversation
There was a problem hiding this comment.
kapi-agent review
Verdict: APPROVE
Final approval summary
Review journey
The original goal is a bounded follow-up to issue #205: make the generic runtime CLI path user-visible through npm run setup:cli while preserving the existing kapi compatibility alias. The semantic scope is small and coherent: one setup message change, targeted install/bin coverage, and an audit-doc classification update. There is no prior kapi-agent feedback on this PR, so no review/fix ping-pong was required.
What changed
scripts/setup-kapi-cli.mjsnow exposessetupCompletionMessage()and printsrunctl --helpfirst, withkapi --helpexplicitly retained for compatibility.test/cli-bin.test.tsnow verifies the setup message and checks both installed shims,runctlandkapi, in isolated setup and production-style global install flows.docs/product-name-audit.mddocuments the setup helper filename as compatibility debt while keeping user-facing guidance generic.
Why this is correct
The implementation changes only the user-facing completion text and leaves the installation mechanics intact. The tests exercise the actual installed commands rather than only package metadata, which directly guards the intended contract: runctl is the canonical generic runtime command, and kapi remains executable as a compatibility alias.
Evidence
- Verifier gate: PASS —
npm ci && npm run verifyexited 0. - Size gate: PASS — 40 changed lines, below the 200-line semantic review threshold.
- Revision-explanation status: not required; found in the PR body.
- Ilchul review harness gate: PASS — neutral/comment verdict, no blocking findings.
- Inspected files:
scripts/setup-kapi-cli.mjs,test/cli-bin.test.ts,docs/product-name-audit.md, andpackage.json.
Remaining risks and approval rationale
Remaining risk is low: the historical scripts/setup-kapi-cli.mjs filename remains product-named, but this is explicitly documented as compatibility debt and intentionally outside this PR’s scope. Approval is justified because the behavioral change is narrow, compatibility is preserved, and the new tests cover the setup and production-install contracts that could regress.
Blocking issues
None.
Warnings / risks
scripts/setup-kapi-cli.mjs: the filename remains product-specific, but the audit correctly classifies it as compatibility filename debt for a later scoped migration.
Suggestions
- In a future migration slice, consider adding a generic setup script alias before renaming or deprecating
setup-kapi-cli.mjs, so existing automation has a transition path.
Looks good
- The setup output now clearly prefers
runctl --helpwhile preservingkapi --help. - The tests validate real installed shims in both setup and production-style install paths, which is the right level for this contract.
- The product-name audit stays aligned with the implementation and explains why the remaining product-named setup helper is intentional.
Verification notes
Verifier gate status: PASS — npm ci && npm run verify exited 0. Size gate status: PASS — 40 changed lines. Revision-explanation status: not required and present. Ilchul review harness gate: PASS with no blocking findings.
Engine: pi
|
@kapi-agent review Revision explanation for current head What changed:
Why this closes the current gate:
Verification:
|
Summary
npm run setup:clipoint users torunctl --helpfirst while preservingkapi --helpcompatibility.runctlandkapi) work from isolated prefix and production-style installs.Linked issue
Refs #205
Problem
Issue #205 is normalizing reusable surfaces away from product names without breaking existing compatibility contracts. PR #206 added the generic
runctlbin, but the setup helper still printed a Kapi-first completion message and tests only asserted the installedkapishim. That left the documentednpm run setup:cli→runctl --helppath less directly guarded.Options considered
scripts/setup-kapi-cli.mjsimmediately.Selected approach
Selected option: option 2.
Why this one: it moves the user-visible setup path toward
runctlwithout creating a breaking script rename or over-expanding #205 into a broad product-name migration.Risks/trade-offs:
scripts/setup-kapi-cli.mjsremains product-named. The audit explicitly classifies that as compatibility filename debt for a later scoped migration.Implementation by file/surface
scripts/setup-kapi-cli.mjs: addssetupCompletionMessage()and printsRuntime CLI setup complete. Run: runctl --help (or kapi --help for compatibility).test/cli-bin.test.ts: asserts the helper message, verifiesrunctlandkapishims aftersetup:cli, and verifies both shims in production-stylenpm install -g --omit=devinstalls.docs/product-name-audit.md: adds setup-helper classification while preserving the existing runtime entrypoint and slash-command compatibility classifications.Why this fixes it
The setup command now guides users to the canonical generic runtime command while retaining the legacy command in the same message. The install tests prove
runctlis not just listed inpackage.json; it is actually installed and executable in the setup and production-install paths.QA / Verification
npm ci— passgit diff --check— passnpm test -- test/cli-bin.test.ts— pass; package script shape ran the fulltest/*.test.tssuite plustest/cli-bin.test.ts(517 tests, 506 pass, 11 skipped)npm run check— passnpm run check:unused— passnpm run quality:budgets— pass with existing non-failingcode_smellsbudget warningAnomalies observed
npm test -- test/cli-bin.test.tsdoes not narrow to only that file because the package script istsx --test test/*.test.ts; it ran the full suite plus the explicit file argument.npm ci/verification produced recurring mode-only churn onsrc/cli/kapi-review-cli.ts; it was reset before staging and is not included in the commit.Risks / Follow-up
setup-kapi-cli.mjsitself should gain a generic filename/alias.kapi-agent review expectations and current-head merge gate
33 insertions / 7 deletions) and below the 200 changed-line gate.kapi-agentformal APPROVED review, successfulkapi-agent/reviewcheck, successful formal approval gate, mergeable PR state, and local verification evidence above before merge.