dorfl 0.1.2 → 0.2.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 (364) hide show
  1. package/dist/advance-drivers.d.ts +1 -1
  2. package/dist/advance-drivers.d.ts.map +1 -1
  3. package/dist/advance-drivers.js +15 -3
  4. package/dist/advance-drivers.js.map +1 -1
  5. package/dist/advance-lifecycle-template.d.ts.map +1 -1
  6. package/dist/advance-lifecycle-template.js +76 -4
  7. package/dist/advance-lifecycle-template.js.map +1 -1
  8. package/dist/advance-treeless-publish.d.ts +23 -0
  9. package/dist/advance-treeless-publish.d.ts.map +1 -1
  10. package/dist/advance-treeless-publish.js +41 -0
  11. package/dist/advance-treeless-publish.js.map +1 -1
  12. package/dist/advance.d.ts +59 -7
  13. package/dist/advance.d.ts.map +1 -1
  14. package/dist/advance.js +389 -82
  15. package/dist/advance.js.map +1 -1
  16. package/dist/advancing-lock.d.ts +30 -2
  17. package/dist/advancing-lock.d.ts.map +1 -1
  18. package/dist/advancing-lock.js +50 -0
  19. package/dist/advancing-lock.js.map +1 -1
  20. package/dist/agent-launch.d.ts +12 -0
  21. package/dist/agent-launch.d.ts.map +1 -1
  22. package/dist/agent-launch.js +22 -12
  23. package/dist/agent-launch.js.map +1 -1
  24. package/dist/agent-stop.d.ts +40 -2
  25. package/dist/agent-stop.d.ts.map +1 -1
  26. package/dist/agent-stop.js +30 -2
  27. package/dist/agent-stop.js.map +1 -1
  28. package/dist/apply-decide.d.ts +17 -3
  29. package/dist/apply-decide.d.ts.map +1 -1
  30. package/dist/apply-decide.js +36 -7
  31. package/dist/apply-decide.js.map +1 -1
  32. package/dist/apply-merge-action.d.ts +17 -5
  33. package/dist/apply-merge-action.d.ts.map +1 -1
  34. package/dist/apply-merge-action.js +43 -8
  35. package/dist/apply-merge-action.js.map +1 -1
  36. package/dist/apply-persist.d.ts +57 -26
  37. package/dist/apply-persist.d.ts.map +1 -1
  38. package/dist/apply-persist.js +166 -37
  39. package/dist/apply-persist.js.map +1 -1
  40. package/dist/apply-stuck-action.d.ts +151 -0
  41. package/dist/apply-stuck-action.d.ts.map +1 -0
  42. package/dist/apply-stuck-action.js +125 -0
  43. package/dist/apply-stuck-action.js.map +1 -0
  44. package/dist/brand.d.ts +12 -1
  45. package/dist/brand.d.ts.map +1 -1
  46. package/dist/brand.js +2 -1
  47. package/dist/brand.js.map +1 -1
  48. package/dist/cli-spinner.d.ts +1 -1
  49. package/dist/cli-spinner.js +1 -1
  50. package/dist/cli.d.ts +10 -0
  51. package/dist/cli.d.ts.map +1 -1
  52. package/dist/cli.js +320 -63
  53. package/dist/cli.js.map +1 -1
  54. package/dist/close-job-template.js +1 -1
  55. package/dist/complete.d.ts +6 -3
  56. package/dist/complete.d.ts.map +1 -1
  57. package/dist/complete.js +91 -37
  58. package/dist/complete.js.map +1 -1
  59. package/dist/config.d.ts +55 -9
  60. package/dist/config.d.ts.map +1 -1
  61. package/dist/config.js +56 -4
  62. package/dist/config.js.map +1 -1
  63. package/dist/continue-branch.d.ts.map +1 -1
  64. package/dist/continue-branch.js +22 -0
  65. package/dist/continue-branch.js.map +1 -1
  66. package/dist/decision-engine.d.ts +38 -10
  67. package/dist/decision-engine.d.ts.map +1 -1
  68. package/dist/decision-engine.js +10 -6
  69. package/dist/decision-engine.js.map +1 -1
  70. package/dist/do-autopick.d.ts.map +1 -1
  71. package/dist/do-autopick.js +11 -1
  72. package/dist/do-autopick.js.map +1 -1
  73. package/dist/do-config.d.ts +1 -1
  74. package/dist/do.d.ts +49 -56
  75. package/dist/do.d.ts.map +1 -1
  76. package/dist/do.js +419 -30
  77. package/dist/do.js.map +1 -1
  78. package/dist/env-config.d.ts.map +1 -1
  79. package/dist/env-config.js +12 -4
  80. package/dist/env-config.js.map +1 -1
  81. package/dist/failure-cause.d.ts +3 -2
  82. package/dist/failure-cause.d.ts.map +1 -1
  83. package/dist/failure-cause.js +28 -1
  84. package/dist/failure-cause.js.map +1 -1
  85. package/dist/format.d.ts +6 -6
  86. package/dist/format.d.ts.map +1 -1
  87. package/dist/format.js +10 -27
  88. package/dist/format.js.map +1 -1
  89. package/dist/frontmatter.d.ts +16 -4
  90. package/dist/frontmatter.d.ts.map +1 -1
  91. package/dist/frontmatter.js +27 -1
  92. package/dist/frontmatter.js.map +1 -1
  93. package/dist/gc.d.ts +65 -6
  94. package/dist/gc.d.ts.map +1 -1
  95. package/dist/gc.js +126 -9
  96. package/dist/gc.js.map +1 -1
  97. package/dist/github.d.ts +14 -0
  98. package/dist/github.d.ts.map +1 -1
  99. package/dist/github.js +73 -0
  100. package/dist/github.js.map +1 -1
  101. package/dist/harness.d.ts +25 -0
  102. package/dist/harness.d.ts.map +1 -1
  103. package/dist/harness.js.map +1 -1
  104. package/dist/index.d.ts +4 -1
  105. package/dist/index.d.ts.map +1 -1
  106. package/dist/index.js +2 -1
  107. package/dist/index.js.map +1 -1
  108. package/dist/install-ci-branch-protection.d.ts +132 -38
  109. package/dist/install-ci-branch-protection.d.ts.map +1 -1
  110. package/dist/install-ci-branch-protection.js +190 -48
  111. package/dist/install-ci-branch-protection.js.map +1 -1
  112. package/dist/install-ci-core.d.ts +21 -1
  113. package/dist/install-ci-core.d.ts.map +1 -1
  114. package/dist/install-ci-core.js +10 -3
  115. package/dist/install-ci-core.js.map +1 -1
  116. package/dist/install-ci-github.d.ts +32 -0
  117. package/dist/install-ci-github.d.ts.map +1 -1
  118. package/dist/install-ci-github.js +73 -0
  119. package/dist/install-ci-github.js.map +1 -1
  120. package/dist/install-skills.d.ts +123 -0
  121. package/dist/install-skills.d.ts.map +1 -0
  122. package/dist/install-skills.js +100 -0
  123. package/dist/install-skills.js.map +1 -0
  124. package/dist/intake-trigger-template.js +1 -1
  125. package/dist/intake.d.ts +17 -4
  126. package/dist/intake.d.ts.map +1 -1
  127. package/dist/intake.js +23 -7
  128. package/dist/intake.js.map +1 -1
  129. package/dist/integration-core.d.ts +10 -7
  130. package/dist/integration-core.d.ts.map +1 -1
  131. package/dist/integration-core.js +174 -60
  132. package/dist/integration-core.js.map +1 -1
  133. package/dist/integrator.d.ts +1 -1
  134. package/dist/integrator.d.ts.map +1 -1
  135. package/dist/integrator.js +19 -3
  136. package/dist/integrator.js.map +1 -1
  137. package/dist/isolation.d.ts +2 -2
  138. package/dist/isolation.d.ts.map +1 -1
  139. package/dist/isolation.js +9 -0
  140. package/dist/isolation.js.map +1 -1
  141. package/dist/item-lock.d.ts +196 -129
  142. package/dist/item-lock.d.ts.map +1 -1
  143. package/dist/item-lock.js +329 -254
  144. package/dist/item-lock.js.map +1 -1
  145. package/dist/ledger-write.d.ts +31 -26
  146. package/dist/ledger-write.d.ts.map +1 -1
  147. package/dist/ledger-write.js +100 -122
  148. package/dist/ledger-write.js.map +1 -1
  149. package/dist/lifecycle-gather.d.ts +17 -0
  150. package/dist/lifecycle-gather.d.ts.map +1 -1
  151. package/dist/lifecycle-gather.js +7 -1
  152. package/dist/lifecycle-gather.js.map +1 -1
  153. package/dist/lifecycle-pools.d.ts +40 -3
  154. package/dist/lifecycle-pools.d.ts.map +1 -1
  155. package/dist/lifecycle-pools.js +26 -6
  156. package/dist/lifecycle-pools.js.map +1 -1
  157. package/dist/merge-question-surfacer.d.ts +15 -1
  158. package/dist/merge-question-surfacer.d.ts.map +1 -1
  159. package/dist/merge-question-surfacer.js +18 -3
  160. package/dist/merge-question-surfacer.js.map +1 -1
  161. package/dist/migrate-stuck-locks.d.ts +129 -0
  162. package/dist/migrate-stuck-locks.d.ts.map +1 -0
  163. package/dist/migrate-stuck-locks.js +355 -0
  164. package/dist/migrate-stuck-locks.js.map +1 -0
  165. package/dist/needs-attention.d.ts +293 -16
  166. package/dist/needs-attention.d.ts.map +1 -1
  167. package/dist/needs-attention.js +532 -57
  168. package/dist/needs-attention.js.map +1 -1
  169. package/dist/orphan-sidecar.d.ts +8 -4
  170. package/dist/orphan-sidecar.d.ts.map +1 -1
  171. package/dist/orphan-sidecar.js +35 -2
  172. package/dist/orphan-sidecar.js.map +1 -1
  173. package/dist/pi-harness.d.ts +16 -0
  174. package/dist/pi-harness.d.ts.map +1 -1
  175. package/dist/pi-harness.js +82 -2
  176. package/dist/pi-harness.js.map +1 -1
  177. package/dist/placement.d.ts +3 -3
  178. package/dist/placement.js +1 -1
  179. package/dist/prd-to-spec.d.ts.map +1 -1
  180. package/dist/prd-to-spec.js +9 -5
  181. package/dist/prd-to-spec.js.map +1 -1
  182. package/dist/protocol/CLAIM-PROTOCOL.md +17 -10
  183. package/dist/protocol/REVIEW-PROTOCOL.md +4 -1
  184. package/dist/protocol/SURFACE-PROTOCOL.md +16 -2
  185. package/dist/protocol/TASKING-PROTOCOL.md +3 -1
  186. package/dist/protocol/WORK-CONTRACT.md +22 -18
  187. package/dist/protocol/task-template.md +1 -1
  188. package/dist/reap-branches.d.ts +12 -9
  189. package/dist/reap-branches.d.ts.map +1 -1
  190. package/dist/reap-branches.js +25 -7
  191. package/dist/reap-branches.js.map +1 -1
  192. package/dist/recover-isolated.d.ts +12 -0
  193. package/dist/recover-isolated.d.ts.map +1 -1
  194. package/dist/recover-isolated.js +5 -0
  195. package/dist/recover-isolated.js.map +1 -1
  196. package/dist/repo-config.d.ts +23 -2
  197. package/dist/repo-config.d.ts.map +1 -1
  198. package/dist/repo-config.js +53 -7
  199. package/dist/repo-config.js.map +1 -1
  200. package/dist/repo-mirror.d.ts.map +1 -1
  201. package/dist/repo-mirror.js +18 -2
  202. package/dist/repo-mirror.js.map +1 -1
  203. package/dist/review-verdict.js +1 -1
  204. package/dist/review-verdict.js.map +1 -1
  205. package/dist/run.d.ts +1 -1
  206. package/dist/run.d.ts.map +1 -1
  207. package/dist/run.js +54 -19
  208. package/dist/run.js.map +1 -1
  209. package/dist/scan.d.ts +17 -8
  210. package/dist/scan.d.ts.map +1 -1
  211. package/dist/scan.js +22 -8
  212. package/dist/scan.js.map +1 -1
  213. package/dist/select-priority.d.ts +2 -2
  214. package/dist/select-priority.js +1 -1
  215. package/dist/select-priority.js.map +1 -1
  216. package/dist/sidecar-apply.js +1 -1
  217. package/dist/sidecar-apply.js.map +1 -1
  218. package/dist/sidecar.d.ts +45 -10
  219. package/dist/sidecar.d.ts.map +1 -1
  220. package/dist/sidecar.js +82 -2
  221. package/dist/sidecar.js.map +1 -1
  222. package/dist/skills/answer-questions/SKILL.md +89 -0
  223. package/dist/skills/capture-signal/SKILL.md +52 -0
  224. package/dist/skills/convert-from-prd-to-spec/SKILL.md +90 -0
  225. package/dist/skills/drive-tasks/SKILL.md +218 -0
  226. package/dist/skills/from-idea/SKILL.md +83 -0
  227. package/dist/skills/merge-prs/SKILL.md +70 -0
  228. package/dist/skills/orchestrate/SKILL.md +101 -0
  229. package/dist/skills/promote/SKILL.md +35 -0
  230. package/dist/skills/review/SKILL.md +16 -0
  231. package/dist/skills/setup/SKILL.md +258 -0
  232. package/dist/skills/setup/protocol/ADR-FORMAT.md +47 -0
  233. package/dist/skills/setup/protocol/CLAIM-PROTOCOL.md +224 -0
  234. package/dist/skills/setup/protocol/REVIEW-PROTOCOL.md +122 -0
  235. package/dist/skills/setup/protocol/SURFACE-PROTOCOL.md +135 -0
  236. package/dist/skills/setup/protocol/TASKING-PROTOCOL.md +124 -0
  237. package/dist/skills/setup/protocol/WORK-CONTRACT.md +280 -0
  238. package/dist/skills/setup/protocol/spec-template.md +71 -0
  239. package/dist/skills/setup/protocol/task-template.md +65 -0
  240. package/dist/skills/surface-questions/SKILL.md +16 -0
  241. package/dist/skills/to-spec/SKILL.md +34 -0
  242. package/dist/skills/to-task/SKILL.md +19 -0
  243. package/dist/skills/triage-observations/SKILL.md +78 -0
  244. package/dist/skills/work/SKILL.md +51 -0
  245. package/dist/slug-namespace.d.ts +5 -5
  246. package/dist/slug-namespace.js +5 -5
  247. package/dist/slug-namespace.js.map +1 -1
  248. package/dist/spec-complete.d.ts.map +1 -1
  249. package/dist/spec-complete.js +2 -3
  250. package/dist/spec-complete.js.map +1 -1
  251. package/dist/start.d.ts.map +1 -1
  252. package/dist/start.js +51 -57
  253. package/dist/start.js.map +1 -1
  254. package/dist/surface-gate.d.ts.map +1 -1
  255. package/dist/surface-gate.js +10 -3
  256. package/dist/surface-gate.js.map +1 -1
  257. package/dist/surface-persist.js +1 -1
  258. package/dist/surface-persist.js.map +1 -1
  259. package/dist/tasker-review-loop.d.ts +4 -3
  260. package/dist/tasker-review-loop.d.ts.map +1 -1
  261. package/dist/tasker-review-loop.js.map +1 -1
  262. package/dist/tasking-lock.d.ts +2 -2
  263. package/dist/tasking-lock.d.ts.map +1 -1
  264. package/dist/tasking-lock.js +53 -32
  265. package/dist/tasking-lock.js.map +1 -1
  266. package/dist/tasking.d.ts +40 -6
  267. package/dist/tasking.d.ts.map +1 -1
  268. package/dist/tasking.js +224 -12
  269. package/dist/tasking.js.map +1 -1
  270. package/dist/triage-persist.d.ts +10 -6
  271. package/dist/triage-persist.d.ts.map +1 -1
  272. package/dist/triage-persist.js +34 -4
  273. package/dist/triage-persist.js.map +1 -1
  274. package/dist/vendor/incur/agents.d.ts +58 -0
  275. package/dist/vendor/incur/agents.d.ts.map +1 -0
  276. package/dist/vendor/incur/agents.js +343 -0
  277. package/dist/vendor/incur/agents.js.map +1 -0
  278. package/dist/verify-workflow-template.js +1 -1
  279. package/dist/watch-session.d.ts +11 -3
  280. package/dist/watch-session.d.ts.map +1 -1
  281. package/dist/watch-session.js +94 -7
  282. package/dist/watch-session.js.map +1 -1
  283. package/dist/work-layout.d.ts +7 -3
  284. package/dist/work-layout.d.ts.map +1 -1
  285. package/dist/work-layout.js +6 -3
  286. package/dist/work-layout.js.map +1 -1
  287. package/dist/workspace.d.ts +1 -1
  288. package/package.json +2 -2
  289. package/src/advance-drivers.ts +16 -3
  290. package/src/advance-lifecycle-template.ts +89 -4
  291. package/src/advance-treeless-publish.ts +45 -0
  292. package/src/advance.ts +467 -87
  293. package/src/advancing-lock.ts +96 -1
  294. package/src/agent-launch.ts +37 -12
  295. package/src/agent-stop.ts +60 -2
  296. package/src/apply-decide.ts +36 -7
  297. package/src/apply-merge-action.ts +45 -7
  298. package/src/apply-persist.ts +228 -54
  299. package/src/apply-stuck-action.ts +260 -0
  300. package/src/brand.ts +14 -2
  301. package/src/cli-spinner.ts +1 -1
  302. package/src/cli.ts +401 -70
  303. package/src/close-job-template.ts +1 -1
  304. package/src/complete.ts +110 -52
  305. package/src/config.ts +107 -13
  306. package/src/continue-branch.ts +22 -0
  307. package/src/decision-engine.ts +55 -17
  308. package/src/do-autopick.ts +12 -1
  309. package/src/do-config.ts +1 -1
  310. package/src/do.ts +511 -38
  311. package/src/env-config.ts +12 -4
  312. package/src/failure-cause.ts +30 -1
  313. package/src/format.ts +10 -30
  314. package/src/frontmatter.ts +35 -5
  315. package/src/gc.ts +172 -9
  316. package/src/github.ts +78 -0
  317. package/src/harness.ts +25 -0
  318. package/src/index.ts +10 -0
  319. package/src/install-ci-branch-protection.ts +282 -57
  320. package/src/install-ci-core.ts +30 -3
  321. package/src/install-ci-github.ts +86 -0
  322. package/src/install-skills.ts +166 -0
  323. package/src/intake-trigger-template.ts +1 -1
  324. package/src/intake.ts +46 -11
  325. package/src/integration-core.ts +199 -65
  326. package/src/integrator.ts +22 -9
  327. package/src/isolation.ts +11 -2
  328. package/src/item-lock.ts +485 -341
  329. package/src/ledger-write.ts +135 -150
  330. package/src/lifecycle-gather.ts +29 -6
  331. package/src/lifecycle-pools.ts +67 -9
  332. package/src/merge-question-surfacer.ts +28 -4
  333. package/src/migrate-stuck-locks.ts +451 -0
  334. package/src/needs-attention.ts +857 -84
  335. package/src/orphan-sidecar.ts +47 -6
  336. package/src/pi-harness.ts +82 -2
  337. package/src/placement.ts +3 -3
  338. package/src/prd-to-spec.ts +13 -5
  339. package/src/reap-branches.ts +38 -14
  340. package/src/recover-isolated.ts +17 -0
  341. package/src/repo-config.ts +55 -6
  342. package/src/repo-mirror.ts +23 -1
  343. package/src/review-verdict.ts +1 -1
  344. package/src/run.ts +64 -18
  345. package/src/scan.ts +22 -8
  346. package/src/select-priority.ts +3 -3
  347. package/src/sidecar-apply.ts +1 -1
  348. package/src/sidecar.ts +138 -11
  349. package/src/slug-namespace.ts +7 -7
  350. package/src/spec-complete.ts +2 -3
  351. package/src/start.ts +53 -59
  352. package/src/surface-gate.ts +10 -3
  353. package/src/surface-persist.ts +1 -1
  354. package/src/tasker-review-loop.ts +4 -3
  355. package/src/tasking-lock.ts +52 -36
  356. package/src/tasking.ts +261 -17
  357. package/src/triage-persist.ts +56 -12
  358. package/src/vendor/incur/LICENSE +21 -0
  359. package/src/vendor/incur/README.md +19 -0
  360. package/src/vendor/incur/agents.ts +392 -0
  361. package/src/verify-workflow-template.ts +1 -1
  362. package/src/watch-session.ts +102 -7
  363. package/src/work-layout.ts +6 -3
  364. package/src/workspace.ts +1 -1
@@ -1,9 +1,11 @@
1
- import { existsSync, readFileSync } from 'node:fs';
2
- import { join } from 'node:path';
1
+ import { existsSync, mkdirSync, readFileSync, writeFileSync } from 'node:fs';
2
+ import { dirname, join } from 'node:path';
3
3
  import { run } from './git.js';
4
+ import { setFrontmatterMarker } from './frontmatter.js';
4
5
  import { applyAtomic } from './sidecar-apply.js';
5
- import { allAnswered, appendQuestions, parseSidecar, sidecarPathFor, } from './sidecar.js';
6
+ import { allAnswered, appendQuestions, parseSidecar, resolveSidecarIdentity, sidecarPathFor, } from './sidecar.js';
6
7
  import { APPLY_LIFECYCLE_FOLDERS, resolveItemPathByIdentity, } from './item-path.js';
8
+ import { workItemRel } from './work-layout.js';
7
9
  /**
8
10
  * The engine-owned APPLY PERSIST (spec `advance-loop`, task `advance-rung-apply`;
9
11
  * AGENTIC apply, task `agentic-apply-retire-disposition-vocabulary`) — the half of
@@ -15,10 +17,15 @@ import { APPLY_LIFECYCLE_FOLDERS, resolveItemPathByIdentity, } from './item-path
15
17
  * - **append / re-pause** — when the apply has NEW questions to ask: append
16
18
  * `qN+1…`, stay `needsAnswers:true`, re-pause (the "all answered?" flips back
17
19
  * to false); OR
18
- * - **discharge by deletion** — when the caller decided the SOURCE should leave
19
- * by deletion (`discharge` set): `git rm` the source + sidecar in a STANDALONE
20
- * revertible commit, the reason in the commit message (git history is the
21
- * archive); OR
20
+ * - **dispose** — when the caller decided the SOURCE should be DISPOSED
21
+ * (`dispose` set): REGIME-POLYMORPHIC on the source's type (task
22
+ * `apply-disposition-delete-to-dispose-regime-polymorphic`, spec
23
+ * `surface-stuck-as-questions-and-retire-stuck-lock-state` decision #5):
24
+ * an OBSERVATION is `git rm`-ed with its sidecar in one revertible commit
25
+ * (reason in the message, git history = archive); a TASK is `git mv`-ed to
26
+ * `tasks/cancelled/` (RETAINED, `reason:` written into the moved body); a
27
+ * SPEC is `git mv`-ed to `specs/dropped/` (RETAINED). A task can NEVER be
28
+ * hard-deleted from here — dispose is the only path off the board; OR
22
29
  * - **resolve fully** (the default) — clear `needsAnswers` + DELETE the sidecar
23
30
  * in the SAME atomic commit (the invariant `needsAnswers:false ⟺ no active
24
31
  * sidecar`); the item advances toward build by its normal lifecycle.
@@ -29,19 +36,19 @@ import { APPLY_LIFECYCLE_FOLDERS, resolveItemPathByIdentity, } from './item-path
29
36
  * no `keep`/`triaged:keep` resting state. A sidecar entry is BINARY (no-answer |
30
37
  * answered); what to DO with a fully-answered OBSERVATION is decided by the
31
38
  * AGENTIC apply decision in the advance tick (`advance.ts` `applyRung` over the
32
- * shared `decide` engine), which then routes here (re-pause / discharge / via
39
+ * shared `decide` engine), which then routes here (re-pause / dispose / via
33
40
  * `promoteObservation` for a mint). A signal is still-open, acted-on, or deleted
34
41
  * — there is no \"retain as resolved\" state.
35
42
  *
36
43
  * The work-item (task/spec) terminal MOVES (`tasks/cancelled`, `specs/dropped`) and
37
- * the `needs-attention/` LIFECYCLE state are a SEPARATE lifecycle concern (a
44
+ * the stuck (lock `state: stuck`) LIFECYCLE state are a SEPARATE lifecycle concern (a
38
45
  * task/spec is dropped by its own lifecycle, not by a question answer) — they are
39
46
  * NOT routed from here any more (they were the removed disposition vocabulary).
40
47
  *
41
48
  * It is the SIBLING of {@link import('./surface-persist.js').persistSurfacedQuestions}:
42
49
  * that is the SURFACE rung's one-commit primitive (append-or-create + set
43
50
  * `needsAnswers`); this is the APPLY rung's (apply answers + resolve / re-pause /
44
- * discharge). Kept file-orthogonal so the rung bodies land in different tasks.
51
+ * dispose). Kept file-orthogonal so the rung bodies land in different tasks.
45
52
  *
46
53
  * **NEVER invents an answer (US #4).** The apply rung applies ONLY what the human
47
54
  * authored — the recorded `answer:` text. It does NOT fill, guess, or author an
@@ -78,7 +85,7 @@ const APPLIED_HEADING = '## Applied answers';
78
85
  * (backward compat — no marker ⇒ nothing to strip ⇒ identical bytes).
79
86
  *
80
87
  * The sibling task `templates-mark-transient-open-questions-block` introduces
81
- * the markers in the prd/task templates; this task exports the constants so
88
+ * the markers in the spec/task templates; this task exports the constants so
82
89
  * the two tasks agree on the literal byte sequence.
83
90
  */
