mirror of
https://github.com/morluto/rea.git
synced 2026-11-05 06:45:22 +00:00
[GH-ISSUE #8193] [Design] Analyze an explicitly selected universal Mach-O slice with Kuna #6477
Open
opened 2026-11-01 21:11:27 +00:00 by bsakaguchi
·
3 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#6477
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?
Originally created by @morluto on GitHub (Oct 30, 2026).
Original GitHub issue: https://github.com/morluto/rea/issues/8193
Before submitting
Decision needed
Should REA allow an explicit selected architecture of a universal Mach-O to be analyzed with Kuna, while keeping the original container, selected slice, coordinates and derived artifacts unambiguous?
Context and evidence
On macOS arm64, I built an unexecuted x86-64/arm64 universal Mach-O from the same small owned C fixture (container SHA-256
705614f3df4c590fee5e0bbe7639e7108886f4d47138d20ff63ec59829019538).decompile ... _adjust --slice arm64 --jsonreturned the arm64 function at0x100000410; selectingx86_64returned the x86-64 function at0x100000420. Omitting--slicereturned the x86-64 result on this container, even though the host is arm64. This is one container ordering, not a claim about all default choices.open_binarywithprovider_id: "kuna"refused the universal image with a typed unsupported-target error and advised opening a supported extracted binary. A failed explicit open left no target in that new session, solist_architecturesandinspect_machothen reported no app open.list_architecturesto report both slices. With Hopper configured, auto selection used its verified private thin-image workflow and its Evidence described the original container. In a separate session with Hopper disabled, metadata inspection still worked, while deep procedure listing was unavailable.lipo -thin arm64to create a separate file. Its bytes matched the range[16384, 49952)of the original container. REA/Kuna opened that thin file and listed the function, but its Evidence subject was the thin file and its SHA-256 (20b1bb58e22badbb817bd8939ad3e8a84b1a61f181f3a86dce4456d6c2245d36); the manual parent-to-slice relationship was not part of that Evidence.The current rejection matches REA's documented thin-only Kuna boundary; it is not a claim that universal input was promised. It does show why simply forwarding Kuna's default would be unsafe for a caller who selected a different architecture.
Expected interaction with targets
Read a caller-selected local container and launch the existing static provider; an owned temporary slice may be written. Neither original target nor target code is executed or modified.
Boundary details (optional)
Require or otherwise make the selected architecture unambiguous. Validate slice identity, offsets, container bounds and target changes; preserve original and derived digest, selected architecture, coordinate mapping, and cleanup ownership. Do not assume slice addresses, file offsets, or the provider default are interchangeable. The existing Hopper verified-image path is useful design evidence, not proof that its implementation can be reused unchanged for Kuna.
Options and tradeoffs
Compare a shared, verified owned-slice preparation workflow against passing an explicit
--slicewith independently checked identity and output semantics. Consider an agent's recovery after an explicit provider refusal and whether a provider-neutral selection operation could be shared with #7381. Do not expose upstream flags without preserving evidence and lifecycle behavior.Verification available so far
I have a prototype or observed results.
Success criteria and open questions
Test both requested slices, ambiguous/default selection, malformed and duplicated FAT entries, identity changes, different file offsets, cache separation, CLI/MCP parity, cancellation and cleanup. Preserve the selected user input and verify cold and project-export paths; do not infer that a universal container's default architecture equals the host or that the slice digest is the container digest.
References
Related: #7381 (Ghidra), #8173 (function matching across distinct coordinate contexts), #8168 (Kuna inventory classifications). REA source
d48e472faplus the 1.986 baseline update in #8187.Universal Mach-O byte provenance control
On macOS arm64, I built an unexecuted x86-64/arm64 universal Mach-O with
_audit_valuein both slices.lipo -detailed_inforeported x86-64 at container offset0x1000and arm64 at0x4000. Direct released Kuna 1.988read --slicereturned the expected 16 bytes for each architecture. An unverified debug source build at Kuna merge commitb8eae8b660ceb0dc2a9162d0df2e63272c9280ed, using locally supplied 1.988 specs, returned the same bytes andfileprovenance offsets0x1340for x86-64 and0x4328for arm64. Those offsets locate the bytes in the original universal container.After explicit
lipo -thinextraction, the same source build reported slice-file offsets0x340and0x328, respectively. The original container bytes at the reported container offsets and the extracted files at their reported slice offsets matched independently. Real REA/Ghidra 12.1.4 through compact and full stdio MCP returned the same bytes and slice-file offsets for both extracted binaries; successfulread_bytesandaddress_to_file_offsetresults validated against their advertised schemas. REA explicitly refused the universal file for both Ghidra and verified Kuna 1.988 with provider-specific unsupported-target reasons.The original universal SHA-256 was
d5374df0bffb2d6c05a30d431a37b70cc4877f16bad1c11638d748797c0252ef; extracted arm64 and x86-64 hashes were967e8358527e0fd4dea88282e6cd4b9cf56604c9f786f5c1d75ed1ba642d991bandb33bfb04782a7b1570eb9d54cf28226dd67e2d4223608d23b979d299c89065f7. All remained unchanged and were not run. This is one constructed container and ordinary file-backed reads, not a claim about all offsets, fixups, malformed containers or released provenance support. It reinforces that an adapter must name the coordinate owner and preserve the selected slice and container identity; it must not add a slice base twice or treat an extracted file's offset as a container offset.Recovery after refusal with an existing target
On #8608 head
331f2dd82, macOS arm64, Ghidra 12.1.4/JDK 21 and Kuna 1.988, I opened the extracted arm64 file with Ghidra, read 16 bytes at0x100000328, then attempted to open the universal container explicitly with Ghidra. Both compact and full stdio MCP returnedcapability_unavailable/target_unsupported;binary_session(detail: complete)still showed an open Ghidra binding, and repeating the read succeeded with the previous thin file's subject SHA-256967e8358527e0fd4dea88282e6cd4b9cf56604c9f786f5c1d75ed1ba642d991b. A failed switch therefore preserves the previous target in this control.Explicitly reopening the universal container without a provider then succeeded;
list_architecturesreported both slices and their container offsets. All successful results were validated against the fetched MCP output schemas; source hashes remained unchanged and no target was executed. This is one recovery sequence, not a general lifecycle guarantee. It adds an agent-UX concern to #8402: after a failed switch, a follow-up query without checking its subject may still answer about the old artifact. Recovery guidance should make the preserved selection and explicit reopen/selection step understandable while retaining the useful previous session.@morluto commented on GitHub (Oct 31, 2026):
Looping in @gensokyo-dev @kaoru0822-kitauji @N0zoM1z0 for visibility on the Ghidra, Kuna, and REA tool-design investigation.
@morluto commented on GitHub (Oct 31, 2026):
Additional selected-slice controls on main
e6d061897, macOS arm64, direct Kuna 1.986 and real REA MCP with Ghidra 12.1.4/Kuna 1.986. This uses the original two-slice, unexecuted Mach-O; independentlipo -detailed_inforeported x86-64 at container offset 4096 (size 8568) and arm64 at offset 16384 (size 33568). I verified each full container range byte-for-byte against its corresponding thin file.functions, individualdecompile, outgoingxrefsanddisassemblereturned equal parsed results for the selected FAT slice and its thin file after excluding the input path._adjustwas0x100000410on arm64 and0x100000420on x86-64. The returnedbinaryidentifies the supplied file; the selection is still caller context.decompile-project --progress, the function spans matched between FAT and thin output for each architecture, but complete C-file digests differed because their generated include/file names differed. On x86-64 the function's output-file offset was 30 for FAT versus 31 for thin. Output-file spans must therefore remain tied to the actual produced file, even when function text matches._adjustto thin offsets 1040 (arm64) and 1056 (x86-64); adding the independently verified slice starts produced container offsets 17424 and 5152, whose bytes matched Kuna's first decoded instruction. REA/Kuna reported address-to-file-offset capability unavailable; it did not establish that mapping itself.The container and thin-file hashes were unchanged. These are two slices of one fixture, not proof of general FAT loader equivalence or cross-architecture behavioral equivalence. They support preserving both container and slice identity plus coordinate context; they do not make project-output offsets interchangeable or justify forwarding an omitted
--slicedefault.@morluto commented on GitHub (Oct 31, 2026):
Shipped-artifact control on current REA
a989c0e: Xcode 26.5's universallibSwiftToolsSupport.dylibwas refused by explicitopen_binary(provider_id: "kuna")with the documentedtarget_format_unsupportedreason. Direct Kuna 1.986 on that original file, explicitly using--slice arm64, successfully decompiled the selected address0x6d868.I created a separate caller-owned arm64 file with
lipo -thin arm64; its bytes exactly matched the original slice at container offset 1,228,800 with length 1,190,496. REA/Kuna opened that derivative and decompiled the same address, but its Evidence subject and SHA-256 identified the derivative, not the original universal container. Original SHA-256a0c202bf8ea127eb1d0c23f305c9f926e54cd29399d095c71bb37a265ad4144c; derivative SHA-2560898d938a516e7168c2a19b2bce36fda6e0b440dadcf3c436babf52b486a1875. Both hashes stayed unchanged during analysis; neither target was executed.The chosen export name was also absent from Kuna's procedure inventory despite being present in the source's export trie; that independent name handoff is #8328 / Kuna #1349. This one Apple-shipped library supports the importance of preserving container/slice identity; it does not establish that forwarding
--sliceis sufficient for REA's cached project and evidence contracts.