feat(native): add investigation features (#486)
* feat(native): add UI and dispatch investigation workflows * feat(ghidra): support macOS host validation * docs: update native investigation capabilities * feat(artifacts): decode compiled Interface Builder archives * feat(ghidra): expose bounded p-code value flow * test(ghidra): split host and cross-format verification * fix(verify): follow complete result contracts * refactor: remove unused authorization and schema helpers * refactor: remove unused evidence result alias * fix(ghidra): report jump-table evidence precisely * fix(verify): align browser scenario fixture schema * fix(setup): compare parsed client config structurally * test(ghidra): verify AArch64 jump-table mappings * fix(ghidra): recover AArch64 byte jump tables * test(artifacts): verify compiled interface builder archives * feat(native): trace UI actions through handlers * fix(tests): update native trace and shutdown fixtures * fix(verification): diagnose browser scenario failures * fix(browser): wrap scenario snapshots in capture state * fix(native): bind and bound investigation workflows * fix(artifacts): preserve bounded interface builder evidence * fix(ghidra): enforce admitted hosts and preflight tools * fix(native): preserve trace cancellation and bounds * test(application): expect bound analysis target evidence * fix(native): preserve investigation bounds and cancellation * fix(application): preserve bundle and unresolved trace evidence * style(test): format artifact subject fixture
This commit is contained in:
+5
-1
@@ -92,7 +92,11 @@ describe("binary session", () => {
|
||||
},
|
||||
limitations: [],
|
||||
locations: [],
|
||||
subject: null,
|
||||
subject: {
|
||||
format: "analysis-database",
|
||||
path: first,
|
||||
sha256: expect.any(String),
|
||||
},
|
||||
},
|
||||
});
|
||||
expect(provider.identity().id).toBe("fixture");
|
||||
|
||||
@@ -9,6 +9,7 @@ import { createTestTempDirectory } from "../../fixtures/temporaryDirectory.js";
|
||||
import {
|
||||
createAnalysisExecution,
|
||||
type AnalysisClient,
|
||||
type AnalysisOperation,
|
||||
type AnalysisProvider,
|
||||
type AnalysisProviderCandidate,
|
||||
type CapabilityDescriptor,
|
||||
@@ -25,6 +26,8 @@ import {
|
||||
} from "../../../src/domain/errors.js";
|
||||
import { err, ok } from "../../../src/domain/result.js";
|
||||
|
||||
type DeclaredOperation = Exclude<AnalysisOperation, "health">;
|
||||
|
||||
describe("target-bound provider routing", () => {
|
||||
it("rejects provider identity and operation-family collisions at composition", () => {
|
||||
const alpha = deepProvider("alpha");
|
||||
@@ -79,6 +82,11 @@ describe("target-bound provider routing", () => {
|
||||
provider: { id: "alpha", version: "1" },
|
||||
analysisProfile: { provider: { id: "alpha", version: "1" } },
|
||||
result: "alpha:address_name",
|
||||
subject: {
|
||||
sha256: expect.any(String),
|
||||
path: target,
|
||||
format: "analysis-database",
|
||||
},
|
||||
});
|
||||
expect(alpha.clients).toHaveLength(1);
|
||||
expect(beta.clients).toHaveLength(0);
|
||||
@@ -121,6 +129,28 @@ describe("target-bound provider routing", () => {
|
||||
expect(beta.clients[0]?.closed).toBe(true);
|
||||
});
|
||||
|
||||
it("preserves bundle-root identity for artifact inventory operations", async () => {
|
||||
const target = await databaseTarget();
|
||||
const analysis = deepProvider("alpha");
|
||||
const artifact = auxiliaryProvider("artifact", "inventory_artifact");
|
||||
const session = selectableSession([analysis.provider], artifact);
|
||||
|
||||
expect((await session.open(target, { providerId: "alpha" })).ok).toBe(true);
|
||||
const result = await session.execute("inventory_artifact", {});
|
||||
if (!result.ok) throw result.error;
|
||||
|
||||
expect(result).toMatchObject({
|
||||
ok: true,
|
||||
value: {
|
||||
subject: {
|
||||
path: target,
|
||||
sha256: "f".repeat(64),
|
||||
format: "directory",
|
||||
},
|
||||
},
|
||||
});
|
||||
});
|
||||
|
||||
it("cancels a provider switch, closes its old client, and restores the binding", async () => {
|
||||
const target = await databaseTarget();
|
||||
const alpha = deepProvider("alpha");
|
||||
@@ -259,7 +289,7 @@ const successfulExecution = (
|
||||
|
||||
const auxiliaryProvider = (
|
||||
id = "auxiliary",
|
||||
operation: "address_name" | "inspect_macho" = "inspect_macho",
|
||||
operation: DeclaredOperation = "inspect_macho",
|
||||
): AnalysisProvider => {
|
||||
const identity = {
|
||||
id,
|
||||
@@ -269,10 +299,25 @@ const auxiliaryProvider = (
|
||||
return {
|
||||
identity: () => identity,
|
||||
capabilities: () => [capability(identity, operation)],
|
||||
createClient: () => ({
|
||||
createClient: (target) => ({
|
||||
execute: (operation) =>
|
||||
Promise.resolve(
|
||||
ok(createAnalysisExecution(`${operation}:auxiliary`, identity)),
|
||||
ok(
|
||||
createAnalysisExecution(
|
||||
`${operation}:auxiliary`,
|
||||
identity,
|
||||
operation === "inventory_artifact" ||
|
||||
operation === "inspect_artifact"
|
||||
? {
|
||||
subject: {
|
||||
path: target.sourcePath ?? target.path,
|
||||
sha256: "f".repeat(64),
|
||||
format: "directory",
|
||||
},
|
||||
}
|
||||
: {},
|
||||
),
|
||||
),
|
||||
),
|
||||
close: () => Promise.resolve(),
|
||||
}),
|
||||
@@ -290,7 +335,7 @@ const selectableSession = (
|
||||
|
||||
const capability = (
|
||||
provider: ProviderIdentity,
|
||||
operation: "address_name" | "inspect_macho",
|
||||
operation: DeclaredOperation,
|
||||
): CapabilityDescriptor => ({
|
||||
provider,
|
||||
operation,
|
||||
|
||||
Reference in New Issue
Block a user