fix(artifacts): keep integrity policy and extraction claims aligned (#1083)

* fix(artifacts): keep integrity policy and extraction claims aligned

rea analyze routed a JavaScript application without the integrity policy,
so the remediation flag it recommends was rejected on that command. The
routed command now accepts --integrity-policy and forwards it.

Extraction copied every inventory contradiction into the result and said
those files were written. Only materialized occurrences stay in that list;
nested contradictions are named as unwritten.

* test(artifacts): type the nested extraction fixture as a directory path

---------

Co-authored-by: Cursor Agent <cursoragent@cursor.com>
This commit is contained in:
morluto
2026-10-08 22:41:35 +08:00
committed by GitHub
co-authored by Cursor Agent
parent 467f68412e
commit ac392da332
3 changed files with 76 additions and 4 deletions
+13 -1
View File
@@ -42,7 +42,17 @@ const registerOverviewCommands = (cli: CliInstance, logger: Logger): void => {
args: z.object({
path: z.string().describe("App, program, or analysis database path"),
}),
options: overviewOptions,
options: overviewOptions.extend({
integrityPolicy: z
.enum(["fail", "record-and-continue"])
.default("fail")
.describe(
"Behavior when a routed JavaScript application declares integrity that does not match",
),
}),
alias: {
integrityPolicy: "integrity-policy",
},
run: ({ args, options }) =>
logCliCommand(logger, "analyze", () =>
runRoutedOverview(args.path, options, logger),
@@ -107,6 +117,7 @@ const runRoutedOverview = async (
readonly snapshot?: string | undefined;
readonly "target-format"?: "dos-com" | undefined;
readonly provider?: string | undefined;
readonly integrityPolicy?: "fail" | "record-and-continue" | undefined;
},
logger: Logger,
) => {
@@ -118,6 +129,7 @@ const runRoutedOverview = async (
)
return runCliJavaScriptApplicationAnalysis({
input_path: resolve(path),
integrity_policy: options.integrityPolicy ?? "fail",
});
return runDirectAnalysis(
path,