Repository navigation
fix(verification): compare retained Ghidra function evidence - #8491
ShuaixinHuang wants to merge 1 commit into
Conversation
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
[Low impact] The change is limited to the repository's real-Ghidra verification workflow. The request change appears sound, but the missing-reference test must satisfy the repository's structured-error assertion requirement before merging. Findings
Fix with agent prompt### Issue 1
tests/boundary/process/nativeValueVerifierComparison.test.ts:68-69
The missing-reference check accepts any rejection from `compareRetainedFunctionEvidence`. A timeout, broken connection, or unrelated server error would pass and print `missing_reference_refused: true` without proving that the server rejected the missing ID. Check the returned error's code, missing-reference reason, and requested ID. The repository's testing guide requires structured error assertions; this requirement must be satisfied before merging.
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.SummaryBoth verifier controls now use
Reviews (1) · Last reviewed commit: "fix(verification): compare retained Ghid..." · Reviewed by Greptile |
| await assert.rejects(() => compareRetainedFunctionEvidence(client, | ||
| { ...evidence, evidence_id: "ev_" + "b".repeat(64) })); |
There was a problem hiding this comment.
The missing-reference check accepts any rejection from compareRetainedFunctionEvidence. A timeout, broken connection, or unrelated server error would pass and print missing_reference_refused: true without proving that the server rejected the missing ID. Check the returned error's code, missing-reference reason, and requested ID. The repository's testing guide requires structured error assertions; this requirement must be satisfied before merging.
Context Used: Documentation (source)
Prompt To Fix With AI
This is a comment left during a code review.
Path: tests/boundary/process/nativeValueVerifierComparison.test.ts
Line: 68-69
Comment:
**Wrong failures pass the test**
The missing-reference check accepts any rejection from `compareRetainedFunctionEvidence`. A timeout, broken connection, or unrelated server error would pass and print `missing_reference_refused: true` without proving that the server rejected the missing ID. Check the returned error's code, missing-reference reason, and requested ID. The repository's testing guide requires structured error assertions; this requirement must be satisfied before merging.
**Context Used:** Documentation ([source](https://github.com/morluto/rea/blob/main/docs))
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.
Supersedes #8258 at the author's explicit request to resubmit the existing PR. This replacement reuses verified head 2bf92eb and preserves the original discussion and validation record at #8179. Historical validation and its limitations below remain at their stated execution points. This new PR must pass its own hosted CI.
Summary
Fixes #8172. The real-Ghidra verifier sends two inline copies of complete function Evidence to
compare_functions, exceeding the default MCP input allowance for sufficiently detailed functions. Use exact references to the records already retained by the same MCP session.Problem and expected behavior
The comparison should run within the default transport budget and keep its original result and provenance assertions. A local compiled stdio MCP probe with explicitly synthetic, artifact-bound function Evidence containing 1200 assembly rows rejects the inline request with
resource_constraint, reportingmax_input_elements: 1024. The same record compared through retained references returnsunchangedand links the original Evidence.Change and scope
Both the complete-function and unresolved-call verifier controls now use one request producer,
compareRetainedFunctionEvidence, with{ kind: "retained-evidence", evidence_id }for each operand. Existing response/error parsing, complete-functionunchanged, unresolved-callunknown, profile checks, source Evidence links, full bundle-record equality, and session cleanup assertions remain. Fullanalyze_functionreplies are still retrieved and checked inline; only the redundant comparison input changes.No input-limit increase, environment forwarding, provider behavior, schema, authority, timeout, resource setting, or comparison semantics change. The separate JDK-selection report #8171 is outside this PR.
Contract and boundary impact
scripts/lib/native-value-e2e.mjs; both verifier comparison controls use the same producer.compare_functionsretained-Evidence input, no new command/tool/schema.evidence_id; full source and comparison records remain in the bundle.Expected effects of the existing real-provider verifier remain:
The retained-reference change adds no target interaction; existing verifier bridge-script execution and owned temporary-file/project responsibilities remain with their current owners. Executable target bytes are not modified.
Evidence and regression coverage
d48e472fa6a664cacbb400560e673533005795cecontains both duplicated inline request sites. The original public-MCP input shape reproduces the reported default transport refusal using explicit synthetic Evidence; this does not establish a real Ghidra run on this host.unchangedorunknown, retains the exact source link and full source/comparison records, and refuses a missing retained ID.resource_constraint; patched source is restored byte-for-byte infinally. This is a controlled reversion after mechanical extraction, not a claim that the newly exported helper existed on main.For evidence-bearing changes:
Validation performed
npm run test:focused -- tests/boundary/process/nativeValueVerifierComparison.test.ts src/domain/functionComparison.test.ts src/config/mcpInputBudget.test.ts tests/boundary/mcp/functionComparisonReferenceFactsMcp.test.ts— 3 prerequisite build tasks passed; 4 complete files, 103 tests passed.npm run check:fast— typecheck and lint passed, 2/2 tasks, 26.46s.npm run verify:test-discovery— all 2884 files discovered exactly once.Compatibility, safety, and release
verify:ghidra, real Ghidra/JDK, macOS/Linux or full repository suite result is claimed. The report's real-provider gate must still be rerun on an equipped host.Author readiness
Human owner: @ShuaixinHuang
Before merge
type(scope): outcome.This replacement preserves the prior PR discussion and validation history at #8258. It reuses the verified published head and requires its own hosted CI.
Resubmitted at the author's request as #8541: #8541. This PR is closed unmerged; its original discussion and validation history are retained.