Add generated figures and diagrams to the README - #4
Conversation
…plainer explainer/build.py now writes six standalone SVG figures under explainer/figures/: the T1 and T4 full-chain rows side by side, and each scenario across its three safeguard arms, in a light and a dark variant. They are drawn by the same gate-chain code as the explainer page, which was split into a view derivation and a drawing step so a one-step T1 leg and a three-step T4 leg render through one path. Every value in them is read from the committed artifacts; nothing is hand-typed. build() returns the figures beside the two page wrappers, so main() writes them and --check compares them byte for byte, and the Pages workflow now refuses to deploy if a figure has drifted. Its operator hint names the figures directory. The figures carry an inline stylesheet, system font stacks and no external references, so GitHub can render them, and labels that sit on a gate bar are painted with a background halo. Two tests are added: each figure states the outcomes and side-effect counts of the rows it draws, read independently from the artifacts, and no figure carries a script, a link, or an external URL. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
The README opens with badges and a links line, then leads the finding with the generated T1 versus T4 figure, and embeds each scenario's three-arm figure after its paragraph, using picture elements so GitHub serves the dark variant under its dark theme. A new section, "How the experiment works", carries two Mermaid diagrams: the gate chain from the frozen contract to the checkers, and the capture-and-replay path that makes the three arms comparable. Every number, link target and fenced block from the previous revision is unchanged; the numeric claims were compared as a multiset before and after. tests/test_readme_figures.py pins that every relative image path in the README resolves to a file, that each picture element pairs a light file with its -dark variant, and that each Mermaid fence names a diagram type. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars. ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Team Run ID: Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
🟢 Approval recommended
The changes are internally consistent and are guarded by targeted tests plus a Pages deploy gate that drift-checks the newly generated README figures against committed artifacts.
Pull request overview
This PR updates the project’s top-level README to embed generated, artifact-derived visuals (SVG figures + Mermaid diagrams) that summarize key experimental results and the safeguard-chain mechanics, and extends the explainer build/test pipeline so those visuals are reproducible, paired (light/dark), and drift-checked in CI/Pages.
Changes:
- Add three generated SVG figures (each with light/dark variants) and two Mermaid diagrams to
README.md. - Extend
explainer/build.pyto generate the README figures using the same gate-chain renderer as the explainer page, and emit them as build outputs. - Add tests that validate README image/diagram integrity and pin the generated figures’ content and “no external fetches” invariants to committed artifacts.
File summaries
| File | Description |
|---|---|
tests/test_readme_figures.py |
New tests to ensure README image paths resolve, <picture> blocks are correctly paired, and Mermaid fences are non-empty/typed. |
tests/test_explainer_is_derived_from_artifacts.py |
Extends explainer drift/idempotency checks to include README figures; adds SVG-content invariants. |
README.md |
Embeds generated SVG figures (light/dark via <picture>) and adds Mermaid diagrams explaining the chain and replay model. |
explainer/build.py |
Generates six README SVGs (3 figures × light/dark) via shared chain renderer; adds overt-steps to derived arm records; writes nested outputs safely. |
explainer/figures/finding-t1-vs-t4.svg |
New generated README hero figure (light). |
explainer/figures/finding-t1-vs-t4-dark.svg |
New generated README hero figure (dark). |
explainer/figures/t1-three-arms.svg |
New generated README T1 three-arm figure (light). |
explainer/figures/t1-three-arms-dark.svg |
New generated README T1 three-arm figure (dark). |
explainer/figures/t4-three-arms.svg |
New generated README T4 three-arm figure (light). |
explainer/figures/t4-three-arms-dark.svg |
New generated README T4 three-arm figure (dark). |
.github/workflows/pages.yml |
Updates the --check gate messaging to include figures and documents why figures are verified but not published to Pages. |
Review details
- Files reviewed: 5/11 changed files
- Comments generated: 0
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
The README opens with badges and a links line, leads the finding with a generated figure of the T1 and T4 full-chain rows side by side, and shows each scenario across its three safeguard arms. A new section carries two Mermaid diagrams: the gate chain from the frozen contract to the checkers, and the capture-and-replay path.
The figures are SVGs written by
explainer/build.pyfrom the committed artifacts, drawn by the same gate-chain code as the explainer page, with light and dark variants served through picture elements.build.py --checkcovers them, so the Pages workflow refuses to deploy if a figure drifts, and two new tests pin each figure's outcomes and side-effect counts to the artifacts. Every number and link in the README is unchanged frommain.Verification on this branch:
build.py --checkclean, explainer and README tests green,ruff checkclean.explainer/index.htmlis byte-identical tomain, so merging does not change the hosted page.🤖 Generated with Claude Code