@mjasnikovs/pi-task 0.38.29 → 0.38.30

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 (370) hide show
  1. package/dist/config/config.d.ts +70 -70
  2. package/dist/config/config.js +26 -35
  3. package/dist/config/extension-list.d.ts +6 -5
  4. package/dist/config/extension-list.js +3 -2
  5. package/dist/config/reasoning-args.d.ts +9 -7
  6. package/dist/config/reasoning-args.js +12 -10
  7. package/dist/config/reasoning.d.ts +44 -105
  8. package/dist/config/reasoning.js +27 -704
  9. package/dist/config/register.d.ts +34 -48
  10. package/dist/config/register.js +41 -51
  11. package/dist/config/tool-list.d.ts +16 -16
  12. package/dist/config/tool-list.js +1 -1
  13. package/dist/remote/bridge.d.ts +19 -10
  14. package/dist/remote/bridge.js +3 -2
  15. package/dist/remote/broadcast.js +3 -1
  16. package/dist/remote/events.js +12 -11
  17. package/dist/remote/history.d.ts +1 -1
  18. package/dist/remote/protocol.d.ts +6 -3
  19. package/dist/remote/protocol.js +2 -1
  20. package/dist/remote/push.d.ts +16 -16
  21. package/dist/remote/push.js +27 -27
  22. package/dist/remote/register.d.ts +3 -3
  23. package/dist/remote/register.js +17 -19
  24. package/dist/remote/server.d.ts +9 -8
  25. package/dist/remote/server.js +15 -14
  26. package/dist/remote/session-state.d.ts +5 -4
  27. package/dist/remote/session-state.js +8 -5
  28. package/dist/remote/sw.d.ts +7 -6
  29. package/dist/remote/sw.js +7 -6
  30. package/dist/remote/tailscale.d.ts +4 -2
  31. package/dist/remote/tailscale.js +4 -2
  32. package/dist/remote/ui-highlight.js +6 -5
  33. package/dist/remote/ui-render.js +4 -4
  34. package/dist/remote/ui-script.js +24 -24
  35. package/dist/remote/ui-styles.d.ts +1 -1
  36. package/dist/remote/ui-styles.js +10 -13
  37. package/dist/remote/ui-tools.js +9 -6
  38. package/dist/shared/child-extensions.d.ts +29 -17
  39. package/dist/shared/child-extensions.js +29 -17
  40. package/dist/shared/child-output.d.ts +30 -24
  41. package/dist/shared/child-output.js +25 -17
  42. package/dist/shared/child-process.d.ts +47 -40
  43. package/dist/shared/child-process.js +50 -59
  44. package/dist/shared/command-watchdog.d.ts +22 -16
  45. package/dist/shared/command-watchdog.js +28 -21
  46. package/dist/shared/fs-text.d.ts +16 -10
  47. package/dist/shared/fs-text.js +16 -10
  48. package/dist/shared/git-runner.d.ts +25 -25
  49. package/dist/shared/git-runner.js +25 -25
  50. package/dist/shared/leaked-tool-call.d.ts +17 -11
  51. package/dist/shared/leaked-tool-call.js +23 -15
  52. package/dist/shared/model-endpoint.d.ts +29 -16
  53. package/dist/shared/model-endpoint.js +33 -21
  54. package/dist/shared/pi-invocation.d.ts +7 -4
  55. package/dist/shared/pi-invocation.js +12 -7
  56. package/dist/shared/pkg-version.d.ts +13 -5
  57. package/dist/shared/pkg-version.js +13 -5
  58. package/dist/shared/reasoning-capability.d.ts +35 -24
  59. package/dist/shared/reasoning-capability.js +35 -24
  60. package/dist/shared/stream-watchdog.d.ts +60 -44
  61. package/dist/shared/stream-watchdog.js +62 -45
  62. package/dist/task/accept-debt.d.ts +41 -43
  63. package/dist/task/accept-debt.js +73 -65
  64. package/dist/task/api-synthesis.d.ts +24 -21
  65. package/dist/task/api-synthesis.js +32 -26
  66. package/dist/task/apis-contract.d.ts +32 -64
  67. package/dist/task/apis-contract.js +32 -64
  68. package/dist/task/artifact-closure.d.ts +27 -13
  69. package/dist/task/artifact-closure.js +95 -67
  70. package/dist/task/auto-commit.d.ts +46 -35
  71. package/dist/task/auto-commit.js +51 -38
  72. package/dist/task/auto-io.d.ts +45 -25
  73. package/dist/task/auto-io.js +57 -29
  74. package/dist/task/auto-orchestrator.d.ts +26 -24
  75. package/dist/task/auto-orchestrator.js +178 -162
  76. package/dist/task/auto-prompts.d.ts +36 -24
  77. package/dist/task/auto-prompts.js +40 -26
  78. package/dist/task/autofix-ledger.d.ts +27 -25
  79. package/dist/task/autofix-ledger.js +29 -26
  80. package/dist/task/batch-test-task.d.ts +20 -12
  81. package/dist/task/batch-test-task.js +67 -60
  82. package/dist/task/boot-probe.d.ts +60 -44
  83. package/dist/task/boot-probe.js +91 -72
  84. package/dist/task/cancel-input.d.ts +30 -16
  85. package/dist/task/cancel-input.js +20 -11
  86. package/dist/task/cancel-points.d.ts +27 -20
  87. package/dist/task/cancel-points.js +30 -22
  88. package/dist/task/child-runner.d.ts +46 -51
  89. package/dist/task/child-runner.js +48 -49
  90. package/dist/task/child-status.d.ts +23 -16
  91. package/dist/task/child-status.js +23 -16
  92. package/dist/task/clamp-output.js +12 -5
  93. package/dist/task/command-run.d.ts +31 -28
  94. package/dist/task/command-run.js +44 -35
  95. package/dist/task/command-shrink.d.ts +25 -18
  96. package/dist/task/command-shrink.js +37 -31
  97. package/dist/task/command-watchdog.d.ts +9 -6
  98. package/dist/task/command-watchdog.js +21 -15
  99. package/dist/task/context-attribution.d.ts +34 -26
  100. package/dist/task/context-attribution.js +34 -26
  101. package/dist/task/context-silence.d.ts +39 -29
  102. package/dist/task/context-silence.js +35 -25
  103. package/dist/task/context-usage.d.ts +16 -9
  104. package/dist/task/context-usage.js +16 -9
  105. package/dist/task/contracts.d.ts +8 -4
  106. package/dist/task/contracts.js +25 -17
  107. package/dist/task/coverage-loop.d.ts +22 -18
  108. package/dist/task/coverage-loop.js +35 -30
  109. package/dist/task/critique-probes.d.ts +13 -14
  110. package/dist/task/critique-probes.js +50 -39
  111. package/dist/task/debug-log.d.ts +13 -5
  112. package/dist/task/debug-log.js +32 -20
  113. package/dist/task/decompose-fidelity.d.ts +11 -9
  114. package/dist/task/decompose-fidelity.js +38 -33
  115. package/dist/task/decompose-granularity.d.ts +41 -38
  116. package/dist/task/decompose-granularity.js +41 -38
  117. package/dist/task/deep-render-check.d.ts +22 -14
  118. package/dist/task/deep-render-check.js +40 -31
  119. package/dist/task/dropped-input.d.ts +12 -7
  120. package/dist/task/dropped-input.js +5 -2
  121. package/dist/task/enforce-attribution.d.ts +38 -47
  122. package/dist/task/enforce-attribution.js +46 -52
  123. package/dist/task/enforce-guidelines.d.ts +31 -20
  124. package/dist/task/enforce-guidelines.js +32 -21
  125. package/dist/task/enrichment.d.ts +7 -2
  126. package/dist/task/enrichment.js +26 -14
  127. package/dist/task/env-notes.d.ts +16 -7
  128. package/dist/task/env-notes.js +48 -31
  129. package/dist/task/env-template-closure.d.ts +4 -4
  130. package/dist/task/env-template-closure.js +42 -34
  131. package/dist/task/external-context.d.ts +28 -21
  132. package/dist/task/external-context.js +17 -12
  133. package/dist/task/failure-classifier.d.ts +4 -5
  134. package/dist/task/failure-classifier.js +6 -7
  135. package/dist/task/file-inventory.d.ts +15 -11
  136. package/dist/task/file-inventory.js +25 -22
  137. package/dist/task/final-gate-fix.d.ts +74 -86
  138. package/dist/task/final-gate-fix.js +97 -116
  139. package/dist/task/final-gate-progress.d.ts +29 -46
  140. package/dist/task/final-gate-progress.js +40 -51
  141. package/dist/task/final-gate.d.ts +64 -97
  142. package/dist/task/final-gate.js +192 -199
  143. package/dist/task/fix-child.d.ts +21 -27
  144. package/dist/task/fix-child.js +21 -27
  145. package/dist/task/foreign-path.d.ts +6 -5
  146. package/dist/task/foreign-path.js +0 -0
  147. package/dist/task/frozen-conflict.d.ts +9 -10
  148. package/dist/task/frozen-conflict.js +61 -64
  149. package/dist/task/frozen-path-guard.d.ts +35 -14
  150. package/dist/task/frozen-path-guard.js +56 -39
  151. package/dist/task/gate-child.d.ts +27 -28
  152. package/dist/task/gate-child.js +36 -35
  153. package/dist/task/gate-deps.d.ts +34 -27
  154. package/dist/task/gate-deps.js +169 -159
  155. package/dist/task/gate-tally.d.ts +77 -80
  156. package/dist/task/gate-tally.js +65 -68
  157. package/dist/task/git-state-guard.d.ts +15 -11
  158. package/dist/task/git-state-guard.js +76 -66
  159. package/dist/task/impl-widget.d.ts +25 -16
  160. package/dist/task/impl-widget.js +27 -17
  161. package/dist/task/implementation-thinking.d.ts +33 -31
  162. package/dist/task/implementation-thinking.js +5 -6
  163. package/dist/task/implementation-turn.d.ts +34 -31
  164. package/dist/task/implementation-turn.js +29 -27
  165. package/dist/task/inline-markdown.d.ts +20 -7
  166. package/dist/task/inline-markdown.js +15 -6
  167. package/dist/task/launch-config-gap.js +25 -39
  168. package/dist/task/launch-contract.d.ts +18 -21
  169. package/dist/task/launch-contract.js +28 -30
  170. package/dist/task/launch-manifest.d.ts +6 -2
  171. package/dist/task/launch-manifest.js +35 -34
  172. package/dist/task/ledger.js +16 -14
  173. package/dist/task/lint-fix.d.ts +6 -8
  174. package/dist/task/lint-fix.js +67 -69
  175. package/dist/task/loop-detector.d.ts +9 -8
  176. package/dist/task/loop-detector.js +16 -12
  177. package/dist/task/mid-run-input.d.ts +17 -15
  178. package/dist/task/mid-run-input.js +17 -15
  179. package/dist/task/orchestrator.d.ts +24 -28
  180. package/dist/task/orchestrator.js +62 -64
  181. package/dist/task/orientation.d.ts +18 -23
  182. package/dist/task/orientation.js +24 -31
  183. package/dist/task/owned-freeze-conflict.d.ts +21 -20
  184. package/dist/task/owned-freeze-conflict.js +52 -85
  185. package/dist/task/owned-freeze-reassign.d.ts +40 -60
  186. package/dist/task/owned-freeze-reassign.js +41 -61
  187. package/dist/task/parsers.d.ts +4 -2
  188. package/dist/task/parsers.js +4 -4
  189. package/dist/task/phases.d.ts +41 -48
  190. package/dist/task/phases.js +179 -248
  191. package/dist/task/plan-io.d.ts +6 -7
  192. package/dist/task/plan-io.js +6 -7
  193. package/dist/task/plan-orchestrator.d.ts +10 -8
  194. package/dist/task/plan-orchestrator.js +14 -10
  195. package/dist/task/plan-prompts.d.ts +6 -5
  196. package/dist/task/plan-prompts.js +6 -5
  197. package/dist/task/plan-readonly.d.ts +4 -5
  198. package/dist/task/plan-readonly.js +4 -5
  199. package/dist/task/plan-rounds.d.ts +17 -29
  200. package/dist/task/plan-rounds.js +21 -34
  201. package/dist/task/plan-session.d.ts +58 -72
  202. package/dist/task/plan-session.js +61 -83
  203. package/dist/task/probe-gaming.d.ts +28 -27
  204. package/dist/task/probe-gaming.js +0 -0
  205. package/dist/task/prohibition-probe.d.ts +14 -16
  206. package/dist/task/prompts.d.ts +3 -4
  207. package/dist/task/prompts.js +17 -26
  208. package/dist/task/qa-transcript.d.ts +15 -22
  209. package/dist/task/qa-transcript.js +15 -21
  210. package/dist/task/question-box.d.ts +17 -13
  211. package/dist/task/question-box.js +19 -15
  212. package/dist/task/question-dedup.d.ts +6 -7
  213. package/dist/task/question-dedup.js +13 -14
  214. package/dist/task/question-dialog.d.ts +22 -32
  215. package/dist/task/question-dialog.js +22 -32
  216. package/dist/task/question-source.d.ts +18 -44
  217. package/dist/task/question-source.js +22 -51
  218. package/dist/task/refuted-constraint.d.ts +11 -31
  219. package/dist/task/refuted-constraint.js +27 -51
  220. package/dist/task/regenerable-artifacts.d.ts +12 -31
  221. package/dist/task/regenerable-artifacts.js +12 -31
  222. package/dist/task/render-check.d.ts +11 -22
  223. package/dist/task/render-check.js +33 -46
  224. package/dist/task/repo-health-check.d.ts +10 -14
  225. package/dist/task/repo-health-check.js +17 -23
  226. package/dist/task/requirements.d.ts +38 -71
  227. package/dist/task/requirements.js +78 -126
  228. package/dist/task/research-fanout-budget.d.ts +51 -88
  229. package/dist/task/research-fanout-budget.js +51 -88
  230. package/dist/task/research-worker.d.ts +29 -39
  231. package/dist/task/research-worker.js +37 -61
  232. package/dist/task/resume-gap.d.ts +14 -15
  233. package/dist/task/root-cause-repair.d.ts +9 -9
  234. package/dist/task/root-cause-repair.js +28 -40
  235. package/dist/task/run-bracket.d.ts +10 -13
  236. package/dist/task/run-end.d.ts +12 -22
  237. package/dist/task/run-end.js +8 -16
  238. package/dist/task/run-final-gate.d.ts +19 -21
  239. package/dist/task/run-final-gate.js +62 -80
  240. package/dist/task/runner-globs.d.ts +12 -13
  241. package/dist/task/runner-globs.js +12 -13
  242. package/dist/task/runner-resolve.d.ts +9 -9
  243. package/dist/task/runner-resolve.js +22 -23
  244. package/dist/task/script-escape.d.ts +10 -12
  245. package/dist/task/script-escape.js +13 -14
  246. package/dist/task/serve-entry.d.ts +1 -1
  247. package/dist/task/serve-entry.js +22 -25
  248. package/dist/task/service-blocks.js +4 -2
  249. package/dist/task/shipped-source.d.ts +11 -29
  250. package/dist/task/shipped-source.js +11 -29
  251. package/dist/task/skip-escape.js +10 -14
  252. package/dist/task/spec-urls.d.ts +26 -65
  253. package/dist/task/spec-urls.js +26 -65
  254. package/dist/task/spec-validation.d.ts +17 -20
  255. package/dist/task/spec-validation.js +17 -20
  256. package/dist/task/stall-detector.d.ts +23 -30
  257. package/dist/task/stall-detector.js +23 -30
  258. package/dist/task/stream-watchdog.d.ts +14 -12
  259. package/dist/task/stream-watchdog.js +14 -12
  260. package/dist/task/substitution-probe.d.ts +17 -20
  261. package/dist/task/substitution-probe.js +17 -20
  262. package/dist/task/task-gates.d.ts +36 -41
  263. package/dist/task/task-gates.js +95 -106
  264. package/dist/task/task-io.d.ts +4 -4
  265. package/dist/task/task-io.js +4 -4
  266. package/dist/task/task-parsers.js +4 -3
  267. package/dist/task/task-provenance.d.ts +2 -2
  268. package/dist/task/task-provenance.js +11 -13
  269. package/dist/task/task-types.d.ts +4 -3
  270. package/dist/task/terminal-outcome.d.ts +14 -16
  271. package/dist/task/terminal-outcome.js +12 -14
  272. package/dist/task/test-assembly.d.ts +13 -20
  273. package/dist/task/test-assembly.js +13 -20
  274. package/dist/task/timings.d.ts +5 -3
  275. package/dist/task/timings.js +5 -3
  276. package/dist/task/title-label.d.ts +9 -4
  277. package/dist/task/title-label.js +9 -4
  278. package/dist/task/type-only-answer.d.ts +44 -52
  279. package/dist/task/type-only-answer.js +44 -52
  280. package/dist/task/unfailable-command.d.ts +18 -24
  281. package/dist/task/unfailable-command.js +21 -27
  282. package/dist/task/unknown-routing.d.ts +10 -4
  283. package/dist/task/unknown-routing.js +10 -4
  284. package/dist/task/user-directives.d.ts +5 -8
  285. package/dist/task/user-directives.js +5 -8
  286. package/dist/task/verify-quality.d.ts +18 -22
  287. package/dist/task/verify-quality.js +45 -46
  288. package/dist/task/verify-reconcile.d.ts +15 -10
  289. package/dist/task/verify-reconcile.js +45 -43
  290. package/dist/task/verify-resolution.d.ts +24 -20
  291. package/dist/task/verify-resolution.js +51 -50
  292. package/dist/task/verify-work.d.ts +59 -66
  293. package/dist/task/verify-work.js +101 -138
  294. package/dist/task/widget.d.ts +15 -14
  295. package/dist/task/widget.js +22 -17
  296. package/dist/task/wiring-claims.d.ts +25 -32
  297. package/dist/task/wiring-claims.js +30 -35
  298. package/dist/task/write-guard.d.ts +39 -39
  299. package/dist/task/write-guard.js +48 -51
  300. package/dist/task/yolo.d.ts +34 -30
  301. package/dist/task/yolo.js +42 -37
  302. package/dist/workers/abstention.d.ts +21 -41
  303. package/dist/workers/abstention.js +27 -48
  304. package/dist/workers/brave-search.d.ts +4 -3
  305. package/dist/workers/brave-search.js +5 -2
  306. package/dist/workers/brave-warning.d.ts +7 -4
  307. package/dist/workers/brave-warning.js +19 -7
  308. package/dist/workers/ddg-search.d.ts +6 -6
  309. package/dist/workers/ddg-search.js +18 -12
  310. package/dist/workers/docs-cache.js +5 -2
  311. package/dist/workers/docs-chunk.d.ts +30 -37
  312. package/dist/workers/docs-chunk.js +37 -41
  313. package/dist/workers/docs-core.d.ts +28 -44
  314. package/dist/workers/docs-core.js +25 -44
  315. package/dist/workers/docs-index.js +4 -3
  316. package/dist/workers/docs-lookup.d.ts +15 -22
  317. package/dist/workers/docs-lookup.js +12 -21
  318. package/dist/workers/docs-project.d.ts +15 -9
  319. package/dist/workers/docs-project.js +17 -10
  320. package/dist/workers/docs-resolve.d.ts +19 -20
  321. package/dist/workers/docs-resolve.js +35 -32
  322. package/dist/workers/docs-retrieve.d.ts +5 -6
  323. package/dist/workers/docs-retrieve.js +18 -15
  324. package/dist/workers/exa-search.d.ts +9 -6
  325. package/dist/workers/exa-search.js +23 -12
  326. package/dist/workers/fetch-core.d.ts +13 -16
  327. package/dist/workers/fetch-core.js +23 -23
  328. package/dist/workers/focused-extractor.d.ts +12 -12
  329. package/dist/workers/focused-extractor.js +16 -19
  330. package/dist/workers/html-clean.js +24 -14
  331. package/dist/workers/http-request.d.ts +28 -20
  332. package/dist/workers/http-request.js +22 -17
  333. package/dist/workers/npm-version.d.ts +28 -11
  334. package/dist/workers/npm-version.js +24 -15
  335. package/dist/workers/phantom-imports.d.ts +15 -12
  336. package/dist/workers/phantom-imports.js +30 -24
  337. package/dist/workers/pi-worker-core.d.ts +69 -71
  338. package/dist/workers/pi-worker-core.js +100 -109
  339. package/dist/workers/pi-worker-docs.d.ts +24 -19
  340. package/dist/workers/pi-worker-docs.js +67 -76
  341. package/dist/workers/pi-worker-fetch.d.ts +7 -3
  342. package/dist/workers/pi-worker-fetch.js +27 -19
  343. package/dist/workers/pi-worker-search.js +12 -8
  344. package/dist/workers/pi-worker.d.ts +9 -4
  345. package/dist/workers/pi-worker.js +21 -14
  346. package/dist/workers/reasoning-warning.d.ts +18 -17
  347. package/dist/workers/reasoning-warning.js +22 -20
  348. package/dist/workers/research-cache.js +50 -78
  349. package/dist/workers/search-core.js +7 -5
  350. package/dist/workers/search-types.d.ts +10 -9
  351. package/dist/workers/search-types.js +9 -8
  352. package/dist/workers/session-hint.d.ts +13 -14
  353. package/dist/workers/session-hint.js +8 -9
  354. package/dist/workers/shared.d.ts +21 -25
  355. package/dist/workers/shared.js +0 -0
  356. package/dist/workers/single-read-extension.d.ts +14 -7
  357. package/dist/workers/single-read-extension.js +14 -7
  358. package/dist/workers/single-read-guard.d.ts +25 -28
  359. package/dist/workers/single-read-guard.js +32 -32
  360. package/dist/workers/typeonly-log.d.ts +12 -9
  361. package/dist/workers/typeonly-log.js +29 -33
  362. package/dist/workers/worker-channels.d.ts +15 -23
  363. package/dist/workers/worker-channels.js +15 -23
  364. package/dist/workers/worker-failure.d.ts +38 -46
  365. package/dist/workers/worker-failure.js +31 -39
  366. package/dist/workers/worker-kill.d.ts +25 -26
  367. package/dist/workers/worker-kill.js +16 -19
  368. package/dist/workers/worker-profiles.d.ts +43 -53
  369. package/dist/workers/worker-profiles.js +30 -38
  370. package/package.json +10 -8
