Gate each fast-path finding on its cop and touched tests; run the full suite once per batch #1254

Closed
opened 2026-10-23 15:20:23 +00:00 by jared · 2 comments
Owner

Problem

bin/fast-gate runs the full os-sdlc suite after every fast-path finding. In fast-batch-12, the full-suite gate runs took about 17 of the 35 agent minutes. The edits took about 30 s for each builder. The batch cost is mostly gate time, not edit time. CRC run 4 over os-sdlc will run many findings, so this cost repeats on each one.

Reproduce

n/a: cost ticket; the evidence is the fast-batch-12 cost rows in docs/sdlc-fast-path.md.

Approach

Decided 2026-10-23. bin/fast-gate runs only the tests for the files that the finding changed. The batch keeps its one full-suite run: skills/fast-batch/SKILL.md step 7 item 1 already runs ruby plugins/os-sdlc/tests/all.rb in the worktree before the merge. No new --full flag.
FastGate::Run#checks (fast_gate/run.rb:33) builds SuiteCheck from a new FastGate::SuiteScope. SuiteScope takes fast-gate's merge-base changed paths (fast_gate/changed_files.rb). It maps them to tests with the same mapping that Suite::DiffPlan uses (Codebase#tests_for, Suite::Candidates), and it widens to target.test.command under the same rule as DiffPlan#widened? (ADR-0202). Do not change Project::Changes or its four callers.
When no test maps and nothing widens, SuiteScope runs no suite, and the summary says no touched tests.
The PASS line names the scope: touched N tests or full suite.
Update the fast-gate text in skills/fast-batch/references/batch-brief.md, agents/finding-builder.md, and docs/sdlc-fast-path.md:24 to say the gate runs the touched tests, and that the batch runs the full suite once before the merge.

Required work:

  1. Build the suite command from the changed paths — check: present SuiteScope in plugins/os-sdlc/lib/os_sdlc/fast_gate/run.rb
  2. Name the scope in the gate summary — check: present touched in plugins/os-sdlc/lib/os_sdlc/fast_gate/suite_scope.rb
  3. Describe touched-test gating in the builder brief — check: present touched tests in plugins/os-sdlc/skills/fast-batch/references/batch-brief.md
  4. Describe touched-test gating in the fast-path doc — check: present touched tests in docs/sdlc-fast-path.md

Rejected: a --full flag — the batch-end suite run already exists in step 7. Change Project::Changes to take a base ref — it touches four callers that do not need it.

Acceptance criteria

  1. Given a finding that changes a file with mapped tests, when bin/fast-gate runs, then only those tests run and the PASS line says touched N tests.
  2. Given a finding that changes only code files with no mapped test, when bin/fast-gate runs, then the full suite runs and the PASS line says full suite.
  3. Given a finding whose changes map to no test and do not widen, when bin/fast-gate runs, then no suite runs and the summary says no touched tests.
  4. Given a touched test that fails, when bin/fast-gate runs, then the gate fails and names the failing test.

Owner sketch

class OsSdlc::FastGate::SuiteScope
  def initialize(project, changed_paths)
  def command
  def label
end

Origin

  • Trigger: fast-batch-12 cost review (docs/sdlc-fast-path.md, fast-batch-12 cost rows; commit 3cc28a30)
  • Improvised this session: none
  • Chain: slow fast-batch ← full suite on every finding ← bin/fast-gate design (commit 05e4e1b7) — DESIGN: plugins/os-sdlc/bin/fast-gate
  • Root candidate: none found; searched fast-gate, fast-path, fast-batch, touched tests, full suite, suite budget, gate time
  • Where: plugins/os-sdlc/bin/fast-gate, plugins/os-sdlc/lib/os_sdlc/fast_gate
  • Session: b0da7c4b-f4b3-4f3b-96cd-0b77e82451d4
  • Transcript: /home/jared/.claude/projects/-home-jared-dev-cc-os/b0da7c4b-f4b3-4f3b-96cd-0b77e82451d4.jsonl

Blocking edges

  • Blocked by #1239 (same files: fast_gate/suite_check.rb, the PASS summary).

VERDICT: CREATE

## Problem `bin/fast-gate` runs the full os-sdlc suite after every fast-path finding. In fast-batch-12, the full-suite gate runs took about 17 of the 35 agent minutes. The edits took about 30 s for each builder. The batch cost is mostly gate time, not edit time. CRC run 4 over os-sdlc will run many findings, so this cost repeats on each one. ## Reproduce n/a: cost ticket; the evidence is the fast-batch-12 cost rows in `docs/sdlc-fast-path.md`. ## Approach Decided 2026-10-23. `bin/fast-gate` runs only the tests for the files that the finding changed. The batch keeps its one full-suite run: `skills/fast-batch/SKILL.md` step 7 item 1 already runs `ruby plugins/os-sdlc/tests/all.rb` in the worktree before the merge. No new `--full` flag. `FastGate::Run#checks` (`fast_gate/run.rb:33`) builds `SuiteCheck` from a new `FastGate::SuiteScope`. `SuiteScope` takes fast-gate's merge-base changed paths (`fast_gate/changed_files.rb`). It maps them to tests with the same mapping that `Suite::DiffPlan` uses (`Codebase#tests_for`, `Suite::Candidates`), and it widens to `target.test.command` under the same rule as `DiffPlan#widened?` (ADR-0202). Do not change `Project::Changes` or its four callers. When no test maps and nothing widens, `SuiteScope` runs no suite, and the summary says `no touched tests`. The PASS line names the scope: `touched N tests` or `full suite`. Update the fast-gate text in `skills/fast-batch/references/batch-brief.md`, `agents/finding-builder.md`, and `docs/sdlc-fast-path.md:24` to say the gate runs the touched tests, and that the batch runs the full suite once before the merge. Required work: 1. Build the suite command from the changed paths — check: present `SuiteScope` in `plugins/os-sdlc/lib/os_sdlc/fast_gate/run.rb` 2. Name the scope in the gate summary — check: present `touched` in `plugins/os-sdlc/lib/os_sdlc/fast_gate/suite_scope.rb` 3. Describe touched-test gating in the builder brief — check: present `touched tests` in `plugins/os-sdlc/skills/fast-batch/references/batch-brief.md` 4. Describe touched-test gating in the fast-path doc — check: present `touched tests` in `docs/sdlc-fast-path.md` Rejected: a `--full` flag — the batch-end suite run already exists in step 7. Change `Project::Changes` to take a base ref — it touches four callers that do not need it. ## Acceptance criteria 1. Given a finding that changes a file with mapped tests, when `bin/fast-gate` runs, then only those tests run and the PASS line says `touched N tests`. 2. Given a finding that changes only code files with no mapped test, when `bin/fast-gate` runs, then the full suite runs and the PASS line says `full suite`. 3. Given a finding whose changes map to no test and do not widen, when `bin/fast-gate` runs, then no suite runs and the summary says `no touched tests`. 4. Given a touched test that fails, when `bin/fast-gate` runs, then the gate fails and names the failing test. ## Owner sketch ```ruby class OsSdlc::FastGate::SuiteScope def initialize(project, changed_paths) def command def label end ``` ## Origin - Trigger: fast-batch-12 cost review (`docs/sdlc-fast-path.md`, fast-batch-12 cost rows; commit 3cc28a30) - Improvised this session: none - Chain: slow fast-batch ← full suite on every finding ← `bin/fast-gate` design (commit 05e4e1b7) — DESIGN: `plugins/os-sdlc/bin/fast-gate` - Root candidate: none found; searched fast-gate, fast-path, fast-batch, touched tests, full suite, suite budget, gate time - Where: `plugins/os-sdlc/bin/fast-gate`, `plugins/os-sdlc/lib/os_sdlc/fast_gate` - Session: b0da7c4b-f4b3-4f3b-96cd-0b77e82451d4 - Transcript: /home/jared/.claude/projects/-home-jared-dev-cc-os/b0da7c4b-f4b3-4f3b-96cd-0b77e82451d4.jsonl ## Blocking edges - Blocked by #1239 (same files: `fast_gate/suite_check.rb`, the PASS summary). VERDICT: CREATE
Author
Owner

Work started on branch ticket-1254 (os-sdlc implement pipeline).

Work started on branch ticket-1254 (os-sdlc implement pipeline).
Author
Owner

Resolution

Done: bin/fast-gate runs only the tests mapped to the changed files (new FastGate::SuiteScope over Suite::DiffPlan); it widens to the full suite when a changed code file has no mapped test, and runs no suite when nothing maps. The PASS line names the scope: 'touched N tests', 'full suite', or 'no touched tests'. fast-batch keeps its one full-suite run before the merge (SKILL.md step 7 item 1); batch-brief.md, finding-builder.md and docs/sdlc-fast-path.md say so.

Evidence: Implementation 120 complete with 0 retries in 12 min 8 s, Runner commit 65a8df97 on ticket-1254; suite-check gate green (suite 62 s); contract-auditor pass. Main loop read the production diff.

Follow-ups: none

## Resolution **Done:** bin/fast-gate runs only the tests mapped to the changed files (new FastGate::SuiteScope over Suite::DiffPlan); it widens to the full suite when a changed code file has no mapped test, and runs no suite when nothing maps. The PASS line names the scope: 'touched N tests', 'full suite', or 'no touched tests'. fast-batch keeps its one full-suite run before the merge (SKILL.md step 7 item 1); batch-brief.md, finding-builder.md and docs/sdlc-fast-path.md say so. **Evidence:** Implementation 120 complete with 0 retries in 12 min 8 s, Runner commit 65a8df97 on ticket-1254; suite-check gate green (suite 62 s); contract-auditor pass. Main loop read the production diff. **Follow-ups:** none
jared closed this issue 2026-10-23 16:14:42 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
jared/cc-os#1254
No description provided.