Repository navigation
fix(regenerate): stop counting on the per-topic graph pages too - #30
Merged
Merged
Conversation
#26 said it dropped "the three counts that reach committed output". There were four. renderTopicMarkdown() still wrote "N ADRs in this topic" into every docs/adr/graph/<topic>.md, and regenerate commits those, so they drift the same way: two branches regenerating against different bases each write a locally correct number and the merge keeps whichever landed last. karasu already hit it — its PR #2406 conflicted on graph/build.md with 71 / 70 / 72, the #26 scenario verbatim, after 0.0.11. Fifteen committed files there still carried a count. `adr visualize` keeps its count, unchanged: that output is a stdout query result, not a versioned file. The tests missed it because they pinned absence file by file, for the two files someone thought of. Replaced with a sweep over everything buildGeneratedFiles returns, so a new output is covered by default rather than by remembering, with a length guard so the sweep cannot pass vacuously. Closes #29 Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
This was referenced Aug 9, 2026
Merged
kompiro
added a commit
to kompiro/karasu
that referenced
this pull request
Aug 9, 2026
…#2416) 0.0.11 removed the ADR counts from effective.md and graph.md but left renderTopicMarkdown() writing "N ADRs in this topic" into all 15 committed docs/adr/graph/*.md pages, so those kept drifting between parallel branches. PR #2406 hit it: graph/build.md conflicted with 71 / 70 / 72. adr-tools 0.0.12 (kompiro/adr-tools#30) drops that fourth count and replaces the two named-file assertions with a sweep over every generated file, so a future output is covered without anyone remembering to list it. The lock diff is large but nothing moved version. Comparing name@version across the lock with peer suffixes stripped, the only resolution changes are adr-tools 0.0.11 -> 0.0.12 and the drop of @babel/helper-validator-identifier and @types/estree, which nothing needs any more. The remaining ~550 lines are pnpm re-keying peer suffixes; a fresh install on main is a no-op, so this is the graph change re-keying, not pre-existing drift. Refs #2407 Co-authored-by: Claude Opus 5 (1M context) <[email protected]>
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.
Purpose
Closes #29
Summary
#26 said it dropped "the three counts that reach committed output". There were four.
renderTopicMarkdown()still writesN ADRs in this topicinto everydocs/adr/graph/<topic>.md, andregeneratecommits those files, so they drift exactly as #26 describes: two branches regenerating against different bases each write a locally correct number, and the merge keeps whichever landed last without conflicting on the header.adr visualizekeeps its count, unchanged — that output is a stdout query result, not a versioned file, which is the distinction #26 drew.It already reproduced
karasu PR #2406 conflicted on
docs/adr/graph/build.mdwith71 / 70 / 72 ADRs in this topic, under 0.0.11. Fifteen committed files in that repo still carry a count.Changes
src/visualizer.ts—renderTopicMarkdown()drops the count; the sentence still reads "Solid nodes belong to<topic>; gray dashed nodes are ghosts ..."test/regenerator.test.ts— new sweep over every filebuildGeneratedFilesreturns, rejecting/\d+ ADRs/, with a length guard so it cannot pass vacuouslytest/visualizer.test.ts— therenderTopicMarkdownunit test pins absence instead of asserting3 ADRsWhy the sweep rather than a fourth named assertion
The bug is not that one file was forgotten; it is that the assertions were per-file, so coverage depended on someone listing the outputs. #26 added the right shape of test (pin absence, not wording) with the wrong scope. A sweep makes any output added later covered by default.
Verification
pnpm test143 passed / 9 files,typecheck0 errors,lint0 warnings,format:checkclean,buildOK.Confirmed the new sweep fails on the pre-fix code — reverting the visualizer change makes it report both per-topic pages the fixture produces:
Note on versioning
No
versionbump here, following the 0.0.11 convention (a separatechore(release):PR) — see #28, still open.