sequant 1.20.3 → 2.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.claude-plugin/marketplace.json +2 -4
- package/.claude-plugin/plugin.json +1 -1
- package/README.md +36 -15
- package/dist/bin/cli.js +25 -2
- package/dist/src/commands/doctor.js +42 -9
- package/dist/src/commands/init.d.ts +1 -0
- package/dist/src/commands/init.js +52 -0
- package/dist/src/commands/logs.d.ts +1 -0
- package/dist/src/commands/logs.js +18 -2
- package/dist/src/commands/run.d.ts +7 -0
- package/dist/src/commands/run.js +235 -68
- package/dist/src/commands/serve.d.ts +13 -0
- package/dist/src/commands/serve.js +131 -0
- package/dist/src/commands/stats.d.ts +1 -0
- package/dist/src/commands/stats.js +185 -26
- package/dist/src/commands/status.d.ts +2 -0
- package/dist/src/commands/status.js +99 -50
- package/dist/src/index.d.ts +2 -2
- package/dist/src/index.js +4 -1
- package/dist/src/lib/ac-parser.d.ts +2 -0
- package/dist/src/lib/ac-parser.js +12 -2
- package/dist/src/lib/assess-comment-parser.d.ts +137 -0
- package/dist/src/lib/assess-comment-parser.js +344 -0
- package/dist/src/lib/ci/config.d.ts +22 -0
- package/dist/src/lib/ci/config.js +134 -0
- package/dist/src/lib/ci/index.d.ts +12 -0
- package/dist/src/lib/ci/index.js +10 -0
- package/dist/src/lib/ci/inputs.d.ts +29 -0
- package/dist/src/lib/ci/inputs.js +103 -0
- package/dist/src/lib/ci/labels.d.ts +34 -0
- package/dist/src/lib/ci/labels.js +101 -0
- package/dist/src/lib/ci/outputs.d.ts +25 -0
- package/dist/src/lib/ci/outputs.js +84 -0
- package/dist/src/lib/ci/triggers.d.ts +9 -0
- package/dist/src/lib/ci/triggers.js +86 -0
- package/dist/src/lib/ci/types.d.ts +131 -0
- package/dist/src/lib/ci/types.js +47 -0
- package/dist/src/lib/mcp-config.d.ts +54 -0
- package/dist/src/lib/mcp-config.js +172 -0
- package/dist/src/lib/merge-check/index.js +6 -12
- package/dist/src/lib/merge-check/types.d.ts +20 -7
- package/dist/src/lib/merge-check/types.js +11 -0
- package/dist/src/lib/phase-signal.d.ts +3 -3
- package/dist/src/lib/phase-signal.js +5 -3
- package/dist/src/lib/settings.d.ts +52 -0
- package/dist/src/lib/settings.js +41 -0
- package/dist/src/lib/shutdown.d.ts +16 -5
- package/dist/src/lib/shutdown.js +32 -12
- package/dist/src/lib/solve-comment-parser.d.ts +9 -102
- package/dist/src/lib/solve-comment-parser.js +13 -248
- package/dist/src/lib/stacks.d.ts +8 -0
- package/dist/src/lib/stacks.js +34 -0
- package/dist/src/lib/system.js +3 -7
- package/dist/src/lib/test-tautology-detector.d.ts +10 -0
- package/dist/src/lib/test-tautology-detector.js +43 -4
- package/dist/src/lib/upstream/assessment.js +9 -59
- package/dist/src/lib/upstream/issues.js +12 -75
- package/dist/src/lib/version-check.d.ts +2 -2
- package/dist/src/lib/version-check.js +6 -3
- package/dist/src/lib/version.d.ts +4 -0
- package/dist/src/lib/version.js +25 -0
- package/dist/src/lib/workflow/batch-executor.d.ts +26 -86
- package/dist/src/lib/workflow/batch-executor.js +269 -55
- package/dist/src/lib/workflow/drivers/agent-driver.d.ts +56 -0
- package/dist/src/lib/workflow/drivers/agent-driver.js +8 -0
- package/dist/src/lib/workflow/drivers/aider.d.ts +18 -0
- package/dist/src/lib/workflow/drivers/aider.js +160 -0
- package/dist/src/lib/workflow/drivers/claude-code.d.ts +17 -0
- package/dist/src/lib/workflow/drivers/claude-code.js +165 -0
- package/dist/src/lib/workflow/drivers/index.d.ts +20 -0
- package/dist/src/lib/workflow/drivers/index.js +27 -0
- package/dist/src/lib/workflow/error-classifier.d.ts +16 -0
- package/dist/src/lib/workflow/error-classifier.js +90 -0
- package/dist/src/lib/workflow/log-writer.d.ts +6 -3
- package/dist/src/lib/workflow/log-writer.js +57 -27
- package/dist/src/lib/workflow/metrics-schema.d.ts +9 -9
- package/dist/src/lib/workflow/phase-detection.d.ts +23 -0
- package/dist/src/lib/workflow/phase-detection.js +45 -29
- package/dist/src/lib/workflow/phase-executor.d.ts +42 -3
- package/dist/src/lib/workflow/phase-executor.js +375 -229
- package/dist/src/lib/workflow/phase-mapper.d.ts +1 -1
- package/dist/src/lib/workflow/phase-mapper.js +7 -7
- package/dist/src/lib/workflow/platforms/github.d.ts +157 -0
- package/dist/src/lib/workflow/platforms/github.js +466 -0
- package/dist/src/lib/workflow/platforms/index.d.ts +17 -0
- package/dist/src/lib/workflow/platforms/index.js +25 -0
- package/dist/src/lib/workflow/platforms/platform-provider.d.ts +67 -0
- package/dist/src/lib/workflow/platforms/platform-provider.js +8 -0
- package/dist/src/lib/workflow/pr-status.d.ts +2 -4
- package/dist/src/lib/workflow/pr-status.js +3 -16
- package/dist/src/lib/workflow/qa-cache.d.ts +58 -0
- package/dist/src/lib/workflow/qa-cache.js +88 -0
- package/dist/src/lib/workflow/reconcile.d.ts +69 -0
- package/dist/src/lib/workflow/reconcile.js +290 -0
- package/dist/src/lib/workflow/ring-buffer.d.ts +17 -0
- package/dist/src/lib/workflow/ring-buffer.js +37 -0
- package/dist/src/lib/workflow/run-log-schema.d.ts +115 -24
- package/dist/src/lib/workflow/run-log-schema.js +47 -12
- package/dist/src/lib/workflow/run-reflect.js +1 -1
- package/dist/src/lib/workflow/state-cleanup.js +21 -0
- package/dist/src/lib/workflow/state-manager.d.ts +34 -3
- package/dist/src/lib/workflow/state-manager.js +278 -126
- package/dist/src/lib/workflow/state-schema.d.ts +34 -30
- package/dist/src/lib/workflow/state-schema.js +35 -25
- package/dist/src/lib/workflow/state-utils.d.ts +3 -1
- package/dist/src/lib/workflow/state-utils.js +1 -0
- package/dist/src/lib/workflow/types.d.ts +224 -6
- package/dist/src/lib/workflow/types.js +20 -1
- package/dist/src/lib/workflow/worktree-discovery.d.ts +1 -1
- package/dist/src/lib/workflow/worktree-discovery.js +6 -14
- package/dist/src/lib/workflow/worktree-manager.js +33 -51
- package/dist/src/mcp/index.d.ts +4 -0
- package/dist/src/mcp/index.js +4 -0
- package/dist/src/mcp/resources.d.ts +7 -0
- package/dist/src/mcp/resources.js +111 -0
- package/dist/src/mcp/run-registry.d.ts +34 -0
- package/dist/src/mcp/run-registry.js +42 -0
- package/dist/src/mcp/server.d.ts +12 -0
- package/dist/src/mcp/server.js +50 -0
- package/dist/src/mcp/tools/logs.d.ts +7 -0
- package/dist/src/mcp/tools/logs.js +149 -0
- package/dist/src/mcp/tools/run.d.ts +121 -0
- package/dist/src/mcp/tools/run.js +591 -0
- package/dist/src/mcp/tools/status.d.ts +7 -0
- package/dist/src/mcp/tools/status.js +127 -0
- package/package.json +26 -7
- package/templates/hooks/post-tool.sh +19 -8
- package/templates/hooks/pre-tool.sh +36 -49
- package/templates/mcp.json +6 -0
- package/templates/skills/assess/SKILL.md +354 -352
- package/templates/skills/exec/SKILL.md +64 -1
- package/templates/skills/fullsolve/SKILL.md +35 -4
- package/templates/skills/qa/SKILL.md +486 -9
- package/templates/skills/qa/scripts/quality-checks.sh +1 -1
- package/templates/skills/setup/SKILL.md +386 -0
- package/templates/skills/solve/SKILL.md +38 -664
- package/templates/skills/spec/SKILL.md +90 -31
|
@@ -588,6 +588,51 @@ echo "Current branch: $CURRENT_BRANCH"
|
|
|
588
588
|
- Documents intentional deferrals
|
|
589
589
|
- Enables better QA in `/qa` phase
|
|
590
590
|
|
|
591
|
+
### 3e2. Simulate QA Before PR (REQUIRED)
|
|
592
|
+
|
|
593
|
+
**Purpose:** Prevent first-pass QA failures by simulating the QA reviewer's perspective before creating a PR. Root cause analysis of multi-attempt QA issues (#448) found that the majority of first-pass failures stem from gaps exec could have caught with deliberate self-verification.
|
|
594
|
+
|
|
595
|
+
**Top failure patterns exec must check for (from analysis of 6 multi-attempt issues):**
|
|
596
|
+
|
|
597
|
+
| Pattern | Frequency | What to check |
|
|
598
|
+
|---------|-----------|---------------|
|
|
599
|
+
| Test coverage gaps | 50% (3/6 issues) | Changed files have corresponding tests |
|
|
600
|
+
| Incomplete self-verification | 17% (1/6 issues) | Each AC verified against literal wording, not just spirit |
|
|
601
|
+
| Lint/build not run pre-PR | 17% (1/6 issues) | `npm run lint` + `npm run build` pass locally |
|
|
602
|
+
|
|
603
|
+
*Note: Remaining 33% were QA detection issues, addressed separately in QA skill.*
|
|
604
|
+
|
|
605
|
+
**Simulate QA Checklist (answer each before creating PR):**
|
|
606
|
+
|
|
607
|
+
1. **Test-to-Change Alignment:** For each source file you modified:
|
|
608
|
+
```bash
|
|
609
|
+
# List changed source files (excluding tests)
|
|
610
|
+
changed=$(git diff main...HEAD --name-only | grep -E '\.(ts|tsx|js|jsx)$' | grep -v -E '\.(test|spec)\.' || true)
|
|
611
|
+
|
|
612
|
+
# For each, verify a corresponding test exists and covers the change
|
|
613
|
+
for file in $changed; do
|
|
614
|
+
base=$(basename "$file" | sed 's/\.[^.]*$//')
|
|
615
|
+
test_exists=$(find . -name "${base}.test.*" -o -name "${base}.spec.*" 2>/dev/null | head -1 || true)
|
|
616
|
+
if [[ -z "$test_exists" ]]; then
|
|
617
|
+
echo "WARNING NO TEST: $file"
|
|
618
|
+
fi
|
|
619
|
+
done
|
|
620
|
+
```
|
|
621
|
+
- If critical files lack tests, add tests before PR creation
|
|
622
|
+
- If tests exist but don't cover the specific change, note as known gap
|
|
623
|
+
|
|
624
|
+
2. **QA Reviewer Perspective:** Ask yourself:
|
|
625
|
+
- "If I were reviewing this PR for the first time, what would I flag?"
|
|
626
|
+
- "Are there any 'I'll fix it later' shortcuts that QA will catch?"
|
|
627
|
+
- "Did I actually run the feature, or just verify it compiles?"
|
|
628
|
+
|
|
629
|
+
**If any check reveals a gap:**
|
|
630
|
+
- Fix the gap before creating the PR
|
|
631
|
+
- Re-run build/lint/tests after fixing
|
|
632
|
+
- Update the AC verification table
|
|
633
|
+
|
|
634
|
+
**Do NOT skip this step.** This single checkpoint addresses the most common first-pass QA failure patterns.
|
|
635
|
+
|
|
591
636
|
### 3f. CHANGELOG Update (REQUIRED for user-facing changes)
|
|
592
637
|
|
|
593
638
|
**Purpose:** Ensure all user-facing changes are documented in the CHANGELOG before PR creation. This prevents documentation gaps and reduces release overhead.
|
|
@@ -1161,7 +1206,7 @@ for script in $shell_scripts; do
|
|
|
1161
1206
|
# 3. Unused function detection
|
|
1162
1207
|
funcs=$(grep -oE "^[a-zA-Z_]+\(\)" "$script" | sed 's/()//' || true)
|
|
1163
1208
|
for func in $funcs; do
|
|
1164
|
-
calls=$(grep -c "\b${func}\b" "$script" ||
|
|
1209
|
+
calls=$(grep -c "\b${func}\b" "$script" || true)
|
|
1165
1210
|
if [[ $calls -lt 2 ]]; then
|
|
1166
1211
|
echo "⚠️ Function '$func' defined but possibly not called"
|
|
1167
1212
|
fi
|
|
@@ -1636,6 +1681,22 @@ When retrying a failed agent, use the error recovery template from [prompt-templ
|
|
|
1636
1681
|
|
|
1637
1682
|
Before each commit, self-check against these standards:
|
|
1638
1683
|
|
|
1684
|
+
### 0. Branch Verification
|
|
1685
|
+
|
|
1686
|
+
**CRITICAL:** Verify you are on the correct feature branch, not main/master.
|
|
1687
|
+
|
|
1688
|
+
```bash
|
|
1689
|
+
CURRENT_BRANCH=$(git branch --show-current)
|
|
1690
|
+
if [[ "$CURRENT_BRANCH" == "main" || "$CURRENT_BRANCH" == "master" ]]; then
|
|
1691
|
+
echo "❌ ERROR: On $CURRENT_BRANCH — do NOT commit here."
|
|
1692
|
+
echo " Navigate to the feature worktree or create a branch first."
|
|
1693
|
+
exit 1
|
|
1694
|
+
fi
|
|
1695
|
+
echo "✓ On branch: $CURRENT_BRANCH"
|
|
1696
|
+
```
|
|
1697
|
+
|
|
1698
|
+
**Why:** Sub-agents and shell context resets can silently switch the working directory back to main. Without this check, commits land on main instead of the feature branch.
|
|
1699
|
+
|
|
1639
1700
|
### 1. Scope Check
|
|
1640
1701
|
Does this change directly address an AC item?
|
|
1641
1702
|
- **Yes** → Proceed
|
|
@@ -1724,6 +1785,8 @@ The goal is to satisfy AC with the smallest, safest change possible.
|
|
|
1724
1785
|
2. "If this feature broke tomorrow, would the current tests catch it?"
|
|
1725
1786
|
3. "What's the weakest part of this implementation?"
|
|
1726
1787
|
4. "Am I reporting success metrics without honest self-evaluation?"
|
|
1788
|
+
5. "For each changed source file, does a corresponding test file exist? If not, why is that acceptable?"
|
|
1789
|
+
6. "Did I run `npm run lint` and fix all errors, or am I hoping CI will pass?"
|
|
1727
1790
|
|
|
1728
1791
|
**Include this section in your output:**
|
|
1729
1792
|
|
|
@@ -143,7 +143,14 @@ When posting progress comments after each phase, append the appropriate marker:
|
|
|
143
143
|
### 0.1 Git State Verification
|
|
144
144
|
|
|
145
145
|
```bash
|
|
146
|
-
# Check current branch
|
|
146
|
+
# Check current branch — warn if on main/master
|
|
147
|
+
CURRENT_BRANCH=$(git branch --show-current)
|
|
148
|
+
echo "Current branch: $CURRENT_BRANCH"
|
|
149
|
+
if [[ "$CURRENT_BRANCH" == "main" || "$CURRENT_BRANCH" == "master" ]]; then
|
|
150
|
+
echo "⚠️ WARNING: On $CURRENT_BRANCH — will need feature branch before committing"
|
|
151
|
+
fi
|
|
152
|
+
|
|
153
|
+
# Check recent commits
|
|
147
154
|
git log --oneline -5 --stat
|
|
148
155
|
|
|
149
156
|
# Check for any existing work on this issue
|
|
@@ -412,6 +419,30 @@ while qa_iteration < 2:
|
|
|
412
419
|
|
|
413
420
|
## Phase 5: Pull Request (PR)
|
|
414
421
|
|
|
422
|
+
### 5.0 Branch Verification Gate
|
|
423
|
+
|
|
424
|
+
**CRITICAL: Verify you are on the correct feature branch before committing or creating a PR.**
|
|
425
|
+
|
|
426
|
+
```bash
|
|
427
|
+
CURRENT_BRANCH=$(git branch --show-current)
|
|
428
|
+
echo "Current branch: $CURRENT_BRANCH"
|
|
429
|
+
|
|
430
|
+
# HARD GATE: Must be on a feature branch, not main/master
|
|
431
|
+
if [[ "$CURRENT_BRANCH" == "main" || "$CURRENT_BRANCH" == "master" ]]; then
|
|
432
|
+
echo "❌ ERROR: On $CURRENT_BRANCH — commits must NOT land on main."
|
|
433
|
+
echo " Fix: git checkout feature/<issue-number>-* or create a new branch."
|
|
434
|
+
exit 1
|
|
435
|
+
fi
|
|
436
|
+
|
|
437
|
+
# Soft check: branch should match the issue number
|
|
438
|
+
if ! echo "$CURRENT_BRANCH" | grep -q "<issue-number>"; then
|
|
439
|
+
echo "⚠️ WARNING: Branch '$CURRENT_BRANCH' does not contain issue number <issue-number>."
|
|
440
|
+
echo " Verify this is the correct branch before continuing."
|
|
441
|
+
fi
|
|
442
|
+
```
|
|
443
|
+
|
|
444
|
+
**Why this matters:** Sub-agents and shell context resets can silently switch the working directory back to main. Without this check, commits land on main instead of the feature branch, requiring messy recovery (cherry-picks, force pushes, re-created PRs).
|
|
445
|
+
|
|
415
446
|
### 5.1 Create PR (if not exists)
|
|
416
447
|
|
|
417
448
|
```bash
|
|
@@ -435,8 +466,8 @@ Post completion comment to issue with:
|
|
|
435
466
|
**IMPORTANT:** Merge the PR first, then clean up the worktree.
|
|
436
467
|
|
|
437
468
|
```bash
|
|
438
|
-
# 1. Merge PR (--delete-branch
|
|
439
|
-
gh pr merge <N> --squash
|
|
469
|
+
# 1. Merge PR (without --delete-branch; cleanup happens after success)
|
|
470
|
+
gh pr merge <N> --squash
|
|
440
471
|
|
|
441
472
|
# 2. Clean up worktree (removes local worktree + branch)
|
|
442
473
|
./scripts/dev/cleanup-worktree.sh feature/<issue-number>-*
|
|
@@ -444,7 +475,7 @@ gh pr merge <N> --squash --delete-branch
|
|
|
444
475
|
# 3. Issue auto-closes if commit message contains "Fixes #N"
|
|
445
476
|
```
|
|
446
477
|
|
|
447
|
-
**Why this order matters:** The cleanup script checks if the PR is merged before proceeding.
|
|
478
|
+
**Why this order matters:** The cleanup script checks if the PR is merged before proceeding. Merging without `--delete-branch` avoids worktree lock conflicts. The post-tool hook and cleanup script handle branch removal after merge succeeds. If the merge fails, the worktree is preserved so work isn't lost.
|
|
448
479
|
|
|
449
480
|
### 5.4 Post-Merge Verification
|
|
450
481
|
|