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:
@@ -39,3 +39,31 @@ it("returns a complete requested text artifact beyond the former inline ceiling"
|
||||
value: { bytes: 16 * 1_024 * 1_024 + 1 },
|
||||
});
|
||||
});
|
||||
|
||||
it("wraps URL, history, and storage snapshots in the capture state contract", async () => {
|
||||
const page = {
|
||||
url: () => "https://app.example.test/path?token=secret",
|
||||
evaluate: async (expression: string) =>
|
||||
expression.includes("window.history.length")
|
||||
? {
|
||||
length: 2,
|
||||
navigation_entries: [
|
||||
{ type: "navigate", name: "https://app.example.test/path" },
|
||||
],
|
||||
}
|
||||
: { local_storage: [], session_storage: [] },
|
||||
} as unknown as Page;
|
||||
const context = { cookies: async () => [] } as unknown as BrowserContext;
|
||||
|
||||
const result = await capturePlaywrightStepArtifacts({
|
||||
context,
|
||||
page,
|
||||
scenario,
|
||||
secrets,
|
||||
requested: new Set(["url", "history", "storage"]),
|
||||
});
|
||||
|
||||
expect(result.url.state).toBe("captured");
|
||||
expect(result.history.state).toBe("captured");
|
||||
expect(result.storage.state).toBe("captured");
|
||||
});
|
||||
|
||||
@@ -126,7 +126,7 @@ const captureHistory = async (page: Page) => {
|
||||
name: sanitizeBrowserUrl(name),
|
||||
})),
|
||||
};
|
||||
return value;
|
||||
return { state: "captured" as const, value };
|
||||
} catch {
|
||||
return missing("history capture failed");
|
||||
}
|
||||
@@ -166,7 +166,7 @@ const captureStorage = async (input: {
|
||||
...secrets.fingerprint(value),
|
||||
})),
|
||||
};
|
||||
return value;
|
||||
return { state: "captured" as const, value };
|
||||
} catch {
|
||||
return missing("storage capture failed");
|
||||
}
|
||||
@@ -211,9 +211,10 @@ export const capturePlaywrightStepArtifacts = async (input: {
|
||||
accessibility: await state("accessibility", () =>
|
||||
captureAccessibility({ page, secrets }),
|
||||
),
|
||||
url: await state("url", async () =>
|
||||
Promise.resolve(sanitizeBrowserUrl(page.url())),
|
||||
),
|
||||
url: await state("url", async () => ({
|
||||
state: "captured" as const,
|
||||
value: sanitizeBrowserUrl(page.url()),
|
||||
})),
|
||||
history: await state("history", () => captureHistory(page)),
|
||||
storage: await state("storage", () =>
|
||||
captureStorage({ context, page, scenario, secrets }),
|
||||
|
||||
Reference in New Issue
Block a user