propose: collapse repeated graph builds + per-PR test selection contract#93
Conversation
ReviewOverall: Agree with the direction. The diagnosis (many tests re-running What works well: Corpus-keyed session graphs; Tier 3 staying per-test with a thin Risks / suggestions:
Bottom line: Ship it as a plan; tighten enforcement of the full merge gate and how review proves subset + full gate. |
5dabfb3 to
b22750a
Compare
v2 amendment — response to review (force-pushed
|
b22750a to
a5be71c
Compare
v3 amendment — answering "can you prove this won't bypass failed tests to master?" (force-pushed
|
Propose draft for cutting the per-PR test loop time.
Root cause
15 of 18 graph-building tests bypass the session
kuzu_graphfixture intests/conftest.pyand callpass1_parse → pass2_edges → pass3_calls → pass4_routes → write_kuzuthemselves. Eachpytestinvocation re-parses the same corpora 15+ times.A 3-test sample (
test_brownfield_routes.py,test_call_invariant.py,test_kuzu_queries.py) ran in 13.16s with the single shared build paying 4.19s — the rest is dominated by independent re-builds.What this propose locks
Two PRs, both
tests/+ skills, zero production touch:PR-1 — fixture refactor — three-tier model:
kuzu_db_path/kuzu_graphfor the bank-chat-system corpuskuzu_graph_call_graph_smoke,kuzu_graph_route_extraction_smoke, etc.)tmp_pathrebuild but share atests/_builders.py::build_kuzu_into(tmp)helperPR-2 — per-PR test selection contract:
cursor-task-promptskill grows## Tests to run (iteration loop)fieldcursor-pr-reviewskill grows a checklist item that verifies the subset was actually executedPosition pushed-back-on
pytest-xdist/pytest-testmonin this propose: useful, but each one is its own tradeoff. Ship the free dedup-wins first; layer parallelism on top later.git diff. Author-declared subset is honest.Consistency pass
Why one propose covering both
The two PRs are independent in mechanics but symbiotic in outcome: faster suite makes the per-PR subset also faster, and the subset contract is the thing that lets you ship a one-line parser tweak without paying for the full graph rebuild even after PR-1 lands. Splitting into two proposes would invite relitigation of the "but why subset selection if the suite is already fast?" question. Locked in §9 #1.