mirror of
https://github.com/morluto/rea.git
synced 2026-11-05 06:45:22 +00:00
[GH-ISSUE #8360] [Design] Investigate explicit non-mutating decode of an alternate instruction stream #6564
Open
opened 2026-11-01 21:12:16 +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#6564
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 31, 2026).
Original GitHub issue: https://github.com/morluto/rea/issues/8360
Before submitting
Decision needed
Should REA offer an explicitly requested, bounded, non-mutating decode at a selected address when an analyst needs to inspect an alternative instruction stream that the provider's listing did not retain? If so, should that be a mode of the existing instruction-inspection workflow?
Context and evidence
On REA main
d54a4661d, I built an x86-64 Mach-O dylib containing the following unexecuted bytes at0x2d0:The conditional branch at
0x2d2names0x2d5, inside the byte span of the fall-through instruction starting at0x2d4. Independently requested decodes establish two byte-valid static alternatives:0x2d4: b8 b8 2a 00 00(MOV EAX,0x2ab8), and0x2d5: b8 2a 00 00 00(MOV EAX,0x2a), followed byRETat0x2da. These are conditional static possibilities, not observed runtime execution.procedure_assembly(_audit_overlap)returned the first stream and included the branch to0x2d5, but no row starting there or a specific overlap caveat. Its separate pseudocode contained anoverlapbranchwarning and truncated the fall-through.inspect_native_instructionandread_byteswere explicitly unavailable with Kuna selected.inspect_native_instruction(0x2d5)returnednot-in-listingand explicitly said no decode was attempted;read_bytesreturned the authored 12 bytes. Ghidra did not create the_audit_overlapprocedure in this fresh import, so a procedure lookup did not resolve it. The fixed-function control did resolve.new PseudoDisassembler(currentProgram).disassemble(address)produced both byte sequences above. Ghidra's shipped API documentation states this operation does not affect the program. This is one direct Ghidra observation, not an existing REA feature or proof of general decoder correctness.disassemble --followdid not produce the overlapping target on this fixture; it emitted contradictory recovery notes. I reported the reproduced upstream behavior separately: https://github.com/Noelo-Lab/kuna/issues/1363. An REA design should not simply forward--followas a completeness guarantee.The target digest was unchanged across REA calls; successful MCP responses were validated with the advertised compact schemas. The fixture and standalone Ghidra project were disposable.
Expected interaction with targets
Read explicitly selected bytes and provider decoder context. No target execution or mutation of the target or selected Ghidra project is proposed. Scope and provider admission still need maintainer review.
Boundary details
Keep the exact requested address, address space, source bytes, architecture and mode/context with each candidate. A decode does not establish function identity, listing membership, reachability or runtime execution. Preserve overlapping alternatives; do not replace a listed instruction or silently decode uninitialized, unmapped, ambiguous-context or non-executable data. Existing
not-in-listing,not-instruction-boundary, data and unreadable results must retain their meaning. Bound the requested range and output.Options and tradeoffs
Compare the existing listing-only result plus explicit caller-side recovery; an opt-in candidate decode under
inspect_native_instruction; or another task-level address-context workflow. Evaluate the result and provenance before proposing integration. Do not add a provider-specific CLI wrapper merely for API parity.Verification available so far
I have observed results. One x86-64 Mach-O and the exact inputs above were exercised; broad architectures, ARM/Thumb mode, overlays, selected edited projects, instruction context changes, cancellation and CLI parity are untested. The source file's SHA-256 is
bae32cfbc3dab050235ece58c19cf38bf99d0ea198d1511c9e3512a48199216c.References
Related #8241 concerns finding the containing listed instruction without silently moving a search hit; #7490 concerns correct
not-in-listingstatus; #8192 concerns analyst-selected function entries. Ghidra'sPseudoDisassembleris a possible implementation primitive, not a prescribed public contract.@gensokyo-dev @kaoru0822-kitauji @N0zoM1z0
Additional AArch64 boundary control
On REA
9ebbe67e05af08b567e215340da993c08dae378f, macOS arm64, a self-built AArch64 Mach-O (SHA-256ae0f2a349b22332113ab60ab4c78024eb18153c76bdeefb01c4b1d89a26c0003) was inspected through real compact-schema MCP with Ghidra 12.1.4 and Kuna 1.989. Ghidra returneddecodedfor0x100000328(ff4300d1,sub) and0x10000032c(e00f00b9,str),not-instruction-boundaryfor the interior byte0x100000329, andoutside-memoryfor0x200000000. REA'sinspect_native_instructionexplicitly reported unavailable with Kuna selected.Direct
kuna disassembleat0x100000328 --addr --count 2 --jsonreturned the same two instruction bytes; the same command at0x100000329 --addr --count 1 --jsonemitted a one-byte.byte 0x43row. This is a raw decoding result, not evidence of a listed instruction boundary or runtime execution. The target digest remained unchanged. Only this fixture and MCP output profile were checked; this does not establish general ARM mode or decoder behavior.Kuna 1.990 overlap control and upstream status
The earlier
--followfailure described above was fixed upstream in Kuna #1370, closing #1363. On macOS arm64 I rebuilt the x86-64 Mach-O fixture (entry0x2b0, SHA-25675423e5e9b6514152915e72b04f6b7c01742af2223ed03eea435524de12e6d88). Direct Kuna 1.990disassemble --follow --jsonreported both0x2b4: b8b82a0000and0x2b5: b82a000000, with an explicit note that rows overlap. An independent direct non-follow decode at0x2b5returned the second instruction andRETat0x2ba.In compact and full public MCP sessions on REA's 1.990 validation branch,
procedure_assemblyfor0x2b0returned the straight-line listing and branch to0x2b5but no row at0x2b5;read_function_instructionsandinspect_native_instructionreturnedcapability_unavailablefor Kuna. The target was not executed and its digest stayed unchanged. This is one fixture and does not imply that an alternate decode proves reachability or runtime execution, or that exposing Kuna's full CLI is the right REA design.Pseudocode and dossier warning in 1.990
On the same 1.990 fixture, separate fresh compact and full MCP sessions requested cold
procedure_pseudo_code, completeanalyze_function, and pseudocode again after the project export. Each result retained Kuna's inlineoverlapbranchwarning naming0x2b5and saying the fall-through was truncated; the dossier also included the straight-line assembly without the alternate row. The cold result disclosed its single-function source, and the completed-project result did not carry that source limitation. The warning is provider text rather than a separately typed overlap record; this test did not establish how an autonomous agent interprets it or whether every overlap generates a warning. The fixture hash remained unchanged.Explicit cross-provider handoff on 1.990 fixture
On the 1.990 overlap fixture above, compact and full MCP sessions first obtained Kuna pseudocode containing its overlap warning, then explicitly reopened the same target with Ghidra 12.1.4.
inspect_native_instruction(0x2b5)returnednot-in-listingand explicitly said no decode was attempted;read_bytes(0x2b0, 12)returned85ff7401b8b82a000000c3c3. The original Kuna pseudocode Evidence was still retained exactly in the same investigation bundle after the switch. Direct Kunadisassembleat0x2b5separately produced the alternate decode described above. The source digest remained unchanged. This is a manual cross-provider handoff, not a typed alternate decode in REA or proof of instruction reachability.Direct Ghidra candidate decode
On the same x86-64 overlap fixture, a separate Ghidra 12.1.4 headless import ran an owned post-script calling
new PseudoDisassembler(currentProgram).disassemble(toAddr("2b5")). Ghidra returnedMOV EAX,0x2a, bytesb82a000000, length 5;getInstructionAt(0x2b5)was null both before and after the call. This agrees on the candidate bytes with direct Kuna's independent decode. The disposable project was deleted, the unexecuted target retained SHA-25675423e5e9b6514152915e72b04f6b7c01742af2223ed03eea435524de12e6d88, and no REA capability was added.This establishes a possible non-listing-mutating Ghidra primitive on one x86 fixture, not general non-mutation of every project property, correctness across architectures or modes, reachability, or runtime execution. A task-level contract must distinguish such a candidate from the observed listing, expose requested address and decoder context, preserve failures and resource bounds, and avoid silently rewriting the database.
Candidate decoder address boundaries
A direct Ghidra 12.1.4 headless follow-up on the same fixture asked
PseudoDisassembler.disassembleat three exact addresses. The unlisted0x2b5decodedMOV EAX,0x2a;0x2b6, an interior byte of that candidate, also decoded a different plausibleSUBinstruction. Neither became a listed instruction. At unmapped0x200000000, the decoder returned null. The first probe incorrectly dereferenced that null and raisedNullPointerExceptionin the probe itself; a corrected second run distinguished the null result from an exception. Both temporary projects were deleted.This reinforces that a successful candidate decode alone cannot choose an instruction boundary or establish execution. A REA workflow would need to validate mapped/readable input before invoking the primitive and return an honest typed failure; the null observation is specific to this fixture and Ghidra version, not a general specification of Ghidra's API.
Candidate decode from non-executable data
A separate direct Ghidra 12.1.4 headless control used the owned arm64 pointer fixture from #8510. Its slot at
0x100004000was in a non-executable block and identified as data in the REA control.PseudoDisassembler.disassemblenevertheless returnedudf 0x3c0from loaded bytesc0030000withsetRespectExecuteFlag(false)and withsetRespectExecuteFlag(true). This tests those two direct calls, not the behavior of Ghidra's other subroutine-validation methods. The disposable project was deleted and the target was not executed.A future caller-selected candidate decode should report memory permissions and loaded-byte provenance and define its policy for non-executable regions explicitly; the decoder producing a plausible instruction does not make data executable or prove code. Do not assume the
setRespectExecuteFlagsetting alone enforces that policy for the tested directdisassemblecall.Ghidra source interpretation
The Ghidra 12.1.4
PseudoDisassemblersource documents single-instruction decoding as not changing the program. Source inspection shows thedisassemble(Address)path delegates to a one-instruction pseudo decode; therespectExecuteFlagfield is consulted in validation paths rather than that direct method. Its setter documentation is broad, but the observed direct decode matches the implementation. This is not an upstream defect report: REA should own its admission policy and cannot infer execute enforcement from the setter alone. The local controls above remain observations on the listed fixtures and host.