84
91
  export const OPEN_QUESTIONS_MARKER_OPEN = '<!-- open-questions -->';
@@ -195,9 +202,12 @@ function stripOpenQuestionsBlocks(body) {
195
202
  *
196
203
  * 1. **append / re-pause** — `appendQuestions` is non-empty: append `qN+1…`,
197
204
  * keep `needsAnswers:true`, re-pause (one commit, body + sidecar).
198
- * 2. **discharge by deletion** — `discharge` is set (the `delete-source`
199
- * verdict): `git rm` the source + sidecar in a standalone revertible commit,
200
- * the reason in the commit message.
205
+ * 2. **dispose** — `dispose` is set (the `dispose` verdict): REGIME-POLYMORPHIC
206
+ * on the source's type — an OBSERVATION is `git rm`-ed with its sidecar in
207
+ * a standalone revertible commit (reason in the message); a TASK is `git
208
+ * mv`-ed to `tasks/cancelled/` (`reason:` written into the moved body,
209
+ * sidecar `git rm`-ed in the same commit); a SPEC is `git mv`-ed to
210
+ * `specs/dropped/` (same shape as the task branch).
201
211
  * 3. **resolve fully** (the default) — clear `needsAnswers` + delete the sidecar
202
212
  * in ONE commit; the item advances toward build by its normal lifecycle.
203
213
  */
@@ -243,7 +253,7 @@ export function applyAnsweredQuestions(options) {
243
253
  const by = options.by || resolveBy(cwd, env);
244
254
  // (1) APPEND / RE-PAUSE: the apply has new questions. Append them (`qN+1…`,
245
255
  // never mutating an answered entry), stay needsAnswers:true, re-pause. Re-pause
246
- // WINS over a discharge — you cannot discharge a source you are still asking
256
+ // WINS over a dispose — you cannot dispose a source you are still asking
247
257
  // about.
248
258
  const followups = options.appendQuestions ?? [];
249
259
  if (followups.length > 0) {
@@ -268,17 +278,39 @@ export function applyAnsweredQuestions(options) {
268
278
  message,
269
279
  };
270
280
  }
271
- // (2) DISCHARGE BY DELETION: the caller decided the source should leave by
272
- // deletion (the `delete-source` verdict). `git rm` the source + sidecar in a
273
- // STANDALONE revertible commit, the reason in the commit message (git history =
274
- // archive). DIRECT — no preview/confirm (decision 12); the human's answer is
275
- // the source of truth.
276
- if (options.discharge !== undefined) {
277
- return dischargeByDeletion({
281
+ // (2) DISPOSE: the caller decided the source should be DISPOSED (the `dispose`
282
+ // verdict). REGIME-POLYMORPHIC on the source type (task
283
+ // `apply-disposition-delete-to-dispose-regime-polymorphic`, spec
284
+ // `surface-stuck-as-questions-and-retire-stuck-lock-state` decision #5):
285
+ // - observation → `git rm` the note + sidecar in one revertible commit
286
+ // (reason in the message; notes leave by deletion, decision 12);
287
+ // - task → `git mv` to `tasks/cancelled/` (RETAINED; `reason:` written into
288
+ // the moved body; sidecar `git rm`-ed in the same commit);
289
+ // - spec → `git mv` to `specs/dropped/` (RETAINED, same shape).
290
+ // DIRECT — no preview/confirm (decision 12); the human's answer is the source
291
+ // of truth. A TASK is never `git rm`-ed here (true by construction: the
292
+ // task-branch calls `git mv`, no branch of this dispatcher hard-deletes a
293
+ // task).
294
+ if (options.dispose !== undefined) {
295
+ const { type } = resolveSidecarIdentity(item);
296
+ if (type === 'observation') {
297
+ return disposeObservationByDeletion({
298
+ cwd,
299
+ item,
300
+ itemPath,
301
+ reason: options.dispose.reason,
302
+ sidecarPath,
303
+ by,
304
+ env,
305
+ note,
306
+ });
307
+ }
308
+ return disposeToTerminal({
278
309
  cwd,
279
310
  item,
280
311
  itemPath,
281
- reason: options.discharge.reason,
312
+ type,
313
+ reason: options.dispose.reason,
282
314
  sidecarPath,
283
315
  by,
284
316
  env,
@@ -313,23 +345,25 @@ export function applyAnsweredQuestions(options) {
313
345
  };
314
346
  }
315
347
  /**
316
- * DISCHARGE a source by DELETION (the `delete-source` verdict, US #5/#11): `git
317
- * rm` the source AND its answered sidecar in ONE STANDALONE commit, the human's
318
- * discharge reason recorded in the commit MESSAGE (git history is the archive).
319
- * There is no spawned artifact for a discharge, so the deletion is a standalone
320
- * commit (a `mint`, by contrast, rides the new artifact's create commit through
321
- * `promoteObservation`).
348
+ * DISPOSE an OBSERVATION by DELETION (task
349
+ * `apply-disposition-delete-to-dispose-regime-polymorphic`; US #5/#11): `git rm`
350
+ * the observation-note AND its answered sidecar in ONE STANDALONE commit, the
351
+ * human's dispose reason recorded in the commit MESSAGE (git history = archive).
352
+ * There is no spawned artifact for a dispose-by-deletion, so the deletion is a
353
+ * standalone commit (a `mint`, by contrast, rides the new artifact's create
354
+ * commit through `promoteObservation`).
322
355
  *
323
- * A discharged item leaves by being GONE — no resting body marker, no `triaged:`
324
- * stamp (the resting-state machinery is retired; an item is still-open, acted-on,
325
- * or deleted). This is the apply rung applying the human's RATIFIED answer (the
326
- * deletion is human-authored), and it is git-recoverable (a single revertible
327
- * commit) a wrong inference is never catastrophic.
356
+ * A disposed observation leaves by being GONE — notes have no terminal folder
357
+ * (decision 12: "notes leave by deletion"), unlike a task/spec which is `git
358
+ * mv`-ed to its regime's terminal by {@link disposeToTerminal}. This is the
359
+ * apply rung applying the human's RATIFIED answer (the deletion is
360
+ * human-authored), and it is git-recoverable (a single revertible commit) a
361
+ * wrong inference is never catastrophic.
328
362
  */
329
- function dischargeByDeletion(input) {
363
+ function disposeObservationByDeletion(input) {
330
364
  const { cwd, item, itemPath, reason, sidecarPath, by, env, note } = input;
331
365
  // `git rm` the source. The sidecar may not exist in every path; rm it too when
332
- // present, so the discharge leaves no answered-sidecar residue. Both ride ONE
366
+ // present, so the dispose leaves no answered-sidecar residue. Both ride ONE
333
367
  // commit.
334
368
  const rmPaths = [itemPath];
335
369
  if (existsSync(join(cwd, sidecarPath))) {
@@ -338,7 +372,7 @@ function dischargeByDeletion(input) {
338
372
  gitHard(['rm', '--quiet', '--', ...rmPaths], cwd, env);
339
373
  const reasonLine = reason.trim() === '' ? '(no reason given)' : reason.trim();
340
374
  const subject = `advance: ${item} → deleted (by ${by})`;
341
- const messageBody = `Discharged by deletion (the human's ratified answer authors it; ` +
375
+ const messageBody = `Disposed by deletion (the human's ratified answer authors it; ` +
342
376
  `git history is the archive).\n\nreason: ${reasonLine}`;
343
377
  gitHard(['commit', '--quiet', '-m', subject, '-m', messageBody], cwd, env);
344
378
  const commit = gitHard(['rev-parse', 'HEAD'], cwd, env).stdout.trim();
@@ -353,6 +387,101 @@ function dischargeByDeletion(input) {
353
387
  message,
354
388
  };
355
389
  }
390
+ /**
391
+ * The per-regime WON'T-PROCEED TERMINAL folder key {@link disposeToTerminal}
392
+ * moves a task/spec into. The folder WORDS are deliberately different
393
+ * (`cancelled` for tasks, `dropped` for specs) so a task and spec sharing a slug
394
+ * cannot collide on one terminal path — the two regimes have namespaced
395
+ * terminals by design (spec `surface-stuck-as-questions-and-retire-stuck-lock-
396
+ * state`, and see `work-layout.ts`). Do NOT rename the folders here; the token
397
+ * that changed is the verdict outcome (`dispose`), NOT the folder words.
398
+ */
399
+ const DISPOSE_TERMINAL_FOLDER = {
400
+ task: 'cancelled',
401
+ spec: 'specs-dropped',
402
+ };
403
+ /**
404
+ * DISPOSE a TASK or SPEC to its regime's won't-proceed TERMINAL folder (task
405
+ * `apply-disposition-delete-to-dispose-regime-polymorphic`, spec
406
+ * `surface-stuck-as-questions-and-retire-stuck-lock-state` decision #5): `git
407
+ * mv` the item to `tasks/cancelled/` (task) or `specs/dropped/` (spec), with the
408
+ * human's dispose reason written into the moved body's `reason:` frontmatter
409
+ * (durable, in-file archive of WHY the item won't proceed — symmetric across
410
+ * both regimes; the source of the moved item is the human's ratified answer),
411
+ * then `git rm` the answered sidecar, all in ONE commit.
412
+ *
413
+ * ## Decisions (recorded here per task etiquette)
414
+ *
415
+ * - **`reason:` frontmatter, symmetric across task AND spec.** The acceptance
416
+ * criteria explicitly require the reason for the task branch; the spec
417
+ * branch is only required to `git mv` to `specs/dropped/`. We nonetheless
418
+ * write the same `reason:` marker onto a disposed SPEC too, because (a) the
419
+ * two regimes are the same shape ("disposed to terminal"), so asymmetric
420
+ * behaviour would be a surprise; (b) the spec regime's dropped/ folder had
421
+ * no in-file WHY at all before, so any adjacent surface (an operator
422
+ * inspecting `specs/dropped/`) would otherwise have to grep the commit
423
+ * history for the reason. Setting it uses the same {@link
424
+ * setFrontmatterMarker} the surface rung already uses for `needsAnswers`.
425
+ * The commit message still carries the reason too (belt + braces — the
426
+ * frontmatter is the durable in-file record, the commit is the audit
427
+ * history). If a reviewer disagrees they can flip the spec branch back to a
428
+ * bare `git mv` in one line — the task branch is the load-bearing acceptance.
429
+ *
430
+ * - **The sidecar is `git rm`-ed in the same commit as the mv.** A disposed
431
+ * item is no longer in the question-loop (the answer settled it), so the
432
+ * sidecar has no reason to survive at the terminal folder. Same commit
433
+ * preserves the sidecar's `needsAnswers ⇔ active sidecar` invariant.
434
+ *
435
+ * A TASK is NEVER `git rm`-ed on this branch (that is the invariant this
436
+ * function exists to enforce): the disposal is a `git mv` to `tasks/cancelled/`,
437
+ * a folder-move that git can revert with a single `git revert`.
438
+ */
439
+ function disposeToTerminal(input) {
440
+ const { cwd, item, itemPath, type, reason, sidecarPath, by, env, note } = input;
441
+ const { slug } = resolveSidecarIdentity(item);
442
+ const folderKey = DISPOSE_TERMINAL_FOLDER[type];
443
+ const terminalPath = workItemRel(folderKey, `${slug}.md`);
444
+ // (a) Rewrite the item body with the `reason:` frontmatter marker BEFORE the
445
+ // mv so the marker rides the same commit as the terminal move. `git mv` reads
446
+ // the working-tree file, so a pre-mv rewrite is picked up by the subsequent
447
+ // stage of the moved path.
448
+ const reasonLine = reason.trim() === '' ? '(no reason given)' : reason.trim();
449
+ const itemAbs = join(cwd, itemPath);
450
+ const rewritten = setFrontmatterMarker(readFileSync(itemAbs, 'utf8'), 'reason', reasonLine);
451
+ writeFileSync(itemAbs, rewritten);
452
+ // (b) Ensure the terminal folder exists (git mv fatals on a missing parent).
453
+ mkdirSync(dirname(join(cwd, terminalPath)), { recursive: true });
454
+ // (c) `git mv` the source to its regime terminal.
455
+ gitHard(['mv', '--', itemPath, terminalPath], cwd, env);
456
+ // (d) `git rm` the answered sidecar (the loop is settled) in the same commit.
457
+ const rmPaths = [];
458
+ if (existsSync(join(cwd, sidecarPath))) {
459
+ rmPaths.push(sidecarPath);
460
+ }
461
+ if (rmPaths.length > 0) {
462
+ gitHard(['rm', '--quiet', '--', ...rmPaths], cwd, env);
463
+ }
464
+ // (e) Stage the rewritten (now-moved) body so its `reason:` marker rides the
465
+ // same commit as the mv.
466
+ gitHard(['add', '--', terminalPath], cwd, env);
467
+ const subject = `advance: ${item} → disposed (by ${by})`;
468
+ const messageBody = `Disposed to regime terminal '${folderKey}' (the human's ratified answer ` +
469
+ `authors it; git history + terminal folder are the archive).\n\n` +
470
+ `reason: ${reasonLine}`;
471
+ gitHard(['commit', '--quiet', '-m', subject, '-m', messageBody], cwd, env);
472
+ const commit = gitHard(['rev-parse', 'HEAD'], cwd, env).stdout.trim();
473
+ const message = `applied ${item} → disposed (source git mv-ed to '${terminalPath}', ` +
474
+ `reason: written into the moved body's frontmatter, sidecar deleted in the ` +
475
+ `same commit).`;
476
+ note(message);
477
+ return {
478
+ outcome: 'disposed',
479
+ commit,
480
+ sidecarPath,
481
+ itemPath: terminalPath,
482
+ message,
483
+ };
484
+ }
356
485
  // Re-export the heading constant the tests assert against, so the byte-level
357
486
  // marker stays in one place.
358
487
  export { APPLIED_HEADING };
@@ -1 +1 @@
1
- {"version":3,"file":"apply-persist.js","sourceRoot":"","sources":["../src/apply-persist.ts"],"names":[],"mapp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E,SAAS,EAAE,IAAI,EAAE,GAAG,OAAO,CAAC,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC;IACxD,CAAC;IAED,6EAA6E;IAC7E,yBAAyB;IACzB,OAAO,CAAC,CAAC,KAAK,EAAE,IAAI,EAAE,YAAY,CAAC,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC;IAE/C,MAAM,OAAO,GAAG,YAAY,IAAI,mBAAmB,EAAE,GAAG,CAAC;IACzD,MAAM,WAAW,GAChB,gCAAgC,SAAS,iCAAiC;QAC1E,iEAAiE;QACjE,WAAW,UAAU,EAAE,CAAC;IACzB,OAAO,CAAC,CAAC,QAAQ,EAAE,SAAS,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,WAAW,CAAC,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC;IAC3E,MAAM,MAAM,GAAG,OAAO,CAAC,CAAC,WAAW,EAAE,MAAM,CAAC,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC,MAAM,CAAC,IAAI,EAAE,CAAC;IACtE,MAAM,OAAO,GACZ,WAAW,IAAI,qCAAqC,YAAY,KAAK;QACrE,4EAA4E;QAC5E,eAAe,CAAC;IACjB,IAAI,CAAC,OAAO,CAAC,CAAC;IACd,OAAO;QACN,OAAO,EAAE,UAAU;QACnB,MAAM;QACN,WAAW;QACX,QAAQ,EAAE,YAAY;QACtB,OAAO;KACP,CAAC;AACH,CAAC;AAED,6EAA6E;AAC7E,6BAA6B;AAC7B,OAAO,EAAC,eAAe,EAAC,CAAC"}
@@ -0,0 +1,151 @@
1
+ import { type SidecarEntry } from './sidecar.js';
2
+ /**
3
+ * The **answered STUCK-QUESTION ACTION DISPATCH** (spec
4
+ * `surface-stuck-as-questions-and-retire-stuck-lock-state`, task
5
+ * `apply-resolve-reset-flag-discards-work-branch`; user story 2, resolved
6
+ * decision #6) — the deterministic, answer-driven RUNNER-ACTION layer that
7
+ * turns an answered `kind: 'stuck'` sidecar entry (the shape the bounce-surface
8
+ * path stamps when a task's build bounces) into one of three verbs:
9
+ *
10
+ * - `keep` -> today's continue-from-WIP: leave the `work/<slug>` branch
11
+ * alone; the apply rung falls through to the normal
12
+ * `applyAnsweredQuestions` resolve so the next claim continues
13
+ * from the branch tip.
14
+ * - `reset` -> discard the WIP branch, rebuild clean: DELETE the remote
15
+ * `work/<slug>` branch on the arbiter (via the SHARED
16
+ * {@link deleteRemoteWorkBranchIfPresent} primitive the
17
+ * `requeue --reset` recovery verb also uses) BEFORE the apply
18
+ * rung clears `needsAnswers`, so the next claim starts fresh.
19
+ * Safely IDEMPOTENT when no branch exists (an observation, or a
20
+ * task never built) — a `remote ref does not exist` push error
21
+ * is tolerated as an already-gone no-op.
22
+ * - `cancel` -> the existing `dispose` terminal: `git mv` the task to
23
+ * `tasks/cancelled/` via `applyAnsweredQuestions`' `dispose`
24
+ * option (the answer text is recorded as the human's reason).
25
+ *
26
+ * A direct SIBLING of the `apply-merge-action.ts` machinery: the apply rung
27
+ * KIND-CHECKS the sidecar BEFORE the fall-through persist, so an answered
28
+ * `kind: 'stuck'` entry dispatches HERE deterministically (mirroring how a
29
+ * `kind: 'merge'` entry dispatches through `apply-merge-action.ts`). There is
30
+ * NO agentic decider on the TASK apply-persist path (the `runAgenticDecision`
31
+ * gate at `advance.ts` fires only for `namespace === 'observation'`), so this
32
+ * MUST be a deterministic parse+dispatch — the flag SOURCE on the task path
33
+ * (see the task's `## Re-scope 2026-07-14`).
34
+ *
35
+ * # Ordering (delete-before-clear) and partial-failure decision
36
+ *
37
+ * The `reset` verb DELETES the remote work branch BEFORE the apply rung
38
+ * clears `needsAnswers`. On a partial failure (arbiter delete FAILS after the
39
+ * local tracking ref was cleared), we REFUSE the apply and leave the sidecar
40
+ * in place (`needsAnswers` stays `true`), so the human sees the failure and
41
+ * can re-answer. The alternative (clear-then-delete, or clear-anyway on a
42
+ * failed delete) would leave the item `needsAnswers:false` and CLAIMABLE while
43
+ * still carrying the WIP branch we meant to discard — exactly the stale-
44
+ * continue trap the `requeue --reset` code path spends a page of comment
45
+ * defending against. The two callers (this verb + `requeue --reset`) MUST
46
+ * stay behaviourally identical; both fail the whole recovery on a genuine
47
+ * push-delete failure. This is the `## Decisions` entry the done record
48
+ * links.
49
+ */
50
+ /** The three deterministic verbs a stuck-question answer encodes. */
51
+ export type StuckActionVerb = 'keep' | 'reset' | 'cancel';
52
+ /** A detected, answer-driven stuck-action keyed off ONE answered `kind: 'stuck'` entry. */
53
+ export interface DetectedStuckAction {
54
+ /** The deterministic verb parsed from the entry's answer text. */
55
+ verb: StuckActionVerb;
56
+ /** The answered `kind: 'stuck'` entry the verb came from. */
57
+ entry: SidecarEntry;
58
+ }
59
+ /**
60
+ * Parse the human's plain free-text answer into a {@link StuckActionVerb}.
61
+ * MIRRORS `parseMergeAnswer` EXACTLY: first whole ASCII word, case-insensitive,
62
+ * trailing commentary tolerated; `undefined` on anything else (empty / typo /
63
+ * narrative). NEVER default-guesses a destructive `reset` — an ambiguous
64
+ * answer falls through to today's plain persist (the safe "keep the branch,
65
+ * clear the flag" behaviour), never invents a branch discard.
66
+ */
67
+ export declare function parseStuckAnswer(text: string): StuckActionVerb | undefined;
68
+ /**
69
+ * Detect the `kind: 'stuck'` action verb that should drive the next apply run.
70
+ *
71
+ * ORDERING (mirrors `detectAnsweredMergeAction`'s re-stale re-surface rule):
72
+ *
73
+ * 1. If ANY `kind: 'stuck'` entry is UNANSWERED, return `undefined` —
74
+ * that is the re-paused state (a freshly-appended follow-up awaiting an
75
+ * answer), and the apply MUST NOT fire against a stale prior sibling.
76
+ * 2. Otherwise return the LATEST answered `kind: 'stuck'` entry — a fresh
77
+ * follow-up answer wins over the stale one.
78
+ *
79
+ * Returns `undefined` on a missing/unparseable sidecar or when no
80
+ * `kind: 'stuck'` entry parses to one of the three verbs (the apply rung then
81
+ * falls through to today's plain persist, which is the `keep` semantic — a
82
+ * malformed answer NEVER discards a branch).
83
+ */
84
+ export declare function detectAnsweredStuckAction(cwd: string, item: string): DetectedStuckAction | undefined;
85
+ /** Input the production stuck-action handler consumes. */
86
+ export interface StuckActionInput {
87
+ /** The detected action (verb + source entry). */
88
+ action: DetectedStuckAction;
89
+ /** The namespaced item identity (`task:<slug>`). */
90
+ item: string;
91
+ /** The bare slug (the work branch is `work/task-<slug>`). */
92
+ slug: string;
93
+ /** The apply rung's working clone. */
94
+ cwd: string;
95
+ /** The arbiter remote NAME in `cwd` (defaults to `origin`). */
96
+ arbiter: string;
97
+ /** Environment for child git processes. */
98
+ env?: NodeJS.ProcessEnv;
99
+ /** Sink for human-readable progress notes. */
100
+ note?: (message: string) => void;
101
+ }
102
+ /** The terminal verbs the dispatcher reports to the apply rung. */
103
+ export type StuckActionOutcome =
104
+ /** `answer=keep` -> no action; fall through to the normal apply persist. */
105
+ 'keep'
106
+ /**
107
+ * `answer=reset` -> the remote `work/<slug>` branch was DELETED (or was
108
+ * already gone); fall through to the normal apply persist so
109
+ * `needsAnswers` clears. The `already-gone` sub-case is the safe idempotent
110
+ * no-op for an item with no work branch.
111
+ */
112
+ | 'reset'
113
+ /**
114
+ * `answer=cancel` -> the apply rung dispatches through
115
+ * `applyAnsweredQuestions`' `dispose` option (task -> `tasks/cancelled/`).
116
+ * The answer text is the human's reason.
117
+ */
118
+ | 'cancel'
119
+ /**
120
+ * `answer=reset` -> the branch delete FAILED (a real push-delete error, not
121
+ * `already-gone`). The apply rung SHORT-CIRCUITS: the sidecar stays,
122
+ * `needsAnswers` stays `true`, no clear — the human sees the failure and
123
+ * re-answers. Matches the `requeue --reset` "abort the requeue on a failed
124
+ * arbiter delete" behaviour (delete-before-clear ordering, see the module
125
+ * docs' partial-failure decision).
126
+ */
127
+ | 'refused';
128
+ /** What the production handler returns to the apply rung. */
129
+ export interface StuckActionResult {
130
+ outcome: StuckActionOutcome;
131
+ /** Human-readable summary for the rung's message. */
132
+ message: string;
133
+ }
134
+ /**
135
+ * The injectable dispatch SEAM. Production wires {@link performStuckAction};
136
+ * tests inject a stub to assert on the apply-rung's routing WITHOUT touching a
137
+ * real arbiter.
138
+ */
139
+ export type StuckActionHandler = (input: StuckActionInput) => Promise<StuckActionResult>;
140
+ /**
141
+ * The PRODUCTION dispatcher: an answered `kind: 'stuck'` entry's verb drives
142
+ * one of the four terminals (`keep` / `reset` / `refused` / `cancel`). For
143
+ * `answer=reset` it dispatches through the SHARED
144
+ * {@link deleteRemoteWorkBranchIfPresent} primitive the `requeue --reset` verb
145
+ * also uses — delete-before-clear ordering, local-first write-through,
146
+ * already-gone tolerance (safe no-op when no branch exists). For `keep` and
147
+ * `cancel` there is nothing to do on the git side; the apply rung's normal
148
+ * fall-through handles the persist (`cancel` via the `dispose` option).
149
+ */
150
+ export declare function performStuckAction(input: StuckActionInput): Promise<StuckActionResult>;
151
+ //# sourceMappingURL=apply-stuck-action.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"apply-stuck-action.d.ts","sourceRoot":"","sources":["../src/apply-stuck-action.ts"],"names":[],"mappings":"AAEA,OAAO,EAIN,KAAK,YAAY,EAEjB,MAAM,cAAc,CAAC;AAGtB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+CG;AAEH,qEAAqE;AACrE,MAAM,MAAM,eAAe,GAAG,MAAM,GAAG,OAAO,GAAG,QAAQ,CAAC;AAE1D,2FAA2F;AAC3F,MAAM,WAAW,mBAAmB;IACnC,kEAAkE;IAClE,IAAI,EAAE,eAAe,CAAC;IACtB,6DAA6D;IAC7D,KAAK,EAAE,YAAY,CAAC;CACpB;AAED;;;;;;;GAOG;AACH,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,MAAM,GAAG,eAAe,GAAG,SAAS,CAU1E;AAED;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,yBAAyB,CACxC,GAAG,EAAE,MAAM,EACX,IAAI,EAAE,MAAM,GACV,mBAAmB,GAAG,SAAS,CAsBjC;AAED,0DAA0D;AAC1D,MAAM,WAAW,gBAAgB;IAChC,iDAAiD;IACjD,MAAM,EAAE,mBAAmB,CAAC;IAC5B,oDAAoD;IACpD,IAAI,EAAE,MAAM,CAAC;IACb,6DAA6D;IAC7D,IAAI,EAAE,MAAM,CAAC;IACb,sCAAsC;IACtC,GAAG,EAAE,MAAM,CAAC;IACZ,+DAA+D;IAC/D,OAAO,EAAE,MAAM,CAAC;IAChB,2CAA2C;IAC3C,GAAG,CAAC,EAAE,MAAM,CAAC,UAAU,CAAC;IACxB,8CAA8C;IAC9C,IAAI,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAC;CACjC;AAED,mEAAmE;AACnE,MAAM,MAAM,kBAAkB;AAC7B,4EAA4E;AAC1E,MAAM;AACR;;;;;GAKG;GACD,OAAO;AACT;;;;GAIG;GACD,QAAQ;AACV;;;;;;;GAOG;GACD,SAAS,CAAC;AAEb,6DAA6D;AAC7D,MAAM,WAAW,iBAAiB;IACjC,OAAO,EAAE,kBAAkB,CAAC;IAC5B,qDAAqD;IACrD,OAAO,EAAE,MAAM,CAAC;CAChB;AAED;;;;GAIG;AACH,MAAM,MAAM,kBAAkB,GAAG,CAChC,KAAK,EAAE,gBAAgB,KACnB,OAAO,CAAC,iBAAiB,CAAC,CAAC;AAEhC;;;;;;;;;GASG;AACH,wBAAsB,kBAAkB,CACvC,KAAK,EAAE,gBAAgB,GACrB,OAAO,CAAC,iBAAiB,CAAC,CAoD5B"}
@@ -0,0 +1,125 @@
1
+ import { existsSync, readFileSync } from 'node:fs';
2
+ import { join } from 'node:path';
3
+ import { isEntryAnswered, parseSidecar, sidecarPathFor, } from './sidecar.js';
4
+ import { deleteRemoteWorkBranchIfPresent } from './needs-attention.js';
5
+ /**
6
+ * Parse the human's plain free-text answer into a {@link StuckActionVerb}.
7
+ * MIRRORS `parseMergeAnswer` EXACTLY: first whole ASCII word, case-insensitive,
8
+ * trailing commentary tolerated; `undefined` on anything else (empty / typo /
9
+ * narrative). NEVER default-guesses a destructive `reset` — an ambiguous
10
+ * answer falls through to today's plain persist (the safe "keep the branch,
11
+ * clear the flag" behaviour), never invents a branch discard.
12
+ */
13
+ export function parseStuckAnswer(text) {
14
+ const trimmed = text.trim().toLowerCase();
15
+ if (trimmed === '')
16
+ return undefined;
17
+ const match = /^([a-z]+)/.exec(trimmed);
18
+ if (match === null)
19
+ return undefined;
20
+ const word = match[1];
21
+ if (word === 'keep' || word === 'reset' || word === 'cancel') {
22
+ return word;
23
+ }
24
+ return undefined;
25
+ }
26
+ /**
27
+ * Detect the `kind: 'stuck'` action verb that should drive the next apply run.
28
+ *
29
+ * ORDERING (mirrors `detectAnsweredMergeAction`'s re-stale re-surface rule):
30
+ *
31
+ * 1. If ANY `kind: 'stuck'` entry is UNANSWERED, return `undefined` —
32
+ * that is the re-paused state (a freshly-appended follow-up awaiting an
33
+ * answer), and the apply MUST NOT fire against a stale prior sibling.
34
+ * 2. Otherwise return the LATEST answered `kind: 'stuck'` entry — a fresh
35
+ * follow-up answer wins over the stale one.
36
+ *
37
+ * Returns `undefined` on a missing/unparseable sidecar or when no
38
+ * `kind: 'stuck'` entry parses to one of the three verbs (the apply rung then
39
+ * falls through to today's plain persist, which is the `keep` semantic — a
40
+ * malformed answer NEVER discards a branch).
41
+ */
42
+ export function detectAnsweredStuckAction(cwd, item) {
43
+ const abs = join(cwd, sidecarPathFor(item));
44
+ if (!existsSync(abs))
45
+ return undefined;
46
+ let model;
47
+ try {
48
+ model = parseSidecar(readFileSync(abs, 'utf8'));
49
+ }
50
+ catch {
51
+ return undefined;
52
+ }
53
+ for (const entry of model.entries) {
54
+ if (entry.kind === 'stuck' && !isEntryAnswered(entry))
55
+ return undefined;
56
+ }
57
+ for (let i = model.entries.length - 1; i >= 0; i--) {
58
+ const entry = model.entries[i];
59
+ if (entry.kind !== 'stuck')
60
+ continue;
61
+ if (!isEntryAnswered(entry))
62
+ continue;
63
+ const verb = parseStuckAnswer(entry.answer);
64
+ if (verb !== undefined) {
65
+ return { verb, entry };
66
+ }
67
+ }
68
+ return undefined;
69
+ }
70
+ /**
71
+ * The PRODUCTION dispatcher: an answered `kind: 'stuck'` entry's verb drives
72
+ * one of the four terminals (`keep` / `reset` / `refused` / `cancel`). For
73
+ * `answer=reset` it dispatches through the SHARED
74
+ * {@link deleteRemoteWorkBranchIfPresent} primitive the `requeue --reset` verb
75
+ * also uses — delete-before-clear ordering, local-first write-through,
76
+ * already-gone tolerance (safe no-op when no branch exists). For `keep` and
77
+ * `cancel` there is nothing to do on the git side; the apply rung's normal
78
+ * fall-through handles the persist (`cancel` via the `dispose` option).
79
+ */
80
+ export async function performStuckAction(input) {
81
+ const note = input.note ?? (() => { });
82
+ const { verb } = input.action;
83
+ if (verb === 'keep') {
84
+ return {
85
+ outcome: 'keep',
86
+ message: `stuck-question for ${input.item} answered KEEP — leaving ` +
87
+ `\`work/task-${input.slug}\` untouched (continue-from-WIP; the answer ` +
88
+ `is recorded in the item body via the normal apply path).`,
89
+ };
90
+ }
91
+ if (verb === 'cancel') {
92
+ return {
93
+ outcome: 'cancel',
94
+ message: `stuck-question for ${input.item} answered CANCEL — dispatching ` +
95
+ `through the \`dispose\` terminal (\`git mv -> tasks/cancelled/\`).`,
96
+ };
97
+ }
98
+ // verb === 'reset'
99
+ const dropped = await deleteRemoteWorkBranchIfPresent({
100
+ cwd: input.cwd,
101
+ arbiter: input.arbiter,
102
+ slug: input.slug,
103
+ env: input.env,
104
+ });
105
+ if (dropped.status === 'failed') {
106
+ const stderr = dropped.stderr;
107
+ const message = `stuck-question for ${input.item} answered RESET — but the arbiter ` +
108
+ `delete of ${dropped.branch} on ${input.arbiter} failed ` +
109
+ `(${stderr || 'unknown error'}). NOT clearing needsAnswers; the sidecar ` +
110
+ `stays surfaced for a re-answer. The local tracking ref was already ` +
111
+ `cleared (write-through ordering); a subsequent fetch will restore it ` +
112
+ `from the arbiter — the local store is BEHIND the arbiter ` +
113
+ `(self-healing), never AHEAD (which would drive a stale continue).`;
114
+ note(message);
115
+ return { outcome: 'refused', message };
116
+ }
117
+ const droppedLabel = dropped.status === 'deleted'
118
+ ? `Deleted the remote branch ${dropped.branch} on ${input.arbiter}`
119
+ : `Remote branch ${dropped.branch} on ${input.arbiter} was already gone`;
120
+ const message = `stuck-question for ${input.item} answered RESET — ${droppedLabel} ` +
121
+ `(next claim starts fresh).`;
122
+ note(message);
123
+ return { outcome: 'reset', message };
124
+ }
125
+ //# sourceMappingURL=apply-stuck-action.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"apply-stuck-action.js","sourceRoot":"","sources":["../src/apply-stuck-action.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,UAAU,EAAE,YAAY,EAAC,MAAM,SAAS,CAAC;AACjD,OAAO,EAAC,IAAI,EAAC,MAAM,WAAW,CAAC;AAC/B,OAAO,EACN,eAAe,EACf,YAAY,EACZ,cAAc,GAGd,MAAM,cAAc,CAAC;AACtB,OAAO,EAAC,+BAA+B,EAAC,MAAM,sBAAsB,CAAC;AA8DrE;;;;;;;GAOG;AACH,MAAM,UAAU,gBAAgB,CAAC,IAAY;IAC5C,MAAM,OAAO,GAAG,IAAI,CAAC,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC;IAC1C,IAAI,OAAO,KAAK,EAAE;QAAE,OAAO,SAAS,CAAC;IACrC,MAAM,KAAK,GAAG,WAAW,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IACxC,IAAI,KAAK,KAAK,IAAI;QAAE,OAAO,SAAS,CAAC;IACrC,MAAM,IAAI,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC;IACtB,IAAI,IAAI,KAAK,MAAM,IAAI,IAAI,KAAK,OAAO,IAAI,IAAI,KAAK,QAAQ,EAAE,CAAC;QAC9D,OAAO,IAAI,CAAC;IACb,CAAC;IACD,OAAO,SAAS,CAAC;AAClB,CAAC;AAED;;;;;;;;;;;;;;;GAeG;AACH,MAAM,UAAU,yBAAyB,CACxC,GAAW,EACX,IAAY;IAEZ,MAAM,GAAG,GAAG,IAAI,CAAC,GAAG,EAAE,cAAc,C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sBAAsB,KAAK,CAAC,IAAI,qBAAqB,YAAY,GAAG;QACpE,4BAA4B,CAAC;IAC9B,IAAI,CAAC,OAAO,CAAC,CAAC;IACd,OAAO,EAAC,OAAO,EAAE,OAAO,EAAE,OAAO,EAAC,CAAC;AACpC,CAAC"}
package/dist/brand.d.ts CHANGED
@@ -48,8 +48,19 @@ export interface Brand {
48
48
  readonly base: string;
49
49
  /** The shared env-var prefix: `constantCase(base) + '_'` ⇒ `DORFL_`. */
50
50
  readonly envPrefix: string;
51
- /** The per-repo config filename: `.{paramCase(base)}.json` ⇒ `.dorfl.json`. */
51
+ /**
52
+ * The per-repo config filename PREFERRED + written by default:
53
+ * `{paramCase(base)}.json` ⇒ `dorfl.json` (a plain, non-dotfile name, so it is
54
+ * visible in a normal `ls` and reads like other tool configs).
55
+ */
52
56
  readonly repoConfigFilename: string;
57
+ /**
58
+ * The LEGACY per-repo config filename still honoured on READ for backward
59
+ * compatibility: `.{paramCase(base)}.json` ⇒ `.dorfl.json` (the original
60
+ * dotfile form). Reads prefer {@link repoConfigFilename} and fall back to this;
61
+ * writes/`setup` use {@link repoConfigFilename}.
62
+ */
63
+ readonly repoConfigFilenameLegacy: string;
53
64
  /** The workspaces-dir name (a dotfile dir): `.{paramCase(base)}` ⇒ `.dorfl`. */
54
65
  readonly workdirName: string;
55
66
  /** The per-job record filename: `.{paramCase(base)}-job.json` ⇒ `.dorfl-job.json`. */