sequant 2.8.0 → 2.10.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 (211) hide show
  1. package/.claude-plugin/marketplace.json +1 -1
  2. package/.claude-plugin/plugin.json +1 -1
  3. package/README.md +23 -4
  4. package/dist/bin/cli.js +99 -18
  5. package/dist/marketplace/external_plugins/sequant/.claude-plugin/plugin.json +1 -1
  6. package/dist/marketplace/external_plugins/sequant/.mcp.json +1 -1
  7. package/dist/marketplace/external_plugins/sequant/README.md +58 -2
  8. package/dist/marketplace/external_plugins/sequant/hooks/parallel-marker.sh +50 -0
  9. package/dist/marketplace/external_plugins/sequant/hooks/post-tool.sh +38 -10
  10. package/dist/marketplace/external_plugins/sequant/hooks/pre-tool.sh +405 -67
  11. package/dist/marketplace/external_plugins/sequant/skills/_shared/references/trust-model.md +18 -0
  12. package/dist/marketplace/external_plugins/sequant/skills/assess/SKILL.md +250 -344
  13. package/dist/marketplace/external_plugins/sequant/skills/assess/references/predicted-collision-detection.md +10 -7
  14. package/dist/marketplace/external_plugins/sequant/skills/docs/SKILL.md +4 -4
  15. package/dist/marketplace/external_plugins/sequant/skills/exec/SKILL.md +26 -6
  16. package/dist/marketplace/external_plugins/sequant/skills/fullsolve/SKILL.md +4 -2
  17. package/dist/marketplace/external_plugins/sequant/skills/loop/SKILL.md +38 -2
  18. package/dist/marketplace/external_plugins/sequant/skills/merger/SKILL.md +2 -2
  19. package/dist/marketplace/external_plugins/sequant/skills/qa/SKILL.md +337 -57
  20. package/dist/marketplace/external_plugins/sequant/skills/qa/references/anti-pattern-detection.md +6 -6
  21. package/dist/marketplace/external_plugins/sequant/skills/qa/references/call-site-review.md +2 -2
  22. package/dist/marketplace/external_plugins/sequant/skills/qa/references/code-review-checklist.md +2 -2
  23. package/dist/marketplace/external_plugins/sequant/skills/qa/references/fixtures/injection-issue-body.md +36 -0
  24. package/dist/marketplace/external_plugins/sequant/skills/qa/references/quality-gates.md +21 -7
  25. package/dist/marketplace/external_plugins/sequant/skills/qa/references/testing-requirements.md +1 -1
  26. package/dist/marketplace/external_plugins/sequant/skills/qa/scripts/quality-checks.sh +11 -11
  27. package/dist/marketplace/external_plugins/sequant/skills/reflect/SKILL.md +27 -13
  28. package/dist/marketplace/external_plugins/sequant/skills/reflect/references/documentation-tiers.md +80 -68
  29. package/dist/marketplace/external_plugins/sequant/skills/reflect/references/phase-reflection.md +31 -15
  30. package/dist/marketplace/external_plugins/sequant/skills/release/SKILL.md +11 -3
  31. package/dist/marketplace/external_plugins/sequant/skills/setup/SKILL.md +5 -5
  32. package/dist/marketplace/external_plugins/sequant/skills/spec/SKILL.md +2 -0
  33. package/dist/marketplace/external_plugins/sequant/skills/spec/references/verification-criteria.md +1 -1
  34. package/dist/marketplace/external_plugins/sequant/skills/test/SKILL.md +1 -1
  35. package/dist/src/commands/assess-render.d.ts +23 -0
  36. package/dist/src/commands/assess-render.js +60 -0
  37. package/dist/src/commands/doctor.js +8 -13
  38. package/dist/src/commands/init.js +13 -1
  39. package/dist/src/commands/locks.js +2 -0
  40. package/dist/src/commands/logs.js +20 -6
  41. package/dist/src/commands/merge.js +154 -2
  42. package/dist/src/commands/ready-tui-adapter.js +6 -1
  43. package/dist/src/commands/ready.d.ts +25 -3
  44. package/dist/src/commands/ready.js +39 -13
  45. package/dist/src/commands/resume.d.ts +113 -0
  46. package/dist/src/commands/resume.js +193 -0
  47. package/dist/src/commands/run-display.d.ts +20 -0
  48. package/dist/src/commands/run-display.js +117 -5
  49. package/dist/src/commands/run-flags.d.ts +42 -1
  50. package/dist/src/commands/run-flags.js +53 -1
  51. package/dist/src/commands/run-progress.js +26 -1
  52. package/dist/src/commands/run.js +11 -10
  53. package/dist/src/commands/state.js +7 -0
  54. package/dist/src/commands/stats.js +47 -0
  55. package/dist/src/commands/status.d.ts +9 -0
  56. package/dist/src/commands/status.js +24 -1
  57. package/dist/src/commands/sync.js +90 -19
  58. package/dist/src/commands/update.js +28 -5
  59. package/dist/src/lib/ac-parser.d.ts +14 -0
  60. package/dist/src/lib/ac-parser.js +99 -5
  61. package/dist/src/lib/assess/index.d.ts +10 -0
  62. package/dist/src/lib/assess/index.js +9 -0
  63. package/dist/src/lib/assess/renderer.d.ts +64 -0
  64. package/dist/src/lib/assess/renderer.js +481 -0
  65. package/dist/src/lib/assess/types.d.ts +224 -0
  66. package/dist/src/lib/assess/types.js +241 -0
  67. package/dist/src/lib/assess-collision-detect.d.ts +19 -2
  68. package/dist/src/lib/assess-collision-detect.js +68 -4
  69. package/dist/src/lib/ci/outputs.d.ts +15 -2
  70. package/dist/src/lib/ci/outputs.js +17 -5
  71. package/dist/src/lib/cli-flags.d.ts +33 -0
  72. package/dist/src/lib/cli-flags.js +46 -0
  73. package/dist/src/lib/cli-ui/run-renderer-types.d.ts +21 -7
  74. package/dist/src/lib/cli-ui/run-renderer.d.ts +10 -0
  75. package/dist/src/lib/cli-ui/run-renderer.js +79 -9
  76. package/dist/src/lib/errors.d.ts +84 -6
  77. package/dist/src/lib/errors.js +142 -17
  78. package/dist/src/lib/locks/index.d.ts +3 -3
  79. package/dist/src/lib/locks/index.js +2 -2
  80. package/dist/src/lib/locks/lock-manager.d.ts +20 -2
  81. package/dist/src/lib/locks/lock-manager.js +47 -3
  82. package/dist/src/lib/locks/types.d.ts +34 -3
  83. package/dist/src/lib/locks/types.js +16 -0
  84. package/dist/src/lib/manifest.js +1 -17
  85. package/dist/src/lib/mcp-config.d.ts +45 -0
  86. package/dist/src/lib/mcp-config.js +77 -1
  87. package/dist/src/lib/merge-check/combined-branch-test.d.ts +21 -2
  88. package/dist/src/lib/merge-check/combined-branch-test.js +233 -110
  89. package/dist/src/lib/merge-check/command-result.d.ts +36 -0
  90. package/dist/src/lib/merge-check/command-result.js +56 -0
  91. package/dist/src/lib/merge-check/index.d.ts +4 -0
  92. package/dist/src/lib/merge-check/index.js +1 -1
  93. package/dist/src/lib/merge-check/report.js +5 -1
  94. package/dist/src/lib/merge-check/types.d.ts +9 -0
  95. package/dist/src/lib/merge-check/watch.d.ts +121 -0
  96. package/dist/src/lib/merge-check/watch.js +215 -0
  97. package/dist/src/lib/qa/infra-blocked-ci.d.ts +90 -0
  98. package/dist/src/lib/qa/infra-blocked-ci.js +80 -0
  99. package/dist/src/lib/settings.d.ts +14 -0
  100. package/dist/src/lib/settings.js +61 -8
  101. package/dist/src/lib/shutdown.d.ts +42 -2
  102. package/dist/src/lib/shutdown.js +75 -5
  103. package/dist/src/lib/skills-check.d.ts +26 -0
  104. package/dist/src/lib/skills-check.js +31 -0
  105. package/dist/src/lib/stacks.d.ts +110 -1
  106. package/dist/src/lib/stacks.js +244 -5
  107. package/dist/src/lib/templates.d.ts +74 -0
  108. package/dist/src/lib/templates.js +171 -16
  109. package/dist/src/lib/test-tautology-detector.d.ts +9 -2
  110. package/dist/src/lib/test-tautology-detector.js +153 -12
  111. package/dist/src/lib/version-check.d.ts +31 -0
  112. package/dist/src/lib/version-check.js +46 -7
  113. package/dist/src/lib/workflow/batch-executor.d.ts +138 -6
  114. package/dist/src/lib/workflow/batch-executor.js +550 -54
  115. package/dist/src/lib/workflow/chain-preflight.d.ts +89 -0
  116. package/dist/src/lib/workflow/chain-preflight.js +199 -0
  117. package/dist/src/lib/workflow/chain-resume.d.ts +118 -0
  118. package/dist/src/lib/workflow/chain-resume.js +170 -0
  119. package/dist/src/lib/workflow/completed-status.d.ts +52 -0
  120. package/dist/src/lib/workflow/completed-status.js +57 -0
  121. package/dist/src/lib/workflow/config-resolver.d.ts +26 -0
  122. package/dist/src/lib/workflow/config-resolver.js +54 -2
  123. package/dist/src/lib/workflow/dependency-markers.d.ts +29 -0
  124. package/dist/src/lib/workflow/dependency-markers.js +79 -0
  125. package/dist/src/lib/workflow/drivers/agent-driver.d.ts +7 -0
  126. package/dist/src/lib/workflow/drivers/aider.d.ts +2 -0
  127. package/dist/src/lib/workflow/drivers/aider.js +2 -0
  128. package/dist/src/lib/workflow/drivers/claude-code.d.ts +21 -0
  129. package/dist/src/lib/workflow/drivers/claude-code.js +50 -8
  130. package/dist/src/lib/workflow/error-classifier.d.ts +9 -2
  131. package/dist/src/lib/workflow/error-classifier.js +14 -1
  132. package/dist/src/lib/workflow/git-diff-utils.d.ts +35 -3
  133. package/dist/src/lib/workflow/git-diff-utils.js +77 -4
  134. package/dist/src/lib/workflow/heartbeat.d.ts +38 -0
  135. package/dist/src/lib/workflow/heartbeat.js +90 -0
  136. package/dist/src/lib/workflow/log-writer.d.ts +44 -1
  137. package/dist/src/lib/workflow/log-writer.js +81 -14
  138. package/dist/src/lib/workflow/metrics-schema.d.ts +42 -3
  139. package/dist/src/lib/workflow/metrics-schema.js +16 -0
  140. package/dist/src/lib/workflow/metrics-writer.d.ts +2 -1
  141. package/dist/src/lib/workflow/phase-executor.d.ts +234 -13
  142. package/dist/src/lib/workflow/phase-executor.js +533 -56
  143. package/dist/src/lib/workflow/phase-registry.js +2 -1
  144. package/dist/src/lib/workflow/platforms/github.d.ts +64 -0
  145. package/dist/src/lib/workflow/platforms/github.js +152 -0
  146. package/dist/src/lib/workflow/qa-cache.d.ts +6 -1
  147. package/dist/src/lib/workflow/qa-cache.js +22 -9
  148. package/dist/src/lib/workflow/ready-gate.d.ts +17 -4
  149. package/dist/src/lib/workflow/ready-gate.js +25 -9
  150. package/dist/src/lib/workflow/run-log-schema.d.ts +37 -0
  151. package/dist/src/lib/workflow/run-log-schema.js +92 -2
  152. package/dist/src/lib/workflow/run-orchestrator.d.ts +33 -0
  153. package/dist/src/lib/workflow/run-orchestrator.js +429 -47
  154. package/dist/src/lib/workflow/skills-preflight.d.ts +89 -0
  155. package/dist/src/lib/workflow/skills-preflight.js +112 -0
  156. package/dist/src/lib/workflow/state-cleanup.js +9 -2
  157. package/dist/src/lib/workflow/state-manager.d.ts +33 -0
  158. package/dist/src/lib/workflow/state-manager.js +83 -0
  159. package/dist/src/lib/workflow/state-schema.d.ts +26 -0
  160. package/dist/src/lib/workflow/state-schema.js +47 -0
  161. package/dist/src/lib/workflow/status-derivation.d.ts +30 -0
  162. package/dist/src/lib/workflow/status-derivation.js +27 -0
  163. package/dist/src/lib/workflow/types.d.ts +149 -4
  164. package/dist/src/lib/workflow/types.js +1 -0
  165. package/dist/src/lib/workflow/worktree-manager.d.ts +70 -2
  166. package/dist/src/lib/workflow/worktree-manager.js +201 -52
  167. package/dist/src/mcp/tools/run.d.ts +11 -1
  168. package/dist/src/mcp/tools/run.js +22 -1
  169. package/dist/src/mcp/tools/status.js +6 -0
  170. package/dist/src/ui/tui/ElapsedTimer.d.ts +12 -3
  171. package/dist/src/ui/tui/ElapsedTimer.js +12 -10
  172. package/dist/src/ui/tui/IssueBox.js +10 -2
  173. package/dist/src/ui/tui/row-cap.js +2 -1
  174. package/dist/src/ui/tui/theme.d.ts +7 -0
  175. package/dist/src/ui/tui/theme.js +9 -0
  176. package/package.json +9 -10
  177. package/templates/hooks/parallel-marker.sh +50 -0
  178. package/templates/hooks/post-tool.sh +38 -10
  179. package/templates/hooks/pre-tool.sh +405 -67
  180. package/templates/scripts/cleanup-worktree.sh +282 -30
  181. package/templates/scripts/new-feature.sh +264 -16
  182. package/templates/skills/_shared/references/trust-model.md +18 -0
  183. package/templates/skills/assess/SKILL.md +250 -344
  184. package/templates/skills/assess/references/predicted-collision-detection.md +10 -7
  185. package/templates/skills/docs/SKILL.md +4 -4
  186. package/templates/skills/exec/SKILL.md +26 -6
  187. package/templates/skills/fullsolve/SKILL.md +4 -2
  188. package/templates/skills/loop/SKILL.md +38 -2
  189. package/templates/skills/merger/SKILL.md +2 -2
  190. package/templates/skills/qa/SKILL.md +337 -57
  191. package/templates/skills/qa/references/anti-pattern-detection.md +6 -6
  192. package/templates/skills/qa/references/call-site-review.md +2 -2
  193. package/templates/skills/qa/references/code-review-checklist.md +2 -2
  194. package/templates/skills/qa/references/fixtures/injection-issue-body.md +36 -0
  195. package/templates/skills/qa/references/quality-gates.md +21 -7
  196. package/templates/skills/qa/references/testing-requirements.md +1 -1
  197. package/templates/skills/qa/scripts/quality-checks.sh +11 -11
  198. package/templates/skills/reflect/SKILL.md +27 -13
  199. package/templates/skills/reflect/references/documentation-tiers.md +80 -68
  200. package/templates/skills/reflect/references/phase-reflection.md +31 -15
  201. package/templates/skills/release/SKILL.md +11 -3
  202. package/templates/skills/setup/SKILL.md +5 -5
  203. package/templates/skills/spec/SKILL.md +2 -0
  204. package/templates/skills/spec/references/verification-criteria.md +1 -1
  205. package/templates/skills/test/SKILL.md +1 -1
  206. package/dist/src/lib/phase-spinner.d.ts +0 -146
  207. package/dist/src/lib/phase-spinner.js +0 -255
  208. package/dist/src/lib/workflow/pr-operations.d.ts +0 -86
  209. package/dist/src/lib/workflow/pr-operations.js +0 -326
  210. package/dist/src/lib/workflow/run-summary.d.ts +0 -36
  211. package/dist/src/lib/workflow/run-summary.js +0 -142
