Files
reverse-engineering-anything/src/domain/reconstructionCoverageInput.ts
T
d734e6424d fix(cli): advertise parsed JSON documents in --schema
`--schema` for JSON-input CLI commands showed only an opaque
`inputJson` string, so callers could not see the document the command
actually parses. The argument now carries the decoded document as its
contentSchema, built from the same contract each command or its service
parses with (the Evidence input frame, or the ledger and coverage
request schemas). `$schema` is stripped, and a schema JSON Schema cannot
represent is refused rather than advertised as {}.

Fixes #9195
Supersedes #9283

Squashed from #9283 (with morluto's validation test) and rebased onto
main; the coverage test now expects boundary_id's stable-identifier
pattern from #9919. #9214 by 1052326311 took the same approach.

Co-Authored-By: morluto <76467478+morluto@users.noreply.github.com>
Co-Authored-By: 1052326311 <65798732+1052326311@users.noreply.github.com>
Co-Authored-By: gensokyo-dev <342580529+gensokyo-dev@users.noreply.github.com>
2026-11-14 14:16:39 +01:00

21 lines
686 B
TypeScript

import { z } from "zod";
import {
reconstructionBoundaryIdSchema,
reconstructionCoverageDataSchema,
} from "./reconstructionCoverage.js";
/** Named-boundary input for inline reconstruction coverage evaluation. */
export const reconstructionCoverageEvaluationInputSchema = z.strictObject({
coverage: reconstructionCoverageDataSchema,
boundary_id: reconstructionBoundaryIdSchema,
});
/**
* Envelope the coverage command parses before its reader authenticates
* `coverage`. The reader owns that document, so this field stays unknown.
*/
export const reconstructionCoverageRequestSchema =
reconstructionCoverageEvaluationInputSchema.extend({
coverage: z.unknown(),
});