[PR #1507] [MERGED] fix(native): page every retained function dossier collection #2927

Closed
opened 2026-10-17 21:11:55 +00:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/morluto/rea/pull/1507
Author: @kaoru0822-kitauji
Created: 10/10/2026
Status: ✅ Merged
Merged: 10/10/2026
Merged by: @kaoru0822-kitauji

Base: main ← Head: fix/native-view-complete-facets


📝 Commits (1)

  • 3ac739f fix(native): page every retained function dossier collection

📊 Changes

6 files changed (+95 additions, -9 deletions)

View changed files

📝 .agents/skills/reverse-engineer-anything/references/native-and-artifacts.md (+3 -2)
📝 docs/mcp-contracts.md (+3 -2)
📝 src/contracts/analysisViewToolContracts.ts (+1 -1)
📝 src/domain/analysisView/analysisView.test.ts (+58 -0)
📝 src/domain/analysisView/analysisView.ts (+6 -0)
📝 src/domain/analysisView/nativeFunctionView.ts (+24 -4)

📄 Description

Summary

Since a9ee2360, inspect_analysis_view is the documented way to read an analyze_function dossier that exceeds the MCP response budget (#1247). Its native facets covered procedure, pseudocode, assembly, callers, callees, incoming_references, outgoing_references and the value-flow facets. The rest of functionDossierSchema could not be read from retained Evidence at all:

  • basic_blocks, which grows with function size just like assembly;
  • comments;
  • unresolved_calls;
  • referenced_strings and referenced_names;
  • native_api, the full API-boundary record. Views only folded its limitations and unknowns into the parent fields.

When one of these is what an agent needs from an oversized dossier, the only remaining route is to export the complete Evidence.

Change

  • New native facets: basic_blocks, comments, unresolved_calls, referenced_strings, referenced_names. They page by rows, with the same offset, limit and coverage rules as assembly.
  • New singleton facet native_api (offset must be 0). It returns the recorded boundary, or {available: false, reason: "not recorded"} when the dossier has none.
  • unresolved_calls is optional in the dossier schema. When it is absent the facet reports "not recorded". Only value-flow facets inherit the value-flow failure reason; otherwise the shared fallback would report a misleading reason here.
  • The tool description, docs/mcp-contracts.md and the skill's native reference list the new facets.

This is additive: existing facets and their results are unchanged.

Verification

  • A new test in src/domain/analysisView/analysisView.test.ts pages each new collection, checks the absent-unresolved_calls reason while value flow is unavailable, and checks the native_api singleton.
  • npx vitest run src/domain/analysisView src/application/analysisView passes (25 tests).
  • npm run test:focused -- tests/boundary/mcp/analysisViewMcp.test.ts tests/boundary/cli/analysisViewCli.test.ts tests/boundary/mcp/toolSchemaValidity.test.ts tests/boundary/mcp/contractPresentation.test.ts passes (20 tests).
  • npm run check:fast and npm run docs:check pass.
  • I did not run real Ghidra or Hopper. The change projects already-retained dossier fields and uses the existing Ghidra dossier fixture.

🤖 Generated with Claude Code


🔄 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/1507 **Author:** [@kaoru0822-kitauji](https://github.com/kaoru0822-kitauji) **Created:** 10/10/2026 **Status:** ✅ Merged **Merged:** 10/10/2026 **Merged by:** [@kaoru0822-kitauji](https://github.com/kaoru0822-kitauji) **Base:** `main` ← **Head:** `fix/native-view-complete-facets` --- ### 📝 Commits (1) - [`3ac739f`](https://github.com/morluto/rea/commit/3ac739feb4e1e4ae3ad830cd3f1ec39c863a2f3b) fix(native): page every retained function dossier collection ### 📊 Changes **6 files changed** (+95 additions, -9 deletions) <details> <summary>View changed files</summary> 📝 `.agents/skills/reverse-engineer-anything/references/native-and-artifacts.md` (+3 -2) 📝 `docs/mcp-contracts.md` (+3 -2) 📝 `src/contracts/analysisViewToolContracts.ts` (+1 -1) 📝 `src/domain/analysisView/analysisView.test.ts` (+58 -0) 📝 `src/domain/analysisView/analysisView.ts` (+6 -0) 📝 `src/domain/analysisView/nativeFunctionView.ts` (+24 -4) </details> ### 📄 Description ## Summary Since a9ee2360, `inspect_analysis_view` is the documented way to read an `analyze_function` dossier that exceeds the MCP response budget (#1247). Its native facets covered `procedure`, `pseudocode`, `assembly`, `callers`, `callees`, `incoming_references`, `outgoing_references` and the value-flow facets. The rest of `functionDossierSchema` could not be read from retained Evidence at all: - `basic_blocks`, which grows with function size just like `assembly`; - `comments`; - `unresolved_calls`; - `referenced_strings` and `referenced_names`; - `native_api`, the full API-boundary record. Views only folded its limitations and unknowns into the parent fields. When one of these is what an agent needs from an oversized dossier, the only remaining route is to export the complete Evidence. ## Change - New native facets: `basic_blocks`, `comments`, `unresolved_calls`, `referenced_strings`, `referenced_names`. They page by rows, with the same `offset`, `limit` and coverage rules as `assembly`. - New singleton facet `native_api` (offset must be 0). It returns the recorded boundary, or `{available: false, reason: "not recorded"}` when the dossier has none. - `unresolved_calls` is optional in the dossier schema. When it is absent the facet reports `"not recorded"`. Only value-flow facets inherit the value-flow failure reason; otherwise the shared fallback would report a misleading reason here. - The tool description, `docs/mcp-contracts.md` and the skill's native reference list the new facets. This is additive: existing facets and their results are unchanged. ## Verification - A new test in `src/domain/analysisView/analysisView.test.ts` pages each new collection, checks the absent-`unresolved_calls` reason while value flow is unavailable, and checks the `native_api` singleton. - `npx vitest run src/domain/analysisView src/application/analysisView` passes (25 tests). - `npm run test:focused -- tests/boundary/mcp/analysisViewMcp.test.ts tests/boundary/cli/analysisViewCli.test.ts tests/boundary/mcp/toolSchemaValidity.test.ts tests/boundary/mcp/contractPresentation.test.ts` passes (20 tests). - `npm run check:fast` and `npm run docs:check` pass. - I did not run real Ghidra or Hopper. The change projects already-retained dossier fields and uses the existing Ghidra dossier fixture. 🤖 Generated with [Claude Code](https://claude.com/claude-code) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-17 21:11:55 +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#2927
No description provided.