Repository navigation
docs(website): draw the traits diagram - #52
Merged
Merged
Conversation
The trait vocabulary of METAMODEL.md §3 as one SVG, in the style of the Specy metamodel diagrams: the entity in the middle, the seven families around it, one box per trait with the attributes it contributes, a dashed box for a marker, red dots on the TNamed + TStructural + TInvocable composition. - website/scripts/traits-diagram.mjs generates website/assets/diagrams/traits-metamodel.svg (committed). Labels carry textLength measured from static/fonts/*.ttf, so the file still fits its boxes as an <img> on GitHub, where no webfont loads. - The metamodel-diagram shortcode inlines it on the traits page: every box and family frame links to its section, with hover and focus states in the SVG's own stylesheet. assets/css/custom.css styles the card. - traits-diagram.test.mjs pins the drawing to schemas/ (the trait names and the entity record's keys), to its generator, and to the headings it links to. The website package's test script runs it, as does the website workflow. - METAMODEL.md §3 shows the same file as its image. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01PKCVh1MUps9E7nFWjgQgpW
Deploying with
|
| Status | Name | Latest Commit | Preview URL | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! View logs |
codegraph | 98e6299 | Commit Preview URL Branch Preview URL |
Nov 23 2026, 10:48 AM |
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.
The trait vocabulary of
METAMODEL.md§3, drawn as one SVG in the style of the Specy metamodel diagrams, and shown on Reference › Metamodel › Traits.0..nper family, dashed boxes are marker traits, and red dots mark theTNamed + TStructural + TInvocablecomposition.metamodel-diagramshortcode inlines the SVG. Every box and family frame links to its section, and the SVG's own stylesheet supplies the hover and keyboard-focus states (an<img>would lose both). Only the frames are tab stops, so 11 stops instead of 30.website/scripts/traits-diagram.mjswriteswebsite/assets/diagrams/traits-metamodel.svg. Labels carrytextLengthmeasured fromstatic/fonts/*.ttf, so the same file still fits its boxes as the<img>inMETAMODEL.mdon GitHub, where no webfont loads.website/scripts/traits-diagram.test.mjsfails when the SVG is not the generator's output, when the boxes stop matchingschemas/(trait names and the entity record's keys), or when a box links to a heading that no longer exists. The website package'stestscript, previouslytrue, runs it, and so does the website workflow.Verification
node --test website/scripts/traits-diagram.test.mjs: 5/5 on this base (after feat: add codegraph walk (M21) #50 and feat: add the Python extractor (M22) #51). A deliberately stale SVG, a renamed heading and an extra trait in the contract each make it fail.hugo --minify --gcbuilds, and the page carries 21 box links and 7 family links.<img>with fallback fonts renders.Not exercised: GitHub's own rendering of
METAMODEL.md, and CI's Hugo 0.165 (I built locally with 0.170.1).🤖 Generated with Claude Code
https://claude.ai/code/session_01PKCVh1MUps9E7nFWjgQgpW