Skip to content

pr_gates --fast: run the tests a diff can break (importers + change classifier), not just lint/audits #6733

Closed

Description

@squid-protocol

Why. Breaking other existing tests, languages or programs is the send-back cause that grows fastest with PR size. In the churn data from 2026-10-18 to 10-26 it went from 1.2 fix runs per 100 PRs at 1-2 hand-written files to 4.8 at 3-4 and 17.7 at 5. That jump is the main reason the 5-file cap can't safely go up. Workers test their own change well: the PR's own tests fail in CI only 2-5 times per 100 PRs, flat across sizes. What they miss is effects elsewhere, for example:

  • "macro rule overmatched, tree-sitter audit regressed"
  • "new fault commands broke the strengthen-loop planner test"
  • "shared dateutil port change staled dependent evidence"

What. Add an affected gate to pr_gates --fast:

  1. Map changed .py files to the test modules that import them, transitively, with an ast import scan in the style of change_classifier.py's reader scan. Also include the tests the change classifier (CI cost: one change classifier so each PR runs only the jobs and tests it can affect (docs, ground-truth, det/db2, suite, re-runs) #6278) assigns to each changed area, and the docs_read_by_tests.txt readers of changed docs.
  2. Run those test modules with a time budget, e.g. 5 min. When the selection is bigger than the budget, print "selection too large: N modules; CI will run them" rather than silently skipping.

churn's precheck already runs --fast, so the automatic send-back would catch these before review.

Acceptance: replay 5 collateral-break fix runs from 10-20..25. The gate must fail on the pre-fix head and pass on the fixed head.

Related: #6731, #6278.

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

    scope:infra

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions