docs/plans/2026-04-18-slate-v2-slate-query-first-wave-plan.md
Execute the first tranche-3 slate recovery wave against the highest-leverage
query/location seams:
Editor.before(...)Editor.after(...)Editor.positions(...)This wave is intentionally narrow.
It exists to recover maximum non-breaking legacy-facing contract width without
starting a broad slate rewrite.
Primary truth, in order:
../slate/packages/slate/**.tmp/slate-v2/packages/slate/**.tmp/slate-v2-draft/packages/slate/** only as
secondary implementation evidenceHard rule:
The tranche-3 classification already froze the topology:
editor/**,
interfaces/**, and supporting core filesThe first honest wave is the query/location family because it is where hidden contract narrowing is most likely to leak into every later recovery wave:
before / after / positionsThis wave does not attempt to close:
Editor.nodes(...)Editor.levels(...)Editor.unhangRange(...)Characterization-first.
Use the existing same-path legacy fixture corpus as the first oracle. Add new tests only when a real hole is exposed that the same-path fixtures do not cover clearly enough.
slate fixture harness:
index.spec.tsThe old slice is useful as implementation history, but not as the current claim boundary. This wave is broader because legacy width is the default.
interfaces/editor.tsEditorBeforeOptionsEditorAfterOptionsEditorPositionsOptionsBaseEditor.beforeBaseEditor.afterBaseEditor.positionsLocation kindsunit valuesvoidsnonSelectable traversal behaviorbefore(...) / after(...) Runtime Widthpositions(...) Runtime WidthunitreversevoidsnonSelectable skip handlinginterfaces/editor.ts contract diffbefore.ts and after.tspositions.tsnext / previous / nodes /
levels / unhangRange still need dedicated follow-on wavesBuild-first package verification for the implementation turn:
bun installbunx turbo build --filter=./packages/slatebunx turbo typecheck --filter=./packages/slatebun run lint:fixbun test ./packages/slate/test/index.spec.tsIf the fixture harness needs narrower reruns during iteration, run the exact
fixture files above through the current index.spec.ts tree or targeted Bun
test filters before the full fixture suite rerun.
This wave is done when:
before / after / positions are legacy-first and same-path honest