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:
GuoJun Tang
2026-10-13 22:15:01 +08:00
committed by GitHub
co-authored by morluto
parent 30e9b83a68
commit b17487f482
12 changed files with 318 additions and 4 deletions
@@ -792,3 +792,29 @@ it("rejects unsupported parent operations and incompatible collections", () => {
error: { _tag: "AnalysisInputError" },
});
});
it("preserves selected native facet unavailability instead of an exhausted empty page", () => {
const parent = nativeParent({
...ghidraFunctionDossier(),
facet_availability: {
comments: { available: false, reason: "Typed comments unavailable" },
references: { available: false, reason: "Typed references unavailable" },
},
});
for (const [facet, reason] of [
["comments", "Typed comments unavailable"],
["incoming_references", "Typed references unavailable"],
] as const) {
const result = projectAnalysisView(parent, {
kind: "native",
facet,
offset: 0,
limit: 8,
});
if (!result.ok) throw result.error;
expect(result.value).toMatchObject({
item: { available: false, reason },
unknowns: expect.arrayContaining([reason]),
});
}
});