@@ -1,36 +1,48 @@
1
1
  /**
2
- * Clarify: asks ONE question at a time. Output MUST match parseClarifyList — a
3
- * single numbered question followed by a "SUGGESTED: <default>" line, an optional
4
- * "ALT: <alternative>" line for binary "A or B?" forks, or the literal token NONE
5
- * when no clarification remains. priorQA carries the questions already answered so
6
- * each next question adapts to them.
2
+ * Clarify: asks ONE question at a time. Output MUST match `parseClarifyList`
3
+ * the shared parser in parsers.ts that question-source.ts actually calls on this
4
+ * reply so the shape is a single numbered question, then a "SUGGESTED: <default>"
5
+ * line, then an optional "ALT: <alternative>" line for binary "A or B?" forks, or
6
+ * the literal token NONE when no clarification remains. `priorQA` is interpolated
7
+ * as ANSWERS SO FAR, so each next question adapts to what has been settled.
8
+ *
9
+ * Runs with the read tool (`--tools read`), which is what the "you may use the read
10
+ * tool" line above depends on.
7
11
  */
8
12
  export declare const AUTO_CLARIFY_PROMPT: (feature: string, priorQA: string) => string;
9
13
  /**
10
14
  * Decompose: output a markdown checkbox list of task titles (one line each).
11
- * `requirementsLedger` is buildRequirementsLedger's grounded quote list (goal E's
12
- * belt): the spec's obligations ride into decompose explicitly, so mirroring the
13
- * spec's own milestone/section structure cannot silently discharge them. '' ⇒
14
- * the prompt is unchanged.
15
15
  *
16
- * `noBatchTests` adds the anti-batch-test rule (batch-test-task.ts) emitted ONLY
17
- * when the decisions mandate tests-in-the-same-change, so every other run sees the
18
- * prompt it always saw. It is the belt; the host-side rewrite is the lever.
16
+ * `requirementsLedger` is buildRequirementsLedger's grounded quote list: the spec's
17
+ * obligations ride into decompose explicitly, so mirroring the spec's own
18
+ * milestone/section structure cannot silently discharge them. An empty or
19
+ * whitespace-only ledger leaves the prompt byte-identical to the default — checked.
20
+ *
21
+ * `noBatchTests` adds the anti-batch-test rule (batch-test-task.ts), emitted ONLY
22
+ * when the decisions mandate tests-in-the-same-change; `false` also leaves the
23
+ * prompt byte-identical, so every other run sees the same text. It is the belt —
24
+ * `rewriteBatchTestPlan` is the host-side lever.
19
25
  *
20
- * Plan GRANULARITY is deliberately NOT a rule here it rides in CLARIFICATIONS
21
- * (decompose-granularity.ts). Live A/B: as a RULES line replacing "prefer a
22
- * handful", it made plan size explode (81 and 85 titles for a spec whose healthy
23
- * plan is ~30, one 120k-context blowup); as a clarification, with the counterweight
24
- * below left intact, the same directive holds 20–39 across 16 reps.
26
+ * Plan GRANULARITY is deliberately NOT a rule here. The only count-shaped line in
27
+ * RULES is the FORMAT one ("One task per line"); the floor reaches the model as a
28
+ * CLARIFICATION instead, through the host-set plan-shape answer in the transcript
29
+ * (decompose-granularity.ts), with a split-retry hint if the drawn plan still comes
30
+ * in under it. Kept out of RULES so it lands as one input among several rather
31
+ * than as another imperative competing with the ones already there.
25
32
  */
