[PR #5461] feat(providers): add Leandec deep provider backed by its MCP cache #6931

Open
opened 2026-11-01 21:44:09 +00:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/morluto/rea/pull/5461
Author: @bovel84
Created: 10/20/2026
Status: 🔄 Open

Base: main ← Head: feature/leandec-provider


📝 Commits (1)

  • 1247fd4 feat(providers): add Leandec deep provider backed by its MCP cache

📊 Changes

12 files changed (+1780 additions, -3 deletions)

View changed files

📝 docs/.vitepress/config.ts (+1 -0)
📝 docs/index.md (+1 -1)
➕ docs/leandec-provider.md (+86 -0)
📝 scripts/lib/module-boundaries.mjs (+1 -0)
📝 scripts/lib/test-projects.mjs (+1 -1)
📝 src/composition/binary.ts (+3 -1)
➕ src/leandec/LeandecMcpClient.ts (+336 -0)
➕ src/leandec/LeandecProvider.test.ts (+78 -0)
➕ src/leandec/LeandecProvider.ts (+137 -0)
➕ src/leandec/LeandecProviderCapabilities.ts (+121 -0)
➕ src/leandec/LeandecSessionClient.ts (+864 -0)
➕ src/leandec/LeandecSettings.ts (+151 -0)

📄 Description

What

Adds a leandec deep provider that makes REA a client of the Leandec MCP server instead of starting a second Ghidra stack.

Leandec is a Ghidra workbench with a persistent SQLite cache (functions, pseudocode, assembly, references, strings) exposed over stdio MCP. Cached answers are instant, re-imports of identical bytes reuse the stored analysis, and unknown targets can still be imported through analyze + job polling.

Components

  • LeandecMcpClient: stdio JSON-RPC client with one shared handshake, bounded stderr, per-call timeout, AbortSignal support and SIGTERM/SIGKILL shutdown.
  • LeandecSessionClient: maps the AnalysisClient operations, resolves targets by path or slice digest, imports unknown targets, and reads inventory/strings through SQL and text through decompile/disassemble/xrefs.
  • LeandecProvider / LeandecSettings / LeandecProviderCapabilities: mach-o, mach-o-universal and elf support, env-driven configuration (LEANDEC_MCP_SERVER, LEANDEC_PYTHON, timeouts, limits, LEANDEC_AUTO_ANALYZE), cachePolicy: live.
  • Composition root wires the provider after kuna; module boundary declared, adapters test project updated, docs added (docs/leandec-provider.md).

Notes for reviewers

  • The provider is optional: without LEANDEC_MCP_SERVER it stays unavailable and the existing provider chain is unchanged.
  • The paired Leandec change (MCP resolve, trace_feature, get_reconstruction_context, alias-aware re-import) lives in bovel84/Leandec PR #5.
  • Rebased on main (aa314ab6) after the branch was written.

Verification (local)

  • npx vitest run src/leandec — 3 tests passed.
  • npm run verify:module-boundaries — 2334 files checked, no violations.
  • oxfmt --check on changed files — clean.
  • npx tsc --noEmit reports only pre-existing missing @bufbuild/protobuf types (stale local node_modules, unrelated to this change; the same guard blocked the pre-push hook).

🔄 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/5461 **Author:** [@bovel84](https://github.com/bovel84) **Created:** 10/20/2026 **Status:** 🔄 Open **Base:** `main` ← **Head:** `feature/leandec-provider` --- ### 📝 Commits (1) - [`1247fd4`](https://github.com/morluto/rea/commit/1247fd4f9e5c8fa57b912e635755d590e6a5c0aa) feat(providers): add Leandec deep provider backed by its MCP cache ### 📊 Changes **12 files changed** (+1780 additions, -3 deletions) <details> <summary>View changed files</summary> 📝 `docs/.vitepress/config.ts` (+1 -0) 📝 `docs/index.md` (+1 -1) ➕ `docs/leandec-provider.md` (+86 -0) 📝 `scripts/lib/module-boundaries.mjs` (+1 -0) 📝 `scripts/lib/test-projects.mjs` (+1 -1) 📝 `src/composition/binary.ts` (+3 -1) ➕ `src/leandec/LeandecMcpClient.ts` (+336 -0) ➕ `src/leandec/LeandecProvider.test.ts` (+78 -0) ➕ `src/leandec/LeandecProvider.ts` (+137 -0) ➕ `src/leandec/LeandecProviderCapabilities.ts` (+121 -0) ➕ `src/leandec/LeandecSessionClient.ts` (+864 -0) ➕ `src/leandec/LeandecSettings.ts` (+151 -0) </details> ### 📄 Description ## What Adds a `leandec` deep provider that makes REA a **client** of the Leandec MCP server instead of starting a second Ghidra stack. Leandec is a Ghidra workbench with a persistent SQLite cache (functions, pseudocode, assembly, references, strings) exposed over stdio MCP. Cached answers are instant, re-imports of identical bytes reuse the stored analysis, and unknown targets can still be imported through `analyze` + `job` polling. ## Components - `LeandecMcpClient`: stdio JSON-RPC client with one shared handshake, bounded stderr, per-call timeout, `AbortSignal` support and `SIGTERM`/`SIGKILL` shutdown. - `LeandecSessionClient`: maps the `AnalysisClient` operations, resolves targets by path or slice digest, imports unknown targets, and reads inventory/strings through SQL and text through `decompile`/`disassemble`/`xrefs`. - `LeandecProvider` / `LeandecSettings` / `LeandecProviderCapabilities`: `mach-o`, `mach-o-universal` and `elf` support, env-driven configuration (`LEANDEC_MCP_SERVER`, `LEANDEC_PYTHON`, timeouts, limits, `LEANDEC_AUTO_ANALYZE`), `cachePolicy: live`. - Composition root wires the provider after `kuna`; module boundary declared, adapters test project updated, docs added (`docs/leandec-provider.md`). ## Notes for reviewers - The provider is optional: without `LEANDEC_MCP_SERVER` it stays unavailable and the existing provider chain is unchanged. - The paired Leandec change (MCP `resolve`, `trace_feature`, `get_reconstruction_context`, alias-aware re-import) lives in bovel84/Leandec PR #5. - Rebased on `main` (`aa314ab6`) after the branch was written. ## Verification (local) - `npx vitest run src/leandec` — 3 tests passed. - `npm run verify:module-boundaries` — 2334 files checked, no violations. - `oxfmt --check` on changed files — clean. - `npx tsc --noEmit` reports only pre-existing missing `@bufbuild/protobuf` types (stale local `node_modules`, unrelated to this change; the same guard blocked the pre-push hook). --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
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#6931
No description provided.