Skip to content

feat: Comprehensive QA improvements - execution evidence, test quality, and anti-pattern detection #147

Closed

Description

@admarble

Summary

Consolidates three related QA improvement issues into a single comprehensive enhancement. The core problem: QA passes without catching real issues because it relies on self-reporting rather than actual verification.


Part 1: Execution Evidence (from #143)

Problem: QA self-reports "verified working: yes" without actually running the feature. Analysis of 34 run logs shows zero /loop phases triggered - QA passes every time.

Solution: QA must execute at least one smoke command and include output as evidence.

Execution Matrix

Change Type QA Must Execute Example
scripts/ Run the script with safe args npx tsx scripts/foo.ts --help
CLI commands Run with --help or dry-run npx sequant run --help
UI components Note: requires /test for browser verification N/A
Types/config only Waiver with reason N/A
Tests only Run the tests npm test -- --grep "feature"

Output Format

### Execution Evidence

| Test Type | Command | Exit Code | Result |
|-----------|---------|-----------|--------|
| Smoke test | `npx tsx scripts/analytics.ts --help` | 0 | Usage info displayed ✓ |

**Evidence status:** Complete / Incomplete / Waived (reason)

Verdict Gating

Verdict Evidence Requirement
READY_FOR_MERGE Evidence status: Complete
AC_MET_BUT_NOT_A_PLUS Evidence status: Incomplete + note why

Part 2: Test Quality Checklist (from #91)

Problem: Tests exist but don't actually validate behavior - testing implementation details, happy path only, over-mocking, snapshot abuse.

Solution: Add test quality evaluation checklist to QA.

Checklist

## Test Quality Review

### Behavior vs Implementation
- [ ] Tests assert on observable outputs, not internal state
- [ ] Refactoring internals shouldn't require test changes

### Coverage Depth  
- [ ] Error paths tested (what happens when things fail?)
- [ ] Boundary conditions tested (empty, null, max values)

### Mock Hygiene
- [ ] Mocks are minimal (only external dependencies)
- [ ] Not mocking the thing being tested

### Test Reliability
- [ ] No timing-dependent assertions (use waitFor, not setTimeout)
- [ ] Tests are deterministic and independent

Example Output

### Test Quality: ⚠️ Needs Attention

**Over-mocking in `auth.test.ts`:**
- 4 of 5 modules mocked, leaving little to actually test

**Missing error paths in `checkout.test.ts`:**
- No tests for payment failure scenario

Part 3: Anti-Pattern Detection (from #92)

Problem: Common issues slip through that experts would catch immediately - N+1 queries, swallowed errors, sketchy dependencies.

Solution: Add lightweight pattern-matching sanity checks.

New Dependency Audit

Flag Threshold
Low downloads < 1,000/week
Stale No updates in 12+ months
License risk UNLICENSED, GPL in MIT project
Size concern > 100kb for utility
Security advisory Known vulnerabilities

Code Pattern Checks

Category Pattern Suggestion
Performance N+1 query (await in loop) Use batch query or Promise.all
Performance Unbounded loop Add iteration limit
Error Handling Empty catch block Log or rethrow
Error Handling Unhandled promise Add .catch()
Security Hardcoded secret Use env variable
Security SQL concatenation Use parameterized query
Memory Uncleared interval Clear in cleanup
A11y Image without alt Add descriptive alt

Acceptance Criteria

Execution Evidence

  • QA detects change type (scripts/CLI/UI/types) and determines execution requirement
  • QA executes at least one smoke command for scripts/CLI changes
  • Output includes "Execution Evidence" section with command, exit code, result
  • READY_FOR_MERGE requires evidence status "Complete" or explicit waiver

Test Quality

  • QA includes test quality checklist adapted per test type
  • Common anti-patterns flagged with suggested fixes
  • Test quality section in QA output

Anti-Pattern Detection

  • QA audits new dependencies added during exec
  • Dependency flags: low downloads, stale, license issues, size, vulnerabilities
  • Code sanity checks for common anti-patterns
  • Each flag includes location and fix suggestion

Files to Modify

  1. .claude/skills/qa/SKILL.md - Add all three enhancement areas
  2. .claude/skills/qa/references/quality-gates.md - Add evidence requirements
  3. .claude/skills/qa/references/testing-requirements.md - Add test quality guidance

Supersedes

Activity

  1. admarble commented on Jan 21, 2026

    @admarble
    ContributorAuthor

    Plan: Comprehensive QA Improvements

    Acceptance Criteria Checklist

    Part 1: Execution Evidence

    • AC-1: QA detects change type (scripts/CLI/UI/types) and determines execution requirement
    • AC-2: QA executes at least one smoke command for scripts/CLI changes
    • AC-3: Output includes "Execution Evidence" section with command, exit code, result
    • AC-4: READY_FOR_MERGE requires evidence status "Complete" or explicit waiver

    Part 2: Test Quality

    • AC-5: QA includes test quality checklist adapted per test type
    • AC-6: Common anti-patterns flagged with suggested fixes
    • AC-7: Test quality section in QA output

    Part 3: Anti-Pattern Detection

    • AC-8: QA audits new dependencies added during exec
    • AC-9: Dependency flags: low downloads, stale, license issues, size, vulnerabilities
    • AC-10: Code sanity checks for common anti-patterns
    • AC-11: Each flag includes location and fix suggestion

    Implementation Plan

    Phase Files Description
    1 SKILL.md, quality-gates.md Execution evidence workflow and verdict gating
    2 SKILL.md, new test-quality-checklist.md Test quality evaluation checklist
    3 SKILL.md, new anti-pattern-detection.md Dependency audit + code pattern checks
    4 SKILL.md Integrated output template

    Files to Modify

    1. .claude/skills/qa/SKILL.md - Main skill file (all three enhancements)
    2. .claude/skills/qa/references/quality-gates.md - Evidence requirements for verdicts
    3. .claude/skills/qa/references/testing-requirements.md - Test quality guidance

    Files to Create

    1. .claude/skills/qa/references/test-quality-checklist.md - Test quality evaluation
    2. .claude/skills/qa/references/anti-pattern-detection.md - Anti-pattern detection

    Supersedes

    This issue consolidates:


    Plan generated by /spec

  2. added
    enhancement
    planned
    on Jan 21, 2026
  3. added 2 commits that reference this issue on Jan 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementplanned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions