mirror of
https://github.com/morluto/rea.git
synced 2026-11-05 06:45:22 +00:00
[PR #2634] [MERGED] perf(native): add opt-in Mach-O summary delivery and retained pages #5295
Closed
opened 2026-10-31 01:05:31 +00:00 by bsakaguchi
·
0 comments
No Branch/Tag specified
main
codex/procedure-reference-stacked
release-please--branches--main--components--rea-agents
release-please--branches--main--components--rea-agents--release-notes
codex/kuna-independent-retry
codex/byte-search-overlay-coverage
codex/open-failure-target-receipt
codex/kuna-xref-evidence
codex/ghidra-ambiguous-procedure-recovery
codex/function-source-bundle
codex/trace-function-integration-prototype
codex/snapshot-source-closure
codex/recorded-evidence-array-pages
codex/evidence-recovery-redesign
codex/trace-feature-address-scope
codex/call-discovery-scope
codex/ghidra-literal-candidate-evidence
codex/decompile-directory-independent-retry
codex/retry-provenance-base
codex/value-flow-capability-experiment
codex/ghidra-containing-instruction
cursor/readme-discord-button-ef9f
dependabot/github_actions/actions/setup-node-7.1.0
dependabot/github_actions/actions/upload-artifact-7.0.2
dependabot/npm_and_yarn/npm-minor-and-patch-d8d97ce6df
codex/kuna-1989
fix/8559-native-ui-fixture-ownership
fix/8555-go-verifier-mcp-ownership
codex/provider-capability-recovery
fix/8642-rizin-target-stdin
codex/ghidra-memory-effect-scope
codex/ghidra-annotation-entry-selector
codex/ghidra-readonly-recovery
codex/ghidra-regex-verifier-recovery
codex/evidence-discovery-view-guidance
fix/8545-bulk-append-overflow
fix/8428-navigation-refusal-alternatives
codex/address-context-recovery
codex/matching-member-limitations
codex/unknown-scope-contract
codex/evidence-view-guidance
feat/8373-native-trace-views
codex/ghidra-snapshot-verifier-binding
codex/elf-export-visibility
codex/evidence-view-recovery
codex/native-reference-cli-help
codex/provider-candidate-observation-scope
codex/kuna-session-verification
codex/ghidra-switch-lifetime-guidance
codex/pseudocode-paging-discovery
codex/clarify-evidence-view-support
codex/kuna-xrefs-selector-recovery
codex/context-capacity-recovery
codex/evidence-closure-large-links
codex/same-function-evidence-identity
codex/ghidra-verifier-inspected-jdk
codex/audit-guided-workflows
codex/crash-prompt-retained-dossiers
codex/analysis-view-error-recovery
codex/kuna-verifier-target-selection
codex/ghidra-selected-project-call-coverage
codex/docs-native-analysis-scope
codex/ghidra-java-socket-boundary
codex/ghidra-retained-snapshot-verifier
codex/ghidra-search-inventory-facts
fix/8284-zero-argument-parameter-bindings
fix/8198-ui-action-handler-offset
fix/8257-elf-entry-label-identity
fix/8304-deferred-output-schema-projection
fix/8277-call-path-computed-target-uncertainty
fix/pr-8089-conflicts
fix/ci-static-duplicate-export
dependabot/npm_and_yarn/lint-staged-17.6.0
dependabot/github_actions/actions/download-artifact-8.0.2
dependabot/npm_and_yarn/write-file-atomic-8.0.0
dependabot/npm_and_yarn/canonicalize-5.1.0
dependabot/github_actions/actions/cache/restore-6.1.0
dependabot/npm_and_yarn/toon-format/toon-4.4.0
dependabot/github_actions/actions/deploy-pages-5.0.1
codex/review-fixes-pr-2403
codex/review-fixes-pr-2400
codex/process-terminal-width
codex/test-brittleness-cleanup
verify/7167-browser-connect-macos
fix/7167-browser-connect
feat/native-matching-allowance-setting
feat/browser-scenario-dry-run
test/managed-caller-parameters-20261024
codex/parser-fortythird-boundaries
fix/6926-pinvoke-platform-decorations-20261023
fix/6889-har-body-encoding-20261023
fix/6888-sqlite-schema-budget-20261023
fix/dependency-security-gates-6708
cursor/evidence-overwrite-rebase-b4ac
feat/4057-verify-native-exports
fix/windows-acl-observer-overhead-20261022
cursor/erlang-beam-restack-4476
cursor/pe-certificate-review-bf32
fix/6116-javascript-application-fs-errors
fix/6061-unmapped-runtime-script-unknown
feat/browser-scenario-summary
fix/pe-certificates
codex/verify-3407
cursor/rebase-5699
cursor/rebase-5352
cursor/rebase-5600
cursor/fix-cli-schema-omission-10a8
codex/audit-hopper-shutdown-reasons-20261021
fix/demangle-swift-omitted-record
fix/nib-boolean-value-types
cursor/cancellation-partial-observation-a5ac
fix/ib-object-limit-reasons
fix/electron-fuse-limit-advice
fix/kuna-doctor-dangling-cache
fix/fixed-budget-refusal-advice
fix/js-ipc-listener-dedup
fix/js-return-member-provenance
fix/dmg-integrity-retry-advice
fix/ida-doctor-readiness
fix/kuna-version-probe-output-drain
fix/legacy-swift-runtime-name-matching
fix/dylib-lazy-load-commands
fix/browser-scenario-startup-cancel
fix/swift-nested-punycode-classification
fix/compare-unselected-scopes
fix/objc-method-budget-coverage
fix/dmg-mounted-root-observations
audit/ci-tests-20261019-round2
release/6.7.0
fix/wabt-cleanup-retry-resolution
fix/electron-fuse-elf-pe-architecture
fix/native-plist-descriptor-ownership
fix/kuna-caller-cleanup-ownership
experiment/atomic-codemode-20261016
review/first-contributor-3776
fix/call-resolution-full-read-cycles
fix/member-mutation-selection-repeat
experiment/atomic-re-tools-20261015
perf/member-mutation-lazy-origins
perf/static-network-mutation-index
fix/hopper-startup-lifecycle
audit/3050-windows-proof-20261015
feat/windows-window-capture-2183
audit/3049-windows-proof-20261015
audit/3735-macos-fixtures-20261015
fix/batch-decompile-null-pseudocode
fix/kuna-inventory-honors-jobs
experiment/browser-codemode-tool-design-20261015
fix/hopper-clean-runtime-argv
codex/review-2049-27f1b367
review-fixes/pr-2787-routing
fix/3360-scoped-this-emitters
fix/3367-replaced-global-effects
fix/3838-compact-any-value-items
test/hopper-download-probe-20261015
codex/windows-runtime-creation-red-green-20261015
codex/windows-readonly-root-red-green-20261015
codex/windows-root-share-red-green-20261015
codex/exp-1685-win-mcp-startup
codex/bug-sweep-20261015
investigate/2190-windows-package-phases
investigate/3543-macos-cli-deadline
perf/3281-reverse-tools-feedback-quality
fix/3406-hopper-doctor-fixture
fix/3341-wrapper-require-test-context
fix/3301-owned-uninstall-fixtures
fix/3164-compiler-input-ownership
fix/pcap-cleanup-stdout-newline-20261014
perf/interface-builder-summary
codex/review-fixes-pr-1977
fix/ghidra-effective-jvm-platform
fix/docs-turkish-rust-link-20261013
fix/main-maintenance-ci-20261010
fix/recover-binary-session-process-effects
codex/review-fixes-pr-2457
codex/ci-required-cancellation-gate
fix/main-format-baseline-20261013
fix/setup-preserve-entry-fields
cursor/restore-main-checks-1ffc
fix/ghidra-bridge-hashmap-import
codex/shared-ci-jadx-json-default-20261013
codex/shared-ci-ghidra-test-groups-20261013
codex/shared-ci-java-fixture-format-20261013
codex/fix-intrinsic-invocation-boundaries
test/release-preflight-reusable-jobs
test/js-parameter-provenance-expectation
fix/linux-hopper-verification-current
test/2419-ghidra-elf-probe-size
followup/pr-1544-native-ida
codex/fold-pr-2230-contribution
docs/readme-responsible-use
fix/issue-2064
fix/issue-2050
fix/issue-2053
fix/issue-1968
fix/issue-1945
experiment/codemode-bridge-20261011
fix/tool-effects-negative-wording-1904-20261012
fix/1842-electron-interop-provenance
feat/recover-javascript-multi-input
refactor/website-i18n-prep
fix/nativeaot-pe-virtual-extent
fix/browser-verifier-ci-hang
fix/pe-resources-input-selection
docs/beginner-friendly-guides
docs/beginner-setup-guide
fix/javascript-analysis-worker-1563
fix/1649-ghidra-duplicate-names
fix/javascript-export-keys-integration-1369
test/maintenance-boundary-contracts-20261011
review/javascript-export-keys-1369
review/process-live-progress-1483
test/javascript-1495-growth-ratio
fix/ci-escape-timing
docs/normalized-terminal-geometry-1450
release/6.3.0
archive/release-6.3.0-pr1381
release/6.2.0
fix/electron-preload-dynamic-override
fix/javascript-self-referential-bundler-edges
release/6.1.0
cursor/grok-client-cherry-pick-0b56
feat/signature-posture
feat/dyld-shared-cache
feat/artifact-integrity-policy
feat/pkg-inventory
release/6.0.0
chore/sync-release-5.0.0
release/5.0.0
cursor/cloud-agent-node-787e
fix/javascript-xhr-open-endpoints
review/pr-711-realpath-fallback-wording
cleanup/replay-confinement
codex/test-suite-performance
codex/issue-foundations
codex/address-open-issues-2026-07-20
agent/javascript-vite-rollup-esbuild-adapters
agent/process-cleanup
agent/triage-integration
agent/unknown-commands-registry
feat/mcp-identity-metadata
morlvps/issue_cleanup
codex/installer-redesign
morl/roadmap-investigation-core
morl/roadmap-investigation-docs
release-please--branches--main--components--rea
rea-agents-6.8.0
rea-agents-6.7.0
rea-agents-6.6.0
experiment/atomic-codemode-wait-runtime-20261016
rea-agents-6.5.0
rea-agents-6.4.0
rea-agents-6.3.0
rea-agents-6.2.0
rea-agents-6.1.0
rea-agents-6.0.0
rea-agents-5.0.0
rea-agents-4.1.0
rea-agents-4.0.1
rea-agents-4.0.0
rea-agents-3.2.1
rea-agents-3.2.0
rea-agents-3.1.0
rea-agents-3.0.0
rea-agents-2.7.0
rea-agents-2.6.0
rea-agents-2.5.1
rea-agents-2.5.0
rea-agents-2.4.0
rea-agents-2.3.0
rea-agents-2.2.0
rea-agents-2.1.0
rea-agents-2.0.0
rea-agents-1.7.0
rea-agents-1.6.0
rea-agents-1.5.0
rea-agents-1.4.0
rea-agents-1.3.0
rea-agents-1.2.0
rea-agents-1.1.0
rea-agents-1.0.0
rea-agents-0.5.0
rea-agents-0.4.0
rea-agents-0.3.0
rea-0.2.1
rea-0.2.0
Labels
Clear labels
area: bridge
area: bridge
area: build
area: build
area: build
area: cli
area: domain
area: evidence
area: mcp
area: native
area: providers
area: runtime
area: server
area: setup
area: tests
bug
design
documentation
enhancement
enhancement
enhancement
experiment
help wanted
i18n
invalid
P0: critical
P1: high
P2: medium
P2: medium
P2: medium
P3: low
performance
provider-request
pull-request
Mirrored from GitHub Pull Request
question
roadmap
triage
No labels
area: bridge
area: bridge
area: build
area: build
area: build
area: cli
area: domain
area: evidence
area: mcp
area: native
area: providers
area: runtime
area: server
area: setup
area: tests
bug
design
documentation
enhancement
enhancement
enhancement
experiment
help wanted
i18n
invalid
P0: critical
P1: high
P2: medium
P2: medium
P2: medium
P3: low
performance
provider-request
pull-request
question
roadmap
triage
Milestone
Clear milestone
No items
No milestone
Projects
Clear projects
No items
No project
Assignees
Clear assignees
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#5295
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/morluto/rea/pull/2634
Author: @kaoru0822-kitauji
Created: 10/13/2026
Status: ✅ Merged
Merged: 10/13/2026
Merged by: @kaoru0822-kitauji
Base:
main← Head:perf/macho-summary-detail📝 Commits (4)
0d98b37perf(native): add opt-in Mach-O summary delivery and retained pages5be6342Merge origin/main into perf/macho-summary-detail6edba0bfix(mcp): refuse unretainable summary delivery before analysisd190e84fix(native): keep whole rows in Mach-O architecture and segment pages📊 Changes
13 files changed (+864 additions, -17 deletions)
View changed files
📝
.agents/skills/reverse-engineer-anything/references/native-and-artifacts.md(+8 -0)📝
docs/mcp-contracts.md(+15 -2)📝
src/contracts/analysisViewToolContracts.ts(+2 -2)📝
src/contracts/native/nativeToolContracts.ts(+10 -2)📝
src/contracts/toolOutputSchemaGroups.ts(+4 -1)📝
src/domain/analysisView/analysisView.ts(+28 -1)➕
src/domain/analysisView/machoView.test.ts(+246 -0)➕
src/domain/analysisView/machoView.ts(+247 -0)📝
src/server/createServer.ts(+2 -3)📝
src/server/registerArtifactTools.ts(+13 -5)📝
src/server/registerEvidenceTools.ts(+19 -1)➕
src/server/registerNativeTools.ts(+54 -0)➕
tests/boundary/mcp/nativeMachoSummaryMcp.test.ts(+216 -0)📄 Description
Summary
inspect_machoreturns every import and export inline, with no way to ask for less. On VS Code'sElectron Frameworkone MCP call returns 2,521,011 bytes of text (827,986 o200k tokens), plus the same JSON again asstructuredContent. The 10 MiB default MCP response budget admits this, so it reaches the agent in full. An agent that only wanted the slice, UUID or dependency count still paid for 11,231 exports and 5,129 imports.This PR adds the opt-in delivery selection that WASM, EVM, managed, Android, Dart AOT and pcap already have.
detail: "summary"retains the complete Evidence and returns slice identity plus per-collection counts.inspect_analysis_viewkindmachopages the original rows. Omitted orcompletedetail is unchanged, including its Evidence ID.Refs #2016, #1065.
Problem and expected behavior
Smallest trigger:
open_binaryon any large framework, theninspect_macho {}. Expected (the precedent for every other large producer): a first call can ask for a bounded answer, and the complete Evidence stays retained for exact pages.Change and scope
src/domain/analysisView/machoView.ts(new) is the single owner of Mach-O views.format,selected_architecture,endian,word_size,file_type,flagsanduuid. Each of the eight collections becomes{returned, total, exhaustive}. It addsprovenance_countand the merged report and collection limitations.kind: "macho"pages:entrypoints,architectures,build_metadata,load_commands,dependencies,imports,exports,segmentsorprovenance. Rows are the original rows. Each page repeats that collection'ssource_totalandsource_exhaustiveand its own limitations, so exhausting a non-exhaustive collection (nm/dyld_info imports and exports) is never read as absence.isMachOFormat, following 3c57e1a8b's subject authentication). A missing subject keeps the artifact identity unknown.src/server/registerNativeTools.ts(new) registers the native contracts with the same hooksregisterArtifactToolsuses forinspect_artifact.detailis stripped before execution, andsummarygoes throughsummarizeRetainedAnalysis.registerEvidenceToolsgainsparametersForEvidence, so delivery detail stays out of Evidence identity. The summary'sparent_evidence_idis the same Evidence ID as a complete call, as WASM's delivery already guarantees. Omitted detail still recordsparameters: {}:/bin/lsgivesev_9e6882ef…on both main and this branch.inspect_machodeclaresdetailas optional (theinspect_artifactform), and its output schema is complete-or-summary. The CLIinspect-machois unchanged. The portable CLI path isinspect-analysis-viewwith the complete Evidence inline, which works forkind: "macho"without other changes.docs/mcp-contracts.md, the skill referencenative-and-artifacts.md, and a short addition to theinspect_analysis_viewdescription.Not included: a default change (complete stays the default), CLI
--detail, and any change to the native tools or their caching.Contribution scope: not applicable. This follows the established opt-in delivery pattern; there's no new target execution, mutation or authority.
Contract and boundary impact
Semantic owner and earliest changed stage:
machoView.ts(projection of retainedinspect_machoEvidence); MCP delivery selection inregisterNativeTools.Contribution scope fit and linked maintainer decision: not applicable.
CLI and MCP/tool-catalog contract: additive.
inspect_machoaccepts optionaldetailand its output is a union with the summary carrier.inspect_analysis_viewgains amachorequest/result variant. Omitted detail behaves as before.Provider, bridge, target-format, or platform compatibility: none. The native tools receive the same (empty) parameters.
Evidence, artifact, provenance, or reconstruction contract: complete Evidence and its ID are unchanged. Summary/page Evidence are derived views linked to the retained parent.
Generated metadata, package, or installation impact: the catalog is regenerated at build;
docs:checkpasses.Read existing files or captured data.
Evidence and regression coverage
src/domain/analysisView/machoView.test.ts(any platform): summary counts and merged limitations without rows, the non-exhaustive unknown, pages with producer coverage, provenance, an offset past the end, a missing subject, a contradictory subject format, the wrong view kind, and a malformed retained result.tests/boundary/mcp/nativeMachoSummaryMcp.test.ts(darwin, real native tools on a copy of/bin/ls): omitted detail recordsparameters: {}; summary counts equal the complete result's collections;parent_evidence_idequals the complete call's Evidence ID; paging imports 16 at a time reproduces the completeimports.itemsexactly; a wrong view kind is refused.Real-data measurements (macOS, real MCP stdio, this branch)
Electron Framework(195 MB)Transmission.appexecutable/bin/lsstructuredContentcarries the same JSON again in each case. Tokens were counted with tiktoken o200k_base (cl100k is within 1%). Timings for the firstinspect_machocall in a fresh server:CPU and peak memory were not measured separately; the analysis is identical and only delivery differs.
Catalog cost:
tools/listgrows from 676,832 to 680,472 o200k tokens (+3,640, +0.54%).inspect_machoadds 1,042 tokens (input/output schema), andinspect_analysis_viewadds 2,598, mostly the typedmachorow union (1,593). Typingitemloosely, as the older native function view does, would save about 1.2k, but I followed the typed WASM/managed views. One complete call on a mid-size app (34k tokens) outweighs the catalog cost.Validation performed
npm run test:local -- src/domain/analysisView/machoView.test.ts— 4 passednpx vitest run src/contracts src/domain/analysisView src/application/analysisView src/server— 147 passed, 3 skippednpm run test:focused --nativeMachoSummaryMcp,analysisSummaryDetailMcp,toolSchemaValidity,serverIdentity,analysisViewCli,targetContentProvenance,wasmArtifactMcp,managedArtifactSummaryMcp,nativeProvider,providerBinding— all pass. The one exception isanalysisViewMcp"reads successive native source pages directly from a completed-result transport error", which fails identically on unmodified main on this host.npm run check:fast,npm run typecheck,npm run format:check,npm run docs:check,npm run jscpd,npm run verify:architecture-guards— passinspect-machoon the Electron Framework, theninspect-analysis-viewwith that Evidence inline forsummary,macho/exportsandmacho/build_metadata; each takes about 0.35 s and returns 2.5–3.3 KB.Compatibility, safety, and release
otool,nm,dyld_info,lipo,vtool); the Linux CI runs the domain tests, and the darwin MCP test skips there.Before merge
type(scope): outcome.🤖 Generated with Claude Code
Summary by CodeRabbit
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.