[PR #1230] [MERGED] fix(mcp): emit portable Unicode NUL patterns #2740

Closed
opened 2026-10-17 21:09:43 +00:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/morluto/rea/pull/1230
Author: @N0zoM1z0
Created: 10/9/2026
Status: ✅ Merged
Merged: 10/9/2026
Merged by: @N0zoM1z0

Base: main ← Head: fix/1212-portable-nul-patterns


📝 Commits (1)

  • 11c44de fix(mcp): emit portable Unicode NUL patterns

📊 Changes

7 files changed (+33 additions, -20 deletions)

View changed files

📝 src/contracts/native/nativeToolContracts.ts (+1 -1)
📝 src/domain/apple/dylibResolution.ts (+1 -1)
📝 src/domain/javascript/electronActiveObservation.ts (+3 -1)
📝 src/domain/localPath.ts (+1 -1)
📝 src/domain/native/nativeCallObservation.ts (+5 -3)
📝 src/domain/process/processScenario.ts (+2 -2)
📝 tests/boundary/mcp/advertisedPatternsVMode.test.ts (+20 -11)

📄 Description

Summary

Strict schema consumers reject the short NUL escape emitted by REA, so enabling its MCP tools can prevent ordinary chat before any tool runs. Emit \u0000 instead, retaining the existing NUL rejection. This completes the NUL portion of the supplied DeepSeek Harness report alongside the character-class fix merged in #1220.

Fixes #1212.

Problem and expected behavior

The reported first rejection is analyze_javascript_application with pattern ^[^\0]*$. V8 accepts this in all modes, so a compilation-only guard misses it. The complete advertised catalog must avoid that short escape while continuing to reject NUL in paths, arguments, symbols and environment entries.

Change and scope

Nine regex literals in six canonical schema files use the equivalent Unicode escape. The existing SDK boundary guard also checks NUL representation and compiles every input/output pattern in default, u and v modes.

Contract and boundary impact

  • Semantic owner and earliest changed stage: canonical domain/contract string schemas.
  • CLI and MCP/tool-catalog contract: accepted inputs and inventory unchanged; serialized NUL pattern text changes.
  • Provider, bridge, target-format, or platform compatibility: no provider changes.
  • Evidence, artifact, provenance, or reconstruction contract: unchanged.
  • Process execution, authorization, cleanup, or containment impact: unchanged.
  • Generated metadata, package, or installation impact: ignored outputs regenerated and checked; no generated files committed.

Evidence and regression coverage

  • Executed fail-before: strengthened catalog guard fails on main f4c99ab8, identifying 41 short-NUL pattern fields.
  • Executed pass-after: actual stdio initialize and tools/list exposes 139 tools and 988 input/output pattern fields; zero short-NUL escapes and zero compilation failures in all three JS modes.
  • Differential check: 9,288 classifications over the common changed grammars, including NUL, equals, reserved environment names, Unicode and literal backslashes; zero differences.
  • Representative advertised JSON: {"pattern":"^[^\\u0000]*$"}.
  • Remaining proof gaps: DeepSeek Harness/model endpoint is unavailable here; its actual chat request has not been replayed. Syntax/projection verification is not a claim of endpoint acceptance.

Validation performed

  • npm run build:cached — passed.
  • npm run test:focused -- src/contracts/toolInputReferences.test.ts src/contracts/toolOutputReferences.test.ts src/domain/inputIssueProjection.test.ts src/domain/apple/dylibResolution.test.ts tests/boundary/mcp/advertisedPatternsVMode.test.ts tests/boundary/mcp/nativeCallObservationMcp.test.ts — 110 passed.
  • npm run docs:check — passed.
  • Pre-push npm run check:fast — passed.

Compatibility, safety, and release

  • Breaking changes or migration steps: none.
  • Real Hopper/Ghidra, browser, or OS coverage: not applicable to schema encoding; no new provider claims.
  • Package or release metadata impact: none; no release performed.
  • Security, privacy, process, or containment review: NUL validation remains enforced.

Review checklist

  • Concrete failure, focused Conventional Commit title, linked issue.
  • Fail-before/pass-after regression and actual SDK projection checked.
  • Canonical contracts and generated documents checked.
  • Final diff contains no local artifacts or unrelated changes.

🔄 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/1230 **Author:** [@N0zoM1z0](https://github.com/N0zoM1z0) **Created:** 10/9/2026 **Status:** ✅ Merged **Merged:** 10/9/2026 **Merged by:** [@N0zoM1z0](https://github.com/N0zoM1z0) **Base:** `main` ← **Head:** `fix/1212-portable-nul-patterns` --- ### 📝 Commits (1) - [`11c44de`](https://github.com/morluto/rea/commit/11c44de82727ae6ab79464e416517222d208aa8b) fix(mcp): emit portable Unicode NUL patterns ### 📊 Changes **7 files changed** (+33 additions, -20 deletions) <details> <summary>View changed files</summary> 📝 `src/contracts/native/nativeToolContracts.ts` (+1 -1) 📝 `src/domain/apple/dylibResolution.ts` (+1 -1) 📝 `src/domain/javascript/electronActiveObservation.ts` (+3 -1) 📝 `src/domain/localPath.ts` (+1 -1) 📝 `src/domain/native/nativeCallObservation.ts` (+5 -3) 📝 `src/domain/process/processScenario.ts` (+2 -2) 📝 `tests/boundary/mcp/advertisedPatternsVMode.test.ts` (+20 -11) </details> ### 📄 Description ## Summary Strict schema consumers reject the short NUL escape emitted by REA, so enabling its MCP tools can prevent ordinary chat before any tool runs. Emit `\u0000` instead, retaining the existing NUL rejection. This completes the NUL portion of the supplied DeepSeek Harness report alongside the character-class fix merged in #1220. Fixes #1212. ## Problem and expected behavior The reported first rejection is `analyze_javascript_application` with pattern `^[^\0]*$`. V8 accepts this in all modes, so a compilation-only guard misses it. The complete advertised catalog must avoid that short escape while continuing to reject NUL in paths, arguments, symbols and environment entries. ## Change and scope Nine regex literals in six canonical schema files use the equivalent Unicode escape. The existing SDK boundary guard also checks NUL representation and compiles every input/output pattern in default, `u` and `v` modes. ## Contract and boundary impact - Semantic owner and earliest changed stage: canonical domain/contract string schemas. - CLI and MCP/tool-catalog contract: accepted inputs and inventory unchanged; serialized NUL pattern text changes. - Provider, bridge, target-format, or platform compatibility: no provider changes. - Evidence, artifact, provenance, or reconstruction contract: unchanged. - Process execution, authorization, cleanup, or containment impact: unchanged. - Generated metadata, package, or installation impact: ignored outputs regenerated and checked; no generated files committed. ## Evidence and regression coverage - Executed fail-before: strengthened catalog guard fails on main `f4c99ab8`, identifying 41 short-NUL pattern fields. - Executed pass-after: actual stdio `initialize` and `tools/list` exposes 139 tools and 988 input/output pattern fields; zero short-NUL escapes and zero compilation failures in all three JS modes. - Differential check: 9,288 classifications over the common changed grammars, including NUL, equals, reserved environment names, Unicode and literal backslashes; zero differences. - Representative advertised JSON: `{"pattern":"^[^\\u0000]*$"}`. - Remaining proof gaps: DeepSeek Harness/model endpoint is unavailable here; its actual chat request has not been replayed. Syntax/projection verification is not a claim of endpoint acceptance. ## Validation performed - `npm run build:cached` — passed. - `npm run test:focused -- src/contracts/toolInputReferences.test.ts src/contracts/toolOutputReferences.test.ts src/domain/inputIssueProjection.test.ts src/domain/apple/dylibResolution.test.ts tests/boundary/mcp/advertisedPatternsVMode.test.ts tests/boundary/mcp/nativeCallObservationMcp.test.ts` — 110 passed. - `npm run docs:check` — passed. - Pre-push `npm run check:fast` — passed. ## Compatibility, safety, and release - Breaking changes or migration steps: none. - Real Hopper/Ghidra, browser, or OS coverage: not applicable to schema encoding; no new provider claims. - Package or release metadata impact: none; no release performed. - Security, privacy, process, or containment review: NUL validation remains enforced. ## Review checklist - [x] Concrete failure, focused Conventional Commit title, linked issue. - [x] Fail-before/pass-after regression and actual SDK projection checked. - [x] Canonical contracts and generated documents checked. - [x] Final diff contains no local artifacts or unrelated changes. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-17 21:09:43 +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#2740
No description provided.