sequant 1.20.3 → 2.0.0

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.
Files changed (137) hide show
  1. package/.claude-plugin/marketplace.json +2 -4
  2. package/.claude-plugin/plugin.json +1 -1
  3. package/README.md +29 -9
  4. package/dist/bin/cli.js +25 -2
  5. package/dist/src/commands/doctor.js +42 -9
  6. package/dist/src/commands/init.d.ts +1 -0
  7. package/dist/src/commands/init.js +52 -0
  8. package/dist/src/commands/logs.d.ts +1 -0
  9. package/dist/src/commands/logs.js +18 -2
  10. package/dist/src/commands/run.d.ts +7 -0
  11. package/dist/src/commands/run.js +235 -68
  12. package/dist/src/commands/serve.d.ts +13 -0
  13. package/dist/src/commands/serve.js +131 -0
  14. package/dist/src/commands/stats.d.ts +1 -0
  15. package/dist/src/commands/stats.js +185 -26
  16. package/dist/src/commands/status.d.ts +2 -0
  17. package/dist/src/commands/status.js +99 -50
  18. package/dist/src/index.d.ts +2 -2
  19. package/dist/src/index.js +4 -1
  20. package/dist/src/lib/ac-parser.d.ts +2 -0
  21. package/dist/src/lib/ac-parser.js +12 -2
  22. package/dist/src/lib/assess-comment-parser.d.ts +137 -0
  23. package/dist/src/lib/assess-comment-parser.js +344 -0
  24. package/dist/src/lib/ci/config.d.ts +22 -0
  25. package/dist/src/lib/ci/config.js +134 -0
  26. package/dist/src/lib/ci/index.d.ts +12 -0
  27. package/dist/src/lib/ci/index.js +10 -0
  28. package/dist/src/lib/ci/inputs.d.ts +29 -0
  29. package/dist/src/lib/ci/inputs.js +103 -0
  30. package/dist/src/lib/ci/labels.d.ts +34 -0
  31. package/dist/src/lib/ci/labels.js +101 -0
  32. package/dist/src/lib/ci/outputs.d.ts +25 -0
  33. package/dist/src/lib/ci/outputs.js +84 -0
  34. package/dist/src/lib/ci/triggers.d.ts +9 -0
  35. package/dist/src/lib/ci/triggers.js +86 -0
  36. package/dist/src/lib/ci/types.d.ts +131 -0
  37. package/dist/src/lib/ci/types.js +47 -0
  38. package/dist/src/lib/mcp-config.d.ts +54 -0
  39. package/dist/src/lib/mcp-config.js +172 -0
  40. package/dist/src/lib/merge-check/index.js +6 -12
  41. package/dist/src/lib/merge-check/types.d.ts +20 -7
  42. package/dist/src/lib/merge-check/types.js +11 -0
  43. package/dist/src/lib/phase-signal.d.ts +3 -3
  44. package/dist/src/lib/phase-signal.js +5 -3
  45. package/dist/src/lib/settings.d.ts +52 -0
  46. package/dist/src/lib/settings.js +41 -0
  47. package/dist/src/lib/shutdown.d.ts +16 -5
  48. package/dist/src/lib/shutdown.js +32 -12
  49. package/dist/src/lib/solve-comment-parser.d.ts +9 -102
  50. package/dist/src/lib/solve-comment-parser.js +13 -248
  51. package/dist/src/lib/stacks.d.ts +8 -0
  52. package/dist/src/lib/stacks.js +34 -0
  53. package/dist/src/lib/system.js +3 -7
  54. package/dist/src/lib/test-tautology-detector.d.ts +10 -0
  55. package/dist/src/lib/test-tautology-detector.js +43 -4
  56. package/dist/src/lib/upstream/assessment.js +9 -59
  57. package/dist/src/lib/upstream/issues.js +12 -75
  58. package/dist/src/lib/version-check.d.ts +2 -2
  59. package/dist/src/lib/version-check.js +6 -3
  60. package/dist/src/lib/version.d.ts +4 -0
  61. package/dist/src/lib/version.js +25 -0
  62. package/dist/src/lib/workflow/batch-executor.d.ts +18 -86
  63. package/dist/src/lib/workflow/batch-executor.js +232 -55
  64. package/dist/src/lib/workflow/drivers/agent-driver.d.ts +56 -0
  65. package/dist/src/lib/workflow/drivers/agent-driver.js +8 -0
  66. package/dist/src/lib/workflow/drivers/aider.d.ts +18 -0
  67. package/dist/src/lib/workflow/drivers/aider.js +160 -0
  68. package/dist/src/lib/workflow/drivers/claude-code.d.ts +17 -0
  69. package/dist/src/lib/workflow/drivers/claude-code.js +165 -0
  70. package/dist/src/lib/workflow/drivers/index.d.ts +20 -0
  71. package/dist/src/lib/workflow/drivers/index.js +27 -0
  72. package/dist/src/lib/workflow/error-classifier.d.ts +16 -0
  73. package/dist/src/lib/workflow/error-classifier.js +90 -0
  74. package/dist/src/lib/workflow/log-writer.d.ts +6 -3
  75. package/dist/src/lib/workflow/log-writer.js +57 -27
  76. package/dist/src/lib/workflow/metrics-schema.d.ts +9 -9
  77. package/dist/src/lib/workflow/phase-detection.d.ts +23 -0
  78. package/dist/src/lib/workflow/phase-detection.js +45 -29
  79. package/dist/src/lib/workflow/phase-executor.d.ts +42 -3
  80. package/dist/src/lib/workflow/phase-executor.js +340 -220
  81. package/dist/src/lib/workflow/phase-mapper.d.ts +1 -1
  82. package/dist/src/lib/workflow/phase-mapper.js +7 -7
  83. package/dist/src/lib/workflow/platforms/github.d.ts +157 -0
  84. package/dist/src/lib/workflow/platforms/github.js +466 -0
  85. package/dist/src/lib/workflow/platforms/index.d.ts +17 -0
  86. package/dist/src/lib/workflow/platforms/index.js +25 -0
  87. package/dist/src/lib/workflow/platforms/platform-provider.d.ts +67 -0
  88. package/dist/src/lib/workflow/platforms/platform-provider.js +8 -0
  89. package/dist/src/lib/workflow/pr-status.d.ts +2 -4
  90. package/dist/src/lib/workflow/pr-status.js +3 -16
  91. package/dist/src/lib/workflow/qa-cache.d.ts +58 -0
  92. package/dist/src/lib/workflow/qa-cache.js +88 -0
  93. package/dist/src/lib/workflow/reconcile.d.ts +69 -0
  94. package/dist/src/lib/workflow/reconcile.js +290 -0
  95. package/dist/src/lib/workflow/ring-buffer.d.ts +17 -0
  96. package/dist/src/lib/workflow/ring-buffer.js +37 -0
  97. package/dist/src/lib/workflow/run-log-schema.d.ts +115 -24
  98. package/dist/src/lib/workflow/run-log-schema.js +47 -12
  99. package/dist/src/lib/workflow/run-reflect.js +1 -1
  100. package/dist/src/lib/workflow/state-cleanup.js +21 -0
  101. package/dist/src/lib/workflow/state-manager.d.ts +34 -3
  102. package/dist/src/lib/workflow/state-manager.js +278 -126
  103. package/dist/src/lib/workflow/state-schema.d.ts +34 -30
  104. package/dist/src/lib/workflow/state-schema.js +35 -25
  105. package/dist/src/lib/workflow/state-utils.d.ts +3 -1
  106. package/dist/src/lib/workflow/state-utils.js +1 -0
  107. package/dist/src/lib/workflow/types.d.ts +208 -6
  108. package/dist/src/lib/workflow/types.js +20 -1
  109. package/dist/src/lib/workflow/worktree-discovery.d.ts +1 -1
  110. package/dist/src/lib/workflow/worktree-discovery.js +6 -14
  111. package/dist/src/lib/workflow/worktree-manager.js +33 -51
  112. package/dist/src/mcp/index.d.ts +4 -0
  113. package/dist/src/mcp/index.js +4 -0
  114. package/dist/src/mcp/resources.d.ts +7 -0
  115. package/dist/src/mcp/resources.js +111 -0
  116. package/dist/src/mcp/run-registry.d.ts +34 -0
  117. package/dist/src/mcp/run-registry.js +42 -0
  118. package/dist/src/mcp/server.d.ts +12 -0
  119. package/dist/src/mcp/server.js +50 -0
  120. package/dist/src/mcp/tools/logs.d.ts +7 -0
  121. package/dist/src/mcp/tools/logs.js +149 -0
  122. package/dist/src/mcp/tools/run.d.ts +121 -0
  123. package/dist/src/mcp/tools/run.js +591 -0
  124. package/dist/src/mcp/tools/status.d.ts +7 -0
  125. package/dist/src/mcp/tools/status.js +127 -0
  126. package/package.json +10 -1
  127. package/templates/hooks/post-tool.sh +19 -8
  128. package/templates/hooks/pre-tool.sh +36 -49
  129. package/templates/mcp.json +6 -0
  130. package/templates/skills/assess/SKILL.md +354 -352
  131. package/templates/skills/exec/SKILL.md +64 -1
  132. package/templates/skills/fullsolve/SKILL.md +35 -4
  133. package/templates/skills/qa/SKILL.md +486 -9
  134. package/templates/skills/qa/scripts/quality-checks.sh +1 -1
  135. package/templates/skills/setup/SKILL.md +386 -0
  136. package/templates/skills/solve/SKILL.md +38 -664
  137. package/templates/skills/spec/SKILL.md +90 -31
