refactor(cli): project reconstruction and source-to-bundle documents from their contracts (#10697)

* refactor(cli): project reconstruction ledger and coverage commands from their contracts

* refactor(cli): project compare-source-to-bundle from its contract and refuse omitted document fields

* fix(cli): advertise caller paths in JSON documents as the CLI admits them

* fix(cli): advertise that JSON document caller paths exclude URLs

* refactor(cli): narrow omitted document field refusal to object documents

* test(cli): give the coverage document fixture the current evidence_format
This commit is contained in:
morluto authored and GitHub committed 2026-11-15 19:40:22 +08:00
1 parent fd2eabb12a
commit 9be6a96fd6
12 files changed
+456 -182

No files matched your search

@@ -1,7 +1,4 @@
import {
absoluteLocalPathStringSchema,
localPathStringSchema,
} from "../../domain/localPath.js";
import { absoluteLocalPathStringSchema } from "../../domain/localPath.js";
import { sourceToBundleViewRequestSchema } from "../../domain/analysisView/sourceToBundleView.js";
import { featureTraceViewRequestSchema } from "../../domain/analysisView/featureTraceView.js";
import { z } from "zod";
@@ -85,9 +82,10 @@ export const compareApplicationVersionsRequestSchema = z.strictObject({
right: evidenceInputSchema,
});
/** Historical graph JSON is a transport alternative to the inline graph, authenticated by the same graph parser. */
const referenceFile = z.strictObject({
kind: z.literal("file"),
path: localPathStringSchema,
path: absoluteLocalPathStringSchema,
});
const sourceToBundleSelection = {
view: z
@@ -97,19 +95,11 @@ const sourceToBundleSelection = {
])
.optional(),
};
/** Historical graph JSON is a transport alternative to the inline graph, authenticated by the same graph parser. */
export const compareSourceToBundleCliInputSchema = z.strictObject({
reference: z.union([
compareSourceToBundleInputSchema.shape.reference,
referenceFile,
]),
application: evidenceInputSchema,
});
/** The MCP host accepts absolute local paths; omitted view preserves the full report. */
export const compareSourceToBundleRequestSchema = z.strictObject({
reference: z.union([
compareSourceToBundleInputSchema.shape.reference,
referenceFile.extend({ path: absoluteLocalPathStringSchema }),
referenceFile,
]),
application: evidenceInputSchema,
...sourceToBundleSelection,