@@ -6,6 +6,12 @@
6
6
  * Also supports alternate formats: `- [ ] **B2:** Description`
7
7
  * And bold-wrapped format: `- [ ] **AC-1: Description**`
8
8
  *
9
+ * Bare checkbox items (`- [ ] Some requirement`, no ID prefix) are also
10
+ * honored, but ONLY under an explicit `## Acceptance Criteria` heading, where
11
+ * they receive synthesized stable IDs. Human-authored issues rarely prefix
12
+ * their ACs with IDs, so without this every hand-written issue parsed to zero
13
+ * ACs — blinding every downstream AC consumer (#850).
14
+ *
9
15
  * @example
10
16
  * ```typescript
11
17
  * import { parseAcceptanceCriteria } from './ac-parser';
@@ -33,6 +39,9 @@ import { createAcceptanceCriterion, createAcceptanceCriteria, } from "./workflow
33
39
  * - `- [ ] **B2:** Description`
34
40
  * - `- [ ] **AC1:** Description`
35
41
  * - `- [ ] **AC-1: Description**` (bold wraps ID + description)
42
+ * - `- [ ] **AC-1** Description` (bold ID, no colon)
43
+ * - `- [ ] **AC-1**: Description` (colon outside the bold)
44
+ * - `- [ ] AC-1: Description`
36
45
  */
37
46
  const AC_PATTERNS = [
38
47
  // Pattern 1: `- [ ] **AC-1:** Description` or `- [x] **AC-1:** Description`
@@ -43,7 +52,41 @@ const AC_PATTERNS = [
43
52
  /^-\s*\[[x\s]\]\s*\*\*([A-Za-z]+-?\d+):\s*(.+?)\*\*\s*(.*)$/gim,
44
53
  // Pattern 4: `- [ ] AC-1: Description` (no bold)
45
54
  /^-\s*\[[x\s]\]\s*([A-Za-z]+-?\d+):\s*(.+)$/gim,
55
+ // Pattern 5: `- [ ] **AC-1** Description` / `- [ ] **AC-1**: Description` (#808)
56
+ //
57
+ // The colon-less form is a very common authoring style, and before this
58
+ // pattern existed it matched nothing at all — an issue written this way
59
+ // parsed as ZERO acceptance criteria, silently, with no warning anywhere
60
+ // downstream (#803's five ACs were written exactly like this).
61
+ //
62
+ // The trailing `:?` also absorbs a colon placed *outside* the bold, which
63
+ // would otherwise land in the description as a leading ": ".
64
+ //
65
+ // Deliberately requires the bold markers. A bare `- [ ] AC1 something` is
66
+ // ambiguous against ordinary checklist prose, so widening that far would
67
+ // trade a silent miss for silent false positives. The `\d+` at the end of
68
+ // the ID keeps non-identifier bold labels (`**Note**`, `**Verify**`) out.
69
+ /^-\s*\[[x\s]\]\s*\*\*([A-Za-z]+-?\d+)\*\*:?\s*(.+)$/gim,
46
70
  ];
71
+ /**
72
+ * Matches an `## Acceptance Criteria` heading (any level, case-insensitive).
73
+ *
74
+ * Real issues vary the casing — #703 uses `## Acceptance criteria` (lowercase
75
+ * "criteria") — so the match must be case-insensitive. The trailing `\b` lets
76
+ * a suffix follow ("Acceptance Criteria (v2)") without demanding an exact end.
77
+ */
78
+ const AC_HEADING_RE = /^#{1,6}\s+acceptance\s+criteria\b/i;
79
+ /**
80
+ * Matches any markdown ATX heading. Used to detect when the AC section ends —
81
+ * the next heading of any level closes it, mirroring `parseNonGoals` in
82
+ * `ready-gate.ts`.
83
+ */
84
+ const HEADING_RE = /^#{1,6}\s+/;
85
+ /**
86
+ * Matches a bare checkbox item with no ID prefix: `- [ ] Some requirement`.
87
+ * Honored only inside the AC section (see {@link parseAcceptanceCriteria}).
88
+ */
89
+ const BARE_CHECKBOX_RE = /^-\s*\[[x\s]\]\s*(.+)$/i;
47
90
  /**
48
91
  * Keywords that suggest verification method
49
92
  */
