Skip to content

perf(build): gate each wave once, brief each agent, cap change sets - #2

Merged
tobrun merged 1 commit into
mainfrom
build-speed
Oct 1, 2026
Merged

tobrun merged 1 commit into
mainfrom
build-speed

Conversation

@tobrun

@tobrun tobrun commented Oct 1, 2026

Copy link
Copy Markdown
Owner

Summary

Makes the dev build step faster by acting on five causes named in feedback on the contexia searchable-kb build.

Cause Change
The Validation block ran more than once per change set It runs once per wave, by the orchestrator, as the gate before the commits. Agents run only their own test files plus typecheck and lint. The e2e suite, benchmarks, and coverage or complexity re-runs wait for one run at the end.
Every test proven red by break-and-rerun The rule stays. The red is free when the test is written first, otherwise one break per slice and one test file.
One change set carried 38 scenarios and took 73 minutes lint-spec.py fails a change set over 25 scenarios. Change sets already built are exempt.
Change sets queued behind shared files lint-spec.py prints the build waves the file lists allow and the files that make a change set wait. Scope is asked for a wide plan with one owner per shared file.
Agents read the whole spec and notes New change-set-brief.py cuts the spec down to one change set, verbatim. For one real change set that is 42 KB instead of 130 KB.

Also fixes check-tests.py, which split test names on every comma.

Evidence

  • scripts/validate.sh passes, including the new D01 check that runs 21 unit tests for the three scripts.
  • One old-versus-new functional run of the parallel-wave eval, recorded in dev/evals/results.md: the Validation block ran 2 times instead of 4, and no subagent ran it.
  • Wall time did not improve on that fixture, whose suite costs 20 seconds. A real build has to show the saving.

Notes

  • Five decisions are recorded under "Build speed" in docs/decisions.md.
  • The factory-plugin branch carries the same change plus the factory phase copies in commit 0130c2f.
  • dev goes to 3.3.0.

🤖 Generated with Claude Code

What: build now runs a spec's Validation block once per wave, as the
gate before the wave's commits ("The wave gate" in parallel.md). A
change-set implementer runs only the test files it adds or edits plus
typecheck and lint. Commands marked `(end of build)` in the block, and
the e2e suite, benchmarks, and suite-repeating analyses even when
unmarked, run once on the final tree with the CI-parity gate.
ci-parity.md no longer re-runs a command that is green on the same tree.

The seen-red rule keeps its guarantee and loses its cost: free when the
test is written first, otherwise one break per slice running one test
file.

change-set-brief.py (new, build/scripts) cuts spec.md down to one change
set: every section but research and the change plan, the decisions the
change set links, its own plan, and implementation-notes.md without its
test and seam inventories. Lines are verbatim. parallel.md hands each
agent its brief instead of the whole spec and notes.

lint-spec.py fails a change set over 25 scenarios (change sets already
logged in implementation-notes.md are exempt, since they never
renumber) and prints, on a clean spec, the build waves the file lists
allow and the shared files that make a change set wait. scope asks for
a wide plan, one owner per shared file, and the `(end of build)` mark;
the scope-review feasibility lens checks both.

check-tests.py splits the `Tests added:` line only where a path::name
follows the comma, so a test name may hold commas.

plugins/ is regenerated, dev goes to 3.3.0, and validate.sh gains D01,
which runs the 21 new unit tests under dev/evals/tests. docs/decisions.md gains a Build speed
area: D-wave-gate, D-seen-red-cost, D-change-set-size, D-wave-report,
D-change-set-brief.

Why: feedback on the contexia searchable-kb build named five causes of
a slow build. The Validation block (lint, typecheck, build, unit,
integration, e2e, bench, and a complexity script that re-runs the suite
with coverage) ran more than once per change set. One change set spent
47 break-and-rerun cycles proving 75 tests red. Change set 4 carried 38
scenarios over about 60 files and took 73 minutes. Change sets 3, 4,
and 5 queued behind shared files. Every agent read about 130 KB of spec
and notes before writing anything; the brief for change set 5 is 42 KB.
The comma split was costing loops too: 75 of the 91 problems
check-tests.py reported on that plan were test names cut in two.

An old-versus-new run of the parallel-wave eval is recorded in
dev/evals/results.md: the Validation block ran 2 times instead of 4 and
no subagent ran it. Wall time did not improve on that fixture, whose
suite costs 20 seconds; a real build has to show the saving.

Considered: running the block once per build (commits in between would
be unverified); a file-count limit (file lists are prose, the count
would be a guess); failing the lint on a serial plan (no threshold
separates a careless chain from a necessary one); worktrees for
overlapping change sets (an overlap usually is a real dependency).
@tobrun
tobrun merged commit 9c130d9 into main Oct 1, 2026
4 checks passed
@tobrun
tobrun deleted the build-speed branch October 1, 2026 14:35
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