Skip to content

Diagrams: architecture, flowchart, data flow, sequence and schema (DECISIONS 281, 282) - #122

Merged
bmjcoding merged 5 commits into
mainfrom
claude/diagrams
Nov 23, 2026
Merged

bmjcoding merged 5 commits into
mainfrom
claude/diagrams

Conversation

@bmjcoding

Copy link
Copy Markdown
Owner

Five diagram types for Basalt: architecture, flowchart, data flow, sequence and database schema. Each ships as a React component (ArchitectureDiagram, FlowchartDiagram, DataFlowDiagram, SequenceDiagram, SchemaDiagram) on one shared engine, and as the HTML skill's diagram module. Also in this PR: the diagram tokens, a "Diagrams" section in docs/foundations.md, the matching AGENTS.md rule and review round 64. The examples are CIMIP's own flows, drawn from its docs and schema.

Who decided what

  • The owner asked for diagrams adapted from the diagram-design reference to Basalt's primitives. He chose these five types for CIMIP's real flows and confirmed the lead's prototype: "yeah these are pretty solid apart from the little issues with the text overlapping... but yeah send these to the council, great first run." This was a handoff (DECISIONS 281).
  • The council (a heavy round):
    • Grok scouted.
    • Neon drafted (Draft A).
    • Astra checked Draft A (6/10, 8 blocking).
    • Fable decided (DECISIONS 282). It adopted Draft A and accepted every finding.
    • Neon and Astra both objected, three objections each. Fable measured all six, revised the decision on every one and held none, so nothing went to the owner.
  • Muse sat out on a usage limit. Its draft landed after the decision and is kept unused; its alternative ideas are in the backlog.
  • Opus built it, then fixed two review rounds.
  • The owner removed the GPT seat from this topic after Astra's first code review: "lets just use fable neon and opus here. get gpt out of here." (DECISIONS 284). Neon took over the code review.
  • Reference values: diagram-design (MIT) supplied the types and ideas. None of its colours, sizes or CSS are used.

What the decision holds

  • One grammar for all five types:
    • monochrome;
    • one focal node in inverted ink;
    • three kinds of line, named by look in the key (main 2px, plain 1px, dashed);
    • 12px text throughout;
    • a 3:1 outline on every flowchart shape.
  • A fit rule: a diagram is drawn as boxes and lines only when every column and every label fits cleanly. Otherwise it stacks into a column at most 480 wide. The CIMIP examples first draw at these figure widths: architecture 784, flowchart 960, data flow 1,080, sequence 807 and schema 1,056.
  • Derived routes: authors place nodes and the lines route themselves. Crossings are cut, each key in the schema gets one shared bus line, and no label sits on a line's end or a node.
  • Before script: the words are in the HTML. With scripting off, the list is open.
  • Accessibility:
    • a summary and "View as list" built from the same data;
    • one tab stop per diagram with arrow keys inside it;
    • forced colours and more contrast handled.
  • Left out of this build: tap-to-trace on touch and the draw-in animation. These and the other later items are in the backlog.

Review

Seat Score
Astra (check of Draft A) 6/10
Astra (code, first build) 5/10, 10 blocking, fixed in fix round 1 (8c9233c9)
Neon (code, after fix 1) 6/10, 9 blocking, fixed in fix round 2 (e1a35bce)
Fable (pixels, after fix 1) 8/10, 3 blocking, fixed in fix round 2; it also decided the builder's nine open questions

Fix round 2 was not re-reviewed by any seat. It was the last round, at the owner's request ("too much waiting"). The lead checked that lint, both typechecks and the build pass, rebuilt round 64's 122 screenshots, and looked at them in both themes at 1440 and 390.

Fable's answers that are built here:

  • the schema key adds "Primary key" and "Foreign key";
  • Mono details break only at spaces;
  • three wording changes in the keys;
  • the sequence's phase headings sit one level under "Messages".

Not fixed:

  • one-column schemas never draw (Neon 12);
  • a slot overlap in an edge case (Neon 13);
  • production builds keep the dev-time checks (Neon 14);
  • labels on 1px lines sit on half pixels (Fable P3).

Tests