@@ -122,22 +165,73 @@ function parseACLine(line) {
122
165
  * - `- [ ] **AC-1:** Description`
123
166
  * - `- [ ] **B2:** Description`
124
167
  * - `- [ ] **AC-1: Description**` (bold wraps ID + description)
168
+ * - `- [ ] **AC-1** Description` (bold ID, no colon)
169
+ * - `- [ ] **AC-1**: Description` (colon outside the bold)
125
170
  * - `- [ ] AC-1: Description`
126
171
  *
172
+ * Bare checkbox items without an ID prefix (`- [ ] Some requirement`) are also
173
+ * parsed, but ONLY under an explicit `## Acceptance Criteria` heading, where
174
+ * they receive synthesized stable IDs (`AC-1`, `AC-2`, ...). This keeps
175
+ * unrelated checklists elsewhere in the body (Open Questions, Test Plan) from
176
+ * being misread as ACs, while letting ordinary human-written issues parse.
177
+ *
127
178
  * @param issueBody - The full GitHub issue body markdown
128
179
  * @returns Array of parsed acceptance criteria
129
180
  */
130
181
  export function parseAcceptanceCriteria(issueBody) {
131
182
  const criteria = [];
132
183
  const seenIds = new Set();
133
- // Split into lines and process each
184
+ const push = (id, description) => {
185
+ if (seenIds.has(id))
186
+ return;
187
+ seenIds.add(id);
188
+ criteria.push(createAcceptanceCriterion(id, description, inferVerificationMethod(description)));
189
+ };
190
+ // Split into lines and process each. `inAcSection` tracks whether the
191
+ // current line falls under an `## Acceptance Criteria` heading; it toggles on
192
+ // every heading and closes at the next heading of any level (same boundary
193
+ // rule as `parseNonGoals` in ready-gate.ts). `bareCount` numbers synthesized
194
+ // IDs for bare checkboxes in appearance order.
134
195
  const lines = issueBody.split("\n");
196
+ let inAcSection = false;
197
+ let bareCount = 0;
198
+ // Pre-scan for explicit IDs anywhere in the body. Synthesis must skip IDs
199
+ // owned by explicit markers even when the marker appears on a LATER line —
200
+ // otherwise a bare checkbox listed before `**AC-1:**` under the same heading
201
+ // synthesizes AC-1 first and the author's explicit AC-1 is silently dropped
202
+ // by the first-occurrence dedupe.
203
+ const explicitIds = new Set();
135
204
  for (const line of lines) {
136
205
  const parsed = parseACLine(line);
137
- if (parsed && !seenIds.has(parsed.id)) {
138
- seenIds.add(parsed.id);
139
- const verificationMethod = inferVerificationMethod(parsed.description);
140
- criteria.push(createAcceptanceCriterion(parsed.id, parsed.description, verificationMethod));
206
+ if (parsed)
207
+ explicitIds.add(parsed.id);
208
+ }
209
+ for (const line of lines) {
210
+ if (HEADING_RE.test(line)) {
211
+ inAcSection = AC_HEADING_RE.test(line);
212
+ continue;
213
+ }
214
+ // Existing ID-prefixed patterns run on every line, regardless of section,
215
+ // so previously-parsable issues are unaffected (AC-4).
216
+ const parsed = parseACLine(line);
217
+ if (parsed) {
218
+ push(parsed.id, parsed.description);
219
+ continue;
220
+ }
221
+ // Bare-checkbox fallback: only inside the AC section (AC-1/AC-2).
222
+ if (inAcSection) {
223
+ const bare = line.match(BARE_CHECKBOX_RE);
224
+ const description = bare?.[1].trim();
225
+ if (description) {
226
+ // Synthesize `AC-<n>`, skipping any ID already taken by an explicit
227
+ // marker — before OR after this line — so a synthesized ID can never
228
+ // collide with (and be silently dropped against) a hand-written one.
229
+ let id;
230
+ do {
231
+ id = `AC-${++bareCount}`;
232
+ } while (seenIds.has(id) || explicitIds.has(id));
233
+ push(id, description);
234
+ }
141
235
  }
142
236
  }
143
237
  return criteria;
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Deterministic rendering for `/assess` output (#823).
3
+ *
4
+ * `types.ts` owns the contract, `renderer.ts` owns the geometry. Neither touches
5
+ * TTY state, ANSI, or I/O — see the header comment in `renderer.ts` for why that
6
+ * rules out the `cli-ui.ts` helpers.
7
+ */
8
+ export { AssessActionSchema, AssessChainSchema, AssessCleanupSchema, AssessCommandSchema, AssessFlagSchema, AssessIssueSchema, AssessResultSchema, AssessResultValidationError, AssessWarningSchema, parseAssessResult, } from "./types.js";
9
+ export type { AssessAction, AssessChain, AssessCleanup, AssessCommand, AssessFlag, AssessIssue, AssessResult, AssessWarning, } from "./types.js";
10
+ export { GEOMETRY, render, renderBatch, renderSingle } from "./renderer.js";
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Deterministic rendering for `/assess` output (#823).
3
+ *
4
+ * `types.ts` owns the contract, `renderer.ts` owns the geometry. Neither touches
5
+ * TTY state, ANSI, or I/O — see the header comment in `renderer.ts` for why that
6
+ * rules out the `cli-ui.ts` helpers.
7
+ */
8
+ export { AssessActionSchema, AssessChainSchema, AssessCleanupSchema, AssessCommandSchema, AssessFlagSchema, AssessIssueSchema, AssessResultSchema, AssessResultValidationError, AssessWarningSchema, parseAssessResult, } from "./types.js";
9
+ export { GEOMETRY, render, renderBatch, renderSingle } from "./renderer.js";
@@ -0,0 +1,64 @@
1
+ /**
2
+ * Deterministic renderer for `/assess` output (#823).
3
+ *
4
+ * ## Why this module exists
5
+ *
6
+ * `/assess` was asked to hand-draw an aligned ASCII dashboard inside a prompt.
7
+ * It did two things wrong, both recurring: it silently substituted a prose
8
+ * summary for the block entirely, and when it did draw the table the columns
9
+ * drifted (every worked example in `SKILL.md` had its header offset from its own
10
+ * data rows). Both are the same root cause — deterministic formatting done by
11
+ * hand. This module takes the arithmetic away from the model. The model keeps
12
+ * the judgment; a tool call, which is observable in the transcript, produces the
13
+ * geometry.
14
+ *
15
+ * ## Why not `cli-ui.ts`
16
+ *
17
+ * Its `table()` / `box()` / `divider()` / `sectionHeader()` helpers are the
18
+ * obvious first instinct and the wrong tool. They emit ANSI via `chalk`, gate on
19
+ * `config.isTTY` / `config.jsonMode` (so they silently degrade when stdout is a
20
+ * pipe — which it always is here, since this runs from a Bash call), and
21
+ * `table()` delegates to `cli-table3`'s bordered grid. This output lands in a
22
+ * chat transcript *and* is posted to GitHub, then re-parsed by
23
+ * `assess-comment-parser.ts`. It must be byte-stable, ANSI-free, and
24
+ * copy-pasteable.
25
+ *
26
+ * The only thing shared with the terminal UI is the `string-width` dependency.
27
+ * The module is otherwise modeled on `src/lib/cli-ui/format.ts`: pure
28
+ * deterministic string formatting, no TTY state, no I/O.
29
+ */
30
+ import type { AssessResult } from "./types.js";
31
+ /** Column at which the `Reason` field starts, given whether `ACs` is shown. */
32
+ declare function reasonCol(withAcs: boolean): number;
33
+ /** Width of the `Reason` field — whatever is left before {@link RUN_COL}. */
34
+ declare function reasonWidth(withAcs: boolean): number;
35
+ /**
36
+ * Render the batch dashboard: table → `Commands:` → annotations → markers.
37
+ *
38
+ * Every section is conditional (Section Visibility Rules). A section that has no
39
+ * content takes its adjacent separator with it, so an all-clear batch renders as
40
+ * table → separator → commands → separator → markers and nothing else.
41
+ */
42
+ export declare function renderBatch(result: AssessResult): string;
43
+ /**
44
+ * Render the single-issue assessment for one verdict.
45
+ *
46
+ * PROCEED and REWRITE templates define a `⚠` region between two trailing
47
+ * separators. CLOSE / CLARIFY / PARK / MERGE do not, so a carried warning
48
+ * becomes its own separator-delimited block immediately above the markers — the
49
+ * one case where a posted comment extends a slot-less template.
50
+ */
51
+ export declare function renderSingle(result: AssessResult): string;
52
+ /** Dispatch on `mode`. The entry point the CLI subcommand calls. */
53
+ export declare function render(result: AssessResult): string;
54
+ /**
55
+ * Geometry constants, exported for tests and for documenting the layout.
56
+ * Consumers should treat these as read-only.
57
+ */
58
+ export declare const GEOMETRY: {
59
+ readonly RUN_COL: 47;
60
+ readonly SEPARATOR_WIDTH: 64;
61
+ readonly reasonCol: typeof reasonCol;
62
+ readonly reasonWidth: typeof reasonWidth;
63
+ };
64
+ export {};