Skip to content

Numerical-claims guard does not check the stated test-module count outside README #958

Open

Description

@cemililik

Found while verifying #954, which added a test module and updated the stated count by hand in five places.

What happens

The numerical-claims guard's test-module rule (tools/check_doc_numerical_claims.py, scope toplevel) reads only README.md, by design: docs/roadmap/ records per-wave figures that must not be rewritten to the current total. The surfaces that state the current count are not checked at all:

  • CLAUDE.md and AGENTS.md (tests/ # 130 test modules)
  • CONTRIBUTING.md (130 test files)
  • docs/reference/architecture.md and architecture-tr.md (130 test modules, 130 test modülü)

On #954's head, setting all five to 999 still prints OK: every numerical doc claim matches canonical scrapes.

Acceptance criteria

  • The test-module rule also covers the current-inventory surfaces (the module_inventory scope plus CONTRIBUTING.md), including the test files and Turkish test modülü phrasings, while docs/roadmap/ stays exempt.
  • A test sets each of those counts wrong and expects a finding.

Activity

  1. added
    wave: 4Roadmap wave 4: low / info / watch, when touching the module
    on Oct 17, 2026
  2. cemililik commented on Oct 17, 2026

    @cemililik
    CollaboratorAuthor

    Where to start

    Thanks for taking a look. Please confirm the issue is unassigned and comment before starting so work does not overlap.

    Start with these files on development:

    The test-module rule in build_rules() has the scope "toplevel", and _scanned_docs("toplevel") returns only README.md, so the files that state the current count are never read. _scanned_docs("module_inventory") already returns four of them (CLAUDE.md, AGENTS.md and the English and Turkish docs/reference/architecture pages); CONTRIBUTING.md is in neither scope. Two phrasings also never match the pattern: "130 test files" (CONTRIBUTING.md) and the Turkish "130 test modülü".

    Make the test-module rule read those five files, and keep docs/roadmap/ out of it: it records historical per-wave figures that are correct as written. A new scope is the least invasive way to say "README plus the inventory surfaces plus CONTRIBUTING.md". Widen the pattern for the two phrasings but keep a qualifier, so that generic counts such as "124 rows" still do not match (test_generic_count_without_the_qualifier_does_not_match guards that).

    Add tests in TestTestModuleAndGuardRules: set each of the five counts wrong in a temporary tree and expect a finding for each, and check that a wrong count under docs/roadmap/ is not reported. test_stale_inventory_fails_on_each_current_surface in TestCoreModuleInventory builds exactly this for the module_inventory scope, and test_toplevel_scope_excludes_docs_roadmap shows the roadmap check. test_both_rules_are_scoped_to_toplevel asserts the old scope and will have to change with the rule; say so in the PR.

    Run the focused tests and the guard itself:

    pytest tests/test_check_doc_numerical_claims.py --no-cov
    python3 tools/check_doc_numerical_claims.py --strict

    Run these checks as applicable to the changed files:

    ruff format --check tools/check_doc_numerical_claims.py tests/test_check_doc_numerical_claims.py
    ruff check tools/check_doc_numerical_claims.py tests/test_check_doc_numerical_claims.py

    Tests must not need a GPU, network access or model downloads. Record the change under ## [Unreleased] in CHANGELOG.md; earlier guard changes are listed there. No documentation page changes, so there is no Turkish mirror to update.

    Open the PR against development with Fixes #958.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area: dev-toolingCode area: dev-toolingbugSomething isn't workinggood first issueGood for newcomersseverity: lowMinor defect, inaccuracy or rough edgewave: 4Roadmap wave 4: low / info / watch, when touching the module

    Type

    No type

    Projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions