Skip to content

fix(mcp): emit portable Unicode NUL patterns - #1230

Merged
N0zoM1z0 merged 1 commit into
mainfrom
fix/1212-portable-nul-patterns
Oct 9, 2026
Merged

N0zoM1z0 merged 1 commit into
mainfrom
fix/1212-portable-nul-patterns

Conversation

@N0zoM1z0

@N0zoM1z0 N0zoM1z0 commented Oct 9, 2026

Copy link
Copy Markdown
Collaborator

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.

Preserve NUL rejection while avoiding the short escape rejected by strict
schema consumers. Guard the entire advertised input/output catalog and all
three JavaScript regexp modes.

Assisted-by: Kogasa (gensokyo-skills:kogasa-surprise-testing)
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 9, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-09T09:09:24.386955Z 11c44de PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@N0zoM1z0 N0zoM1z0 left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed 11c44de. The canonical validators keep their accepted inputs; only NUL representation changes. The catalog regression fails on the base and passes after the fix, and actual stdio tools/list contains 139 tools / 988 patterns with no short NUL escapes or JS compilation failures. Focused tests (110), docs and required CI pass. Actual DeepSeek endpoint replay remains unverified, as stated in the PR.

@N0zoM1z0
N0zoM1z0 merged commit aa5750c into main Oct 9, 2026
23 checks passed
@N0zoM1z0
N0zoM1z0 deleted the fix/1212-portable-nul-patterns branch October 9, 2026 09:18
darsrc pushed a commit to darsrc/rea that referenced this pull request Oct 10, 2026
Preserve NUL rejection while avoiding the short escape rejected by strict
schema consumers. Guard the entire advertised input/output catalog and all
three JavaScript regexp modes.

Assisted-by: Kogasa (gensokyo-skills:kogasa-surprise-testing)
@morluto morluto added bug Something isn't working area: mcp MCP server, transport, and tool registration labels Oct 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: mcp MCP server, transport, and tool registration bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] MCP tool schemas emit regex patterns rejected under strict-mode validation (observe_native_calls blocks the whole request)

2 participants