fix(verify): report final success only after resource cleanup

This commit is contained in:
morluto
2026-10-09 04:12:49 +08:00
parent 3eb7dbdc16
commit ee043e2cbf
17 changed files with 277 additions and 195 deletions
+3
View File
@@ -43,6 +43,9 @@ through the compiled public CLI or MCP runtime. Calling a compiled private
workflow or injecting a provider still establishes its narrower integration workflow or injecting a provider still establishes its narrower integration
claim, even if a directory name calls it acceptance. claim, even if a directory name calls it acceptance.
Emit a verifier's final success report only after awaited cleanup. Observe final
process lineage after closing its owned resources.
Measure slow files before removing capacity regressions. Optimize repeated Measure slow files before removing capacity regressions. Optimize repeated
process startup, fixture construction, and production algorithms when they process startup, fixture construction, and production algorithms when they
dominate runtime. Keep at least one input beyond each formerly failing size or dominate runtime. Keep at least one input beyond each formerly failing size or
+8 -3
View File
@@ -13,6 +13,7 @@ if (!executable)
const profile = await mkdtemp(join(tmpdir(), "rea-browser-dom-")); const profile = await mkdtemp(join(tmpdir(), "rea-browser-dom-"));
const site = await startBrowserVerifierSite(); const site = await startBrowserVerifierSite();
let context; let context;
let report;
try { try {
context = await chromium.launchPersistentContext(profile, { context = await chromium.launchPersistentContext(profile, {
executablePath: executable, executablePath: executable,
@@ -43,11 +44,15 @@ try {
process.argv[2], process.argv[2],
page.url(), page.url(),
); );
process.stdout.write( report = {
`${JSON.stringify({ ...result, browser: context.browser().version(), native_oracle: true, verified: true })}\n`, ...result,
); browser: context.browser().version(),
native_oracle: true,
verified: true,
};
} finally { } finally {
await context?.close(); await context?.close();
await site.close(); await site.close();
await rm(profile, { recursive: true, force: true }); await rm(profile, { recursive: true, force: true });
} }
process.stdout.write(`${JSON.stringify(report)}\n`);
+14 -3
View File
@@ -15,6 +15,7 @@ if (process.platform !== "darwin")
const root = await mkdtemp(join(tmpdir(), "rea-ui-fixture-")); const root = await mkdtemp(join(tmpdir(), "rea-ui-fixture-"));
let child; let child;
let fixturePid; let fixturePid;
let report;
try { try {
const childRetrievalTest = join(root, "child-retrieval-test"); const childRetrievalTest = join(root, "child-retrieval-test");
await promisify(execFile)("/usr/bin/xcrun", [ await promisify(execFile)("/usr/bin/xcrun", [
@@ -187,9 +188,18 @@ try {
); );
if (mismatch.ok || !mismatch.error.message.includes("target-mismatch")) if (mismatch.ok || !mismatch.error.message.includes("target-mismatch"))
throw new Error("Real helper did not reject changed target bytes"); throw new Error("Real helper did not reject changed target bytes");
process.stdout.write( report = {
`${JSON.stringify({ ok: true, verification_status: observation.ok ? "passed" : "permission-boundary-only", positive_e2e: observation.ok, observation: observation.ok ? "captured-selected-fixture-window" : "os-permission-denial-verified", scenario: scenarioStatus, permission_failure: observation.ok ? null : observation.error.message, mismatch_rejected: true, target_owned: true })}\n`, ok: true,
); verification_status: observation.ok ? "passed" : "permission-boundary-only",
positive_e2e: observation.ok,
observation: observation.ok
? "captured-selected-fixture-window"
: "os-permission-denial-verified",
scenario: scenarioStatus,
permission_failure: observation.ok ? null : observation.error.message,
mismatch_rejected: true,
target_owned: true,
};
} finally { } finally {
if (fixturePid !== undefined) { if (fixturePid !== undefined) {
try { try {
@@ -205,3 +215,4 @@ try {
} }
await rm(root, { recursive: true, force: true }); await rm(root, { recursive: true, force: true });
} }
process.stdout.write(`${JSON.stringify(report)}\n`);
+39 -3
View File
@@ -34,6 +34,7 @@ let tarball;
let mcpStartup; let mcpStartup;
let mcpModuleLoading; let mcpModuleLoading;
let update; let update;
let report;
try { try {
({ tarball } = await verifyPackagePack({ root, workspace })); ({ tarball } = await verifyPackagePack({ root, workspace }));
@@ -132,9 +133,44 @@ try {
evidenceRoot, evidenceRoot,
artifactArchive, artifactArchive,
}); });
process.stdout.write( report = {
`${JSON.stringify({ verifier_run: await completeVerifierRun(verifierRun), cli: true, analysisCli: true, artifactCli: true, managedCli: true, managedReconstructionCli: true, managedNativeVerificationCli: true, managedApplicationGraphCli: true, evidenceCli: true, incurMcpCommand: PRODUCT_IDENTITY.mcpCommand, lifecycleScriptsRequired: false, doctor: "platform-appropriate", setup: supportedSetupHost ? "planned-then-idempotent" : "unsupported-host-rejected", setupPlanReadOnly: supportedSetupHost, existingHopperPreserved: supportedSetupHost, clients: supportedSetupHost ? 4 : 0, backupReadback: supportedSetupHost, failureRecovery: supportedSetupHost, configSymlinkLifecycle: supportedSetupHost, skill: supportedSetupHost, skillReferences: supportedSetupHost, mcpTools: TOOL_CONTRACTS.length, mcpPrompts: prompts.names.length, promptCompletion: true, promptCompletionLifecycle: true, evidenceMcp: true, targetFree: true, targetLifecycle: true, boundedRegexBridge: true, update, mcpStartup, mcpModuleLoading })}\n`, cli: true,
); analysisCli: true,
artifactCli: true,
managedCli: true,
managedReconstructionCli: true,
managedNativeVerificationCli: true,
managedApplicationGraphCli: true,
evidenceCli: true,
incurMcpCommand: PRODUCT_IDENTITY.mcpCommand,
lifecycleScriptsRequired: false,
doctor: "platform-appropriate",
setup: supportedSetupHost
? "planned-then-idempotent"
: "unsupported-host-rejected",
setupPlanReadOnly: supportedSetupHost,
existingHopperPreserved: supportedSetupHost,
clients: supportedSetupHost ? 4 : 0,
backupReadback: supportedSetupHost,
failureRecovery: supportedSetupHost,
configSymlinkLifecycle: supportedSetupHost,
skill: supportedSetupHost,
skillReferences: supportedSetupHost,
mcpTools: TOOL_CONTRACTS.length,
mcpPrompts: prompts.names.length,
promptCompletion: true,
promptCompletionLifecycle: true,
evidenceMcp: true,
targetFree: true,
targetLifecycle: true,
boundedRegexBridge: true,
update,
mcpStartup,
mcpModuleLoading,
};
} finally { } finally {
await rm(workspace, { recursive: true, force: true }); await rm(workspace, { recursive: true, force: true });
} }
process.stdout.write(
`${JSON.stringify({ verifier_run: await completeVerifierRun(verifierRun), ...report })}\n`,
);
+33 -29
View File
@@ -52,6 +52,7 @@ const profile = await mkdtemp(join(tmpdir(), "rea-real-browser-"));
const site = await startBrowserVerifierSite(); const site = await startBrowserVerifierSite();
let browser; let browser;
let pageProxy; let pageProxy;
let report;
try { try {
browser = spawn( browser = spawn(
executable, executable,
@@ -338,35 +339,32 @@ try {
target_id: target, target_id: target,
}); });
const moduleTrace = await verifyBrowserModules(executable); const moduleTrace = await verifyBrowserModules(executable);
process.stdout.write( report = {
`${JSON.stringify({ browser: observed.value.browser.product,
verifier_run: await completeVerifierRun(verifierRun), endpoint,
browser: observed.value.browser.product, target,
endpoint, domNodes: observed.value.dom.nodes.length,
target, accessibilityNodes: observed.value.accessibility.nodes.length,
domNodes: observed.value.dom.nodes.length, scripts: observed.value.scripts.items.length,
accessibilityNodes: observed.value.accessibility.nodes.length, networkRequests: observed.value.network.requests.length,
scripts: observed.value.scripts.items.length, consoleEvents: observed.value.console.events.length,
networkRequests: observed.value.network.requests.length, websocketEvents: observed.value.network.websocket_events.length,
consoleEvents: observed.value.console.events.length, bundleScripts: bundle.value.capture.scripts_analyzed,
websocketEvents: observed.value.network.websocket_events.length, sourceMaps: bundle.value.observations.source_maps.processed,
bundleScripts: bundle.value.capture.scripts_analyzed, sessionEvents: session.value.timeline.length,
sourceMaps: bundle.value.observations.source_maps.processed, pageScopedTransport: true,
sessionEvents: session.value.timeline.length, screenshotBytes: screenshot.value.artifact.bytes,
pageScopedTransport: true, largeScreenshot,
screenshotBytes: screenshot.value.artifact.bytes, popupEvents,
largeScreenshot, networkEvidence,
popupEvents, scriptExport,
networkEvidence, moduleTrace,
scriptExport, domDestinations,
moduleTrace, browserScenarioCli: true,
domDestinations, browserScenarioAttachCleanup: "disconnected-external",
browserScenarioCli: true, browserScenarioLaunchCleanup: "terminated-owned-process",
browserScenarioAttachCleanup: "disconnected-external", verified: true,
browserScenarioLaunchCleanup: "terminated-owned-process", };
verified: true,
})}\n`,
);
} finally { } finally {
if (pageProxy !== undefined) await pageProxy.close(); if (pageProxy !== undefined) await pageProxy.close();
if (browser !== undefined) await stopProcess(browser); if (browser !== undefined) await stopProcess(browser);
@@ -378,6 +376,12 @@ try {
retryDelay: 100, retryDelay: 100,
}); });
} }
process.stdout.write(
`${JSON.stringify({
verifier_run: await completeVerifierRun(verifierRun),
...report,
})}\n`,
);
async function verifyPageScopedTransport(provider, proxy, origin) { async function verifyPageScopedTransport(provider, proxy, origin) {
const target = await pageTarget(provider, proxy.endpoint); const target = await pageTarget(provider, proxy.endpoint);
+25 -24
View File
@@ -43,6 +43,7 @@ import {
} from "./verify-real-ghidra-function.mjs"; } from "./verify-real-ghidra-function.mjs";
const exec = promisify(execFile); const exec = promisify(execFile);
const verifierRun = createVerifierRun(); const verifierRun = createVerifierRun();
let report;
const installDir = process.env.GHIDRA_INSTALL_DIR; const installDir = process.env.GHIDRA_INSTALL_DIR;
if (installDir === undefined || !isAbsolute(installDir)) if (installDir === undefined || !isAbsolute(installDir))
throw new Error( throw new Error(
@@ -265,33 +266,33 @@ try {
const customPath = process.env.GHIDRA_TARGET_PATH; const customPath = process.env.GHIDRA_TARGET_PATH;
const custom = const custom =
customPath === undefined ? null : await verifyTarget(customPath, "custom"); customPath === undefined ? null : await verifyTarget(customPath, "custom");
process.stdout.write( report = {
`${JSON.stringify({ ok: true,
verifier_run: await completeVerifierRun(verifierRun), provider: { id: "ghidra", version: SUPPORTED_GHIDRA_VERSION },
ok: true, verification_lane: aarch64JumpTableOnly
provider: { id: "ghidra", version: SUPPORTED_GHIDRA_VERSION }, ? "aarch64-jump-table"
verification_lane: aarch64JumpTableOnly : crossFormat
? "aarch64-jump-table" ? "cross-format"
: crossFormat : "host-native",
? "cross-format" fixture_sources:
: "host-native", crossFormat || aarch64JumpTableOnly
fixture_sources: ? [sourcePath, crossFormatSourcePath]
crossFormat || aarch64JumpTableOnly : [sourcePath],
? [sourcePath, crossFormatSourcePath] fixtures: [debug, stripped, layout, ...crossResults].map(summary),
: [sourcePath], malformed_target: "rejected-before-provider-start",
fixtures: [debug, stripped, layout, ...crossResults].map(summary), native_api_cli: aarch64JumpTableOnly
malformed_target: "rejected-before-provider-start", ? (crossResults[0]?.native_api_cli ?? null)
native_api_cli: aarch64JumpTableOnly : debug.native_api_cli,
? (crossResults[0]?.native_api_cli ?? null) native_value_e2e: debug.native_values,
: debug.native_api_cli, custom_target: custom === null ? null : summary(custom),
native_value_e2e: debug.native_values, cleanup: "complete",
custom_target: custom === null ? null : summary(custom), };
cleanup: "complete",
})}\n`,
);
} finally { } finally {
await rm(fixtureRoot, { recursive: true, force: true }); await rm(fixtureRoot, { recursive: true, force: true });
} }
process.stdout.write(
`${JSON.stringify({ verifier_run: await completeVerifierRun(verifierRun), ...report })}\n`,
);
function nativeFixtureTarget(platform, architecture) { function nativeFixtureTarget(platform, architecture) {
const supportedTargets = { const supportedTargets = {
+4 -2
View File
@@ -10,6 +10,7 @@ const execute = promisify(execFile);
const root = resolve(import.meta.dirname, ".."); const root = resolve(import.meta.dirname, "..");
const temporary = await mkdtemp(join(tmpdir(), "rea-test-discovery-")); const temporary = await mkdtemp(join(tmpdir(), "rea-test-discovery-"));
let discovered;
try { try {
const output = join(temporary, "discovery.json"); const output = join(temporary, "discovery.json");
await execute( await execute(
@@ -58,8 +59,9 @@ try {
) { ) {
console.error(JSON.stringify(report, null, 2)); console.error(JSON.stringify(report, null, 2));
process.exitCode = 1; process.exitCode = 1;
} else } else discovered = report.discovered;
console.log(`Discovered all ${report.discovered} test files exactly once.`);
} finally { } finally {
await rm(temporary, { recursive: true, force: true }); await rm(temporary, { recursive: true, force: true });
} }
if (discovered !== undefined)
console.log(`Discovered all ${discovered} test files exactly once.`);
+3 -3
View File
@@ -59,9 +59,6 @@ try {
} }
if (failures.length > 0) throw new Error(failures.join("\n\n")); if (failures.length > 0) throw new Error(failures.join("\n\n"));
process.stdout.write(
"Test temporary-directory hygiene verified: no owned residues remain.\n",
);
} finally { } finally {
await rm(isolatedTemporaryRoot, { await rm(isolatedTemporaryRoot, {
recursive: true, recursive: true,
@@ -70,3 +67,6 @@ try {
retryDelay: 25, retryDelay: 25,
}); });
} }
process.stdout.write(
"Test temporary-directory hygiene verified: no owned residues remain.\n",
);
+15 -14
View File
@@ -27,6 +27,7 @@ const verifierRun = createVerifierRun();
const root = process.cwd(); const root = process.cwd();
const workspace = await mkdtemp(join(tmpdir(), "rea-windows-package-")); const workspace = await mkdtemp(join(tmpdir(), "rea-windows-package-"));
const prefix = join(workspace, "prefix"); const prefix = join(workspace, "prefix");
let report;
try { try {
const packed = JSON.parse( const packed = JSON.parse(
@@ -212,23 +213,23 @@ try {
environment, environment,
}); });
process.stdout.write( report = {
`${JSON.stringify({ ok: true,
verifier_run: await completeVerifierRun(verifierRun), platform: process.platform,
ok: true, package: packageResult.filename,
platform: process.platform, tools: toolCount,
package: packageResult.filename, ghidra_bridge: "present",
tools: toolCount, agent_setup: ["opencode", "vscode", "copilot_cli"],
ghidra_bridge: "present", setup_idempotent: true,
agent_setup: ["opencode", "vscode", "copilot_cli"], uninstall: true,
setup_idempotent: true, update,
uninstall: true, };
update,
})}\n`,
);
} finally { } finally {
await rm(workspace, { recursive: true, force: true }); await rm(workspace, { recursive: true, force: true });
} }
process.stdout.write(
`${JSON.stringify({ verifier_run: await completeVerifierRun(verifierRun), ...report })}\n`,
);
function npm(arguments_, cwd) { function npm(arguments_, cwd) {
const npmExecPath = process.env.npm_execpath; const npmExecPath = process.env.npm_execpath;
+11 -3
View File
@@ -21,6 +21,7 @@ await exec("/usr/bin/xcrun", ["--find", "actool"]);
await exec("/usr/bin/xcrun", ["--find", "clang"]); await exec("/usr/bin/xcrun", ["--find", "clang"]);
await exec("/usr/bin/assetutil", ["--version"]); await exec("/usr/bin/assetutil", ["--version"]);
const root = await mkdtemp(join(tmpdir(), "rea-asset-e2e-")); const root = await mkdtemp(join(tmpdir(), "rea-asset-e2e-"));
let report;
try { try {
const app = join(root, "Fixture.app"); const app = join(root, "Fixture.app");
const resources = join(app, "Contents", "Resources"); const resources = join(app, "Contents", "Resources");
@@ -98,9 +99,16 @@ try {
}); });
assert.equal(invalid.isError, true); assert.equal(invalid.isError, true);
}); });
process.stdout.write( report = {
`${JSON.stringify({ ok: true, mocked: false, cli: true, stdio_mcp: true, records: raw.length, pagination: true, malformed_input_rejected: true })}\n`, ok: true,
); mocked: false,
cli: true,
stdio_mcp: true,
records: raw.length,
pagination: true,
malformed_input_rejected: true,
};
} finally { } finally {
await rm(root, { recursive: true, force: true }); await rm(root, { recursive: true, force: true });
} }
process.stdout.write(`${JSON.stringify(report)}\n`);
+3 -3
View File
@@ -142,6 +142,7 @@ const checkSwift = (metadata, mode) => {
}; };
const root = await mkdtemp(join(tmpdir(), "rea-dispatch-")); const root = await mkdtemp(join(tmpdir(), "rea-dispatch-"));
let report;
try { try {
const results = []; const results = [];
for (const mode of LINK_MODES) { for (const mode of LINK_MODES) {
@@ -197,9 +198,8 @@ try {
}); });
} }
} }
process.stdout.write( report = { ok: true, target_executed: false, fixtures: results };
`${JSON.stringify({ ok: true, target_executed: false, fixtures: results })}\n`,
);
} finally { } finally {
await rm(root, { recursive: true, force: true }); await rm(root, { recursive: true, force: true });
} }
process.stdout.write(`${JSON.stringify(report)}\n`);
+15 -15
View File
@@ -21,6 +21,7 @@ const sourceRoot = fileURLToPath(
new URL("../../../tests/conformance/interface-builder/", import.meta.url), new URL("../../../tests/conformance/interface-builder/", import.meta.url),
); );
let report;
try { try {
await mkdir(join(appPath, "Contents", "MacOS"), { recursive: true }); await mkdir(join(appPath, "Contents", "MacOS"), { recursive: true });
await mkdir(resourcesPath, { recursive: true }); await mkdir(resourcesPath, { recursive: true });
@@ -83,21 +84,20 @@ try {
); );
assert.equal(decoded.graph.truncated, false); assert.equal(decoded.graph.truncated, false);
process.stdout.write( report = {
`${JSON.stringify({ ok: true,
ok: true, fixture: "compiled-appkit-nib",
fixture: "compiled-appkit-nib", provider: execution.value.provider,
provider: execution.value.provider, target_sha256: decoded.target_sha256,
target_sha256: decoded.target_sha256, archive_sha256: decoded.documents[0].archive_sha256,
archive_sha256: decoded.documents[0].archive_sha256, objects: decoded.documents[0].object_count,
objects: decoded.documents[0].object_count, connections: decoded.documents[0].connection_count,
connections: decoded.documents[0].connection_count, recovered_control: button.name,
recovered_control: button.name, recovered_action: action.name,
recovered_action: action.name, hierarchy_complete: decoded.documents[0].hierarchy_complete,
hierarchy_complete: decoded.documents[0].hierarchy_complete, truncated: decoded.graph.truncated,
truncated: decoded.graph.truncated, };
})}\n`,
);
} finally { } finally {
await rm(fixtureRoot, { recursive: true, force: true }); await rm(fixtureRoot, { recursive: true, force: true });
} }
process.stdout.write(`${JSON.stringify(report)}\n`);
+16 -3
View File
@@ -17,6 +17,7 @@ if (process.platform !== "darwin")
"Real Foundation keyed archive verification requires macOS and Xcode Swift tools", "Real Foundation keyed archive verification requires macOS and Xcode Swift tools",
); );
const root = await mkdtemp(join(tmpdir(), "rea-keyed-fixture-")); const root = await mkdtemp(join(tmpdir(), "rea-keyed-fixture-"));
let report;
try { try {
const archive = join(root, "model.plist"); const archive = join(root, "model.plist");
await promisify(execFile)("/usr/bin/xcrun", [ await promisify(execFile)("/usr/bin/xcrun", [
@@ -150,9 +151,21 @@ try {
[{ source: null, path: ["UID"], target: 1, status: "resolved" }], [{ source: null, path: ["UID"], target: 1, status: "resolved" }],
); );
} }
process.stdout.write( report = {
`${JSON.stringify({ ok: true, mocked: false, cli: true, stdio_mcp: true, xml_golden: true, uid_named_root: true, format: graph.archive_format, objects: graph.total_objects, references: graph.total_references, shared_identity: true, cyclic_identity: true, target_classes_instantiated_by_reader: false })}\n`, ok: true,
); mocked: false,
cli: true,
stdio_mcp: true,
xml_golden: true,
uid_named_root: true,
format: graph.archive_format,
objects: graph.total_objects,
references: graph.total_references,
shared_identity: true,
cyclic_identity: true,
target_classes_instantiated_by_reader: false,
};
} finally { } finally {
await rm(root, { recursive: true, force: true }); await rm(root, { recursive: true, force: true });
} }
process.stdout.write(`${JSON.stringify(report)}\n`);
+13 -13
View File
@@ -65,6 +65,7 @@ const EXPECTED_BUNDLES = [
["Contents/XPCServices/Svc.xpc", "xpc-service", "macos-deep", "."], ["Contents/XPCServices/Svc.xpc", "xpc-service", "macos-deep", "."],
]; ];
let report;
try { try {
const { app } = await buildMacosBundleFixture(root); const { app } = await buildMacosBundleFixture(root);
const zip = join(root, "MacFixture.zip"); const zip = join(root, "MacFixture.zip");
@@ -155,19 +156,18 @@ try {
const dylibs = await verifyDylibResolution(app); const dylibs = await verifyDylibResolution(app);
const dyldEnvironment = await verifyDyldEnvironment(root); const dyldEnvironment = await verifyDyldEnvironment(root);
process.stdout.write( report = {
`${JSON.stringify({ ok: true,
ok: true, mocked: false,
mocked: false, cli: true,
cli: true, stdio_mcp: true,
stdio_mcp: true, containers: containers.map(({ format }) => format),
containers: containers.map(({ format }) => format), bundles: EXPECTED_BUNDLES.length,
bundles: EXPECTED_BUNDLES.length, dmg_detached: true,
dmg_detached: true, dylib_resolution: dylibs,
dylib_resolution: dylibs, dyld_environment: dyldEnvironment,
dyld_environment: dyldEnvironment, };
})}\n`,
);
} finally { } finally {
await rm(root, { recursive: true, force: true }); await rm(root, { recursive: true, force: true });
} }
process.stdout.write(`${JSON.stringify(report)}\n`);
+11 -11
View File
@@ -34,6 +34,7 @@ const sampleRss = () => {
}; };
const sampler = setInterval(sampleRss, 25); const sampler = setInterval(sampleRss, 25);
sampler.unref(); sampler.unref();
let finalReport;
try { try {
const evidence = createEvidence( const evidence = createEvidence(
@@ -112,17 +113,15 @@ try {
assert.equal(digest, expectedHash.digest("hex")); assert.equal(digest, expectedHash.digest("hex"));
assert.equal((await stat(path)).size, expectedBytes); assert.equal((await stat(path)).size, expectedBytes);
sampleRss(); sampleRss();
process.stdout.write( finalReport = {
`${JSON.stringify({ json_output_verified: true,
json_output_verified: true, format,
format, output_bytes: expectedBytes,
output_bytes: expectedBytes, engine_string_limit: constants.MAX_STRING_LENGTH,
engine_string_limit: constants.MAX_STRING_LENGTH, output_sha256: digest,
output_sha256: digest, evidence_id: evidence.evidence_id,
evidence_id: evidence.evidence_id, rss: { method: "node-memoryUsage-rss-sampled", peak_bytes: peakRss },
rss: { method: "node-memoryUsage-rss-sampled", peak_bytes: peakRss }, };
})}\n`,
);
} finally { } finally {
clearInterval(sampler); clearInterval(sampler);
if (destination !== undefined && !destination.closed) { if (destination !== undefined && !destination.closed) {
@@ -132,3 +131,4 @@ try {
} }
await rm(workspace, { recursive: true, force: true }); await rm(workspace, { recursive: true, force: true });
} }
process.stdout.write(`${JSON.stringify(finalReport)}\n`);
+8 -8
View File
@@ -49,6 +49,7 @@ const call = async (name, args) => {
}; };
const fingerprint = (bytes) => createHash("sha256").update(bytes).digest("hex"); const fingerprint = (bytes) => createHash("sha256").update(bytes).digest("hex");
const counts = []; const counts = [];
let finalReport;
try { try {
const fixtures = await buildRecoveryFixtures( const fixtures = await buildRecoveryFixtures(
root, root,
@@ -128,19 +129,18 @@ try {
}); });
} }
} }
console.log( finalReport = {
JSON.stringify({ engine: "wakaru 1.13.0",
engine: "wakaru 1.13.0", toolchains: fixtures.toolchains,
toolchains: fixtures.toolchains, results: counts,
results: counts, verified: true,
verified: true, };
}),
);
} finally { } finally {
await client.close(); await client.close();
await transport.close(); await transport.close();
await rm(root, { recursive: true, force: true }); await rm(root, { recursive: true, force: true });
} }
console.log(JSON.stringify(finalReport));
async function assertRecoveredArtifacts(evidence, result, fixture) { async function assertRecoveredArtifacts(evidence, result, fixture) {
assert.deepEqual(result.options, { assert.deepEqual(result.options, {
+56 -58
View File
@@ -34,6 +34,8 @@ import {
const verifierRun = createVerifierRun(); const verifierRun = createVerifierRun();
const workspace = await mkdtemp(join(tmpdir(), "rea-managed-conformance-")); const workspace = await mkdtemp(join(tmpdir(), "rea-managed-conformance-"));
let completionReportInput;
let finalReport;
const { const {
fixture, fixture,
fixtureBytes, fixtureBytes,
@@ -378,65 +380,61 @@ try {
const manifestSelfTest = await runManagedAppManifestSelfTest(); const manifestSelfTest = await runManagedAppManifestSelfTest();
const operatorManifest = await runOptionalManagedAppManifest(); const operatorManifest = await runOptionalManagedAppManifest();
const ilspyOracle = await runOptionalIlspyOracle(); const ilspyOracle = await runOptionalIlspyOracle();
const completionReport = createManagedCompletionReport( completionReportInput = {
{ modern,
modern, framework,
framework, nativeFunctionTarget,
nativeFunctionTarget, readyToRun,
readyToRun, obfuscated,
obfuscated, left,
left, right,
right, nativeOnly,
nativeOnly, malformed,
malformed, manifestSelfTest,
manifestSelfTest, operatorManifest,
operatorManifest, ilspyOracle,
ilspyOracle, };
finalReport = {
verified:
11 + (operatorManifest === null ? 0 : 1) + (ilspyOracle === null ? 0 : 1),
managedSurfaces: [
"inspect_managed_artifact",
"inspect_managed_members",
"inspect_managed_native_boundaries",
"compare_managed_members",
"verify_managed_native_boundaries",
"import_managed_reconstruction",
"project_managed_application_graph",
],
coverage: [
"modern-dotnet-anycpu",
"dotnet-framework-x86-pinvoke",
"x64-ready-to-run-native-body",
"managed-native-verification",
"managed-application-graph-projection",
"unicode-obfuscated-identifiers",
"decompiler-reconstruction-import",
"mvid-and-token-drift",
"not-managed",
"malformed-metadata",
"operator-local-managed-manifest",
...(ilspyOracle === null ? [] : ["ilspy-reconstruction-oracle"]),
],
managedAppManifest: {
env: "REA_MANAGED_APP_MANIFEST_PATH",
selfTest: manifestSelfTest,
operator: operatorManifest ?? { configured: false },
}, },
await completeVerifierRun(verifierRun), ilspyOracle: ilspyOracle ?? {
); env: "REA_ILSPY_CMD_PATH",
configured: false,
process.stdout.write( },
`${JSON.stringify({ };
verified:
11 +
(operatorManifest === null ? 0 : 1) +
(ilspyOracle === null ? 0 : 1),
managedSurfaces: [
"inspect_managed_artifact",
"inspect_managed_members",
"inspect_managed_native_boundaries",
"compare_managed_members",
"verify_managed_native_boundaries",
"import_managed_reconstruction",
"project_managed_application_graph",
],
coverage: [
"modern-dotnet-anycpu",
"dotnet-framework-x86-pinvoke",
"x64-ready-to-run-native-body",
"managed-native-verification",
"managed-application-graph-projection",
"unicode-obfuscated-identifiers",
"decompiler-reconstruction-import",
"mvid-and-token-drift",
"not-managed",
"malformed-metadata",
"operator-local-managed-manifest",
...(ilspyOracle === null ? [] : ["ilspy-reconstruction-oracle"]),
],
managedAppManifest: {
env: "REA_MANAGED_APP_MANIFEST_PATH",
selfTest: manifestSelfTest,
operator: operatorManifest ?? { configured: false },
},
ilspyOracle: ilspyOracle ?? {
env: "REA_ILSPY_CMD_PATH",
configured: false,
},
completionReport,
})}\n`,
);
} finally { } finally {
await rm(workspace, { recursive: true, force: true }); await rm(workspace, { recursive: true, force: true });
} }
finalReport.completionReport = createManagedCompletionReport(
completionReportInput,
await completeVerifierRun(verifierRun),
);
process.stdout.write(`${JSON.stringify(finalReport)}\n`);