Back to Plate

rename DOM coverage copy policy

docs/plans/2026-05-31-rename-dom-coverage-copy-policy.md

53.0.815.7 KB
Original Source

rename DOM coverage copy policy

Objective: Rename Slate v2 DOM coverage copy policy values from include-model and summary-only to model and summary across public API, examples, docs, tests, and changesets.

Goal plan: docs/plans/2026-05-31-rename-dom-coverage-copy-policy.md

Template: docs/plans/templates/task.md

Primary template: docs/plans/templates/task.md

Applied packs:

  • docs
  • package-api
  • browser

Task source:

  • type: user request
  • title: rename copy policy values
  • acceptance criteria: no current source/test/docs references to old copy policy values; focused package and browser checks pass; changesets document the public API rename.

Completion threshold:

  • DOMCoverageCopyPolicy exposes model, summary, exclude, and materialize.
  • Defaults and examples use model.
  • Docs explain all four copy policies as current-state API.
  • Focused package tests, hidden-content browser rows, and bun check pass in /Users/zbeyens/git/plate-2/.tmp/slate-v2.

Verification surface:

  • bun test ./packages/slate-dom/test/dom-coverage.ts ./packages/slate-dom/test/clipboard-boundary.ts
  • cd packages/slate-react && bun test:vitest -- keyboard-input-strategy-contract selection-reconciler-contract dom-coverage-native-bridge-contract dom-strategy-and-scroll dom-coverage-boundary-contract
  • PLAYWRIGHT_BASE_URL=http://localhost:3100 PLAYWRIGHT_RETRIES=0 bunx playwright test playwright/integration/examples/hidden-content-blocks.test.ts playwright/integration/examples/query-controls.test.ts --project=chromium --grep "hidden content|query controls"
  • bun check
  • rg -n "include-model|summary-only" --glob '!site/out/**' --glob '!node_modules/**' .

Constraints:

  • Keep the rename hard-cut: no compatibility aliases.
  • Do not create PRs, commits, or pushes.
  • Do not broaden into unrelated DOM coverage behavior.

Boundaries:

  • Source of truth: .tmp/slate-v2 Slate v2 package and example sources.
  • Allowed edit scope: DOM coverage copy policy source, tests, examples, docs, and changesets.
  • Browser surface: /examples/hidden-content-blocks.
  • Tracker sync: N/A, no tracker item.
  • Non-goals: hidden-content selection, find, and virtualization behavior.

Blocked condition:

  • Block only if the focused tests or bun check expose a real failure outside this rename that cannot be isolated without user direction.

Task state:

  • task_type: public API rename
  • task_complexity: normal
  • current_phase: closeout
  • current_phase_status: complete
  • next_phase: final response
  • goal_status: complete-ready

Current verdict:

  • verdict: complete
  • confidence: high
  • next owner: user
  • reason: source, docs, changesets, focused tests, browser rows, and bun check all agree on the new names.

Completion rule:

  • Complete the goal only after this file passes the autogoal completion check.

Start Gates:

GateAppliesEvidence
Skill analysis before editsyesautogoal, task, and changeset loaded.
Active goal checked or createdyesActive goal created for this rename.
Source of truth read before editsyesrg located copy policy API, runtime, examples, docs, and tests.
Tracker comments and attachments readnoN/A: user chat request only.
Video transcript evidence requirednoN/A: no video evidence for this rename.
docs/solutions checked for non-trivial existing-code worknoN/A: narrow API rename, local source search was sufficient.
TDD decision before behavior change or bug fixyesRename is API contract work; existing focused tests cover behavior.
Branch decision for code-changing taskyesN/A: no branch work requested.
Release artifact decisionyesChangesets updated for slate-dom and slate-react.
Browser tool decision for browser surfaceyesAutomated Playwright proof covers the route/control behavior.
PR expectation decisionyesN/A: no PR requested.
Tracker sync expectation decisionyesN/A: no tracker.
Docs pack selectedyesDocs pack applied; docs/libraries/slate-react/editable.md updated.
docs-creator loadednoN/A: small API reference table, not docs-dominant work.
Docs lane selectedyesSupporting docs lane.
Target docs and nearest sibling docs readyesdocs/libraries/slate-react/editable.md DOM Coverage Boundaries section read.
Docs style doctrine readyesRepo instruction: docs describe latest state only.
Documented source owner identifiedyesSource owner is DOM coverage boundary/copy runtime.
Package/API pack selectedyesPublic string literal union changed.
Public surface or package boundary identifiedyesDOMCoverageCopyPolicy and copyPolicy props.
Release artifact path selectedyes.changeset files updated.
changeset skill loaded when .changeset is requiredyeschangeset skill read.
Barrel/export impact decision recordedyesN/A: no exports or file layout changed.
Browser pack selectedyesHidden-content example controls touched.
Browser route / app surface identifiedyes/examples/hidden-content-blocks.
Browser tool decision recordedyesPlaywright route proof used for deterministic coverage.
Console/network caveat policy recordedyesN/A: no manual browser console/network audit for string literal rename.

