[PR #5269] [MERGED] fix(rizin): default one-shot output to plain presentation #6849

Closed
opened 2026-11-01 21:43:29 +00:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/morluto/rea/pull/5269
Author: @gensokyo-dev
Created: 10/19/2026
Status: ✅ Merged
Merged: 10/19/2026
Merged by: @gensokyo-dev

Base: main ← Head: fix/4488-rizin-plain-output


📝 Commits (2)

  • a391544 fix(rizin): default one-shot output to plain presentation
  • b4542d3 test(rizin): consolidate one-shot profile coverage

📊 Changes

4 files changed (+27 additions, -24 deletions)

View changed files

📝 docs/reverse-engineering-tools.md (+1 -1)
📝 src/rizin/RizinCommand.ts (+3 -1)
📝 tests/boundary/providers/RizinDebugSessionCoverage.part1.test.ts (+0 -14)
📝 tests/composition/reverseEngineering.test.ts (+23 -8)

📄 Description

Summary

Fixes #4488. Default one-shot Rizin terminal presentation to plain text before capturing CLI/MCP Evidence. Explicit caller colour settings and literal ANSI data remain intact.

Problem and expected behavior

With a colour-capable TERM, rea execute-rizin-command /usr/lib/x86_64-linux-gnu/libcurl.so.4 'pD 96 @ 0x74710;p8 96 @ 0x74710' --json previously included automatic colour controls. The native profile now passes -e scr.color=0 before -c; a caller's e scr.color=1 still takes effect. Captured text remains native output.

Change and scope

Four files: the shared provider profile, a consolidated composition regression, removal of its misplaced duplicate from persistent-debugger coverage, and owning documentation. Existing CLI/MCP services, supervision, artifact digests, plugins and complete Evidence access remain in use. Arbitrary command results are not cached because external inputs and effects are not fully identified. Persistent debugger startup is outside this one-shot change.

Contract and boundary impact

  • Semantic owner: native Rizin startup settings, before collection and serialization.
  • Contribution scope: routine presentation fix within the existing provider; a new execution/injection/mutation scope decision is not applicable.
  • CLI/MCP: existing names and schemas; exact caller command preserved, actual argv recorded in Evidence. Discovery catalog is byte-identical across all eight task trials.
  • Evidence: original raw and normalized stdout/stderr, caller colour overrides, literal ANSI bytes, source identity and coverage preserved.
  • Compatibility: real Rizin 0.9.1 on Linux x86-64 ELF verified; other versions/platforms unverified. Native colour level 2 also affects symbolic brackets/padding, so textual equality after stripping ANSI is not claimed; instruction addresses and raw byte facts agree.
  • Package/install: no dependency, installer, release metadata or generated source changes.

Expected effects: existing artifact reads and analysis-engine launch. No added target execution, injection, mutation, network or recovery authority; the existing unrestricted command/plugin limitations remain.

Evidence and regression coverage

Final focused and static checks ran on b4542d39c, based on main aacf740a0. Native/CLI/MCP, documentation and benchmark receipts remain pinned to a391544d5; runtime and document contents are byte-identical in the final head.

  • Final npm run check (types, lint, formatting, knip, metadata and architecture guards) passed. Runtime build and npm run docs:check passed on the identical runtime/document sources; docs also ran 5 README tests.
  • 134 focused tests across 12 files passed, including cancellation, partial Evidence, environment selection, CLI/MCP and explicit-colour nonzero output preservation. The one-shot policy oracle now lives in the shared composition regression, which covers caller-relative paths containing spaces, source digest and owner-qualified lookup/argv provenance; all 15 persistent-debugger lifecycle cases remain covered.
  • Official Rizin 0.9.1 actual CLI/MCP/native checks passed for 7 cases, including 4 CLI parity checks and complete retained Evidence. Selected disassembly-plus-byte reads agree with independent ELF64 PT_LOAD file mapping; JSON metadata, explicit colour and literal ANSI/NUL data were checked. Targets were never executed.

Measured costs

Two alternating before/after pairs per artifact, fresh SDK/server sessions and warm OS caches, one CPU, 2 GiB process-family cap; TERM=xterm-256color in the native oracle, CLI and MCP. Baseline aacf740a0, candidate a391544d5; same official engine and artifacts. Selected zlib stdout changes 380 -> 170 bytes; libcurl 3,876 -> 1,468 bytes.

Task Raw SDK reply token estimate before -> after Recorded task payload estimate, including discovery
zlib selected 8 bytes 2,580 -> 1,628 810,139 -> 809,187
libcurl selected 96 bytes 15,104 -> 3,686 822,663 -> 811,245

Offline tiktoken 0.12.0 / cl100k estimates over raw SDK payloads, including text/structured duplication. The unchanged catalog alone is 807,510 estimated tokens; client filtering/rendering, initialization/framing and actual model usage are unmeasured. No complex-investigation effectiveness claim.

Task Elapsed seconds before -> after CPU seconds before -> after Family peak MiB before -> after
zlib 18.419-18.884 -> 18.357-19.599 17.855-18.218 -> 17.950-18.995 578.5-579.8 -> 578.3-581.7
libcurl 18.500-18.808 -> 18.361-19.108 17.862-18.275 -> 17.577-18.483 587.2-591.8 -> 576.0-581.6

Ranges overlap; no consistent end-to-end speedup or general memory improvement is established. Counters were observed at payload exit with an observer alive, not terminal whole-scope counters. Owned process cleanup was verified, with no OOM kills; maximum across validation scopes was 4.62 GiB under the 8 GiB hard cap.

Reproduction inputs: Debian zlib 1:1.2.13.dfsg-1, libcurl 7.88.1-10+deb12u15. Target SHA-256 values: zlib 7e2a72b4c4b38c61e6962de6e3f4a5e9ae692e732c68deead10a7ce2135a7f68; libcurl 02fbea31e63cd827ee61644851f1d336de6850a7df0f7af30ba74da97c4b99ab. Official Rizin release static x86-64 archive SHA-256: 9102249a9f0b6319c5334a2e5cf8d9cc3f2035e1d3def027c41f6a90f647e8cf.

Author readiness

Human owner: @gensokyo-dev

The owner explicitly authorized ready-for-review submission, delegated execution and merging, including CI bypass, in this session. Technical review and the executed validation above were performed by the assistant. No separate human manual review is attested here; the owner authorized ignoring those procedural declarations.

  • I reviewed the final diff and relevant existing code, understand the change and its edge cases, and take responsibility for the complete PR, including AI-assisted work.
  • I checked the evidence above, confirmed it supports the current change, and recorded meaningful validation gaps.
  • I declare this PR ready for initial maintainer review.

Before merge

  • This PR addresses a concrete problem or an agreed enhancement.
  • Material scope and authority questions are resolved, and any required maintainer scope decision covers the final diff.
  • The PR has one focused outcome and the title follows type(scope): outcome.
  • Related issue is linked, or the reason for not linking one is stated above.
  • Tests cover changed observable behavior and meaningful failure paths.
  • Owning docs, contracts, and generated metadata are updated where needed.
  • User-visible CLI/MCP changes include representative output.
  • I checked the final diff for secrets, unrelated cleanup, and unsupported claims.

🔄 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/5269 **Author:** [@gensokyo-dev](https://github.com/gensokyo-dev) **Created:** 10/19/2026 **Status:** ✅ Merged **Merged:** 10/19/2026 **Merged by:** [@gensokyo-dev](https://github.com/gensokyo-dev) **Base:** `main` ← **Head:** `fix/4488-rizin-plain-output` --- ### 📝 Commits (2) - [`a391544`](https://github.com/morluto/rea/commit/a391544d5b67a1ebc5931ada9550c9e347c1b94a) fix(rizin): default one-shot output to plain presentation - [`b4542d3`](https://github.com/morluto/rea/commit/b4542d39c0f068f29eeeb0f33bbf79edb4b0f05a) test(rizin): consolidate one-shot profile coverage ### 📊 Changes **4 files changed** (+27 additions, -24 deletions) <details> <summary>View changed files</summary> 📝 `docs/reverse-engineering-tools.md` (+1 -1) 📝 `src/rizin/RizinCommand.ts` (+3 -1) 📝 `tests/boundary/providers/RizinDebugSessionCoverage.part1.test.ts` (+0 -14) 📝 `tests/composition/reverseEngineering.test.ts` (+23 -8) </details> ### 📄 Description ## Summary Fixes #4488. Default one-shot Rizin terminal presentation to plain text before capturing CLI/MCP Evidence. Explicit caller colour settings and literal ANSI data remain intact. ## Problem and expected behavior With a colour-capable `TERM`, `rea execute-rizin-command /usr/lib/x86_64-linux-gnu/libcurl.so.4 'pD 96 @ 0x74710;p8 96 @ 0x74710' --json` previously included automatic colour controls. The native profile now passes `-e scr.color=0` before `-c`; a caller's `e scr.color=1` still takes effect. Captured text remains native output. ## Change and scope Four files: the shared provider profile, a consolidated composition regression, removal of its misplaced duplicate from persistent-debugger coverage, and owning documentation. Existing CLI/MCP services, supervision, artifact digests, plugins and complete Evidence access remain in use. Arbitrary command results are not cached because external inputs and effects are not fully identified. Persistent debugger startup is outside this one-shot change. ## Contract and boundary impact - Semantic owner: native Rizin startup settings, before collection and serialization. - Contribution scope: routine presentation fix within the existing provider; a new execution/injection/mutation scope decision is not applicable. - CLI/MCP: existing names and schemas; exact caller command preserved, actual argv recorded in Evidence. Discovery catalog is byte-identical across all eight task trials. - Evidence: original raw and normalized stdout/stderr, caller colour overrides, literal ANSI bytes, source identity and coverage preserved. - Compatibility: real Rizin 0.9.1 on Linux x86-64 ELF verified; other versions/platforms unverified. Native colour level 2 also affects symbolic brackets/padding, so textual equality after stripping ANSI is not claimed; instruction addresses and raw byte facts agree. - Package/install: no dependency, installer, release metadata or generated source changes. Expected effects: existing artifact reads and analysis-engine launch. No added target execution, injection, mutation, network or recovery authority; the existing unrestricted command/plugin limitations remain. ## Evidence and regression coverage Final focused and static checks ran on `b4542d39c`, based on main `aacf740a0`. Native/CLI/MCP, documentation and benchmark receipts remain pinned to `a391544d5`; runtime and document contents are byte-identical in the final head. - Final `npm run check` (types, lint, formatting, knip, metadata and architecture guards) passed. Runtime build and `npm run docs:check` passed on the identical runtime/document sources; docs also ran 5 README tests. - 134 focused tests across 12 files passed, including cancellation, partial Evidence, environment selection, CLI/MCP and explicit-colour nonzero output preservation. The one-shot policy oracle now lives in the shared composition regression, which covers caller-relative paths containing spaces, source digest and owner-qualified lookup/argv provenance; all 15 persistent-debugger lifecycle cases remain covered. - Official Rizin 0.9.1 actual CLI/MCP/native checks passed for 7 cases, including 4 CLI parity checks and complete retained Evidence. Selected disassembly-plus-byte reads agree with independent ELF64 PT_LOAD file mapping; JSON metadata, explicit colour and literal ANSI/NUL data were checked. Targets were never executed. ## Measured costs Two alternating before/after pairs per artifact, fresh SDK/server sessions and warm OS caches, one CPU, 2 GiB process-family cap; `TERM=xterm-256color` in the native oracle, CLI and MCP. Baseline `aacf740a0`, candidate `a391544d5`; same official engine and artifacts. Selected zlib stdout changes 380 -> 170 bytes; libcurl 3,876 -> 1,468 bytes. | Task | Raw SDK reply token estimate before -> after | Recorded task payload estimate, including discovery | | --- | ---: | ---: | | zlib selected 8 bytes | 2,580 -> 1,628 | 810,139 -> 809,187 | | libcurl selected 96 bytes | 15,104 -> 3,686 | 822,663 -> 811,245 | Offline tiktoken 0.12.0 / cl100k estimates over raw SDK payloads, including text/structured duplication. The unchanged catalog alone is 807,510 estimated tokens; client filtering/rendering, initialization/framing and actual model usage are unmeasured. No complex-investigation effectiveness claim. | Task | Elapsed seconds before -> after | CPU seconds before -> after | Family peak MiB before -> after | | --- | ---: | ---: | ---: | | zlib | 18.419-18.884 -> 18.357-19.599 | 17.855-18.218 -> 17.950-18.995 | 578.5-579.8 -> 578.3-581.7 | | libcurl | 18.500-18.808 -> 18.361-19.108 | 17.862-18.275 -> 17.577-18.483 | 587.2-591.8 -> 576.0-581.6 | Ranges overlap; no consistent end-to-end speedup or general memory improvement is established. Counters were observed at payload exit with an observer alive, not terminal whole-scope counters. Owned process cleanup was verified, with no OOM kills; maximum across validation scopes was 4.62 GiB under the 8 GiB hard cap. Reproduction inputs: Debian zlib `1:1.2.13.dfsg-1`, libcurl `7.88.1-10+deb12u15`. Target SHA-256 values: zlib `7e2a72b4c4b38c61e6962de6e3f4a5e9ae692e732c68deead10a7ce2135a7f68`; libcurl `02fbea31e63cd827ee61644851f1d336de6850a7df0f7af30ba74da97c4b99ab`. Official [Rizin release](https://github.com/rizinorg/rizin/releases/tag/v0.9.1) static x86-64 archive SHA-256: `9102249a9f0b6319c5334a2e5cf8d9cc3f2035e1d3def027c41f6a90f647e8cf`. ## Author readiness Human owner: @gensokyo-dev The owner explicitly authorized ready-for-review submission, delegated execution and merging, including CI bypass, in this session. Technical review and the executed validation above were performed by the assistant. No separate human manual review is attested here; the owner authorized ignoring those procedural declarations. - [ ] I reviewed the final diff and relevant existing code, understand the change and its edge cases, and take responsibility for the complete PR, including AI-assisted work. - [ ] I checked the evidence above, confirmed it supports the current change, and recorded meaningful validation gaps. - [x] I declare this PR ready for initial maintainer review. ## Before merge - [x] This PR addresses a concrete problem or an agreed enhancement. - [x] Material scope and authority questions are resolved, and any required maintainer scope decision covers the final diff. - [x] The PR has one focused outcome and the title follows `type(scope): outcome`. - [x] Related issue is linked, or the reason for not linking one is stated above. - [x] Tests cover changed observable behavior and meaningful failure paths. - [x] Owning docs, contracts, and generated metadata are updated where needed. - [x] User-visible CLI/MCP changes include representative output. - [x] I checked the final diff for secrets, unrelated cleanup, and unsupported claims. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-01 21:43:29 +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#6849
No description provided.