Merge remote-tracking branch 'origin/main' into fix/swift-demangle-arguments

# Conflicts:
#	docs/product-catalog.json
#	docs/verification/managed-conformance-manifest.json
#	skills/reverse-engineer-anything/SKILL.md
#	src/generatedMcpToolCatalog.ts
This commit is contained in:
Iwakurakaoru0822
2026-10-06 22:47:23 -07:00
26 changed files with 877 additions and 406 deletions
@@ -18,6 +18,8 @@ const JSON_COMMANDS = [
"build-reconstruction-obligation-ledger",
],
["evaluate-reconstruction-coverage", "evaluate-reconstruction-coverage"],
["project-android-application-graph", "project-android-application-graph"],
["project-apple-application-graph", "project-apple-application-graph"],
["import-managed-reconstruction", "import-managed-reconstruction"],
["verify-managed-native-boundaries", "verify-managed-native-boundaries"],
["project-managed-application-graph", "project-managed-application-graph"],
+12
View File
@@ -8,6 +8,8 @@ import { createTestTempDirectory } from "../../fixtures/temporaryDirectory.js";
import { SUPPORTED_CLIENT_DEFINITIONS } from "../../../src/application/SupportedClients.js";
import {
ANDROID_APPLICATION_PROVIDER,
APPLE_APPLICATION_PROVIDER,
ARTIFACT_GRAPH_PROVIDER,
JAVASCRIPT_APPLICATION_PROVIDER,
JAVASCRIPT_APPLICATION_WORKFLOW_PROVIDER,
@@ -108,6 +110,8 @@ describe("canonical product catalog", () => {
IDA_PROVIDER_IDENTITY,
NATIVE_MACOS_PROVIDER_IDENTITY,
ARTIFACT_GRAPH_PROVIDER,
ANDROID_APPLICATION_PROVIDER,
APPLE_APPLICATION_PROVIDER,
MANAGED_STATIC_PROVIDER,
MANAGED_WORKFLOW_PROVIDER,
CDP_BROWSER_PROVIDER_IDENTITY,
@@ -164,6 +168,14 @@ describe("canonical product catalog", () => {
"trace_application_feature",
"trace_javascript_semantics",
]);
expect(
catalog.providers.find(({ id }) => id === ANDROID_APPLICATION_PROVIDER.id)
?.capabilities,
).toEqual(["project_android_application_graph"]);
expect(
catalog.providers.find(({ id }) => id === APPLE_APPLICATION_PROVIDER.id)
?.capabilities,
).toEqual(["project_apple_application_graph"]);
expect(
catalog.providers.find(({ id }) => id === MANAGED_WORKFLOW_PROVIDER.id)
?.capabilities,
@@ -0,0 +1,113 @@
import { writeFile } from "node:fs/promises";
import { join } from "node:path";
import { Client, InMemoryTransport } from "@modelcontextprotocol/client";
import {
TextReader,
Uint8ArrayReader,
Uint8ArrayWriter,
ZipWriter,
} from "@zip.js/zip.js";
import { afterEach, expect, it } from "vitest";
import { runProviderAnalysis } from "../../../src/application/DirectAnalysis.js";
import { parseEvidence } from "../../../src/domain/evidence.js";
import { createTestBinarySession } from "../../fixtures/binarySession.js";
import { createTestTempDirectory } from "../../fixtures/temporaryDirectory.js";
import { createServer } from "../../../src/server/createServer.js";
const resources: Array<{ close(): Promise<unknown> }> = [];
afterEach(async () => {
for (const resource of resources.splice(0)) await resource.close();
});
async function connect() {
const session = createTestBinarySession(() => {
throw new Error("mobile graph projection must not launch a provider");
});
const server = createServer(session, session);
const client = new Client({
name: "mobile-application-graph-test",
version: "1",
});
resources.push(client, server, session);
const [a, b] = InMemoryTransport.createLinkedPair();
await server.connect(b);
await client.connect(a);
return client;
}
const writeApk = async (directory: string): Promise<string> => {
const path = join(directory, "Fixture.apk");
const writer = new ZipWriter(new Uint8ArrayWriter());
await writer.add(
"AndroidManifest.xml",
new Uint8ArrayReader(Uint8Array.from([3, 0, 8, 0])),
);
await writer.add(
"classes.dex",
new Uint8ArrayReader(
Uint8Array.from([0x64, 0x65, 0x78, 0x0a, 0x30, 0x33, 0x35, 0]),
),
);
await writeFile(path, await writer.close());
return path;
};
const writeIpa = async (directory: string): Promise<string> => {
const path = join(directory, "Fixture.ipa");
const writer = new ZipWriter(new Uint8ArrayWriter());
await writer.add(
"Payload/Fixture.app/Info.plist",
new TextReader("<plist></plist>"),
);
await writer.add(
"Payload/Fixture.app/Fixture",
new Uint8ArrayReader(
Uint8Array.from([0xcf, 0xfa, 0xed, 0xfe, 0x0c, 0, 0, 1]),
),
);
await writeFile(path, await writer.close());
return path;
};
it("advertises and executes Android and Apple inventory projections", async () => {
const client = await connect();
const { tools } = await client.listTools();
const names = new Set(tools.map(({ name }) => name));
expect(names.has("project_android_application_graph")).toBe(true);
expect(names.has("project_apple_application_graph")).toBe(true);
const root = await createTestTempDirectory("rea-mobile-graph-mcp-");
const apkInventory = parseEvidence(
await runProviderAnalysis(await writeApk(root), "inventory_artifact", {}),
);
const android = await client.callTool({
name: "project_android_application_graph",
arguments: { inventory_evidence: [apkInventory] },
});
if (android.isError === true)
throw new Error(JSON.stringify(android.structuredContent, null, 2));
expect(android.structuredContent).toMatchObject({
evidence: {
operation: "project_android_application_graph",
provider: { id: "rea-android-application" },
},
});
const ipaInventory = parseEvidence(
await runProviderAnalysis(await writeIpa(root), "inventory_artifact", {}),
);
const apple = await client.callTool({
name: "project_apple_application_graph",
arguments: { inventory_evidence: [ipaInventory] },
});
if (apple.isError === true)
throw new Error(JSON.stringify(apple.structuredContent, null, 2));
expect(apple.structuredContent).toMatchObject({
evidence: {
operation: "project_apple_application_graph",
provider: { id: "rea-apple-application" },
},
});
});