Skip to content

Project-state housekeeping and diagram-grammar hardening#5

Merged
adewale merged 4 commits into
mainfrom
claude/project-state-improvements-pcftyu
Jun 10, 2026
Merged

Project-state housekeeping and diagram-grammar hardening#5
adewale merged 4 commits into
mainfrom
claude/project-state-improvements-pcftyu

Conversation

@adewale

@adewale adewale commented Jun 10, 2026

Copy link
Copy Markdown
Owner

Housekeeping fixes from a project-state review, plus four structural improvements to the diagram grammar.

Project state fixes

  • README: example count corrected from 104 to the actual 109; test instructions point at make test.
  • Makefile: make test runs through uv run --python 3.13, so it works where the system python3 isn't 3.13 (the example loader executes 3.12+ type statements).
  • Preview workflow: preview-viz.yml only triggered on a long-merged feature branch; replaced with an on-demand Preview workflow taking the preview Worker name as a workflow_dispatch input.
  • Auto-regen on main: GitHub UI merges bypass the local git hooks that keep generated files fresh, so merges could land with stale asset fingerprints and a red Verify run (as happened on May 16). A new workflow reruns make build on push to main and commits regenerated files when they drifted.
  • CHANGELOG: cut the 2026-05-16 release and added the entries that were never logged (journeys, marginalia figure system, quality registries, Turnstile, observability, deployment smoke, custom domain, footer link).

Diagram grammar fixes

  1. Semantic accent census. Emphasis scarcity is now counted by the grammar itself (Canvas.accent_count()) instead of reverse-engineered from SVG output, where an arrow's shaft and a gate line are indistinguishable. Gates collectively count as one accent per figure; a lanes traced path and its terminal dot count as one mark. Two new contract tests enforce the counter and catch primitives that paint EMPHASIS without counting. Closes the blind spot where generator-ribbon shipped 3 uncounted gate lines and control-stop-boundary's gate was invisible to the contract.
  2. Twin layouts are now phrases (two_names_one_object, type_triangle, mono_divider), making coordinate drift between twin figures structurally impossible. Normalizes two live drifts: the aliasing/tuple second-panel tag gap (8px vs 6px) and metaclass-triangle sitting 2px lower with a 10px-wider gap than its class-triangle twin.
  3. Single-sourced text metrics: MONO_ADVANCE (exact, positioning) and BBOX_ADVANCE/text_width (conservative, contracts) live in marginalia_grammar.py; the geometry contracts import them instead of redefining their own.
  4. Accessibility: figure SVGs carry aria-hidden="true" focusable="false", so screen readers get the figcaption (the canonical voice) instead of the SVG's internal text fragments out of context.

117 of 123 figures render with identical geometry; the 6 that changed are the twin normalizations, all by single-digit pixel amounts. HTML_CACHE_VERSION regenerated, so rendered-HTML caches bust on next deploy.

All 90 tests, every geometry contract, ruff, SEO/cache lint, example verification, and the quality gates pass.

https://claude.ai/code/session_012cj8czQW6Cd1Gw2PPgapED


Generated by Claude Code

claude added 4 commits June 9, 2026 22:51
README claimed 104 examples; the catalog has 109. `make test` ran bare
python3, which fails on any system where python3 is not 3.13 (the
example loader executes 3.12+ `type` statements). Route it through
`uv run --python 3.13` and point the README at `make test`.

https://claude.ai/code/session_012cj8czQW6Cd1Gw2PPgapED
preview-viz.yml only triggered on a feature branch that has since
merged. Replace it with an on-demand Preview workflow taking the
preview Worker name as a workflow_dispatch input.

GitHub UI merges bypass the local git hooks that keep generated files
fresh, so merges to main could land with stale asset fingerprints and a
red Verify run. Add a workflow that reruns `make build` on push to main
and commits the regenerated files when they drifted.

https://claude.ai/code/session_012cj8czQW6Cd1Gw2PPgapED
Everything under Unreleased has been deployed to production since
May 16. Date the section and add the entries that were never logged:
journeys, the marginalia figure system and its geometry contracts,
quality registries, Turnstile runner protection, wide-event
observability, deployment smoke, the custom domain, and the footer
repository link.

https://claude.ai/code/session_012cj8czQW6Cd1Gw2PPgapED
1. Emphasis scarcity is now counted semantically by the grammar
   (Canvas.accent_count) instead of reverse-engineered from SVG, where
   an arrow's shaft and a gate line are indistinguishable. Gates
   collectively count as one accent per figure; a lanes traced path
   and its terminal dot count as one mark. Two new contract tests
   enforce the counter and catch primitives that paint EMPHASIS
   without counting. This closes the blind spot where generator-ribbon
   shipped 3 uncounted gate lines and control-stop-boundary's gate was
   invisible to the contract.

2. Twin layouts are now phrases, so coordinate drift is structurally
   impossible: two_names_one_object (aliasing-mutation /
   tuple-no-mutation), type_triangle (class-triangle /
   metaclass-triangle), and mono_divider computes a character
   divider's x from the font advance instead of an eyeballed pixel.
   This normalizes two live drifts: the aliasing/tuple second-panel
   tag gap (8px vs the first panel's 6px) and metaclass-triangle
   sitting 2px lower and 10px wider-gapped than its class-triangle
   twin.

3. Text metrics are single-sourced: MONO_ADVANCE (exact, for
   positioning) and BBOX_ADVANCE/text_width (conservative, for the
   clipping/collision contracts) live in marginalia_grammar.py; the
   geometry contracts import them instead of redefining their own.

4. Figure SVGs now carry aria-hidden/focusable=false so screen
   readers get the figcaption (the canonical voice) instead of the
   SVG's internal text fragments out of context.

117 of 123 figures are geometry-identical; the 6 that changed are the
twin normalizations above. HTML_CACHE_VERSION regenerated.

https://claude.ai/code/session_012cj8czQW6Cd1Gw2PPgapED
@adewale adewale merged commit 3aff70b into main Jun 10, 2026
2 checks passed
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.

2 participants