feat(artifacts): let extraction and JavaScript analysis record integrity mismatches
macOS code signing rewrites unpacked native modules after electron-builder records their ASAR integrity, so the declared and observed hashes of those .node files differ in most signed Electron apps. Claude, ChatGPT, Notion, Obsidian, and Tabby all failed inspect_artifact, extract_artifact, and analyze_javascript_application by default. Only inspect_artifact offered integrity_policy, so extraction and JavaScript analysis of these apps was impossible. extract_artifact and analyze_javascript_application now accept the same integrity_policy (default fail). With record-and-continue, extraction writes the observed bytes, and JavaScript analysis reads contradicted files as observed. Contradicted nested archives stay unexpanded. Both results return the recorded integrity_contradictions and a limitation. The mismatch remediation now names this option instead of only advising a fresh copy, which cannot help for a signed installation. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
0804722cdf
commit
69af884666
@@ -153,14 +153,23 @@ const registerExtractionCommand = (cli: CliInstance, logger: Logger): void => {
|
||||
args: z.object({
|
||||
path: z.string().describe("Application or package path"),
|
||||
}),
|
||||
options: z.object({}),
|
||||
run: ({ args }) =>
|
||||
options: z.object({
|
||||
integrityPolicy: z
|
||||
.enum(["fail", "record-and-continue"])
|
||||
.default("fail")
|
||||
.describe("Behavior when declared artifact integrity does not match"),
|
||||
}),
|
||||
alias: {
|
||||
integrityPolicy: "integrity-policy",
|
||||
},
|
||||
run: ({ args, options }) =>
|
||||
logCliCommand(logger, "extract-artifact", () =>
|
||||
runProviderAnalysis(
|
||||
args.path,
|
||||
"extract_artifact",
|
||||
{
|
||||
output_root: createArtifactExtractionDestination(),
|
||||
integrity_policy: options.integrityPolicy,
|
||||
},
|
||||
logger,
|
||||
),
|
||||
|
||||
@@ -175,6 +175,7 @@ const registerJavaScriptApplicationCommand = (
|
||||
runCliJavaScriptApplicationAnalysis({
|
||||
input_path: args.path,
|
||||
format: options.artifactFormat,
|
||||
integrity_policy: options.integrityPolicy,
|
||||
}),
|
||||
),
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user