feat(native): add inspection primitives, dispatch traces and approved UI observation (#500)

* fix(hopper): normalize string-backed addresses and update verification

* feat(native): add inspection primitives, dispatch traces and approved UI observation

* test: prioritize real artifact E2E and captured golden regressions

* fix(process): queue observed output before reactive rendering actions

* test: prune redundant cases and strengthen boundary assertions

* fix(cli): route native value tracing through shared workflows

* test: replace synthetic success with real workflows and captured data

* fix(catalog): separate portable metadata from native host availability
This commit is contained in:
morluto
2026-10-04 16:02:36 +08:00
committed by GitHub
parent 0356f7677f
commit 4fbc501121
205 changed files with 8136 additions and 1816 deletions
+55 -16
View File
@@ -13,6 +13,9 @@ const VALID_INPUTS: Readonly<
Record<string, Readonly<Record<string, JsonValue>>>
> = {
address_name: {},
inspect_native_instruction: { address: "0x1000" },
resolve_native_call_targets: { address: "0x1000" },
inspect_native_data_type: { type: "/Missing" },
comment: {},
current_address: {},
current_procedure: {},
@@ -124,6 +127,58 @@ const connect = async (analysis: AnalysisOperationPort) => {
const inventory: JsonValue = [];
const outputFor = (name: string): JsonValue => {
if (name === "inspect_native_instruction")
return {
address: "0x1000",
status: "decoded",
procedure: "0x1000",
architecture: "x86:LE:64:default",
mode: "default",
bytes: "c3",
length: 1,
mnemonic: "RET",
raw_disassembly: "RET",
operands: [],
flow: {
kind: "terminal",
conditional: false,
computed: false,
direct_destinations: [],
},
references: [],
limitations: ["Provider decoder observation"],
};
if (name === "resolve_native_call_targets")
return {
call_site: "0x1000",
procedure: "0x1000",
status: "not-call",
mechanism: "unavailable",
targets: [],
limitations: [],
};
if (name === "inspect_native_data_type")
return {
status: "unavailable",
reason: "Type absent",
id: null,
name: null,
kind: "unavailable",
source: "analysis-database",
source_archive: null,
address: null,
size_bytes: null,
alignment_bytes: null,
packing_enabled: null,
referenced_type: null,
array_count: null,
array_stride_bytes: null,
fields: [],
members: [],
total_fields: 0,
truncated: false,
limitations: [],
};
if (["list_procedures", "list_names", "list_strings"].includes(name))
return inventory;
if (["address_name", "comment", "inline_comment"].includes(name)) return null;
@@ -184,22 +239,6 @@ const outputFor = (name: string): JsonValue => {
};
describe("official Hopper proxy tools", () => {
it("lists every official contract", async () => {
const client = await connect({
execute: () => Promise.resolve(ok(null)),
});
const listed = await client.listTools();
const officialNames = new Set<string>(
OFFICIAL_TOOL_CONTRACTS.map(({ name }) => name),
);
expect(
listed.tools
.map(({ name }) => name)
.filter((name) => officialNames.has(name))
.sort(),
).toEqual(OFFICIAL_TOOL_CONTRACTS.map(({ name }) => name).sort());
});
it("executes every handler and projects omitted Python optionals to null", async () => {
const invocations: Invocation[] = [];
const client = await connect({