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:
+11
-17
@@ -52,12 +52,12 @@ const addressedNamesSchema = z.array(
|
||||
);
|
||||
const addressedNameMapSchema = z.record(z.string(), z.string());
|
||||
const segmentSchema = z.object({
|
||||
name: z.string().default(""),
|
||||
start: z.string().default(""),
|
||||
end: z.string().default(""),
|
||||
readable: z.boolean().nullable().default(null),
|
||||
writable: z.boolean().nullable().default(null),
|
||||
executable: z.boolean().nullable().default(null),
|
||||
name: z.string(),
|
||||
start: z.string(),
|
||||
end: z.string(),
|
||||
readable: z.boolean().nullable(),
|
||||
writable: z.boolean().nullable(),
|
||||
executable: z.boolean().nullable(),
|
||||
});
|
||||
const unavailableAnalysisFactSchema = z
|
||||
.object({ available: z.literal(false), reason: z.string() })
|
||||
@@ -186,12 +186,6 @@ export const functionBodySchema = z.discriminatedUnion("available", [
|
||||
}),
|
||||
]);
|
||||
|
||||
const unknownFunctionBody = () =>
|
||||
functionBodySchema.default({
|
||||
available: false,
|
||||
reason: "The provider did not report complete function body ranges.",
|
||||
});
|
||||
|
||||
/** Check the declared entry membership against complete, inclusive body ranges. */
|
||||
export const functionBodyEntryAgrees = (
|
||||
body: z.infer<typeof functionBodySchema>,
|
||||
@@ -226,8 +220,8 @@ export const procedureIdentitySchema = z
|
||||
.object({
|
||||
address: z.string(),
|
||||
name: z.string(),
|
||||
classification: procedureClassificationSchema.nullable().default(null),
|
||||
body: unknownFunctionBody(),
|
||||
classification: procedureClassificationSchema.nullable(),
|
||||
body: functionBodySchema,
|
||||
})
|
||||
.strict()
|
||||
.superRefine((identity, context) => {
|
||||
@@ -352,9 +346,9 @@ export const functionDossierSchema = z
|
||||
})
|
||||
.strict(),
|
||||
),
|
||||
native_api: nativeApiBoundarySchema.nullable().default(null),
|
||||
native_value_flow: nativeValueFlowSchema.nullable().default(null),
|
||||
limitations: z.array(z.string()).default([]),
|
||||
native_api: nativeApiBoundarySchema.nullable(),
|
||||
native_value_flow: nativeValueFlowSchema.nullable(),
|
||||
limitations: z.array(z.string()),
|
||||
})
|
||||
.strict();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user