You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit d40280d
Browse filesBrowse the repository at this point in the historyBrowse files
fix(replay): withhold empty-tail alternateFrom when no session can stamp the watermark (#1262)
The empty-tail alternate (`alternateFrom > actions.length`) is accepted by
the range check ONLY when it matches a stamped `pendingRecordAndHeal`
watermark, and that watermark can only be stamped on a live session. For a
last-step caution/manual failure with no active session — a one-step `open`
failure, or a session closed mid-replay — the watermark can never be stamped,
so the advertised `--from length+1` is then rejected as out of range,
re-introducing the text/structured mismatch this arc fixed.
- Thread `sessionExists` into `buildReplayDivergenceResume`; gate the
one-past-the-end `alternateFrom` on it (mid-plan alternate stays in-range and
session-independent). Both divergence sites pass `session !== undefined`.
- At the last step this makes `computeReplayResumeAlternateFrom`'s emit
condition exactly `computeRecordAndHealWatermark`'s stamp condition, so
alternateFrom present ⟺ the watermark gets stamped in the same request.
- ADR-0012 decision 4: reword the mechanical resume.from parity statement for
the dual-path hints (from=N + optional alternateFrom=N+1); update the
empty-tail paragraph to cover caution/manual last-step stamping and the
no-session withholding.
- Tests: unit (last-step no-session → no alternateFrom; mid-plan no-session →
still present) + integration (single-step failure, no session → no
alternateFrom on the wire, no --from length+1 in text).
// actions.length`) is authorizable only via the `pendingRecordAndHeal`
378
+
// watermark, which can only be stamped on a LIVE session. With NO session — a
379
+
// one-step `open` failure, or a session closed mid-replay — advertising
380
+
// `--from actions.length + 1` would be rejected as out of range, so it must
381
+
// not be emitted. A MID-PLAN alternate (in range) needs no watermark and stays
382
+
// session-independent. ---
383
+
384
+
test('buildReplayDivergenceResume: LAST-step caution/manual with NO session carries NO alternateFrom (empty-tail needs a watermark, which needs a session)',()=>{
0 commit comments