[PR #3776] [MERGED] fix(cutter): preserve mixed Unicode output within the frame limit #5893

Closed
opened 2026-10-31 01:10:14 +00:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/morluto/rea/pull/3776
Author: @AyoubElleuch
Created: 10/15/2026
Status: ✅ Merged
Merged: 10/17/2026
Merged by: @N0zoM1z0

Base: main ← Head: fix/cutter-mixed-unicode-output


📝 Commits (7)

  • 21ad0bc fix(cutter): preserve mixed Unicode output within the frame limit
  • 61ce038 Merge branch 'main' into fix/cutter-mixed-unicode-output
  • 2cb4afc Merge branch 'main' into fix/cutter-mixed-unicode-output
  • 757e7aa fix(cutter): preserve completion for unencodable output
  • 51c34ab Merge branch 'main' into fix/cutter-mixed-unicode-output
  • 35f5226 Merge branch 'main' into fix/cutter-mixed-unicode-output
  • 31eb36d Merge branch 'main' into fix/cutter-mixed-unicode-output

📊 Changes

2 files changed (+59 additions, -5 deletions)

View changed files

📝 bridge/cutter/rea_bridge.py (+13 -5)
📝 tests/fixtures/cutter_bridge_protocol_test.py (+46 -0)

📄 Description

Fixes #3330.

Problem and change

A completed 5 MiB ASCII Cutter result fits the authenticated 16 MiB frame, but a single non-ASCII suffix made the old preflight charge four bytes for every character and omit it. The producer now counts actual UTF-8 bytes in 65,536-character chunks, rejects an obviously oversized character count early, and retains the final encoded-frame check and HMAC as authoritative. Each temporary conversion is at most 256 KiB.

The follow-up also preserves the existing authenticated omission path for unencodable surrogate output: preflight returns false on UnicodeEncodeError, and the sender reports completed execution with output=null and output_truncated=true. Framing, completion and caller choices keep one owner; consumers need no repair.

Scope and contracts

Only bridge/cutter/rea_bridge.py and its existing Python protocol fixture change. Existing CLI/MCP schemas, command authority, target selection, framing and cleanup contracts remain intact. MCP may still return its explicit smaller result-budget error with a retained Evidence reference; export recovers the complete output. Ordinary correction within an existing provider; no new capability or maintainer scope decision required.

Verification

Current head: 31eb36d3b3ce7558b423b526e5fea41d7a9497dd, incorporating main 5b243993872c2bcc70cb00060ffb79b347321370. Exact merge-tree and stable patch-ID checks confirm the feature patch is unchanged. Complete exact-head CI passes all five built-dependent shards, Source/static checks and required gates.

  • Producer regressions cover ASCII/é/雪/😀, exact decoded equality, HMAC, the wire limit and oversized rejection. Unpaired high/low surrogate cases in the first/last chunks go through the actual sender/socketpair and verify truthful authenticated completion. The regression fails on the preceding PR implementation and passes with the structural fix.
  • Earlier support revision 757e7aa85a passed all 15 Python protocol and 36 production bridge/client boundary cases, production build and complete check:ci. These local suite receipts remain attributed to that revision.
  • Fresh exact-head Linux production build and real official free Cutter 2.5.0-HEAD-a6f6ad7 / Rizin 0.9.1 workflow pass: 2 CLI / 5 MCP calls plus catalog, exact 5 MiB mixed-Unicode output, explicit MCP resource-constraint response, full retained Evidence recovery and a successful next command. Disconnect preserves the GUI; owned cleanup verifies; source ELF bytes stay unchanged and the target is not executed.
  • Native malformed-surrogate output was not generated; its negative coverage is at the production Python sender. macOS and Windows real-provider behavior remain unverified. No directly related cleanup remains.

Completed native task: 10.18 s wall / 11.64 s reaped CPU / 1.22 GiB sampled process-family RSS, two-core affinity, serial local jobs and a 3 GiB Node heap. Sampling may double-count shared pages or miss short processes and excludes assistant/shared services. Host/OS caches are uncontrolled; model tokens and controlled cold/warm costs are unmeasured. No speedup is inferred.

CI and review observations

Current-head CI retained two distinct failed attempts: an existing 60 s CLI dispatcher test timeout, then the 384 MiB cli-boundary worker OOM in cliIntegerArguments.test.ts. The latter is separately tracked as #4713 with cross-PR hosted evidence and explicit missing clean-main reproduction/heap diagnosis. Unchanged attempt 4 passed the affected shard and all required gates, with the same 384 MiB bound, deadlines and assertions. The feature patch changes neither CLI test nor runner configuration.

Current-head Greptile review reports 5/5, with no unresolved findings. Maintainer review is explicitly AI-assisted. Codex reports repository review-credit exhaustion; no new Codex review is claimed. Existing initial human-owner readiness remains valid and unchanged below.

Author readiness

Human owner: @AyoubElleuch

  • 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.
  • The PR has one focused outcome and the title follows type(scope): outcome.
  • Related issue is linked.
  • Required real-provider/platform verification and current CI are complete.
  • Human review and readiness declaration are complete.

🔄 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/3776 **Author:** [@AyoubElleuch](https://github.com/AyoubElleuch) **Created:** 10/15/2026 **Status:** ✅ Merged **Merged:** 10/17/2026 **Merged by:** [@N0zoM1z0](https://github.com/N0zoM1z0) **Base:** `main` ← **Head:** `fix/cutter-mixed-unicode-output` --- ### 📝 Commits (7) - [`21ad0bc`](https://github.com/morluto/rea/commit/21ad0bc2f15bf869e4093ab888c8c9f655f62af9) fix(cutter): preserve mixed Unicode output within the frame limit - [`61ce038`](https://github.com/morluto/rea/commit/61ce038d5b0c3a95bd460b933f9ed8e5bcc6368e) Merge branch 'main' into fix/cutter-mixed-unicode-output - [`2cb4afc`](https://github.com/morluto/rea/commit/2cb4afc358f709f1022029b81125aa7ed4c6bb68) Merge branch 'main' into fix/cutter-mixed-unicode-output - [`757e7aa`](https://github.com/morluto/rea/commit/757e7aa85a3bf6317b255b1d5560575c5c201831) fix(cutter): preserve completion for unencodable output - [`51c34ab`](https://github.com/morluto/rea/commit/51c34ab4d7591144e7c5c2d083096ff4bc1e0062) Merge branch 'main' into fix/cutter-mixed-unicode-output - [`35f5226`](https://github.com/morluto/rea/commit/35f52269e951ebf9e9abcc6e29097008db1eb018) Merge branch 'main' into fix/cutter-mixed-unicode-output - [`31eb36d`](https://github.com/morluto/rea/commit/31eb36d3b3ce7558b423b526e5fea41d7a9497dd) Merge branch 'main' into fix/cutter-mixed-unicode-output ### 📊 Changes **2 files changed** (+59 additions, -5 deletions) <details> <summary>View changed files</summary> 📝 `bridge/cutter/rea_bridge.py` (+13 -5) 📝 `tests/fixtures/cutter_bridge_protocol_test.py` (+46 -0) </details> ### 📄 Description Fixes #3330. ## Problem and change A completed 5 MiB ASCII Cutter result fits the authenticated 16 MiB frame, but a single non-ASCII suffix made the old preflight charge four bytes for every character and omit it. The producer now counts actual UTF-8 bytes in 65,536-character chunks, rejects an obviously oversized character count early, and retains the final encoded-frame check and HMAC as authoritative. Each temporary conversion is at most 256 KiB. The follow-up also preserves the existing authenticated omission path for unencodable surrogate output: preflight returns false on UnicodeEncodeError, and the sender reports completed execution with output=null and output_truncated=true. Framing, completion and caller choices keep one owner; consumers need no repair. ## Scope and contracts Only `bridge/cutter/rea_bridge.py` and its existing Python protocol fixture change. Existing CLI/MCP schemas, command authority, target selection, framing and cleanup contracts remain intact. MCP may still return its explicit smaller result-budget error with a retained Evidence reference; export recovers the complete output. Ordinary correction within an existing provider; no new capability or maintainer scope decision required. ## Verification Current head: `31eb36d3b3ce7558b423b526e5fea41d7a9497dd`, incorporating main `5b243993872c2bcc70cb00060ffb79b347321370`. Exact merge-tree and stable patch-ID checks confirm the feature patch is unchanged. [Complete exact-head CI](https://github.com/morluto/rea/actions/runs/39011339111) passes all five built-dependent shards, Source/static checks and required gates. - Producer regressions cover ASCII/é/雪/😀, exact decoded equality, HMAC, the wire limit and oversized rejection. Unpaired high/low surrogate cases in the first/last chunks go through the actual sender/socketpair and verify truthful authenticated completion. The regression fails on the preceding PR implementation and passes with the structural fix. - Earlier support revision `757e7aa85a` passed all 15 Python protocol and 36 production bridge/client boundary cases, production build and complete check:ci. These local suite receipts remain attributed to that revision. - Fresh **exact-head** Linux production build and real official free **Cutter 2.5.0-HEAD-a6f6ad7 / Rizin 0.9.1** workflow pass: 2 CLI / 5 MCP calls plus catalog, exact 5 MiB mixed-Unicode output, explicit MCP resource-constraint response, full retained Evidence recovery and a successful next command. Disconnect preserves the GUI; owned cleanup verifies; source ELF bytes stay unchanged and the target is not executed. - Native malformed-surrogate output was not generated; its negative coverage is at the production Python sender. macOS and Windows real-provider behavior remain unverified. No directly related cleanup remains. Completed native task: **10.18 s wall / 11.64 s reaped CPU / 1.22 GiB sampled process-family RSS**, two-core affinity, serial local jobs and a 3 GiB Node heap. Sampling may double-count shared pages or miss short processes and excludes assistant/shared services. Host/OS caches are uncontrolled; model tokens and controlled cold/warm costs are unmeasured. No speedup is inferred. ## CI and review observations [Current-head CI](https://github.com/morluto/rea/actions/runs/39011339111) retained two distinct failed attempts: an existing 60 s CLI dispatcher test timeout, then the 384 MiB cli-boundary worker OOM in cliIntegerArguments.test.ts. The latter is separately tracked as #4713 with cross-PR hosted evidence and explicit missing clean-main reproduction/heap diagnosis. Unchanged attempt 4 passed the affected shard and all required gates, with the same 384 MiB bound, deadlines and assertions. The feature patch changes neither CLI test nor runner configuration. Current-head Greptile review reports 5/5, with no unresolved findings. Maintainer review is explicitly AI-assisted. Codex reports repository review-credit exhaustion; no new Codex review is claimed. Existing initial human-owner readiness remains valid and unchanged below. ## Author readiness Human owner: @AyoubElleuch - [x] 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. - [x] 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] The PR has one focused outcome and the title follows `type(scope): outcome`. - [x] Related issue is linked. - [x] Required real-provider/platform verification and current CI are complete. - [x] Human review and readiness declaration are complete. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-31 01:10:14 +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#5893
No description provided.