sequant 2.4.0 → 2.6.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 (61) hide show
  1. package/.claude-plugin/marketplace.json +2 -2
  2. package/.claude-plugin/plugin.json +2 -2
  3. package/README.md +125 -163
  4. package/dist/bin/cli.js +26 -3
  5. package/dist/dashboard/server.js +1 -0
  6. package/dist/marketplace/external_plugins/sequant/.claude-plugin/plugin.json +2 -2
  7. package/dist/marketplace/external_plugins/sequant/README.md +6 -3
  8. package/dist/marketplace/external_plugins/sequant/hooks/post-tool.sh +92 -0
  9. package/dist/marketplace/external_plugins/sequant/hooks/pre-tool.sh +18 -9
  10. package/dist/marketplace/external_plugins/sequant/hooks/relay-check.sh +107 -0
  11. package/dist/marketplace/external_plugins/sequant/skills/_shared/references/behavior-rule-detection.md +205 -0
  12. package/dist/marketplace/external_plugins/sequant/skills/_shared/references/subagent-types.md +21 -8
  13. package/dist/marketplace/external_plugins/sequant/skills/assess/SKILL.md +302 -86
  14. package/dist/marketplace/external_plugins/sequant/skills/assess/references/predicted-collision-detection.md +109 -0
  15. package/dist/marketplace/external_plugins/sequant/skills/docs/SKILL.md +141 -22
  16. package/dist/marketplace/external_plugins/sequant/skills/exec/SKILL.md +83 -78
  17. package/dist/marketplace/external_plugins/sequant/skills/fullsolve/SKILL.md +377 -137
  18. package/dist/marketplace/external_plugins/sequant/skills/loop/SKILL.md +28 -0
  19. package/dist/marketplace/external_plugins/sequant/skills/merger/SKILL.md +621 -0
  20. package/dist/marketplace/external_plugins/sequant/skills/qa/SKILL.md +741 -232
  21. package/dist/marketplace/external_plugins/sequant/skills/qa/scripts/quality-checks.sh +47 -1
  22. package/dist/marketplace/external_plugins/sequant/skills/setup/SKILL.md +12 -6
  23. package/dist/marketplace/external_plugins/sequant/skills/spec/SKILL.md +217 -964
  24. package/dist/marketplace/external_plugins/sequant/skills/spec/references/parallel-groups.md +7 -0
  25. package/dist/marketplace/external_plugins/sequant/skills/spec/references/quality-checklist.md +75 -0
  26. package/dist/marketplace/external_plugins/sequant/skills/spec/references/recommended-workflow.md +4 -2
  27. package/dist/marketplace/external_plugins/sequant/skills/test/SKILL.md +0 -27
  28. package/dist/marketplace/external_plugins/sequant/skills/testgen/SKILL.md +24 -44
  29. package/dist/src/commands/ready-tui-adapter.d.ts +59 -0
  30. package/dist/src/commands/ready-tui-adapter.js +130 -0
  31. package/dist/src/commands/ready.d.ts +49 -0
  32. package/dist/src/commands/ready.js +243 -0
  33. package/dist/src/commands/run-flags.d.ts +31 -0
  34. package/dist/src/commands/run-flags.js +34 -0
  35. package/dist/src/commands/run.js +7 -1
  36. package/dist/src/commands/status.js +4 -0
  37. package/dist/src/lib/cli-ui/run-renderer.d.ts +7 -1
  38. package/dist/src/lib/cli-ui/run-renderer.js +28 -28
  39. package/dist/src/lib/settings.d.ts +34 -0
  40. package/dist/src/lib/settings.js +23 -1
  41. package/dist/src/lib/workflow/phase-executor.js +17 -2
  42. package/dist/src/lib/workflow/platforms/github.d.ts +6 -0
  43. package/dist/src/lib/workflow/platforms/github.js +17 -0
  44. package/dist/src/lib/workflow/ready-gate.d.ts +155 -0
  45. package/dist/src/lib/workflow/ready-gate.js +374 -0
  46. package/dist/src/lib/workflow/reconcile.js +6 -0
  47. package/dist/src/lib/workflow/state-schema.d.ts +3 -0
  48. package/dist/src/lib/workflow/state-schema.js +1 -0
  49. package/dist/src/lib/workflow/types.d.ts +27 -3
  50. package/dist/src/ui/tui/App.js +8 -2
  51. package/dist/src/ui/tui/IssueBox.js +3 -4
  52. package/dist/src/ui/tui/index.d.ts +13 -4
  53. package/dist/src/ui/tui/index.js +19 -5
  54. package/dist/src/ui/tui/row-cap.d.ts +51 -0
  55. package/dist/src/ui/tui/row-cap.js +76 -0
  56. package/dist/src/ui/tui/teardown.d.ts +20 -0
  57. package/dist/src/ui/tui/teardown.js +29 -0
  58. package/dist/src/ui/tui/theme.d.ts +3 -0
  59. package/dist/src/ui/tui/theme.js +3 -0
  60. package/package.json +19 -8
  61. package/templates/skills/qa/SKILL.md +5 -2
@@ -7,8 +7,8 @@
7
7
  "plugins": [
8
8
  {
9
9
  "name": "sequant",
10
- "description": "Structured workflow system for Claude Code - GitHub issue resolution with spec, exec, test, and QA phases. Includes 17 skills, MCP server with workflow tools, and pre/post-tool hooks.",
11
- "version": "2.4.0",
10
+ "description": "AI coding agent orchestrator for Claude Code resolve GitHub issues end-to-end with isolated git worktrees, quality gates, and an MCP server. Includes 17 skills, workflow MCP tools, and pre/post-tool hooks.",
11
+ "version": "2.6.0",
12
12
  "author": {
13
13
  "name": "sequant-io",
14
14
  "email": "hello@sequant.io"
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "sequant",
3
- "description": "Structured workflow system for Claude Code - GitHub issue resolution with spec, exec, test, and QA phases",
4
- "version": "2.4.0",
3
+ "description": "AI coding agent orchestrator for Claude Code resolve GitHub issues end-to-end with isolated git worktrees and quality gates, through spec → exec qa phases.",
4
+ "version": "2.6.0",
5
5
  "author": {
6
6
  "name": "sequant-io",
7
7
  "email": "hello@sequant.io"
package/README.md CHANGED
@@ -1,87 +1,96 @@
1
1
  # Sequant
2
2
 
3
- **Workflow automation for AI coding agents.**
3
+ **Spec-driven AI coding agents — every acceptance criterion verified, stops at the human merge gate.**
4
4
 
5
- Solve GitHub issues with structured phases and quality gates — from issue to merge-ready PR.
5
+ For teams that can't ship un-reviewed AI code. Solve GitHub issues with structured phases and quality gates — from issue to merge-ready PR.
6
6
 
7
7
  **[sequant.io](https://sequant.io)** — docs, guides, and getting started.
8
8
 
9
9
  [![npm version](https://img.shields.io/npm/v/sequant.svg)](https://www.npmjs.com/package/sequant)
10
+ [![npm downloads](https://img.shields.io/npm/dm/sequant.svg)](https://www.npmjs.com/package/sequant)
11
+ [![GitHub stars](https://img.shields.io/github/stars/sequant-io/sequant.svg)](https://github.com/sequant-io/sequant/stargazers)
12
+ [![CI](https://github.com/sequant-io/sequant/actions/workflows/ci.yml/badge.svg)](https://github.com/sequant-io/sequant/actions/workflows/ci.yml)
10
13
  [![License: MIT](https://img.shields.io/badge/License-MIT-green.svg)](https://opensource.org/licenses/MIT)
11
14
 
12
- ### What's new in 2.x
15
+ AI coding agents write code well, but leave you to run the workflow around it — planning, isolation, review, and merge safety. Sequant wraps an agent in a structured **spec → exec → qa** pipeline with isolated git worktrees and quality gates, taking a GitHub issue from triage to a merge-ready PR without babysitting each step.
13
16
 
14
- - **MCP server** `sequant serve` exposes workflow orchestration as MCP tools (`sequant_run`, `sequant_status`, `sequant_logs`). Any MCP client can drive Sequant headlessly.
15
- - **`/assess` unification** — `/solve` is merged into `/assess` with a 6-action vocabulary (PROCEED, CLOSE, MERGE, REWRITE, CLARIFY, PARK). `/solve` still works as an alias.
16
- - **Parallel execution with per-issue locks** — multi-issue runs are concurrent by default (`--concurrency`); `.sequant/locks/` prevents two sessions from clobbering the same issue.
17
- - **Stacked PRs** — `sequant run --stacked` chains issue PRs onto their predecessor branch so reviewers see the incremental diff per issue instead of the cumulative chain diff.
18
- - **Live run dashboard + cohort analytics** — unified renderer with a two-zone TTY grid (active issues + append-only events log); `sequant stats --label <name> --since YYYY-MM-DD` filters runs for measuring feature- or class-specific success rates.
19
- - **Interactive relay** — `sequant prompt <issue> "<message>"` sends queries or directives into a running headless `sequant run`, and `sequant watch <issue>` tails the replies. Bidirectional communication with detached and CI-driven sessions.
20
- - **Worktree isolation for parallel agents** — `sequant run --isolate-parallel` gives each parallel `/exec` agent group its own sub-worktree with merge-back via `git merge --no-ff`, eliminating file conflicts between concurrent agents structurally rather than by convention.
21
- - **GitHub Actions & multi-agent backends** — label-triggered and comment-triggered CI workflows out of the box; `--agent aider` for non-Claude-Code execution.
17
+ See the [CHANGELOG](CHANGELOG.md) for release notes, or the [migration guide](CHANGELOG.md#migration-from-v1x) if upgrading from v1.x.
22
18
 
23
- Upgrading from v1.x? See the [migration guide](CHANGELOG.md#migration-from-v1x).
19
+ ### What's new in 2.5
20
+
21
+ - **`sequant ready <issue>`** — a post-resolve A+ QA gate that drives a resolved issue through a full-weight `qa → loop → qa` pass and **stops at the human merge gate — it never merges**.
22
+ - **Live phase-matrix TUI** — `sequant ready` and `sequant run` render the active phase and quality-loop iteration in place (boxed Ink dashboard on a TTY by default), so a long run is never indistinguishable from a hang. Opt out with `--no-tui` (line renderer) or `-s`/`--quiet` (heartbeat-only); non-TTY output auto-degrades.
23
+ - **Per-issue concurrency locks** — a second session on the same issue is skipped with a clear message instead of clobbering the first; `sequant locks` inspects and clears them.
24
24
 
25
25
  ## Quick Start
26
26
 
27
- ### Option A: Plugin (interactive users)
27
+ ### Prerequisites
28
28
 
29
- In Claude Code:
29
+ **An AI coding agent — one of:**
30
+ - [Claude Code](https://claude.ai/code) — default agent
31
+ - [Aider](https://aider.chat/) — alternative, via `--agent aider`
32
+
33
+ **Always required (both):**
34
+ - [GitHub CLI](https://cli.github.com/) — run `gh auth login`
35
+ - Git — for worktree-based isolation
36
+
37
+ **For the npm/CLI install path:** Node.js 22.12+
38
+
39
+ **Optional MCP (Model Context Protocol) servers — enhanced features:**
40
+ - `chrome-devtools` — enables `/test` for browser-based UI testing
41
+ - `sequential-thinking` — enhanced reasoning for complex decisions
42
+ - `context7` — library documentation lookup
43
+
44
+ > **Note:** Sequant is optimized for Node.js/TypeScript projects. The worktree workflow works with any git repository.
45
+
46
+ ### Install
47
+
48
+ Pick the path that matches **where you run Sequant**:
49
+
50
+ **Inside Claude Code (plugin)** — skills, hooks, and MCP tools, no npm required:
30
51
  ```
31
52
  /plugin install sequant@sequant-io/sequant
32
53
  /sequant:setup
33
54
  ```
34
55
 
35
- You get skills, hooks, and MCP tools no npm required.
56
+ **Headless / CI (npm package)** drive runs from the terminal or a CI job:
57
+ ```bash
58
+ npm install sequant # or: pnpm add / yarn add / bun add sequant
59
+ npx sequant init # install skills into your project
60
+ npx sequant doctor # verify setup
61
+ ```
36
62
 
37
- ### Option B: Package install (power users / CI)
63
+ ### Your first run
38
64
 
39
- ```bash
40
- npm install sequant # npm
41
- pnpm add sequant # pnpm
42
- yarn add sequant # yarn
43
- bun add sequant # bun
65
+ Inside Claude Code, solve an issue end-to-end:
66
+ ```
67
+ /fullsolve 123
44
68
  ```
45
69
 
46
- Then initialize:
70
+ Or headless from the terminal (`-Q` runs the quality loop):
47
71
  ```bash
48
- npx sequant init # Install skills to your project
49
- npx sequant doctor # Verify setup
72
+ npx sequant run 123 -Q
50
73
  ```
51
74
 
52
- ### Start Using
75
+ Either way, Sequant creates an isolated worktree, posts a plan comment to the issue, and opens a merge-ready PR.
53
76
 
54
- Then in Claude Code:
77
+ ### What a run looks like
55
78
 
56
- ```
57
- /fullsolve 123 # Solve issue #123 end-to-end
58
- ```
79
+ A real `/fullsolve 683` (the run that built `sequant ready` itself):
59
80
 
60
- Or step-by-step:
81
+ ```text
82
+ SEQUANT WORKFLOW · #683
83
+ spec ✔ 9 ACs extracted · plan posted to the issue
84
+ exec ✔ 29 tests + docs + lint fix · committed to the feature branch
85
+ qa ✔ full build + suite · 8/9 ACs MET · 1 manual AC marked PENDING (not faked)
86
+ pr ✔ opened #686 · 7/7 checks green · MERGEABLE
61
87
 
88
+ → stops at the human merge gate · never auto-merges · run `merge` to land it
62
89
  ```
63
- /spec 123 # Plan implementation
64
- /exec 123 # Build in isolated worktree
65
- /qa 123 # Review before merge
66
- ```
67
-
68
- ### Prerequisites
69
-
70
- **Required (one of):**
71
- - [Claude Code](https://claude.ai/code) — default agent
72
- - [Aider](https://aider.chat/) — alternative via `--agent aider`
73
- - [GitHub CLI](https://cli.github.com/) — run `gh auth login`
74
- - Git (for worktree-based isolation)
75
90
 
76
- **For npm installation:**
77
- - Node.js 22.12+
91
+ QA findings post back to the issue as comments, with each acceptance criterion re-checked independently.
78
92
 
79
- **Optional MCP servers (enhanced features):**
80
- - `chrome-devtools` — enables `/test` for browser-based UI testing
81
- - `sequential-thinking` — enhanced reasoning for complex decisions
82
- - `context7` — library documentation lookup
83
-
84
- > **Note:** Sequant is optimized for Node.js/TypeScript projects. The worktree workflow works with any git repository.
93
+ > 📹 A recorded demo GIF of the live run grid is coming — tracked in [#695](https://github.com/sequant-io/sequant/issues/695).
85
94
 
86
95
  ---
87
96
 
@@ -135,159 +144,111 @@ When checks fail, `/loop` automatically fixes and re-runs (up to 3x).
135
144
 
136
145
  ---
137
146
 
138
- ## Two Ways to Use
147
+ ## Using Sequant
139
148
 
140
- ### Interactive (Slash Commands)
149
+ ### Solve one issue (the 80% path)
141
150
 
142
- Type commands in Claude Code or any MCP-connected client:
151
+ The most common invocation no flags. Auto-creates a worktree, posts a plan comment to the issue, and opens a PR.
143
152
 
153
+ In Claude Code:
144
154
  ```
145
- /fullsolve 123 # Complete pipeline
146
- /spec 123 → /exec → /qa # Step by step
155
+ /fullsolve 123
147
156
  ```
148
157
 
149
- ### Headless (CLI)
150
-
151
- Run without Claude Code UI:
152
-
158
+ Headless (`-Q` runs the quality loop):
153
159
  ```bash
154
- npx sequant run 123 # Single issue
155
- npx sequant run 1 2 3 # Batch (parallel)
156
- npx sequant run 123 --quality-loop
157
- npx sequant run 123 --base feature/dashboard # Custom base branch
158
- npx sequant merge --check # Verify batch before merging
160
+ npx sequant run 123 -Q
159
161
  ```
160
162
 
161
- ---
162
-
163
- ## Commands
163
+ > `sequant run --help` is the authoritative flag list. There is **no** `--skip-spec` — to skip the plan phase, use `--phases exec,qa`.
164
164
 
165
- ### Core Workflow
165
+ ### Batch: triage, then run
166
166
 
167
- | Command | Purpose |
168
- |---------|---------|
169
- | `/spec` | Plan implementation, draft acceptance criteria |
170
- | `/exec` | Implement in isolated git worktree |
171
- | `/test` | Browser-based UI testing (optional) |
172
- | `/qa` | Code review and quality gate |
167
+ For several issues at once, the ritual is `/assess` → paste the commands it emits:
173
168
 
174
- ### Automation
169
+ ```
170
+ /assess 101 102 103
171
+ ```
175
172
 
176
- | Command | Purpose |
177
- |---------|---------|
178
- | `/fullsolve` | Complete pipeline in one command |
179
- | `/assess` | Triage issue, recommend workflow (6-action vocabulary) |
180
- | `/loop` | Fix iteration when checks fail |
173
+ `/assess` returns a dashboard (PROCEED / PARK / CLOSE per issue), dependency ordering, and ready-to-paste commands like `npx sequant run 101 -Q`. The quality loop (`-Q`) is part of every command it generates.
181
174
 
182
- ### Integration
175
+ ### From Claude Code, via the MCP server
183
176
 
184
- | Command | Purpose |
185
- |---------|---------|
186
- | `/merger` | Multi-issue merge coordination |
187
- | `/testgen` | Generate test stubs from spec |
188
- | `/verify` | CLI/script execution verification |
189
- | `/setup` | Initialize Sequant in a project |
177
+ With the plugin installed, drive runs through the MCP server from inside Claude Code:
190
178
 
191
- ### Utilities
179
+ ```
180
+ use sequant plugin to fullsolve 123
181
+ ```
192
182
 
193
- | Command | Purpose |
194
- |---------|---------|
195
- | `/docs` | Generate feature documentation |
196
- | `/clean` | Repository cleanup |
197
- | `/improve` | Codebase analysis and improvement discovery |
198
- | `/security-review` | Deep security analysis |
199
- | `/reflect` | Workflow improvement analysis |
183
+ You get back a structured phase-timing table and verdict. The same tools — `sequant_run`, `sequant_status`, `sequant_logs` — are available to any MCP client; `npx sequant serve` exposes them headlessly.
200
184
 
201
- ---
185
+ ### QA on the issue
202
186
 
203
- ## CLI Commands
187
+ Re-verify a resolved issue or PR. Findings land as **issue comments**, with each acceptance criterion independently re-checked:
204
188
 
205
- ```bash
206
- npx sequant init # Initialize in project
207
- npx sequant update # Update skill templates
208
- npx sequant doctor # Check installation
209
- npx sequant status # Show version and config
210
- npx sequant run <issues...> # Execute workflow
211
- npx sequant merge <issues...> # Batch integration QA before merging
212
- npx sequant state <cmd> # Manage workflow state (init/rebuild/clean)
213
- npx sequant locks <cmd> # Inspect/clear per-issue concurrency locks
214
- npx sequant stats # View local workflow analytics
215
- npx sequant dashboard # Launch real-time workflow dashboard
189
+ ```
190
+ 123 any gaps? # re-QA issue #123
191
+ /qa pr488 # re-QA a PR
216
192
  ```
217
193
 
218
- Cohort filtering: `npx sequant stats --label docs --since 2026-01-01`. See [Analytics — Filtering by Label or Date](docs/reference/analytics.md#filtering-by-label-or-date) for details.
194
+ ### Merge
219
195
 
220
- See [Run Command Options](docs/reference/run-command.md), [Merge Command](docs/reference/merge-command.md), [State Command](docs/reference/state-command.md), and [Analytics](docs/reference/analytics.md) for details.
196
+ ```
197
+ merge # squash-merge + sync main + worktree cleanup + post-merge build/test
198
+ ```
221
199
 
222
200
  ---
223
201
 
224
- ## Concurrency
202
+ ## Command Reference
225
203
 
226
- Sequant prevents two sessions from working on the same GitHub issue at the
227
- same time. When `sequant run` starts, each issue claims a per-issue lock at
228
- `.sequant/locks/<issue>.lock` containing the holder's PID, hostname, start
229
- time, and command. A second session attempting the same issue is skipped
230
- with a clear error and the rest of the batch continues.
204
+ Most work goes through a handful of top-level commands. The rest are either pipeline internals (run for you) or occasional tools.
231
205
 
232
- **Stale recovery.** Locks are auto-cleared in three situations:
206
+ ### Everyday
233
207
 
234
- 1. Same host, PID no longer alive → cleared immediately (covers SIGKILL and
235
- crashes).
236
- 2. Cross-host, lock older than 2 hourscleared by age.
237
- 3. Manual: `sequant locks clear <issue>` (with safety check by default).
208
+ | Command | What it does |
209
+ |---------|--------------|
210
+ | `/fullsolve <issue>` | Complete spec exec qa pipeline; opens a PR. The 80% path. |
211
+ | `/assess <issues…>` | Triage one or more issues; emits a dashboard + ready-to-paste `run` commands (6-action vocabulary). |
212
+ | `npx sequant run <issues…>` | Headless equivalent of `/fullsolve`; batches run in parallel. Add `-Q` for the quality loop. |
213
+ | `/qa <issue>` | Code review + quality gate; posts findings as issue comments. |
214
+ | `npx sequant merge <issues…>` | Batch integration QA before merging. |
238
215
 
239
- **Taking over an active session.** `sequant run --force <issue>` writes a
240
- new lock claiming the issue. Add `--signal-other` to also SIGTERM the prior
241
- PID (same host, alive only). Plain `--force` does not signal — use it when
242
- you already know the other session is dead.
216
+ ### Pipeline internals
243
217
 
244
- **Inspecting locks.**
218
+ `/spec`, `/exec`, `/loop`, `/testgen`, `/test` are the phases that `/fullsolve` and `sequant run` orchestrate for you. You can invoke them directly, but rarely need to.
245
219
 
246
- ```bash
247
- npx sequant locks list # Show every active lock
248
- npx sequant locks clear 123 # Clear lock for #123 (refuses fresh)
249
- npx sequant locks clear 123 --force # Clear unconditionally
250
- ```
220
+ ### Occasional / advanced
251
221
 
252
- **Skill wiring** (`/fullsolve`, `/assess`). The `/fullsolve` skill claims the
253
- lock at Phase 0.3, releases it at Phase 5.5, AND releases on every halt
254
- branch (spec failure, exec exhausted, etc.) so an aborted run frees the
255
- lock immediately. `/assess` probes it read-only and surfaces a dashboard
256
- warning when any issue is in use. Both use these subcommands directly from
257
- bash:
222
+ | Command | What it does |
223
+ |---------|--------------|
224
+ | `sequant ready <issue>` | Post-resolve full-weight A+ QA gate; drives to merge-readiness, then stops at the human merge gate (never merges). |
225
+ | `/merger` | Multi-issue merge coordination. |
226
+ | `/improve` | Codebase analysis and improvement discovery. |
227
+ | `/security-review` | Deep security analysis. |
228
+ | `/verify` | CLI/script execution verification. |
229
+ | `/docs` · `/clean` · `/reflect` | Feature docs, repo cleanup, workflow reflection. |
230
+
231
+ ### CLI utilities
258
232
 
259
233
  ```bash
260
- npx sequant locks acquire 123 --command="/fullsolve 123" --skip-pid-check
261
- npx sequant locks release 123 # idempotent; safe on every error path
262
- npx sequant locks check 123 --json # exit 1 when held, prints holder JSON
263
- npx sequant locks check-batch 100 101 102 # /assess: emits lines for held issues only
234
+ npx sequant init # initialize in project
235
+ npx sequant update # update skill templates
236
+ npx sequant doctor # check installation
237
+ npx sequant status # show version and config
238
+ npx sequant state <cmd> # manage workflow state (init/rebuild/clean)
239
+ npx sequant locks <cmd> # inspect/clear per-issue concurrency locks
240
+ npx sequant stats # local workflow analytics (cohort filter: --label / --since)
241
+ npx sequant dashboard # real-time workflow dashboard
242
+ npx sequant serve # expose workflow tools over MCP
264
243
  ```
265
244
 
266
- `--skip-pid-check` is required for skill shells: the Node process that runs
267
- `locks acquire` exits immediately, so its PID is dead before the lock is
268
- released. With the flag set, stale detection falls back to age-only on the
269
- holder's own host. The default skill-lock TTL is **6h** (separate from the
270
- 2h cross-host TTL) — long enough to cover virtually every `/fullsolve` run
271
- including multi-iteration QA loops. Override per-process via
272
- `SEQUANT_SKILL_LOCK_TTL_MS=<milliseconds>`.
273
-
274
- A skill that crashes mid-run leaves at most a 6h orphan; clear it manually
275
- with `sequant locks clear <issue>` to recover sooner. The skill's explicit
276
- release calls on every halt branch (see `.claude/skills/fullsolve/SKILL.md`
277
- Phase 0.3 release contract) mean this corner case should be rare in practice.
245
+ See [Run Command Options](docs/reference/run-command.md), [Merge Command](docs/reference/merge-command.md), [State Command](docs/reference/state-command.md), and [Analytics](docs/reference/analytics.md) for details.
278
246
 
279
- **Read-only commands** (`status`, `merge`, `/assess`) warn when an issue is
280
- locked but do not block.
247
+ ---
281
248
 
282
- **MCP / orchestrator mode.** When the `SEQUANT_ORCHESTRATOR` env var is set
283
- (in-process or remote MCP-driven runs), all lock operations are no-ops —
284
- the orchestrator caller is responsible for any coordination.
249
+ ## Concurrency
285
250
 
286
- **Caveats.** The lock relies on `open(O_CREAT | O_EXCL)` and is reliable on
287
- local filesystems. NFS and other network filesystems may not honor those
288
- semantics; users on networked repos may see false positives. The
289
- `SEQUANT_LOCKS_DIR` env var overrides the lock directory (used in tests
290
- and unusual layouts).
251
+ Multi-issue runs are parallel by default, and a per-issue lock (`.sequant/locks/<issue>.lock`) stops two sessions from clobbering the same issue — see [Concurrency & Per-Issue Locks](docs/reference/concurrency.md) for stale recovery, takeover (`--force`), and `sequant locks` subcommands.
291
252
 
292
253
  ---
293
254
 
@@ -328,6 +289,7 @@ See [Customization Guide](docs/guides/customization.md) for all options.
328
289
  - [What Is Sequant](docs/concepts/what-is-sequant.md) — Elevator pitch, pipeline diagram, architecture
329
290
  - [Workflow Concepts](docs/concepts/workflow-phases.md)
330
291
  - [Run Command](docs/reference/run-command.md)
292
+ - [Concurrency & Per-Issue Locks](docs/reference/concurrency.md)
331
293
  - [Git Workflows](docs/guides/git-workflows.md)
332
294
  - [Customization](docs/guides/customization.md)
333
295
  - [Troubleshooting](docs/troubleshooting.md)
package/dist/bin/cli.js CHANGED
@@ -4,7 +4,7 @@
4
4
  *
5
5
  * Sequential AI phases with quality gates for any codebase.
6
6
  */
7
- import { Command, InvalidArgumentError } from "commander";
7
+ import { Command, InvalidArgumentError, Option } from "commander";
8
8
  import chalk from "chalk";
9
9
  import { fileURLToPath } from "url";
10
10
  import { dirname, resolve } from "path";
@@ -46,6 +46,7 @@ import { dashboardCommand } from "../src/commands/dashboard.js";
46
46
  import { stateInitCommand, stateRebuildCommand, stateCleanCommand, } from "../src/commands/state.js";
47
47
  import { syncCommand, areSkillsOutdated } from "../src/commands/sync.js";
48
48
  import { mergeCommand } from "../src/commands/merge.js";
49
+ import { readyCommand, } from "../src/commands/ready.js";
49
50
  import { conventionsCommand } from "../src/commands/conventions.js";
50
51
  import { locksListCommand, locksClearCommand, locksAcquireCommand, locksReleaseCommand, locksCheckCommand, locksCheckBatchCommand, } from "../src/commands/locks.js";
51
52
  import { promptCommand } from "../src/commands/prompt.js";
@@ -172,13 +173,18 @@ program
172
173
  .option("--no-log", "Disable JSON logging for this run")
173
174
  .option("--log-path <path>", "Custom log directory path")
174
175
  .option("-Q, --quality-loop", "Enable quality loop with auto-retry")
176
+ // #705: `-q` is a hidden alias for the quality loop (Commander 14 allows only
177
+ // one short flag per Option, so it can't live on --quality-loop directly).
178
+ // `runCommand` ORs `qualityLoopAlias` into `qualityLoop`. `-q` no longer maps
179
+ // to --quiet, which moved to `-s` to end the `-q`/`-Q` collision.
180
+ .addOption(new Option("-q, --quality-loop-alias", "Alias for -Q/--quality-loop").hideHelp())
175
181
  .option("--max-iterations <n>", "Max iterations for quality loop (default: 3)", parseInt)
176
182
  .option("--batch <issues>", 'Group of issues to run together (e.g., --batch "1 2" --batch "3")', (value, prev) => prev.concat([value]), [])
177
183
  .option("--smart-tests", "Enable smart test detection (default)")
178
184
  .option("--no-smart-tests", "Disable smart test detection")
179
185
  .option("--testgen", "Run testgen phase after spec")
180
186
  .option("--security-review", "Run security-review phase after spec")
181
- .option("-q, --quiet", "Suppress version warnings and non-essential output")
187
+ .option("-s, --quiet", "Suppress version warnings and non-essential output (heartbeat-only)")
182
188
  .option("--chain", "Chain issues: each branches from previous (implies --sequential)")
183
189
  .option("--stacked", "Stack PRs: middle PRs target predecessor branch instead of main; first/last target main (implies --chain)")
184
190
  .option("--qa-gate", "Wait for QA pass before starting next issue in chain (requires --chain)")
@@ -194,7 +200,12 @@ program
194
200
  .option("--isolate-parallel", "Isolate parallel agent groups in separate worktrees (prevents file conflicts)")
195
201
  .option("--reflect", "Analyze run results and suggest improvements")
196
202
  .option("--agent <name>", 'Agent driver for phase execution (default: "claude-code")')
197
- .option("--experimental-tui", "Render live multi-issue dashboard (requires TTY; falls back to linear output when piped)")
203
+ // #705: the boxed Ink TUI is now the default on a TTY. `--no-tui` opts out to
204
+ // the line-based phase-matrix renderer; non-TTY / piped output auto-degrades.
205
+ .option("--no-tui", "Disable the boxed Ink dashboard; use the line-based phase-matrix renderer")
206
+ // #705: `--experimental-tui` is now a hidden no-op alias (the TUI is the
207
+ // default) so existing scripts and muscle-memory keep parsing.
208
+ .addOption(new Option("--experimental-tui").hideHelp())
198
209
  .option("--no-relay", "Disable interactive relay (#383); `sequant prompt` cannot reach this run")
199
210
  .action(runCommand);
200
211
  program
@@ -255,6 +266,18 @@ program
255
266
  .option("--json", "Output as JSON")
256
267
  .option("-v, --verbose", "Enable verbose output")
257
268
  .action(mergeCommand);
269
+ program
270
+ .command("ready")
271
+ .description("Post-resolve A+ QA gate — drive an issue to merge-readiness, then stop at the human merge gate (never merges)")
272
+ .argument("<issue>", "Issue number to drive to readiness")
273
+ .option("--policy <policy>", "Gate policy: 'ac' (default, stop at ACs met) or 'a-plus' (loop to READY_FOR_MERGE)")
274
+ .option("--max-iterations <n>", "Max QA passes before halting for human review (default: settings.run.maxIterations)", parseInt)
275
+ .option("--budget <tokens>", "Token budget; halt cleanly with a 'needs human' message on exhaustion", parseInt)
276
+ .option("--timeout <seconds>", "Timeout per phase in seconds", parseInt)
277
+ .option("--no-mcp", "Disable MCP server injection in headless mode")
278
+ .option("--json", "Output as JSON")
279
+ .option("-v, --verbose", "Enable verbose output")
280
+ .action((issue, options) => readyCommand(issue, options));
258
281
  program
259
282
  .command("conventions")
260
283
  .description("View and manage codebase conventions")
@@ -346,6 +346,7 @@ function renderIssuesList(issues) {
346
346
  const byStatus = {
347
347
  in_progress: [],
348
348
  waiting_for_qa_gate: [],
349
+ waiting_for_human_merge: [],
349
350
  ready_for_merge: [],
350
351
  blocked: [],
351
352
  not_started: [],
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "sequant",
3
- "description": "Structured workflow system for Claude Code - GitHub issue resolution with spec, exec, test, and QA phases",
4
- "version": "2.0.1",
3
+ "description": "AI coding agent orchestrator for Claude Code resolve GitHub issues end-to-end with isolated git worktrees and quality gates, through spec → exec qa phases.",
4
+ "version": "2.6.0",
5
5
  "author": {
6
6
  "name": "sequant-io",
7
7
  "email": "hello@sequant.io"
@@ -1,12 +1,12 @@
1
1
  # Sequant
2
2
 
3
- Structured workflow system for Claude Code — GitHub issue resolution with spec, exec, test, and QA phases.
3
+ AI coding agent orchestrator for Claude Code — resolve GitHub issues end-to-end with isolated git worktrees and quality gates, through spec → exec qa phases.
4
4
 
5
5
  ## Prerequisites
6
6
 
7
7
  - **Git** with a GitHub remote
8
8
  - **GitHub CLI** (`gh`) authenticated (`gh auth status`)
9
- - **Node.js 20+** (for MCP server via `npx`)
9
+ - **Node.js 22.12+** (for MCP server via `npx`)
10
10
 
11
11
  ## Installation
12
12
 
@@ -47,7 +47,7 @@ sequant init
47
47
  | `/improve` | Codebase analysis and improvement |
48
48
  | `/clean` | Repository cleanup |
49
49
  | `/security-review` | Deep security analysis |
50
- | `/release` | Automated release workflow |
50
+ | `/solve` | Generate the recommended workflow for one or more issues |
51
51
  | `/merger` | Multi-issue integration and merge |
52
52
  | `/setup` | Project initialization for plugin users |
53
53
 
@@ -74,10 +74,13 @@ sequant init
74
74
  ## Quick Start
75
75
 
76
76
  ```
77
+ sequant ready # Boxed pre-flight: which issues are ready to run?
77
78
  /assess 123 # Analyze issue, get recommended workflow
78
79
  /fullsolve 123 # End-to-end: spec → exec → qa → PR
79
80
  ```
80
81
 
82
+ See the [`sequant ready` command reference](https://github.com/sequant-io/sequant/blob/main/docs/reference/ready-command.md) for the full pre-flight readiness check.
83
+
81
84
  ## Documentation
82
85
 
83
86
  - [Getting Started](https://github.com/sequant-io/sequant/tree/main/docs/getting-started)
@@ -13,6 +13,17 @@ if [[ "${CLAUDE_HOOKS_DISABLED:-}" == "true" ]]; then
13
13
  exit 0
14
14
  fi
15
15
 
16
+ # === RELAY CHECK (#383) ===
17
+ # Sourced only when SEQUANT_RELAY=true. The check itself is a single env-var
18
+ # comparison when relay is disabled (default), so non-relay runs incur no cost.
19
+ if [[ "${SEQUANT_RELAY:-}" == "true" ]]; then
20
+ _RELAY_CHECK="$(dirname "${BASH_SOURCE[0]:-$0}")/relay-check.sh"
21
+ if [[ -f "${_RELAY_CHECK}" ]]; then
22
+ # shellcheck source=relay-check.sh disable=SC1091
23
+ source "${_RELAY_CHECK}" || true
24
+ fi
25
+ fi
26
+
16
27
  # === READ INPUT FROM STDIN ===
17
28
  # Claude Code passes tool data as JSON via stdin, not environment variables
18
29
  INPUT_JSON=$(cat)
@@ -216,6 +227,60 @@ if [[ "$TOOL_NAME" == "Bash" ]] && echo "$TOOL_INPUT" | grep -qE '(npm run build
216
227
  fi
217
228
  fi
218
229
 
230
+ # === TEST COVERAGE ANALYSIS (P3) ===
231
+ # Opt-in: Set CLAUDE_HOOKS_COVERAGE=true to enable
232
+ # Automatically appends coverage analysis to npm test output
233
+ # Logs which changed files have/don't have corresponding tests
234
+ if [[ "${CLAUDE_HOOKS_COVERAGE:-}" == "true" ]]; then
235
+ if [[ "$TOOL_NAME" == "Bash" ]] && echo "$TOOL_INPUT" | grep -qE '(npm (test|run test)|bun (test|run test)|yarn (test|run test)|pnpm (test|run test))'; then
236
+ # Only run if tests passed (don't clutter failure output)
237
+ if ! echo "$TOOL_OUTPUT" | grep -qE '(FAIL|failed|Error:)'; then
238
+ COVERAGE_LOG="${_LOG_DIR}/claude-coverage.log"
239
+
240
+ # Get changed source files (excluding tests)
241
+ changed_files=$(git diff main...HEAD --name-only 2>/dev/null | grep -E '\.(ts|tsx|js|jsx)$' | grep -v -E '\.test\.|\.spec\.|__tests__' || true)
242
+
243
+ if [[ -n "$changed_files" ]]; then
244
+ echo "$(date +%H:%M:%S) COVERAGE_ANALYSIS: Checking test coverage for changed files" >> "$QUALITY_LOG"
245
+
246
+ files_with_tests=0
247
+ files_without_tests=0
248
+ critical_without_tests=""
249
+
250
+ while IFS= read -r file; do
251
+ [[ -z "$file" ]] && continue
252
+ base=$(basename "$file" .ts | sed 's/\.tsx$//')
253
+
254
+ # Check for test file
255
+ if find . -name "${base}.test.*" -o -name "${base}.spec.*" 2>/dev/null | grep -q .; then
256
+ ((files_with_tests++))
257
+ else
258
+ ((files_without_tests++))
259
+ # Check if critical path
260
+ if echo "$file" | grep -qE 'auth|payment|security|server-action|middleware|admin'; then
261
+ critical_without_tests="$critical_without_tests $file"
262
+ fi
263
+ fi
264
+ done <<< "$changed_files"
265
+
266
+ total=$((files_with_tests + files_without_tests))
267
+
268
+ # Log coverage summary
269
+ echo "$(date +%H:%M:%S) COVERAGE: $files_with_tests/$total changed files have tests" >> "$COVERAGE_LOG"
270
+
271
+ if [[ -n "$critical_without_tests" ]]; then
272
+ echo "$(date +%H:%M:%S) ⚠️ CRITICAL_NO_TESTS:$critical_without_tests" >> "$COVERAGE_LOG"
273
+ echo "$(date +%H:%M:%S) CRITICAL_NO_TESTS:$critical_without_tests" >> "$QUALITY_LOG"
274
+ fi
275
+
276
+ if [[ $files_without_tests -gt 0 ]]; then
277
+ echo "$(date +%H:%M:%S) COVERAGE_GAP: $files_without_tests files without tests" >> "$QUALITY_LOG"
278
+ fi
279
+ fi
280
+ fi
281
+ fi
282
+ fi
283
+
219
284
  # === SMART TEST RUNNING (P3) ===
220
285
  # Opt-in: Set CLAUDE_HOOKS_SMART_TESTS=true to enable
221
286
  # Runs related tests asynchronously after file edits
@@ -300,4 +365,31 @@ if [[ -n "${CLAUDE_HOOKS_WEBHOOK_URL:-}" ]]; then
300
365
  fi
301
366
  fi
302
367
 
368
+ # === POST-MERGE WORKTREE CLEANUP ===
369
+ # Clean up worktree AFTER `gh pr merge` succeeds (not before).
370
+ # Previous approach removed worktree pre-merge, which lost work if merge failed.
371
+ if [[ "$TOOL_NAME" == "Bash" ]] && echo "$TOOL_INPUT" | grep -qE 'gh pr merge'; then
372
+ # Only clean up if merge succeeded (output contains merge confirmation)
373
+ if echo "$TOOL_OUTPUT" | grep -qiE '(merged|Merged pull request|Pull request .* merged)'; then
374
+ PR_NUM=$(echo "$TOOL_INPUT" | grep -oE 'gh pr merge [0-9]+' | grep -oE '[0-9]+')
375
+
376
+ if [[ -n "$PR_NUM" ]]; then
377
+ BRANCH_NAME=$(gh pr view "$PR_NUM" --json headRefName --jq '.headRefName' 2>/dev/null || true)
378
+
379
+ if [[ -n "$BRANCH_NAME" ]]; then
380
+ # Note: worktree line is 2 lines before branch line in porcelain output
381
+ WORKTREE_PATH=$(git worktree list --porcelain 2>/dev/null | grep -B2 "branch refs/heads/$BRANCH_NAME" | grep "^worktree " | sed 's/^worktree //' || true)
382
+
383
+ if [[ -n "$WORKTREE_PATH" && -d "$WORKTREE_PATH" ]]; then
384
+ git worktree remove "$WORKTREE_PATH" --force 2>/dev/null || true
385
+ echo "POST-MERGE: Removed worktree $WORKTREE_PATH for branch $BRANCH_NAME" >> "${_LOG_DIR}/claude-hook.log"
386
+ fi
387
+
388
+ # Clean up local branch
389
+ git branch -D "$BRANCH_NAME" 2>/dev/null || true
390
+ fi
391
+ fi
392
+ fi
393
+ fi
394
+
303
395
  exit 0