26
33
  export declare const AUTO_DECOMPOSE_PROMPT: (feature: string, clarifications: string, requirementsLedger?: string, noBatchTests?: boolean) => string;
27
34
  /**
28
- * Coverage triage: judge whether a decomposed task list covers the whole
29
- * feature. Guards the plan — the highest-leverage artifact in /task-auto —
30
- * against a degenerate-but-nonempty decompose completion (live mx5: the model
31
- * emitted ONE task for an 18KB design doc with a natural EOS, and the only
32
- * existing gate was `titles.length === 0`, so the run "completed" after one
33
- * task). Pure judgment over text already in hand, so it runs with --no-tools.
34
- * Output MUST match parseCoverageVerdict.
35
+ * Coverage triage: judge whether a decomposed task list covers the whole feature.
36
+ * Guards the plan — the highest-leverage artifact in /task-auto — against a
37
+ * degenerate-but-nonempty decompose completion: one task emitted for a whole
38
+ * design document, with a natural end-of-stream, which a `titles.length === 0`
39
+ * gate waves through so the run "completes" after that single task.
40
+ *
41
+ * Pure judgment over text already in hand, so it runs with NO tools: the call site
42
+ * passes an empty tools string, which childArgs turns into `--no-tools`.
43
+ *
44
+ * Output MUST match `parseCoverageVerdict`, including the at-most-8 bound — the
45
+ * parser stops collecting MISSING lines at eight, so a longer list is truncated
46
+ * rather than rejected.
35
47
  */
