Skip to content

Add the project corpus: 233 pinned repositories compared between branches, and the audit's regression tests - #291

Open
leftibot wants to merge 1 commit into
cpp-best-practices:mainfrom
leftibot:corpus
Open

leftibot wants to merge 1 commit into
cpp-best-practices:mainfrom
leftibot:corpus

Conversation

@leftibot

Copy link
Copy Markdown
Contributor

The regression corpus: real repositories, pinned, validated as they are, compared between branches, and audited against what is true in them.

What this adds

  • corpus/: projects.toml lists 233 GitHub repositories (one or more for each of the 44 ecosystem profiles, plus mixed-language ones), each pinned to a commit, with the ecosystems it stands for and the open issues about what the validator gets wrong on it. Nothing is recorded in the repository: python -m corpus record DIR fetches the checkouts shallowly (about 5 GB, cached under ~/.cache/project_validator/corpus), validates them in parallel and writes, per project, the project map, the results judged with --allow-unknown and what strict judging adds (each check's status and the distinct "not read" reasons); python -m corpus diff BASE HEAD says what changed between two recordings, per project and per check. record fails when a project crashes the extraction or is not detected as the ecosystem it stands for. The checkouts are git checkouts, not archives: an archive drops what .gitattributes export-ignores, often .github/ itself.
  • CI job corpus: records the pull request's head and, in a worktree, its base over the same checkouts, and puts the diff in the job summary; the head recording is an artifact. It fails only on a crash or an undetected ecosystem; what changed is for the review, since a change in what is recognised is meant to show there. Every run also exercises every parser over real inputs.
  • tests/test_corpus.py (offline): every project is pinned, every ecosystem has a project that stands for it, the issue lists are numbers; shortfalls and diff on a recording made by hand.
  • cli.report_dicts: the --format json structure as a function, used by the corpus.
  • The audit: every project's results were compared against its repository. 556 discrepancies, clustered into 111 upstream issues (A dangling symlink in the checkout crashes the extraction (FileNotFoundError in read_head) #180 to data-wellformed's message for a 100000-deep JSON file depends on the Python build ("malformed JSON" vs "Expecting value") #290, 97 bugs and 14 enhancements), each with the evidence quoted from the checkouts. The manifest's issues lists the open issues per project (226 of 233 projects have at least one).
  • tests/regressions/: 149 expected-failure tests covering 93 of the issues, each asserting the right behaviour on a small project and marked @unittest.expectedFailure # upstream #N; the fix makes it an unexpected success, which fails the suite until the decorator goes. Three more sit in the modules of the code they test (dangling symlink crash, [[ ]] as a command, quadratic covers()).

Nothing in project_validator/ changes behaviour: the bugs are logged and pinned, not fixed.

Decisions

  • Integrated, not a separate repository: the manifest and the runner belong with the code, and the audit's tests with the checks they pin.
  • Nothing recorded in the repository: a recording for 233 projects is 9 MB and would churn with every change in what is recognised; CI compares the pull request with its base instead, which is also a run of every parser over real inputs on every change.
  • haskell/cabal and rust-lang/cargo are left out of the manifest until ToolRun.covers()/owner() is quadratic in the units: monorepos take minutes (cabal, cargo > 10 min) #181 (quadratic unit ownership; they take more than ten minutes each).

The largest classes found

Part of the testing roadmap; the next step after this is fixing the issues, each fix removing a decorator and changing an expectation.

🤖 Generated with Claude Code

https://claude.ai/code/session_01ByTXNqDWdM7HzezrFtEvQt

…ches, and the audit's regression tests

The fixtures are small and written to be judged; the corpus is the other half of the regression suite: real
repositories, one or more for every ecosystem profile, pinned to a commit. Nothing is recorded in the repository:
`python -m corpus record DIR` writes what the validator says about each project (the project map, the results judged
with --allow-unknown, and what strict judging adds), `python -m corpus diff BASE HEAD` compares two recordings, and the
CI job records a pull request's head and its base over the same checkouts and shows what changed, which also runs every
parser over real inputs each time. A crash, or a project not detected as the ecosystem it stands for, fails the job.
tests/test_corpus.py checks the manifest offline; cli.report_dicts exposes the --format json shape.

An audit of every project's results against its repository found 556 discrepancies, filed as upstream issues cpp-best-practices#180 to
cpp-best-practices#290; the manifest names the open issues per project. tests/regressions/ holds 149 expected-failure tests over 93 of
the issues (three more sit beside the code they test); a fix turns one into an unexpected success, which fails the
suite until its decorator goes, and shows in the corpus diff of its pull request.

haskell/cabal and rust-lang/cargo wait for cpp-best-practices#181 (quadratic unit ownership). History item 15.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01ByTXNqDWdM7HzezrFtEvQt
@codecov

codecov Bot commented Nov 14, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 99.77%. Comparing base (1d902a0) to head (304e949).

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #291   +/-   ##
=======================================
  Coverage   99.77%   99.77%           
=======================================
  Files         273      273           
  Lines       14063    14065    +2     
  Branches     1544     1544           
=======================================
+ Hits        14031    14033    +2     
  Misses         32       32           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

This branch has not been deployed

No deployments
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.

1 participant