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:
@@ -7,6 +7,11 @@ const dossier = (text: string) =>
|
||||
procedure: {
|
||||
address: "0x1000",
|
||||
name: "main",
|
||||
classification: null,
|
||||
body: {
|
||||
available: false,
|
||||
reason: "The fixture omits function-body extent observations.",
|
||||
},
|
||||
signature: "int main(void)",
|
||||
locals: [],
|
||||
},
|
||||
@@ -20,6 +25,9 @@ const dossier = (text: string) =>
|
||||
referenced_strings: [],
|
||||
referenced_names: [],
|
||||
basic_blocks: [{ start: "0x1000", end: "0x1001", successors: [] }],
|
||||
native_api: null,
|
||||
native_value_flow: null,
|
||||
limitations: ["The fixture omits native API and value-flow observations."],
|
||||
});
|
||||
|
||||
const observe = (digit: string, text: string) =>
|
||||
|
||||
@@ -165,8 +165,8 @@ export const officialOutputSchemas: Readonly<Record<string, z.ZodObject>> = {
|
||||
z.object({
|
||||
procedure: procedureIdentitySchema,
|
||||
direction: z.enum(["incoming", "outgoing"]),
|
||||
reference_kinds_available: z.boolean().optional(),
|
||||
unresolved_calls: z.array(unresolvedCallSchema).default([]),
|
||||
reference_kinds_available: z.boolean(),
|
||||
unresolved_calls: z.array(unresolvedCallSchema),
|
||||
references: z.array(referenceEdgeSchema),
|
||||
}),
|
||||
),
|
||||
|
||||
@@ -484,11 +484,8 @@ export const procedureInfoOutput = evidenceResultOf(
|
||||
length: z.number().min(0),
|
||||
signature: nullableText,
|
||||
locals: z.array(localVariableSchema),
|
||||
classification: procedureClassificationSchema.nullable().default(null),
|
||||
body: functionBodySchema.default({
|
||||
available: false,
|
||||
reason: "The provider did not report complete function body ranges.",
|
||||
}),
|
||||
classification: procedureClassificationSchema.nullable(),
|
||||
body: functionBodySchema,
|
||||
}),
|
||||
);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user