[PR #419] [MERGED] feat(process): compare declared concurrent traces #1968

Closed
opened 2026-10-16 21:12:56 +00:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/morluto/rea/pull/419
Author: @morluto
Created: 7/22/2026
Status: ✅ Merged
Merged: 7/22/2026
Merged by: @morluto

Base: main ← Head: codex/issue-403


📝 Commits (8)

  • 508c8d0 feat(process): record global capture event order
  • 3601d5f refactor(process): extract capture journal recorder
  • 23a9227 refactor(process): split trace comparison domain logic
  • 96bc23f refactor(process): split trace comparison helpers
  • df2e155 fix(process): preserve replay event causality
  • 18cf649 feat(process): compare declared concurrent traces
  • 56fa012 fix(process): bound trace comparison semantics
  • 14a15d7 fix(process): preserve nonconforming differences

📊 Changes

31 files changed (+2839 additions, -166 deletions)

View changed files

📝 docs/process-capture.md (+44 -0)
📝 docs/product-catalog.json (+2 -2)
📝 docs/verification/managed-conformance-manifest.json (+2 -2)
📝 skills/reverse-engineer-anything/SKILL.md (+1 -1)
📝 src/application/CommandShimReplay.ts (+11 -3)
📝 src/application/LoopbackReplay.ts (+6 -4)
📝 src/application/LoopbackReplayRecorder.ts (+28 -5)
➕ src/application/ProcessCaptureJournal.ts (+89 -0)
📝 src/application/ProcessCaptureLifecycle.ts (+26 -11)
📝 src/application/ProcessCheckpoints.ts (+15 -2)
📝 src/application/ProcessCli.ts (+33 -2)
📝 src/application/ProcessHarness.ts (+27 -64)
📝 src/application/ProcessSampling.ts (+7 -1)
📝 src/application/TerminalRenderer.ts (+8 -2)
📝 src/cliProcessCommands.ts (+5 -1)
📝 src/contracts/toolContracts.ts (+3 -1)
📝 src/domain/changedBehavior.ts (+9 -4)
📝 src/domain/processCapture.ts (+50 -0)
📝 src/domain/processCaptureValidation.ts (+49 -0)
📝 src/domain/processComparison.ts (+111 -44)

...and 11 more files

📄 Description

Closes #403.

Problem

Process Capture compared independent observation arrays as total orders. That rejected valid concurrent schedules, while timestamp sorting or broad normalization could hide real ordering regressions. Captures also lacked a producer-time cross-source order that could support causal claims.

Changes

  • record and validate a complete monotonic event journal across terminal, interaction, lifecycle, process, filesystem, shim, protocol, and replay-transition producers
  • add a bounded versioned trace specification with exact predicates, explicit schedule-field exclusions, cardinalities, happens-before and not-before constraints, unordered groups, prefixes/suffixes, and finite trace variants
  • compare journaled traces without using timestamps as causality; return raw locations, complete satisfied constraints, and minimal deterministic diagnostics
  • preserve exact legacy differences when a trace is incomplete, source coverage is partial, or both captures are nonconforming
  • expose identical optional trace-spec behavior through the CLI and MCP, using comparison Evidence v4 while retaining v3 behavior when no spec is supplied
  • preserve source Evidence locations and accept older journal-free Process Capture v4 records as unknown rather than equivalent
  • update downstream comparison predicate compatibility and generated catalog/skill metadata

The matcher indexes canonical exact predicates by source and payload, so bounded captures do not rescan every declaration per event.

Compatibility

The trace specification is optional. Existing compare_process_captures calls and two-path CLI invocations keep the v3 comparison contract. Journal-free historical v4 captures still parse, but cannot prove trace equivalence.

Verification

  • npm run check
  • npm run docs:check
  • focused trace, adapter, downstream, and process-capture tests
  • npm test: 1307/1308 passed in the full-load run; the single interactive PTY integration failure passed immediately when rerun alone with its existing 20-second timeout

Real Hopper and Ghidra verification was not run because this change is confined to provider-neutral Process Capture comparison and adapters.

Suggested review order

  1. src/domain/processTraceSpecification.ts and src/domain/processTraceEvaluation.ts
  2. src/domain/processComparison.ts and src/domain/processTraceDimensionProjection.ts
  3. capture journal producers and validation
  4. CLI/MCP adapters, tests, and generated documentation

🔄 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/419 **Author:** [@morluto](https://github.com/morluto) **Created:** 7/22/2026 **Status:** ✅ Merged **Merged:** 7/22/2026 **Merged by:** [@morluto](https://github.com/morluto) **Base:** `main` ← **Head:** `codex/issue-403` --- ### 📝 Commits (8) - [`508c8d0`](https://github.com/morluto/rea/commit/508c8d008e09254891cabb8d91d850d592cea7c5) feat(process): record global capture event order - [`3601d5f`](https://github.com/morluto/rea/commit/3601d5fb74b0682b30f175e0f0354d653fbe5714) refactor(process): extract capture journal recorder - [`23a9227`](https://github.com/morluto/rea/commit/23a9227dbda6ee6788dc258fec197fec58fd1533) refactor(process): split trace comparison domain logic - [`96bc23f`](https://github.com/morluto/rea/commit/96bc23f73e2552c6f0dd5f4427f30c261947b943) refactor(process): split trace comparison helpers - [`df2e155`](https://github.com/morluto/rea/commit/df2e1557e785cb91f6c28d6f1baa77e23b9ee434) fix(process): preserve replay event causality - [`18cf649`](https://github.com/morluto/rea/commit/18cf6491a149d8b717459418852d373924a3e32a) feat(process): compare declared concurrent traces - [`56fa012`](https://github.com/morluto/rea/commit/56fa012463dc1f5458944c2cf9357e1c5873b9a5) fix(process): bound trace comparison semantics - [`14a15d7`](https://github.com/morluto/rea/commit/14a15d75b61f6722cad2534adf97bdf61e5ea5a4) fix(process): preserve nonconforming differences ### 📊 Changes **31 files changed** (+2839 additions, -166 deletions) <details> <summary>View changed files</summary> 📝 `docs/process-capture.md` (+44 -0) 📝 `docs/product-catalog.json` (+2 -2) 📝 `docs/verification/managed-conformance-manifest.json` (+2 -2) 📝 `skills/reverse-engineer-anything/SKILL.md` (+1 -1) 📝 `src/application/CommandShimReplay.ts` (+11 -3) 📝 `src/application/LoopbackReplay.ts` (+6 -4) 📝 `src/application/LoopbackReplayRecorder.ts` (+28 -5) ➕ `src/application/ProcessCaptureJournal.ts` (+89 -0) 📝 `src/application/ProcessCaptureLifecycle.ts` (+26 -11) 📝 `src/application/ProcessCheckpoints.ts` (+15 -2) 📝 `src/application/ProcessCli.ts` (+33 -2) 📝 `src/application/ProcessHarness.ts` (+27 -64) 📝 `src/application/ProcessSampling.ts` (+7 -1) 📝 `src/application/TerminalRenderer.ts` (+8 -2) 📝 `src/cliProcessCommands.ts` (+5 -1) 📝 `src/contracts/toolContracts.ts` (+3 -1) 📝 `src/domain/changedBehavior.ts` (+9 -4) 📝 `src/domain/processCapture.ts` (+50 -0) 📝 `src/domain/processCaptureValidation.ts` (+49 -0) 📝 `src/domain/processComparison.ts` (+111 -44) _...and 11 more files_ </details> ### 📄 Description Closes #403. ## Problem Process Capture compared independent observation arrays as total orders. That rejected valid concurrent schedules, while timestamp sorting or broad normalization could hide real ordering regressions. Captures also lacked a producer-time cross-source order that could support causal claims. ## Changes - record and validate a complete monotonic event journal across terminal, interaction, lifecycle, process, filesystem, shim, protocol, and replay-transition producers - add a bounded versioned trace specification with exact predicates, explicit schedule-field exclusions, cardinalities, happens-before and not-before constraints, unordered groups, prefixes/suffixes, and finite trace variants - compare journaled traces without using timestamps as causality; return raw locations, complete satisfied constraints, and minimal deterministic diagnostics - preserve exact legacy differences when a trace is incomplete, source coverage is partial, or both captures are nonconforming - expose identical optional trace-spec behavior through the CLI and MCP, using comparison Evidence v4 while retaining v3 behavior when no spec is supplied - preserve source Evidence locations and accept older journal-free Process Capture v4 records as unknown rather than equivalent - update downstream comparison predicate compatibility and generated catalog/skill metadata The matcher indexes canonical exact predicates by source and payload, so bounded captures do not rescan every declaration per event. ## Compatibility The trace specification is optional. Existing `compare_process_captures` calls and two-path CLI invocations keep the v3 comparison contract. Journal-free historical v4 captures still parse, but cannot prove trace equivalence. ## Verification - `npm run check` - `npm run docs:check` - focused trace, adapter, downstream, and process-capture tests - `npm test`: 1307/1308 passed in the full-load run; the single interactive PTY integration failure passed immediately when rerun alone with its existing 20-second timeout Real Hopper and Ghidra verification was not run because this change is confined to provider-neutral Process Capture comparison and adapters. ## Suggested review order 1. `src/domain/processTraceSpecification.ts` and `src/domain/processTraceEvaluation.ts` 2. `src/domain/processComparison.ts` and `src/domain/processTraceDimensionProjection.ts` 3. capture journal producers and validation 4. CLI/MCP adapters, tests, and generated documentation --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-16 21:12:56 +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#1968
No description provided.