Problem
A diagram whose edge label overhangs the viewBox ships with the label clipped mid-word, yet deliver --quality showcase returns 9/9 checks, 0 errors, 0 warnings — the receipt approves a visibly broken artifact. The gap covers the fixed canvases: architecture, sequence, data-flow, lifecycle, and schema_version: 1 workflow. (readable-v2 workflow is already safe: the compiler grows its canvas around pinned labels and rejects an authored viewBox that cannot hold the layout.)
Two adjacent defects compound it:
suggestLabelObstacleFix derives its labelAt/labelDx/labelDy hints from the obstacle alone. It can propose coordinates outside the canvas — applying the validator's own suggestion produces a clipped label. With an authored labelAt present, the relative-form hint is a no-op (labelPoint short-circuits), and with a pre-existing labelDx the delta lands in the wrong place.
archify check on an existing HTML artifact re-runs the composition rules, so the same clipped artifact also passes standalone checking.
Architecture's auto viewBox (autoViewBoxFor) sizes the canvas from components and boundaries only, so a no-meta.viewBox diagram can overhang the renderer's own canvas.
CJK text raises the odds of hitting all of this (full-width glyphs are 2 text units, so labels run wider), but the defect is locale-independent.
Repro
Any showcase diagram with an edge label routed near the right edge and a long enough label: validate --quality showcase exits 0 while the emitted <rect> for the label extends past viewBox[0]. Minimal JSON available on request.
Proposed fix (PR ready)
- Where the canvas is derived, size it correctly instead of reporting the author: include connection label rects in architecture's auto viewBox (measured non-breaking —
max() only grows a bbox, and every checked-in auto-sized architecture diagram renders byte-identically).
- Where the canvas is authored (plus the origin side growth cannot reach), a showcase-level rule
composition/label-canvas-containment reports the exact overflow with machine-readable evidence; standard keeps accepting pre-rule documents. Wired into the renderers and into check for artifacts they did not produce.
- Repair hints only emit fixes that survive being applied: clamped into the canvas, measured against the document's own
labelDx/labelDy, withheld when an authored labelAt outranks them, and stated as replacements, never increments.
All checked-in examples and frozen fixtures validate identically before/after (43 PASS / 10 pre-existing FAIL on both — zero legitimate diagrams newly rejected).
Known adjacent gap (out of scope)
Sequence segment titles are still unbounded (a segment label hundreds of px past the viewBox validates clean) — a distinct geometry, left for a follow-up.
Problem
A diagram whose edge label overhangs the viewBox ships with the label clipped mid-word, yet
deliver --quality showcasereturns 9/9 checks, 0 errors, 0 warnings — the receipt approves a visibly broken artifact. The gap covers the fixed canvases: architecture, sequence, data-flow, lifecycle, andschema_version: 1workflow. (readable-v2 workflow is already safe: the compiler grows its canvas around pinned labels and rejects an authored viewBox that cannot hold the layout.)Two adjacent defects compound it:
suggestLabelObstacleFixderives itslabelAt/labelDx/labelDyhints from the obstacle alone. It can propose coordinates outside the canvas — applying the validator's own suggestion produces a clipped label. With an authoredlabelAtpresent, the relative-form hint is a no-op (labelPointshort-circuits), and with a pre-existinglabelDxthe delta lands in the wrong place.archify checkon an existing HTML artifact re-runs the composition rules, so the same clipped artifact also passes standalone checking.Architecture's auto viewBox (
autoViewBoxFor) sizes the canvas from components and boundaries only, so a no-meta.viewBoxdiagram can overhang the renderer's own canvas.CJK text raises the odds of hitting all of this (full-width glyphs are 2 text units, so labels run wider), but the defect is locale-independent.
Repro
Any showcase diagram with an edge label routed near the right edge and a long enough label:
validate --quality showcaseexits 0 while the emitted<rect>for the label extends pastviewBox[0]. Minimal JSON available on request.Proposed fix (PR ready)
max()only grows a bbox, and every checked-in auto-sized architecture diagram renders byte-identically).composition/label-canvas-containmentreports the exact overflow with machine-readable evidence;standardkeeps accepting pre-rule documents. Wired into the renderers and intocheckfor artifacts they did not produce.labelDx/labelDy, withheld when an authoredlabelAtoutranks them, and stated as replacements, never increments.All checked-in examples and frozen fixtures validate identically before/after (43 PASS / 10 pre-existing FAIL on both — zero legitimate diagrams newly rejected).
Known adjacent gap (out of scope)
Sequence segment titles are still unbounded (a segment label hundreds of px past the viewBox validates clean) — a distinct geometry, left for a follow-up.