Repository navigation
refactor(diagram): one sequence contract across generation and Code Mode - #375
Merged
Merged
Conversation
Collaborator
Author
This was referenced Oct 10, 2026
anandpant
force-pushed
the
feat/sequence-canonical
branch
from
October 10, 2026 22:11
21583e0 to
115e4ae
Compare
anandpant
force-pushed
the
feat/sequence-one-contract
branch
from
October 10, 2026 22:11
3bdf75b to
518ebb0
Compare
anandpant
marked this pull request as ready for review
October 10, 2026 22:12
|
Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits. |
This was referenced Oct 10, 2026
Merged
Merge activity
|
…ode (#375) ## What changed - `diagram-generation` decodes a model's sequence output with diagram-core's `SequenceDiagram` and its validation, the same way flowcharts are handled. `GeneratedSequenceParticipant`, `GeneratedSequenceMessage`, `GeneratedSequenceDiagram`, and `parseGeneratedSequence` are deleted. Invalid output now reports typed `sequence.<code>: … Hint: …` diagnostics, which the repair loop feeds back to the model, and the Sketchi palette is applied like it is for the other families. - The candidate's `diagram` field is diagram-core's `CanonicalDiagramSchema`. - Code Mode's `buildSequenceDiagram` gets its invariants from `getSequenceValidationIssues` and maps them onto its published issue codes (`duplicate_node_id`, `missing_edge_source`, `self_loop`, …). Paths and hints are unchanged, so the MCP contract is unchanged. Message `type`/`style` enums come from core. - The playground generate API converts the core diagram into the canonical sequence document. ## Why Before this, the participant/message invariants existed in three copies: generation, Code Mode, and the renderer (removed in the parent PR). Now diagram-core owns the sequence contract and its validation, and the other surfaces use it. ## Verification - `pnpm nx affected -t typecheck,test --base=origin/main` (18 projects), including the existing Code Mode sequence tests that pin issue codes, paths, and hints - New generation tests: core diagnostics for a self message and an unknown target, and style normalization - `oxlint`, `oxfmt --check` Refs #280 ## Review follow-up Code Mode keeps its published reference hints (`Use the id of a participant declared in spec.participants.`): the Code Mode mapping overrides diagram-core's request-agnostic wording, and a runtime test pins the code, path, message, and hint.
graphite-app
Bot
force-pushed
the
feat/sequence-canonical
branch
from
October 11, 2026 01:48
115e4ae to
bfd9c2b
Compare
graphite-app
Bot
force-pushed
the
feat/sequence-one-contract
branch
from
October 11, 2026 01:48
97f5817 to
4d3079f
Compare
Contributor
Sketchi Web PreviewStatus:
|
Contributor
Sketchi Eval Harness PreviewStatus:
|
Contributor
Sketchi Icons PreviewStatus:
|
Contributor
Sketchi Excalidraw Workspace PreviewStatus:
|
Contributor
Sketchi Playground / Studio PreviewStatus:
|
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

What changed
diagram-generationdecodes a model's sequence output with diagram-core'sSequenceDiagramand its validation, the same way flowcharts are handled.GeneratedSequenceParticipant,GeneratedSequenceMessage,GeneratedSequenceDiagram, andparseGeneratedSequenceare deleted. Invalid output now reports typedsequence.<code>: … Hint: …diagnostics, which the repair loop feeds back to the model, and the Sketchi palette is applied like it is for the other families.diagramfield is diagram-core'sCanonicalDiagramSchema.buildSequenceDiagramgets its invariants fromgetSequenceValidationIssuesand maps them onto its published issue codes (duplicate_node_id,missing_edge_source,self_loop, …). Paths and hints are unchanged, so the MCP contract is unchanged. Messagetype/styleenums come from core.Why
Before this, the participant/message invariants existed in three copies: generation, Code Mode, and the renderer (removed in the parent PR). Now diagram-core owns the sequence contract and its validation, and the other surfaces use it.
Verification
pnpm nx affected -t typecheck,test --base=origin/main(18 projects), including the existing Code Mode sequence tests that pin issue codes, paths, and hintsoxlint,oxfmt --checkRefs #280
Review follow-up
Code Mode keeps its published reference hints (
Use the id of a participant declared in spec.participants.): the Code Mode mapping overrides diagram-core's request-agnostic wording, and a runtime test pins the code, path, message, and hint.