36
48
  export declare const DECOMPOSE_COVERAGE_PROMPT: (feature: string, clarifications: string, list: string[]) => string;
@@ -1,15 +1,21 @@
1
1
  /**
2
- * Prompts for /task-auto's two feature-level child calls. These produce a task
3
- * LIST only; all research/spec depth is /task's job, run per-title later.
2
+ * The three feature-level prompts /task-auto sends before any task starts: one
3
+ * clarifying QUESTION at a time, one task LIST, and one coverage VERDICT over
4
+ * that list. None of them produces a spec — all research and spec depth is
5
+ * /task's job, run per title later.
4
6
  */
5
7
  import { DECOMPOSE_SOURCE_RULE } from './decompose-fidelity.js';
6
8
  import { DECOMPOSE_NO_BATCH_TESTS_RULE } from './batch-test-task.js';
7
9
  /**
8
- * Clarify: asks ONE question at a time. Output MUST match parseClarifyList — a
9
- * single numbered question followed by a "SUGGESTED: <default>" line, an optional
10
- * "ALT: <alternative>" line for binary "A or B?" forks, or the literal token NONE
11
- * when no clarification remains. priorQA carries the questions already answered so
12
- * each next question adapts to them.
10
+ * Clarify: asks ONE question at a time. Output MUST match `parseClarifyList`
11
+ * the shared parser in parsers.ts that question-source.ts actually calls on this
12
+ * reply so the shape is a single numbered question, then a "SUGGESTED: <default>"
13
+ * line, then an optional "ALT: <alternative>" line for binary "A or B?" forks, or
14
+ * the literal token NONE when no clarification remains. `priorQA` is interpolated
15
+ * as ANSWERS SO FAR, so each next question adapts to what has been settled.
16
+ *
17
+ * Runs with the read tool (`--tools read`), which is what the "you may use the read
18
+ * tool" line above depends on.
13
19
  */
