Reverse engineer anything with agents, from app behavior down to native binaries.
TypeScript agent-skillsai-agentsbinary-analysisclaude-codeclicodexcordisdecompilerdeveloper-toolsdshdsh-pluginghidrahopperllmmcpmodel-context-protocolreareverse-engineeringstatic-analysistouhou
fix(verify): reconcile PR-212/215/228 package E2E expectations
morlutocfa110ccb402
diff --git a/scripts/verify-package.mjs b/scripts/verify-package.mjsindex 3782e4bad..c28fdee8a 100644--- a/scripts/verify-package.mjs+++ b/scripts/verify-package.mjs@@ -180,72 +180,88 @@ try {throw new Error("packaged artifact inventory CLI failed");// prettier-ignoreconst investigationReplay = await verifyPackagedInvestigation({ cli, workspace, evidenceRoot, artifactArchive, environment });- const overview = json(- await run(cli, ["analyze", process.execPath, "--json"], environment),- );- if (- overview.operation !== "binary_overview" ||- overview.normalized_result?.procedure_count < 1- )- throw new Error(- `packaged Hopper-backed analyze CLI failed: ${JSON.stringify(overview)}`,- );- const inspected = json(- await run(- cli,- [- "inspect",- process.execPath,- "--detail",- "detailed",- "--limit",- "1",- "--json",- ],- environment,- ),- );- if (- inspected.operation !== "binary_overview" ||- inspected.normalized_result?.detail !== "detailed"- )- throw new Error("packaged inspect CLI failed");- const functionResult = json(- await run(+ if (process.platform === "linux") {+ const unsupportedExecution = await runWithStatus(cli,- ["function", process.execPath, "0x1000", "--json"],+ ["analyze", process.execPath, "--json"],environment,- ),- );- if (- functionResult.operation !== "analyze_function" ||- functionResult.provider?.id !== "hopper" ||- functionResult.normalized_result?.procedure?.address !== "0x1000"- )- throw new Error(- `packaged function CLI failed: ${JSON.stringify(functionResult)}`,);- const xrefs = json(- await run(- cli,- ["xrefs", process.execPath, "0x1000", "--json"],- environment,- ),- );- if (- xrefs.operation !== "xrefs" ||- JSON.stringify(xrefs.normalized_result) !== JSON.stringify(["0x1000"])- )- throw new Error(`packaged xrefs CLI failed: ${JSON.stringify(xrefs)}`);- const trace = json(- await run(- cli,- ["trace", process.execPath, "fixture", "--json"],- environment,- ),- );- if (trace.operation !== "trace_feature")- throw new Error(`packaged trace CLI failed: ${JSON.stringify(trace)}`);+ const unsupported = json(unsupportedExecution.stdout);+ if (+ unsupportedExecution.status !== 1 ||+ unsupported.details?.failure_code !== "unsupported_hopper_build"+ )+ throw new Error(+ `packaged Linux Hopper verification did not fail closed: ${JSON.stringify(unsupported)}`,+ );+ } else {+ const overview = json(+ await run(cli, ["analyze", process.execPath, "--json"], environment),+ );+ if (+ overview.operation !== "binary_overview" ||+ overview.normalized_result?.procedure_count < 1+ )+ throw new Error(+ `packaged Hopper-backed analyze CLI failed: ${JSON.stringify(overview)}`,+ );+ const inspected = json(+ await run(+ cli,+ [+ "inspect",+ process.execPath,+ "--detail",+ "detailed",+ "--limit",+ "1",+ "--json",+ ],+ environment,+ ),+ );+ if (+ inspected.operation !== "binary_overview" ||+ inspected.normalized_result?.detail !== "detailed"+ )+ throw new Error("packaged inspect CLI failed");+ const functionResult = json(+ await run(+ cli,+ ["function", process.execPath, "0x1000", "--json"],+ environment,+ ),+ );+ if (+ functionResult.operation !== "analyze_function" ||+ functionResult.provider?.id !== "hopper" ||+ functionResult.normalized_result?.procedure?.address !== "0x1000"+ )+ throw new Error(+ `packaged function CLI failed: ${JSON.stringify(functionResult)}`,+ );+ const xrefs = json(+ await run(+ cli,+ ["xrefs", process.execPath, "0x1000", "--json"],+ environment,+ ),+ );+ if (+ xrefs.operation !== "xrefs" ||+ JSON.stringify(xrefs.normalized_result) !== JSON.stringify(["0x1000"])+ )+ throw new Error(`packaged xrefs CLI failed: ${JSON.stringify(xrefs)}`);+ const trace = json(+ await run(+ cli,+ ["trace", process.execPath, "fixture", "--json"],+ environment,+ ),+ );+ if (trace.operation !== "trace_feature")+ throw new Error(`packaged trace CLI failed: ${JSON.stringify(trace)}`);+ }const capabilities = json(await run(cli, ["capabilities", "--json"], environment),);@@ -257,20 +273,22 @@ try {providers.providers.some(({ id }) => typeof id !== "string"))throw new Error("packaged providers CLI failed");- const searchResult = json(- await run(- cli,- ["search", process.execPath, "fixture", "--json"],- environment,- ),- );- if (- searchResult.operation !== "search_strings" ||- searchResult.normalized_result?.items?.length !== 1- )- throw new Error(- `packaged search CLI failed: ${JSON.stringify(searchResult)}`,+ if (process.platform !== "linux") {+ const searchResult = json(+ await run(+ cli,+ ["search", process.execPath, "fixture", "--json"],+ environment,+ ),);+ if (+ searchResult.operation !== "search_strings" ||+ searchResult.normalized_result?.items?.length !== 1+ )+ throw new Error(+ `packaged search CLI failed: ${JSON.stringify(searchResult)}`,+ );+ }const referenceImport = json(await run(cli,@@ -450,7 +468,7 @@ try {throw new Error("packaged stale-skill upgrade was not isolated");await writeFile(claudeConfig, "malformed");- await writeFile(cursorConfig, "{}\n");+ await writeFile(cursorConfig, '{"existing":true}\n');const failedExecution = await runWithStatus(cli,["setup", "--yes", "--json"],@@ -600,30 +618,41 @@ try {);if (opened.isError === true)throw new Error("packaged MCP could not open a binary");- await prompts.verifyPromptCompletion(client, mcpOptions, true);- const current = await client.callTool(- { name: "current_document", arguments: {} },+ await prompts.verifyPromptCompletion(+ client,mcpOptions,+ process.platform !== "linux",);- if (- current.isError === true ||- json(prompts.mcpText(current)).normalized_result !== "fixture"- )- throw new Error("packaged MCP bridge call failed");- const batch = await client.callTool(- { name: "batch_decompile", arguments: { addresses: ["0x1000"] } },+ const current = await client.callTool(+ { name: "current_document", arguments: {} },mcpOptions,);- const batchResult = json(prompts.mcpText(batch)).normalized_result;- if (- batch.isError === true ||- batchResult?.total !== 1 ||- batchResult?.succeeded !== 1 ||- batchResult?.failed !== 0 ||- batchResult?.items?.[0]?.status !== "ok" ||- batchResult?.items?.[0]?.pseudocode !== "return 0;"- )- throw new Error("packaged MCP structured batch result failed");+ if (process.platform === "linux") {+ if (+ current.isError !== true ||+ !prompts+ .mcpText(current)+ .includes("not supported for unattended Linux analysis")+ )+ throw new Error("packaged Linux MCP did not reject an unpinned Hopper");+ } else {+ if (json(prompts.mcpText(current)).normalized_result !== "fixture")+ throw new Error("packaged MCP bridge call failed");+ const batch = await client.callTool(+ { name: "batch_decompile", arguments: { addresses: ["0x1000"] } },+ mcpOptions,+ );+ const batchResult = json(prompts.mcpText(batch)).normalized_result;+ if (+ batch.isError === true ||+ batchResult?.total !== 1 ||+ batchResult?.succeeded !== 1 ||+ batchResult?.failed !== 0 ||+ batchResult?.items?.[0]?.status !== "ok" ||+ batchResult?.items?.[0]?.pseudocode !== "return 0;"+ )+ throw new Error("packaged MCP structured batch result failed");+ }const closed = await client.callTool({ name: "close_binary", arguments: {} },mcpOptions,