@@ -391,6 +391,51 @@ For each major decision:
391
391
 
392
392
  See [parallel-groups.md](references/parallel-groups.md) for parallelization format.
393
393
 
394
+ ### 2.5. Design Review (REQUIRED)
395
+
396
+ **Purpose:** Make design decisions explicit before implementation starts. This forces evaluation of *how* to build, not just *what* to build — catching wrong-layer, over-engineered, or pattern-mismatched approaches before code is written.
397
+
398
+ **Why this matters:** Repeated pattern across issues: implementation passes QA functionally but uses the wrong design — wrong layer, hacky shortcut, over-engineered approach. The fix cycle is expensive. Making design explicit here prevents it.
399
+
400
+ **Complexity Scaling:**
401
+ - **Simple issues** (`simple-fix`, `typo`, `docs-only` labels): Abbreviated — answer Q1 and Q3 only
402
+ - **Standard issues**: Answer all 4 questions
403
+ - **Complex issues** (`complex`, `refactor`, `breaking` labels): Answer all 4 questions with detailed rationale
404
+
405
+ **Answer these questions:**
406
+
407
+ 1. **Where does this logic belong?** — Which module/layer owns this change? Name the specific directory, file, or abstraction layer. If it spans layers, explain why.
408
+
409
+ 2. **What's the simplest correct approach?** — Actively reject over-engineering. What's the minimum implementation that satisfies all AC? What alternatives did you consider and reject?
410
+
411
+ 3. **What existing pattern does this follow?** — Name the specific pattern in the codebase. Confirm it fits this use case. If no existing pattern fits, explain why a new approach is needed.
412
+
413
+ 4. **What would a senior reviewer challenge?** — Anticipate design pushback. What's the most likely "why didn't you just...?" or "this should be in X instead" feedback?
414
+
415
+ **Example (standard issue):**
416
+
417
+ ```markdown
418
+ ## Design Review
419
+
420
+ 1. **Where does this logic belong?** Spec skill's SKILL.md prompt files — purely prompt engineering, not TypeScript. Same layer as Feature Quality Planning and AC Checklist sections.
421
+
422
+ 2. **What's the simplest correct approach?** Add markdown prompt text to SKILL.md. Reuse the existing complexity scaling pattern from Feature Quality Planning. No code, no new files, no abstractions.
423
+
424
+ 3. **What existing pattern does this follow?** Mirrors Feature Quality Planning exactly: required section, purpose statement, complexity scaling table, question format.
425
+
426
+ 4. **What would a senior reviewer challenge?** (1) "Why after Implementation Plan, not before?" — Design review needs the plan as input to evaluate. (2) "Won't this bloat output?" — Adds ~15 lines for standard, ~5 for simple-fix.
427
+ ```
428
+
429
+ **Example (simple-fix issue, abbreviated):**
430
+
431
+ ```markdown
432
+ ## Design Review
433
+
434
+ 1. **Where does this logic belong?** `src/lib/utils.ts` — utility function, same layer as existing helpers.
435
+
436
+ 3. **What existing pattern does this follow?** Same pattern as `formatDuration()` in the same file — pure function, no side effects, single responsibility.
437
+ ```
438
+
394
439
  ### 3. Plan Review
395
440
 
396
441
  Ask the user to confirm or adjust:
@@ -404,24 +449,24 @@ Ask the user to confirm or adjust:
404
449
 
405
450
  **Before** determining the recommended workflow, analyze the issue content for phase-relevant signals:
406
451
 
407
- #### Step 1: Check for Solve Comment (AC-4)
452
+ #### Step 1: Check for Assess Comment (AC-4)
408
453
 
409
- First, check if a `/solve` comment already exists for this issue:
454
+ First, check if an `/assess` comment already exists for this issue:
410
455
 
411
456
  ```bash
412
- # Check issue comments for solve workflow
413
- gh issue view <issue-number> --json comments --jq '.comments[].body' | grep -l "## Solve Workflow for Issues:" || true
457
+ # Check issue comments for assess workflow (includes legacy /solve format for backward compat)
458
+ gh issue view <issue-number> --json comments --jq '.comments[].body' | grep -l "## Assess Analysis\|## Solve Workflow for Issues:" || true
414
459
  ```
415
460
 
416
- **If solve comment found:**
417
- - Extract phases from the solve workflow (e.g., `spec → exec → test → qa`)
418
- - Use solve recommendations as the primary source (after labels)
419
- - Skip content analysis for phases (solve already analyzed)
420
- - Include in output: `"Solve comment found - using /solve workflow recommendations"`
461
+ **If assess comment found:**
462
+ - Extract phases from the assess workflow (e.g., `spec → exec → test → qa`)
463
+ - Use assess recommendations as the primary source (after labels)
464
+ - Skip content analysis for phases (assess already analyzed)
465
+ - Include in output: `"Assess comment found - using /assess workflow recommendations"`
421
466
 
422
467
  #### Step 2: Analyze Title for Keywords (AC-1)
423
468
 
424
- If no solve comment, analyze the issue title for phase-relevant keywords:
469
+ If no assess comment, analyze the issue title for phase-relevant keywords:
425
470
 
426
471
  | Pattern | Detection | Suggested Phase |
427
472
  |---------|-----------|-----------------|
@@ -468,7 +513,7 @@ Content analysis **supplements** label detection - it can only ADD phases, never
468
513
 
469
514
  **Priority order (highest first):**
470
515
  1. **Labels** (explicit, highest priority)
471
- 2. **Solve comment** (if exists)
516
+ 2. **Assess comment** (if exists)
472
517
  3. **Title keywords**
473
518
  4. **Body patterns** (lowest priority)
474
519
 
@@ -491,42 +536,41 @@ Content analysis **supplements** label detection - it can only ADD phases, never
491
536
  **Final phases:** spec → exec → test → security-review → qa
492
537
  ```
493
538
 
494
- ### 4.5. Solve Comment Detection (AC-4, AC-5)
539
+ ### 4.5. Assess Comment Detection (AC-4, AC-5)
495
540
 
496
- **Before making your own phase recommendation**, check if `/solve` has already posted an analysis comment to this issue:
541
+ **Before making your own phase recommendation**, check if `/assess` has already posted an analysis comment to this issue:
497
542
 
498
543
  ```bash
499
- # Check for solve analysis comment on the issue
500
- solve_comment=$(gh issue view <issue-number> --json comments \
501
- --jq '[.comments[].body | select(test("## Solve Analysis|<!-- solve:phases="))] | last // empty')
544
+ # Check for assess analysis comment on the issue (includes legacy /solve format for backward compat)
545
+ assess_comment=$(gh issue view <issue-number> --json comments \
546
+ --jq '[.comments[].body | select(test("## Assess Analysis|## Solve Analysis|<!-- assess:phases=|<!-- solve:phases="))] | last // empty')
502
547
  ```
503
548
 
504
- **If a solve analysis comment exists:**
549
+ **If an assess analysis comment exists:**
505
550
 
506
551
  1. Parse the HTML comment markers to extract the recommended phases:
507
552
  ```
