Compile Mermaid with mermaid-cli (drop the hand-rolled checker); make Python 3.14 required#8
Merged
Conversation
Replace the hand-written scripts/validate_mermaid.py structural checker with scripts/check_mermaid.py, which shells out to the real Mermaid compiler (@mermaid-js/mermaid-cli / mmdc): a diagram passes only if it actually renders. It is wired as the `mermaid-compile` pre-commit hook (self-bootstraps mmdc via npx locally) and, because it needs Node + a headless browser, as a dedicated CI `mermaid` job — the lint job SKIPs it. Python 3.14 is now a required test-matrix version (dropped the experimental / continue-on-error / allow-prereleases machinery); it has passed every CI run. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Fd4FtxJFV2fVSSoD7urqqn
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #8 +/- ##
=======================================
Coverage 99.14% 99.14%
=======================================
Files 17 17
Lines 1756 1756
=======================================
Hits 1741 1741
Misses 15 15 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
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.
Mermaid: real compiler instead of a re-implementation
Replaces the hand-written
scripts/validate_mermaid.py(structural checks) withscripts/check_mermaid.py, which shells out to the real Mermaid compiler —@mermaid-js/mermaid-cli(mmdc). A diagram passes only if it actually renders, so it catches real syntax errors a structural check can't.mmdcis located via$MMDC→PATH→npx --yes @mermaid-js/mermaid-cli@11; Puppeteer runs headless with--no-sandbox, honoring$PUPPETEER_EXECUTABLE_PATH.mermaid-compilepre-commit hook (self-bootstrapsmmdcvianpxlocally).mermaidjob; the lint jobSKIPs it (stays lightweight).mmdccan't run (never skips silently); ignores Markdown without a mermaid block.Python 3.14 now required
Dropped the
experimental/continue-on-error/allow-prereleasesmachinery — 3.14 is a plain required matrix entry (["3.11", "3.12", "3.13", "3.14"]). It has passed every CI run since it was added.Verified locally
mmdccompiles all four repo diagrams (README + phase3 + phase4 + Brier); a deliberately broken block exits non-zero.mermaid-compilehook passes via pre-commit; the other hooks pass with it skipped (mirroring the lint job).CI now has four jobs: lint, egress-isolation, mermaid, and test (3.11–3.14).
🤖 Generated with Claude Code
https://claude.ai/code/session_01Fd4FtxJFV2fVSSoD7urqqn
Generated by Claude Code