Repository navigation
fix(class): set every class label clearly on its own line - #588
Merged
Merged
Conversation
Multiplicities, roles and relationship names now only take a spot that is clearly nearer their own line than any other: every other line stands half again as far off and at least 8 units further. End labels try the end's first run, then the end's half of the line; names try every spot before settling for a merely free one. When a label still finds no such spot, the placements run again keeping room for labels (wider port gaps, boxes growing to hold them, and corridors standing clear of a side-by-side line's labels), and one takes over only if it draws no more crossings, detours or hugging runs and no more findings than the labels it clears. The class fuzz gains a label attribution invariant (96 misattributed labels across the 240-model full run on main, none now), the renderer test checks it on every class fixture, and a new stress fixture and story reproduce the observer pattern's opposing named dependencies. Fixes #585
Contributor
Sketchi Playground / Studio PreviewStatus:
|
Contributor
Sketchi Icons PreviewStatus:
|
Contributor
Sketchi Eval Harness PreviewStatus:
|
Contributor
Sketchi Excalidraw Workspace PreviewStatus:
|
Contributor
Sketchi Web PreviewStatus:
|
This was referenced Oct 31, 2026
anandpant
added a commit
that referenced
this pull request
Oct 31, 2026
Sol's library build lost two of five samples on data accuracy, and three on the class-drawn check, after #588: Member to Reservation runs straight up in one run, the "reservations" role found no spot clearly its own line's at Reservation, and walked down that run until it stood just above Member. A multiplicity or role now only takes a spot beside its own end: its middle within 110 units of the end's tip (the class-drawn check's reach) and the line's other tip half again as far off as its own, and 8 units further. That also keeps a self-loop's labels out from between its two runs. With no spot both beside its end and clearly its own line's, it stays beside its end, and the placements run again keeping room for labels; one that reads at most 5% longer than the placement it replaces may now take over. The class fuzz gains the end invariant: main misplaced 17 end labels across the 240-model full run and 74 across eight more seeds, none now. On those eight seeds, 8 labels whose room would cost crossings now stand at their end but nearer a neighboring line (81 findings on main, 12 now). Across the 100 saved class builds from the evals, three scenes change, each only in that one end's labels, and each now passes the class-drawn check. The renderer test checks every class fixture, and a new fixture and story carry Sol's build. Fixes #589
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.

Fixes #585.
What: In class diagrams, every multiplicity, role and relationship name now sits clearly on its own line. A label only takes a spot where every other line is at least 1.5× as far away as its own line, and at least 8 units further. Rendering only: no API, prompt or token change.
Why: In the real-voice side-by-side on prod fb45399, the judge failed visual clarity on Sol's
observer-pattern-class-v2(2 of 3: "attach / detach" sat between two opposing dependency routes) and Sonnet'slibrary-system-class-v2(1 of 3: a "0..*" sat nearer the neighbouring inheritance line than its own).How:
class-diagram.ts): an end label tries the end's first run (two labels on opposite sides, then together on one side), then the end's half of the line. A name tries all of its spots before settling for one that is merely free.class-layout.ts,labelRoomoption): if a label still finds no such spot, the placements run again with more label room: wider port gaps, boxes that grow to hold them, and corridors kept clear of a side-by-side line's labels. The retry is kept only if it draws no more crossings, detours or hugging runs, and at most one extra routing finding per label it fixes. Models whose labels already read clearly render exactly as before.Proof:
library-modelrole 5 units from a neighbour) and passes here.classStressFixtures.opposingDependenciesand the Class / OpposingDependencies Storybook story reproduce the observer build. The existing LargeModel story was also ambiguous on main and is fixed.pr-588-sketchi-studio): all 24 v2 class builds were accepted, all are attributable, and scenario-CLI grades are identical to the evals'.pnpm ci:localpassed and is signed off. Fulldiagram-excalidraw:class-fuzzpasses. No other fuzz target touches class rendering.Before/after PNGs (
/home/anandpant/Development/shpitdev/sketchi/.memory/renderer-584-585/585/):before-prod/: the judged production PNGs (gh9p, gcax, n7n7)before-main-local/andafter-local/: all 48 class samples rendered locally from the saved specs on main and on this branch, withreport.jsonlattribution reportsafter-preview/: the 24 v2 builds from the PR preview, withpreview-grades.txtandpreview-attribution.txtfuzz/: fuzz models 3 and 75 after the label-room fallback