Work Checklist:

  • Objective includes outcome, completion threshold, verification surface, constraints, boundaries, and blocked condition.
  • Task source classified with source type, title, task type, acceptance criteria, caveats, likely files/routes/packages, browser surface, and root-cause layer.
  • Required video or screen-recording evidence is cached/read as normalized XML, or marked N/A with reason.
  • Nearby repo instructions and implementation patterns read before edits.
  • Implementation fixes the right ownership boundary, or the narrower choice is recorded with reason.
  • Release artifact requirement recorded: changesets updated.
  • Final handoff shape decided: concise source/test summary.
  • Branch handling recorded: N/A, no branch requested.
  • Local-env-rot retry policy recorded: N/A, no env-rot failure shape.
  • Workspace authority recorded: verification commands ran in .tmp/slate-v2 or its owning package.
  • High-risk note recorded: public API rename is hard-cut; tests and changesets prove callers see only the new names.
  • Review/autoreview target selected or marked N/A: N/A, narrow mechanical rename with green focused and full fast checks.
  • Agent-native review decision recorded: N/A, no agent/tooling behavior changed.
  • Docs pack: docs lane, target docs, nearest sibling docs, and source owner recorded.
  • Docs pack: every named API, option, route, and demo claim is source-backed.
  • Docs pack: docs use current-state reference voice.
  • Docs pack: links, anchors, and previews are N/A for this table-only docs change.
  • Package/API pack: public API, package boundary, export, and release-artifact impact recorded.
  • Package/API pack: release artifact matrix applied via .changeset.
  • Package/API pack: .changeset work loaded changeset.
  • Package/API pack: registry-only work is N/A.
  • Package/API pack: no-artifact decisions are N/A because package users see a public API delta.
  • Package/API pack: compatibility, migration, or hard-cut decision is explicit.
  • Package/API pack: package-owned typecheck/test proof recorded.
  • Package/API pack: generated barrels or release notes are N/A.
  • Browser pack: route, interaction path, and expected visible outcome recorded.
  • Browser pack: browser proof uses Playwright route rows; manual browser proof waived because this is a string-literal/API rename.
  • Browser pack: console and network errors are out of scope for this rename.
  • Browser pack: exact verification caveat is ready for final handoff.

Completion Gates:

GateAppliesRequired actionEvidence
Named verification thresholdyesRun named commandsFocused tests, Playwright rows, stale-string audit, and bun check passed.
Bug reproduced before fixnoN/AThis is an API rename, not a bug repro.
Targeted behavior verificationyesRun focused tests44 slate-dom tests, 94 focused slate-react tests, and 17 Playwright rows passed.
TypeScript or typed config changedyesRun typecheckbun check typecheck phase passed.
Package exports or file layout changednoN/ANo exports or file layout changed.
Package manifests, lockfile, or install graph changednoN/ANo manifest or lockfile changed.
Agent rules or skills changednoN/ANo agent rules or skills changed.
Workspace authority proofyesRun checks in owning checkoutAll commands ran in .tmp/slate-v2 or .tmp/slate-v2/packages/slate-react.
Browser surface changedyesRun route proof or waiverPlaywright hidden-content/query-controls rows passed.
Browser final proofyesRecord exact route proofhttp://localhost:3100/examples/hidden-content-blocks?selection=model&copy=model returned 200; Playwright passed.
CI-controlled template output changednoN/ANo templates changed.
Package behavior or public API changedyesAdd changesetsslate-dom and slate-react changesets updated.
Registry-only component work changednoN/ANo registry-only component work.
Docs or content changedyesVerify docs claimseditable.md copy policy table matches source union.
High-risk mini gateyesRecord failure mode and proofFailure mode: stale literal breaks consumers; stale audit and typecheck passed.
Agent-native review for agent/tooling changesnoN/ANo .agents, .claude, .codex, skill, hook, command, prompt, or tooling change.
Local install corruption suspectednoN/ANo install-corruption failure shape.
Autoreview for non-trivial implementation changesnoN/ANarrow mechanical API rename with green focused and fast full checks.
PR create or updatenoN/ANo PR requested.
PR proof image hostingnoN/ANo PR body.
Tracker sync-backnoN/ANo tracker.
Final handoff contractyesFill final evidenceFinal response will include changed surface and verification.
Final lintyesRun lint or scoped equivalentbun check lint phase passed.
Goal plan completeyesRun autogoal checkFinal check run before goal closure.
Docs source-backed claim audityesSource auditDOMCoverageCopyPolicy source matches docs table.
Docs links / routes / previewsnoN/ANo links, routes, or previews added to docs.
Docs MDX/content parsernoN/AMarkdown-only package docs; bun check covered formatting/type/test gates.
Plugin page specificsnoN/ANot a plugin docs page.
Public API / package boundary proofyesSource audit and checksUnion/default/runtime checks use model and summary.
Release artifact classificationyesRecord classificationPublished package API rename.
Published package changesetyesUpdate one per packageExisting slate-dom and slate-react major changesets updated.
Registry changelognoN/ANot registry-only.
No release artifactnoN/APublic package delta exists.
Package typecheck/build/testyesRun owning checksFocused tests and bun check passed.
Barrel/export generationnoN/ANo exported file layout changed.
Browser interaction proofyesExercise route/control pathPlaywright hidden-content/query-controls rows passed.
Browser console/network checknoN/ANo manual browser proof; automated test route covered behavior.
Browser final proof artifactyesRecord exact caveatRoute 200 plus Playwright pass recorded.

