Skip to content

CLAUDE.md says which files a test keeps free of a stated count (closes #2035) - #2039

Merged
fametrano merged 1 commit into
mainfrom
iss-2035-the-count-free-rule-names-its-gate
Sep 12, 2026
Merged

CLAUDE.md says which files a test keeps free of a stated count (closes #2035)#2039
fametrano merged 1 commit into
mainfrom
iss-2035-the-count-free-rule-names-its-gate

Conversation

@fametrano

@fametrano fametrano commented Sep 12, 2026

Copy link
Copy Markdown
Member

CLAUDE.md's Never state how many of anything a file holds named the
tests that enforce it and no file the rule governs without one.
SECURITY.md is such a file, so the sentence read as coverage the suite
does not give. The decision is that it stays with the reading, and this is
that decision written where the rule is.

Three grounds, each measured rather than argued:

  • The fitting instrument is inert on its own subject. All three of
    tests/release_notes_test.py's _FORBIDDEN patterns answer None
    against the pre-repair SECURITY.md (git show 6065ade8^:SECURITY.md),
    the file that still said "being four other places a secret meets the
    curve" — while answering true on 4 of 4 _RESURRECTED strings. So
    naming the file in _FILES would have been green on the exact sentence
    ISS 2035 was filed
    for, which is what test_the_patterns_still_match exists to refuse.
  • The defect mode that justifies a test for the other two is absent.
    git check-attr merge answers union for CHANGELOG.md and
    RELEASE_NOTES.md and unspecified for SECURITY.md — one run over
    six paths, so the unspecified is discriminated and not a silent zero.
    The silent-restore mechanism a test answers for is not there; what is
    left is staleness, and the paragraph says the file is kept by hand.
  • The working instrument costs an allowlist coupled to another gate. A
    guard of tests/vendored_data_test.py's shape flags 48 of 481 prose
    lines, 9 of them path:line citations, each wanting an exemption pinned
    verbatim — where an edit anywhere in a cited module moves the number
    tests/security_citations_test.py then reads.

What lands is a paragraph in CLAUDE.md, a comment above
tests/release_notes_test.py's _FILES where somebody minded to add a
third file is standing, and one CHANGELOG.md entry. 3 files, 43
insertions, 0 deletions; no test function, id or collection count moves.

Gates at 2839272f, the pushed tip: lint exit 0 (47 Passed, 0
Failed), tree clean after; pytest exit 0, 32605 passed, 78 skipped,
TOTAL 57179 0 9886 100.00%; sphinx-build -n -W exit 0; the
href="#../" sweep exit 1 with a planted control the sweep exits 0 on;
pinned markdownlint-cli2 v0.23.2 check-only exit 0, and exit 1 naming
MD032/MD022 on a copy with the blank line above this branch's own
heading deleted.

Reviewed at 3dd2efb3 (CLEARED). Two changes since that sha, both prose
and both from the review itself: the reviewer's non-blocking finding on
the CLAUDE.md paragraph's closing clause is taken, so the clause no
longer labels a live class of SECURITY.md sentences as descriptions the
file carries; and the commit body now points the question it raises at
ISS 2038, filed from
this review, rather than settling it here.

closes #2035

🤖 Generated with Claude Code

https://claude.ai/code/session_01Sn2BerFVJcUtGF8Dm1Amd3

Summary by Sourcery

Document why SECURITY.md remains outside the automated stated-count checks while clarifying the intended scope of the existing test.

Bug Fixes:

Enhancements:

  • Document the rationale for limiting count checks to files where silent restoration or branch-generated edits can introduce defects.
  • Add an explanatory comment at the test file allowlist to prevent inappropriate expansion of its scope.

Documentation:

  • Update CLAUDE.md with the decision and criteria governing files subject to stated-count checks.
  • Record the decision and its rationale in the changelog.

 #2035)

`CLAUDE.md`'s *Never state how many of anything a file holds* names the
tests that enforce it -- `tests/release_notes_test.py` for `CHANGELOG.md`
and `RELEASE_NOTES.md`, `tests/vendored_data_test.py` for
`tests/_data/README.md` -- and names no file the rule governs without
one. `SECURITY.md` is such a file, so the sentence reads as coverage the
suite does not give.

The decision is that it stays with the reading, and the file says so
where it names the tests.

What makes a test the instrument for the files it does name is a defect
a reading cannot see. `merge=union` resolves an append-point collision by
keeping both sides' added lines, so a branch carrying an edit to a count
paragraph restores it on rebase with nothing in the merge output to say
so; and `tests/_data/README.md`'s count is an edit every branch vendoring
a vector makes, which is a conflict for the others and a wrong number
where two of them pick the same one. `git check-attr merge -- SECURITY.md`
answers `unspecified`, and its numerals sit in prose rather than at an
append point, so an edit to one conflicts the ordinary way.

Naming the file in `_FILES` is the small move and an inert one. The
patterns there are keyed on the paragraph each forbids -- an entry count,
the size of the breaking-changes list, and the cross-reference to it --
and none of them matches `SECURITY.md`, nor the sentence
[ISS 2035](#2035) reports,
which `6065ade8` repaired. A guard that cannot fail on its own subject is
what `test_the_patterns_still_match` exists to refuse within the module's
scope, and adding a file to the tuple would put one in the tree.

A guard of `tests/vendored_data_test.py`'s shape -- a numeral anywhere,
past an allowlist naming each permitted line verbatim -- does catch that
sentence. Its cost is the allowlist: an exemption for every `path:line`
citation, where an edit anywhere in a cited module moves the number and
`tests/security_citations_test.py` is the gate that then reads it, and an
exemption for every protocol constant, a key size and a field width among
them. And the numeral the issue reports summarises a roster the sentence
itself lists, which no pattern can tell from a sentence naming a
structure -- `these three` for the call sites named beside it, `the other
three`, `Those three` for the libsecp256k1 entry points. Each would take
an exemption recording a judgement, which is the reading written down
rather than a check performed. Whether the first two of those should lose
their numeral the way this issue's own sentence did is
[ISS 2038](#2038), filed from
this branch's review: the roster they count is call sites of this tree and
grows, where `Those three` closes the enumeration it counts.

`tests/release_notes_test.py` carries the same decision at `_FILES`,
which is where somebody minded to add a third file is standing.

closes #2035

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Sn2BerFVJcUtGF8Dm1Amd3

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Sorry @fametrano, you've used your own review budget of 250,000 diff characters for the last 7 days.

You can request another review in 1 day and 3 hours by commenting @sourcery-ai review. Upgrade to get a review now.

@sourcery-ai

sourcery-ai Bot commented Sep 12, 2026

Copy link
Copy Markdown
Contributor

Reviewer's Guide

The PR clarifies that SECURITY.md is intentionally kept free of stated-count claims by hand rather than added to automated count-restoration tests, documenting the reasoning in project guidance, test comments, and the changelog without changing test behavior or production code.

Flow diagram for the SECURITY.md count-rule decision

flowchart TD
    A[SECURITY.md is governed by the count-wording rule] --> B{Does the existing test instrument fit?}
    B -->|No| C[release_notes_test.py patterns match nothing in SECURITY.md]
    B -->|No| D[merge attribute is unspecified; no silent restore mechanism]
    B -->|No| E[vendored-data-style guard would require fragile exemptions]
    C --> F[Keep SECURITY.md maintained by hand]
    D --> F
    E --> F
    F --> G[Document the decision in CLAUDE.md, test comments, and CHANGELOG.md]
Loading

File-Level Changes

Change Details Files
Document the deliberate manual treatment of SECURITY.md under the no-counts rule. CLAUDE.md
tests/release_notes_test.py
Record the policy decision and rationale in the changelog. CHANGELOG.md

Assessment against linked issues

Issue Objective Addressed Explanation
#2035 Rewrite the sentence in SECURITY.md so it names the relevant places without stating a count of them. The PR does not modify SECURITY.md or remove the phrase "four other places a secret meets the curve." It explicitly leaves the counted sentence in place and chooses to keep the file maintained by hand.
#2035 Decide whether the count-free guard should be extended to SECURITY.md, and document that decision.

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@fametrano
fametrano merged commit 801e4cf into main Sep 12, 2026
3 of 12 checks passed
@fametrano
fametrano deleted the iss-2035-the-count-free-rule-names-its-gate branch September 12, 2026 19:54
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.

SECURITY.md states how many places a secret meets the curve, and no gate reads that file for a count

1 participant