Files
msd-core/src/verification-command-router.cts
Jakub Zych a9a7a328e6 refactor: hard-fork GSD -> MSD (Make Software Done)
Mechanical rename produced by scripts/msd-rename.cjs: gsd/Gsd/GSD -> msd/Msd/MSD
across contents and paths, upstream package/repo coordinates -> @golem15/msd-core
and golem15com/msd-core. Deep links into upstream history, sibling upstream
packages, the GSD-2 import feature, CHANGELOG.md and .changeset/ are kept as-is.

Hand edits on top: MSD block-letter banner and logos, LICENSE copyright line,
package/plugin identity, regenerated lockfile, install-tree fixtures, derived
registries and benchmark baseline; migration checksum baseline re-locked
(MSD keeps its own install state, so no install had applied the old sums);
sort-order and regex-escaped expectations in tests adjusted.
2026-10-06 01:47:40 +02:00

61 lines
2.3 KiB
TypeScript

/**
* Verification-status subcommand router.
* Routes `verification.status <phaseDir>` to verification.cmdVerificationStatus.
*
* Note: `verification` (reads verifier-emitted status) is distinct from `verify`
* (runs verification checks like plan-structure/artifacts). Keep them separate.
*
* ADR-457 build-at-publish: source in src/verification-command-router.cts,
* compiled to msd-core/bin/lib/verification-command-router.cjs (gitignored).
*/
// eslint-disable-next-line @typescript-eslint/no-require-imports
import cjsCommandRouterAdapter = require('./cjs-command-router-adapter.cjs');
const { routeCjsCommandFamily } = cjsCommandRouterAdapter;
// ─── Types ────────────────────────────────────────────────────────────────────
interface VerificationModule {
cmdVerificationStatus(cwd: string, phaseDirArg: string | undefined, raw: boolean): void;
cmdVerificationResolveFile(cwd: string, phaseDirArg: string | undefined, raw: boolean): void;
cmdVerificationFingerprint(cwd: string, phaseDirArg: string | undefined, files: string[], raw: boolean): void;
}
interface RouteVerificationCommandOptions {
verification: VerificationModule;
args: string[];
cwd: string;
raw: boolean;
error: (message: string) => void;
}
// ─── Implementation ───────────────────────────────────────────────────────────
const VERIFICATION_SUBCOMMANDS = ['status', 'resolve-file', 'fingerprint'];
function routeVerificationCommand({
verification,
args,
cwd,
raw,
error,
}: RouteVerificationCommandOptions): void {
routeCjsCommandFamily({
args,
subcommands: VERIFICATION_SUBCOMMANDS,
unsupported: {},
error,
unknownMessage: (_subcommand: string, available: string[]) =>
`Unknown verification subcommand. Available: ${available.join(', ')}`,
handlers: {
status: () => verification.cmdVerificationStatus(cwd, args[2], raw),
'resolve-file': () => verification.cmdVerificationResolveFile(cwd, args[2], raw),
fingerprint: () => verification.cmdVerificationFingerprint(cwd, args[2], args.slice(3), raw),
},
});
}
export = {
routeVerificationCommand,
};