From d29d2eb2987b77710539aec92ba66a88bf0e65a9 Mon Sep 17 00:00:00 2001 From: Clouds Beyond <34269366+cloudsbeyond@users.noreply.github.com> Date: Wed, 22 Jul 2026 15:13:00 +0800 Subject: [PATCH] fix: preserve npm CLI entrypoint Change-Id: Ie3b90bcb48e215fe5e5a08aecae55c2d9fb70553 --- CHANGELOG.md | 7 +++++++ architecture/project-traceability.md | 2 ++ architecture/project-traceability.yaml | 4 +++- package.json | 2 +- test/cli-rpc-smoke.test.ts | 7 +++++++ test/publication-identity.test.ts | 4 ++++ 6 files changed, 24 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5ed3338..83b8ca2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -31,6 +31,11 @@ No entries. - The local RPC documentation now makes non-loopback exposure an explicit human-owned architecture and security gate. +### Fixed + +- Normalized the npm `bin` path so the published manifest retains the + `agent-runtime-services` CLI entrypoint. + ### Validation Evidence - The release-candidate gate passed 117 tests across 15 test files under Node 20 @@ -43,6 +48,8 @@ No entries. - An isolated runtime home reported `readiness: ok`; real language, embedding, and vision calls succeeded, smoke output contained no configured secret, and an unconfigured runtime returned `missing_resource` for all model modules. +- The packed manifest preserved the CLI mapping and the packed CLI executed + `--version` and `--help` successfully. ### Residual Risks diff --git a/architecture/project-traceability.md b/architecture/project-traceability.md index 2be4135..2931d7f 100644 --- a/architecture/project-traceability.md +++ b/architecture/project-traceability.md @@ -31,6 +31,8 @@ direct post-publication or product-acceptance evidence exists. - `pnpm release:check`: 15 test files and 117 tests passed under Node 20 and Node 22; typecheck, build, and the 21-file package dry-run passed. +- The packed package manifest retained the `agent-runtime-services` CLI bin + mapping, and the packed CLI executed `--version` and `--help` successfully. - `pnpm security:audit`: no known production dependency vulnerabilities at the time of the check. - A dedicated isolated runtime home reported `readiness: ok`; real language, diff --git a/architecture/project-traceability.yaml b/architecture/project-traceability.yaml index 678d0b7..1d1015d 100644 --- a/architecture/project-traceability.yaml +++ b/architecture/project-traceability.yaml @@ -3,7 +3,7 @@ validation_baseline: observed_at: 2026-07-22 release_candidate: command: pnpm release:check - result: 15 test files and 117 tests passed on Node 20 and Node 22; typecheck, build, and 21-file package dry-run passed + result: 15 test files and 117 tests passed on Node 20 and Node 22; typecheck, build, 21-file package dry-run, packed CLI manifest, and packed CLI execution passed dependency_security: command: pnpm security:audit result: no known production dependency vulnerabilities @@ -98,6 +98,8 @@ requirements: - .github/workflows/ci.yml validation: - pnpm release:check + - packed package manifest retains the agent-runtime-services bin mapping + - packed CLI executes --version and --help residual_risk: - Consumer acceptance, npm publication, and production operation require separate evidence. - Node 22 with the experimental NODE_USE_ENV_PROXY flag emits runtime warnings on stderr; the CI-like matrix without that experimental flag passes. diff --git a/package.json b/package.json index 02b0eb6..1295135 100644 --- a/package.json +++ b/package.json @@ -17,7 +17,7 @@ }, "type": "module", "bin": { - "agent-runtime-services": "./bin/agent-runtime-services.mjs" + "agent-runtime-services": "bin/agent-runtime-services.mjs" }, "exports": { ".": { diff --git a/test/cli-rpc-smoke.test.ts b/test/cli-rpc-smoke.test.ts index fc7b660..cecf75f 100644 --- a/test/cli-rpc-smoke.test.ts +++ b/test/cli-rpc-smoke.test.ts @@ -461,6 +461,13 @@ describe('CLI RPC smoke', () => { runtimeHome, ]); await installPackedRuntimePackage(consumerHome); + const packedPackage = JSON.parse(await readFile( + join(consumerHome, 'node_modules', 'agent-runtime-services', 'package.json'), + 'utf8', + )) as { bin?: Record }; + expect(packedPackage.bin).toEqual({ + 'agent-runtime-services': 'bin/agent-runtime-services.mjs', + }); const packedBin = join(consumerHome, 'node_modules', 'agent-runtime-services', 'bin', 'agent-runtime-services.mjs'); await expect(execFileAsync(process.execPath, [packedBin, '--version'], { cwd: consumerHome, diff --git a/test/publication-identity.test.ts b/test/publication-identity.test.ts index c01a177..27b14ab 100644 --- a/test/publication-identity.test.ts +++ b/test/publication-identity.test.ts @@ -46,6 +46,7 @@ describe('publication identity', () => { readFile(join(repoRoot, 'architecture', 'release-readiness-contract.md'), 'utf8').catch(() => ''), ]); const pkg = JSON.parse(pkgRaw) as { + bin?: Record; files?: string[]; publishConfig?: { access?: string; registry?: string }; scripts?: Record; @@ -57,6 +58,9 @@ describe('publication identity', () => { ); expect(pkg.scripts?.prepublishOnly).toBe('pnpm test:acceptance && pnpm release:check'); expect(pkg.version).toBe('0.1.0'); + expect(pkg.bin).toEqual({ + 'agent-runtime-services': 'bin/agent-runtime-services.mjs', + }); expect(pkg.publishConfig).toEqual({ access: 'public', registry: 'https://registry.npmjs.org/',