[GH-ISSUE #1753] fix(process): aggregate quadratic trace-specification diagnostics #590

Closed
opened 2026-10-15 18:26:27 +00:00 by bsakaguchi · 0 comments
Owner

Originally created by @N0zoM1z0 on GitHub (Oct 11, 2026).
Original GitHub issue: https://github.com/morluto/rea/issues/1753

On current main 21650455a9c90a26e725c3505a3c17054cc4516c, a small invalid partial_order trace specification expands into thousands of near-identical validation diagnostics through the actual public CLI and stdio MCP workflows.

The specification declares 200 distinct optional lifecycle predicates and omits their pair relations. Its 18,428-byte JSON correctly fails validation, but each of the 19,900 undeclared pairs becomes a separate issue:

  • rea compare-process-captures LEFT.json RIGHT.json TRACE.json --json: exit 1, 2,625,117 output bytes, 19,900 structured issues.
  • SDK stdio MCP compare_process_captures: error response with 1,629,885 text bytes. The server still answers a subsequent ping.

Both capture inputs are authenticated Evidence generated from the public EMPTY_PROCESS_CAPTURE_EXAMPLE. These are static fixture captures, not a claim about a live process capture. The runtime was freshly built with pinned Node 24.18.0/npm 11.16.0. The controlled steps stayed below the 2 GiB process-family budget; the larger valid control described below peaked at approximately 679 MB.

The producing representation is validateCompletePairDeclarations in src/domain/process/processTraceSpecification.ts, which emits an issue for every missing pair. The same file also allocates triangular slice() copies in both unordered-group and complete-pair scans, and pairKey allocates/sorts a two-element array for every pair.

A valid control with 1,200 optional predicates in one unordered group succeeds through CLI and SDK MCP. It takes approximately 4.3 seconds for the complete CLI process and 3.3 seconds for the MCP call on the constrained two-CPU lane. Those single measurements establish a reproducible workload, not a general benchmark or speed claim.

Expected: reject exactly the same incomplete specifications, retain the exact missing-pair count and useful representative IDs, and issue one actionable diagnostic for that violated invariant rather than a quadratic list. Preserve all other malformed-input, duplicate, cycle, ordering-conflict and finite-trace semantics. Remove avoidable pair-scan copies and sorting without inventing an input/event cap.

Related original feature: #403/#419. Searches found no existing fix PR for this validation/output amplification. Full runtime replies and resource receipts are preserved privately; no capture target is executed.

Originally created by @N0zoM1z0 on GitHub (Oct 11, 2026). Original GitHub issue: https://github.com/morluto/rea/issues/1753 On current main `21650455a9c90a26e725c3505a3c17054cc4516c`, a small invalid `partial_order` trace specification expands into thousands of near-identical validation diagnostics through the actual public CLI and stdio MCP workflows. The specification declares 200 distinct optional lifecycle predicates and omits their pair relations. Its 18,428-byte JSON correctly fails validation, but each of the 19,900 undeclared pairs becomes a separate issue: - `rea compare-process-captures LEFT.json RIGHT.json TRACE.json --json`: exit 1, 2,625,117 output bytes, 19,900 structured issues. - SDK stdio MCP `compare_process_captures`: error response with 1,629,885 text bytes. The server still answers a subsequent ping. Both capture inputs are authenticated Evidence generated from the public `EMPTY_PROCESS_CAPTURE_EXAMPLE`. These are static fixture captures, not a claim about a live process capture. The runtime was freshly built with pinned Node 24.18.0/npm 11.16.0. The controlled steps stayed below the 2 GiB process-family budget; the larger valid control described below peaked at approximately 679 MB. The producing representation is `validateCompletePairDeclarations` in `src/domain/process/processTraceSpecification.ts`, which emits an issue for every missing pair. The same file also allocates triangular `slice()` copies in both unordered-group and complete-pair scans, and `pairKey` allocates/sorts a two-element array for every pair. A valid control with 1,200 optional predicates in one unordered group succeeds through CLI and SDK MCP. It takes approximately 4.3 seconds for the complete CLI process and 3.3 seconds for the MCP call on the constrained two-CPU lane. Those single measurements establish a reproducible workload, not a general benchmark or speed claim. Expected: reject exactly the same incomplete specifications, retain the exact missing-pair count and useful representative IDs, and issue one actionable diagnostic for that violated invariant rather than a quadratic list. Preserve all other malformed-input, duplicate, cycle, ordering-conflict and finite-trace semantics. Remove avoidable pair-scan copies and sorting without inventing an input/event cap. Related original feature: #403/#419. Searches found no existing fix PR for this validation/output amplification. Full runtime replies and resource receipts are preserved privately; no capture target is executed.
bsakaguchi 2026-10-15 18:26:27 +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#590
No description provided.