[PR #1430] [MERGED] perf(native): record macOS command provenance once in its Evidence #2882

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

📋 Pull Request Information

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

Base: main ← Head: perf/native-macos-raw-provenance


📝 Commits (1)

  • aac9404 perf(native): record macOS command provenance once in its Evidence

📊 Changes

3 files changed (+37 additions, -8 deletions)

View changed files

📝 src/native/NativeMacOSProvider.ts (+0 -6)
📝 src/native/NativeMachoInspection.ts (+0 -2)
📝 tests/boundary/providers/native/nativeProvider.test.ts (+37 -0)

📄 Description

Summary

inspect_macho, inspect_signature, inspect_plist, list_architectures and demangle_swift already return their command provenance inside the normalized result (normalized_result.provenance). NativeMacOSProvider also copied the same array into raw_result, so every one of these responses carried it twice. MCP sends both text and structured content, so the copy appeared four times on the wire. raw_result is now null, which matches what docs/mcp-contracts.md says for results without a distinct provider representation. Same pattern as #1402, #1404 and #1405. Part of #1065 / #723.

Measurements (CLI --format json, local real apps, before → after)

App inspect-macho inspect-signature list-architectures
KeepingYouAwake 37,968 → 34,405 4,591 → 3,338 (−27%) 2,067 → 1,618 (−22%)
XLD 65,223 → 61,660 4,335 → 3,086 (−29%) 2,410 → 1,961 (−19%)
Transmission 115,012 → 111,444 4,298 → 3,047 (−29%) 2,064 → 1,615 (−22%)

Contract impact

  • No schema change. raw_result was already nullable, and the normalized result keeps the complete provenance array.
  • Evidence IDs for these operations change because raw_result is part of the hashed record. This is the same consequence as in #1402.
  • Nothing in src/, tests/ or scripts/ read the raw copy.

Verification

  • New regression test tests/boundary/providers/native/nativeProvider.test.ts ("records command provenance once, in the normalized result") covers all five operations. It fails on main and passes with this change.
  • npm run test:focused -- with all tests/boundary/providers/native/*, tests/boundary/mcp/native*, tests/boundary/cli/native*, src/native/*.test.ts, tests/acceptance/applications/appBundleEncodingCli.test.ts and tests/composition/analysis-sessions/providerBinding.test.ts: 275 of 276 pass. The one failure is the known local "real hdiutil verify refusal" case, which also fails on main on this Mac.
  • npm run typecheck, oxlint and oxfmt
  • Ran the real CLI on three installed macOS apps (table above).

No real Hopper/Ghidra verification (not affected).

🤖 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/1430 **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/native-macos-raw-provenance` --- ### 📝 Commits (1) - [`aac9404`](https://github.com/morluto/rea/commit/aac9404eee39cac86869f979638d884a2ed62c91) perf(native): record macOS command provenance once in its Evidence ### 📊 Changes **3 files changed** (+37 additions, -8 deletions) <details> <summary>View changed files</summary> 📝 `src/native/NativeMacOSProvider.ts` (+0 -6) 📝 `src/native/NativeMachoInspection.ts` (+0 -2) 📝 `tests/boundary/providers/native/nativeProvider.test.ts` (+37 -0) </details> ### 📄 Description ## Summary `inspect_macho`, `inspect_signature`, `inspect_plist`, `list_architectures` and `demangle_swift` already return their command provenance inside the normalized result (`normalized_result.provenance`). `NativeMacOSProvider` also copied the same array into `raw_result`, so every one of these responses carried it twice. MCP sends both text and structured content, so the copy appeared four times on the wire. `raw_result` is now `null`, which matches what `docs/mcp-contracts.md` says for results without a distinct provider representation. Same pattern as #1402, #1404 and #1405. Part of #1065 / #723. ## Measurements (CLI `--format json`, local real apps, before → after) | App | `inspect-macho` | `inspect-signature` | `list-architectures` | | --- | ---: | ---: | ---: | | KeepingYouAwake | 37,968 → 34,405 | 4,591 → 3,338 (−27%) | 2,067 → 1,618 (−22%) | | XLD | 65,223 → 61,660 | 4,335 → 3,086 (−29%) | 2,410 → 1,961 (−19%) | | Transmission | 115,012 → 111,444 | 4,298 → 3,047 (−29%) | 2,064 → 1,615 (−22%) | ## Contract impact - No schema change. `raw_result` was already nullable, and the normalized result keeps the complete `provenance` array. - Evidence IDs for these operations change because `raw_result` is part of the hashed record. This is the same consequence as in #1402. - Nothing in `src/`, `tests/` or `scripts/` read the raw copy. ## Verification - New regression test `tests/boundary/providers/native/nativeProvider.test.ts` ("records command provenance once, in the normalized result") covers all five operations. It fails on main and passes with this change. - `npm run test:focused --` with all `tests/boundary/providers/native/*`, `tests/boundary/mcp/native*`, `tests/boundary/cli/native*`, `src/native/*.test.ts`, `tests/acceptance/applications/appBundleEncodingCli.test.ts` and `tests/composition/analysis-sessions/providerBinding.test.ts`: 275 of 276 pass. The one failure is the known local "real hdiutil verify refusal" case, which also fails on main on this Mac. - `npm run typecheck`, oxlint and oxfmt - Ran the real CLI on three installed macOS apps (table above). No real Hopper/Ghidra verification (not affected). 🤖 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:22 +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#2882
No description provided.