docs/solutions/test-failures/2026-04-22-slate-browser-selectionchange-proof-must-separate-traceability-from-programmatic-import.md
A Batch 1 closure row tried to prove two different contracts at once: selectionchange traceability and pure programmatic DOM-selection import. That made the test red for the wrong reason.
selectDOMRange(...) placed the visible DOM caret at This is editable offset 4.getSelectionWithHandle(...) kept returning Slate selection [0, 0]@0.selectionchange events, but they reflected the existing selection rather than the synthetic DOM range.mousedown manually did not reliably model the full user selection authority transition.Split the proof:
await expect
.poll(async () =>
(await harness.get.kernelTrace()).some(
entry => (entry as { eventFamily?: string }).eventFamily === 'selectionchange'
)
)
.toBe(true)
await selectWithHandle(harness.root, {
anchor: { path: [0, 0], offset: 4 },
focus: { path: [0, 0], offset: 4 },
})
Selectionchange traceability and programmatic DOM-selection import are separate contracts. Batch 1 needed traceable kernel results and repair correctness. Programmatic import needs its own explicit API/proof in the next batch because synthetic selectionchange timing is not equivalent to a real user selection.