From 60f9a4c69abd0bbc97346434d6006880ecc6d6ba Mon Sep 17 00:00:00 2001 From: morluto <76467478+morluto@users.noreply.github.com> Date: Sun, 8 Nov 2026 01:10:38 +0800 Subject: [PATCH] fix(native): show function match limitations by default (#8558) Co-authored-by: Cursor Agent --- docs/native-function-matching.md | 3 +- .../nativeFunctionMatchingView.ts | 1 + .../tools/nativeFunctionMatching.test.ts | 35 +++++++++++++++++++ 3 files changed, 38 insertions(+), 1 deletion(-) diff --git a/docs/native-function-matching.md b/docs/native-function-matching.md index 3d669dbd60..d8b7b41ec8 100644 --- a/docs/native-function-matching.md +++ b/docs/native-function-matching.md @@ -95,7 +95,8 @@ counts, both identities and coverage. Query its `parent_evidence_id`: counts. Large member lists are omitted by default; select `left`/`right` columns explicitly or page individual `functions`. Batch `match_ids`/`function_ids`, exact function `names`, state and side filters intersect. Mandatory identities and provenance survive column -selection. Page coverage covers selected retained facts. Function identity binds +selection. Default function rows include member limitations; an explicit `fields` +selection can omit them. Page coverage covers selected retained facts. Function identity binds inventory Evidence and the owning inventory’s `source_index`, preserving same-address alternatives. One validation, lazy member index and bounded recent filter are retained per immutable parent; no live target state is cached. diff --git a/src/domain/analysisView/nativeFunctionMatchingView.ts b/src/domain/analysisView/nativeFunctionMatchingView.ts index acf0d95081..0d8bf4a92f 100644 --- a/src/domain/analysisView/nativeFunctionMatchingView.ts +++ b/src/domain/analysisView/nativeFunctionMatchingView.ts @@ -237,6 +237,7 @@ const selectedItems = ( "body_bytes", "dossier_evidence_id", "evidence_links", + "limitations", ]; const fields = new Set(view.fields ?? defaults); const columns = (row: Readonly>) => diff --git a/tests/acceptance/tools/nativeFunctionMatching.test.ts b/tests/acceptance/tools/nativeFunctionMatching.test.ts index fc2bf53fbe..9fc121e556 100644 --- a/tests/acceptance/tools/nativeFunctionMatching.test.ts +++ b/tests/acceptance/tools/nativeFunctionMatching.test.ts @@ -317,11 +317,46 @@ cliTest.for([{ profile: "full" }, { profile: "compact" }] as const)( }, ], }); + const selectedPage = parseEvidence(page.structuredContent) + .normalized_result as { + items: Record[]; + }; + expect(selectedPage.items[0]).not.toHaveProperty("limitations"); expect(parseEvidence(page.structuredContent).locations).not.toEqual( expect.arrayContaining([ expect.objectContaining({ kind: "artifact-path" }), ]), ); + const withoutBytes = await call("match_native_functions", { + left: reference(left.evidence_id), + right: reference(right.evidence_id), + }); + expect(withoutBytes.isError, JSON.stringify(withoutBytes)).not.toBe(true); + const missingParent = parseEvidence(withoutBytes.structuredContent) + .normalized_result as { parent_evidence_id: string }; + const missingPage = await call("inspect_analysis_view", { + source: reference(missingParent.parent_evidence_id), + view: { + kind: "function-matches", + collection: "functions", + sides: ["left"], + names: ["main"], + }, + }); + expect(missingPage.isError, JSON.stringify(missingPage)).not.toBe(true); + expect( + parseEvidence(missingPage.structuredContent).normalized_result, + ).toMatchObject({ + items: [ + { + name: "main", + body_sha256: null, + limitations: [ + "No complete unambiguous bytes for the observed function body.", + ], + }, + ], + }); const compared = await call( "compare_functions", report.matches[0]!.compare_functions_input!,