docs(cli-registry): name the real tests and fields the catalogue docs point at

Three instructions a future contributor would follow literally were stale after
the last review round: the "Adding a CLI" checklist sent the agent-image reason to
AGENT_IMAGE_SPECIAL_CASES, a constant that no longer exists (it is
discovery.install.agentImageLayer on the entry in stock.ts), the trust-boundary
paragraph credited the embedded-commands pin to the invariants test when it is
test/cli-catalog-sync.test.ts, and install.sh claimed "the parity test" pinned the
DeepSeek Harness banner when no test did. That pin now exists: the invariants test
asserts the script's grep literal and the registry's discovery.identity.regex agree
on "DeepSeek Harness", and the comment names it.

docs/docker-cases.md separated the two reasons a CLI stays out of the shared npm
layer (no npmPackage at all versus an agentImageLayer entry), which it had folded
into one, and architecture-invariants no longer lists the agent image's CLI set by
hand.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This commit is contained in:
Codeman maintainer
2026-09-14 15:55:20 +02:00
parent 3566e8b5ff
commit a5cf1f6005
5 changed files with 32 additions and 10 deletions
+18
View File
@@ -14,6 +14,7 @@ import { describe, expect, it } from 'vitest';
import { spawnSync } from 'node:child_process';
import { readFileSync } from 'node:fs';
import { fileURLToPath } from 'node:url';
import { STOCK_CLIS } from '../src/config/cli-registry/stock.js';
const INSTALL_SH = fileURLToPath(new URL('../install.sh', import.meta.url));
const SOURCE = readFileSync(INSTALL_SH, 'utf-8');
@@ -167,6 +168,23 @@ describe('install.sh runtime safety', () => {
});
});
describe('install.sh DeepSeek identity probe', () => {
it('greps for the same banner the registry identity regex demands', () => {
// dsh_banner_probe is the ONE hand-written identity check left in the script (the
// registry's is a JavaScript regex, deliberately not translated into grep at install
// time). The two are pinned to each other here so an upstream banner change fails
// this test instead of mis-detecting on one side only.
const grepLine = CODE_LINES.find((line) => line.includes('grep -qi "DeepSeek Harness"'));
expect(grepLine, 'the dsh banner grep is gone or its literal changed').toBeDefined();
const deepseek = STOCK_CLIS.find((entry) => entry.id === 'deepseek');
const identity = deepseek?.discovery.identity;
expect(identity, 'the deepseek entry no longer declares an identity probe').toBeDefined();
expect(identity?.arg).toBe('--help');
expect(new RegExp(identity!.regex, 'i').test('DeepSeek Harness')).toBe(true);
});
});
describe('install.sh AI CLI install menu', () => {
// The menu is the one interactive path in the script, which is why it used to be the
// only part nothing exercised: choosing "s" (Skip) once fell straight into the shared