Phase / pass table:

PhaseStatusEvidenceNext
Intake and source readcompleteSkills read; API/docs/test surface found with rg.implementation
ImplementationcompletePolicy literals renamed and docs/changesets updated.verification
VerificationcompleteFocused tests, Playwright rows, stale audit, and bun check passed.closeout
PR / tracker synccompleteN/A: no PR or tracker requested.final response
CloseoutcompletePlan completed and ready for autogoal check.final response

Findings:

  • copyPolicy is a public DOM coverage contract owned by slate-dom and surfaced through slate-react.
  • The clean names are model, summary, exclude, and materialize.

Decisions and tradeoffs:

  • Hard-cut the old names instead of aliasing them.
  • Keep Copy controls in the example because they exercise real clipboard behavior and remain useful coverage.

Implementation notes:

  • Updated package source, React defaults, dom strategy helpers, pagination and hidden-content examples, unit tests, Playwright-facing URL controls, docs, and changesets.

Review fixes:

  • Fixed one formatting issue caught by bun check.

Error attempts:

Error / failed attemptCountNext different moveResolution
bun check formatting failure in hidden-content example1Apply formatter-required line wrapFixed and reran bun check successfully.

Verification evidence:

  • bun test ./packages/slate-dom/test/dom-coverage.ts ./packages/slate-dom/test/clipboard-boundary.ts: 44 passed.
  • cd packages/slate-react && bun test:vitest -- keyboard-input-strategy-contract selection-reconciler-contract dom-coverage-native-bridge-contract dom-strategy-and-scroll dom-coverage-boundary-contract: 5 files, 94 tests passed.
  • PLAYWRIGHT_BASE_URL=http://localhost:3100 PLAYWRIGHT_RETRIES=0 bunx playwright test playwright/integration/examples/hidden-content-blocks.test.ts playwright/integration/examples/query-controls.test.ts --project=chromium --grep "hidden content|query controls": 17 passed.
  • curl http://localhost:3100/examples/hidden-content-blocks?selection=model&copy=model: 200.
  • bun check: passed.
  • rg -n "include-model|summary-only" --glob '!site/out/**' --glob '!node_modules/**' .: no matches.

Final handoff contract:

  • PR line: N/A, no PR requested.
  • Issue / tracker line: N/A, no tracker.
  • Confidence line: high.
  • Flow table:
    • Reproduced: N/A, API rename.
    • Verified: focused tests, route proof, stale audit, and bun check.
  • Browser check: Playwright route rows passed against localhost 3100.
  • Outcome: copy policy public names are model, summary, exclude, and materialize.
  • Caveat: no manual in-app Browser pass; automated Playwright proof covered the route/control behavior.
  • Design:
    • Chosen boundary: rename at public DOMCoverageCopyPolicy and React props.
    • Why not quick patch: labels alone would leave stale public API literals.
    • Why not broader change: find and selection policies were already cut.
  • Verified: all named gates passed.

Final handoff / sync:

  • PR: N/A.
  • Issue / tracker: N/A.
  • Browser proof: localhost route 200 plus Playwright pass.
  • Caveats: none beyond no manual browser screenshot.

Timeline:

  • 2026-05-31T06:42:27.664Z Task goal plan created.
  • 2026-05-31T06:44Z Copy policy rename implemented.
  • 2026-05-31T06:46Z Verification gates passed.

Reboot status:

QuestionAnswer
Where am I?Closeout complete.
Where am I going?Final response after autogoal check.
What is the goal?Rename DOM coverage copy policy values to model and summary.
What have I learned?The public copy policy surface is centralized enough for a hard cut.
What have I done?Updated source, examples, docs, tests, changesets, and verification.

Open risks:

  • None.