Skip to content

feat(#377): optimize QA skill re-runs by diffing against prior findings - #432

Merged
admarble merged 2 commits into
mainfrom
feature/377-qa-skill-optimize-re-runs-by-diffing-against-prior
Mar 25, 2026
Merged

admarble merged 2 commits into
mainfrom
feature/377-qa-skill-optimize-re-runs-by-diffing-against-prior

Conversation

@admarble

Copy link
Copy Markdown
Contributor

Summary

  • Add incremental QA re-run optimization that detects what changed since the last QA run and skips checks whose inputs haven't changed
  • Extend phase markers with commitSHA field and QA cache with run context (prior AC statuses, diff hash) for re-run baseline tracking
  • Add Phase 0c "Incremental Re-Run Detection" to QA skill with skip/re-run logic and output formatting

AC Coverage

AC Description Status Evidence
AC-1 Detect prior QA comments via phase markers ✅ detectPriorQAFindings() in phase-detection.ts
AC-2 Identify files changed since last QA commit ✅ getChangedFilesSince() + changed-since CLI command
AC-3 Skip unchanged quality checks if diff hash matches ✅ Existing diff-hash cache + SKILL.md skip logic
AC-4 Always re-run build verification ✅ ALWAYS_RERUN_CHECKS constant + skip logic table
AC-5 Always re-evaluate NOT_MET/PARTIALLY_MET ACs ✅ AC re-evaluation rules in Phase 0c
AC-6 Output clearly indicates skipped vs re-run ✅ Incremental QA Summary table in output template
AC-7 Fall back to full QA when commitSHA missing/invalid ✅ Validation in Phase 0c detection flow
AC-8 --no-cache forces full re-run ✅ INCREMENTAL_MODE=false when --no-cache passed

Test plan

  • Build passes (npm run build)
  • Lint passes (npm run lint)
  • 104 tests pass for changed files (phase-detection + qa-cache)
  • New tests cover: commitSHA parsing, run context CRUD, incremental diff, detectPriorQAFindings
  • Backward compatibility: markers without commitSHA still parse correctly

Closes #377

Add incremental QA re-run support that detects what changed since the
last QA run and skips checks whose inputs haven't changed, reducing
token usage and execution time on iterative QA cycles.

- Extend PhaseMarkerSchema with optional commitSHA field
- Add QA run context cache (lastQACommitSHA, acStatuses, diffHash)
- Add detectPriorQAFindings() helper in phase-detection.ts
- Add computeIncrementalDiffHash() and getChangedFilesSince() to QACache
- Add set-run-context, get-run-context, changed-since CLI commands
- Add Phase 0c "Incremental Re-Run Detection" to QA SKILL.md
- Add Incremental QA Summary to output template
- ALWAYS_RERUN_CHECKS constant for build verification
- --no-cache forces full re-run; MET ACs skipped when no file changes
Add regex guard (/^[a-f0-9]{4,40}$/) to computeIncrementalDiffHash()
and getChangedFilesSince() to reject malformed input before it reaches
execSync. Defense-in-depth against command injection via corrupted cache.
@admarble
admarble merged commit d4e72f8 into main Mar 25, 2026
6 of 8 checks passed
@admarble
admarble deleted the feature/377-qa-skill-optimize-re-runs-by-diffing-against-prior branch March 25, 2026 14:25
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.

QA skill: optimize re-runs by diffing against prior findings

1 participant