docs(style): a docstring is not a changelog - #587
Merged
Merged
Conversation
The guide said "`.. versionchanged:: X.Y.Z` when behaviour changes" and offered the parameter-level form only as an alternative. Agents followed it literally: a 2026-06-01 pass backfilled version history into docstrings package-wide, and the API pages now open with a stack of "Changed in version 1.1.0" blocks before the reader learns what the method does. Measured: 242 `versionadded` + 40 `versionchanged` across the package, 11 of them in _cpp.py. `CPP.__init__`'s docstring went 36 -> 102 -> 117 lines across v1.0.3 -> v1.1.0 -> today, and the version stack is part of why. The rule is now: exactly one `versionadded` per public symbol, marking when the symbol appeared; never a `versionchanged` stack at class or method level; a behaviour change is annotated on the parameter that changed, and otherwise lives in CHANGELOG.md and the release notes, which is where a reader looking for history goes. Mirrored into .claude/rules/docstrings.md so it reaches an agent before it writes the docstring, with the numbers, since the previous wording is exactly what produced them. No library code touched; no existing docstring edited here. Co-Authored-By: Claude Fable 5.1 <[email protected]>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #587 +/- ##
=======================================
Coverage 95.39% 95.39%
=======================================
Files 222 222
Lines 23387 23387
Branches 4073 4073
=======================================
Hits 22309 22309
Misses 631 631
Partials 447 447
🚀 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.
The style guide said "
.. versionchanged:: X.Y.Zwhen behaviour changes" and offered the parameter-level form only as an alternative. Agents followed it literally: a 2026-06-01 pass (a4537eed) backfilled version history into docstrings package-wide, and the API pages now open with a stack of "Changed in version 1.1.0" blocks before the reader learns what the method does.Measured on
origin/master: 242versionadded+ 40versionchangedacross the package, 11 of the latter in_cpp.pyalone.CPP.__init__'s docstring went 36 → 102 → 117 lines across v1.0.3 → v1.1.0 → today, and the version stack is part of why.The rule now
.. versionadded::per public symbol, marking when the symbol appeared.. versionchanged::stack at class or method levelCHANGELOG.mdand the release notes, which is where a reader looking for history goesMirrored into
.claude/rules/docstrings.md, so it reaches an agent before it writes the docstring, with the numbers included — the previous wording is exactly what produced them.No library code touched and no existing docstring edited here. The cleanup of the 40 existing entries is tracked in #581, which carries the rendering target and the one decision it needs (whether the class-level
versionaddedis worth keeping at all).🤖 Generated with Claude Code