Skip to content

affected-tests runs the full Rust suite for docs-only changes #1612

Closed

Description

@JacobStephens2

This was generated by AI during triage.

Problem

scripts/affected-tests selects the full Rust suite for any path it doesn't know, including Markdown that no build or test reads. PR #1595 changed only docs/adr/0001-rust-binary-with-embedded-skills.md, yet the selector printed Conservative full-suite selection for 'docs/adr/…' and ran the whole suite. With the machine loaded (load average 18.5), two of the #1396 wall-clock tests failed. So a prose edit cost a full run plus time spent ruling out failures that had nothing to do with it. CI then ran the suite again anyway. On the 4-core hosts a full run takes a median of 19–23 minutes (#1522).

Docs-only changes are common. Of the last 300 commits on main, 14 touched only docs/adr/, docs/research/, docs/grill-with-docs/, docs/agents/, GLOSSARY.md or CODING_STANDARDS.md.

What reads docs/ today

Searching src, tests, scripts, site and console for references:

  • docs/guide.md: the site generator and site tests (already mapped to the site checks)
  • docs/experiment-results.md: include_str! in tests/experiments/result_format.rs
  • docs/research/second-opinion-replays/replay.py: scripts/test_replay.py
  • tests/packaging.rs checks that docs/ is left out of the crate, whatever is in it
  • src/security/audit.rs looks for docs/THREAT-MODEL.md in the target repository, not this one

Every other Markdown file under docs/, plus GLOSSARY.md and CODING_STANDARDS.md, is read by nothing that builds or tests.

Proposal

Add a docs area to the selector: a change that touches only Markdown nobody reads selects no checks and prints why (No checks for docs-only 'docs/adr/…'.). Specifically:

  • Docs area: docs/**/*.md, GLOSSARY.md, CODING_STANDARDS.md
  • Exceptions (unchanged selection): docs/guide.md (site checks), docs/experiment-results.md (full Rust suite, or --test experiments if narrowing is in place), and any non-Markdown file under docs/ (full suite, as now)
  • Mixed with any other area, the docs paths add nothing and the other areas select as today

This keeps #724's rule that a new area can't silently opt out. To make sure a future test that starts reading some doc isn't skipped without anyone noticing, a selector test checks the repository for code references to docs/**/*.md, GLOSSARY.md and CODING_STANDARDS.md. Each one must appear in the selector's exception list, and the test fails otherwise, naming the file.

Acceptance criteria

  • With only docs/adr/*.md changed, scripts/affected-tests main runs nothing, prints the docs-only reason, and exits 0
  • docs/guide.md still selects the site checks, docs/experiment-results.md still selects Rust tests, and a non-Markdown file under docs/ still selects the full suite
  • A docs path together with a src/ path selects exactly what the src/ path alone selects
  • scripts/test_affected_tests.py covers each case above, plus the reference check: adding a test that include_str!s an unlisted doc makes it fail
  • docs/testing.md's selection table has a docs row and lists the exceptions
  • python3 -m unittest discover -s scripts -p test_affected_tests.py passes

Out of scope

Related: #724, #1396, #1522, #1595.

Activity

  1. added
    enhancement
    needs-triage
    on Oct 29, 2026
  2. JacobStephens2 commented on Nov 9, 2026

    @JacobStephens2
    OwnerAuthor

    This was generated by AI during triage.

    Triage: ready for an agent

    Checked against main on 2026-11-09: the selector still has no docs area, and a path it doesn't know selects the full Rust suite.

    New evidence from the 2026-11-09 retro: six implement sessions on five issues ran the full suite for changes that were prose only. #1868 changed one research note, edited in two minutes. Its Ticket run took 75 minutes, and its first full-suite run failed after 12 minutes on a cause the change had nothing to do with (#1895).

    Agent Brief

    Category: enhancement
    Summary: scripts/affected-tests selects no checks for a change that touches only Markdown that nothing builds or tests.

    Current behavior:
    A path outside the selector's named areas selects the full Rust suite, so a change to an ADR, a research note or the glossary runs it. On the hosts a full run that passes takes a median of 38 to 52 minutes, and CI runs the suite again.

    Desired behavior:

    • A docs area: Markdown files under docs/, plus GLOSSARY.md and CODING_STANDARDS.md. A change that touches only this area runs nothing, prints the reason and exits 0.
    • Exceptions keep the selection they have today: the user manual's source keeps the site checks, and a doc that a test or build reads keeps the Rust tests. A file under docs/ that isn't Markdown selects the full suite, as now.
    • Mixed with another area, docs paths add nothing: the other areas select what they select today.
    • A doc that code starts to read later can't be skipped unnoticed. A selector test searches the repository for code references to the docs area's files, and fails, naming the file, when one is missing from the exception list.

    Key interfaces:

    • The selector's area mapping: a docs area and its exception list.
    • The selector's unit tests: one case per rule above, and the reference check.
    • The selection table in docs/testing.md: a docs row that lists the exceptions.

    Acceptance criteria:

    • With only an ADR changed, scripts/affected-tests main runs nothing, prints the docs-only reason and exits 0.
    • The user manual's source still selects the site checks. A doc that a Rust test reads still selects Rust tests. A non-Markdown file under docs/ still selects the full suite.
    • A docs path together with a src/ path selects exactly what the src/ path selects alone.
    • The selector's tests cover each case above. Adding a test that reads an unlisted doc makes the reference check fail, naming the doc.
    • The selection table in docs/testing.md has a docs row and lists the exceptions.
    • python3 -m unittest discover -s scripts -p test_affected_tests.py passes.

    Out of scope:

  3. added
    ready-for-agent
    in-progress
    and removed
    needs-triage
    ready-for-agent
    on Nov 9, 2026
  4. removed
    in-progress
    on Nov 9, 2026
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

    enhancement

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions