feat(analysis): add opt-in retained inventory and WASM views (#2122)

Add opt-in retained inventory and WASM Evidence views with exact nested output contracts and a small static WASM descriptor. Preserve old complete CLI/MCP workflows, producer choices, original authenticated Evidence and cleanup ownership.

Validated with real public applications, genuine old Evidence migration, 123 focused assertions, 11 synchronized description checks and 42 installed-package WABT cases. Detailed generated experiment JSON stays outside the final tree; concise findings and reproduction inputs remain. Main-existing completion/package CI failures are separately attributed and left unchanged.

Refs #2016

Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>
This commit is contained in:
Ysopwnable
2026-10-12 21:17:52 +08:00
committed by GitHub
co-authored by factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>
parent 3159732597
commit 58fb372071
55 changed files with 4322 additions and 235 deletions
+8 -5
View File
@@ -1,5 +1,5 @@
import type { WasmArtifactService } from "../application/wasm/WasmArtifactService.js";
import { createWasmArtifactService } from "../composition/wasm.js";
import { wasmArtifactModule } from "../composition/wasm.js";
import { registerWasmTools } from "./registerWasmTools.js";
import { snapshotEnvironment } from "../process/snapshotEnvironment.js";
import { createPeResourcesService } from "../composition/binaryDiagnostics.js";
@@ -246,8 +246,10 @@ export const createServer = (
);
const android =
options.androidAnalysis ?? createAndroidAnalysisProvider(environment);
const wasmArtifact =
options.wasmArtifact ?? createWasmArtifactService(environment);
const wasmArtifact = wasmArtifactModule.create(
environment,
options.wasmArtifact,
);
const apktool =
options.apktoolAnalysis ??
createApktoolResourceAnalysisProvider(environment);
@@ -399,7 +401,7 @@ const registerConfiguredAnalysisTools = (
withAdmittedAnalysis,
}: ServerToolContext,
android: AndroidAnalysisPort,
wasmArtifact: WasmArtifactService,
wasmArtifact: Pick<WasmArtifactService, "inspect" | "close">,
jeb: JebAnalysisPort,
firmwareAnalysis: FirmwareAnalysisService,
): void => {
@@ -557,6 +559,7 @@ const registerBinaryAnalysisTools = ({
activeTarget,
recordEvidence,
recordEvidenceWithUnknown,
evidenceById,
withAdmittedAnalysis,
}: ServerToolContext): void => {
const recordUnknown =
@@ -592,7 +595,7 @@ const registerBinaryAnalysisTools = ({
withAdmittedAnalysis,
};
registerEvidenceTools(server, NATIVE_TOOL_CONTRACTS, evidenceOptions);
registerArtifactTools(server, evidenceOptions);
registerArtifactTools(server, { ...evidenceOptions, evidenceById });
registerManagedTools(server, evidenceOptions);
if (session !== undefined)
registerManagedWorkflowTools(server, {