outcomeEdges route around boxes with deterministic orthogonal paths
spec:consumers.spec-studio.diagram-kinds.edge-routingPacks: pack:roadmaps-and-slices-v1, pack:self-hosting-v1
Design: 6 design entries · 1 pinned declaration · no decisions
Findings: no errors, no warnings
specs/consumers/spec-studio.diagram-kinds.edge-routing.sdp.md
No open questions and no blocking questions; implementation binding present, verifier binding present, and expected-outcome oracle none.
Intent
- Follow an arrow without it crossing a box or covering a label, using the engine's own static layout.
Contract
rule.obstaclesline 18 ·specs/consumers/spec-studio.diagram-kinds.edge-routing.sdp.md:18- After box placement and label wrapping, reserve each box and band label rectangle as an obstacle with clearance. An edge may touch only its own source and destination ports; no other segment may intersect a reserved rectangle's interior.
no example exercises it
rule.routesline 19 ·specs/consumers/spec-studio.diagram-kinds.edge-routing.sdp.md:19- Route edges deterministically in code-unit order by from, to, kind and claim with orthogonal whole-pixel paths around the reserved obstacles. Add no layout dependency and read no browser measurement. The build owns the search representation, weights and tie-break implementation.
no example exercises it
rule.portsline 20 ·specs/consumers/spec-studio.diagram-kinds.edge-routing.sdp.md:20- Choose source and destination sides deterministically for forward, same-band and backward edges. Every incident edge has its own port. A cycle and a backward edge remain directed and route around intervening boxes.
no example exercises it
rule.labelsline 21 ·specs/consumers/spec-studio.diagram-kinds.edge-routing.sdp.md:21- Reserve an edge label's rectangle beside a free segment. If the exact relation and claim words do not fit, use a stable edge key and name its full wording in the adjacent legend and text equivalent. Every placed label rectangle is an obstacle for later labels and routes; no two labels overlap. An edge carries a label only where spec:consumers.spec-studio.diagrams#rule.wordsBesideStyle asks for one; a drawing whose edges share one relation and one claim names them once in its legend.
no example exercises it
rule.noPathline 22 ·specs/consumers/spec-studio.diagram-kinds.edge-routing.sdp.md:22- If any required route, distinct lane or label cannot be placed within the deterministic routing budget, omit that SVG and open its text equivalent with an explicit routing explanation. Never draw a straight line through a box as fallback.
no example exercises it
0 unkeyed rules.
Design
clearanceline 25 ·specs/consumers/spec-studio.diagram-kinds.edge-routing.sdp.md:2512logical pixels around boxes and text, with ports connected through their own clearance by a stub. Lane spacing is8pixels and gutter margin is24pixels; all coordinates and costs are integers.no citation recorded
costline 26 ·specs/consumers/spec-studio.diagram-kinds.edge-routing.sdp.md:26- Crossings remain permitted at free points, never through nodes or labels. Two edges never share a collinear segment: they take distinct ports and lanes
8pixels apart, and an edge that cannot get a lane is a routing failure under the no-path rule. searchBoundline 27 ·specs/consumers/spec-studio.diagram-kinds.edge-routing.sdp.md:27- The build chooses a finite deterministic search budget and tests its routing-failure explanation; tuning the search changes no graph meaning. The shared box and edge bound applies first.
overflowline 28 ·specs/consumers/spec-studio.diagram-kinds.edge-routing.sdp.md:28- Routing gutters may increase SVG width beyond the box layout budget to preserve distinct lanes; the desktop scroll instruction follows that final width. No label is shrunk to fit.
routeModelline 29 ·specs/consumers/spec-studio.diagram-kinds.edge-routing.sdp.md:29- Each route retains from, to, kind, claim, optional aggregation count and relation reason, plus its integer point list; ports and routes are presentation values, never graph edges.
elementIdsline 30 ·specs/consumers/spec-studio.diagram-kinds.edge-routing.sdp.md:30- Preserve
.edgedata-from, data-to and data-kind, add data-claim when present and a stable data-edge-key for legend lookup; arrow marker ids remain scoped to subject and view.
Verification
Verifier bindings
- test:protocol.studio-diagram-core · anchored · test anchor binding present ·
test/studio-diagram-core.test.ts:37External run evidence from
test/studio-diagram-core.test.tsTest anchors:
test:protocol.studio-copy-source,test:protocol.studio-diagram-core. Specs verified by those bindings: spec:consumers.spec-studio.diagram-kinds.edge-routing, spec:consumers.spec-studio.diagram-kinds.legibility, spec:consumers.spec-studio.diagram-kinds.mermaid-source, spec:consumers.spec-studio.diagram-kinds.requirement-trace, spec:consumers.spec-studio.diagrams, spec:consumers.spec-studio.page-elements.Run 1: external run evidence from vitest 4.1.10
Build: CI 391 · Branch: cursor/media-plan-and-articles-09b1 · Commit: 076cd4f1f85640d8236e5cca1bffffa68ab79a33 · Start: 2026-10-31T15:32:20.471Z · Stop: 2026-10-31T15:34:02.073Z
Name Suite Result Duration wraps by code point and shortens shared segments without collisions shared diagram core passed 8.85 ms wraps boxes within the width budget and writes an instruction only for final wide drawings shared diagram core passed 3.9 ms routes forward, backward and same-band edges with distinct ports and no shared segments shared diagram core passed 15.19 ms fails closed when routing cannot fit, retaining complete text and no partial source shared diagram core passed 48.26 ms serializes full identities, exact claims, reasons, counts and folds as inert Mermaid data shared diagram core passed 2.03 ms copies the current value of the labelled textarea and selects that same area on clipboard failure not recorded passed 57.44 ms keeps the full box and edge bound routable with obstacles, separate lanes and edge labels not recorded passed 370.5 ms offers deterministic Mermaid source for each existing drawing and pins the safe text syntax not recorded passed 7.07 ms folds reason-bearing trace groups without attributing a member reason to the group not recorded passed 6.45 ms uses the full band budget for a single context and routes adjacent bands inside it not recorded passed 0.58 ms prints exact short relation words and reserves keys for wording that cannot fit not recorded passed 10.14 ms names viewport and instruction ids for trace and secondary views not recorded passed 6.44 ms names the architecture syntax and serializes aliases in displayed box order not recorded passed 0.47 ms routes the current Protocol architecture and recorded adopter architecture with distinct ports and segments not recorded passed 61.67 ms extends overflow rails past earlier labels on the adopter's dense traces not recorded passed 4.04 ms keeps high-degree boxes inside their cells when contexts share a grid not recorded passed 0.78 ms folds nine refining verifiers with their tests within the band budget and keeps every text row not recorded passed 2.44 ms names folded declared refiners by their relation and claim without an internal subtitle not recorded passed 1.61 ms keeps examples apart from refiners when dense requirement groups fold not recorded passed 1.02 ms names refines folds in plain words and preserves direction not recorded passed 1.21 ms names satisfies folds in plain words and preserves direction not recorded passed 2.29 ms names verifies folds in plain words and preserves direction not recorded passed 1.05 ms keeps a short drawing unfolded even with many boxes and incident edges not recorded passed 0.79 ms packs disjoint endpoint intervals into shared horizontal lanes not recorded passed 0.8 ms uses a legend key before spending overflow width on exact words not recorded passed 1.11 ms
Design view
Requirement drawing
- Declared verifying examples: no declared verifying example.
The diagram as text
- spec:consumers.spec-studio.diagram-kinds.edge-routing: Edges route around boxes with deterministic orthogonal paths · declared Spec
- spec:consumers.spec-studio.diagram-kinds: The Studio chooses diagram kinds from graph values · declared Spec
- spec:consumers.spec-studio.diagrams: A diagram is laid out from graph values into SVG with a text equivalent · declared Spec
- impl:protocol.studio-diagram-routing: port, channel and overflow-rail edge routes around boxes and labels · anchored code ·
src/projections/studio/diagrams/routing.ts:38 - impl:protocol.studio-diagrams: deterministic grid and band layouts with bounded folds and full text equivalents · anchored code ·
src/projections/studio/diagrams/svg.ts:73 - test:protocol.studio-diagram-core: test:protocol.studio-diagram-core · anchored test binding · binding present ·
test/studio-diagram-core.test.ts:37 - spec:consumers.spec-studio.diagram-kinds.edge-routing refines spec:consumers.spec-studio.diagram-kinds · declared — arrows that cover no label serve the readable drawings the diagram kinds state
- spec:consumers.spec-studio.diagram-kinds.edge-routing refines spec:consumers.spec-studio.diagrams · declared
- impl:protocol.studio-diagram-routing satisfies spec:consumers.spec-studio.diagram-kinds.edge-routing · anchored
- impl:protocol.studio-diagrams satisfies spec:consumers.spec-studio.diagram-kinds.edge-routing · anchored
- test:protocol.studio-diagram-core verifies spec:consumers.spec-studio.diagram-kinds.edge-routing · anchored
Mermaid source
Copyable source; the Studio draws static SVG.
Preferred and chosen syntax: requirementDiagram; exact refines, satisfies and verifies, with claim words in nodes and per-edge comments.
Decisions
No decision record named.
Runtime
component:protocol.projections· read-only output, layout and owned publication ·src/projections/design-review.ts:29· layer edge · context protocol Uses
component:protocol.extract· the carrier and source pipeline ·src/extract/index.ts:192· layer application · context protocol component:protocol.graph· the one graph and its semantic decisions ·src/graph/schema.ts:34· layer domain · context protocol component:protocol.model· the authored contracts and stable ids ·src/model/anchors.ts:100· layer domain · context protocol component:protocol.notation· the leaf step codec ·src/notation/slots.ts:261· layer domain · context protocol component:protocol.reader· the typed graph contract and body evaluator ·src/reader/reader.ts:671· layer application · context protocol component:protocol.validate· one finding currency and ordered checks ·src/validate/validators.ts:72· layer domain · context protocol
impl:protocol.studio-diagram-routing· port, channel and overflow-rail edge routes around boxes and labels ·src/projections/studio/diagrams/routing.ts:38Component:
component:protocol.projections· read-only output, layout and owned publication ·src/projections/design-review.ts:29· layer edge · context protocol Uses
None.
impl:protocol.studio-diagrams· deterministic grid and band layouts with bounded folds and full text equivalents ·src/projections/studio/diagrams/svg.ts:73Component:
component:protocol.projections· read-only output, layout and owned publication ·src/projections/design-review.ts:29· layer edge · context protocol Uses
impl:protocol.studio-diagram-model· shared diagram boxes, edges and drawing bounds ·src/projections/studio/diagrams/model.ts:1
Runtime observation: not tracked.
Evidence
Runtime observation: not tracked.
Build attestations: not tracked.
Deployments: not tracked.
Bills of materials: not tracked.
Impact
Arrows: refines (declared).
The diagram as text
- spec:consumers.spec-studio.diagram-kinds: The Studio chooses diagram kinds from graph values
- spec:consumers.spec-studio.diagram-kinds.edge-routing: Edges route around boxes with deterministic orthogonal paths
- spec:consumers.spec-studio.diagrams: A diagram is laid out from graph values into SVG with a text equivalent
- spec:consumers.spec-studio.diagram-kinds.edge-routing refines spec:consumers.spec-studio.diagram-kinds · declared — arrows that cover no label serve the readable drawings the diagram kinds state
- spec:consumers.spec-studio.diagram-kinds.edge-routing refines spec:consumers.spec-studio.diagrams · declared
Mermaid source
Copyable source; the Studio draws static SVG.
Preferred syntax: flowchart. Chosen syntax: labelled flowchart, preserving exact relations, claims and folds.
Rests on
- refines · spec:consumers.spec-studio.diagram-kinds · stated ready, floor ready
- refines · spec:consumers.spec-studio.diagrams · stated ready, floor ready
Rested on by
No Spec rests on this Spec.
Relations
| Relation and direction | Other end | Claim | Reason | Exercised keys |
|---|---|---|---|---|
| refines · outgoing | The Studio chooses diagram kinds from graph valuesspec:consumers.spec-studio.diagram-kinds · resolves | declared | arrows that cover no label serve the readable drawings the diagram kinds state | None |
| refines · outgoing | A diagram is laid out from graph values into SVG with a text equivalentspec:consumers.spec-studio.diagrams · resolves | declared | None | None |
Bindings
Implementation binding: present
impl:protocol.studio-diagram-routing· port, channel and overflow-rail edge routes around boxes and labels ·src/projections/studio/diagrams/routing.ts:38· role projection · component component:protocol.projections· layer edge · context protocolimpl:protocol.studio-diagrams· deterministic grid and band layouts with bounded folds and full text equivalents ·src/projections/studio/diagrams/svg.ts:73· role projection · component component:protocol.projections· layer edge · context protocol
Design reference: none
Verifier binding: present
- test:protocol.studio-diagram-core · anchored ·
test/studio-diagram-core.test.ts:37· test anchor
Expected-outcome oracle: none
Runtime observation: not tracked.
Run results: not recorded in the graph.
Findings
None.
Composing (0)
Composing needs the script.