The tests are written but have not run. The owner paused tests (DECISIONS 271), then skipped test work for this build. Some are already stale:

  • diagrams.test.mjs:371 expects the old "The one transaction" wording;
  • the schema list now uses headings, and the phase heading level changed;
  • the first build's own tests contradict themselves (the basalt-diagram- substring);
  • the geometry loop leaves light and the crossing list unchecked.

These are in the backlog for the full run on main.

Sizes

  • styles.css grows about 9.4% minified.
  • Each diagram component is about 61 KB on its own, because every component bundles the shared engine.
  • The skill's index cap goes from 12,400 to 12,550 (the diagram line).
  • The diagram module's cap is 87,200; it measures 87,158.
  • One token beyond the decision, diagram-focal-rule-contrast, was confirmed by the decider.

Merging main

Main was merged in once. Review round 56 was taken on main, so this is round 64. DECISIONS 269 and 270 were also taken on main, so the diagrams cite 281 and 282.

The walkthrough is built with npm run review -- 64.

Final positions, as written

Neon (drafter): object

object

I agree with the overall direction — the measured fit rule, derived ports/routes/groups/foreign keys, the 3:1 flowchart contour, shared buses and computed crossing cuts, ink-only tracing without tap-to-trace, static HTML before script, keeping diagram-structure and diagram-edge-dim on border-input under more contrast, and CanvasText/Canvas for the focal node in forced colours all improve on Draft A. Three concrete defects in the spec would break the build or its own examples and need fixing before implementation:

  1. Sections 1.8 and 1.11 (edge-label seating rejects two CIMIP examples at every width). Measured in Chromium on Geist Mono text-xs, "trim" is 28.8px bare (36.8px plated), "responder" is 64.8px (72.8px plated), and "observer" is 57.6px (65.6px plated). Under 1.8, an above/below label sits space-1-5 (6px) from the line; growing its box by space-1 (4px) reaches 2px from the line, which overlaps an 8 × 8 size-diagram-head arrowhead (±4px) vertically by 2px. Combined with centering on the full node-to-node run and box-based node hit-testing, Data flow trim in its fixed space-12 (48px) gap and Flowchart responder and observer in their fixed space-16 (64px) gap each get 0 of 6 clean seats at every width (including 1,440px). By 1.8 ("No seat, no drawn layout"), neither example can ever enter the drawn layout, contradicting 1.11 ("On the 1,104px page row at 1440 all five are drawn").

    • Instead: seat above/below horizontal labels space-2 (8px) clear of the line (so the space-1-grown box clears the ±4px head vertically), compute middle/thirds along the clear shaft (excluding the 8px head), and test node collisions against each node's drawn contour (diamond polygon / capsule curve, matching 1.5) rather than its bounding box. With those three rules, "trim" seats cleanly at cx = 28 ([9.6, 46.4] in [0, 48]), and "responder" and "observer" seat cleanly from Flowchart's 880px minimum through 1,440px.
  2. Section 1.17 (forced colours erases the focal node's text in Chromium). Section 1.17 applies forced-color-adjust: none only to the SVG and swatches ("Nodes are HTML and take theirs from the system") while styling the focal node CanvasText with Canvas ink. In Chromium under forcedColors: "active", an HTML element whose background differs from Canvas without forced-color-adjust: none receives a solid Canvas backplate behind its text — painting Canvas text onto a Canvas backplate. Verified by pixel inspection: all 1,624 pixels in the focal text box render solid (0, 0, 0) in forced-dark and (255, 255, 255) in forced-light (1.00:1, completely invisible), the same backplate issue docs/foundations.md (§Lines, states and actions) solves with forced-color-adjust: none on lit rows.

    • Instead: keep the CanvasText/Canvas inversion, and explicitly set forced-color-adjust: none on the focal HTML node (including the focal schema table and stacked sequence focal chip), with the focal table's diagram-focal-rule set to Canvas and its outer edge to CanvasText under @media (forced-colors: active).
  3. Sections 1.11, 1.12 and 1.13 (the 640px stack cap distorts stacked diamonds to 10:1 and over-stretches intermediate stacks). Because the fit rule keeps Flowchart stacked up to 879px and Data flow stacked up to 1,079px, the 640px cap (size-breakpoint-container-lg) now governs a wide band of tablet and split-screen widths. Even at 607px (decision/proof/flow-stack-639.png), "Who is deciding?" and "First decision?" flatten to 607×64 slivers (at 640px, 640×64 — 10:1), where the diamond is only 2.4px thick at the x = 12px rail — barely thicker than the 2px rail itself — and stacked cards stretch across empty space far from their end-lane bypasses.

    • Instead: cap the stacked drawing at size-breakpoint-container (480px) (existing token; all CIMIP stacked cards fit with room to spare) and floor a stacked diamond's height at max(space-16, width / 5) (72px at 390, 96px at 480) so it stays a recognizable diamond with a clean shoulder for the rail and trunk.

Two small non-blocking cleanups worth folding in at the same time: in 1.13's stacked-route table, Row 1 ("both on the spine or both branches") omits branch → next spine (which derive-check.mjs routes straight down — "The next card, except spine → branch" fixes it); and in Section 7, the 390 ↔ 900 focus-survival test leaves Flowchart (880), Data flow (1,080) and Schema (1,060) stacked at a 900px viewport (852px figure) while Sequence/Schema drop roving stops when stacked — test 390 ↔ 1440 for layout switches and specify moving focus to the disclosure toggle if a focused Sequence/Schema node narrows into its stop-free stack.

Astra (checker): object

object

  • §1.13. With three full-width spine cards A, B and C, a connector from A to C runs 10px inside B’s edge and passes through B. The proof’s bypasses pass indented branches. Reserve a gutter outside the cards whenever a connector must pass a spine card, and test A → C in both directions.
  • §§1.11 and 1.19. At 640px the initial CSS puts the data flow on its five-column grid before script measures it. That leaves 56px per card where the decision requires 144px. Show the stack until the grid can fit, and check the server-rendered figure at 640px with hydration delayed.
  • §§1.17 and 7. The forced-colours test measures every word against Canvas. Focal words use Canvas ink, so that comparison always gives 1:1. Measure those words against their painted CanvasText fill at 4.5:1, and measure the fill against the surrounding Canvas at 3:1.

Fable revised the decision on all six objections (answers.md in the council folder).

🤖 Generated with Claude Code

bmjcoding and others added 5 commits November 22, 2026 18:56
…CISIONS 269 and 270)

