Skip to content

test(ghidra): match the checkpoint-aware health limitation - #9269

Closed
XiaoBinGan wants to merge 2 commits into
morluto:mainfrom
XiaoBinGan:fix/ghidra-checkpoint-limitation-assertion
Closed

XiaoBinGan wants to merge 2 commits into
morluto:mainfrom
XiaoBinGan:fix/ghidra-checkpoint-limitation-assertion

Conversation

@XiaoBinGan

Copy link
Copy Markdown
Contributor

Summary

Current main fails tests/boundary/mcp/ghidraEvidenceMcp.test.ts on its own. #9246 rewrote the default healthLimitations entry to name the checkpoint mode, and this test still asserted the previous phrasing.

FAIL tests/boundary/mcp/ghidraEvidenceMcp.test.ts > Ghidra MCP evidence parity >
     preserves provider evidence, composed parity, and capability routing
AssertionError: expected { …(16) } to match object { operation: 'analyze_function', …(3) }

Expected limitations to contain "original executable bytes are never written". The default limitation now says:

Ghidra Program checkpoint mode is disabled: closing discards metadata edits; original executable bytes are unchanged. For stock ELF/PE/Mach-O on Linux/macOS, set REA_GHIDRA_CHECKPOINT_DIR …

Change

One assertion names the substring the source emits. Nothing else changes.

The text at GhidraProviderCapabilities.ts:48 — the existing-project branch — still says "are never written" and is untouched. The default branch and the owned-checkpoint branch keep their own wording, so this only corrects the expectation for the default limitation.

Why this is worth landing on its own

The failure is inherited by every open PR that rebases onto current main: a PR's shards run against the merge of its head with main, so this one assertion turns the Test shard (5/8) lane red regardless of what the branch changed. The red Portable tests and CI required lanes are that failure aggregated, not independent problems.

Contract and boundary impact

  • Semantic owner and earliest changed stage: none; this is a test expectation.
  • CLI and MCP/tool-catalog contract: none. No tool, schema, description or catalog change.
  • Provider, bridge, target-format, or platform compatibility: the assertion now matches the message the provider emits.
  • Evidence, artifact, provenance, or reconstruction contract: none.
  • Generated metadata, package, or installation impact: none.

Expected effects:

  • Test-only; no runtime behavior change.

Validation performed

  • npx vitest run tests/boundary/mcp/ghidraEvidenceMcp.test.ts — 11 passed
  • npx tsc --noEmit -p . — exit 0
  • npm run lint — 0 errors
  • Reproduced the failure on a clean checkout of upstream/main at 8eff65127 before changing anything, so the assertion mismatch is confirmed independent of this branch.

Gap: the failure was reproduced locally on Windows. The CI lane that first showed it runs on Linux, and I did not run the Linux lane here; the assertion compares a fixed string the provider emits, so it is platform-independent.

Before merge

  • This PR addresses a concrete problem or an agreed enhancement.
  • Material scope and authority questions are resolved, and any required maintainer scope decision covers the final diff.
  • The PR has one focused outcome and the title follows type(scope): outcome.
  • Tests cover changed observable behavior and meaningful failure paths.
  • Owning docs, contracts, and generated metadata are updated where needed.
  • I checked the final diff for secrets, unrelated cleanup, and unsupported claims.

Author readiness

Human owner: @XiaoBinGan

  • I reviewed the final diff and relevant existing code, understand the change and its edge cases, and take responsibility for the complete PR, including AI-assisted work.
  • I checked the evidence above, confirmed it supports the current change, and recorded meaningful validation gaps.
  • I declare this PR ready for initial maintainer review.

`morluto#9246` rewrote the default `healthLimitations` entry to name the checkpoint mode:

    Ghidra Program checkpoint mode is disabled: closing discards metadata edits;
    original executable bytes are unchanged. For stock ELF/PE/Mach-O on
    Linux/macOS, set REA_GHIDRA_CHECKPOINT_DIR ...

`ghidraEvidenceMcp.test.ts` still asserted the previous phrasing, "original
executable bytes are never written", so it fails on `main` at `8eff65127` and
`c5301e614` independently of any branch:

    FAIL tests/boundary/mcp/ghidraEvidenceMcp.test.ts > Ghidra MCP evidence parity
      AssertionError: expected { …(16) } to match object { operation: 'analyze_function', …(3) }

The assertion now names the substring the source emits. The text at
`GhidraProviderCapabilities.ts:48` — the `existing-project` branch — still says
"are never written" and is untouched, so only the default limitation's expectation
changed.

`tests/boundary/mcp/ghidraEvidenceMcp.test.ts`: 11 passing. `tsc` 0;
`npm run lint` 0 errors.

This is what turned the shards red on every open PR against current `main`; the
failures were inherited, not caused by those branches.
@XiaoBinGan XiaoBinGan changed the title test(ghidra):-match-the-checkpoint-aware-health-limitation test(ghidra): match the checkpoint-aware health limitation Nov 7, 2026
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 7, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-07T11:22:31.128555Z b0644b8 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@greptile-apps

greptile-apps Bot commented Nov 7, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 5/5

[Low impact] This test-only change appears safe to merge.

Summary

Replaces frozen health-message phrases with ghidraHealthLimitations("fresh-import") in the Ghidra MCP test.

  • The Ghidra evidence test follows the fresh-import limitation text.

Reviews (5) · Last reviewed commit: "test(ghidra): compare delivered guidance..." · Reviewed by Greptile

`docs/testing.md` asks tests to compare delivered guidance with the owning formatter
or constant instead of freezing explanatory sentences, and `AGENTS.md` points there.
The previous commit swapped one frozen phrase for another, which fixes today's failure
and leaves the next reword to break the same shard.

The assertion now requires the result to contain every string
`ghidraHealthLimitations("fresh-import")` returns, so the test follows the formatter
that owns that text.

Verified both directions: rewording the health limitation to "original executable
bytes stay byte-for-byte identical" keeps the test green, while the frozen-phrase
version fails on the same edit.

`tests/boundary/mcp/ghidraEvidenceMcp.test.ts`: 11 passing. `tsc` 0.
@morluto

morluto commented Nov 7, 2026

Copy link
Copy Markdown
Owner

Closing as superseded by #9268, which fixes the same stale Ghidra MCP limitation assertion and checks the complete operation limitation set, including the fresh-import health limitations covered here. Thank you for identifying and fixing the failure.

@morluto morluto closed this Nov 7, 2026
@XiaoBinGan

Copy link
Copy Markdown
Contributor Author

Understood, and thank you for the pointer. I checked #9268 and it is still open, so the stale assertion is live on main until that lands — nothing for me to do here beyond not duplicating it.

One note for whoever merges #9268: the case I fixed and the case it fixes are not the same assertion. Mine pinned the fresh-import health wording; its claim is the complete operation limitation set, which is the stronger shape. I am not reopening this.

My only open question is whether the same stale-literal shape appears in other Ghidra MCP limitation assertions that #9268 does not reach. If it does and someone is already on it, say so and I will stay out.

@morluto morluto added area: tests Test suite and verification provider: ghidra Analysis provider / engine: ghidra labels Nov 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: tests Test suite and verification provider: ghidra Analysis provider / engine: ghidra

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants