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
@@ -52,6 +52,20 @@ Every issue gets exactly ONE action:
52
52
 
53
53
  ### Step 1: Context Gathering
54
54
 
55
+ **Concurrency check (#625, read-only):**
56
+
57
+ Probe the per-issue concurrency lock so the dashboard can flag issues another session is actively working on. `/assess` never acquires the lock — it only reports.
58
+
59
+ ```bash
60
+ # Single batch call. Empty output = no issues are locked. Held issues print one
61
+ # pre-formatted `⚠ #<N> held by ...` line each, ready to paste above the dashboard.
62
+ npx sequant locks check-batch <N1> <N2> ... 2>/dev/null || true
63
+ ```
64
+
65
+ If the output is non-empty, paste every line verbatim above the dashboard table (or, in single-issue detail mode, immediately above the action verdict). Do not gate the recommendation — `/assess` is read-only and must still produce its action verdict even when an issue is locked.
66
+
67
+ The orchestrator/MCP mode (`SEQUANT_ORCHESTRATOR` set) returns no output, so the call is safe to make unconditionally.
68
+
55
69
  **From GitHub (parallel for all issues):**
56
70
 
57
71
  ```bash
@@ -78,6 +92,27 @@ gh pr list --search "<N> in:title" --json number,title,state,headRefName,mergeab
78
92
  - Grep for TODOs: `Grep(pattern="TODO.*#<N>")`
79
93
  - Check files referenced in issue body exist
80
94
  - Identify modified files if branch exists
95
+ - For predicted-collision detection (see Step 5), pass each PROCEED candidate's body through `extractPathsFromIssueBody` from `src/lib/assess-collision-detect.ts` to build the issue → paths map used in Step 5
96
+
97
+ #### Prior Assessment Detection
98
+
99
+ Before generating output, scan the issue's existing comments for prior `<!-- assess:action=... -->` markers. The parser exposes four pure functions in `src/lib/assess-comment-parser.ts`:
100
+
101
+ | Function | Purpose |
102
+ |----------|---------|
103
+ | `findAllAssessComments(comments)` | Returns prior assess comments in chronological order (oldest first). |
104
+ | `buildSupersessionHeader(priors)` | Returns `Supersedes prior assess from <date> (<action>)` for 1 prior, `Supersedes N prior assessments (most recent: <date>)` for ≥2, or `null` for 0. |
105
+ | `detectChurn(priors, allComments)` | Returns `{ isChurn, count, firstDate }`. Fires (`isChurn=true`) only when ≥3 priors exist AND no exec phase marker (`<!-- SEQUANT_PHASE: {"phase":"exec",...} -->`) appears in any comment dated after the first prior. |
106
+ | `shouldPromptOnConflict(prior, new)` | Returns `true` only when prior action ∈ {`PROCEED`, `REWRITE`} AND differs from the new action. |
107
+
108
+ **Supersession protocol:**
109
+
110
+ 1. **No priors** → omit the supersession header entirely.
111
+ 2. **1+ priors** → prepend the header line returned by `buildSupersessionHeader` to the new comment body, immediately above the `→ ACTION — reason` line.
112
+ 3. **Churn detected** (`detectChurn(...).isChurn === true`) → emit a dashboard warning: `⚠ #<N> Re-assessed N times since <firstDate> without execution — possible blocker or low priority`.
113
+ 4. **Conflict detected** (`shouldPromptOnConflict(prior, new) === true`) → confirm with the user via `AskUserQuestion` before posting. Skip the prompt when actions match or when the prior was `CLOSE`/`PARK`/`CLARIFY`/`MERGE`.
114
+
115
+ **This pass is read-only — never edit or delete prior assess comments.** The append-only history is the audit trail; new comments add context, they do not rewrite it.
81
116
 
82
117
  ### Step 2: Health Checks
83
118
 
@@ -110,38 +145,74 @@ Surface red flags. Only track signals that change the recommendation.
110
145
 
111
146
  **Phase selection from labels:**
112
147
 
113
- | Labels | Workflow |
114
- |--------|----------|
115
- | bug, fix, hotfix, patch | `exec → qa` |
116
- | docs, documentation, readme | `exec → qa` |
117
- | ui, frontend, admin, web, browser | `spec → exec → test qa` |
118
- | security, auth, authentication, permissions | `spec security-review exec qa` |
119
- | complex, refactor, breaking, major | `spec → exec → qa` + `-q` |
120
- | enhancement, feature (default) | `spec → exec → qa` |
148
+ | Labels | Category | Workflow |
149
+ |--------|----------|----------|
150
+ | security, auth, authentication, permissions | Domain | `spec → security-review → exec → qa` |
151
+ | ui, frontend, admin, web, browser | Domain | `spec → exec → test → qa` |
152
+ | complex, refactor, breaking, major | Modifier | `spec → exec → qa` + `-Q` |
153
+ | (ui/frontend) + (enhancement/feature), or testable-AC signals | Modifier | inserts `testgen` before `exec` (see Testgen detection below) |
154
+ | enhancement, feature (default) | Generic | `spec → exec → qa` |
155
+ | bug, fix, hotfix, patch | Generic | `spec → exec → qa` |
156
+ | docs, documentation, readme | Generic | `spec → exec → qa` |
157
+
158
+ **Label priority:** Domain labels take precedence over generic labels. When an issue has both a domain label and a generic label (e.g., `bug` + `auth`), the domain label adds its extra phase. Example: an issue labeled `bug` + `auth` gets `spec → security-review → exec → qa` (adds `security-review` from `auth`); `bug` + `ui` gets `spec → exec → test → qa` (adds `test` from `ui`).
121
159
 
122
160
  **Valid phases (from `PhaseSchema` in `src/lib/workflow/types.ts`):** `spec`, `security-review`, `exec`, `testgen`, `test`, `verify`, `qa`, `loop`, `merger`
123
161
 
124
- **Skip spec when:** bug/docs label, OR spec comment already exists on issue.
162
+ **Skip spec when:** a prior `spec` phase marker already exists on the issue. Otherwise, always include spec — bug and docs issues often contain design decisions (scope boundaries, edge cases, test-strategy shifts) that benefit from a spec pass.
125
163
 
126
164
  **Resume detection:** Branch exists with commits ahead of main → mark as resume (`◂`).
127
165
 
128
166
  **PR review detection:** Open PR with implementation complete → mark as review-needed (`◂ qa`).
129
167
 
130
- **Quality loop (`-q`):** Recommend for everything except simple bug fixes and docs-only.
168
+ **Quality loop (`-Q`):** Recommend for everything except simple bug fixes and docs-only.
169
+
170
+ **Testgen detection:** Add `testgen` to the workflow when any apply:
171
+ - Labels include (`ui` or `frontend`) AND (`enhancement` or `feature`)
172
+ - ACs reference "unit test", "integration test", or list "Automated Test" as a verification method
173
+
174
+ Skip when: only `bug`/`fix` labels present, only `docs` label present, or a prior `testgen` phase marker exists in issue comments.
175
+
176
+ **Chain detection (suggest-only, never auto-apply):** When 2+ assessed issues have a detected dependency, emit a `Chain:` line alongside (not replacing) the default per-issue commands. False dependency inference produces silently-wrong branch topology, so the user decides.
177
+
178
+ Triggers (any one):
179
+ - Issue body or comments mention `"depends on #N"`, `"blocked by #N"`, or `"after #N"`
180
+ - One issue's described output is another issue's input (e.g., A changes a function signature that B consumes)
131
181
 
132
- **Other flags:**
133
- - `--chain` — Chain issues: each branches from previous (implies --sequential)
134
- - `--qa-gate` — Pause chain on QA failure, preventing downstream issues from building on broken code (requires --chain)
135
- - `--base <branch>` Issue references a feature branch
182
+ Format: `Chain: npx sequant run <N1> <N2> --chain --qa-gate -Q <phases> # alternative — <one-line reason>`
183
+
184
+ Flag references:
185
+ - `--chain` chains issues (each branches from previous; implies `--sequential`)
186
+ - `--qa-gate` pauses chain on QA failure (requires `--chain`)
187
+ - `--base <branch>` — issue references a feature branch
136
188
 
137
189
  ### Step 5: Conflict Detection
138
190
 
191
+ **Active-worktree overlap.** For each in-flight worktree, check whether its diff overlaps with files the assessed issues are likely to touch.
192
+
139
193
  ```bash
140
194
  git worktree list --porcelain 2>/dev/null | grep "^worktree" | cut -d' ' -f2 || true
141
195
  ```
142
196
 
143
197
  For each active worktree, check `git diff --name-only main...HEAD` for file overlap with assessed issues.
144
198
 
199
+ **Predicted file-collision (PROCEED issues).** Step 5 also runs a heuristic across the bodies of unstarted PROCEED issues to predict pairs that will modify the same file once executed in parallel. The detector lives in `src/lib/assess-collision-detect.ts` and exposes three pure functions:
200
+
201
+ | Function | Purpose |
202
+ |----------|---------|
203
+ | `extractPathsFromIssueBody(body)` | Strips fenced code blocks and HTML comments, then returns the set of canonical paths the body names. Backtick-quoted paths under `.claude/`, `templates/`, `skills/`, `src/`, `bin/`, `docs/` matching `*.md`, `*.ts`, `*.tsx`, `*.json`, `*.sh` are extracted; skill-mirror prefixes (`.claude/skills/`, `templates/skills/`, `skills/`) are normalized away so `qa/SKILL.md` is the canonical form. When the body also mentions "3-dir sync" (or "across all three skill directories"), bare `<name>/SKILL.md` references and `/<skill>` slash-command mentions are also added. Globally excluded paths (`CHANGELOG.md`, `package-lock.json`, `yarn.lock`, `pnpm-lock.yaml`) are stripped. |
204
+ | `detectFileCollisions(issuePaths)` | Computes pairwise file-path intersections across the PROCEED issues. Returns one `CollisionResult` per shared file: `{ issues: number[], file: string }`. When N issues share a file, that's a single result with `issues.length === N`. Because paths are canonical, mirrored skill files emit one collision, not three. |
205
+ | `formatCollisionAnnotations(results)` | Returns `{ orderLines, warnings, chainSuggestion? }`. Each pair (or group) emits an `Order: A → B (path)` line and one `⚠ #N Modifies <path> (overlaps #M); land sequentially` per affected issue. When ≥3 issues collide on the same file, a `Chain:` suggestion is also returned (suggest-only — never auto-applied). |
206
+
207
+ **Output integration:**
208
+
209
+ 1. Step 1 (Context Gathering) already calls `extractPathsFromIssueBody` per PROCEED candidate to build the issue → paths map.
210
+ 2. After Step 4 produces the PROCEED set, pass the map to `detectFileCollisions`.
211
+ 3. Render the formatted annotations in the dashboard alongside the active-worktree overlap warnings — same `Order:` / `⚠` / `Chain:` blocks defined in "Annotation Rules" below.
212
+ 4. The bare-filename `Order:` exception (e.g. `Order: 551 → 552 (qa/SKILL.md)`) applies here — predicted collisions are file-collision reasons by definition.
213
+
214
+ False-positive guards and tunables (excluded paths, the path regex, the slash-command-skill derivation rule) are documented in [`references/predicted-collision-detection.md`](references/predicted-collision-detection.md) so they can change without editing this skill.
215
+
145
216
  ---
146
217
 
147
218
  ## Output Format
@@ -150,23 +221,28 @@ For each active worktree, check `git diff --name-only main...HEAD` for file over
150
221
 
151
222
  **Design principle:** Dashboard first. Copy-pasteable commands. Silence means healthy.
152
223
 
224
+ **Table column rules:** The "Reason" column must not be truncated mid-word. If a row's reason text would exceed the column width, prefer abbreviating the reason to a shorter synonym rather than cutting a word in half. Column widths should adapt to content — do not force a fixed table width.
225
+
153
226
  ```
154
- # Action Reason Run
155
- <N> <ACTION> <short reason> <workflow or symbol>
156
- <N> <ACTION> <short reason> <workflow or symbol>
227
+ # Action [ACs] Reason Run
228
+ <N> <ACTION> [N] <short reason> <workflow or symbol>
229
+ <N> <ACTION> [N] <short reason> <workflow or symbol>
157
230
  ...
158
231
  ────────────────────────────────────────────────────────────────
159
-
160
- ╭──────────────────────────────────────────────────────────────╮
161
- npx sequant run <N1> <N2> <flags> │
162
- │ npx sequant run <N3> <flags> # resume │
163
- ╰──────────────────────────────────────────────────────────────╯
164
-
232
+ Commands:
233
+ npx sequant run <N1> <N2> <flags>
234
+ npx sequant run <N3> <flags> # resume
165
235
  ────────────────────────────────────────────────────────────────
166
- Order: <N> → <N> (<shared file>) · <N> → <N> (<dependency>)
236
+ Order: <N> → <N> (<dependency reason>)
167
237
 
168
238
  ⚠ #<N> <warning>
169
239
  ⚠ #<N> <warning>
240
+
241
+ Chain: npx sequant run <N1> <N2> --chain --qa-gate -Q <phases> # alternative — <reason>
242
+
243
+ Flags:
244
+ <flag> <one-line reason>
245
+ <flag> <one-line reason>
170
246
  ────────────────────────────────────────────────────────────────
171
247
  Cleanup:
172
248
  <executable command> # reason
@@ -179,12 +255,14 @@ Cleanup:
179
255
  <!-- assess:quality-loop=<bool> -->
180
256
  ```
181
257
 
258
+ **`ACs` column (conditional):** Include the `ACs` column only when every assessed issue has at least one explicit `- [ ]` checkbox AC in its body. Otherwise omit the column entirely — do not show partial values. The counter prevents eroding table trust when some issues use implicit/narrative ACs.
259
+
182
260
  #### Run Column Symbols
183
261
 
184
262
  | Symbol | Meaning | Example |
185
263
  |--------|---------|---------|
186
264
  | `spec → exec → qa` | Full workflow | Standard feature |
187
- | `exec → qa` | Skip spec | Bug, docs, or spec exists |
265
+ | `exec → qa` | Skip spec | Prior spec marker exists |
188
266
  | `◂ exec → qa` | Resume existing work | Branch has commits |
189
267
  | `◂ qa` | PR needs review/QA | Open PR, impl done |
190
268
  | `⟳ spec → exec → qa` | Restart (fresh) | Stale PR abandoned |
@@ -193,49 +271,81 @@ Cleanup:
193
271
  | `‖` | Blocked/deferred | Dependency or manual |
194
272
  | `—` | No action needed | Already closed/merged |
195
273
 
196
- #### Command Block Rules
274
+ #### Commands Block Rules
275
+
276
+ The commands block is headed by `Commands:` — no box-drawing, no character counting. The header label is the visual anchor.
197
277
 
198
278
  1. Only PROCEED and REWRITE issues get commands
199
279
  2. Group by identical phases + flags → same line
200
280
  3. Resume issues get `# resume` comment
201
281
  4. Rewrite issues get `# restart` comment
202
- 5. Chain mode issues use `--chain` flag
282
+ 5. Chain mode issues use `--chain` flag (see `Chain:` annotation rules below)
203
283
  6. If ALL issues share the same workflow, emit a single command
284
+ 7. **Line splitting:** When a single command would contain more than 6 issue numbers, split into multiple commands of at most 6 issues each, grouped by compatible workflow. Example: 11 issues → two commands (6 + 5)
285
+ 8. **Minimal flags:** Omit `--phases` when the resulting workflow equals the CLI default (registered at `bin/cli.ts:186`, defined as `DEFAULT_PHASES` in `src/lib/workflow/types.ts`). Prefer additive flags over restating phases — additive flags: `--testgen` and `--security-review` (`bin/cli.ts:208-209`). Use `--testgen` instead of `--phases spec,testgen,exec,qa` (or `…,testgen,…,test,qa` for ui-labelled issues, since `phase-mapper.determinePhasesForIssue` auto-adds `test` from the ui label). Use `--security-review` instead of `--phases spec,security-review,exec,qa`. The posted marker (`<!-- assess:phases=… -->`) records the full resolved workflow regardless — markers are machine-readable, displayed commands are human shorthand. This intentional divergence is fine: parsers consume markers, humans copy commands.
204
286
 
205
287
  #### Annotation Rules
206
288
 
207
- - **`Order:`** Only when sequencing matters (shared files or dependencies). Format: `A → B (reason)` joined by ` · `
208
- - **`⚠` warnings** Only non-obvious signals (complexity, staleness, dual concerns). One line each. Prefix with issue number.
289
+ Emit annotations in this order between the separators that follow `Commands:`:
290
+ `Order:` `⚠` warnings `Chain:` `Flags:`. `Cleanup:` goes in its own block after. Omit any section (and its surrounding blank line) when it has no content.
291
+
292
+ - **`Order:`** — Only when sequencing matters. Include the **reason** for the ordering, not just `(<filename>)`. Prefer dependency reasoning over filename.
293
+ - Good: `Order: 185 → 186 (185 changes fetchApi error format that 186 consumes)`
294
+ - Good: `Order: 460 → 461 (460 adds batch-executor tests that 461's label matching depends on)`
295
+ - Avoid bare filenames when a reason is clearer.
296
+ - **Exception:** When the sequencing reason **is** a file collision (two issues both modify the same file), the filename **is** the reason and is acceptable verbatim. Example: `Order: 460 → 461 (qa/SKILL.md)` — the bare filename communicates the conflict directly.
297
+
298
+ - **`⚠` warnings** — Only non-obvious signals (complexity, staleness, dual concerns, partial-AC satisfaction). One line each, prefixed with issue number. Warnings can note when part of an AC is already satisfied in the codebase:
299
+ - `⚠ #185 Domain errors already exist in repository layer — scope may be smaller than expected`
300
+ - `⚠ #412 bug + auth labels — domain label (auth) takes priority over bug`
301
+
302
+ - **`Chain:`** — Only when 2+ PROCEED issues have a detected dependency (see "Chain detection" in Step 4). Suggests an alternative execution topology. Does not replace the default per-issue commands. Format:
303
+ `Chain: npx sequant run <N1> <N2> --chain --qa-gate -Q <phases> # alternative — <one-line reason>`
304
+
305
+ - **`Flags:`** — Only when non-default flags appear in the commands and the reason isn't obvious. One line per **distinct** flag used across all commands. Omit entire section when `-Q` is the only non-default flag AND its reason is obvious (e.g., all issues are enhancements). Format:
306
+ ```
307
+ Flags:
308
+ -Q 9+ ACs or multi-file scope
309
+ --testgen testable ACs detected (UI hooks + API integration)
310
+ --phases ...,test ui label → browser verification
311
+ ```
312
+
209
313
  - **`Cleanup:`** — Only when actionable (stale branches, merged-but-open issues, label changes). Show as executable commands with `# reason` comments.
210
- - **Omit entire section** (including its separator) when no annotations of that type exist.
314
+
211
315
  - **"All clear" is silence** — no annotation means no issues.
212
316
 
213
- #### Batch Example (mixed states)
317
+ #### Batch Example (mixed states, with label priority)
318
+
319
+ Not all issues have explicit `- [ ]` checkboxes, so the `ACs` column is omitted.
214
320
 
215
321
  ```
216
322
  # Action Reason Run
217
323
  462 PARK Manual measurement task ‖
218
- 461 PROCEED Exact label matching exec → qa
219
- 460 PROCEED batch-executor tests exec → qa
324
+ 461 PROCEED Exact label matching spec → exec → qa
325
+ 460 PROCEED batch-executor tests spec → exec → qa
220
326
  458 PROCEED Parallel UX + race condition spec → exec → qa
221
327
  447 CLOSE PR #457 merged —
222
328
  443 PROCEED Consolidate gh calls spec → exec → qa
223
- 412 PROCEED Auth token refresh ◂ exec → qa
329
+ 412 PROCEED Auth bug (domain: auth adds review) spec → security-review → exec → qa
330
+ 411 PROCEED Config path normalization ◂ exec → qa
224
331
  405 REWRITE PR #380 200+ commits behind ⟳ spec → exec → qa
225
332
  ────────────────────────────────────────────────────────────────
226
-
227
- ╭──────────────────────────────────────────────────────────────╮
228
- npx sequant run 461 460 -q --phases exec,qa │
229
- npx sequant run 458 443 -q │
230
- npx sequant run 412 -q --phases exec,qa # resume │
231
- │ npx sequant run 405 -q # restart │
232
- ╰──────────────────────────────────────────────────────────────╯
233
-
333
+ Commands:
334
+ npx sequant run 461 460 458 443 -Q
335
+ npx sequant run 412 -Q --security-review
336
+ npx sequant run 411 -Q --phases exec,qa # resume
337
+ npx sequant run 405 -Q # restart
234
338
  ────────────────────────────────────────────────────────────────
235
- Order: 460 → 461 (batch-executor.ts)
339
+ Order: 460 → 461 (460 adds batch-executor tests that 461's label matching depends on)
236
340
 
237
341
  ⚠ #458 Dual concern (UX + race) across 4 files
238
342
  ⚠ #405 Stale 30+ days, ACs still valid
343
+ ⚠ #412 bug + auth labels — auth (domain) adds security-review phase
344
+
345
+ Flags:
346
+ -Q multi-file scope across most PROCEED issues
347
+ --security-review #412 auth label → security review required
348
+ --phases exec,qa #411 resume — prior spec marker already exists
239
349
  ────────────────────────────────────────────────────────────────
240
350
  Cleanup:
241
351
  git worktree remove .../447-... # merged, stale worktree
@@ -244,36 +354,116 @@ Cleanup:
244
354
  ────────────────────────────────────────────────────────────────
245
355
 
246
356
  <!-- #462 assess:action=PARK -->
247
- <!-- #461 assess:action=PROCEED assess:phases=exec,qa assess:quality-loop=true -->
248
- <!-- #460 assess:action=PROCEED assess:phases=exec,qa assess:quality-loop=true -->
357
+ <!-- #461 assess:action=PROCEED assess:phases=spec,exec,qa assess:quality-loop=true -->
358
+ <!-- #460 assess:action=PROCEED assess:phases=spec,exec,qa assess:quality-loop=true -->
249
359
  <!-- #458 assess:action=PROCEED assess:phases=spec,exec,qa assess:quality-loop=true -->
250
360
  <!-- #447 assess:action=CLOSE -->
251
361
  <!-- #443 assess:action=PROCEED assess:phases=spec,exec,qa assess:quality-loop=true -->
252
- <!-- #412 assess:action=PROCEED assess:phases=exec,qa assess:quality-loop=true -->
362
+ <!-- #412 assess:action=PROCEED assess:phases=spec,security-review,exec,qa assess:quality-loop=true -->
363
+ <!-- #411 assess:action=PROCEED assess:phases=exec,qa assess:quality-loop=true -->
253
364
  <!-- #405 assess:action=REWRITE assess:phases=spec,exec,qa assess:quality-loop=true -->
254
365
  ```
255
366
 
367
+ #### Batch Example (dependent issues with testgen, chain suggestion)
368
+
369
+ All issues have explicit checkbox ACs, so the `ACs` column is shown. A dependency is detected (185 → 186), so a `Chain:` suggestion appears alongside the default commands.
370
+
371
+ ```
372
+ # Action ACs Reason Run
373
+ 185 PROCEED 6 Domain error standardization spec → exec → qa
374
+ 186 PROCEED 9 React Query hooks migration spec → testgen → exec → test → qa
375
+ ────────────────────────────────────────────────────────────────
376
+ Commands:
377
+ npx sequant run 185 -Q
378
+ npx sequant run 186 -Q --testgen
379
+ ────────────────────────────────────────────────────────────────
380
+ Order: 185 → 186 (185 changes fetchApi error format that 186 consumes)
381
+
382
+ ⚠ #185 Domain errors already exist in repository layer — scope may be smaller than expected
383
+ ⚠ #186 @tanstack/react-query not installed; large scope (9 hooks + optimistic updates)
384
+
385
+ Chain: npx sequant run 185 186 --chain --qa-gate -Q --testgen
386
+ # alternative — use if 186 should branch from 185's work
387
+
388
+ Flags:
389
+ --testgen #186 testable ACs (UI hooks + API integration); ui label auto-adds test phase
390
+ ────────────────────────────────────────────────────────────────
391
+
392
+ <!-- #185 assess:action=PROCEED assess:phases=spec,exec,qa assess:quality-loop=true -->
393
+ <!-- #186 assess:action=PROCEED assess:phases=spec,testgen,exec,test,qa assess:quality-loop=true -->
394
+ ```
395
+
256
396
  #### Batch Example (all clean)
257
397
 
258
- When every issue is PROCEED with no warnings, the output is minimal:
398
+ When every issue is PROCEED with no warnings, no dependencies, and no non-default flags beyond an obvious `-Q`, the output is minimal. The `Flags:` section is omitted because `-Q` is obvious here (all PROCEED enhancements).
259
399
 
260
400
  ```
261
401
  # Action Reason Run
262
- 461 PROCEED Exact label matching exec → qa
263
- 460 PROCEED batch-executor tests exec → qa
402
+ 461 PROCEED Exact label matching spec → exec → qa
403
+ 460 PROCEED batch-executor tests spec → exec → qa
264
404
  443 PROCEED Consolidate gh calls spec → exec → qa
265
405
  ────────────────────────────────────────────────────────────────
406
+ Commands:
407
+ npx sequant run 461 460 443 -Q
408
+ ────────────────────────────────────────────────────────────────
409
+
410
+ <!-- #461 assess:action=PROCEED assess:phases=spec,exec,qa assess:quality-loop=true -->
411
+ <!-- #460 assess:action=PROCEED assess:phases=spec,exec,qa assess:quality-loop=true -->
412
+ <!-- #443 assess:action=PROCEED assess:phases=spec,exec,qa assess:quality-loop=true -->
413
+ ```
414
+
415
+ Silence means clean — no `Order:`, no `⚠`, no `Chain:`, no `Flags:`, no `Cleanup:`.
416
+
417
+ #### Batch Example (large batch, 13 issues with Rule 7 split)
418
+
419
+ When assessing 9+ issues, commands are split per Rule 7 (max 6 issue numbers per line), and the table adapts to content width. Mixed AC styles across issues → `ACs` column omitted.
420
+
421
+ ```
422
+ # Action Reason Run
423
+ 503 PROCEED Fix typo in error output spec → exec → qa
424
+ 502 PROCEED Update deprecated API call spec → exec → qa
425
+ 501 PROCEED Add retry logic to API client spec → exec → qa
426
+ 500 PROCEED Fix token refresh race condition spec → security-review → exec → qa
427
+ 499 PROCEED Dashboard chart rendering bug spec → exec → test → qa
428
+ 498 PROCEED Update error messages spec → exec → qa
429
+ 497 PROCEED Refactor batch executor spec → exec → qa
430
+ 496 PARK Blocked on #490 schema migration ‖
431
+ 495 PROCEED CLI help text improvements spec → exec → qa
432
+ 494 PROCEED Assess batch formatting fix spec → exec → qa
433
+ 493 CLOSE Duplicate of #491 —
434
+ 492 PROCEED Add export command spec → exec → qa
435
+ 491 PROCEED Normalize config paths spec → exec → qa
436
+ ────────────────────────────────────────────────────────────────
437
+ Commands:
438
+ npx sequant run 503 502 501 499 498 497 -Q
439
+ npx sequant run 495 494 492 491 -Q
440
+ npx sequant run 500 -Q --security-review
441
+ ────────────────────────────────────────────────────────────────
442
+ Order: 497 → 492 (497 refactors batch-executor internals that 492's export command uses)
266
443
 
267
- ╭──────────────────────────────────────────────────────────────╮
268
- npx sequant run 461 460 -q --phases exec,qa │
269
- │ npx sequant run 443 -q │
270
- ╰──────────────────────────────────────────────────────────────╯
444
+ ⚠ #500 bug + auth labels — auth (domain) adds security-review phase
445
+ ⚠ #499 bug + ui labels ui (domain) adds test phase
271
446
 
447
+ Flags:
448
+ --security-review #500 auth label → security review required
449
+ ────────────────────────────────────────────────────────────────
450
+ Cleanup:
451
+ gh issue close 493 # duplicate of #491
272
452
  ────────────────────────────────────────────────────────────────
273
453
 
274
- <!-- #461 assess:action=PROCEED assess:phases=exec,qa assess:quality-loop=true -->
275
- <!-- #460 assess:action=PROCEED assess:phases=exec,qa assess:quality-loop=true -->
276
- <!-- #443 assess:action=PROCEED assess:phases=spec,exec,qa assess:quality-loop=true -->
454
+ <!-- #503 assess:action=PROCEED assess:phases=spec,exec,qa assess:quality-loop=true -->
455
+ <!-- #502 assess:action=PROCEED assess:phases=spec,exec,qa assess:quality-loop=true -->
456
+ <!-- #501 assess:action=PROCEED assess:phases=spec,exec,qa assess:quality-loop=true -->
457
+ <!-- #500 assess:action=PROCEED assess:phases=spec,security-review,exec,qa assess:quality-loop=true -->
458
+ <!-- #499 assess:action=PROCEED assess:phases=spec,exec,test,qa assess:quality-loop=true -->
459
+ <!-- #498 assess:action=PROCEED assess:phases=spec,exec,qa assess:quality-loop=true -->
460
+ <!-- #497 assess:action=PROCEED assess:phases=spec,exec,qa assess:quality-loop=true -->
461
+ <!-- #496 assess:action=PARK -->
462
+ <!-- #495 assess:action=PROCEED assess:phases=spec,exec,qa assess:quality-loop=true -->
463
+ <!-- #494 assess:action=PROCEED assess:phases=spec,exec,qa assess:quality-loop=true -->
464
+ <!-- #493 assess:action=CLOSE -->
465
+ <!-- #492 assess:action=PROCEED assess:phases=spec,exec,qa assess:quality-loop=true -->
466
+ <!-- #491 assess:action=PROCEED assess:phases=spec,exec,qa assess:quality-loop=true -->
277
467
  ```
278
468
 
279
469
  ---
@@ -291,11 +481,13 @@ More context since you're focused on one issue. Separators between every section
291
481
 
292
482
  → PROCEED — <one-line reason>
293
483
 
294
- ╭──────────────────────────────────────────────────────────────╮
295
- npx sequant run <N> <flags>
296
- ╰──────────────────────────────────────────────────────────────╯
484
+ Commands:
485
+ npx sequant run <N> <flags>
297
486
 
298
- <phases> · <N> ACs · <flag reasoning>
487
+ <phases> · <N> ACs
488
+
489
+ Flags:
490
+ <flag> <one-line reason>
299
491
  ────────────────────────────────────────────────────────────────
300
492
  ⚠ <warning if any>
301
493
  ⚠ Conflict: #<N> also modifies <path>
@@ -306,7 +498,9 @@ More context since you're focused on one issue. Separators between every section
306
498
  <!-- assess:quality-loop=<bool> -->
307
499
  ```
308
500
 
309
- If no warnings exist, omit the warning section and its separator:
501
+ **`Flags:` (single mode):** Indented list of each enabled non-default flag with a one-line reason. Omit the entire `Flags:` section when `-Q` is the only non-default flag AND the reason is obvious (e.g., a straightforward enhancement). Do not repeat obvious flags.
502
+
503
+ Example with `Flags:` (non-obvious `-Q` + `--testgen`):
310
504
 
311
505
  ```
312
506
  #458 — Parallel run UX freeze + reconcileState race condition
@@ -315,11 +509,33 @@ Open · bug, enhancement, cli
315
509
 
316
510
  → PROCEED — Both root causes confirmed in codebase
317
511
 
318
- ╭──────────────────────────────────────────────────────────────╮
319
- npx sequant run 458 -q │
320
- ╰──────────────────────────────────────────────────────────────╯
512
+ Commands:
513
+ npx sequant run 458 -Q
321
514
 
322
- spec → exec → qa · 8 ACs · -q (dual concern)
515
+ spec → exec → qa · 8 ACs
516
+
517
+ Flags:
518
+ -Q dual concern across 4 files
519
+ ────────────────────────────────────────────────────────────────
520
+
521
+ <!-- assess:action=PROCEED -->
522
+ <!-- assess:phases=spec,exec,qa -->
523
+ <!-- assess:quality-loop=true -->
524
+ ```
525
+
526
+ Example omitting `Flags:` (obvious `-Q` for a standard enhancement):
527
+
528
+ ```
529
+ #443 — Consolidate gh CLI calls
530
+ Open · enhancement
531
+ ────────────────────────────────────────────────────────────────
532
+
533
+ → PROCEED — Codebase matches spec, 5 ACs
534
+
535
+ Commands:
536
+ npx sequant run 443 -Q
537
+
538
+ spec → exec → qa · 5 ACs
323
539
  ────────────────────────────────────────────────────────────────
324
540
 
325
541
  <!-- assess:action=PROCEED -->
@@ -397,9 +613,8 @@ Need: <specific information required>
397
613
 
398
614
  → REWRITE — <reason>
399
615
 
400
- ╭──────────────────────────────────────────────────────────────╮
401
- npx sequant run <N> <flags> # fresh start
402
- ╰──────────────────────────────────────────────────────────────╯
616
+ Commands:
617
+ npx sequant run <N> <flags> # fresh start
403
618
 
404
619
  <phases> · <N> ACs
405
620
  ────────────────────────────────────────────────────────────────
@@ -417,32 +632,25 @@ Need: <specific information required>
417
632
 
418
633
  | Section | Show when |
419
634
  |---------|-----------|
420
- | Command block | At least one PROCEED or REWRITE issue |
635
+ | `ACs` column (batch) | Every assessed issue has ≥1 explicit `- [ ]` checkbox AC |
636
+ | `Commands:` block | At least one PROCEED or REWRITE issue |
421
637
  | `Order:` | File conflicts or dependencies require sequencing |
422
- | `⚠` warnings | Non-obvious signals exist |
638
+ | `⚠` warnings | Non-obvious signals exist (complexity, staleness, dual concerns, partial-AC satisfaction) |
639
+ | `Chain:` | 2+ PROCEED issues with detected dependency (suggest-only) |
640
+ | `Flags:` | Non-default flags appear AND `-Q` is not the sole flag with an obvious reason |
423
641
  | `Cleanup:` | Stale branches, merged-but-open issues, or label changes |
424
642
  | Separators | Between sections that are both shown; omit if adjacent section is omitted |
425
643
 
426
- Every separator and section is conditional. If there are no warnings and no cleanup, the output is just: table → separator → command block → separator → markers.
644
+ Every separator and section is conditional. If there are no warnings, no chain, no flags, and no cleanup, the output is just: table → separator → `Commands:` block → separator → markers.
427
645
 
428
646
  ---
429
647
 
430
- ## State Tracking
431
-
432
- Initialize state for each assessed issue:
433
-
434
- ```bash
435
- TITLE=$(gh issue view <N> --json title -q '.title')
436
- npx tsx scripts/state/update.ts init <N> "$TITLE"
437
- ```
438
-
439
- Note: `/assess` only initializes issues — actual phase tracking happens during workflow execution.
440
-
441
648
  ## Persist Analysis
442
649
 
443
650
  After displaying output, prompt the user to save using `AskUserQuestion` with options "Yes (Recommended)" and "No".
444
651
 
445
652
  If confirmed, post a structured comment to each issue via `gh issue comment`. Each posted comment should include:
653
+ - **Supersession header** (when priors exist): If `findAllAssessComments` returned ≥1 prior, prepend `buildSupersessionHeader(priors)` immediately above the `→ ACTION — reason` line. When `detectChurn(...).isChurn === true`, also emit a `⚠ Re-assessed N times since <firstDate> without execution — possible blocker or low priority` warning in the dashboard. When `shouldPromptOnConflict(prior, new) === true`, confirm with the user via `AskUserQuestion` before posting. See "Prior Assessment Detection" in Step 1 for full protocol.
446
654
  - The action headline (`→ ACTION — reason`)
447
655
  - The workflow (for PROCEED/REWRITE)
448
656
  - Standard HTML markers on separate lines:
@@ -467,10 +675,18 @@ If confirmed, post a structured comment to each issue via `gh issue comment`. Ea
467
675
 
468
676
  - [ ] Every issue has exactly one action in the table
469
677
  - [ ] Run column uses correct symbol for the action/state
470
- - [ ] Command block only contains PROCEED and REWRITE issues
471
- - [ ] Commands are grouped by compatible workflow
472
- - [ ] Separators appear between every shown section
473
- - [ ] Annotations omitted when not applicable (silence = healthy)
678
+ - [ ] `ACs` column included only when every issue has explicit `- [ ]` checkboxes
679
+ - [ ] Commands appear under a `Commands:` header (no bare indented block, no box-drawing)
680
+ - [ ] Commands block only contains PROCEED and REWRITE issues, grouped by compatible workflow
681
+ - [ ] `testgen` included when ui/frontend + enhancement/feature labels OR testable-AC signals
682
+ - [ ] `Chain:` suggested (not auto-applied) when 2+ PROCEED issues have a detected dependency
683
+ - [ ] `Flags:` section present when non-default flags appear (unless only obvious `-Q`)
684
+ - [ ] `Order:` annotations carry dependency **reasoning**, not bare filenames
685
+ - [ ] `⚠` warnings include partial-AC satisfaction where applicable
686
+ - [ ] Separators appear between every shown section; omitted when adjacent section is omitted
687
+ - [ ] Annotations/sections omitted when not applicable (silence = healthy)
474
688
  - [ ] HTML markers present for every assessed issue
689
+ - [ ] Supersession header prepended when prior assess comments exist (`buildSupersessionHeader`)
690
+ - [ ] Churn warning included in dashboard when `detectChurn(...).isChurn === true`
475
691
  - [ ] Batch mode: table is the primary output, no per-issue detail sections
476
692
  - [ ] Single mode: focused summary with separators between sections