Five React components on one engine (diagram-core.ts, no React inside it), the HTML skill's diagram module,
the diagram tokens, foundations' Diagrams section and the AGENTS.md rules, and review round 56. Built by Opus
from Fable's decision. Tests written, not run (DECISIONS 271).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Conflicts: review round 56 was taken on main, so the diagrams round is 64; the contrast tests keep both
blocks; the size table, the skill parts and the manifest are regenerated. DECISIONS 269 and 270 are main's
own numbers now, so the diagrams cite 281 and 282. The skill index's budget is 12,550 (the diagram line
on top of main's 12,398). The skill's usage example names an "api service", not CIMIP's.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- A composed figure keeps its stop and its list: the attribute updater pairs
  each tree element with the next DOM element of its tag and class, so the
  JSON script is passed over.
- The author's data is checked at the model's boundary: text is made a
  string; the heading, a line's kind, a side and a key take one of their
  values or the default, with a warning; a track is a whole number. Element
  and attribute names are checked, and every value in the ink is escaped.
- React: a caller's ref is set beside the figure's own; on the root only the
  state's attributes are written, so a caller's hidden and ARIA stay.
- The stack's end lanes are allocated across each overlapping set; a third
  lane is reported. Two stems between one pair take the quarter points, in
  the stack and in the drawn layout. A stem's label tries the middle and
  then the thirds. A stack that still overlaps draws no lines.
- A route that would leave the drawing fails the fit.
- A decision's words wrap at 62% of the track (the border-box). A sequence's
  least width uses its measured participants.
- A measured decision never shows its box's border, traced or in forced
  colours.
- The composer finds figures with its own tag reader in the held body, so
  examples in a textarea, comment or script are left alone and an unquoted
  class works.
