rea/src/domain/process
Kaoru0822 ce748be2f3
fix(process): order interaction differences by their dispatch time (#2739)
* fix(process): order interaction differences by their dispatch time

first_divergence ranks candidate differences by the earliest recorded
time of the differing observations, but eventTime read only `at_ms`.
Interaction events record their time as `dispatched_at_ms`
(and `scheduled_at_ms`), so a changed interaction always ranked as
untimed. An interaction outcome that differed at 6 ms therefore lost to
a process sample that differed at 500 ms.

Give each comparison dimension its recorded time field. Interactions use
the dispatch time, when their outcome was observed; the other
dimensions keep `at_ms`. An earlier process difference still wins.

Fixes #2645

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix(process): require ordered interaction dispatch times in captures

Comparison ranks a changed interaction by its dispatch time, while
firstCollectionDivergence returns the first differing interaction by
sequence. The capture parser checked only that interaction sequences are
contiguous, so an imported capture whose dispatch times decrease could
make that first-by-sequence difference later than another differing
interaction.

Interactions are dispatched in sequence and their times come from the
monotonic capture clock, so require non-decreasing dispatch times at
parsing, as frames, rendered frames, process samples and filesystem
checkpoints already require for their timestamps.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-13 07:02:28 -07:00
..
processCapture.comparison.test.ts fix(process): order interaction differences by their dispatch time (#2739) 2026-10-13 07:02:28 -07:00
processCapture.fixture.ts fix(ci): align FAT fixtures and consolidate duplicated workflow helpers 2026-10-13 16:16:31 +08:00
processCapture.ts feat(process): bound a finalization interval before forced capture timeout 2026-10-11 09:55:43 +08:00
processCapture.validation.test.ts fix(process): order interaction differences by their dispatch time (#2739) 2026-10-13 07:02:28 -07:00
processCaptureCoverage.ts fix(process)!: retain per-file digest open failures 2026-10-10 03:52:35 +08:00
processCaptureExample.ts feat(process): bound a finalization interval before forced capture timeout 2026-10-11 09:55:43 +08:00
processCaptureParsing.ts fix(process)!: require current captures and preserve cleanup failures 2026-10-09 20:12:07 +08:00
processCaptureValidation.ts fix(process): order interaction differences by their dispatch time (#2739) 2026-10-13 07:02:28 -07:00
processComparison.ts fix(process): order interaction differences by their dispatch time (#2739) 2026-10-13 07:02:28 -07:00
processEvidenceProvider.ts refactor(process): separate capture implementation from analyst workflows (#988) 2026-10-08 00:46:21 +08:00
processObservation.ts fix(process): preserve numeric output and original PTY evidence 2026-10-09 17:55:28 +08:00
processScenario.test.ts feat(process): bound a finalization interval before forced capture timeout 2026-10-11 09:55:43 +08:00
processScenario.ts fix(process): preserve nested path identities during normalization (#2468) 2026-10-13 15:54:18 +09:00
processTraceAdapters.test.ts fix(ci): align FAT fixtures and consolidate duplicated workflow helpers 2026-10-13 16:16:31 +08:00
processTraceComparison.fixture.ts perf(mcp): keep Playwright and type-only imports off MCP startup (#1691) 2026-10-10 21:04:05 -07:00
processTraceComparison.test.ts fix(process): accept a trace identifier the comparison result can represent (#2488) 2026-10-13 14:48:26 +08:00
processTraceComparison.ts refactor: remove forwarding exports and redundant aliases 2026-10-09 22:46:09 +08:00
processTraceDimensionProjection.ts refactor: remove forwarding exports and redundant aliases 2026-10-09 22:46:09 +08:00
processTraceEvaluation.ts fix(process): accept a trace identifier the comparison result can represent (#2488) 2026-10-13 14:48:26 +08:00
processTraceSpecification.test.ts fix(process): bound retained trace ordering state 2026-10-13 13:17:44 +08:00
processTraceSpecification.ts fix(process): accept a trace identifier the comparison result can represent (#2488) 2026-10-13 14:48:26 +08:00