14
20
  export const AUTO_CLARIFY_PROMPT = (feature, priorQA) => `You are planning how to split a feature into separate implementation tasks, one clarifying question at a time.
15
21
 
@@ -68,20 +74,23 @@ No question remains:
68
74
  NONE`;
69
75
  /**
70
76
  * Decompose: output a markdown checkbox list of task titles (one line each).
71
- * `requirementsLedger` is buildRequirementsLedger's grounded quote list (goal E's
72
- * belt): the spec's obligations ride into decompose explicitly, so mirroring the
73
- * spec's own milestone/section structure cannot silently discharge them. '' ⇒
74
- * the prompt is unchanged.
75
77
  *
76
- * `noBatchTests` adds the anti-batch-test rule (batch-test-task.ts) emitted ONLY
77
- * when the decisions mandate tests-in-the-same-change, so every other run sees the
78
- * prompt it always saw. It is the belt; the host-side rewrite is the lever.
78
+ * `requirementsLedger` is buildRequirementsLedger's grounded quote list: the spec's
79
+ * obligations ride into decompose explicitly, so mirroring the spec's own
80
+ * milestone/section structure cannot silently discharge them. An empty or
81
+ * whitespace-only ledger leaves the prompt byte-identical to the default — checked.
82
+ *
83
+ * `noBatchTests` adds the anti-batch-test rule (batch-test-task.ts), emitted ONLY
84
+ * when the decisions mandate tests-in-the-same-change; `false` also leaves the
85
+ * prompt byte-identical, so every other run sees the same text. It is the belt —
86
+ * `rewriteBatchTestPlan` is the host-side lever.
79
87
  *
80
- * Plan GRANULARITY is deliberately NOT a rule here it rides in CLARIFICATIONS
81
- * (decompose-granularity.ts). Live A/B: as a RULES line replacing "prefer a
82
- * handful", it made plan size explode (81 and 85 titles for a spec whose healthy
83
- * plan is ~30, one 120k-context blowup); as a clarification, with the counterweight
84
- * below left intact, the same directive holds 20–39 across 16 reps.
88
+ * Plan GRANULARITY is deliberately NOT a rule here. The only count-shaped line in
89
+ * RULES is the FORMAT one ("One task per line"); the floor reaches the model as a
90
+ * CLARIFICATION instead, through the host-set plan-shape answer in the transcript
91
+ * (decompose-granularity.ts), with a split-retry hint if the drawn plan still comes
92
+ * in under it. Kept out of RULES so it lands as one input among several rather
93
+ * than as another imperative competing with the ones already there.
85
94
  */
