Skip to content

feat(#313): Add batch-level integration QA — sequant merge --check - #324

Merged
admarble merged 4 commits into
mainfrom
feature/313-feat-run-add-batch-level-integration-qa-sequan
Feb 22, 2026
Merged

admarble merged 4 commits into
mainfrom
feature/313-feat-run-add-batch-level-integration-qa-sequan

Conversation

@admarble

Copy link
Copy Markdown
Contributor

Summary

  • Add sequant merge command with --check, --scan, --review, --all, and --post flags for batch-level integration QA
  • Phase 1 (--check): combined branch testing, template/source mirroring check, cross-issue file overlap detection
  • Phase 2 (--scan): residual pattern detection — extracts removed patterns from diffs and greps codebase for remaining instances
  • Produces structured Markdown report with per-issue verdicts (PASS/WARN/FAIL) and batch verdict (READY/NEEDS_ATTENTION/BLOCKED)
  • Exit codes: 0 = all pass, 1 = warnings, 2 = failures
  • Auto-detects issues from most recent run log when no issues specified
  • 18 unit tests covering mirroring, overlap detection, and report generation

AC Coverage

AC Description Status
AC-1 Combined branch testing ✅ Implemented
AC-2 Template/source mirroring check ✅ Implemented
AC-3 Residual pattern detection ✅ Implemented
AC-4 Cross-issue file overlap detection ✅ Implemented
AC-5 Merge readiness report ✅ Implemented
AC-6 CLI integration ✅ Implemented
AC-7 Benchmark baseline ⚠️ Needs manual validation against historical data

Test plan

  • npm run build passes
  • npm run lint passes (0 warnings)
  • npm test passes (18 merge-check tests + all existing tests)
  • Manual: Run npx sequant merge --check against a batch with active worktrees
  • Manual: Validate residual pattern detection against historical run b4030aa9

Closes #313

Add `sequant merge --check` command for post-run integration verification.

Phase 1 (--check): combined branch testing, template mirroring,
cross-issue file overlap detection.
Phase 2 (--scan): residual pattern detection from diffs.

Includes CLI registration, structured report output (markdown/JSON),
exit codes (0=pass, 1=warn, 2=fail), and 18 unit tests.
- Gap 1: Classify overlaps as additive vs conflicting using git diff
  hunk analysis (rangesOverlap helper)
- Gap 2: Refactor getChecksToRun with phase arrays and Phase 3 stub
  comments; export for testing
- Gap 3: Add fetchIssueTitle fallback via gh CLI when no run log
- Gap 4: Add formatBranchReportMarkdown for per-PR scoped reports;
  postReportToGitHub now posts only relevant findings per PR
- Gap 5: Add 30 unit tests covering getExitCode, getChecksToRun,
  buildResult, extractPatternsFromDiff, rangesOverlap,
  findMostRecentLog, formatBranchReportMarkdown
- Gap 6: Add benchmark documentation with actual results from batch
  b4030aa9
- Fix remote branch assumption: add getBranchRef() helper that returns
  local ref for worktree-only branches instead of always using origin/
- Fix extractPatternsFromDiff tests: pass BranchInfo objects instead of
  raw strings, add issueNumber propagation assertions
- Fix batch verdict computation: propagate batch-level check errors to
  batchVerdict (prevents false READY when combined-branch-test fails)
- Add false positive rate analysis to benchmark doc (AC-7 target: <10%)
- Fix benchmark doc date typo (2025 → 2026)
The finally block previously checked out 'main' which fails in worktrees
(main is checked out in the main repo). Now saves the current branch
before creating the temp branch and restores it in the finally block.
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(run): Add batch-level integration QA — sequant merge --check

1 participant