Repository navigation
ci: wire specs/ci/affected.t27 -- t27c use-edges + test only the affected specs #7565
Description
Problem
specs/ci/affected.t27 (#7529) decides which specs a change can affect -- the changed specs plus every spec that imports one through use, transitively -- but nothing feeds it and nothing consumes it. No tool prints the use graph as repo-relative paths (t27c graph keys nodes by module name and drops specs that do not parse), so every spec PR still pays for the whole corpus.
Goal
Wire the selector into the build: t27c use-edges prints importer<TAB>imported from the same resolver t27c compiles with (use_resolve::use_targets, no second resolver), and a CI step feeds the diff, the base-and-head edge union and the corpus into gen/c/ci/affected.c, then tests only the selected specs.
Acceptance
t27c use-edges --specs-dir specsprints one edge per resolveduseline, sorted, repo-relative.- spec-guards selects with affected.c (no selection logic in YAML or Rust), falls back to RUN_ALL exactly where affected.t27 says, and runs
t27c test-reporton the selected specs only. - Measured: edge count, selection size and wall time on a spec-only change vs the full corpus.
Boundary
bootstrap/src/main.rs, bootstrap/src/use_resolve.rs, .github/workflows/spec-guards.yml. No change to specs/ci/affected.t27 semantics, suite.rs, corpus-ratchet.yml or the ratchet ledgers. Epic #6655 speed track, follows #7529 / #7548.
User Scenarios
- Given a spec-only change in
specs/example.t27, when the CI runsspec-guards, then onlyspecs/example.t27and specs that transitivelyuseit are tested. - Given a change to a shared spec imported by many specs, when
t27c use-edges --specs-dir specsruns, then it prints every resolveduseedge asimporter<TAB>importedwith repo-relative paths, sorted. - Given a change outside
specs/(e.g., compiler code), when the affected selector runs, then it falls back to running the full corpus exactly asspecs/ci/affected.t27prescribes.
Requirements
- FR-001:
t27c use-edges --specs-dir <dir>MUST print one line per resolvedusestatement asimporter<TAB>importedusing repo-relative paths, sorted lexicographically, usinguse_resolve::use_targetsfrom the compiler's resolver. - FR-002: The
use-edgessubcommand MUST be added tobootstrap/src/main.rsand delegate touse_resolve.rswithout introducing a second resolver. - FR-003:
.github/workflows/spec-guards.ymlMUST invoket27c use-edges, feed its output plus the diff and corpus intogen/c/ci/affected.c, and runt27c test-reportonly on the selected specs. - FR-004: The CI step MUST fall back to
RUN_ALL(full corpus) exactly wherespecs/ci/affected.t27dictates, with no selection logic in YAML or Rust.
Success Criteria
t27c use-edges --specs-dir specsexits 0 and prints at least oneimporter<TAB>importedline for the current corpus.gen/c/ci/affected.ccompiled and invoked by the workflow selects a subset of specs on a spec-only change; the selection size is < 100% of the corpus..github/workflows/spec-guards.ymlrun on a spec-only PR completes in less wall time than the full-corpus baseline (measured in seconds).- Edge count, selection size, and wall time are printed as workflow artifacts for a spec-only change vs the full corpus.
Activity
ci: test only the specs a change can affect -- t27c use-edges feeds s…
t27c use-edges: walk in main.rs, use_resolve.rs stays std-only -- t27…
census: re-bless -- the spec-guards affected-specs step is one new ru…
Merge master 20d20c9 into claude/affected-use-closure; recount tools/…
ci: test only the specs a change can affect -- t27c use-edges feeds s…