86
95
  export const AUTO_DECOMPOSE_PROMPT = (feature, clarifications, requirementsLedger = '', noBatchTests = false) => `Split this feature into an ordered list of implementation tasks. Each task
87
96
  will be handed, by its title, to a separate pipeline that does its own research
@@ -108,13 +117,18 @@ RULES:
108
117
  ${DECOMPOSE_SOURCE_RULE}${noBatchTests ? `\n${DECOMPOSE_NO_BATCH_TESTS_RULE}` : ''}
109
118
  - Output the checkbox list and NOTHING else (no preamble, no numbering).`;
110
119
  /**
111
- * Coverage triage: judge whether a decomposed task list covers the whole
112
- * feature. Guards the plan — the highest-leverage artifact in /task-auto —
113
- * against a degenerate-but-nonempty decompose completion (live mx5: the model
114
- * emitted ONE task for an 18KB design doc with a natural EOS, and the only
115
- * existing gate was `titles.length === 0`, so the run "completed" after one
116
- * task). Pure judgment over text already in hand, so it runs with --no-tools.
117
- * Output MUST match parseCoverageVerdict.
120
+ * Coverage triage: judge whether a decomposed task list covers the whole feature.
121
+ * Guards the plan — the highest-leverage artifact in /task-auto — against a
122
+ * degenerate-but-nonempty decompose completion: one task emitted for a whole
123
+ * design document, with a natural end-of-stream, which a `titles.length === 0`
124
+ * gate waves through so the run "completes" after that single task.
125
+ *
126
+ * Pure judgment over text already in hand, so it runs with NO tools: the call site
127
+ * passes an empty tools string, which childArgs turns into `--no-tools`.
128
+ *
129
+ * Output MUST match `parseCoverageVerdict`, including the at-most-8 bound — the
130
+ * parser stops collecting MISSING lines at eight, so a longer list is truncated
131
+ * rather than rejected.
118
132
  */
119
133
  export const DECOMPOSE_COVERAGE_PROMPT = (feature, clarifications, list) => `You are auditing a task decomposition for completeness. Below is a FEATURE
120
134
  REQUEST (with any referenced design spec inlined), the CLARIFICATIONS the user
@@ -2,28 +2,25 @@
2
2
  * autofix-ledger — what the run-end RESOLUTION LOOP records, and the decisions
3
3
  * that record makes.
4
4
  *
5
- * The same deepening `GateTally` already proved one altitude down. That replaced
6
- * twelve mutable locals threaded through ~400 lines of `runFinalIntegrationGate`
7
- * by closure; this replaces six threaded through ~235 lines of
8
- * `runFinalGateStage` the attempt count, the accumulated gitignored writes, the
9
- * stranded sub-fixes, the previous failure signature, the demoted set, and the
10
- * rejected-edits flag.
5
+ * Six pieces of state that would otherwise be mutable locals threaded through
6
+ * `runFinalGateStage` by closure: the attempt count, the accumulated gitignored
7
+ * writes, the stranded sub-fixes, the previous failure signature, the demoted
8
+ * set, and the rejected-edits flag. The same shape `GateTally` uses one altitude
9
+ * down.
11
10
  *
12
11
  * The reason is not tidiness. `final-gate-progress.ts` holds five pure functions,
13
- * each called from exactly ONE site inside that loopextracted for testability
14
- * while the decisions about ORDERING and CARRY-FORWARD stayed in the caller. That
15
- * is precisely the shape `isNonProgress`'s own comment indicts:
16
- *
17
- * > The fix is NOT a better string pattern the bug is that the decision was
18
- * > made downstream from the evidence.
19
- *
20
- * mx5 run 21 shipped a product whose every page was blank as a `completed` run
21
- * through that gap. Here the evidence and the decision sit in one module, and the
22
- * loop body reads as picker → apply → record.
12
+ * and all five are consumed HERE and nowhere elserun-final-gate.ts names the
13
+ * module only in comments and does not import it. The judgement therefore sits
14
+ * beside the evidence it judges: `judge` reads `observedFailures` off the SAME
15
+ * outcome the failure came from, and enters the demoted signature and breaks the
16
+ * previous-signature chain in that one call. A caller cannot apply those steps
17
+ * out of order or skip one, and the loop body reads as picker → apply → record.
23
18
  *
24
19
  * What is NOT here: anything that talks to the user, writes a ledger file, or
25
- * commits. The loop keeps those, the same way `GateTally` keeps no I/O — a record
26
- * that performs effects cannot be driven by a test that only wants the verdict.
20
+ * commits confirmed, the module's only import is final-gate-progress and it
21
+ * touches no filesystem, UI or git. The loop keeps those, the same way
22
+ * `GateTally` keeps no I/O: a record that performs effects cannot be driven by a
23
+ * test that only wants the verdict.
27
24
  */
28
25
  /** The gate-outcome fields this record reads. Structural, so a caller can hand it
29
26
  * a `FinalGateOutcome` without this module importing the gate. */
@@ -51,11 +48,15 @@ export declare class AutofixLedger {
51
48
  private _attempts;
52
49
  /**
53
50
  * Gitignored paths the fix passes have written so far. ACCUMULATED across
54
- * attempts: a `.env` written by a failed attempt is still on disk for the next
55
- * one, and that attempt's own before/after diff cannot see it (mx5 run 19).
51
+ * attempts, and that asymmetry with `_stranded` below is deliberate: a `.env`
52
+ * written by a failed attempt is still on disk for the next one, and that
53
+ * attempt's own before/after diff cannot see it. Run: two calls carrying an
54
+ * overlapping path yield the union, deduplicated, in first-seen order.
56
55
  */
57
56
  private _ignoredWritten;
58
- /** Sub-fixes a non-converging attempt left uncommitted. REPLACED each attempt. */
57
+ /** Sub-fixes a non-converging attempt left uncommitted. REPLACED each attempt,
58
+ * unlike `_ignoredWritten` above — this is a snapshot of what is uncommitted
59
+ * right now, not a history. Run: a second `setStranded` discards the first. */
59
60
  private _stranded;
60
61
  /** The previous attempt's normalized ranked-first failure. */
61
62
  private _prevFailSig;
@@ -64,7 +65,7 @@ export declare class AutofixLedger {
64
65
  /**
65
66
  * A write-guard rejected an attempt whose edits could NOT be discarded, so
66
67
  * REJECTED edits are sitting in the tree and the terminal paths must not commit
67
- * what they find there (mx5 run 14 item 2b — the cheat guard is never weakened
68
+ * what they find there (the cheat guard is never weakened
68
69
  * to ease committing).
69
70
  */
70
71
  private _rejectedEditsInTree;
@@ -85,9 +86,10 @@ export declare class AutofixLedger {
85
86
  /**
86
87
  * May a terminal path commit what is in the working tree?
87
88
  *
88
- * False once a guard has rejected an attempt without discarding its edits.
89
- * This is the ONE question the flag exists to answer, and it is asked at three
90
- * terminal sites — as a method rather than a bare boolean read at each.
89
+ * False once a guard has rejected an attempt without discarding its edits, and
90
+ * it never flips back rejected edits stay rejected for the rest of the loop.
91
+ * Exposed as a method rather than a public boolean so the question is asked in
92
+ * one vocabulary wherever a terminal path needs it.
91
93
  */
92
94
  mayCommitTree(): boolean;
93
95
  /**
@@ -2,28 +2,25 @@
2
2
  * autofix-ledger — what the run-end RESOLUTION LOOP records, and the decisions
3
3
  * that record makes.
4
4
  *
5
- * The same deepening `GateTally` already proved one altitude down. That replaced
6
- * twelve mutable locals threaded through ~400 lines of `runFinalIntegrationGate`
7
- * by closure; this replaces six threaded through ~235 lines of
8
- * `runFinalGateStage` the attempt count, the accumulated gitignored writes, the
9
- * stranded sub-fixes, the previous failure signature, the demoted set, and the
10
- * rejected-edits flag.
5
+ * Six pieces of state that would otherwise be mutable locals threaded through
6
+ * `runFinalGateStage` by closure: the attempt count, the accumulated gitignored
7
+ * writes, the stranded sub-fixes, the previous failure signature, the demoted
8
+ * set, and the rejected-edits flag. The same shape `GateTally` uses one altitude
9
+ * down.
11
10
  *
12
11
  * The reason is not tidiness. `final-gate-progress.ts` holds five pure functions,
13
- * each called from exactly ONE site inside that loopextracted for testability
14
- * while the decisions about ORDERING and CARRY-FORWARD stayed in the caller. That
15
- * is precisely the shape `isNonProgress`'s own comment indicts:
16
- *
17
- * > The fix is NOT a better string pattern the bug is that the decision was
18
- * > made downstream from the evidence.
19
- *
20
- * mx5 run 21 shipped a product whose every page was blank as a `completed` run
21
- * through that gap. Here the evidence and the decision sit in one module, and the
22
- * loop body reads as picker → apply → record.
12
+ * and all five are consumed HERE and nowhere elserun-final-gate.ts names the
13
+ * module only in comments and does not import it. The judgement therefore sits
14
+ * beside the evidence it judges: `judge` reads `observedFailures` off the SAME
15
+ * outcome the failure came from, and enters the demoted signature and breaks the
16
+ * previous-signature chain in that one call. A caller cannot apply those steps
17
+ * out of order or skip one, and the loop body reads as picker → apply → record.
23
18
  *
24
19
  * What is NOT here: anything that talks to the user, writes a ledger file, or
25
- * commits. The loop keeps those, the same way `GateTally` keeps no I/O — a record
26
- * that performs effects cannot be driven by a test that only wants the verdict.
20
+ * commits confirmed, the module's only import is final-gate-progress and it
21
+ * touches no filesystem, UI or git. The loop keeps those, the same way
22
+ * `GateTally` keeps no I/O: a record that performs effects cannot be driven by a
23
+ * test that only wants the verdict.
27
24
  */
28
25
  import { applyDemotions, isNonProgress, normalizeFailureDetail, rankedFirstFailure, unobservedDebtReason } from './final-gate-progress.js';
29
26
  export class AutofixLedger {
@@ -32,11 +29,15 @@ export class AutofixLedger {
32
29
  _attempts = 0;
33
30
  /**
34
31
  * Gitignored paths the fix passes have written so far. ACCUMULATED across
35
- * attempts: a `.env` written by a failed attempt is still on disk for the next
36
- * one, and that attempt's own before/after diff cannot see it (mx5 run 19).
32
+ * attempts, and that asymmetry with `_stranded` below is deliberate: a `.env`
33
+ * written by a failed attempt is still on disk for the next one, and that
34
+ * attempt's own before/after diff cannot see it. Run: two calls carrying an
35
+ * overlapping path yield the union, deduplicated, in first-seen order.
37
36
  */
38
37
  _ignoredWritten = [];
39
- /** Sub-fixes a non-converging attempt left uncommitted. REPLACED each attempt. */
38
+ /** Sub-fixes a non-converging attempt left uncommitted. REPLACED each attempt,
39
+ * unlike `_ignoredWritten` above — this is a snapshot of what is uncommitted
40
+ * right now, not a history. Run: a second `setStranded` discards the first. */
40
41
  _stranded = [];
41
42
  /** The previous attempt's normalized ranked-first failure. */
42
43
  _prevFailSig = null;
@@ -45,7 +46,7 @@ export class AutofixLedger {
45
46
  /**
46
47
  * A write-guard rejected an attempt whose edits could NOT be discarded, so
47
48
  * REJECTED edits are sitting in the tree and the terminal paths must not commit
48
- * what they find there (mx5 run 14 item 2b — the cheat guard is never weakened
49
+ * what they find there (the cheat guard is never weakened
49
50
  * to ease committing).
50
51
  */
51
52
  _rejectedEditsInTree = false;
@@ -89,9 +90,10 @@ export class AutofixLedger {
89
90
  /**
90
91
  * May a terminal path commit what is in the working tree?
91
92
  *
92
- * False once a guard has rejected an attempt without discarding its edits.
93
- * This is the ONE question the flag exists to answer, and it is asked at three
94
- * terminal sites — as a method rather than a bare boolean read at each.
93
+ * False once a guard has rejected an attempt without discarding its edits, and
94
+ * it never flips back rejected edits stay rejected for the rest of the loop.
95
+ * Exposed as a method rather than a public boolean so the question is asked in
96
+ * one vocabulary wherever a terminal path needs it.
95
97
  */
96
98
  mayCommitTree() {
97
99
  return !this._rejectedEditsInTree;
@@ -123,7 +125,8 @@ export class AutofixLedger {
123
125
  })) {
124
126
  this._demoted.add(normalizeFailureDetail(detail));
125
127
  // A demotion ends the chain: the next attempt has no previous signature
126
- // to match, so one demotion cannot cascade into a second.
128
+ // to match, so one demotion cannot cascade into a second. Run on three
129
+ // identical outcomes — only the SECOND demotes, the third does not.
127
130
  this._prevFailSig = null;
128
131
  return { detail, demoted: true, debtReason: unobservedDebtReason(detail) };
129
132
  }
@@ -1,11 +1,12 @@
1
1
  /**
2
2
  * Does the decisions/spec text mandate tests-in-the-same-change?
3
3
  *
4
- * Scans sentence by sentence and requires BOTH signals in the SAME sentence, so
5
- * a testing section that happens to sit near an unrelated "don't defer" line
6
- * cannot trigger the ban. `decisions` is checked first and alone is sufficient;
7
- * the spec is scanned too because run 14's cadence rule is stated in §10 of the
8
- * doc and only echoed into the decisions channel.
4
+ * Scans sentence by sentence and requires BOTH signals in the SAME sentence, so a
5
+ * testing section that happens to sit near an unrelated "don't defer" line cannot
6
+ * trigger the ban confirmed, "Don't defer the docs. Every route has tests."
7
+ * returns false. `decisions` is checked first and alone is sufficient; the spec is
8
+ * scanned too, and a mandate found only there is enough, because a cadence rule is
9
+ * often stated in the doc body and only echoed into the decisions channel.
9
10
  */
10
11
  export declare function mandatesTestsInSameChange(decisions: string, spec?: string): boolean;
11
12
  /**
@@ -25,9 +26,11 @@ export declare function findBatchTestTitles(titles: string[], spec?: string): nu
25
26
  * The spec's own coverage source — the command whose report scopes the sweep.
26
27
  *
27
28
  * Only backticked spans are considered, so the result is a command the spec
28
- * actually writes down rather than a phrase inferred from prose; a span carrying
29
- * a coverage flag wins over a plain test run. Falls back to a generic phrase when
30
- * the spec names no command, which keeps the sweep title well-formed either way.
29
+ * actually writes down rather than a phrase inferred from prose: a plain-prose
30
+ * "bun test" is ignored and falls through to the generic phrase. A span carrying a
31
+ * coverage flag wins over a plain test run a spec naming both `bun test` and
32
+ * `bun test --coverage` yields the latter. The fallback keeps the sweep title
33
+ * well-formed when the spec names no command at all.
31
34
  */
32
35
  export declare function coverageSourceFromSpec(spec: string): string;
33
36
  /**
@@ -56,15 +59,20 @@ export interface BatchTestRewrite {
56
59
  * Rewrite a decomposed plan so it carries no whole-project batch test task when
57
60
  * the decisions mandate tests-in-the-same-change.
58
61
  *
59
- * No mandate, or no batch title ⇒ the plan is returned untouched (identity), so
60
- * every non-cadence run behaves exactly as before.
62
+ * No mandate, or no batch title ⇒ the plan is returned untouched, with no actions,
63
+ * so every non-cadence run is unaffected. Both identity paths run as described.
61
64
  *
62
65
  * With a mandate, ALL batch titles are removed at once before coverage is
63
66
  * re-measured — otherwise two batch tasks would each mask the other's orphans and
64
67
  * both would look droppable. The orphaned set is then whatever grounded coverage
65
68
  * the removal costs; it is non-empty only when no other task's title claims that
66
- * requirement, and it becomes the sweep's scope. At most ONE sweep is emitted (in
67
- * the first batch title's position, so plan order is preserved).
69
+ * requirement, and it becomes the sweep's scope. At most ONE sweep is emitted, in
70
+ * the first batch title's position, so plan order is preserved.
71
+ *
72
+ * Run on the SAME batch title twice, changing only the requirement list: when
73
+ * another task grounds the requirement the title is DROPPED, and when the batch
74
+ * title is its only owner it is SCOPED into a sweep naming that quote and the
75
+ * spec's own coverage command. Any `[decisions: …]` tail rides onto the sweep.
68
76
  */
69
77
  export declare function rewriteBatchTestPlan(titles: string[], decisions: string, spec: string, requirementQuotes: string[], isCrossCutting: (quote: string) => boolean): BatchTestRewrite;
70
78
  /**