Skip to content

Commit 28ca8a0

Browse files
authored
fix: remove kapi runtime alias (#225)
Squash merge PR #225 after kapi-agent approval and successful required checks.
1 parent 811120b commit 28ca8a0

5 files changed

Lines changed: 35 additions & 30 deletions

File tree

bin/kapi.mjs

Lines changed: 0 additions & 12 deletions
This file was deleted.

docs/product-name-audit.md

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ git grep -n -i -E 'kapi|ilchul' -- ':!package-lock.json' ':!node_modules'
1414

1515
| Surface | Current state | Classification | Follow-up direction |
1616
| --- | --- | --- | --- |
17-
| Package metadata | `package.json` is still named `ka-pi`; package bins include public `ilchul` and `kapi-review`. | package brand / external review integration | Do not retain a `kapi` runtime CLI alias. Prefer `ilchul` for public runtime docs and examples; reserve `runctl` for internal runtime implementation naming. Keep `kapi-review` while the GitHub review integration uses that command. |
18-
| CLI runtime entrypoint | `src/cli/runctl-cli.ts` and related tests use semantic runtime names. This slice keeps the public `ilchul` command wired through the internal `bin/runctl.mjs` wrapper and semantic `parseRuntimeArgs` / `runRuntimeCli` exports without retaining a `kapi` runtime CLI alias. | public brand command with internal semantic implementation | Internal runtime callers should import from `src/cli/runctl-cli.ts` and use semantic runtime exports; product-named command aliases stay at the package/bin edge. |
17+
| Package metadata | `package.json` is still named `ka-pi`; package bins include public `ilchul` and external `kapi-review`, but no `kapi` runtime bin. | package brand / external review integration | Do not retain a `kapi` runtime CLI alias. Prefer `ilchul` for public runtime docs and examples; reserve `runctl` for internal runtime implementation naming. Keep `kapi-review` while the GitHub review integration uses that command. |
18+
| CLI runtime entrypoint | `src/cli/runctl-cli.ts` and related tests use semantic runtime names. This slice keeps the public `ilchul` command wired through the internal `bin/runctl.mjs` wrapper and semantic `parseRuntimeArgs` / `runRuntimeCli` exports, removes the old `bin/kapi.mjs` shim, and verifies package-local/prefix installs do not expose `kapi`. | public brand command with internal semantic implementation | Internal runtime callers should import from `src/cli/runctl-cli.ts` and use semantic runtime exports; product-named runtime command aliases must not be reintroduced at the package/bin edge. |
1919
| CLI setup helper | `setup:cli` still invokes `scripts/setup-runctl-cli.mjs`, but its completion text now points to `ilchul --help`. | internal semantic filename plus brand-facing user guidance | Keep output brand-facing where users see it and implementation filename semantic internally. |
2020
| Slash commands and workflow IDs | `/kapi-*`, `kapi-ralph`, `kapi-autoresearch`, and related state fields remain serialized workflow contracts. | persisted compatibility identifiers | Do not rename without an explicit compatibility/deprecation migration. |
2121
| Storage/config | `.ilchul`, `~/.ilchul`, `.kapi` historical references, and `ILCHUL_*` environment variables appear in docs/tests/runtime setup. | storage/config namespace | `.ilchul` is active storage; `.kapi` is legacy evidence only and must not be deleted by this issue. |
@@ -40,18 +40,28 @@ git grep -n -i -E 'kapi|ilchul' -- ':!package-lock.json' ':!node_modules'
4040
- Presentation registration/UI action helpers now use semantic workflow names (`registerWorkflowExtension`, `registerWorkflowCommandsAndTools`, `registerWorkflowTools`, `WorkflowUiActionContext`, `installWorkflowAutocomplete`, `toggleWorkflowWidgetExpanded`) while leaving public `kapi_*` tool names and `/kapi-*` contracts intact.
4141
- Adapter/domain private helper names now use semantic state/workflow naming for symlink guards, managed autoresearch symlinks, worker branch validation, and prompt rule rendering while preserving user-facing Kapi contract text.
4242
- Review gate helper exports now use semantic review-gate names (`ReviewGateInput`, `ReviewGateResult`, `buildReviewGate`, `runReviewGateCli`, `parseReviewGateArgs`, `REVIEW_GATE_MAX_CHANGED_LINES`) while preserving the `kapi-review` CLI and `kapi-agent` review contract text.
43+
- Runtime package metadata now exposes only the `ilchul` runtime bin and the external `kapi-review` review harness; `kapi` is absent from `package.json` / `package-lock.json`, `bin/kapi.mjs` is removed, and `test/cli-bin.test.ts` asserts package-local and isolated-prefix installs do not expose a `kapi` runtime command.
4344

44-
## Residual scan after service filename rename
45+
## Residual scan after runtime alias removal
4546

4647
```text
4748
find src -iname '*kapi*' -print
4849
src/.kapi
4950
src/.kapi/lanes/kapi-autoresearch
5051
src/.kapi/lanes/kapi-autoresearch/kapi-ux-개선-계획
5152
src/cli/kapi-review-cli.ts
53+
54+
node -e 'const p=require("./package.json"); console.log(JSON.stringify(p.bin,null,2))'
55+
{
56+
"ilchul": "./bin/runctl.mjs",
57+
"kapi-review": "./src/cli/kapi-review-cli.ts"
58+
}
59+
60+
rg -n '"kapi"\\s*:|bin/kapi|npm exec -- kapi|kapi compatibility alias|kapi --help' package.json package-lock.json README.md docs test bin src scripts
61+
test/cli-bin.test.ts:41:test("package metadata exposes ilchul runtime bin without kapi compatibility alias", async () => {
5262
```
5363

54-
Remaining filename hits are legacy fixture state under `src/.kapi` and the literal `kapi-review` external integration CLI. The former application service/factory filename hits moved to semantic `workflow-service` paths in this slice.
64+
Remaining `src/` filename hits are legacy fixture state under `src/.kapi` and the literal `kapi-review` external integration CLI. Runtime package metadata no longer exposes a `kapi` bin, and the old direct `bin/kapi.mjs` shim is removed.
5565

5666
## Remaining justified product-name identifiers
5767

package-lock.json

Lines changed: 0 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
"type": "module",
77
"bin": {
88
"ilchul": "./bin/runctl.mjs",
9-
"kapi": "./bin/kapi.mjs",
109
"kapi-review": "./src/cli/kapi-review-cli.ts"
1110
},
1211
"keywords": [

test/cli-bin.test.ts

Lines changed: 21 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ const execFileAsync = promisify(execFile);
1010
const repoRoot = process.cwd();
1111
const setupScript = path.join(repoRoot, "scripts", "setup-runctl-cli.mjs");
1212

13-
test("package-local ilchul bin runs help while kapi stays a compatibility alias", async () => {
13+
test("package-local ilchul bin runs help without exposing kapi runtime alias", async () => {
1414
const binPath = path.join(repoRoot, "bin", "runctl.mjs");
1515
const mode = (await stat(binPath)).mode;
1616
assert.notEqual(mode & 0o111, 0, "bin/runctl.mjs must be executable for npm bin shims");
@@ -27,16 +27,21 @@ test("package-local ilchul bin runs help while kapi stays a compatibility alias"
2727
assert.doesNotMatch(ilchul.stdout, /kapi remains available|compatibility alias/i);
2828
assert.doesNotMatch(ilchul.stderr, /Permission denied/i);
2929

30-
const kapi = await execFileAsync("npm", ["exec", "--", "kapi", "--help"], { cwd: repoRoot, timeout: 20_000 });
31-
assert.match(kapi.stdout, /kapi workflow runtime/);
32-
assert.match(kapi.stdout, /kapi start ralph/);
33-
assert.doesNotMatch(kapi.stderr, /Permission denied/i);
30+
await assert.rejects(
31+
execFileAsync("npm", ["exec", "--", "kapi", "--help"], { cwd: repoRoot, timeout: 20_000 }),
32+
(error: unknown) => {
33+
const failure = error as { code?: number; stdout?: string; stderr?: string };
34+
assert.notEqual(failure.code, 0);
35+
assert.doesNotMatch(`${failure.stdout ?? ""}\n${failure.stderr ?? ""}`, /kapi workflow runtime|kapi start ralph/);
36+
return true;
37+
},
38+
);
3439
});
3540

36-
test("package metadata exposes ilchul runtime bin and kapi compatibility alias", async () => {
41+
test("package metadata exposes ilchul runtime bin without kapi compatibility alias", async () => {
3742
const packageJson = JSON.parse(await readFile(path.join(repoRoot, "package.json"), "utf8")) as { bin: Record<string, string> };
3843
assert.equal(packageJson.bin.ilchul, "./bin/runctl.mjs");
39-
assert.equal(packageJson.bin.kapi, "./bin/kapi.mjs");
44+
assert.equal(packageJson.bin.kapi, undefined);
4045
});
4146

4247
test("setup helper uses Windows-safe npm execution and prefix paths", async () => {
@@ -74,7 +79,7 @@ test("setup helper uses Windows-safe npm execution and prefix paths", async () =
7479
]);
7580
});
7681

77-
test("setup helper installs ilchul into an isolated prefix", async () => {
82+
test("setup helper installs only ilchul into an isolated prefix", async () => {
7883
const prefix = await mkdtemp(path.join(os.tmpdir(), "kapi-cli-setup-"));
7984
const result = await execFileAsync("npm", ["run", "setup:cli", "--", "--prefix", prefix], { cwd: repoRoot, timeout: 120_000 });
8085
assert.match(result.stdout, /Ilchul CLI setup complete/);
@@ -89,10 +94,14 @@ test("setup helper installs ilchul into an isolated prefix", async () => {
8994
assert.doesNotMatch(ilchul.stderr, /Permission denied/i);
9095

9196
const kapiCommand = path.join(binDir, process.platform === "win32" ? "kapi.cmd" : "kapi");
92-
const kapi = await execFileAsync(kapiCommand, ["--help"], { cwd: repoRoot, timeout: 20_000 });
93-
assert.match(kapi.stdout, /kapi workflow runtime/);
94-
assert.match(kapi.stdout, /kapi start ralph/);
95-
assert.doesNotMatch(kapi.stderr, /Permission denied/i);
97+
await assert.rejects(
98+
execFileAsync(kapiCommand, ["--help"], { cwd: repoRoot, timeout: 20_000 }),
99+
(error: unknown) => {
100+
const failure = error as NodeJS.ErrnoException & { stdout?: string; stderr?: string };
101+
assert.equal(failure.code, "ENOENT");
102+
return true;
103+
},
104+
);
96105
});
97106

98107
test("package install works when dev dependencies are omitted", async () => {

0 commit comments

Comments
 (0)