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
@@ -7,17 +7,21 @@ import { toolContractMetadata } from "./toolEffects.js";
|
||||
import { requireOutputSchema } from "./toolOutputSchemaPrimitives.js";
|
||||
import { appleAssetCatalogInputSchema } from "../domain/appleAssetCatalog.js";
|
||||
import { keyedArchiveInputSchema } from "../domain/keyedArchive.js";
|
||||
import { artifactIntegrityPolicySchema } from "../domain/artifactGraph.js";
|
||||
/** Exact caller boundary for deterministic artifact inventory. */
|
||||
export const artifactInventoryInputSchema = z.strictObject({
|
||||
integrity_policy: z.enum(["fail", "record-and-continue"]).default("fail"),
|
||||
integrity_policy: artifactIntegrityPolicySchema,
|
||||
});
|
||||
|
||||
/** Extraction needs no selector: it materializes every regular child file. */
|
||||
export const artifactExtractionInputSchema = z.strictObject({});
|
||||
export const artifactExtractionInputSchema = z.strictObject({
|
||||
integrity_policy: artifactIntegrityPolicySchema,
|
||||
});
|
||||
|
||||
/** Provider input containing the destination chosen by the local adapter. */
|
||||
export const artifactExtractionExecutionSchema = z.strictObject({
|
||||
output_root: z.string().min(1),
|
||||
integrity_policy: artifactIntegrityPolicySchema,
|
||||
});
|
||||
|
||||
const exampleInputSchema = z.record(z.string(), jsonValueSchema);
|
||||
@@ -63,7 +67,7 @@ export const ARTIFACT_TOOL_CONTRACTS = [
|
||||
),
|
||||
artifact(
|
||||
"extract_artifact",
|
||||
"Extract all regular files from the active archive or application package into a fresh temporary directory chosen by REA. The result includes its location. Rejects traversal and symlink escapes, never overwrites, enforces archive integrity checks, and verifies cleanup.",
|
||||
"Extract all regular files from the active archive or application package into a fresh temporary directory chosen by REA. The result includes its location. Rejects traversal and symlink escapes, never overwrites, enforces archive integrity checks, and verifies cleanup. Integrity mismatches fail by default; record-and-continue extracts the observed bytes and reports each mismatch as an untrusted integrity contradiction.",
|
||||
artifactExtractionInputSchema,
|
||||
),
|
||||
artifact(
|
||||
|
||||
@@ -79,7 +79,7 @@ export const ELECTRON_TOOL_CONTRACTS = [
|
||||
name: "analyze_javascript_application",
|
||||
...toolContractMetadata("analyze_javascript_application"),
|
||||
description:
|
||||
"Reconstruct one local ASAR or extracted JavaScript application as an inline application graph without executing it. Returns all recovered graph nodes, edges, semantic relations, limitations, and coverage.",
|
||||
"Reconstruct one local ASAR or extracted JavaScript application as an inline application graph without executing it. Returns all recovered graph nodes, edges, semantic relations, limitations, and coverage. Integrity mismatches, such as unpacked native modules signed after packaging, fail by default; record-and-continue analyzes the observed bytes and reports each mismatch as an untrusted integrity contradiction.",
|
||||
kind: "electron-provider",
|
||||
inputSchema: analyzeJavaScriptApplicationInputSchema,
|
||||
outputSchema: applicationOutputSchema,
|
||||
|
||||
Reference in New Issue
Block a user