feat(cli): add generic runtime command alias#206
Conversation
|
@kapi-agent review Revision explanation for current head What changed:
Why this closes the prior feedback:
Verification:
|
There was a problem hiding this comment.
kapi-agent review
Verdict: APPROVE
Final approval summary
Review journey
The original goal was to add a generic runtime CLI command while preserving Kapi compatibility contracts. The semantic scope is bounded: one additive bin alias, semantic parser/runner export aliases, targeted help text parameterization, tests, and naming/audit docs. There was no prior kapi-agent blocking feedback on this PR, so no review/fix ping-pong was required.
What changed
- Added
runctlinpackage.jsonandbin/runctl.mjs. - Updated
src/cli/kapi-cli.tsto exposeparseRuntimeArgs/runRuntimeCliwhile retainingparseKapiArgs/runKapiCli. - Parameterized CLI help/usage strings by runtime command name.
- Added regression coverage in
test/cli-args.test.tsandtest/cli-bin.test.ts. - Updated
README.md,docs/ilchul-naming-policy.md, and addeddocs/product-name-audit.md.
Why this is correct
The change is additive for users: kapi remains present and tested, while runctl gets its own wrapper that sets ILCHUL_RUNTIME_CLI_NAME=runctl before invoking the same runtime implementation. Persisted workflow IDs, slash commands, storage names, and GitHub integration names are intentionally not renamed, matching the compatibility policy and reducing migration risk.
Evidence
Verifier gate: PASS. Size gate: PASS at 172 changed lines, with semantic source/test/doc scope below the review threshold. Revision-explanation status: not required, found. Ilchul harness gate: PASS with neutral/comment result and no blocking findings. Reported verification includes npm ci && npm run verify passing. I also inspected the changed implementation paths locally, including package.json, bin/runctl.mjs, bin/kapi.mjs, src/cli/kapi-cli.ts, and CLI tests.
Remaining risks and approval rationale
Remaining risk is limited to discoverability/setup messaging: the setup helper still has Kapi-oriented naming/output, but package bin installation should expose all configured bins and this is not a correctness blocker for the additive alias. Approval is justified because compatibility is preserved, tests cover both aliases, docs accurately frame the migration as a slice, and all gates pass.
Blocking issues
None.
Warnings / risks
scripts/setup-kapi-cli.mjsremains Kapi-named and prints Kapi-oriented setup output. This is acceptable for compatibility, but future migration slices may want to make the setup messaging mentionrunctl.
Suggestions
- Consider adding a small setup-helper assertion for installed
runctlintest/cli-bin.test.tsin a follow-up, since README now showsnpm run setup:clifollowed byrunctl --help.
Looks good
runctlis implemented as an additive wrapper and does not remove or weaken the existingkapibin.- The runtime command name is constrained by a simple allowlist regex before being used in help/usage output.
- Legacy exported names are preserved as aliases, reducing API churn.
- The audit document correctly avoids overclaiming a full product-name migration.
Verification notes
Verifier gate status: PASS (npm ci && npm run verify exited 0). Size gate status: PASS (172 changed lines under threshold). Revision-explanation status: not required, found. Ilchul harness gate: PASS with no blocking findings. Local review inspected the relevant CLI wrapper, parser/runner, package bin, tests, and docs.
Engine: pi
Summary
runctlas the canonical generic CLI runtime command while preservingkapias a compatibility alias.parseKapiArgs/runKapiClialiases retained.Linked issue
Refs #205
Problem
Issue #205 asks us to normalize reusable identifiers away from product names without breaking existing public contracts. The current CLI runtime surface was still anchored on
kapiin help text, parser/runner export names, package bins, and README examples. A broad replacement would be unsafe becausekapi,/kapi-*,kapi-agent/review, workflow IDs, and persisted state names are compatibility or external-integration contracts.Options considered
kapi→ilchulrenameSelected approach
Kapi*internal classes or persisted identifiers; those are recorded for follow-up slices rather than hidden in a broad PR.Implementation by file/surface
package.json,package-lock.json: addrunctlpackage bin while retainingkapiandkapi-review.bin/runctl.mjs: add executable JS wrapper that setsILCHUL_RUNTIME_CLI_NAME=runctlbefore loading the existing TypeScript CLI implementation.src/cli/kapi-cli.ts: introduceparseRuntimeArgsandrunRuntimeCli, preserveparseKapiArgsandrunKapiClicompatibility exports, and parameterize help/usage text by command name.test/cli-args.test.ts,test/cli-bin.test.ts: add regression coverage forrunctl --help, legacykapi --help, and package-localnpm exec -- runctl --help.README.md: preferrunctlfor new generic runtime examples while documentingkapicompatibility.docs/ilchul-naming-policy.md: clarify therunctlcanonical generic CLI surface.docs/product-name-audit.md: records current product-name surfaces, which ones are compatibility contracts, and what remains for follow-up.Why this fixes it
The first normalized slice now has a concrete generic runtime command (
runctl) and semantic parser/runner API (parseRuntimeArgs,runRuntimeCli) backed by tests. Existing users and integrations can keep usingkapi, while new reusable examples no longer need to introduce product-name leakage.QA / Verification
npm test -- test/cli-args.test.ts test/cli-bin.test.ts— pass; package script runs the full test suite plus explicit files (517tests,506pass,11skipped).npm run verify— pass (npm test,npm run check,npm run check:unused,npm run quality:budgets). Quality budgets report one existing warning:code_smells value=50 target="<=20" status=warn.git diff --check— pass.origin/dev:9 files changed, 131 insertions(+), 41 deletions(-)/172changed lines.Anomalies observed
npm run verifyrepeatedly toggledsrc/cli/kapi-review-cli.tsexecutable bit locally; the mode-only churn was reset before staging and is not included in the commit.[DEP0205] module.register() is deprecatedwarnings during tests; this is pre-existing test/runtime noise and not introduced by this slice.Risks / Follow-up
KapiRegistryEntry,KapiService, andKapiStoreare explicitly documented as follow-up work./kapi-*,kapi-agent/review,kapi-ralph,.ilchul, legacy.kapievidence) are intentionally retained until separate compatibility migrations exist.kapi-agent review expectations and current-head merge gate
172changed lines againstorigin/dev).kapi-agentshould verify thatrunctlis additive,kapicompatibility remains tested, and the audit does not overclaim full issue completion.kapi-agentapproval/check success after PR creation.