[PR #1404] [MERGED] perf(native): record pwntools diagnostics once in their Evidence #2860

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

📋 Pull Request Information

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

Base: main ← Head: perf/binary-diagnostics-raw-result


📝 Commits (1)

  • 6113379 perf(native): record pwntools diagnostics once in their Evidence

📊 Changes

7 files changed (+22 additions, -5 deletions)

View changed files

📝 scripts/verify-binary-layout.mjs (+1 -1)
📝 scripts/verify/recorded-crash/public.mjs (+1 -1)
📝 src/application/binaryDiagnostics/BinaryLayoutService.test.ts (+14 -0)
📝 src/application/binaryDiagnostics/BinaryLayoutService.ts (+2 -1)
📝 src/application/binaryDiagnostics/RecordedCrashService.test.ts (+1 -0)
📝 src/application/binaryDiagnostics/RecordedCrashService.ts (+2 -1)
📝 tests/fixtures/analysisView.ts (+1 -1)

📄 Description

Problem

BinaryLayoutService and RecordedCrashService build Evidence with result: value, rawResult: value. The decoded pwntools report is their only representation, so every inspect_binary_layout and inspect_recorded_crash Evidence record carries the complete report twice (raw_result deep-equals normalized_result). An MCP response repeats Evidence in text and structured content, so it carries the report four times. The duplicate also counts twice against the 10 MiB transport budget, which verify-binary-layout's large-result lane exercises with a 65,281-section ELF.

This is the explicit-argument variant of the default copy that #1402 removes from createAnalysisExecution. The two changes are independent.

Change

  • Both services record rawResult: null. normalized_result, confidence, limitations and locations are unchanged.
  • tests/fixtures/analysisView.ts mirrors production with rawResult: null. inspect_analysis_view does not read raw_result.
  • The real-provider verifiers asserted the duplicate (deepEqual(normalized_result, raw_result) and deepEqual(raw_result, report)). They now assert raw_result === null and still check the full report through normalized_result.

Tests

  • New BinaryLayoutService case: the decoded layout is the complete normalized_result, and raw_result is null. The RecordedCrashService debugger-context case also asserts null.
  • npm run test:focused -- the two service tests, analysis-view service/domain tests, and binaryDiagnosticsMcp/analysisViewMcp/recordedCrashMcp (7 files, 41 passed)
  • npm run check:fast

Real pwntools/pwndbg verification needs Linux x64. I could not run it on this Mac. The PR touches src/application/binaryDiagnostics/** and both verifiers, so the Real offline binary layout and Real recorded crash evidence workflows run here and are the real-provider check for this change.

Refs #723, #1065.

🤖 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/1404 **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:** `perf/binary-diagnostics-raw-result` --- ### 📝 Commits (1) - [`6113379`](https://github.com/morluto/rea/commit/6113379a144338b2fb36dc20df5cb74c155a110d) perf(native): record pwntools diagnostics once in their Evidence ### 📊 Changes **7 files changed** (+22 additions, -5 deletions) <details> <summary>View changed files</summary> 📝 `scripts/verify-binary-layout.mjs` (+1 -1) 📝 `scripts/verify/recorded-crash/public.mjs` (+1 -1) 📝 `src/application/binaryDiagnostics/BinaryLayoutService.test.ts` (+14 -0) 📝 `src/application/binaryDiagnostics/BinaryLayoutService.ts` (+2 -1) 📝 `src/application/binaryDiagnostics/RecordedCrashService.test.ts` (+1 -0) 📝 `src/application/binaryDiagnostics/RecordedCrashService.ts` (+2 -1) 📝 `tests/fixtures/analysisView.ts` (+1 -1) </details> ### 📄 Description ## Problem `BinaryLayoutService` and `RecordedCrashService` build Evidence with `result: value, rawResult: value`. The decoded pwntools report is their only representation, so every `inspect_binary_layout` and `inspect_recorded_crash` Evidence record carries the complete report twice (`raw_result` deep-equals `normalized_result`). An MCP response repeats Evidence in text and structured content, so it carries the report four times. The duplicate also counts twice against the 10 MiB transport budget, which `verify-binary-layout`'s large-result lane exercises with a 65,281-section ELF. This is the explicit-argument variant of the default copy that #1402 removes from `createAnalysisExecution`. The two changes are independent. ## Change - Both services record `rawResult: null`. `normalized_result`, confidence, limitations and locations are unchanged. - `tests/fixtures/analysisView.ts` mirrors production with `rawResult: null`. `inspect_analysis_view` does not read `raw_result`. - The real-provider verifiers asserted the duplicate (`deepEqual(normalized_result, raw_result)` and `deepEqual(raw_result, report)`). They now assert `raw_result === null` and still check the full report through `normalized_result`. ## Tests - New `BinaryLayoutService` case: the decoded layout is the complete `normalized_result`, and `raw_result` is null. The `RecordedCrashService` debugger-context case also asserts null. - `npm run test:focused --` the two service tests, analysis-view service/domain tests, and `binaryDiagnosticsMcp`/`analysisViewMcp`/`recordedCrashMcp` (7 files, 41 passed) - `npm run check:fast` Real pwntools/pwndbg verification needs Linux x64. I could not run it on this Mac. The PR touches `src/application/binaryDiagnostics/**` and both verifiers, so the **Real offline binary layout** and **Real recorded crash evidence** workflows run here and are the real-provider check for this change. Refs #723, #1065. 🤖 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:08 +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#2860
No description provided.