- Polish: the roving stop moves by two attributes in the skill; the plan,
  sentences, key and list are worked out once per model; a gutter is scored
  by its own lines; development checks are off in a React production build.
  A second Basalt.diagram call rewrites the markup. The list carries every
  kind's word and the sequence's bands as sub-headings. The usage example
  defines both ends.
- The diagram module's cap goes from 82,300 to 87,200 bytes (87,119 now).

The test files are unchanged in this commit (the owner skipped them for
now). Nothing here has been run in a browser.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…d 282)

Neon's code review and Fable's pixel review of 8c9233c, and the decider's
answers to the builder's questions.

- No-script list in the HTML skill: the open rule is important, so the
  core's [hidden] rule no longer closes it.
- A stack that still overlaps draws no lines and is dressed as the
  no-script form: no line in the key, no key hint, no stops, the list
  open ("Hide the list"); it closes again when lines return, unless the
  reader opened it. Fixed seats (rail, trunk, end lines) take a line of
  their own as the gap grows, and a group's first member's grown gap is
  the group's margin, so Neon's wiped cases draw.
- Labels are seated against each run's place before the half-pixel
  snap: the CIMIP flowchart is stacked to 959 and drawn at every whole
  width from 960 to 1104.
- .basalt-diagram[hidden] hides; the list's code has no box in the skill.
- Opposite end lines from one card leave up first; the end gutter is
  measured from the drawing's end, not a group's inside; turn-backs share
  a gutter's lanes with its jogs, dropped foreign keys take no lane, and
  a lane order that lays one run on another scores worst.
- A labelled line in a 40px first or last row gets space-3 above and
  below when that is all it needs, so a one-row diagram can draw.
- The React figure installs the hardware-key listener for its hint.
- Decider's answers: Mono details break only at spaces; the schema key
  starts with "Primary key" and "Foreign key"; the copy changes; phase
  sub-headings one level under "Messages".
- Polish: notes keep their case, schema table names are sub-headings,
  id-keyed records have no prototype, a zero-width figure waits to be
  shown, the walkthrough says its shots are labelled by the window.
- The skill module stays under its 87,200 cap (87,158): the before-script
  rules use :is(), and the skill build writes the core's type roles and
  shorter private property names.

Tests were not run or edited (the owner paused them).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@bmjcoding
bmjcoding marked this pull request as ready for review November 23, 2026 02:32
@bmjcoding
bmjcoding merged commit cf46912 into main Nov 23, 2026
1 of 2 checks passed
@bmjcoding
bmjcoding deleted the claude/diagrams branch November 23, 2026 02:32
bmjcoding added a commit that referenced this pull request Nov 23, 2026
…wn clock

The owner lifted the test skip for diagrams. Each file run by name, alone:
React diagrams 44/44, diagram-motion 65/65, bundle 103/103; the skill's diagrams 15/15, diagram-motion 11/11, compose 112/112;
the six token files 243/243; the packed consumer passes.

Code:
- An entrance drawn again while its animations are paused (seeked, or posed) is rebuilt paused at the same moment, and "whole" is read
  on its own clock, not the page's (Neon's finding 8.2: a seeked figure narrowed restarted its lines).
- The skill writes a one-form mark's image once (no --_md copy); the focal card's dark form falls back to the light one. No pixel change.

Tests:
- #122's half-finished patch applied where it still fit; its crossing fixture crosses once, not twice, so it says so. Two harness fixes:
  a pixel read scrolls its element into view; a line count leaves out the key's swatches.
- Motion: the uncomposed skill page composed; the seek-and-narrow test reads the clock that paused animations keep; the print test
  really stops script (the painted page reopened with script off); the hydration test really server-renders and hydrates; the
  frames test checks every word at 4.5:1; the narrow test starts a run and checks it stays on its message; development errors run
  in a development build; the mark pixel test frames the owner's file in the same SVG (it caught a shifted box and a colour change).
- Added: all 17 motion tokens, the mark-words warning, a 40-message sequence, traced ink and the pause before loops resume, the run's
  dot in forced colours, and each print's mark form by its ground.

Budgets: diagram 91000 to 91250 and diagram-motion 26200 to 26850. Fix round 1 had already taken them over (91205, 26621, unrun);
this round added 1 and 180 bytes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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