* refactor(#651): consolidate verification-status routing into one queryable seam The passed/gaps_found/human_needed verification status was re-encoded as bare strings across three prose surfaces (gsd-verifier emits, execute-phase routes, ship gates), each independently deciding the per-status next action with no parity coupling — the DEFECT.GENERATIVE-FIX class. Give the enum one home: src/verification.cts (-> bin/lib/verification.cjs) exposing `gsd_run query verification.status <phaseDir>` returning a typed {status, next_action, next_command}. ship.md and execute-phase.md now consume the query instead of re-deriving the routing in prose; gsd-verifier.md points at the shared vocabulary as the single emitter (values unchanged). Also fixes the latent broad-grep status misread (DEFECT.FRONTMATTER-SCALAR- BROAD-GREP): execute-phase.md read `grep "^status:"` over the whole report, so a body `status:` line could misroute a valid phase. Extraction is now frontmatter-scoped in one place. A parity test fails if a verifier status gains no route. Lands the two CONTEXT.md DEFECT entries captured on the issue. Closes #651 Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> * chore(#651): set changeset pr to 755 Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
57 lines
1.9 KiB
TypeScript
57 lines
1.9 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 gsd-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;
|
|
}
|
|
|
|
interface RouteVerificationCommandOptions {
|
|
verification: VerificationModule;
|
|
args: string[];
|
|
cwd: string;
|
|
raw: boolean;
|
|
error: (message: string) => void;
|
|
}
|
|
|
|
// ─── Implementation ───────────────────────────────────────────────────────────
|
|
|
|
const VERIFICATION_SUBCOMMANDS = ['status'];
|
|
|
|
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),
|
|
},
|
|
});
|
|
}
|
|
|
|
export = {
|
|
routeVerificationCommand,
|
|
};
|