[PR #5378] [MERGED] feat(analysis-view): add native inventory summaries and pages #6909

Closed
opened 2026-11-01 21:43:58 +00:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/morluto/rea/pull/5378
Author: @gensokyo-dev
Created: 10/20/2026
Status: ✅ Merged
Merged: 10/20/2026
Merged by: @gensokyo-dev

Base: main ← Head: perf/4249-native-inventory-views-20261020


📝 Commits (1)

  • 59bd2d2 feat(analysis-view): add native inventory summaries and pages

📊 Changes

26 files changed (+2545 additions, -217 deletions)

View changed files

📝 .agents/skills/reverse-engineer-anything/references/evidence-workflows.md (+11 -0)
📝 docs/mcp-contracts.md (+42 -0)
📝 experiments/analysis-efficiency/README.md (+5 -0)
➕ experiments/analysis-efficiency/native-inventory-costs.py (+115 -0)
➕ experiments/analysis-efficiency/native-inventory-portable.mjs (+231 -0)
➕ experiments/analysis-efficiency/native-inventory-views.json (+647 -0)
➕ experiments/analysis-efficiency/native-inventory-views.md (+201 -0)
➕ experiments/analysis-efficiency/native-inventory-views.mjs (+374 -0)
📝 src/application/XrefsAddressResolution.ts (+2 -2)
📝 src/application/analysisView/AnalysisViewService.ts (+5 -3)
📝 src/application/native/NativeDispatchMetadataInspection.ts (+3 -3)
📝 src/cli/analysisViewCommands.ts (+1 -1)
📝 src/contracts/analysisViewToolContracts.ts (+17 -1)
📝 src/contracts/officialToolContracts.ts (+19 -10)
📝 src/contracts/toolOutputSchemaGroups.ts (+32 -7)
📝 src/contracts/toolOutputSchemaPrimitives.ts (+0 -28)
📝 src/domain/analysisView/analysisView.ts (+53 -19)
➕ src/domain/analysisView/nativeInventoryView.test.ts (+170 -0)
➕ src/domain/analysisView/nativeInventoryView.ts (+192 -0)
➕ src/domain/native/nativeInventory.ts (+57 -0)

...and 6 more files

📄 Description

Summary

Fixes #4249. Native procedure/name/string inventories can exceed the MCP response budget or flood context when only counts and a few rows are needed. Five existing tools now accept opt-in summaries; inspect_analysis_view returns selected fields and stable pages while preserving complete source Evidence.

Change and scope

  • Canonical native row semantics live in domain; CLI/MCP share the projector and existing Evidence registration/retention layer.
  • Default complete responses and original Evidence identities are preserved. Row identity uses parent ID plus source index, including duplicate addresses. String value selection retains decoding qualifications; source/provider/profile/query and unknown discovery coverage remain explicit.
  • Validated immutable sources reuse format validation without a second retained graph. Oversized complete responses provide a working retained-page continuation.
  • Existing read-only analysis scope; no new provider, target-execution, injection, mutation or protection-recovery capability. Additional maintainer scope decision is not applicable.

Evidence and validation

Real Ghidra 12.1.4 on Debian true and official jq 1.8.2 completed the count/first-four-row question through production stdio MCP. Actual old Evidence was imported, every row reconstructed, original records reexported unchanged, and 20 actual CLI file-source/MCP comparisons returned identical Evidence. Source artifacts stayed unchanged.

In the frozen 58d-based pairs, including discovery, arguments, replies, retries and export recovery, the cl100k serialization proxy changes 306,496→208,002 (true) and 590,032→208,302 (jq). These are estimates, not actual model usage. The catalog grows ~30 KB and selected delivery adds RPCs. jq warm task time regresses 2.521→6.916 s; both family peaks increase. No general latency/CPU/memory improvement is claimed.

The small pair's complete original Evidence matches exactly. Independent jq analyses vary alias-primary/generated-label observations, so the large pair compares requested facts; old-source full-page equivalence is verified separately. Failed/guard-stopped attempts and resource/coverage limits remain in the measurement record.

  • npm run test:focused -- … — 24 files / 305 tests passed; exact executed paths are in the receipt.
  • npm run check — passed, including module/architecture guards.
  • npm run docs:check — passed.
  • Post-rebase: 28 files / 325 tests passed, final field-selection rerun 2 files / 9 tests passed; final npm run check and npm run docs:check passed. Both actual old-source CLI/MCP full-page verifiers passed again against the final build.

Final main adds Protobuf schemas: its observed complete 209-tool catalog is 3,317,414 bytes. Earlier fixed-runtime performance samples retain their original pins; final-main timing/token pairs were not rerun.

Linux x86-64 Ghidra metadata workflows are qualified here. Other providers/platforms, actual model-host gains and complete application reconstruction remain unverified. Complete source/export access and unknown-artifact semantics are preserved. Source contracts and authored packaged-skill guidance are updated; ignored generated catalogs/build outputs are not committed.

Latest main synchronization: preserved 4eaf3a117 oversized-error protocol framing. Three affected files/11 tests, real old-source CLI/MCP verification and npm run docs:check passed again. Latest-head pre-push typecheck/lint passed (two tasks).

Author readiness

Human owner: @gensokyo-dev

The owner explicitly dictated these readiness declarations and authorized publication and merge in the working session; they are not inferred from CI or automated review.

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

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.
  • Related issue is linked, or the reason for not linking one is stated above.
  • Tests cover changed observable behavior and meaningful failure paths.
  • Owning docs, contracts, and generated metadata are updated where needed.
  • User-visible CLI/MCP changes include representative output.
  • I checked the final diff for secrets, unrelated cleanup, and unsupported claims.

🔄 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/5378 **Author:** [@gensokyo-dev](https://github.com/gensokyo-dev) **Created:** 10/20/2026 **Status:** ✅ Merged **Merged:** 10/20/2026 **Merged by:** [@gensokyo-dev](https://github.com/gensokyo-dev) **Base:** `main` ← **Head:** `perf/4249-native-inventory-views-20261020` --- ### 📝 Commits (1) - [`59bd2d2`](https://github.com/morluto/rea/commit/59bd2d2eef93de4ed9e0709f10fb05c52728ce8e) feat(analysis-view): add native inventory summaries and pages ### 📊 Changes **26 files changed** (+2545 additions, -217 deletions) <details> <summary>View changed files</summary> 📝 `.agents/skills/reverse-engineer-anything/references/evidence-workflows.md` (+11 -0) 📝 `docs/mcp-contracts.md` (+42 -0) 📝 `experiments/analysis-efficiency/README.md` (+5 -0) ➕ `experiments/analysis-efficiency/native-inventory-costs.py` (+115 -0) ➕ `experiments/analysis-efficiency/native-inventory-portable.mjs` (+231 -0) ➕ `experiments/analysis-efficiency/native-inventory-views.json` (+647 -0) ➕ `experiments/analysis-efficiency/native-inventory-views.md` (+201 -0) ➕ `experiments/analysis-efficiency/native-inventory-views.mjs` (+374 -0) 📝 `src/application/XrefsAddressResolution.ts` (+2 -2) 📝 `src/application/analysisView/AnalysisViewService.ts` (+5 -3) 📝 `src/application/native/NativeDispatchMetadataInspection.ts` (+3 -3) 📝 `src/cli/analysisViewCommands.ts` (+1 -1) 📝 `src/contracts/analysisViewToolContracts.ts` (+17 -1) 📝 `src/contracts/officialToolContracts.ts` (+19 -10) 📝 `src/contracts/toolOutputSchemaGroups.ts` (+32 -7) 📝 `src/contracts/toolOutputSchemaPrimitives.ts` (+0 -28) 📝 `src/domain/analysisView/analysisView.ts` (+53 -19) ➕ `src/domain/analysisView/nativeInventoryView.test.ts` (+170 -0) ➕ `src/domain/analysisView/nativeInventoryView.ts` (+192 -0) ➕ `src/domain/native/nativeInventory.ts` (+57 -0) _...and 6 more files_ </details> ### 📄 Description ## Summary Fixes #4249. Native procedure/name/string inventories can exceed the MCP response budget or flood context when only counts and a few rows are needed. Five existing tools now accept opt-in summaries; `inspect_analysis_view` returns selected fields and stable pages while preserving complete source Evidence. ## Change and scope - Canonical native row semantics live in domain; CLI/MCP share the projector and existing Evidence registration/retention layer. - Default complete responses and original Evidence identities are preserved. Row identity uses parent ID plus source index, including duplicate addresses. String value selection retains decoding qualifications; source/provider/profile/query and unknown discovery coverage remain explicit. - Validated immutable sources reuse format validation without a second retained graph. Oversized complete responses provide a working retained-page continuation. - Existing read-only analysis scope; no new provider, target-execution, injection, mutation or protection-recovery capability. Additional maintainer scope decision is not applicable. ## Evidence and validation Real Ghidra 12.1.4 on Debian `true` and official jq 1.8.2 completed the count/first-four-row question through production stdio MCP. Actual old Evidence was imported, every row reconstructed, original records reexported unchanged, and 20 actual CLI file-source/MCP comparisons returned identical Evidence. Source artifacts stayed unchanged. In the frozen 58d-based pairs, including discovery, arguments, replies, retries and export recovery, the cl100k serialization proxy changes **306,496→208,002** (`true`) and **590,032→208,302** (jq). These are estimates, not actual model usage. The catalog grows ~30 KB and selected delivery adds RPCs. jq warm task time regresses **2.521→6.916 s**; both family peaks increase. No general latency/CPU/memory improvement is claimed. The small pair's complete original Evidence matches exactly. Independent jq analyses vary alias-primary/generated-label observations, so the large pair compares requested facts; old-source full-page equivalence is verified separately. Failed/guard-stopped attempts and resource/coverage limits remain in the [measurement record](https://github.com/morluto/rea/blob/59bd2d2eef93de4ed9e0709f10fb05c52728ce8e/experiments/analysis-efficiency/native-inventory-views.md). - `npm run test:focused -- …` — 24 files / 305 tests passed; exact executed paths are in the receipt. - `npm run check` — passed, including module/architecture guards. - `npm run docs:check` — passed. - Post-rebase: 28 files / 325 tests passed, final field-selection rerun 2 files / 9 tests passed; final `npm run check` and `npm run docs:check` passed. Both actual old-source CLI/MCP full-page verifiers passed again against the final build. Final main adds Protobuf schemas: its observed complete 209-tool catalog is 3,317,414 bytes. Earlier fixed-runtime performance samples retain their original pins; final-main timing/token pairs were not rerun. Linux x86-64 Ghidra metadata workflows are qualified here. Other providers/platforms, actual model-host gains and complete application reconstruction remain unverified. Complete source/export access and unknown-artifact semantics are preserved. Source contracts and authored packaged-skill guidance are updated; ignored generated catalogs/build outputs are not committed. Latest main synchronization: preserved `4eaf3a117` oversized-error protocol framing. Three affected files/11 tests, real old-source CLI/MCP verification and `npm run docs:check` passed again. Latest-head pre-push typecheck/lint passed (two tasks). ## Author readiness Human owner: @gensokyo-dev The owner explicitly dictated these readiness declarations and authorized publication and merge in the working session; they are not inferred from CI or automated review. - [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. ## Before merge - [x] This PR addresses a concrete problem or an agreed enhancement. - [x] Material scope and authority questions are resolved, and any required maintainer scope decision covers the final diff. - [x] The PR has one focused outcome and the title follows `type(scope): outcome`. - [x] Related issue is linked, or the reason for not linking one is stated above. - [x] Tests cover changed observable behavior and meaningful failure paths. - [x] Owning docs, contracts, and generated metadata are updated where needed. - [x] User-visible CLI/MCP changes include representative output. - [x] I checked the final diff for secrets, unrelated cleanup, and unsupported claims. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-01 21:43:58 +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#6909
No description provided.