[PR #2933] [MERGED] fix(ghidra): preserve PE PDB coverage facts #5500

Closed
opened 2026-10-31 01:07:07 +00:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/morluto/rea/pull/2933
Author: @N0zoM1z0
Created: 10/13/2026
Status: ✅ Merged
Merged: 10/14/2026
Merged by: @N0zoM1z0

Base: main ← Head: fix/windows-pe-pdb-coverage-2259


📝 Commits (1)

  • 9164048 fix(ghidra): preserve PE PDB coverage facts

📊 Changes

11 files changed (+676 additions, -160 deletions)

View changed files

📝 src/application/InvestigationProviders.ts (+3 -3)
📝 src/ghidra/GhidraAnalysisProfile.ts (+1 -1)
📝 src/ghidra/GhidraPeProfile.test.ts (+277 -76)
📝 src/ghidra/GhidraPeProfile.ts (+106 -21)
📝 src/ghidra/GhidraProvider.behavior.test.ts (+98 -38)
📝 src/ghidra/GhidraProviderClient.ts (+3 -9)
📝 src/ghidra/GhidraSessionValues.ts (+13 -8)
📝 tests/boundary/filesystem/directAnalysisSnapshotReplay.test.ts (+77 -3)
➕ tests/boundary/mcp/enhancedTools.limitations.test.ts (+42 -0)
📝 tests/boundary/mcp/ghidraInventoryMcp.test.ts (+1 -1)
➕ tests/composition/directAnalysisLimitations.test.ts (+55 -0)

📄 Description

Changes

Fixes #2259's missing symbol-coverage limitation. Caller-selected PDB companion admission is not added.

  • Preserve reported Program PDB identity and nullable load state, including loaded=true and explicit resource omissions. Retain declared CodeView facts when fields are missing, conflicting, omitted or unrecognized. Keep matching/type-coverage attestation uncertainty.
  • Compare only recognized GUID/hex-age formats and exact declared locator values. Explicitly omitted file/GUID/age cannot establish equivalence; unrelated signature/version omissions do not defeat a known comparison.
  • Measure actual JSON UTF-8 locator expansion before allocation within the 1024-byte inline budget.
  • Advance PE observations to program-info-v5 and composed workflow revisions, preserving historical Evidence while rejecting obsolete replay bindings.

The shared limitations collector, canonical ordering and adapter wiring from this PR were already absorbed into main by 80de3145e. This update keeps main's implementation and removes superseded duplicate code; the remaining diff completes PDB projection, replay revisions and their regressions.

Verification

Current head 91640480697eb2ed4abf8afe5a639f942691b1f2, refreshed onto main 44d98de2367b99808d78db732ec7d72533266233 and conflicts resolved at the owning representation. Locked Node 24.18.0/npm 11.16.0 dependencies were refreshed.

  • Runtime build and full check:fast pass.
  • 309 tests pass across 15 associated files; two Windows-only cases are skipped on Linux. Includes CLI composition, socket-backed MCP, provider/profile/cache boundaries, malformed identities, actual JSON budgets, cancellation and cleanup.
  • Three NB10 omitted-GUID cases fail before the comparison fix and pass after it. Historical v4 snapshots remain evidence and cannot replay the old interpretation. NB10 coverage is a producer-contract regression fixture; real-provider verification below uses RSDS.

Real Windows scope

Ghidra 12.1.4 PUBLIC/JDK 21.0.12.1; actual Windows where.exe and its GUID/age-matching Microsoft public PDB. Independent DbgHelp verifies both identities. Direct Ghidra control loads the PDB and finds wmain, but its analysis budget expires; it does not attest completed analysis. REA reports unknown Program PDB load state and companion-admission limits honestly.

Public workflow Tested source Observation
CLI inspect 2a30299c7 254324.00 ms;6234 bytes;197 procedures
CLI --version ca24903f 12419.20 ms;6 bytes;exit 0
MCP initialize ca24903f 12041.01 ms
MCP cold overview ca24903f 276283.58 ms;12929 wire bytes
MCP warm overview ca24903f 65.08 ms;identical normalized result and wire size
MCP name search/address lookup ca24903f Empty search retains PDB caveat;expected typed unresolved-name error
MCP backward call graph ca24903f 245.68 ms;18091 bytes;3 successful nodes;PDB and call-coverage limitations retained

Final MCP/native wrapper exits 0; EXE/PDB bytes are unchanged and zero matching owned Java/Node processes remain. CLI inspect retains its earlier exact-source scope. The verified ca24903f 1566-file runtime tree digest is 83cfc1a3d02b1146b000ad8a8866c2a97c49c6b8f36435c4dd7b855d1107895f. The Windows addon was rebuilt from the verified ca24903f source, artifact-verified, and used in this run: SHA256 e3997c26fe7c203edb5455cb36538bf94be56e92caa248806b365c9747338244, 1043146 bytes, N-API 8/ABI 1. Pure JS saxes/xmlchars dependencies match the lockfile.

Performance limits and resources

CPU affinity is two cores, priority BelowNormal, Node/Java heaps 512 MiB; observed JVM affinity/heap match. No verified metaspace or peak-working-set claim. A first current-head run exceeded a 600s startup budget during Ghidra auto-analysis; a second exceeded a 30s MCP initialize budget before opening the binary. Both failed attempts are retained. Final complete verification uses test-only 120s initialize, 900s startup and 950s SDK cold-call budgets with unchanged CPU/heap caps. Product defaults are unchanged. Cold startup is variable; no cross-revision speedup or guaranteed 600s completion is claimed.

Incremental deployment removes 135 obsolete generated files. Inputs and compact source-scoped receipts are retained; prior superseded compile caches reclaimed 10222462 bytes. No binaries, local artifacts, personal information or license-registration data are committed.

Current integration, CI and review

Main's bcc884556 independently repairs unknown PDB load state. This update retains that behavior through the combined observation owner and tests both search and health Evidence for absent/null/false/true state without duplicate caveats or generated-name overclaims. All unrelated main provider tests are preserved.

The prior CI's static failure was our fixture missing newly required createArtifactBinarySession; this commit fixes it. Shard 5's pcap trailing-newline/cleanup fixture failure was unrelated and fixed upstream by 1341e8c83; its suite now passes locally. No unrelated own pcap change is included.

The 17 relevant PDB/provider/profile, Java bridge and Windows native source files are byte-identical to the verified ca24903f files. Real Windows measurements remain pinned to their actual source in the table, without a claim that the new complete runtime tree or unrelated latest-main features were real-tested.

Eight prior review threads are resolved. Earlier exact-head CI 38492549349 passed completely. CI 38548383351 passes on 916404806, including source/static/build, all five shards, native package jobs and reverse-tool coverage/mutation. Greptile passes and all eight review threads are resolved. Human owner declarations below are recorded at the owner’s explicit direction; repository readiness validation is pending.

Author readiness

Human owner: @N0zoM1z0

  • 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.

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/morluto/rea/pull/2933 **Author:** [@N0zoM1z0](https://github.com/N0zoM1z0) **Created:** 10/13/2026 **Status:** ✅ Merged **Merged:** 10/14/2026 **Merged by:** [@N0zoM1z0](https://github.com/N0zoM1z0) **Base:** `main` ← **Head:** `fix/windows-pe-pdb-coverage-2259` --- ### 📝 Commits (1) - [`9164048`](https://github.com/morluto/rea/commit/91640480697eb2ed4abf8afe5a639f942691b1f2) fix(ghidra): preserve PE PDB coverage facts ### 📊 Changes **11 files changed** (+676 additions, -160 deletions) <details> <summary>View changed files</summary> 📝 `src/application/InvestigationProviders.ts` (+3 -3) 📝 `src/ghidra/GhidraAnalysisProfile.ts` (+1 -1) 📝 `src/ghidra/GhidraPeProfile.test.ts` (+277 -76) 📝 `src/ghidra/GhidraPeProfile.ts` (+106 -21) 📝 `src/ghidra/GhidraProvider.behavior.test.ts` (+98 -38) 📝 `src/ghidra/GhidraProviderClient.ts` (+3 -9) 📝 `src/ghidra/GhidraSessionValues.ts` (+13 -8) 📝 `tests/boundary/filesystem/directAnalysisSnapshotReplay.test.ts` (+77 -3) ➕ `tests/boundary/mcp/enhancedTools.limitations.test.ts` (+42 -0) 📝 `tests/boundary/mcp/ghidraInventoryMcp.test.ts` (+1 -1) ➕ `tests/composition/directAnalysisLimitations.test.ts` (+55 -0) </details> ### 📄 Description ## Changes Fixes #2259's missing symbol-coverage limitation. Caller-selected PDB companion admission is not added. - Preserve reported Program PDB identity and nullable load state, including loaded=true and explicit resource omissions. Retain declared CodeView facts when fields are missing, conflicting, omitted or unrecognized. Keep matching/type-coverage attestation uncertainty. - Compare only recognized GUID/hex-age formats and exact declared locator values. Explicitly omitted file/GUID/age cannot establish equivalence; unrelated signature/version omissions do not defeat a known comparison. - Measure actual JSON UTF-8 locator expansion before allocation within the 1024-byte inline budget. - Advance PE observations to `program-info-v5` and composed workflow revisions, preserving historical Evidence while rejecting obsolete replay bindings. The shared limitations collector, canonical ordering and adapter wiring from this PR were already absorbed into main by `80de3145e`. This update keeps main's implementation and removes superseded duplicate code; the remaining diff completes PDB projection, replay revisions and their regressions. ## Verification Current head `91640480697eb2ed4abf8afe5a639f942691b1f2`, refreshed onto main `44d98de2367b99808d78db732ec7d72533266233` and conflicts resolved at the owning representation. Locked Node 24.18.0/npm 11.16.0 dependencies were refreshed. - Runtime build and full `check:fast` pass. - 309 tests pass across 15 associated files; two Windows-only cases are skipped on Linux. Includes CLI composition, socket-backed MCP, provider/profile/cache boundaries, malformed identities, actual JSON budgets, cancellation and cleanup. - Three NB10 omitted-GUID cases fail before the comparison fix and pass after it. Historical v4 snapshots remain evidence and cannot replay the old interpretation. NB10 coverage is a producer-contract regression fixture; real-provider verification below uses RSDS. ### Real Windows scope Ghidra 12.1.4 PUBLIC/JDK 21.0.12.1; actual Windows `where.exe` and its GUID/age-matching Microsoft public PDB. Independent DbgHelp verifies both identities. Direct Ghidra control loads the PDB and finds `wmain`, but its analysis budget expires; it does not attest completed analysis. REA reports unknown Program PDB load state and companion-admission limits honestly. | Public workflow | Tested source | Observation | |---|---|---| | CLI inspect |`2a30299c7`|254324.00 ms;6234 bytes;197 procedures | | CLI --version |`ca24903f`|12419.20 ms;6 bytes;exit 0 | | MCP initialize |`ca24903f`|12041.01 ms | | MCP cold overview |`ca24903f`|276283.58 ms;12929 wire bytes | | MCP warm overview |`ca24903f`|65.08 ms;identical normalized result and wire size | | MCP name search/address lookup |`ca24903f`|Empty search retains PDB caveat;expected typed unresolved-name error | | MCP backward call graph |`ca24903f`|245.68 ms;18091 bytes;3 successful nodes;PDB and call-coverage limitations retained | Final MCP/native wrapper exits 0; EXE/PDB bytes are unchanged and zero matching owned Java/Node processes remain. CLI inspect retains its earlier exact-source scope. The verified `ca24903f` 1566-file runtime tree digest is `83cfc1a3d02b1146b000ad8a8866c2a97c49c6b8f36435c4dd7b855d1107895f`. The Windows addon was rebuilt from the verified `ca24903f` source, artifact-verified, and used in this run: SHA256 `e3997c26fe7c203edb5455cb36538bf94be56e92caa248806b365c9747338244`, 1043146 bytes, N-API 8/ABI 1. Pure JS saxes/xmlchars dependencies match the lockfile. ### Performance limits and resources CPU affinity is two cores, priority BelowNormal, Node/Java heaps 512 MiB; observed JVM affinity/heap match. No verified metaspace or peak-working-set claim. A first current-head run exceeded a 600s startup budget during Ghidra auto-analysis; a second exceeded a 30s MCP initialize budget before opening the binary. Both failed attempts are retained. Final complete verification uses test-only 120s initialize, 900s startup and 950s SDK cold-call budgets with unchanged CPU/heap caps. Product defaults are unchanged. Cold startup is variable; no cross-revision speedup or guaranteed 600s completion is claimed. Incremental deployment removes 135 obsolete generated files. Inputs and compact source-scoped receipts are retained; prior superseded compile caches reclaimed 10222462 bytes. No binaries, local artifacts, personal information or license-registration data are committed. ## Current integration, CI and review Main's `bcc884556` independently repairs unknown PDB load state. This update retains that behavior through the combined observation owner and tests both search and health Evidence for absent/null/false/true state without duplicate caveats or generated-name overclaims. All unrelated main provider tests are preserved. The prior CI's static failure was our fixture missing newly required `createArtifactBinarySession`; this commit fixes it. Shard 5's pcap trailing-newline/cleanup fixture failure was unrelated and fixed upstream by `1341e8c83`; its suite now passes locally. No unrelated own pcap change is included. The 17 relevant PDB/provider/profile, Java bridge and Windows native source files are byte-identical to the verified `ca24903f` files. Real Windows measurements remain pinned to their actual source in the table, without a claim that the new complete runtime tree or unrelated latest-main features were real-tested. Eight prior review threads are resolved. Earlier exact-head CI `38492549349` passed completely. CI `38548383351` passes on `916404806`, including source/static/build, all five shards, native package jobs and reverse-tool coverage/mutation. Greptile passes and all eight review threads are resolved. Human owner declarations below are recorded at the owner’s explicit direction; repository readiness validation is pending. ## Author readiness Human owner: @N0zoM1z0 <!-- Recorded at the human owner's explicit direction after confirming review, evidence and responsibility in this session. --> - [x] 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. - [x] I checked the evidence above, confirmed it supports the current change, and recorded meaningful validation gaps. - [x] I declare this PR ready for initial maintainer review. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-31 01:07:07 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
morluto/rea#5500
No description provided.