sequant 2.9.0 → 2.11.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 (209) hide show
  1. package/.claude-plugin/marketplace.json +1 -1
  2. package/.claude-plugin/plugin.json +1 -1
  3. package/README.md +20 -5
  4. package/dist/bin/cli.js +143 -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 +56 -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 +20 -7
  10. package/dist/marketplace/external_plugins/sequant/hooks/pre-tool.sh +75 -10
  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 +215 -390
  13. package/dist/marketplace/external_plugins/sequant/skills/assess/references/predicted-collision-detection.md +1 -1
  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 +3 -1
  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/release/SKILL.md +1 -1
  28. package/dist/marketplace/external_plugins/sequant/skills/setup/SKILL.md +5 -5
  29. package/dist/marketplace/external_plugins/sequant/skills/spec/SKILL.md +2 -0
  30. package/dist/marketplace/external_plugins/sequant/skills/test/SKILL.md +1 -1
  31. package/dist/src/commands/assess-render.d.ts +23 -0
  32. package/dist/src/commands/assess-render.js +60 -0
  33. package/dist/src/commands/doctor.js +8 -13
  34. package/dist/src/commands/init.js +13 -1
  35. package/dist/src/commands/locks.d.ts +20 -1
  36. package/dist/src/commands/locks.js +208 -4
  37. package/dist/src/commands/logs.js +14 -5
  38. package/dist/src/commands/merge.js +154 -2
  39. package/dist/src/commands/ready-tui-adapter.js +6 -1
  40. package/dist/src/commands/ready.d.ts +31 -3
  41. package/dist/src/commands/ready.js +53 -13
  42. package/dist/src/commands/resume.d.ts +113 -0
  43. package/dist/src/commands/resume.js +193 -0
  44. package/dist/src/commands/run-display.js +38 -4
  45. package/dist/src/commands/run-flags.d.ts +42 -1
  46. package/dist/src/commands/run-flags.js +53 -1
  47. package/dist/src/commands/run-progress.js +26 -1
  48. package/dist/src/commands/run.js +11 -10
  49. package/dist/src/commands/state.js +7 -0
  50. package/dist/src/commands/status.d.ts +9 -0
  51. package/dist/src/commands/status.js +24 -1
  52. package/dist/src/commands/sync.js +90 -19
  53. package/dist/src/commands/update.js +28 -5
  54. package/dist/src/commands/worktree.d.ts +31 -0
  55. package/dist/src/commands/worktree.js +95 -0
  56. package/dist/src/lib/ac-parser.d.ts +14 -0
  57. package/dist/src/lib/ac-parser.js +99 -5
  58. package/dist/src/lib/assess/index.d.ts +10 -0
  59. package/dist/src/lib/assess/index.js +9 -0
  60. package/dist/src/lib/assess/renderer.d.ts +64 -0
  61. package/dist/src/lib/assess/renderer.js +481 -0
  62. package/dist/src/lib/assess/types.d.ts +224 -0
  63. package/dist/src/lib/assess/types.js +241 -0
  64. package/dist/src/lib/ci/outputs.d.ts +15 -2
  65. package/dist/src/lib/ci/outputs.js +17 -5
  66. package/dist/src/lib/cli-flags.d.ts +56 -0
  67. package/dist/src/lib/cli-flags.js +89 -0
  68. package/dist/src/lib/cli-ui/run-renderer-types.d.ts +23 -7
  69. package/dist/src/lib/cli-ui/run-renderer.d.ts +10 -0
  70. package/dist/src/lib/cli-ui/run-renderer.js +69 -1
  71. package/dist/src/lib/errors.d.ts +78 -6
  72. package/dist/src/lib/errors.js +133 -15
  73. package/dist/src/lib/locks/checkout-lock.d.ts +193 -0
  74. package/dist/src/lib/locks/checkout-lock.js +389 -0
  75. package/dist/src/lib/locks/index.d.ts +7 -4
  76. package/dist/src/lib/locks/index.js +5 -3
  77. package/dist/src/lib/locks/lock-manager.d.ts +101 -3
  78. package/dist/src/lib/locks/lock-manager.js +277 -8
  79. package/dist/src/lib/locks/types.d.ts +106 -3
  80. package/dist/src/lib/locks/types.js +44 -0
  81. package/dist/src/lib/mcp-config.d.ts +45 -0
  82. package/dist/src/lib/mcp-config.js +77 -1
  83. package/dist/src/lib/merge-check/combined-branch-test.d.ts +21 -2
  84. package/dist/src/lib/merge-check/combined-branch-test.js +233 -110
  85. package/dist/src/lib/merge-check/command-result.d.ts +36 -0
  86. package/dist/src/lib/merge-check/command-result.js +56 -0
  87. package/dist/src/lib/merge-check/index.d.ts +4 -0
  88. package/dist/src/lib/merge-check/index.js +1 -1
  89. package/dist/src/lib/merge-check/report.js +5 -1
  90. package/dist/src/lib/merge-check/types.d.ts +9 -0
  91. package/dist/src/lib/merge-check/watch.d.ts +121 -0
  92. package/dist/src/lib/merge-check/watch.js +215 -0
  93. package/dist/src/lib/qa/infra-blocked-ci.d.ts +90 -0
  94. package/dist/src/lib/qa/infra-blocked-ci.js +80 -0
  95. package/dist/src/lib/settings.d.ts +87 -0
  96. package/dist/src/lib/settings.js +106 -8
  97. package/dist/src/lib/shutdown.d.ts +42 -2
  98. package/dist/src/lib/shutdown.js +75 -5
  99. package/dist/src/lib/skills-check.d.ts +26 -0
  100. package/dist/src/lib/skills-check.js +31 -0
  101. package/dist/src/lib/stacks.d.ts +110 -1
  102. package/dist/src/lib/stacks.js +244 -5
  103. package/dist/src/lib/templates.d.ts +74 -0
  104. package/dist/src/lib/templates.js +171 -16
  105. package/dist/src/lib/test-tautology-detector.d.ts +10 -2
  106. package/dist/src/lib/test-tautology-detector.js +213 -12
  107. package/dist/src/lib/version-check.d.ts +31 -0
  108. package/dist/src/lib/version-check.js +45 -2
  109. package/dist/src/lib/workflow/batch-executor.d.ts +125 -6
  110. package/dist/src/lib/workflow/batch-executor.js +552 -60
  111. package/dist/src/lib/workflow/chain-resume.d.ts +13 -11
  112. package/dist/src/lib/workflow/chain-resume.js +24 -20
  113. package/dist/src/lib/workflow/completed-status.d.ts +52 -0
  114. package/dist/src/lib/workflow/completed-status.js +57 -0
  115. package/dist/src/lib/workflow/config-resolver.d.ts +51 -0
  116. package/dist/src/lib/workflow/config-resolver.js +143 -2
  117. package/dist/src/lib/workflow/drivers/agent-driver.d.ts +22 -0
  118. package/dist/src/lib/workflow/drivers/aider.d.ts +2 -0
  119. package/dist/src/lib/workflow/drivers/aider.js +2 -0
  120. package/dist/src/lib/workflow/drivers/claude-code.d.ts +14 -0
  121. package/dist/src/lib/workflow/drivers/claude-code.js +25 -2
  122. package/dist/src/lib/workflow/effort-escalation.d.ts +73 -0
  123. package/dist/src/lib/workflow/effort-escalation.js +82 -0
  124. package/dist/src/lib/workflow/error-classifier.d.ts +4 -1
  125. package/dist/src/lib/workflow/error-classifier.js +4 -0
  126. package/dist/src/lib/workflow/git-diff-utils.d.ts +35 -3
  127. package/dist/src/lib/workflow/git-diff-utils.js +77 -4
  128. package/dist/src/lib/workflow/heartbeat.d.ts +38 -0
  129. package/dist/src/lib/workflow/heartbeat.js +90 -0
  130. package/dist/src/lib/workflow/log-writer.d.ts +54 -2
  131. package/dist/src/lib/workflow/log-writer.js +95 -6
  132. package/dist/src/lib/workflow/metrics-schema.d.ts +52 -9
  133. package/dist/src/lib/workflow/metrics-schema.js +33 -0
  134. package/dist/src/lib/workflow/metrics-writer.d.ts +11 -0
  135. package/dist/src/lib/workflow/phase-detection.d.ts +12 -0
  136. package/dist/src/lib/workflow/phase-detection.js +5 -1
  137. package/dist/src/lib/workflow/phase-executor.d.ts +203 -14
  138. package/dist/src/lib/workflow/phase-executor.js +467 -52
  139. package/dist/src/lib/workflow/phase-registry.js +2 -1
  140. package/dist/src/lib/workflow/platforms/github.d.ts +64 -0
  141. package/dist/src/lib/workflow/platforms/github.js +152 -0
  142. package/dist/src/lib/workflow/qa-cache.d.ts +6 -1
  143. package/dist/src/lib/workflow/qa-cache.js +22 -9
  144. package/dist/src/lib/workflow/ready-gate.d.ts +45 -4
  145. package/dist/src/lib/workflow/ready-gate.js +49 -12
  146. package/dist/src/lib/workflow/run-log-schema.d.ts +69 -0
  147. package/dist/src/lib/workflow/run-log-schema.js +78 -2
  148. package/dist/src/lib/workflow/run-orchestrator.d.ts +19 -0
  149. package/dist/src/lib/workflow/run-orchestrator.js +168 -20
  150. package/dist/src/lib/workflow/skills-preflight.d.ts +89 -0
  151. package/dist/src/lib/workflow/skills-preflight.js +112 -0
  152. package/dist/src/lib/workflow/spec-recommendation.d.ts +71 -0
  153. package/dist/src/lib/workflow/spec-recommendation.js +142 -0
  154. package/dist/src/lib/workflow/state-cleanup.js +9 -2
  155. package/dist/src/lib/workflow/state-manager.d.ts +33 -0
  156. package/dist/src/lib/workflow/state-manager.js +83 -0
  157. package/dist/src/lib/workflow/state-schema.d.ts +26 -0
  158. package/dist/src/lib/workflow/state-schema.js +47 -0
  159. package/dist/src/lib/workflow/types.d.ts +190 -4
  160. package/dist/src/lib/workflow/types.js +1 -0
  161. package/dist/src/lib/workflow/worktree-manager.d.ts +36 -3
  162. package/dist/src/lib/workflow/worktree-manager.js +111 -24
  163. package/dist/src/lib/workflow/worktree-resolver.d.ts +73 -0
  164. package/dist/src/lib/workflow/worktree-resolver.js +126 -0
  165. package/dist/src/mcp/tools/run.d.ts +9 -1
  166. package/dist/src/mcp/tools/run.js +20 -1
  167. package/dist/src/mcp/tools/status.js +6 -0
  168. package/dist/src/ui/tui/ElapsedTimer.d.ts +12 -3
  169. package/dist/src/ui/tui/ElapsedTimer.js +12 -10
  170. package/dist/src/ui/tui/IssueBox.js +10 -2
  171. package/dist/src/ui/tui/row-cap.js +2 -1
  172. package/dist/src/ui/tui/theme.d.ts +7 -0
  173. package/dist/src/ui/tui/theme.js +9 -0
  174. package/package.json +10 -8
  175. package/templates/hooks/parallel-marker.sh +50 -0
  176. package/templates/hooks/post-tool.sh +20 -7
  177. package/templates/hooks/pre-tool.sh +303 -10
  178. package/templates/scripts/cleanup-worktree.sh +217 -33
  179. package/templates/scripts/new-feature.sh +289 -35
  180. package/templates/skills/_shared/references/subagent-types.md +7 -18
  181. package/templates/skills/_shared/references/trust-model.md +18 -0
  182. package/templates/skills/assess/SKILL.md +220 -391
  183. package/templates/skills/assess/references/predicted-collision-detection.md +1 -1
  184. package/templates/skills/docs/SKILL.md +4 -4
  185. package/templates/skills/exec/SKILL.md +87 -13
  186. package/templates/skills/fullsolve/SKILL.md +130 -22
  187. package/templates/skills/loop/SKILL.md +94 -13
  188. package/templates/skills/merger/SKILL.md +100 -12
  189. package/templates/skills/qa/SKILL.md +396 -63
  190. package/templates/skills/qa/references/anti-pattern-detection.md +6 -6
  191. package/templates/skills/qa/references/call-site-review.md +2 -2
  192. package/templates/skills/qa/references/code-review-checklist.md +2 -2
  193. package/templates/skills/qa/references/fixtures/injection-issue-body.md +36 -0
  194. package/templates/skills/qa/references/quality-gates.md +21 -7
  195. package/templates/skills/qa/references/testing-requirements.md +1 -1
  196. package/templates/skills/qa/scripts/quality-checks.sh +11 -11
  197. package/templates/skills/release/SKILL.md +80 -1
  198. package/templates/skills/setup/SKILL.md +5 -5
  199. package/templates/skills/spec/SKILL.md +33 -15
  200. package/templates/skills/spec/references/recommended-workflow.md +14 -1
  201. package/templates/skills/test/SKILL.md +1 -1
  202. package/templates/skills/testgen/SKILL.md +23 -6
  203. package/dist/src/lib/phase-spinner.d.ts +0 -146
  204. package/dist/src/lib/phase-spinner.js +0 -255
  205. package/dist/src/lib/workflow/pr-operations.d.ts +0 -86
  206. package/dist/src/lib/workflow/pr-operations.js +0 -326
  207. package/dist/src/lib/workflow/run-summary.d.ts +0 -36
  208. package/dist/src/lib/workflow/run-summary.js +0 -142
  209. package/templates/agents/sequant-explorer.md +0 -24
