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:
morluto
2026-09-30 00:41:05 +08:00
committed by GitHub
parent fa26affc86
commit ed933d1893
87 changed files with 6771 additions and 375 deletions
+66
View File
@@ -0,0 +1,66 @@
import { z } from "zod";
/** A decompiler p-code varnode location or literal value. */
export const nativeVarnodeSchema = z.strictObject({
kind: z.enum(["constant", "address", "register", "unique", "other"]),
size_bytes: z.number().int().nonnegative(),
location: z.string().nullable(),
constant_hex: z
.string()
.regex(/^[0-9a-f]+$/u)
.nullable(),
});
/** One high-p-code operation recovered for a single function. */
export const nativePcodeOperationSchema = z.strictObject({
id: z.string().min(1),
address: z.string().min(1),
sequence: z.number().int().nonnegative(),
opcode: z.string().min(1),
is_dead: z.boolean(),
inputs: z.array(nativeVarnodeSchema),
output: nativeVarnodeSchema.nullable(),
});
/** A def-use relation between operations in one recovered HighFunction. */
export const nativePcodeDefUseSchema = z.strictObject({
definition: z.string().min(1),
use: z.string().min(1),
input_index: z.number().int().nonnegative(),
});
/** Memory and branch operations as directly named by Ghidra p-code. */
export const nativePcodeEffectSchema = z.strictObject({
operation: z.string().min(1),
kind: z.enum([
"memory_read",
"memory_write",
"conditional_branch",
"indirect_branch",
"direct_call",
"indirect_call",
]),
operand_input: z.number().int().nonnegative().nullable(),
value_input: z.number().int().nonnegative().nullable(),
});
/** Bounded data-flow observations; STORE is not necessarily a persistent/global write. */
export const nativeValueFlowSchema = z.discriminatedUnion("available", [
z.strictObject({
available: z.literal(true),
provenance: z.literal("ghidra-high-pcode"),
operations: z.array(nativePcodeOperationSchema),
def_use: z.array(nativePcodeDefUseSchema),
effects: z.array(nativePcodeEffectSchema),
truncated: z.boolean(),
omitted_operations_lower_bound: z.number().int().nonnegative(),
known_omitted_inputs: z.number().int().nonnegative(),
known_omitted_edges: z.number().int().nonnegative(),
limitations: z.array(z.string().min(1)),
}),
z.strictObject({
available: z.literal(false),
reason: z.string().min(1),
limitations: z.array(z.string().min(1)),
}),
]);