fix(comparison): keep unsupported function facets unknown (#2450)
* fix(comparison): keep unsupported function facets unknown * docs(comparison): explain function facet availability * fix(analysis): preserve unavailable facets across Evidence consumers --------- Co-authored-by: morluto <76467478+morluto@users.noreply.github.com>
This commit is contained in:
@@ -15,6 +15,7 @@ const observe = (
|
||||
readonly evidenceLimitations?: readonly string[];
|
||||
readonly dossierLimitations?: readonly string[];
|
||||
readonly relationshipCoverage?: RelationshipCoverage;
|
||||
readonly calleeUnavailable?: string;
|
||||
} = {},
|
||||
): Evidence => {
|
||||
const value = {
|
||||
@@ -52,6 +53,13 @@ const observe = (
|
||||
native_value_flow: null,
|
||||
basic_blocks: [],
|
||||
limitations: [...(options.dossierLimitations ?? [])],
|
||||
...(options.calleeUnavailable === undefined
|
||||
? {}
|
||||
: {
|
||||
facet_availability: {
|
||||
callees: { available: false, reason: options.calleeUnavailable },
|
||||
},
|
||||
}),
|
||||
} satisfies JsonValue;
|
||||
return createEvidence(
|
||||
{ path: "/tmp/a", sha256: "a".repeat(64), format: "mach-o" },
|
||||
@@ -541,3 +549,13 @@ describe("call path evidence admission", () => {
|
||||
);
|
||||
});
|
||||
});
|
||||
|
||||
it("keeps an absent path unknown when only callee facet availability is declared", () => {
|
||||
const result = run([
|
||||
observe("0x1000", [], "rea-workflow", {
|
||||
calleeUnavailable: "Graph callees unavailable",
|
||||
}),
|
||||
]);
|
||||
expect(result.status).toBe("unknown");
|
||||
expect(result.limitations).toContain("Graph callees unavailable");
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user