508
- <!-- solve:phases=exec,qa --> → phases: ["exec", "qa"]
509
- <!-- solve:skip-spec=true --> skip spec phase
510
- <!-- solve:browser-test=false --> no browser testing needed
511
- <!-- solve:quality-loop=true --> → enable quality loop
553
+ <!-- assess:phases=exec,qa --> → phases: ["exec", "qa"] (spec not included = skip spec)
554
+ <!-- assess:browser-test=false --> no browser testing needed
555
+ <!-- assess:quality-loop=true --> enable quality loop
512
556
  ```
513
557
 
514
- 2. **Use the solve recommendation as your starting point** for the phase recommendation in step 5.
558
+ 2. **Use the assess recommendation as your starting point** for the phase recommendation in step 5.
515
559
 
516
- 3. **You may override the solve recommendation**, but you MUST document why:
560
+ 3. **You may override the assess recommendation**, but you MUST document why:
517
561
  ```markdown
518
562
  ## Recommended Workflow
519
563
 
520
564
  **Phases:** spec → exec → test → qa
521
565
  **Quality Loop:** enabled
522
- **Reasoning:** Solve recommended `exec → qa`, but codebase analysis reveals UI components
566
+ **Reasoning:** Assess recommended `exec → qa`, but codebase analysis reveals UI components
523
567
  are affected (found `.tsx` files in change scope), so browser testing is needed.
524
- Overriding solve recommendation with explanation.
568
+ Overriding assess recommendation with explanation.
525
569
  ```
526
570
 
527
- 4. If the solve comment recommends `skip-spec=true`, acknowledge this in your output but proceed with spec since `/spec` was explicitly invoked.
571
+ 4. If the assess comment recommends phases that don't include `spec` (e.g., `phases=exec,qa`), acknowledge this in your output but proceed with spec since `/spec` was explicitly invoked.
528
572
 
529
- **If no solve analysis comment exists:** Proceed with your own analysis as normal (step 5).
573
+ **If no assess analysis comment exists:** Proceed with your own analysis as normal (step 5).
530
574
 
531
575
  ### 5. Recommended Workflow
532
576
 
@@ -654,7 +698,8 @@ npx tsx scripts/state/update.ts fail <issue-number> spec "Error description"
654
698
  - [ ] **Verification Criteria** - Each AC has Verification Method and Test Scenario
655
699
  - [ ] **Conflict Risk Analysis** - Check for in-flight work, include if conflicts found
656
700
  - [ ] **Implementation Plan** - 3-7 concrete steps with codebase references
657
- - [ ] **Content Analysis** - Title/body analysis results (or "Solve comment found" if using /solve)
701
+ - [ ] **Design Review** - All 4 questions answered (abbreviated to Q1+Q3 for simple-fix/typo/docs-only labels)
702
+ - [ ] **Content Analysis** - Title/body analysis results (or "Assess comment found" if using /assess)
658
703
  - [ ] **Recommended Workflow** - Phases, Quality Loop setting, Signal Sources, and Reasoning
659
704
  - [ ] **Label Review** - Current vs recommended labels based on plan analysis
660
705
  - [ ] **Open Questions** - Any ambiguities with recommended defaults
@@ -700,6 +745,20 @@ You MUST include these sections in order:
700
745
 
701
746
  ---
702
747
 
748
+ ## Design Review
749
+
750
+ 1. **Where does this logic belong?** [Module/layer that owns this change]
751
+
752
+ 2. **What's the simplest correct approach?** [Minimum implementation, rejected alternatives]
753
+
754
+ 3. **What existing pattern does this follow?** [Named pattern, confirmation it fits]
755
+
756
+ 4. **What would a senior reviewer challenge?** [Anticipated pushback]
757
+
758
+ <!-- For simple-fix/typo/docs-only: only Q1 and Q3 required -->
759
+
760
+ ---
761
+
703
762
  ## Open Questions
704
763
 
705
764
  1. **[Question]**
@@ -710,10 +769,10 @@ You MUST include these sections in order:
710
769
 
711
770
  ## Content Analysis
712
771
 
713
- <!-- If solve comment found: -->
714
- **Source:** Solve comment found - using /solve workflow recommendations
772
+ <!-- If assess comment found: -->
773
+ **Source:** Assess comment found - using /assess workflow recommendations
715
774
 
716
- <!-- If no solve comment, show analysis: -->
775
+ <!-- If no assess comment, show analysis: -->
717
776
  ### Signal Sources
718
777
 
719
778
  | Phase | Source | Confidence | Reason |