How muhammadmirza97/ai-test-integrity-review works
AI Test Integrity Review is a local-first GitHub Action and CLI that checks whether a pull request weakened tests and whether changed tests exercise the change. Its main workflow loads base/head revisions and policy, discovers and compares tests, optionally verifies changed tests against base code and runs targeted mutation testing, then evaluates and reports PASS, WARN, BLOCK, or ERROR. The README documents preflight/doctor as a separate capability. Some subsystem links reflect documented behavior; unsampled source limits call-level detail.
Main entry points: run-check.ts Check orchestrator · cli.ts Local CLI · run.ts GitHub Action · text.ts Text and JSON reports
Components 19
Entry points
- Local CLI
packages/cli/src/cli.ts - GitHub Action
packages/action/src/run.ts - Preflight doctor
packages/core/src/environment/doctor.ts
PR analysis
- Check orchestrator
packages/core/src/check/run-check.ts - Git revisions
packages/core/src/git/repository.ts - Policy config
packages/core/src/config/load.ts - Framework discovery
packages/core/src/framework/discovery.ts - Setup compatibility
packages/core/src/environment/compatibility.ts - Test structure analysis
packages/core/src/ast/tests.ts - Integrity rules
packages/core/src/rules/registry.ts
Test verification
- Red-green verification
packages/core/src/red-green/verifier.ts - Isolated worktrees
packages/core/src/red-green/worktree.ts - Targeted mutation
packages/core/src/mutation/stryker.ts
Policy and results
- Finding policy
packages/core/src/policy/evaluate.ts - PASS / WARN / BLOCK / ERROR
packages/core/src/domain/result.ts - Text and JSON reports
packages/core/src/report/text.ts - Action summary
packages/action/src/summary.ts
Other components
- Developer / CI
- GitHub PR workflow
Connections 20
- Developer / CI → Local CLI: runs locally
- GitHub PR workflow → GitHub Action: invokes check
- Local CLI → Check orchestrator: runs check
- Local CLI → Preflight doctor: runs preflight
- GitHub Action → Check orchestrator: runs check
- Check orchestrator → Git revisions: reads revisions
- Check orchestrator → Policy config: loads policy
- Check orchestrator → Framework discovery: discovers tests
- Preflight doctor → Setup compatibility: checks support
- Check orchestrator → Test structure analysis: analyzes tests
- Check orchestrator → Integrity rules: evaluates changes
- Check orchestrator → Red-green verification: verifies changed tests
- Red-green verification → Isolated worktrees: creates worktrees
- Check orchestrator → Targeted mutation: runs when enabled
- Check orchestrator → Finding policy: applies policy
- Finding policy → PASS / WARN / BLOCK / ERROR: sets outcome
- Check orchestrator → Text and JSON reports: renders result
- GitHub Action → Action summary: writes summary
- Text and JSON reports → Local CLI: returns output
- Text and JSON reports → GitHub Action: returns output