Repository navigation
test(ghidra): assert projected limitations instead of a stale literal - #9268
Conversation
8eff651 (morluto#9246) replaced the checkpoint-disabled health limitation but left tests/boundary/mcp/ghidraEvidenceMcp.test.ts asserting the removed "original executable bytes are never written" text, so Test shard (5/8) and Portable tests have been red on main since. Compare the MCP result's limitations against limitationsFor() itself, so the boundary test keeps covering projection completeness without holding a second copy of prose the provider owns. A limitation dropped between the capability table and the MCP result still fails the test.
Codex Review Summary: ✅ CompletedThis 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] This test-only PR appears safe to merge. SummaryThis test-only change checks that source-declared Ghidra limitations reach the MCP result and relaxes the remaining auto-analysis wording check.
Reviews (4) · Last reviewed commit: "test(ghidra): keep the auto-analysis che..." · Reviewed by Greptile |
# Conflicts: # tests/boundary/mcp/ghidraEvidenceMcp.test.ts
main added two more limitation expectations to the dossier block while this branch replaced the prose literals with assertions derived from limitationsFor. Keep both: the branch's derivation for every declared limitation, plus main's added expectations.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: aba2805c03
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
The parent test matched /auto.analysis.*complete/iu so a harmless reword of the source-health limitation would not fail it. This change replaced that with an exact substring and regressed the coupling the surrounding loop avoids: the loop below already pins the provider's own text, so the literal only re-copies prose the provider owns.
|
TL;DR: I ran the PR's one changed test file at head fde786c on Node 22.23.4, 24.22.1 and 26.12.1. Each run passed all 11 tests. I did not run the probes that would show whether the new assertions catch a dropped entry. Findings
Not run
Test setupCommandsnpm ci --offline
npm run test:prepare
xvfb-run -a npm run test:focused -- tests/boundary/mcp/ghidraEvidenceMcp.test.ts🤖 Written and tested with Claude Code (Sonnet 5.5, verified by Opus 5.5), posted with my OK 🦊 |
|
Ran the two probes you flagged as not run, at Does the new assertion catch a dropped entry? Yes. Removing one health limitation from the projection ( Is the loop stronger than the literal it replaced? Yes. The literal was two regexes picked from the provider's prose, so a provider-side wording change either broke the test or was silently tolerated by the No code changed. The only thing I did not run is your merge against current main ( |
Summary
Fixes #9267.
tests/boundary/mcp/ghidraEvidenceMcp.test.tsasserted that ananalyze_functionresult carried a limitation containingoriginal executable bytes are never written.8eff65127(#9246) rewrote that entry insrc/ghidra/GhidraProviderCapabilities.ts:25and removed the prose checks insrc/ghidra/GhidraProvider.behavior.test.ts, but this boundary test was not updated.Test shard (5/8)andPortable testsfailed before #9276 updated that literal onmain.Problem and expected behavior
Trigger: run
npx vitest run tests/boundary/mcp/ghidraEvidenceMcp.test.tsonc5301e614. The MCP result now carries the checkpoint-disabled wording, the test still demands the removed phrase, and one of eleven tests fails. After #9276 updated the literal, this follow-up removes the duplicated wording and checks that every source-declared limitation reaches the MCP result.Change and scope
The removed literal is replaced with a comparison against
limitationsFor("analyze_function")itself: each limitation the capability table declares for that operation must be present in the projected MCP result.This keeps the projection-completeness coverage without a second copy of prose the provider owns, matching #9246's stated intent to remove prose-driven checks. A limitation dropped between the capability table and the MCP result still fails the test — verified with a negative control (see below).
Not included:
src/ghidra/GhidraProviderCapabilities.tsis unchanged. Thedefault auto-analysis completeassertion is kept as-is; it covers a different sentence that #9246 did not touch.Follow the contribution scope. This is an ordinary test fix within existing boundaries; no maintainer scope decision applies.
Contract and boundary impact
limitationsForinsrc/ghidra/GhidraProviderCapabilities.tsremains the sole producer; only the test's assertion changed.Expected effects: documentation or usability only; no target interaction. This PR changes a test assertion only.
Evidence and regression coverage
tests/boundary/mcp/ghidraEvidenceMcp.test.ts— the stale literal assertion is replaced with alimitationsFor("analyze_function")containment check.c5301e614before the change, the test fails withAssertionError: expected { …(16) } to match object { operation: 'analyze_function', …(3) }and the diff showing the received checkpoint-disabled limitation.Test Files 1 failed (1) / Tests 1 failed | 10 passed (11)."negative-control-limitation"entry to the expected set made the test fail withexpected [ …(10) ] to include 'negative-control-limitation', then the control was reverted. The containment check therefore still catches a limitation that the MCP result drops.Boundary regression applicable here: projection/parity between the capability table and the MCP boundary result. No lifecycle regression applies — no resource ownership or cleanup path is touched.
Validation performed
PATH=/opt/homebrew/opt/node@24/bin:$PATH npx vitest run tests/boundary/mcp/ghidraEvidenceMcp.test.ts— 11/11 passed.npm run check:fast— typecheck and lint successful (2 tasks, 7.0s).The earlier validation did not run the full suite,
npm run test:focused, or sharded CI; the focused run after the base update is recorded below.Compatibility, safety, and release
Breaking changes or migration steps: none.
Real Hopper/Ghidra, browser, or OS coverage: none. The existing test uses the simulated bridge in
ghidraMcpHarness.ts.Package or release metadata impact: none.
Security, privacy, process, or containment review: none; test-only change.
After merging current
mainin880c0e0590,npm run test:focused -- tests/boundary/mcp/ghidraEvidenceMcp.test.tspassed all 11 tests against the simulated bridge.On current head fde786c, the wording-tolerant follow-up also passed the 11-test Ghidra MCP boundary suite locally. This uses a simulated bridge; real Ghidra was not run.
Author readiness
Human owner: @2SinceJuly
Before merge
type(scope): outcome.