[PR #1756] [MERGED] fix(process): aggregate incomplete trace-spec diagnostics #4796

Closed
opened 2026-10-31 00:55:09 +00:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

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

Base: main ← Head: fix/trace-spec-diagnostics-1753


📝 Commits (1)

  • 474ced7 fix(process): aggregate incomplete trace-spec diagnostics

📊 Changes

3 files changed (+184 additions, -30 deletions)

View changed files

📝 src/domain/process/processTraceSpecification.test.ts (+75 -0)
📝 src/domain/process/processTraceSpecification.ts (+35 -14)
📝 tests/boundary/mcp/processTraceAdaptersParity.test.ts (+74 -16)

📄 Description

An 18 KB incomplete partial-order trace specification currently creates 19,900 near-identical diagnostics: 2,625,117 CLI output bytes and 1,629,885 MCP text bytes. Summarize this violated invariant once with its exact missing-pair count and first undeclared pair. Keep the existing message for one missing pair, scan all pairs, and preserve the other validation errors.

Remove suffix-array copies from both pair scans and replace per-pair two-element sorting with equivalent lexical key construction. No event/input cap or result truncation is introduced.

Closes #1753.

Validation:

  • Reproduced through freshly built latest main 062723e44e937c1e1df865e9ae16184b41e70ae8, then repeated actual public CLI and SDK stdio MCP workflows after the fix. The same invalid input returns 467 CLI bytes / 185 MCP text bytes, one issue, exact count 19,900, and the server answers a subsequent ping.
  • 12 domain regressions and 6 MCP boundary regressions pass, including transitive/not-before/unordered coverage, singleton compatibility, reversed duplicate declarations, valid Evidence parity and invalid CLI/MCP diagnostics.
  • A valid 1,200-event unordered control returns exactly the same complete authenticated Evidence, identity and CLI/MCP text/structured result as the baseline. Whole Evidence SHA-256: c3edab6bb0da15eb4bcc44f56cfb8739cb56789c6020ffa0267cfa46cafb04c8.
  • Flameox 0.2.9 profiles the actual complete CLI process before and after with the same 1,200-event input; full captured stdout SHA-256 is identical. Pair-key sorting was a resolved baseline hotspot and no longer appears in the leading fixed hotspots. These are single controlled profiles, not a portable throughput percentage or token-count measurement.
  • Full single-threaded typecheck, lint/module boundaries, changed-file format check, architecture guards and diff check pass. All steps stay below the 2 GiB process-family budget; the temporary Flameox environment has been removed and native profiles retained privately.

Capture inputs use authenticated EMPTY_PROCESS_CAPTURE_EXAMPLE fixture Evidence. No live process capture, installed native provider, browser, Notion or Obsidian verification is claimed. Tool input schemas and successful result contracts are unchanged; missing-pair error multiplicity is intentionally reduced.


🔄 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/1756 **Author:** [@N0zoM1z0](https://github.com/N0zoM1z0) **Created:** 10/11/2026 **Status:** ✅ Merged **Merged:** 10/11/2026 **Merged by:** [@N0zoM1z0](https://github.com/N0zoM1z0) **Base:** `main` ← **Head:** `fix/trace-spec-diagnostics-1753` --- ### 📝 Commits (1) - [`474ced7`](https://github.com/morluto/rea/commit/474ced7e946956e1c56363588f58310aede03c61) fix(process): aggregate incomplete trace-spec diagnostics ### 📊 Changes **3 files changed** (+184 additions, -30 deletions) <details> <summary>View changed files</summary> 📝 `src/domain/process/processTraceSpecification.test.ts` (+75 -0) 📝 `src/domain/process/processTraceSpecification.ts` (+35 -14) 📝 `tests/boundary/mcp/processTraceAdaptersParity.test.ts` (+74 -16) </details> ### 📄 Description An 18 KB incomplete partial-order trace specification currently creates 19,900 near-identical diagnostics: 2,625,117 CLI output bytes and 1,629,885 MCP text bytes. Summarize this violated invariant once with its exact missing-pair count and first undeclared pair. Keep the existing message for one missing pair, scan all pairs, and preserve the other validation errors. Remove suffix-array copies from both pair scans and replace per-pair two-element sorting with equivalent lexical key construction. No event/input cap or result truncation is introduced. Closes #1753. Validation: - Reproduced through freshly built latest main `062723e44e937c1e1df865e9ae16184b41e70ae8`, then repeated actual public CLI and SDK stdio MCP workflows after the fix. The same invalid input returns 467 CLI bytes / 185 MCP text bytes, one issue, exact count 19,900, and the server answers a subsequent ping. - 12 domain regressions and 6 MCP boundary regressions pass, including transitive/not-before/unordered coverage, singleton compatibility, reversed duplicate declarations, valid Evidence parity and invalid CLI/MCP diagnostics. - A valid 1,200-event unordered control returns exactly the same complete authenticated Evidence, identity and CLI/MCP text/structured result as the baseline. Whole Evidence SHA-256: `c3edab6bb0da15eb4bcc44f56cfb8739cb56789c6020ffa0267cfa46cafb04c8`. - Flameox 0.2.9 profiles the actual complete CLI process before and after with the same 1,200-event input; full captured stdout SHA-256 is identical. Pair-key sorting was a resolved baseline hotspot and no longer appears in the leading fixed hotspots. These are single controlled profiles, not a portable throughput percentage or token-count measurement. - Full single-threaded typecheck, lint/module boundaries, changed-file format check, architecture guards and diff check pass. All steps stay below the 2 GiB process-family budget; the temporary Flameox environment has been removed and native profiles retained privately. Capture inputs use authenticated `EMPTY_PROCESS_CAPTURE_EXAMPLE` fixture Evidence. No live process capture, installed native provider, browser, Notion or Obsidian verification is claimed. Tool input schemas and successful result contracts are unchanged; missing-pair error multiplicity is intentionally reduced. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-31 00:55:09 +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#4796
No description provided.