fix(contracts)!: require observed provider output metadata

Reject omitted segment bounds, procedure classification and body facts, unresolved-call observations, dossier facets, and Ghidra parameter flow metadata. Providers emit explicit nulls for unsupported facets. Verify those unknowns in the real Hopper workflow.

BREAKING CHANGE: Provider analysis outputs must explicitly supply metadata previously repaired with defaults; unsupported nullable facets must be reported as null.
This commit is contained in:
morluto
2026-10-10 03:52:13 +08:00
parent e3bbb9ac45
commit a4ba8aecd5
29 changed files with 465 additions and 112 deletions
+24 -6
View File
@@ -96,13 +96,27 @@ describe("provider-neutral inclusive function body evidence", () => {
non_contiguous: true,
contains_entry: true,
});
it("represents missing Hopper extent explicitly as unknown", () => {
it("rejects missing provider body metadata", () => {
expect(
procedureIdentitySchema.parse({ address: "0x1000", name: "main" }).body,
).toEqual({
available: false,
reason: "The provider did not report complete function body ranges.",
});
procedureIdentitySchema.safeParse({ address: "0x1000", name: "main" })
.success,
).toBe(false);
});
it("rejects segments when required coordinates or unknown permissions are omitted", () => {
expect(
parseSegments([
{
name: "__TEXT",
start: "0x1",
end: "0x2",
readable: null,
writable: null,
},
]).ok,
).toBe(false);
expect(
parseSegments([{ name: "__TEXT", start: "0x1", end: "0x2" }]).ok,
).toBe(false);
});
it("counts inclusive one-byte ranges without assuming an enclosing continuous body", () => {
expect(
@@ -143,6 +157,7 @@ describe("provider-neutral inclusive function body evidence", () => {
procedureIdentitySchema.safeParse({
address: "0x1000",
name: "external",
classification: null,
body: {
...observed(),
ranges: [],
@@ -159,6 +174,7 @@ describe("provider-neutral inclusive function body evidence", () => {
procedureIdentitySchema.safeParse({
address: "0x1002",
name: "last",
classification: null,
body: observed(),
}).success,
).toBe(true);
@@ -166,6 +182,7 @@ describe("provider-neutral inclusive function body evidence", () => {
procedureIdentitySchema.safeParse({
address: "0x1003",
name: "gap",
classification: null,
body: observed(),
}).success,
).toBe(false);
@@ -173,6 +190,7 @@ describe("provider-neutral inclusive function body evidence", () => {
procedureIdentitySchema.safeParse({
address: "other:0x1000",
name: "other",
classification: null,
body: observed(),
}).success,
).toBe(false);