Graph render redesign — line/plane/occlusion renderer (core slice)#762
Conversation
📝 WalkthroughWalkthroughThis PR replaces the tree-layout-based migration graph rendering system with a new grid/occlusion-based pipeline, adds label-formatting and lane colorization, integrates the new renderer into migrate/list/status commands, and adds gallery tooling plus golden-driven tests validating color, glyph, and alignment invariants. ChangesMigration Graph Grid Rendering Architecture
Golden Testing Framework & Validation
Test Updates
Gallery CLI Tool
Estimated code review effort: Possibly Related PRs
Suggested Reviewers
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
@prisma-next/extension-author-tools
@prisma-next/mongo-runtime
@prisma-next/family-mongo
@prisma-next/sql-runtime
@prisma-next/family-sql
@prisma-next/extension-arktype-json
@prisma-next/middleware-cache
@prisma-next/mongo
@prisma-next/extension-paradedb
@prisma-next/extension-pgvector
@prisma-next/extension-postgis
@prisma-next/postgres
@prisma-next/sql-orm-client
@prisma-next/sqlite
@prisma-next/extension-supabase
@prisma-next/target-mongo
@prisma-next/adapter-mongo
@prisma-next/driver-mongo
@prisma-next/contract
@prisma-next/utils
@prisma-next/config
@prisma-next/errors
@prisma-next/framework-components
@prisma-next/operations
@prisma-next/ts-render
@prisma-next/contract-authoring
@prisma-next/ids
@prisma-next/psl-parser
@prisma-next/psl-printer
@prisma-next/cli
@prisma-next/cli-telemetry
@prisma-next/emitter
@prisma-next/migration-tools
prisma-next
@prisma-next/vite-plugin-contract-emit
@prisma-next/mongo-codec
@prisma-next/mongo-contract
@prisma-next/mongo-value
@prisma-next/mongo-contract-psl
@prisma-next/mongo-contract-ts
@prisma-next/mongo-emitter
@prisma-next/mongo-schema-ir
@prisma-next/mongo-query-ast
@prisma-next/mongo-orm
@prisma-next/mongo-query-builder
@prisma-next/mongo-lowering
@prisma-next/mongo-wire
@prisma-next/sql-contract
@prisma-next/sql-errors
@prisma-next/sql-operations
@prisma-next/sql-schema-ir
@prisma-next/sql-contract-psl
@prisma-next/sql-contract-ts
@prisma-next/sql-contract-emitter
@prisma-next/sql-lane-query-builder
@prisma-next/sql-relational-core
@prisma-next/sql-builder
@prisma-next/target-postgres
@prisma-next/target-sqlite
@prisma-next/adapter-postgres
@prisma-next/adapter-sqlite
@prisma-next/driver-postgres
@prisma-next/driver-sqlite
commit: |
size-limit report 📦
|
wmadden
left a comment
There was a problem hiding this comment.
I don't want to see the words "clean-room" in the source.
e60d7eb to
6c17b3c
Compare
|
Addressed the review:
I also corrected the base to |
6c17b3c to
300fc14
Compare
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (1)
packages/1-framework/3-tooling/cli/test/utils/formatters/golden-pipeline.test.ts (1)
284-293: 💤 Low valueConsider optional chaining to avoid non-null assertion.
The non-null assertion on line 285 is safe (guarded by the while condition), but optional chaining would be more idiomatic:
while (merged.length > 0) { - const last = merged[merged.length - 1]!; + const last = merged.at(-1); + if (last === undefined) break; const trimmed = last.text.trimEnd();🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@packages/1-framework/3-tooling/cli/test/utils/formatters/golden-pipeline.test.ts` around lines 284 - 293, Replace the non-null assertion on merged[merged.length - 1]! with an optional-safe access—e.g., use merged.at(-1) and guard it before use: change const last = merged[merged.length - 1]! to const last = merged.at(-1); if (!last) break; then proceed to trim and possibly pop; this removes the `!` while preserving the current loop logic in the block handling merged, last, and trimmed.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In
`@packages/1-framework/3-tooling/cli/test/utils/formatters/migration-list-render.test.ts`:
- Around line 217-220: The test currently only forbids the single tee glyph '├',
but the invariant forbids the full legacy-tee set; update the assertion that
checks the rendered corner to also reject '┬', '┴', and '┼'. Locate the
expectations that reference output (the expect(output).not.toContain('├') line)
and replace it with a single negative assertion that ensures none of the tee
glyphs ['├','┬','┴','┼'] appear in output (e.g., a negative regex or checking
each glyph), keeping the existing positive corner regex
expect(output).toMatch(/[│─]─[╮╯]/) intact.
---
Nitpick comments:
In
`@packages/1-framework/3-tooling/cli/test/utils/formatters/golden-pipeline.test.ts`:
- Around line 284-293: Replace the non-null assertion on merged[merged.length -
1]! with an optional-safe access—e.g., use merged.at(-1) and guard it before
use: change const last = merged[merged.length - 1]! to const last =
merged.at(-1); if (!last) break; then proceed to trim and possibly pop; this
removes the `!` while preserving the current loop logic in the block handling
merged, last, and trimmed.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yml
Review profile: CHILL
Plan: Pro
Run ID: ec1b874c-7f3c-4cc9-b0fc-c12940af9560
⛔ Files ignored due to path filters (8)
packages/1-framework/3-tooling/cli/test/commands/__snapshots__/migration-graph-coloured-output.test.ts.snapis excluded by!**/*.snappackages/1-framework/3-tooling/cli/test/utils/formatters/__snapshots__/graph-render.test.ts.snapis excluded by!**/*.snappackages/1-framework/3-tooling/cli/test/utils/formatters/__snapshots__/migration-graph-gallery-snapshots.test.ts.snapis excluded by!**/*.snapprojects/migration-graph-rendering/design/graph-render-redesign.mdis excluded by!projects/**projects/migration-graph-rendering/slices/render-redesign-core/plan.mdis excluded by!projects/**projects/migration-graph-rendering/slices/render-redesign-core/spec.mdis excluded by!projects/**projects/migration-graph-rendering/slices/render-redesign-geometry/spec.mdis excluded by!projects/**projects/migration-graph-rendering/trace.jsonlis excluded by!projects/**
📒 Files selected for processing (34)
packages/1-framework/3-tooling/cli/package.jsonpackages/1-framework/3-tooling/cli/scripts/gallery.tspackages/1-framework/3-tooling/cli/src/commands/migrate.tspackages/1-framework/3-tooling/cli/src/commands/migration-graph.tspackages/1-framework/3-tooling/cli/src/commands/migration-list.tspackages/1-framework/3-tooling/cli/src/commands/migration-status-overlay.tspackages/1-framework/3-tooling/cli/src/commands/migration-status.tspackages/1-framework/3-tooling/cli/src/utils/formatters/migration-graph-command-render.tspackages/1-framework/3-tooling/cli/src/utils/formatters/migration-graph-grid-layout.tspackages/1-framework/3-tooling/cli/src/utils/formatters/migration-graph-labels.tspackages/1-framework/3-tooling/cli/src/utils/formatters/migration-graph-lane-colors.tspackages/1-framework/3-tooling/cli/src/utils/formatters/migration-graph-layout.tspackages/1-framework/3-tooling/cli/src/utils/formatters/migration-graph-model.tspackages/1-framework/3-tooling/cli/src/utils/formatters/migration-graph-occlusion-render.tspackages/1-framework/3-tooling/cli/src/utils/formatters/migration-graph-space-render.tspackages/1-framework/3-tooling/cli/src/utils/formatters/migration-graph-tree-render.tspackages/1-framework/3-tooling/cli/src/utils/formatters/migration-list-render.tspackages/1-framework/3-tooling/cli/test/commands/migration-graph-coloured-output.test.tspackages/1-framework/3-tooling/cli/test/commands/migration-graph.test.tspackages/1-framework/3-tooling/cli/test/commands/migration-list.test.tspackages/1-framework/3-tooling/cli/test/commands/migration-read-commands-parity.test.tspackages/1-framework/3-tooling/cli/test/utils/formatters/gallery-cells.tspackages/1-framework/3-tooling/cli/test/utils/formatters/gallery-goldens-backlink.tspackages/1-framework/3-tooling/cli/test/utils/formatters/gallery-goldens.tspackages/1-framework/3-tooling/cli/test/utils/formatters/golden-pipeline.test.tspackages/1-framework/3-tooling/cli/test/utils/formatters/migration-graph-cell-identity.test.tspackages/1-framework/3-tooling/cli/test/utils/formatters/migration-graph-colour-matrix.test.tspackages/1-framework/3-tooling/cli/test/utils/formatters/migration-graph-gallery-snapshots.test.tspackages/1-framework/3-tooling/cli/test/utils/formatters/migration-graph-layout.test.tspackages/1-framework/3-tooling/cli/test/utils/formatters/migration-graph-rows.test.tspackages/1-framework/3-tooling/cli/test/utils/formatters/migration-graph-scenario-gallery.tspackages/1-framework/3-tooling/cli/test/utils/formatters/migration-graph-tree-render.test.tspackages/1-framework/3-tooling/cli/test/utils/formatters/migration-list-render.test.tspackages/1-framework/3-tooling/cli/test/utils/formatters/migration-list-styler.test.ts
💤 Files with no reviewable changes (7)
- packages/1-framework/3-tooling/cli/src/utils/formatters/migration-graph-layout.ts
- packages/1-framework/3-tooling/cli/test/utils/formatters/migration-graph-layout.test.ts
- packages/1-framework/3-tooling/cli/test/utils/formatters/migration-graph-cell-identity.test.ts
- packages/1-framework/3-tooling/cli/src/utils/formatters/migration-graph-lane-colors.ts
- packages/1-framework/3-tooling/cli/test/utils/formatters/migration-graph-tree-render.test.ts
- packages/1-framework/3-tooling/cli/test/utils/formatters/migration-graph-colour-matrix.test.ts
- packages/1-framework/3-tooling/cli/src/utils/formatters/migration-graph-tree-render.ts
The no-tee invariant forbids every tee glyph; the corner assertion only rejected ├, so a regression introducing ┬ ┴ ┼ would have passed. Broaden the negative match to the whole set (addresses CodeRabbit review on PR #762). Signed-off-by: Will Madden <madden@prisma.io>
…clusion)
Replace the position-keyed StructuralCell grid and the switch(cell.kind)
renderer with a line/plane/occlusion model: a line carries identity, the
layout assigns each line a plane, and the renderer projects each cell to the
topmost-plane line — taking its glyph from that line's directions and its
colour straight off the line. This removes the colour-bleed class of bugs by
construction.
- Model + layout + renderer: migration-graph-{model,grid-layout,occlusion-render}.ts.
- Commands (graph / status / list --graph / migrate --show) render rows, gutter,
and per-row labels from one grid via migration-graph-{command-render,labels}.ts.
- Glyph alphabet is verticals + corners + arrows + node markers — no tees; with
two columns per lane every cell has one owner, so colour is never arbitrated.
- Branch palette: white, cyan, yellow, blueBright, magenta, green (no red; the
on-path highlight stays greenBright).
- Verified by a hand-authored scenario-gallery oracle: goldens are serialised by
a trivial independent renderer, and the real pipeline is asserted to reproduce
them (render(input) === golden), plus a green-only-on-path invariant.
- Removes the old renderer (migration-graph-{layout,tree-render,lane-colors}.ts)
and its tests.
Back-arc convergence and configurable geometry are left to the sibling
render-redesign-geometry slice.
Signed-off-by: Will Madden <madden@prisma.io>
The no-tee invariant forbids every tee glyph; the corner assertion only rejected ├, so a regression introducing ┬ ┴ ┼ would have passed. Broaden the negative match to the whole set (addresses CodeRabbit review on PR #762). Signed-off-by: Will Madden <madden@prisma.io>
141fc03 to
d93b000
Compare
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (1)
packages/1-framework/3-tooling/cli/test/utils/formatters/golden-pipeline.test.ts (1)
349-358: 💤 Low valueDead loop body — remove or complete the TODO.
Lines 351-357 iterate over lines but the loop body only contains comments; no actual logic executes. Either remove this loop or implement the "best-effort check" mentioned in the comments.
🧹 Suggested cleanup
function assertGreenOnlyOnPath(golden: ScenarioGolden, rendered: string): void { const lines = rendered.split('\n'); - for (const line of lines) { - if (!line.includes(GREEN_BRIGHT)) continue; - // This line has green — it should only be on-path related. - // (We do a best-effort check: if we can find the migration name for this - // line and it's off-path, that's a violation.) - // For now we just collect violations without blocking. - } - // Actual assertion: green must NOT appear on a line that is purely off-path.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@packages/1-framework/3-tooling/cli/test/utils/formatters/golden-pipeline.test.ts` around lines 349 - 358, The loop in assertGreenOnlyOnPath currently contains only comments and must be implemented or removed; implement the "best-effort check" by scanning each rendered line for GREEN_BRIGHT, extracting the migration identifier/name with the same regex/pattern the tests use elsewhere (use the migration naming symbols from ScenarioGolden/migrations), then check that the found migration is marked on-path in the ScenarioGolden data (e.g., via golden.migrations or golden.onPath set); collect violations into an array (e.g., violations) and at the end assert/throw a clear test failure if any off-path migrations were found highlighted in green, otherwise return silently. Ensure you reference the function assertGreenOnlyOnPath, the GREEN_BRIGHT marker, and ScenarioGolden/migrations when locating where to add this logic.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In
`@packages/1-framework/3-tooling/cli/test/utils/formatters/golden-pipeline.test.ts`:
- Line 392: Update the stale test-suite description in the describe(...) call
for the "golden-pipeline" tests: remove the "RED baseline — expected to fail on
current renderer" clause so the description reflects that tests should pass
(e.g., change to "golden-pipeline: render(input) === golden" or similar). Edit
the describe string in the test file's describe('golden-pipeline: render(input)
=== golden (RED baseline — expected to fail on current renderer)', ...) to a
concise, accurate message matching the PR expectation.
---
Nitpick comments:
In
`@packages/1-framework/3-tooling/cli/test/utils/formatters/golden-pipeline.test.ts`:
- Around line 349-358: The loop in assertGreenOnlyOnPath currently contains only
comments and must be implemented or removed; implement the "best-effort check"
by scanning each rendered line for GREEN_BRIGHT, extracting the migration
identifier/name with the same regex/pattern the tests use elsewhere (use the
migration naming symbols from ScenarioGolden/migrations), then check that the
found migration is marked on-path in the ScenarioGolden data (e.g., via
golden.migrations or golden.onPath set); collect violations into an array (e.g.,
violations) and at the end assert/throw a clear test failure if any off-path
migrations were found highlighted in green, otherwise return silently. Ensure
you reference the function assertGreenOnlyOnPath, the GREEN_BRIGHT marker, and
ScenarioGolden/migrations when locating where to add this logic.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yml
Review profile: CHILL
Plan: Pro
Run ID: 459e3f9f-2c50-4297-9f16-a6a33ae88d98
⛔ Files ignored due to path filters (8)
packages/1-framework/3-tooling/cli/test/commands/__snapshots__/migration-graph-coloured-output.test.ts.snapis excluded by!**/*.snappackages/1-framework/3-tooling/cli/test/utils/formatters/__snapshots__/graph-render.test.ts.snapis excluded by!**/*.snappackages/1-framework/3-tooling/cli/test/utils/formatters/__snapshots__/migration-graph-gallery-snapshots.test.ts.snapis excluded by!**/*.snapprojects/migration-graph-rendering/design/graph-render-redesign.mdis excluded by!projects/**projects/migration-graph-rendering/slices/render-redesign-core/plan.mdis excluded by!projects/**projects/migration-graph-rendering/slices/render-redesign-core/spec.mdis excluded by!projects/**projects/migration-graph-rendering/slices/render-redesign-geometry/spec.mdis excluded by!projects/**projects/migration-graph-rendering/trace.jsonlis excluded by!projects/**
📒 Files selected for processing (34)
packages/1-framework/3-tooling/cli/package.jsonpackages/1-framework/3-tooling/cli/scripts/gallery.tspackages/1-framework/3-tooling/cli/src/commands/migrate.tspackages/1-framework/3-tooling/cli/src/commands/migration-graph.tspackages/1-framework/3-tooling/cli/src/commands/migration-list.tspackages/1-framework/3-tooling/cli/src/commands/migration-status-overlay.tspackages/1-framework/3-tooling/cli/src/commands/migration-status.tspackages/1-framework/3-tooling/cli/src/utils/formatters/migration-graph-command-render.tspackages/1-framework/3-tooling/cli/src/utils/formatters/migration-graph-grid-layout.tspackages/1-framework/3-tooling/cli/src/utils/formatters/migration-graph-labels.tspackages/1-framework/3-tooling/cli/src/utils/formatters/migration-graph-lane-colors.tspackages/1-framework/3-tooling/cli/src/utils/formatters/migration-graph-layout.tspackages/1-framework/3-tooling/cli/src/utils/formatters/migration-graph-model.tspackages/1-framework/3-tooling/cli/src/utils/formatters/migration-graph-occlusion-render.tspackages/1-framework/3-tooling/cli/src/utils/formatters/migration-graph-space-render.tspackages/1-framework/3-tooling/cli/src/utils/formatters/migration-graph-tree-render.tspackages/1-framework/3-tooling/cli/src/utils/formatters/migration-list-render.tspackages/1-framework/3-tooling/cli/test/commands/migration-graph-coloured-output.test.tspackages/1-framework/3-tooling/cli/test/commands/migration-graph.test.tspackages/1-framework/3-tooling/cli/test/commands/migration-list.test.tspackages/1-framework/3-tooling/cli/test/commands/migration-read-commands-parity.test.tspackages/1-framework/3-tooling/cli/test/utils/formatters/gallery-cells.tspackages/1-framework/3-tooling/cli/test/utils/formatters/gallery-goldens-backlink.tspackages/1-framework/3-tooling/cli/test/utils/formatters/gallery-goldens.tspackages/1-framework/3-tooling/cli/test/utils/formatters/golden-pipeline.test.tspackages/1-framework/3-tooling/cli/test/utils/formatters/migration-graph-cell-identity.test.tspackages/1-framework/3-tooling/cli/test/utils/formatters/migration-graph-colour-matrix.test.tspackages/1-framework/3-tooling/cli/test/utils/formatters/migration-graph-gallery-snapshots.test.tspackages/1-framework/3-tooling/cli/test/utils/formatters/migration-graph-layout.test.tspackages/1-framework/3-tooling/cli/test/utils/formatters/migration-graph-rows.test.tspackages/1-framework/3-tooling/cli/test/utils/formatters/migration-graph-scenario-gallery.tspackages/1-framework/3-tooling/cli/test/utils/formatters/migration-graph-tree-render.test.tspackages/1-framework/3-tooling/cli/test/utils/formatters/migration-list-render.test.tspackages/1-framework/3-tooling/cli/test/utils/formatters/migration-list-styler.test.ts
💤 Files with no reviewable changes (7)
- packages/1-framework/3-tooling/cli/test/utils/formatters/migration-graph-layout.test.ts
- packages/1-framework/3-tooling/cli/src/utils/formatters/migration-graph-layout.ts
- packages/1-framework/3-tooling/cli/test/utils/formatters/migration-graph-tree-render.test.ts
- packages/1-framework/3-tooling/cli/test/utils/formatters/migration-graph-colour-matrix.test.ts
- packages/1-framework/3-tooling/cli/test/utils/formatters/migration-graph-cell-identity.test.ts
- packages/1-framework/3-tooling/cli/src/utils/formatters/migration-graph-lane-colors.ts
- packages/1-framework/3-tooling/cli/src/utils/formatters/migration-graph-tree-render.ts
✅ Files skipped from review due to trivial changes (7)
- packages/1-framework/3-tooling/cli/src/utils/formatters/migration-list-render.ts
- packages/1-framework/3-tooling/cli/package.json
- packages/1-framework/3-tooling/cli/src/commands/migration-status.ts
- packages/1-framework/3-tooling/cli/src/commands/migration-graph.ts
- packages/1-framework/3-tooling/cli/test/commands/migration-list.test.ts
- packages/1-framework/3-tooling/cli/src/commands/migration-list.ts
- packages/1-framework/3-tooling/cli/src/utils/formatters/migration-graph-model.ts
🚧 Files skipped from review as they are similar to previous changes (16)
- packages/1-framework/3-tooling/cli/src/commands/migration-status-overlay.ts
- packages/1-framework/3-tooling/cli/test/commands/migration-graph.test.ts
- packages/1-framework/3-tooling/cli/test/utils/formatters/migration-list-styler.test.ts
- packages/1-framework/3-tooling/cli/test/utils/formatters/gallery-goldens.ts
- packages/1-framework/3-tooling/cli/src/commands/migrate.ts
- packages/1-framework/3-tooling/cli/test/utils/formatters/migration-list-render.test.ts
- packages/1-framework/3-tooling/cli/test/utils/formatters/migration-graph-rows.test.ts
- packages/1-framework/3-tooling/cli/test/commands/migration-read-commands-parity.test.ts
- packages/1-framework/3-tooling/cli/test/commands/migration-graph-coloured-output.test.ts
- packages/1-framework/3-tooling/cli/src/utils/formatters/migration-graph-labels.ts
- packages/1-framework/3-tooling/cli/test/utils/formatters/gallery-goldens-backlink.ts
- packages/1-framework/3-tooling/cli/test/utils/formatters/migration-graph-gallery-snapshots.test.ts
- packages/1-framework/3-tooling/cli/test/utils/formatters/gallery-cells.ts
- packages/1-framework/3-tooling/cli/src/utils/formatters/migration-graph-space-render.ts
- packages/1-framework/3-tooling/cli/test/utils/formatters/migration-graph-scenario-gallery.ts
- packages/1-framework/3-tooling/cli/scripts/gallery.ts
|
|
||
| const ALL_GOLDENS: readonly ScenarioGolden[] = [...GOLDENS, ...BACKLINK_GOLDENS]; | ||
|
|
||
| describe('golden-pipeline: render(input) === golden (RED baseline — expected to fail on current renderer)', () => { |
There was a problem hiding this comment.
Stale "expected to fail" description contradicts PR verification.
The test suite description says "RED baseline — expected to fail on current renderer", but the PR objectives state all checks are green (1302 passed). If these tests now pass, update the description to reflect the current state.
📝 Suggested fix
-describe('golden-pipeline: render(input) === golden (RED baseline — expected to fail on current renderer)', () => {
+describe('golden-pipeline: render(input) === golden', () => {📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| describe('golden-pipeline: render(input) === golden (RED baseline — expected to fail on current renderer)', () => { | |
| describe('golden-pipeline: render(input) === golden', () => { |
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In
`@packages/1-framework/3-tooling/cli/test/utils/formatters/golden-pipeline.test.ts`
at line 392, Update the stale test-suite description in the describe(...) call
for the "golden-pipeline" tests: remove the "RED baseline — expected to fail on
current renderer" clause so the description reflects that tests should pass
(e.g., change to "golden-pipeline: render(input) === golden" or similar). Edit
the describe string in the test file's describe('golden-pipeline: render(input)
=== golden (RED baseline — expected to fail on current renderer)', ...) to a
concise, accurate message matching the PR expectation.
…oritative plan The line/plane/occlusion rewrite (#762) made several fine-grained glyph-bug slices moot — they targeted the deleted tee-based renderer. Delete converging-back-arcs, connector-crossing-glyph, node-merge-landing-marker (dead by construction in the new model), plus showcase-multilane-merge and diamond-fixture-regeneration (low-value examples/ chores, captured as optional follow-ups). Add plan.md as the single source of truth for what's done vs left. Signed-off-by: Will Madden <madden@prisma.io>
## Close-out: migration-graph-rendering Closes the `migration-graph-rendering` project (TML-2746). It began as a redesign of `migration graph`'s renderer and broadened into a revamp of the whole interrogative migration **read-command family** (`list` / `graph` / `status` / `log`) on a shared renderer + ledger foundation. All work has shipped; this PR migrates the durable knowledge into `docs/` and deletes the transient project scaffolding. ### Definition of Done — verified | Outcome | Evidence | |---|---| | Tier-3 renderer rebuilt (line/plane/occlusion) | #762 | | Back-arc convergence, configurable geometry, greedy lane colouring, layout fixes | #767 | | Ledger foundation (per-migration journal) | #665 | | `list`/`status`/`log` revamped on the shared renderer; dagre + `list --graph` retired | shipped; verified — `migration-list/status/log/graph.ts` use the shared renderer; no `dagre`/`tree-render`/`layout` renderers remain | | Read-command consistency (TML-2801) | re-validated this PR: 4/7 findings resolved, 2 partial, 1 open (4 small follow-ups noted below) | | Showcase real-world golden | on `main` | No unmet acceptance criteria. External-reference scan for `projects/migration-graph-rendering/` is empty (reference-strip step was a no-op). ### Durable knowledge migrated to `docs/` - **ADR 227** — Migration read commands share one graphical renderer with command-specific annotations. - **ADR 228** — The migration apply ledger is a per-migration journal. - **ADR 229** — The migration graph renderer uses a line/plane/occlusion model (the renderer's internal design — lines as the primitive, single-owner cells, occlusion over blended glyphs). All three verified against shipped code. - **`docs/reference/Migration Graph Visual Language.md`** — the glyph/layout vocabulary the renderer draws from (was the project's `mockups.md`). The read-command consistency audit was **re-validated** against current code (verdict: largely accomplished — 4/7 findings resolved, 2 partial, 1 open) and captured as a Linear follow-up ticket (**TML-2877**, related to TML-2801) rather than a committed doc, since what remains is actionable backlog, not long-lived reference. Transient artefacts (spec, plan, slice specs/plans/reviews, `decisions.md` — now ADR'd, `learnings.md`, the followups draft, `trace.jsonl`, prototype, the audit doc) deleted with the folder / moved to Linear. ### Follow-ups (tracked, not in this PR) - **TML-2877** — the four remaining read-command consistency items (show `--space` policy, log unscoped-semantics doc, check see-also, show/check decoration flags, + a parity-test extension). - **PR #773** — the demo fixture no-op self-edge fix + offline integrity guard. ### Retro — lessons - **A wholesale rewrite obsoletes fine-grained bug-slices.** Three glyph-bug slice specs (tee/marker bugs) were made moot by the line/plane/occlusion rewrite — they targeted deleted code. Re-triage the backlog after a rewrite; don't carry dead slices. - **Hand-authored goldens beat auto-snapshots for correctness.** `toMatchSnapshot()` self-certifies whatever the renderer emits; the hand-authored `golden-pipeline` oracle caught a convergence regression the snapshots happily recorded as "correct." - **Real-world fixtures expose layout bugs unit fixtures miss.** Validating against the `showcase` graph surfaced four distinct layout/colour bugs (disconnected-component interleave, asymmetric-diamond merge lane, trunk-continuation, greedy-colour wraparound) that the simple scenarios never hit. - **`@prisma-next/cli` runs vitest with `isolate: false`** — "passes locally" ≠ passes in CI (parallel state pollution). Candidate for a durable testing note. - **`fixtures:emit` can emit an integrity-failing fixture** — the emitter and `migration check` disagreed (a hash-collapse produced a no-op self-edge). Landed an offline demo integrity guard (#773). 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Signed-off-by: Will Madden <madden@prisma.io> Co-authored-by: Will Madden <madden@prisma.io>
Slice:
render-redesign-coreof the migration-graph-rendering project.Base:
render-redesign-design(stacked — this builds on the design + plan branch).What this does
Rebuilds the Tier-3 migration-graph renderer so colouring is correct-by-construction — no more colour "bleed". The line is the primitive; each cell is a z-ordered set of lines with directions and a plane; rendering is an occlusion projection that picks the topmost-plane line per cell and reads its colour straight off the owning line. No tees (
├ ┬ ┼) — corners only, two columns per lane, single-owner-per-cell invariant.How it's verified — an executable scenario-gallery oracle
Correctness is pinned by hand-authored golden fixtures (
[glyphs, name?, colours]) rendered by a trivial, independentrenderCells— not the real renderer, so the test isn't tautological. The real pipeline must satisfyrender(input) === goldenfor every catalogue scenario, plus a "green only on-path" invariant. Runpnpm --filter @prisma-next/cli gallery [filter]to view any scenario in colour.Highlights
LineRef/CellLine{directions, plane}/Cell/Grid(migration-graph-model.ts).migration-graph-grid-layout.ts).migration-graph-occlusion-render.ts) with mode-dependent z-order (trunk-on-top flat / on-path-on-top focus) and an ASCII alphabet.migration-graph-command-render.ts+-labels.ts): rows, gutter, and per-row labels all derived from one grid — fixes the prior off-by-one label offset.StructuralCelllayout, theswitch (cell.kind)render, the tee renderer, and the lane-colour/corner-gutter splice are deleted.white · cyan · yellow · blueBright · magenta · green— no red (reads as an error); green reserved-but-usable (flat lane uses normal green SGR 32, on-path highlight uses greenBright SGR 92).Deferred to
render-redesign-geometry(by design)|after a multi-edge convergence node.showcase-golden-shelf.Verification
render(input) === goldenfor the full catalogue; green-only-on-path invariant holds.multi-branch/wide-fandemo fixtures render with correct alignment and unified per-lane colour.🤖 Generated with Claude Code
Summary by CodeRabbit
New Features
galleryCLI script to render and view hand-authored fixtures.Improvements
Tests