@@ -7,6 +7,7 @@
7
7
  * (including quality-loop retries, checkpoint commits, rebasing, and PR
8
8
  * creation).
9
9
  */
10
+ import { LogWriter } from "./log-writer.js";
10
11
  import { ExecutionConfig, PhaseResult, IssueResult, type RunOptions, type IssueExecutionContext, type BatchExecutionContext, type ProgressCallback } from "./types.js";
11
12
  import { type ErrorCategory } from "./error-classifier.js";
12
13
  export type { RunOptions, ProgressCallback, IssueExecutionContext, BatchExecutionContext, } from "./types.js";
@@ -21,15 +22,32 @@ export type { RunOptions, ProgressCallback, IssueExecutionContext, BatchExecutio
21
22
  * @param extra - Optional fields: durationSeconds (on complete), error (on failed)
22
23
  */
23
24
  /**
24
- * Wrap an `ExecutionConfig` with an `onActivity` hook that re-emits each
25
- * agent-output ping as a `"activity"` progress event for the dashboard (#543).
25
+ * Wrap an `ExecutionConfig` with the runtime liveness hooks:
26
+ * - `onActivity` — re-emits each agent-output ping as an `"activity"` progress
27
+ * event for the dashboard (#543).
28
+ * - `onAutoWait` — re-emits each auto-wait tick as a `"waiting"` progress
29
+ * event so the renderer and heartbeat can show the pause and its wake time
30
+ * (#804 AC-7). Under `SEQUANT_ORCHESTRATOR` it additionally emits throttled
31
+ * `SEQUANT_PROGRESS` waiting lines (#860): an MCP-driven wait was previously
32
+ * invisible on the JSON channel — indistinguishable from a hang — AND was
33
+ * killed by the MCP inactivity timeout, which resets on progress lines.
34
+ * Optionally notifies `onWaitTransition` on wait start/end so the caller
35
+ * can persist the wait to issue state (`sequant status` truthfulness).
26
36
  *
27
- * Returns the input config unchanged when no `onProgress` callback is set,
28
- * so non-TUI runs pay no overhead.
37
+ * Returns the input config unchanged when there is no consumer at all (no
38
+ * `onProgress`, no orchestrator channel, no transition callback), so plain
39
+ * non-TUI runs pay no overhead.
29
40
  *
30
41
  * @internal Exported for testing only
31
42
  */
32
- export declare function withActivityHook(base: ExecutionConfig, issueNumber: number, phase: string, onProgress: ProgressCallback | undefined): ExecutionConfig;
43
+ export declare function withActivityHook(base: ExecutionConfig, issueNumber: number, phase: string, onProgress: ProgressCallback | undefined, onWaitTransition?: (wakeAtMs: number | null) => void): ExecutionConfig;
44
+ /**
45
+ * Cadence of orchestrator-channel waiting lines during an auto-wait (#860).
46
+ * See {@link withActivityHook}.
47
+ *
48
+ * @internal Exported for testing only
49
+ */
50
+ export declare const AUTO_WAIT_PROGRESS_LINE_INTERVAL_MS = 60000;
33
51
  /**
34
52
  * Build enriched prompt context for the /loop phase from a failed phase result (#488).
35
53
  * Passes QA verdict, failed ACs, and error directly so the /loop skill doesn't need
@@ -38,10 +56,12 @@ export declare function withActivityHook(base: ExecutionConfig, issueNumber: num
38
56
  * @internal Exported for testing only
39
57
  */
40
58
  export declare function buildLoopContext(failedResult: PhaseResult): string;
41
- export declare function emitProgressLine(issue: number, phase: string, event?: "start" | "complete" | "failed", extra?: {
59
+ export declare function emitProgressLine(issue: number, phase: string, event?: "start" | "complete" | "failed" | "waiting", extra?: {
42
60
  durationSeconds?: number;
43
61
  error?: string;
44
62
  iteration?: number;
63
+ wakeAtMs?: number;
64
+ remainingMs?: number;
45
65
  }): void;
46
66
  /**
47
67
  * Emit the current run's UUID on stderr so MCP callers can look up the exact
@@ -73,6 +93,32 @@ export declare function parseBatches(batchArgs: string[]): number[][];
73
93
  * Parse environment variables for CI configuration
74
94
  */
75
95
  export declare function getEnvConfig(): Partial<RunOptions>;
96
+ /**
97
+ * Record an issue's completion in the run log in ONE place (#879): PR info, the
98
+ * PR-failure status flip, then finalize. Extracted so every batch loop shares a
99
+ * single completion sequence and cannot drift.
100
+ *
101
+ * The #879 defect was exactly such a drift: `markIssueFailed` was wired into
102
+ * `executeBatch`'s loop, but the live `sequant run` path is
103
+ * `RunOrchestrator.executeOneIssue`, which called `setPRInfo` + `completeIssue`
104
+ * without it — so a real run left the run-log status at `success` on a
105
+ * PR-creation failure. Both call sites now go through this helper.
106
+ *
107
+ * A PR-creation failure occurs after every phase has been logged, so
108
+ * `deriveIssueLogStatus` (last run at phase-log time) leaves the issue at
109
+ * `success`; the flip here is what counts it under `failed`. Safe post-hoc:
110
+ * no further phase is logged before `completeIssue`.
111
+ */
112
+ export declare function recordIssueCompletion(logWriter: LogWriter, result: IssueResult, issueNumber?: number): void;
113
+ /**
114
+ * @deprecated No live caller — `sequant run` executes issues via
115
+ * `RunOrchestrator.executeOneIssue`; this survives only as a
116
+ * `commands/run-compat` re-export. Do not build a new execution loop on it:
117
+ * any path that completes an issue MUST go through
118
+ * {@link recordIssueCompletion}, or the #879 status-drift returns (a
119
+ * completion path that skips the PR-failure flip logs a failed issue as
120
+ * `success`). Slated for removal with the run-compat surface.
121
+ */
76
122
  export declare function executeBatch(issueNumbers: number[], batchCtx: BatchExecutionContext): Promise<IssueResult[]>;
77
123
  /**
78
124
  * Derive the bounded-enum failure category for a failed issue (#761 AC-7).
@@ -86,4 +132,77 @@ export declare function executeBatch(issueNumbers: number[], batchCtx: BatchExec
86
132
  * @internal Exported for testing
87
133
  */
88
134
  export declare function deriveFailureCategory(phaseResults: PhaseResult[]): ErrorCategory | undefined;
135
+ /**
136
+ * "Halt, don't loop" predicate for the outer `-Q` quality loop (#799).
137
+ *
138
+ * A billing / out-of-credits failure (`BillingError`) or a window-exhausted
139
+ * rate limit (reset hours away, per `isWindowExhaustedRateLimit`) cannot be
140
+ * recovered by re-running the phase — every retry re-spawns into the same
141
+ * closed window and, worse, mislabels the halt as a downstream
142
+ * `QA completed without a parseable verdict`. Mirrors the `haltedByCap` (#739)
143
+ * treatment: surface the real cause and halt so the user resumes once credits
144
+ * or the rate-limit window are restored.
145
+ *
146
+ * A transient / metadata-absent rate limit is NOT a halt: it returns false and
147
+ * keeps today's outer-loop behavior (the inner retry ladder in `phase-executor`
148
+ * handles its backoff, per #761 AC-4/AC-9).
149
+ *
150
+ * @internal Exported for testing
151
+ */
152
+ export declare function isBillingOrWindowHalt(result: PhaseResult): boolean;
153
+ /**
154
+ * The billing half of {@link isBillingOrWindowHalt} (#804 AC-8).
155
+ *
156
+ * Split out because the two causes stopped being interchangeable once
157
+ * `--auto-wait` existed: a closed window can now reopen on its own, while
158
+ * out-of-credits cannot — credits are purchased, not waited out. Callers that
159
+ * need to reason about recoverability must be able to tell them apart.
160
+ *
161
+ * @internal Exported for testing
162
+ */
163
+ export declare function isBillingHalt(result: PhaseResult): boolean;
164
+ /**
165
+ * The rate-limit-window half of {@link isBillingOrWindowHalt} (#804 AC-8).
166
+ *
167
+ * NOTE — this predicate needed no behavioral change for auto-wait, and that is
168
+ * a deliberate finding rather than an oversight. AC-8 anticipated that a phase
169
+ * which waits and then succeeds would still halt the `-Q` loop. It cannot:
170
+ * every call site (`:~700` spec, `:~1030` progress label, `:~1150` halt flag)
171
+ * sits inside the `else` of an `if (result.success)`, so a successful
172
+ * post-wait result never reaches this predicate at all. When auto-wait does
173
+ * NOT fire — the default, an exhausted budget, or a spent wait bound — the
174
+ * result is still a failure carrying a window-exhausted `RateLimitError`, and
175
+ * halting is then the correct outcome (#799 behavior, preserved exactly).
176
+ *
177
+ * @internal Exported for testing
178
+ */
179
+ export declare function isWindowHalt(result: PhaseResult): boolean;
180
+ /**
181
+ * Human-readable halt reason for a billing / rate-limit-window failure (#799
182
+ * AC-3). Surfaces the driver's real cause verbatim — `result.error` is already
183
+ * the well-formatted message the driver built via `formatRateLimitMessage`
184
+ * (`Out of credits` for billing, `Rate limited — resets at <local time>` for a
185
+ * throttle with a known reset), so the phase-failed line and run summary name
186
+ * the actual cause instead of a downstream `QA completed without a parseable
187
+ * verdict`.
188
+ *
189
+ * Do NOT re-append `resetsAt` here: the rate-limit message already carries the
190
+ * reset time, and doing so produced a doubled, timezone-inconsistent string
191
+ * (`… resets at 07-24 14:32 — resets at 2026-…Z`). Credits failures carry no
192
+ * reset time by design (they need purchasing, not a window wait).
193
+ *
194
+ * @internal Exported for testing
195
+ */
196
+ export declare function billingHaltReason(result: PhaseResult): string;
197
+ /**
198
+ * Epoch ms after which a waitable-window halt can be re-entered (#892 AC-1):
199
+ * the window's `resetsAt` normalized to ms plus the same buffer auto-wait
200
+ * applies (`AUTO_WAIT_BUFFER_MS`), so in-process waits and durable halts wake
201
+ * on the same clock. Returns `null` when the result carries no future-reset
202
+ * rate-limit window — callers must then skip the `windowHalt` write rather
203
+ * than invent a resume time.
204
+ *
205
+ * @internal Exported for testing
206
+ */
207
+ export declare function windowHaltResumeAtMs(result: PhaseResult): number | null;
89
208
  export declare function runIssueWithLogging(ctx: IssueExecutionContext): Promise<IssueResult>;