summaryrefslogtreecommitdiffhomepage
path: root/src/core/protocol/reducer.ts
diff options
context:
space:
mode:
authorAdam Malczewski <[email protected]>2026-06-22 12:24:43 +0900
committerAdam Malczewski <[email protected]>2026-06-22 12:24:43 +0900
commit9fd9deb8c8c8b8deb5a8094d27b9b49011a15572 (patch)
treee7181279685c40b80be0b117f4ef0185e679d6e9 /src/core/protocol/reducer.ts
parent32cf1b6c4902e89247ff6a6b76100c41e0196d57 (diff)
downloaddispatch-web-9fd9deb8c8c8b8deb5a8094d27b9b49011a15572.tar.gz
dispatch-web-9fd9deb8c8c8b8deb5a8094d27b9b49011a15572.zip
fix(metrics): tail-align when stepId matching fails — prevent misaligned turns
When stepIds are absent on persisted chunks (or don't match), the sequential fallback was HEAD-aligning — matching the OLDEST entries (trimmed turns) to the NEWEST segments. This showed 'turn 1' on turn 20's content and placed the wrong metrics on the wrong segments. Fix: when stepId matching produces ZERO matches, use TAIL-ALIGNMENT instead — match the LAST T entries to the T segments (the loaded chunks are always the newest). The oldest entries (trimmed turns) are unmatched and emit standalone turn-metrics rows at the top. 686 tests green.
Diffstat (limited to 'src/core/protocol/reducer.ts')
0 files changed, 0 insertions, 0 deletions