Skip to content

feat(#228): Add caching to QA checks for improved performance - #232

Merged
admarble merged 4 commits into
mainfrom
feature/228-perf-qa-add-caching-to-skip-unchanged-checks-on-re
Feb 2, 2026
Merged

admarble merged 4 commits into
mainfrom
feature/228-perf-qa-add-caching-to-skip-unchanged-checks-on-re

Conversation

@admarble

@admarble admarble commented Feb 1, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Add QA check result caching to skip unchanged checks on re-run
  • Implement hash-based cache invalidation using git diff and config file hashes
  • Add --use-cache and --no-cache flags to quality-checks.sh
  • Create CLI helper for shell script integration
  • Add 36 unit tests with comprehensive coverage

Pre-PR AC Verification

AC Source Description Status Evidence
AC-1 Original QA caches results of expensive checks (type safety, security, tests) ✅ Implemented qa-cache.ts:420-440 - set() method stores results keyed by check type
AC-2 Original Cache is invalidated when relevant files change ✅ Implemented qa-cache.ts:180-227 - computeDiffHash() and computeConfigHash()
AC-3 Original --no-cache flag forces fresh run ✅ Implemented quality-checks.sh:35-44 - USE_CACHE flag parsed and honored
AC-4 Original Cache hit/miss is reported in QA output ✅ Implemented quality-checks.sh:319-346 - Cache Status Report section
AC-5 Original No false positives (stale cache causing missed issues) ✅ Implemented Hash-based invalidation ensures cache is only used when code matches
Derived ACs
AC-6 Error Handling Gracefully degrade to fresh run if cache is corrupted ✅ Implemented qa-cache.ts:339-345 - catches parse errors, returns empty state
AC-7 Debug Log cache operations at debug level ✅ Implemented qa-cache.ts:494-498 - log() method with verbose option
AC-8 Test Coverage Add unit tests for qa-cache.ts with >80% coverage ✅ Implemented qa-cache.test.ts - 36 tests covering all operations

Test plan

  • All 36 unit tests pass (npm test - qa-cache.test.ts)
  • Build passes (npm run build)
  • CLI commands work correctly (check, get, set, clear, status, hash)
  • Cache file created at .sequant/.cache/qa/cache.json
  • Manual test: Run /qa twice and verify cache hit on second run

Closes #228

🤖 Generated with Claude Code

admarble and others added 3 commits February 1, 2026 19:39
Implement QA check result caching to skip unchanged checks on re-run:

- Add qa-cache.ts module with hash-based cache invalidation
- Add qa-cache-cli.ts CLI helper for shell script integration
- Update quality-checks.sh with --use-cache/--no-cache flags
- Update QA skill SKILL.md with cache orchestration docs
- Add 36 unit tests covering all acceptance criteria

Cache uses git diff hash + config hash for content-based invalidation.
Supports per-check cache lookup with configurable TTL (default 1 hour).
Gracefully degrades to fresh run if cache is corrupted.

Co-Authored-By: Claude Opus 4.5 <[email protected]>
When SEQUANT_ORCHESTRATOR is set (e.g., during orchestrated workflows),
the state update CLI exits early with code 0 without processing commands.
This caused test failures when running tests in environments where this
variable was set.

Fixed by:
- Clearing SEQUANT_ORCHESTRATOR in runInTemp helper by default
- Explicitly clearing in help output tests that use runCli directly

Co-Authored-By: Claude Opus 4.5 <[email protected]>
Fixes ESLint no-unused-vars warnings in qa-cache.ts.

Co-Authored-By: Claude Opus 4.5 <[email protected]>
@admarble
admarble force-pushed the feature/228-perf-qa-add-caching-to-skip-unchanged-checks-on-re branch from 92ba7bb to c41483d Compare February 2, 2026 01:57
The stats command now uses cli-ui colors instead of chalk directly.

Co-Authored-By: Claude Opus 4.5 <[email protected]>
@admarble
admarble merged commit 88855b3 into main Feb 2, 2026
6 checks passed
@admarble
admarble deleted the feature/228-perf-qa-add-caching-to-skip-unchanged-checks-on-re branch February 2, 2026 02:02
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.

perf(qa): Add caching to skip unchanged checks on re-run

1 participant