Skip to content

feat(#530): short-circuit /qa when prior qa:completed SHA matches HEAD - #541

Merged
admarble merged 4 commits into
mainfrom
feature/530-feat-qa-short-circuit-re-run-when-prior-qa-complet
Apr 20, 2026
Merged

admarble merged 4 commits into
mainfrom
feature/530-feat-qa-short-circuit-re-run-when-prior-qa-complet

Conversation

@admarble

Copy link
Copy Markdown
Contributor

Summary

  • Add Phase 0a to /qa skill that parses the latest qa phase marker from issue comments; when status=completed and commitSHA matches current HEAD, skip sub-agent spawning and output a short-circuit summary
  • Bypass with /qa <N> --force or /qa <N> --no-cache (existing flag, consistency)
  • Failed prior runs (status=failed) never short-circuit — user likely wants a re-run after a fix
  • Mirrored across .claude/skills/, skills/, templates/skills/ (verified: check-skill-sync.ts → synced qa/SKILL.md — 3/3 match)

Acceptance Criteria (6/6 met)

  • AC-1: Parse latest qa:completed marker, extract commitSHA
  • AC-2: Short-circuit when SHA matches HEAD + status=completed; skip sub-agents, output summary
  • AC-3: --force bypasses
  • AC-4: --no-cache bypasses (consistency with existing flag at line 172)
  • AC-5: status=failed never short-circuits
  • AC-6: Three-directory sync verified

Test plan

  • npm run build — passes (no TS changes)
  • npm run lint — passes
  • npm test -- tests — 528/528 passing
  • npx tsx scripts/check-skill-sync.ts — qa/SKILL.md synced 3/3
  • Manual: next invocation of /qa on an already-QA'd issue should short-circuit (testing this feature naturally validates it)
  • Manual: /qa <N> --force still runs the full pipeline

Closes #530

Add Phase 0a to the QA skill that parses the latest qa phase marker from
issue comments and, when status=completed and commitSHA matches current
HEAD, skips sub-agent spawning and code review. Previous QA result is
surfaced via a short-circuit summary. Failed prior runs never short-circuit
(user likely wants a re-run after a fix). Bypass with --force or --no-cache.

- AC-1: Parse latest qa:* marker, extract commitSHA
- AC-2: Short-circuit when status=completed and SHA matches HEAD
- AC-3: --force bypasses short-circuit
- AC-4: --no-cache bypasses (consistency with existing flag)
- AC-5: status=failed never short-circuits
- AC-6: Mirrored across .claude/skills/, skills/, templates/skills/
Phase 0a's short-circuit template has a `Prior Verdict:` field but the
previously emitted marker stored only status + commitSHA. Add an optional
`verdict` field to `status:"completed"` markers so the short-circuit
summary surfaces the prior verdict literally, without re-reading the
comment body. Legacy markers without the field still trigger the
short-circuit but fall back to `(see prior QA comment)` — additive,
backward-compatible.
The detection query used `--jq '[.comments[].body]'`, which JSON-encodes
each body (quotes → \", < → \u003c). That escaping defeated the grep
pattern — markers were present in the comments but never extracted, so
the short-circuit path would never trigger in practice.

Switch to `--jq '.comments[].body'` (streaming, raw output). Verified
against issue #530's real comments: pattern now matches the qa:completed
marker and extracts all four fields.
…hort-circuit-re-run-when-prior-qa-complet

# Conflicts:
#	CHANGELOG.md
@admarble
admarble merged commit 6648085 into main Apr 20, 2026
8 checks passed
@admarble
admarble deleted the feature/530-feat-qa-short-circuit-re-run-when-prior-qa-complet branch April 20, 2026 01:10
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.

feat(qa): short-circuit re-run when prior qa:completed SHA matches HEAD

1 participant