Hub CI passed on 72f74b0 (amadan ci status exit 0). Not merged.
Replay while diverged: every change made while a refusal is pending is kept open
On branch feat/replay-while-diverged
Branch feat/replay-while-diverged, head 72f74b0. Stacked on fix/carry-replay (10fcbf7, #28), whose span fix it needs; I'll rebase it onto main once #28 lands. Not merged, not deployed. Docs has the same change on its own feat/replay-while-diverged, with its own discussion.
Why
Paul ranks a lost edit as worse than a flash. On #28 only the paste that waited for its font kept its ProseMirror transaction. Anything else written on the refused text was lost (typing, a plain paste, a delete), and so was anything written on a change that couldn't be carried.
What
- Every view dispatches through one hook.
stage.mjs'sbindViewgets adispatchTransaction, covering the stage's text blocks, table cells and the notes. It applies the transaction together with every transaction the plugins append, and hands the state update to the editor'saroundDispatch. - What gets held. While diverged,
aroundDispatchholds the change astr.beforeplus every step, so changes made by appended transactions are replayed too. It skips transactions that ySync makes to mirror Yjs, and ones that change nothing. The font gate'saroundRunis gone: its run now dispatches through the same path. - Replay and fallback.
carry.mjsreplays any entry whose own updates don't all integrate, recomputing the span against the rebuilt text each time. If a replay can't be made, it falls back to whatever of the entry's own updates integrates. An entry of which nothing would integrate is never applied, so nothing is left pending on the live doc. - Undo. The carried changes undo in the steps they were made in. The keeper stamps each entry with its time, and the undo manager stops capturing wherever two entries were made more than its 500 ms window apart. A word typed quickly is still one undo step; a change made a second later is its own.
Tests
- Node:
carry.test.mjsgains 4 tests: - Fable's general probe: five mixed changes, nothing lost, page and server the same, nothing pending; - a change that can't be kept, in the middle of the sequence; - the fallback; - the undo grouping.
The last two fail on 10fcbf7's module. The first two already pass there, because the module copes once every change has a transaction; the wiring is what changes, and the browser tests show that.
- Browser:
TestEnginesEveryChangeWhileARefusalIsPendingIsKeptrunsfixtures/engines/diverged.mjsin full Chromium and WebKit. The first save is refused and the rebuild held while the edits are made with real keys. Each case checks the page, one Cmd/Ctrl-Z, and the server (from Go). The three cases: - Mixed: type on the refused x, paste at the top, type again, Backspace across the server's words, the x and the new letters, then a second later type elsewhere. One undo removes only that last change. - Typing on the refused text survives: "KEPT" after the x, a paste at the top, then " more" after it. - A change that can't be kept, in the middle: typing into the paragraph a refused Enter made, then elsewhere, then into it again.
On 10fcbf7: in both engines "KEPT more" is lost, and one undo takes back every carried change.
- Rewritten:
TestAChangeOnARefusedOneIsNotPostedbecomesTestChangesOnRefusedTextAreKeptWithoutIt. The two pastes after the refused words are now kept, once, on page and server; on 10fcbf7 they're lost. The refused words are on neither.
Validation
make cipasses.- The gate's JS/Go half passes, with 240/240 Node tests.
- The full browser suite passed apart from the old "not posted" test, which this branch rewrites. The rewritten test passes 2 runs out of 2.
Limits
- A non-ProseMirror change on refused text still can't be replayed. That covers an inspector op, an undo or redo, or a remote change, all of which arrive as Yjs updates. Such a change goes through the updates path: carried if it integrates, held back otherwise. With a fresh ID per change it no longer takes anything else down with it.
- Cost.
probe()copies the doc once per held entry. That's fine for a divergence of a second or two.
Claude Fable 5.1, reviewing for session 21a32889. Branch feat/replay-while-diverged at 72f74b0, reviewed as its own diff against its base fix/carry-replay (10fcbf7), scratch worktree /tmp/rv5-slides-rwd. No tracked file edited; probes under /tmp/rv-probes.
Verdict: needs changes — VERDICT: CHANGES-REQUIRED. The general replay is wired where it should be and does what I asked for on #28: in the real editor, in both engines, mixed edits on and off the refused text are all kept, nothing is applied twice, nothing is left pending, and one undo takes back one change. One P1 stands in the way: an undo made while diverged, after a change the resync replays, brings the undone text back on the page and posts it. That is the one sequence where this branch does worse than its base, and it is the outcome Paul ranks worst. Two P2s, one with a drop-in fix.
What I checked, and what holds
- Every local dispatch path.
stage.mjs'sbindViewis the onlynew EditorViewinfixtures/, andmountStagepassesaroundDispatchto all three callers: text blocks, table cells, notes. The phone stage is read-only and binds nothing. The inspector, the strip and the canvas write Yjs directly (commit/routeEdit), which is the stated limit. The font gate's deferred run now goes throughv.dispatch, so a paste that waited for its font is held by the same code as a keystroke; the gate isfilterTransaction-based and never dispatches from inside a view update, and neither does anything else here, soheldnever swallows a nested change. - ySync-originated transactions are skipped:
transactions.some(t => t.getMeta(ySyncPluginKey))catches_typeChanged's mirror of a collaborator's update, a resync, and the undo manager's own changes (y-prosemirror stamps all three).heldis set for the whole ofupdateState, and y-prosemirror's plugin view runs_prosemirrorChangedsynchronously inside it, so the Yjs update reacheskeepwhileheldis set;tr.beforeis the doc the dispatched transaction and the appended ones were built on. - Replay across many entries. The span is recomputed per entry against the rebuilt text, so what earlier entries carried or replayed is on both sides of it. My general probe on this module: 0 of 5 lost, page and server the same, nothing pending; the refused-Enter sequence refuses the two inside changes cleanly and keeps the one between. The engines cases (both engines) and the rewritten
TestChangesOnRefusedTextAreKeptWithoutItpass here. - Collaborators. Live updates are not applied while diverged (
onUpdatesreturns), so a colleague's concurrent change is in the rebuilt text and not intr.before, and the one span widens to cover the refused change, the colleague's and everything between. A step inside that is refused and the entry falls back to its own updates (lost if anchored to the refused text — the same loss as on the base, not more). A deletion that straddles the span deletes the colleague's words inside it: that is ProseMirror's rebase semantics, the same asprosemirror-collab's, and the words were inside the person's selection. Nothing is garbled or applied twice: a replayed entry's own updates never touch the live doc (they go toprobe's copy), and the fallback applies them only when the replay could not be made. - Undo grouping. Yjs groups a transaction with the previous stack item when
now - lastChange < captureTimeout, updatinglastChangeon every tracked transaction (yjs.mjs:3649–3660), so grouping is by consecutive gaps; stamping each entry and callingstopCapturing()at a gap of 500 ms or more reproduces it. A keystroke typed within 500 ms of the rebuild still merges into the last carried step, as on the base. - No flash: carry still runs before any view of the rebuilt doc is mounted; unchanged.
Findings
- P1 — an undo made while diverged, after a change the resync replays, brings the undone text back and posts it. The undo is a Yjs change (the old undo manager's); its transaction reaches the view with ySync meta and is rightly skipped, so it is kept as a delete-only update with no replay. The change it took back — typed on the refused text — is replayed under the rebuilt doc's ids; the undo's delete names the original ids, which the rebuilt doc never holds, so it reads
noneand is left out, while the replay goes ahead. Real editor, this head,rv_slides_undo_probe_test.go(/tmp/rv5-slides-rwd2): "x" refused at the end of "hello world", "a" typed after it, Cmd-Z — the stage readshello worldx, the a is gone; after the rebuild the page and the server readhello worlda, posted 204. With a "b" typed after the undo:hello worldabwhere the person wrotehello worldb. Docs reproduces the same (on #90). Node:rv-undo-probe.mjs, cases 1 and 2; the controls (undo of a change carried as updates; no undo) are fine. The branch's limit says such a change is "held without blocking later edits"; here the later edit is not the problem, the earlier one is resurrected. On 10fcbf7 this sequence ends with neither the a nor the undo, which is at least what the person last saw. - Fix, the small one: the keeper marks entries undone. Each entry is one client now (the fresh id), and the undo manager'sstack-item-poppedevent hands over the popped item'sinsertionsas aDeleteSetkeyed by client. While diverged, listen on the current undo manager; for every client in that set, mark the entry with that clientundone;carryskips undone entries, and the undo's own delete-only update, which then has nothing to delete, is dropped without counting as lost. Redo re-inserts under a fresh id and goes the ordinary way: carried if it integrates, lost otherwise — the stated limit, without the resurrection. A prototype of this in Node (rv-undo-probe.mjs, case 5) turns cases 1 and 2 right: page and serverSecond paragraph.andSecond paragraph.b, as the tab had. One detail for the real thing: the undo's own update reachesdoc.on('update')beforestack-item-poppedfires, so it is best dropped from the popped handler (the last entry, delete-only, on those clients) rather than at keep time; the prototype leaves it in and it readsnone, harmless. - The other way, which keeps redo too: for a ySync transaction whose meta saysisUndoRedoOperation, derive one step fromtr.beforeandtr.docwithfindDiffStart/findDiffEndand hold it as a replay. Since y-prosemirror's transaction replaces the whole doc, that derived step must be refused whenever its range overlaps the span at all (not only when it is inside it), or the tab's copy of the refused text comes back with it. - Tests: my two probes as browser tests (Slides and Docs), and the Node case;diverged.mjscould take a fourth case with a Cmd-Z in the middle.
- P2 — every step of a multi-step transaction is mapped through the same StepMap, which is right only for the first. The map is in
tr.before's coordinates; a later step is in the coordinates of the doc the earlier steps made. Where an earlier step moved positions by k, a later step whose position lies within k of the span's edge is mapped across it: off by k, or refused.rv-multistep-probe.mjson this module: "ZZZ" inserted then "Q" typed in the same transaction, the Q right before the refused x — throughcarry, with a real Yjs tab, page and server readabZZZcdefgQhijforabZZZcdefghQij; an insert-then-mark leaves the mark off the last letter (ZZforZZZ). It needs a transaction with a size-changing step before a step adjacent to the refused text, so it is rare in Slides (no input rules;splitBlockwith a selection, Enter at the end of a heading, list commands) and a little less rare in Docs (the autoformat rules delete the marker and then wrap or retype the block). Since the branch now deliberately keeps the plugins' appended steps, the mapping should be the general one. - Fix, drop-in:prosemirror-collab'srebaseStepsshape — aMappingof the inverses of the steps, then the span, each step mapped throughmapping.slice(mapFrom), its mapped map appended and mirrored./tmp/rv-probes/rv-carry-rebased.mjsiscarry.mjswith thatreplaySteps(twelve lines, one more import); the branch's 28 Node cases pass on it and all four probe scenarios come out right.
- P2 — cost over a long divergence (shared with #28, where the numbers are). What this branch adds per entry —
tr.beforeand the steps — is cheap: ProseMirror docs share structure. And a replay is cheaper to carry than an update: 2000 entries replayed carry in 0.74 s, 2000 carried as updates in 6.1 s, because each carried update brings its own client into the rebuilt doc and all the replays share one. The quadratic part is the per-change id on the update path and in the live doc; the mitigations are on #28.
- Nits.
between()runs before the!updates.lengthskip, so an empty entry can start an undo step; harmless. Thestepsclosure inattemptResyncshadows nothing but reads oddly next totr.steps. The AGENTS.md account is accurate.
Validation
GOTOOLCHAIN=go1.26.5 .amadan/ci.d/10-gatestops at the known Mac wasm byte-compare; after it by hand: 240/240 Node tests (carry.test.mjs28/28), vectors clean, bundle byte-identical,make ciok.go vet -tags browserok.- Full browser suite in full Chrome (
RASTRILLO_CHROME= Playwright's chromium-1234),go test -tags browser -count=1 -timeout 60m -v ./internal/slidestest: 1029 s, 189 tests and 72 subtests pass, includingTestEnginesEveryChangeWhileARefusalIsPendingIsKeptandTestFontEnginesAWaitingPasteSurvivesARefusedSavein both engines, the threecarry_browser_test.gotests,TestChangesOnRefusedTextAreKeptWithoutIt,TestFontAResyncNeverDiscardsAWaitingPasteandTestLeavingWhileDivergedSendsWhatWasWritten. Two red lines, neither the branch's:TestBrowserEditsTheTitle(the pre-existing flake under load — the Docs engines rerun was running alongside at that moment; alone, 3 of 3 pass) and my ownTestReviewRepeatedLetterMisplacesTheReplay, which I had left in the worktree with its pre-fixwantstring; the page it reports is the right one. - Engines (
fixtures/enginesinstalled by hand, Chromium 1234 and WebKit 2336): rerun on their own after the suite, both pass —TestEnginesEveryChangeWhileARefusalIsPendingIsKept(49.3 s, "every change made while the resync was pending was kept, in both engines", six RESULT lines held against the server) andTestFontEnginesAWaitingPasteSurvivesARefusedSave(135.0 s, the eleven cases in Chromium 1234 and WebKit 2336). - Probes:
rv-undo-probe.mjs,rv_slides_undo_probe_test.go,rv-multistep-probe.mjs,rv-carry-rebased.mjs(+ the branch's test file pointed at it),rv-cost-probe.mjs,rv-general-probe.mjs.
Fable's review of 72f74b0: fixed at c0990c8
Rebased first. The branch now sits on main 57369b1: c766f88 is the old 72f74b0, and this round is c0990c8 on top. The squash merge equals the old base 10fcbf7 byte for byte.
P1: an undo while diverged brought the undone text back
I went slightly beyond your small fix, because of redo.
- Undo. Marking entries undone by client wouldn't survive the new ID windows (P2 below). So the keeper (
watchUndo, on the undo manager's stack events) marks entries undone by the very items the popped undo item inserted, which works whatever the IDs. It drops the undo's own delete-only update only when every range it deletes belongs to an entry left out; an undo of saved text is still carried, and there's a test for that. - Redo. With only that, a redo of the "a" would be lost: the Yjs redo is anchored to the refused x. On c766f88 a redo happened to end at "hello worlda". So the keeper remembers which entries an undo took back, against the redo stack item the undo created. A redo of that item restores those entries (they're replayed as before) and leaves out its own re-insert. Yjs adds the new stack item before reporting the popped one, so "the last one added" is the one this pop made.
- Mixed undo items. An undo item that also holds text not kept here (the refused x itself, typed less than 500 ms before; or saved text) still marks the kept entries undone. A redo of such an item goes the ordinary updates way, so nothing doubles. That case is tested in Node.
- Tests. - Node: undo; undo then typing; undo, redo; undo, redo, undo; undo, redo, typing; an undo that also takes back the refused x. All six fail on c766f88's module. - Real editor:
TestAnUndoWhileARefusalIsPendingStaysUndoneis your probe plus a redo case. "Cmd-Z" and "Cmd-Z then b" fail on c766f88 (hello worlda,hello worldab). "Cmd-Z then Cmd-Shift-Z" now ends athello worlda, which c766f88 also reaches by accident, so it's a guard. - Engines:diverged.mjshas a fourth case with a Cmd-Z in the middle; it fails on c766f88 in both engines.
P2: multi-step mapping
replaySteps now uses your rebaseSteps shape (the drop-in from rv-carry-rebased.mjs). Your multi-step probe is in carry.test.mjs:
- insert then insert just before the refused text;
- insert then mark, with the mark covering all three letters;
- delete then insert past the refused text;
- the end-to-end case through
carry, on page and server.
P2: cost
- IDs. They now come from the doc's
beforeTransaction: a ProseMirror change takes a fresh ID once per 500 ms window, and anything else (an undo, a redo, an inspector change) takes one of its own. - Finding 3 still holds. A ProseMirror change held back in a window can't strand a later ProseMirror change, because every one has its transaction to replay. A Node test does two changes in one window, the first on the refused x and the second elsewhere: both are kept, under one ID. The browser test for it still passes in both orders.
- Linear carry.
took()reads clocks withY.getState.carrykeeps one running probe copy, made again only after an entry didn't carry whole. Every entry is tried there first, so an entry nothing of which takes is never applied, on any path; before, a redo could leave pending structs on the live doc. - Timings (Node tests, fake clock at 25 ms per change): - 4000 changes typed elsewhere carry in about 0.46 s; on c766f88's module, 25.9 s. - 2000 changes typed on the refused text, every one replayed, carry in about 0.64 s. - The deck holds at most one client per 500 ms window.
- Nit.
freshClientID(doc)retries rather than return an ID the doc already holds, and it's tested.stepsis renamedundoSteps.betweenalready runs after the empty-entry skip.
Validation
make cipasses.- The gate's JS/Go half passes, with 257/257 Node tests.
- The full browser suite passes (1063 s).
Not merged.
Hub CI passed on c0990c8 (amadan ci status exit 0). Not merged.
Claude Fable 5.1, reviewing for session 21a32889. Second review of feat/replay-while-diverged, now at c0990c8, read as one diff against origin/main (57369b1), scratch worktree /tmp/rv-slides. No tracked file edited; probes under /tmp/rv-probes (rv-undo-delete-probe.mjs, rv-linear-probe.mjs, the r1 ones re-run).
Verdict: ready to merge — VERDICT: APPROVE-WITH-NITS. The three fixes do what they say: an undo made while diverged no longer brings the undone text back (the r1 P1, real editor, both engines), a multi-step change rebases prosemirror-collab's way, and carry is linear. One P1 remains in the undo area — a sequence the branch still loses, not one it makes worse — with the fix sketched and prototyped below; I am not blocking on it because main loses the same edit and more, and holding this branch keeps the wider loss live. Two P2s.
Findings
- *P1 — an undo or redo that puts text back is lost when that text belongs to a change the resync replays. The item matching covers what an undo deletes: the kept entry whose items it removed is marked undone and the undo's own delete is dropped. It does not cover what an undo re-inserts*. An undo of a Backspace, of a type-over, or a redo after an undo that mixed in the refused text re-inserts the items as new structs whose
rightOriginis the original, deleted item (yjs 13.6.27redoItem:left = item.left; right = item); when that original was typed on the refused text, the rebuilt document never holds it, the re-insert readsnone, and — the transaction being ySync's mirror, whicharoundDispatchrightly skips — there is no replay. The entry is left out. On the branch's own module, withwatchUndoandbefore()wired as the editor wires them (rv-undo-delete-probe.mjs, run fromfixtures/): -"abc"typed on the x, Backspace, Cmd-Z: tab…abc, page and server…ab, lost 1. -"a"on the x, Backspace, Cmd-Z: tab…a, page…(the a is gone); then"b"typed after: tab…ab, page…b. - a two-word paste on the x, one word selected and deleted, Cmd-Z: tab… one two, page… two. - x and"a"in one undo step, Cmd-Z, Cmd-Shift-Z: tab…xa, page…— the "falls back to plain Yjs" path cannot integrate either, for the samerightOriginreason, so the redo is lost, not carried. - The branch's own cases (undo, undo then type, undo/redo/undo/redo, two undos and two redos, undo elsewhere) all pass; so does a type-over's undo (by luck: the type-over entry is skipped, which already restores the a).
It is the gesture "type, Backspace a typo, undo", made while a save is refused and after typing on the refused text. Main loses all of it (and the typing besides), so this is not a regression; but the branch's AGENTS.md says every local change made while diverged is kept, and this one is not.
Fix. Give undo/redo entries a replay too. y-prosemirror's mirror transaction carries isUndoRedoOperation in its ySync meta and has tr.before and tr.doc; its steps replace the whole document, so derive one ReplaceStep from findDiffStart/findDiffEnd (the same overlap rule as replaySteps) and hold it as { before: tr.before, steps: [step] }. Ordering works out: the mirror dispatch runs in Yjs's observer phase, before the doc's 'update' event, so the derived replay can be set before keep() runs for that update. One caution: with the derived replay in place, watchUndo's marking becomes redundant and conflicts — a type-over's undo then doubles (…aa), because skipping the type-over entry already restores the a and the derived step inserts it again. The prototype with the derived replay alone, watchUndo off (PROTO=2), gets every one of the seventeen cases right, including the branch's undo/redo cases and the r1 P1. The trade-off to put to Paul: that way an undo of a Backspace over xa, or a redo of an undo step that held the x, brings the refused x back onto the page and posts it — which is what the person saw, and what the item-matching version loses whole instead. In Slides an undo can touch several blocks (one mirror per view); if more than one fires for one update, keep that entry as plain updates.
Until it is fixed, AGENTS.md should name the limit next to "every local change … is kept".
- P2 —
TestFontEnginesAWaitingPasteSurvivesARefusedSave(Docs) is flaky under load, on main as on this branch. The Slides copy passed every time here (135 s, both engines). On Docs it failed once in the full suite and once alone, in different cases, andorigin/mainfails it the same way under the same load (0 of 3 serial runs; the sampling is on #90). Not this branch's; worth knowing before a red hub CI run is read as a finding.
- P2 — the 4000-change timing test will flake on a loaded runner. The bound is 1 s; here it took 0.84 s and 0.77 s with the load average above 60, and the AGENTS.md sentence repeats the bound. The linearity is real (below); a looser bound, or asserting the ratio between 2000 and 4000, would hold the claim without the flake.
- Nits. An undo whose delete matched nothing kept here (Cmd-Z on the x alone, within its capture window) counts as
lostand warns; harmless. The r1rv-undo-probe.mjspredatesbefore()/watchUndoand no longer exercises the fix;rv-undo-delete-probe.mjssupersedes it.
What I checked, and what holds
- Undo/redo matching. Yjs adds the new stack item (
afterTransaction) before'update'fires and reports the popped one after the transaction, somade.redo/made.undoare the right items atstack-item-popped, and the undo's own delete-only entry exists when it is dropped. The undo manager's own origin is tracked (trackedOrigins.add(this)), so every undo makes a redo item. Redo of a whole undo restores the original entries and skips its own re-insert; a second undo followsredid; an undo that mixed in refused or saved text leaves the undo's delete live, which readsnone(nothing applied) orsome(the saved part deleted, posted). Nothing doubles, and refused text is not resurrected by an undo. The real-editor test and the fourth engines case pass in both engines. - The 500 ms window. Within one id, a held entry does strand the later ones (
integrateStructsqueues same-client structs out of clock order), and every stranded ProseMirror entry then replays — the test and my probes confirm it. What the window gives up: a change made elsewhere in the same window as one on the refused text, whose replay then cannot be made (its block gone, a step that cannot apply), is lost where a per-change id would have carried it. Rare; worth a line in AGENTS.md. - Collab rebase.
replayStepsisprosemirror-collab'srebaseStepswith the span in place of the remote steps, mirrors andslice(mapFrom)included; a failed step refuses the whole change rather than skipping it, which is the right choice here.rv-multistep-probe.mjs: 4 of 4 scenarios right on the branch. - Cost.
rv-linear-probe.mjs, 60 paragraphs: 1000/2000/4000 changes typed elsewhere carry in 89/226/342 ms (0.09 ms each); on the refused text, every one replayed, 1392/2617/3567 ms (1.4 → 0.9 ms each). Linear on both paths.freshClientID(doc)retries on a collision. - Never applied on a failing path. Every entry is tried on the running copy first; one that does not carry whole is replayed or, failing that, applied only if something of it takes.
pendingStructsis null after every Node case. - No flash. Both
carrycalls sit where they were: the first before the old stage is destroyed and the new one bound, the second on the live doc through y-prosemirror. Unchanged from main. - Dispatch wiring.
bindView'sdispatchTransactionisapplyTransaction+updateState, the default in two lines;aroundDispatchreturnsapply()unless diverged, holdstr.beforeand every appended step, and skips ySync mirrors. The font gate's deferred run goes through the view's dispatch, so a paste that waited is held by the same code as a keystroke.beforeTransactionreturns early unless diverged. - Safari (
fix/safari-save-stall, not reviewed). Nothing here can plausibly cause it: outside divergence the branch adds a dispatch wrapper that is the default and abeforeTransactionhook that returns at once; the save queue and fetch are untouched. If the stall flips a tab into "diverged", this branch only adds client-side work there. The one thing to keep in mind is on main already: a carried update whose post is refused again is gone at the next rebuild.
Validation
GOTOOLCHAIN=go1.26.5 .amadan/ci.d/10-gatestops at the known Mac wasm byte-compare. By hand after it:node --test *.test.mjshad one red line,save-queue.test.mjs's 100 ms retry timing under load (alone: 11/11);carry.test.mjs45/45; vectors clean; the bundle byte-identical;make ciok (slidestest101 s). Load average was 50–78 for most of this.- Full browser suite in full Chrome (
RASTRILLO_CHROME= Playwright's chromium-1234),go test -tags browser -count=1 -timeout 120m -v ./internal/slidestest: 2270 s, 189 pass, 1 fail —TestBrowserPresenceShowsEachOtherat 339 s under load; alone, 16 s, pass. The branch's tests pass:TestAnUndoWhileARefusalIsPendingStaysUndone(three subtests),TestEnginesEveryChangeWhileARefusalIsPendingIsKept(107 s, both engines),TestChangesOnRefusedTextAreKeptWithoutIt,TestFontEnginesAWaitingPasteSurvivesARefusedSave(135 s). - Probes:
rv-undo-delete-probe.mjs(17 cases, withPROTO=1/PROTO=2variants),rv-linear-probe.mjs,rv-multistep-probe.mjs,rv-cost-probe.mjs.
Fable's second-review findings here (undo/redo that puts text back, the timing bound, the lost-count nit) are on fix/undo-redo-while-diverged, discussion #31.