Skip to content

feat(diagram-core): canonical sequence diagram contract and family registry - #374

Open
anandpant wants to merge 1 commit into
mainfrom
feat/sequence-canonical
Open

anandpant wants to merge 1 commit into
mainfrom
feat/sequence-canonical

Conversation

@anandpant

@anandpant anandpant commented Oct 10, 2026 •

Copy link
Copy Markdown
Collaborator

What changed

  • diagram-core registers sequence as a canonical family with its own Effect Schema contract, SequenceDiagram: ordered participants and chronologically ordered messages, a call/return message type, and style defaults. It also adds getSequenceValidationIssues (duplicate ids, unknown participants, self messages, lifeline id collisions), parseSequenceDiagram, and two maintained fixtures.
  • IntermediateDiagram is now explicitly the node/edge graph IR for flowchart and mindmap (GRAPH_DIAGRAM_TYPES), so a type: "sequence" graph is rejected.
  • CanonicalDiagramSchema, parseCanonicalDiagram, and validateCanonicalDiagram cover every family. A satisfies Record<DiagramTypeValue, …> map makes a registry entry without a contract fail to compile.
  • renderSequenceDiagram takes the core SequenceDiagram and validates it with core, so the renderer's own input interface and render-time checks are deleted. renderDiagram dispatches any canonical diagram to its family renderer.
  • GenerationWorkspace accepts any canonical diagram, and a new Diagram Types/Sequence Storybook entry renders both sequence fixtures.
  • Code Mode's sequence build renders through the core contract. Adopting core validation there comes in the next PR in this stack.

Why

#280 asks for one typed sequence contract shared by every entry point. This PR adds that contract and moves the renderer and UI onto it. The next PR moves generation and Code Mode validation onto it and deletes their duplicate shapes.

Verification

  • pnpm nx affected -t typecheck,test --base=origin/main (12 projects)
  • pnpm run check (Oxlint, Oxfmt, lint-rule tests), tools/project-graph.test.ts
  • pnpm nx build-storybook diagram-ui

Refs #280

anandpant commented Oct 10, 2026 •

Copy link
Copy Markdown
Collaborator Author

How to use the Graphite Merge Queue

Add either label to this PR to merge it via the merge queue:

  • merge - adds this PR to the back of the merge queue
  • fast - for urgent changes, fast-track this PR to the front of the merge queue

You must have a Graphite account in order to use the merge queue. Sign up using this link.

An organization admin has enabled the Graphite Merge Queue in this repository.

Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue.

This stack of pull requests is managed by Graphite. Learn more about stacking.

@github-actions

github-actions Bot commented Oct 10, 2026 •

Copy link
Copy Markdown
Contributor

Sketchi Icons Preview

Status: ready

@github-actions

github-actions Bot commented Oct 10, 2026 •

Copy link
Copy Markdown
Contributor

Sketchi Web Preview

Status: ready

@github-actions

github-actions Bot commented Oct 10, 2026 •

Copy link
Copy Markdown
Contributor

Sketchi Eval Harness Preview

Status: ready

@github-actions

github-actions Bot commented Oct 10, 2026 •

Copy link
Copy Markdown
Contributor

Sketchi Excalidraw Workspace Preview

Status: ready

@github-actions

github-actions Bot commented Oct 10, 2026 •

Copy link
Copy Markdown
Contributor

Sketchi Playground / Studio Preview

Status: ready

…gistry

Register sequence as a canonical diagram family with its own Effect Schema
contract (ordered participants, chronological messages) instead of a
node/edge graph. The renderer, Code Mode build, and Storybook now consume
that contract, and renderDiagram dispatches any canonical family.

Refs #280
@anandpant
anandpant force-pushed the feat/sequence-canonical branch from 21583e0 to 115e4ae Compare October 10, 2026 22:11
@anandpant
anandpant marked this pull request as ready for review October 10, 2026 22:12
@chatgpt-codex-connector

Copy link
Copy Markdown

Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits.
Repo admins can enable using credits for code reviews in their settings.

This branch was successfully deployed

1 active deployment
staging — 115e4aea Deployed Oct 10, 2026 by anandpant via deploy-preview (web) #438
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant