Skip to content

README: draw the specification diagram, not only the two-strategy diff - #20

Merged
borisdev merged 1 commit into
mainfrom
readme-diagram-companion
Oct 7, 2026
Merged

borisdev merged 1 commit into
mainfrom
readme-diagram-companion

Conversation

@borisdev

@borisdev borisdev commented Oct 6, 2026

Copy link
Copy Markdown
Owner

The README's pitch is you see the design before the code exists. The only mermaid block it drew was diff_diagram() — two implementations already bound. The picture with nothing implemented was described in prose and never shown, so the before/after that makes the claim visual was missing its "before".

This adds the plain diagram() block, generated, directly above the diff block — same graph, bare boxes.

The check that should have caught it

test_the_readme_mermaid_block_is_the_diagram_the_code_emits asserted one block by name, at a time when the README contained exactly one. That is this repo's recurring defect — a check narrower than its claim — and here it was blind in a way worth naming: a one-directional check cannot see a missing picture, because every block that is present passes.

Replaced with a set match over every mermaid block in every markdown file, both directions:

  • a block in the docs that no generator emits → fail
  • a generator registered in _drawn() with no block in the docs → fail

Both verified to go red (renamed a node in the README; deleted the new block).

Notes

  • Also fixed the quickstart line "the comparison above", now that both blocks are above. Confirmed against real output that examples.greeting prints them in the order the README shows.
  • 282 tests green locally — ⛔ no CI in this repo, so that is one local run.

The before/after is the pitch — the same graph with nothing implemented, then with
two implementations bound — and only the second half was ever drawn. `diagram()`
was described in prose and never shown.

The check that should have caught this could not. `test_the_readme_mermaid_block_is_
the_diagram_the_code_emits` asserted ONE block by name, at a time when the README
had exactly one: a check narrower than its claim, and blind to a missing picture
because the blocks that are present all pass. Replaced with a set match over every
mermaid block in every markdown file, in both directions — a block with no generator
fails, and a registered generator with no block fails too. Verified both go red.

282 tests green locally. No CI in this repo, so that is one local run.
Copilot AI balanced review requested due to automatic review settings October 6, 2026 21:24

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🟢 Approval recommended

The documentation matches generator output, and the tests cover both stale and missing diagrams.

Review effort: Balanced
Findings: None

What changed in this PR

Adds the missing pre-implementation specification diagram and ensures documented Mermaid diagrams match generated output bidirectionally.

Changes:

  • Adds the plain diagram() output before the strategy comparison.
  • Validates every documented Mermaid block against registered generators and vice versa.
  • Clarifies quickstart diagram ordering.
File Description
README.md Adds and explains the specification diagram.
tests/​test_greeting.py Adds bidirectional Mermaid documentation checks.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@borisdev
borisdev merged commit c607211 into main Oct 7, 2026
1 check passed
@borisdev
borisdev deleted the readme-diagram-companion branch October 7, 2026 00:29
@borisdev
borisdev restored the readme-diagram-companion branch October 7, 2026 00:30
@borisdev
borisdev deleted the readme-diagram-companion branch October 7, 2026 00:31
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