Skip to content

[3/3] test(painter): lock ResolvedLayout-only boundary (SD-2836)#3118

Open
tupizz wants to merge 3 commits intotadeu/sd-2836-2-collapse-legacy-apifrom
tadeu/sd-2836-3-lock-boundary
Open

[3/3] test(painter): lock ResolvedLayout-only boundary (SD-2836)#3118
tupizz wants to merge 3 commits intotadeu/sd-2836-2-collapse-legacy-apifrom
tadeu/sd-2836-3-lock-boundary

Conversation

@tupizz
Copy link
Copy Markdown
Contributor

@tupizz tupizz commented May 4, 2026

Stack

# PR Branch Status
1 #3116 tadeu/sd-2836-1-consume-resolved-layout open
2 #3117 tadeu/sd-2836-2-collapse-legacy-api open
3 this PR tadeu/sd-2836-3-lock-boundary open

Review in order. PR3 depends on PR1 and PR2; merge those first.

What changed

Locks the boundary established by PR1+PR2 so no future change can re-introduce legacy painter inputs or disallowed cross-package imports.

Architecture guard

  • New tests in tests/architecture-boundaries.test.ts (Guard D) forbid painter-dom from importing pm-adapter, layout-bridge, or layout-resolved at runtime.
  • New type-shape lockdown in painters/dom/src/contract-shape.test.ts pins the painter's public input/option types to ResolvedLayout via Equal<X, Y> + expectTypeOf. Any drift in the contract fails the suite.

Cleanup

  • Drops @superdoc/layout-resolved from painters/dom/package.json runtime dependencies (kept under devDependencies for the boundary tests).
  • Removes unused imports and skipped legacy tests from PR1/PR2 transition.

Why this split

The painter is now structurally dumb (PR1) and surface-collapsed (PR2). This PR makes that state ratchet-only: regressing the boundary breaks the build, not just review.

Verification

  • All package tests pass: painter-dom, pm-adapter, layout-bridge, layout-engine, super-editor.
  • HEAD-vs-origin/main corpus snapshot diff: 0 changed / 407 unchanged (rendering-neutral).

Test plan

  • CI green
  • Reviewer confirms guard tests fail when a forbidden import is added (try locally to verify)
  • No runtime dependency on @superdoc/layout-resolved in painter-dom

@tupizz tupizz requested a review from a team as a code owner May 4, 2026 16:51
@linear
Copy link
Copy Markdown

linear Bot commented May 4, 2026

tupizz added 2 commits May 4, 2026 15:05
renderer.ts: drop unused Layout, Page, Measure, FlowBlock, ParagraphBorder type imports left over from the migration. index.test.ts: delete the skipped 'decoration item synthesis' describe block (it was protecting the synthesis path that has been removed).
@tupizz tupizz force-pushed the tadeu/sd-2836-2-collapse-legacy-api branch from 8f18041 to 1c869c1 Compare May 4, 2026 18:05
@tupizz tupizz force-pushed the tadeu/sd-2836-3-lock-boundary branch from 34b7e7d to 85bd281 Compare May 4, 2026 18:05
…me dep (SD-2836)

Moves @superdoc/layout-resolved to devDependencies in the lockfile to
match package.json, so CI's --frozen-lockfile install matches. Boundary
tests still need it under devDependencies.
@tupizz tupizz self-assigned this May 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant