dorfl 0.1.0 → 0.1.2

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 (324) hide show
  1. package/dist/advance-ci-template.d.ts +3 -3
  2. package/dist/advance-ci-template.js +1 -1
  3. package/dist/advance-ci-template.js.map +1 -1
  4. package/dist/advance-classify.d.ts +5 -5
  5. package/dist/advance-classify.d.ts.map +1 -1
  6. package/dist/advance-classify.js +4 -4
  7. package/dist/advance-drivers.d.ts +7 -7
  8. package/dist/advance-drivers.d.ts.map +1 -1
  9. package/dist/advance-drivers.js +5 -5
  10. package/dist/advance-drivers.js.map +1 -1
  11. package/dist/advance-isolated.d.ts +3 -3
  12. package/dist/advance-isolated.d.ts.map +1 -1
  13. package/dist/advance-isolated.js +1 -1
  14. package/dist/advance-lifecycle-template.d.ts +2 -2
  15. package/dist/advance-lifecycle-template.js +9 -9
  16. package/dist/advance-lifecycle-template.js.map +1 -1
  17. package/dist/advance-loop-driver.d.ts +3 -3
  18. package/dist/advance-loop-driver.d.ts.map +1 -1
  19. package/dist/advance-loop-driver.js +1 -1
  20. package/dist/advance-treeless-publish.d.ts +1 -1
  21. package/dist/advance.d.ts +11 -11
  22. package/dist/advance.d.ts.map +1 -1
  23. package/dist/advance.js +21 -21
  24. package/dist/advance.js.map +1 -1
  25. package/dist/advancing-lock.d.ts +1 -1
  26. package/dist/advancing-lock.js +5 -5
  27. package/dist/apply-decide.d.ts +2 -2
  28. package/dist/apply-decide.js +2 -2
  29. package/dist/apply-merge-action.d.ts +4 -4
  30. package/dist/apply-merge-action.js +2 -2
  31. package/dist/apply-persist.d.ts +5 -5
  32. package/dist/apply-persist.d.ts.map +1 -1
  33. package/dist/apply-persist.js +7 -7
  34. package/dist/apply-persist.js.map +1 -1
  35. package/dist/buildable-body.d.ts +14 -14
  36. package/dist/buildable-body.js +9 -9
  37. package/dist/claim-cas.d.ts +3 -3
  38. package/dist/claim-cas.js +1 -1
  39. package/dist/claim-cas.js.map +1 -1
  40. package/dist/cli.d.ts.map +1 -1
  41. package/dist/cli.js +83 -77
  42. package/dist/cli.js.map +1 -1
  43. package/dist/close-job-template.d.ts +3 -3
  44. package/dist/close-job-template.js +8 -8
  45. package/dist/close-job.d.ts +8 -8
  46. package/dist/close-job.js +25 -25
  47. package/dist/close-job.js.map +1 -1
  48. package/dist/complete.d.ts +3 -3
  49. package/dist/complete.js +8 -8
  50. package/dist/complete.js.map +1 -1
  51. package/dist/concurrency.d.ts +1 -1
  52. package/dist/concurrency.js +1 -1
  53. package/dist/config.d.ts +32 -32
  54. package/dist/config.js +5 -5
  55. package/dist/config.js.map +1 -1
  56. package/dist/continue-branch.d.ts +1 -1
  57. package/dist/continue-branch.js +1 -1
  58. package/dist/cwd-section.js +1 -1
  59. package/dist/cwd-section.js.map +1 -1
  60. package/dist/decision-engine.d.ts +2 -2
  61. package/dist/do-autopick.d.ts +6 -6
  62. package/dist/do-autopick.d.ts.map +1 -1
  63. package/dist/do-autopick.js +5 -5
  64. package/dist/do-autopick.js.map +1 -1
  65. package/dist/do-config.d.ts +3 -3
  66. package/dist/do-config.js +3 -3
  67. package/dist/do-config.js.map +1 -1
  68. package/dist/do-remote-auto.d.ts +2 -2
  69. package/dist/do-remote-auto.js +1 -1
  70. package/dist/do.d.ts +25 -25
  71. package/dist/do.d.ts.map +1 -1
  72. package/dist/do.js +22 -22
  73. package/dist/do.js.map +1 -1
  74. package/dist/drop-source.d.ts +2 -2
  75. package/dist/env-config.js +8 -8
  76. package/dist/env-config.js.map +1 -1
  77. package/dist/format.js +3 -3
  78. package/dist/format.js.map +1 -1
  79. package/dist/frontmatter.d.ts +33 -39
  80. package/dist/frontmatter.d.ts.map +1 -1
  81. package/dist/frontmatter.js +18 -31
  82. package/dist/frontmatter.js.map +1 -1
  83. package/dist/install-ci-branch-protection.d.ts +1 -1
  84. package/dist/install-ci-branch-protection.js +1 -1
  85. package/dist/install-ci-capabilities/advance-lifecycle.d.ts +1 -1
  86. package/dist/install-ci-capabilities/advance-lifecycle.js +1 -1
  87. package/dist/install-ci-capabilities/close-job.d.ts +1 -1
  88. package/dist/install-ci-capabilities/close-job.js +1 -1
  89. package/dist/install-ci-capabilities/example-noop.d.ts +1 -1
  90. package/dist/install-ci-capabilities/example-noop.js +1 -1
  91. package/dist/install-ci-capabilities/intake.d.ts +2 -2
  92. package/dist/install-ci-capabilities/intake.js +2 -2
  93. package/dist/install-ci-capabilities/verify.d.ts +1 -1
  94. package/dist/install-ci-capabilities/verify.js +1 -1
  95. package/dist/install-ci-core.d.ts +3 -3
  96. package/dist/install-ci-core.js +2 -2
  97. package/dist/install-ci-core.js.map +1 -1
  98. package/dist/install-ci-github.d.ts +1 -1
  99. package/dist/install-ci-github.js +1 -1
  100. package/dist/install-ci.d.ts +1 -1
  101. package/dist/install-ci.js +4 -4
  102. package/dist/install-ci.js.map +1 -1
  103. package/dist/intake-event.d.ts +6 -6
  104. package/dist/intake-event.js +6 -6
  105. package/dist/intake-marker.d.ts +3 -3
  106. package/dist/intake-marker.d.ts.map +1 -1
  107. package/dist/intake-triage.d.ts +1 -1
  108. package/dist/intake-triage.js +2 -2
  109. package/dist/intake-trigger-template.d.ts +8 -8
  110. package/dist/intake-trigger-template.d.ts.map +1 -1
  111. package/dist/intake-trigger-template.js +16 -16
  112. package/dist/intake-trigger-template.js.map +1 -1
  113. package/dist/intake.d.ts +50 -50
  114. package/dist/intake.d.ts.map +1 -1
  115. package/dist/intake.js +70 -70
  116. package/dist/intake.js.map +1 -1
  117. package/dist/integration-core.d.ts +17 -17
  118. package/dist/integration-core.js +17 -17
  119. package/dist/integration-core.js.map +1 -1
  120. package/dist/isolation.d.ts +3 -3
  121. package/dist/issue-provider.d.ts +4 -4
  122. package/dist/issue-provider.js +1 -1
  123. package/dist/item-lock.d.ts +21 -21
  124. package/dist/item-lock.d.ts.map +1 -1
  125. package/dist/item-lock.js +16 -16
  126. package/dist/item-path.d.ts +2 -2
  127. package/dist/item-path.js +2 -2
  128. package/dist/ledger-lint.d.ts +9 -9
  129. package/dist/ledger-lint.js +9 -9
  130. package/dist/ledger-read.d.ts +57 -57
  131. package/dist/ledger-read.d.ts.map +1 -1
  132. package/dist/ledger-read.js +24 -24
  133. package/dist/ledger-read.js.map +1 -1
  134. package/dist/ledger-write.d.ts +2 -2
  135. package/dist/ledger-write.js +1 -1
  136. package/dist/lifecycle-gather.d.ts +1 -1
  137. package/dist/lifecycle-gather.js +16 -16
  138. package/dist/lifecycle-gather.js.map +1 -1
  139. package/dist/lifecycle-pools.d.ts +4 -4
  140. package/dist/lifecycle-pools.js +1 -1
  141. package/dist/merge-question-surfacer.d.ts +3 -3
  142. package/dist/merge-question-surfacer.js +2 -2
  143. package/dist/merge-question-surfacer.js.map +1 -1
  144. package/dist/mint-adr.js +4 -4
  145. package/dist/mirror-pool-scan.d.ts +2 -2
  146. package/dist/mirror-pool-scan.js +3 -3
  147. package/dist/mirror-pool-scan.js.map +1 -1
  148. package/dist/needs-attention.d.ts +13 -13
  149. package/dist/needs-attention.d.ts.map +1 -1
  150. package/dist/needs-attention.js +11 -11
  151. package/dist/needs-attention.js.map +1 -1
  152. package/dist/orphan-sidecar.d.ts +2 -2
  153. package/dist/placement.d.ts +6 -6
  154. package/dist/placement.js +2 -2
  155. package/dist/prd-to-spec.d.ts +15 -1
  156. package/dist/prd-to-spec.d.ts.map +1 -1
  157. package/dist/prd-to-spec.js +36 -14
  158. package/dist/prd-to-spec.js.map +1 -1
  159. package/dist/prompt.d.ts +24 -24
  160. package/dist/prompt.d.ts.map +1 -1
  161. package/dist/prompt.js +29 -31
  162. package/dist/prompt.js.map +1 -1
  163. package/dist/protocol/CLAIM-PROTOCOL.md +4 -4
  164. package/dist/protocol/REVIEW-PROTOCOL.md +1 -1
  165. package/dist/protocol/TASKING-PROTOCOL.md +12 -12
  166. package/dist/protocol/WORK-CONTRACT.md +39 -39
  167. package/dist/protocol/spec-template.md +1 -1
  168. package/dist/protocol/task-template.md +3 -3
  169. package/dist/readiness.d.ts +1 -1
  170. package/dist/recover-isolated.js +1 -1
  171. package/dist/repo-config.js +12 -12
  172. package/dist/repo-config.js.map +1 -1
  173. package/dist/review-gate.d.ts +3 -3
  174. package/dist/review-gate.d.ts.map +1 -1
  175. package/dist/review-gate.js +11 -10
  176. package/dist/review-gate.js.map +1 -1
  177. package/dist/review-verdict.d.ts +2 -2
  178. package/dist/review-verdict.d.ts.map +1 -1
  179. package/dist/review-verdict.js +1 -1
  180. package/dist/run.d.ts +1 -1
  181. package/dist/run.js +5 -5
  182. package/dist/run.js.map +1 -1
  183. package/dist/scan.d.ts +10 -10
  184. package/dist/scan.d.ts.map +1 -1
  185. package/dist/scan.js +8 -8
  186. package/dist/scan.js.map +1 -1
  187. package/dist/select-order.d.ts +1 -1
  188. package/dist/select-priority.d.ts +12 -12
  189. package/dist/select-priority.d.ts.map +1 -1
  190. package/dist/select-priority.js +5 -5
  191. package/dist/select-priority.js.map +1 -1
  192. package/dist/sidecar.d.ts +2 -2
  193. package/dist/sidecar.js +2 -2
  194. package/dist/sidecar.js.map +1 -1
  195. package/dist/slug-namespace.d.ts +1 -1
  196. package/dist/slug-namespace.js +3 -3
  197. package/dist/slug-namespace.js.map +1 -1
  198. package/dist/spec-complete.js +2 -2
  199. package/dist/spec-complete.js.map +1 -1
  200. package/dist/start.d.ts +1 -1
  201. package/dist/start.js +3 -3
  202. package/dist/start.js.map +1 -1
  203. package/dist/status.d.ts +3 -3
  204. package/dist/status.js +4 -4
  205. package/dist/status.js.map +1 -1
  206. package/dist/surface-gate.d.ts +2 -2
  207. package/dist/surface-gate.d.ts.map +1 -1
  208. package/dist/surface-persist.d.ts +2 -2
  209. package/dist/surface-persist.d.ts.map +1 -1
  210. package/dist/tasker-review-loop.d.ts +8 -8
  211. package/dist/tasker-review-loop.d.ts.map +1 -1
  212. package/dist/tasker-review-loop.js +8 -8
  213. package/dist/tasker-review-loop.js.map +1 -1
  214. package/dist/tasking-eligibility.d.ts +21 -21
  215. package/dist/tasking-eligibility.d.ts.map +1 -1
  216. package/dist/tasking-eligibility.js +10 -10
  217. package/dist/tasking-lock.d.ts +8 -8
  218. package/dist/tasking-lock.d.ts.map +1 -1
  219. package/dist/tasking-lock.js +20 -21
  220. package/dist/tasking-lock.js.map +1 -1
  221. package/dist/tasking.d.ts +33 -33
  222. package/dist/tasking.d.ts.map +1 -1
  223. package/dist/tasking.js +89 -88
  224. package/dist/tasking.js.map +1 -1
  225. package/dist/triage-gate.d.ts +1 -1
  226. package/dist/triage-persist.d.ts +5 -5
  227. package/dist/triage-persist.js +15 -15
  228. package/dist/triage-persist.js.map +1 -1
  229. package/dist/verify-workflow-template.d.ts +1 -1
  230. package/dist/verify-workflow-template.js +2 -2
  231. package/dist/work-layout.d.ts +9 -7
  232. package/dist/work-layout.d.ts.map +1 -1
  233. package/dist/work-layout.js +9 -7
  234. package/dist/work-layout.js.map +1 -1
  235. package/dist/workspace.d.ts +1 -1
  236. package/package.json +1 -1
  237. package/src/advance-ci-template.ts +4 -4
  238. package/src/advance-classify.ts +5 -5
  239. package/src/advance-drivers.ts +10 -10
  240. package/src/advance-isolated.ts +3 -3
  241. package/src/advance-lifecycle-template.ts +9 -9
  242. package/src/advance-loop-driver.ts +3 -3
  243. package/src/advance-treeless-publish.ts +1 -1
  244. package/src/advance.ts +30 -30
  245. package/src/advancing-lock.ts +6 -6
  246. package/src/apply-decide.ts +2 -2
  247. package/src/apply-merge-action.ts +5 -5
  248. package/src/apply-persist.ts +8 -8
  249. package/src/buildable-body.ts +14 -14
  250. package/src/claim-cas.ts +4 -4
  251. package/src/cli.ts +94 -84
  252. package/src/close-job-template.ts +8 -8
  253. package/src/close-job.ts +26 -26
  254. package/src/complete.ts +11 -11
  255. package/src/concurrency.ts +1 -1
  256. package/src/config.ts +37 -37
  257. package/src/continue-branch.ts +1 -1
  258. package/src/cwd-section.ts +1 -1
  259. package/src/decision-engine.ts +3 -3
  260. package/src/do-autopick.ts +9 -9
  261. package/src/do-config.ts +6 -6
  262. package/src/do-remote-auto.ts +2 -2
  263. package/src/do.ts +49 -49
  264. package/src/drop-source.ts +2 -2
  265. package/src/env-config.ts +8 -8
  266. package/src/format.ts +3 -3
  267. package/src/frontmatter.ts +42 -60
  268. package/src/install-ci-branch-protection.ts +1 -1
  269. package/src/install-ci-capabilities/advance-lifecycle.ts +1 -1
  270. package/src/install-ci-capabilities/close-job.ts +1 -1
  271. package/src/install-ci-capabilities/example-noop.ts +1 -1
  272. package/src/install-ci-capabilities/intake.ts +2 -2
  273. package/src/install-ci-capabilities/verify.ts +1 -1
  274. package/src/install-ci-core.ts +4 -4
  275. package/src/install-ci-github.ts +1 -1
  276. package/src/install-ci.ts +4 -4
  277. package/src/intake-event.ts +6 -6
  278. package/src/intake-marker.ts +3 -3
  279. package/src/intake-triage.ts +2 -2
  280. package/src/intake-trigger-template.ts +17 -17
  281. package/src/intake.ts +97 -97
  282. package/src/integration-core.ts +35 -35
  283. package/src/isolation.ts +3 -3
  284. package/src/issue-provider.ts +4 -4
  285. package/src/item-lock.ts +21 -21
  286. package/src/item-path.ts +2 -2
  287. package/src/ledger-lint.ts +9 -9
  288. package/src/ledger-read.ts +81 -81
  289. package/src/ledger-write.ts +3 -3
  290. package/src/lifecycle-gather.ts +16 -16
  291. package/src/lifecycle-pools.ts +4 -4
  292. package/src/merge-question-surfacer.ts +4 -4
  293. package/src/mint-adr.ts +4 -4
  294. package/src/mirror-pool-scan.ts +5 -5
  295. package/src/needs-attention.ts +22 -22
  296. package/src/orphan-sidecar.ts +2 -2
  297. package/src/placement.ts +6 -6
  298. package/src/prd-to-spec.ts +51 -15
  299. package/src/prompt.ts +33 -35
  300. package/src/readiness.ts +1 -1
  301. package/src/recover-isolated.ts +1 -1
  302. package/src/repo-config.ts +12 -12
  303. package/src/review-gate.ts +12 -11
  304. package/src/review-verdict.ts +2 -2
  305. package/src/run.ts +6 -6
  306. package/src/scan.ts +15 -15
  307. package/src/select-order.ts +1 -1
  308. package/src/select-priority.ts +13 -13
  309. package/src/sidecar.ts +3 -3
  310. package/src/slug-namespace.ts +3 -3
  311. package/src/spec-complete.ts +2 -2
  312. package/src/start.ts +4 -4
  313. package/src/status.ts +7 -7
  314. package/src/surface-gate.ts +2 -2
  315. package/src/surface-persist.ts +2 -2
  316. package/src/tasker-review-loop.ts +15 -15
  317. package/src/tasking-eligibility.ts +21 -21
  318. package/src/tasking-lock.ts +27 -28
  319. package/src/tasking.ts +124 -123
  320. package/src/triage-gate.ts +1 -1
  321. package/src/triage-persist.ts +16 -16
  322. package/src/verify-workflow-template.ts +2 -2
  323. package/src/work-layout.ts +9 -7
  324. package/src/workspace.ts +1 -1
@@ -6,7 +6,7 @@ import {parseableJsonContractPrompt} from './review-verdict.js';
6
6
  import type {NewQuestion} from './sidecar.js';
7
7
 
8
8
  /**
9
- * The **SURFACE gate** (prd `advance-loop`, task `advance-rung-surface`,
9
+ * The **SURFACE gate** (spec `advance-loop`, task `advance-rung-surface`,
10
10
  * US #32/33) — the surface-question rung's fresh-context spawn, the DIRECT mirror
11
11
  * of the PR/code review gate ({@link import('./review-gate.js')}). On
12
12
  * `classify=surface`, the advance engine spawns a FRESH-CONTEXT agent with the
@@ -70,7 +70,7 @@ export interface SurfaceEmit {
70
70
 
71
71
  /** What the surface gate needs to launch a fresh-context surface of one item. */
72
72
  export interface SurfaceGateInput {
73
- /** The namespaced identity the surface is for (`task:foo` / `prd:bar` / `observation:baz`). */
73
+ /** The namespaced identity the surface is for (`task:foo` / `spec:bar` / `observation:baz`). */
74
74
  item: string;
75
75
  /** The working clone/checkout the gate runs in. */
76
76
  cwd: string;
@@ -13,7 +13,7 @@ import {
13
13
  } from './sidecar.js';
14
14
 
15
15
  /**
16
- * The engine-owned SURFACE PERSIST (prd `advance-loop`, task
16
+ * The engine-owned SURFACE PERSIST (spec `advance-loop`, task
17
17
  * `advance-rung-surface`, US #15/33) — the half of the surface rung the ENGINE
18
18
  * owns (the skill JUDGES, the engine PERSISTS). Given the questions the
19
19
  * `surface-questions` skill EMITTED (gathered by `surface-gate.ts`'s spawn), the
@@ -53,7 +53,7 @@ import {
53
53
  export interface SurfacePersistOptions {
54
54
  /** Working clone/worktree the persist commits in. */
55
55
  cwd: string;
56
- /** The namespaced item identity (`task:foo` / `prd:bar` / `observation:baz`). */
56
+ /** The namespaced item identity (`task:foo` / `spec:bar` / `observation:baz`). */
57
57
  item: string;
58
58
  /**
59
59
  * The item file path RELATIVE to `cwd` (e.g. `work/backlog/foo.md`). The
@@ -29,9 +29,9 @@ export {parseReviewVerdict as parseTaskReviewVerdict} from './review-verdict.js'
29
29
 
30
30
  /**
31
31
  * **The tasker review→edit→re-review→converge LOOP** (`slicer-review-edit-loop`,
32
- * GATES prd `work/prds/ready/review.md` RESOLVED DESIGN — Shape 2 / insertion point A).
32
+ * GATES spec `work/specs/ready/review.md` RESOLVED DESIGN — Shape 2 / insertion point A).
33
33
  *
34
- * On the `do prd:<slug>` tasking path (`tasking.ts`/`performTask`), AFTER the
34
+ * On the `do spec:<slug>` tasking path (`tasking.ts`/`performTask`), AFTER the
35
35
  * agent produces a candidate set of `work/tasks/backlog/<slug>.md` tasks and BEFORE the
36
36
  * runner finalises/lands them, this loop RUNS the `review` SKILL
37
37
  * (`skills/review/SKILL.md`), APPLIES its findings as EDITS to the candidate task
@@ -47,7 +47,7 @@ export {parseReviewVerdict as parseTaskReviewVerdict} from './review-verdict.js'
47
47
  * N so the loop can never run forever.
48
48
  *
49
49
  * ⚠️ ASPIRATION-VS-BUILT (2026-06-10): the "single context" wording above is the
50
- * prd's ASPIRATION, NOT what this module does at runtime. The ACTUAL N loop is
50
+ * spec's ASPIRATION, NOT what this module does at runtime. The ACTUAL N loop is
51
51
  * RUNNER-DRIVEN and PER-PASS: `runOneExecution` does `for (pass …) { gate(…);
52
52
  * applyEdits(…to disk…) }` — ONE agent LAUNCH per pass, the runner writing the
53
53
  * agent's edits to the candidate task FILES (`work/tasks/backlog/`) between passes, the
@@ -75,7 +75,7 @@ export {parseReviewVerdict as parseTaskReviewVerdict} from './review-verdict.js'
75
75
  * - **a specific uncertain task** → emit it `needsAnswers: true` with the
76
76
  * questions in its body (created, not agent-buildable until a human answers).
77
77
  * - **the whole decomposition unclear / `taskerLoopMax` exhausted with blockers** →
78
- * route the prd to `work/needs-attention/<slug>.md` with the questions as the
78
+ * route the spec to `work/needs-attention/<slug>.md` with the questions as the
79
79
  * reason, emitting NO guessed tasks.
80
80
  *
81
81
  * The verdict sink itself (the git transitions for those three outcomes) is the
@@ -101,7 +101,7 @@ export type TaskReviewVerdict = ReviewVerdict;
101
101
 
102
102
  /** What the review gate needs to launch a fresh-context review+edit pass. */
103
103
  export interface TaskReviewGateInput {
104
- /** The prd slug whose candidate tasks are under review. */
104
+ /** The spec slug whose candidate tasks are under review. */
105
105
  slug: string;
106
106
  /** The working clone/checkout the loop runs in (candidate tasks live here). */
107
107
  cwd: string;
@@ -141,7 +141,7 @@ export type LoopOutcome =
141
141
  | 'converged'
142
142
  /** `taskerLoopMax` hit with blockers → specific uncertain task(s) → needsAnswers. */
143
143
  | 'uncertain-tasks'
144
- /** `taskerLoopMax` hit / decomposition unclear → route the prd to needs-attention. */
144
+ /** `taskerLoopMax` hit / decomposition unclear → route the spec to needs-attention. */
145
145
  | 'decomposition-unclear';
146
146
 
147
147
  /** The result of running the loop — the disposition the caller's sink routes. */
@@ -174,7 +174,7 @@ export interface RunTaskReviewLoopResult {
174
174
  }
175
175
 
176
176
  export interface RunTaskReviewLoopOptions {
177
- /** The prd slug whose candidate tasks are being improved. */
177
+ /** The spec slug whose candidate tasks are being improved. */
178
178
  slug: string;
179
179
  /** The working clone/checkout the loop runs in. */
180
180
  cwd: string;
@@ -226,7 +226,7 @@ export interface RunTaskReviewLoopOptions {
226
226
  * to the candidate task files, then re-review — until `verdict === 'approve'` (no
227
227
  * NEW blocking issue → converged) or the pass count reaches `taskerLoopMax`. On the cap
228
228
  * with a still-`block` verdict, ROUTE per the verdict's channels:
229
- * - `decompositionUnclear` set ⇒ `decomposition-unclear` (prd → needs-attention,
229
+ * - `decompositionUnclear` set ⇒ `decomposition-unclear` (spec → needs-attention,
230
230
  * no guessed tasks);
231
231
  * - else `uncertainTasks` (or, as a floor, every candidate task) ⇒
232
232
  * `uncertain-tasks` (those tasks emitted `needsAnswers: true` + questions).
@@ -296,7 +296,7 @@ export async function runTaskReviewLoop(
296
296
  note(
297
297
  `Tasker review loop did not converge within taskerLoopMax=${taskerLoopMax} ` +
298
298
  `across ${executions} fresh context(s); the whole decomposition is ` +
299
- 'unclear — routing the prd to needs-attention (no guessed tasks).',
299
+ 'unclear — routing the spec to needs-attention (no guessed tasks).',
300
300
  );
301
301
  return {
302
302
  outcome: 'decomposition-unclear',
@@ -308,7 +308,7 @@ export async function runTaskReviewLoop(
308
308
  message:
309
309
  `The decomposition of '${options.slug}' is still unclear after ` +
310
310
  `taskerLoopMax=${taskerLoopMax} review pass(es) across ${executions} fresh ` +
311
- 'context(s); routing the prd to needs-attention with the open ' +
311
+ 'context(s); routing the spec to needs-attention with the open ' +
312
312
  'questions, emitting no guessed tasks.',
313
313
  };
314
314
  }
@@ -617,18 +617,18 @@ export function buildTaskReviewPrompt(input: TaskReviewGateInput): string {
617
617
  const list = input.candidateTasks.map((p) => ` - ${p}`).join('\n');
618
618
  return [
619
619
  `You are a FRESH-CONTEXT reviewer in the TASKER review→edit→converge LOOP`,
620
- `(insertion point A). Review the CANDIDATE TASKS just produced for the prd`,
620
+ `(insertion point A). Review the CANDIDATE TASKS just produced for the spec`,
621
621
  `"${input.slug}":`,
622
622
  list || ' (no candidate tasks found)',
623
623
  ``,
624
624
  reviewDisciplinePrompt(),
625
625
  ``,
626
- `Read the source prd (work/prds/ready/${input.slug}.md) and review the candidate`,
626
+ `Read the source spec (${workItemRel('specs-ready', `${input.slug}.md`)}) and review the candidate`,
627
627
  `decomposition ADVERSARIALLY. Review the WHOLE SET — graph coherence / gaps /`,
628
628
  `overlap / goal-composition (dependency-graph coherence, set-level gaps,`,
629
- `overlapping/duplicated tasks, and "does the set compose into the prd goal")`,
629
+ `overlapping/duplicated tasks, and "does the set compose into the spec goal")`,
630
630
  `— not just per-task well-formedness. The DESTINATION CHECK ("if every task`,
631
- `is built exactly as written, do we end up with the system the prd describes?")`,
631
+ `is built exactly as written, do we end up with the system the spec describes?")`,
632
632
  `is PART OF this pass and may ITSELF trigger edits — that is why this is a`,
633
633
  `loop, not a one-shot gate.`,
634
634
  ``,
@@ -645,7 +645,7 @@ export function buildTaskReviewPrompt(input: TaskReviewGateInput): string {
645
645
  ` can FIX a finding by editing (the natural improver step).`,
646
646
  ` - "uncertainTasks" — specific tasks you cannot make buildable (each gets`,
647
647
  ` \`needsAnswers: true\` with the questions in its body).`,
648
- ` - "decompositionUnclear" — the WHOLE decomposition is unsound (the prd is`,
648
+ ` - "decompositionUnclear" — the WHOLE decomposition is unsound (the spec is`,
649
649
  ` routed to needs-attention; emit no guessed tasks).`,
650
650
  `Do NOT fill "review" / "edit" / "questions" — those are other callers'`,
651
651
  `channels. Flag, do not guess: a flagged question costs one human glance; a`,
@@ -1,46 +1,46 @@
1
1
  /**
2
2
  * Pure tasking-eligibility resolution — the auto-task decision layer, one level
3
- * UP from the build gate (`eligibility.ts`). No I/O: callers pass in the prd's
3
+ * UP from the build gate (`eligibility.ts`). No I/O: callers pass in the spec's
4
4
  * two autonomy axes (`humanOnly`, `needsAnswers`), the repo's `autoTask` policy,
5
- * the prd's `taskedAfter` slugs, and the set of slugs whose prds are already
6
- * TASKED (resolved against `work/prds/tasked/` residence, NOT `work/done/`).
5
+ * the spec's `taskedAfter` slugs, and the set of slugs whose prds are already
6
+ * TASKED (resolved against `work/specs/tasked/` residence, NOT `work/done/`).
7
7
  *
8
8
  * This mirrors the build-gate shape deliberately (CONTEXT.md / the `auto-slice`
9
- * prd): the same `needsAnswers !== true && humanOnly !== true && <repo policy>`
10
- * predicate, applied to a prd's two axes + the repo's `autoTask` toggle — and a
11
- * cross-prd ordering check that resolves against tasked-ness rather than done-ness.
9
+ * spec): the same `needsAnswers !== true && humanOnly !== true && <repo policy>`
10
+ * predicate, applied to a spec's two axes + the repo's `autoTask` toggle — and a
11
+ * cross-spec ordering check that resolves against tasked-ness rather than done-ness.
12
12
  */
13
13
 
14
14
  import type {HumanOnlyGate} from './eligibility.js';
15
15
 
16
16
  export type {HumanOnlyGate};
17
17
 
18
- /** Resolution of a prd's `taskedAfter` against the set of already-tasked prds. */
18
+ /** Resolution of a spec's `taskedAfter` against the set of already-tasked prds. */
19
19
  export interface TaskedAfterResult {
20
- /** True when every listed prd is already tasked. */
20
+ /** True when every listed spec is already tasked. */
21
21
  satisfied: boolean;
22
- /** Listed prd slugs not yet tasked, in declaration order. */
22
+ /** Listed spec slugs not yet tasked, in declaration order. */
23
23
  missing: string[];
24
24
  }
25
25
 
26
26
  export interface TaskingEligibilityInput {
27
- /** Autonomy axis 1 (DECIDED): a human must drive THIS prd's tasking. */
27
+ /** Autonomy axis 1 (DECIDED): a human must drive THIS spec's tasking. */
28
28
  humanOnly: HumanOnlyGate;
29
- /** Autonomy axis 2 (DISCOVERED): the prd has unresolved questions. */
29
+ /** Autonomy axis 2 (DISCOVERED): the spec has unresolved questions. */
30
30
  needsAnswers: HumanOnlyGate;
31
- /** Cross-prd order: prd slugs that must already be tasked before this one. */
31
+ /** Cross-spec order: spec slugs that must already be tasked before this one. */
32
32
  taskedAfter: string[];
33
- /** Slugs of prds that are already TASKED (residence in `work/prds/tasked/`). */
33
+ /** Slugs of prds that are already TASKED (residence in `work/specs/tasked/`). */
34
34
  taskedSlugs: Set<string>;
35
35
  /** Per-repo policy: may an agent auto-task *undeclared* prds in this repo? */
36
36
  autoTask: boolean;
37
37
  /**
38
- * The target was named EXPLICITLY by the operator (`do prd:<slug>`), so the
39
- * `autoTask` POLICY is already satisfied — naming the prd IS the authorization,
38
+ * The target was named EXPLICITLY by the operator (`do spec:<slug>`), so the
39
+ * `autoTask` POLICY is already satisfied — naming the spec IS the authorization,
40
40
  * exactly as `do <task>` builds a named task regardless of `autoBuild` (the
41
41
  * `autoBuild` precedent: the pool/scan gates the policy, the explicit claim path
42
42
  * never re-checks it). When `true`, the policy term drops from the gate and ONLY
43
- * the prd's own readiness axes (`humanOnly`/`needsAnswers`) + `taskedAfter` bind.
43
+ * the spec's own readiness axes (`humanOnly`/`needsAnswers`) + `taskedAfter` bind.
44
44
  * Defaults `false` (the AUTO-PICK pool path, where the `autoTask` policy DOES
45
45
  * gate). The pool is the single policy-enforcement point; the per-invocation gate
46
46
  * applies the policy only when NOT explicit.
@@ -49,7 +49,7 @@ export interface TaskingEligibilityInput {
49
49
  }
50
50
 
51
51
  export interface TaskingEligibilityResult {
52
- /** Taskable now = gate passes AND every `taskedAfter` prd is already tasked. */
52
+ /** Taskable now = gate passes AND every `taskedAfter` spec is already tasked. */
53
53
  taskable: boolean;
54
54
  /** Whether the autonomy gate alone passes (agent-taskable on its own axes). */
55
55
  gatePass: boolean;
@@ -61,7 +61,7 @@ export interface TaskingEligibilityResult {
61
61
  * `true` AND `humanOnly` is not `true` AND the repo's `autoTask` POLICY is
62
62
  * satisfied — where the policy is satisfied either by the repo's `autoTask`
63
63
  * toggle being on (the AUTO-PICK pool path) OR by the target being named
64
- * EXPLICITLY (`explicit: true` — `do prd:<slug>`, where naming IS the
64
+ * EXPLICITLY (`explicit: true` — `do spec:<slug>`, where naming IS the
65
65
  * authorization, mirroring `do <task>` vs `autoBuild`). Both readiness axes
66
66
  * block orthogonally and are never agent-taskable regardless of policy; a human
67
67
  * is never bound by either. The exact mirror of `resolveGate` (the build gate),
@@ -82,9 +82,9 @@ export function resolveTaskGate(
82
82
  }
83
83
 
84
84
  /**
85
- * Resolve a prd's `taskedAfter` against the slugs of prds already TASKED (NOT
86
- * `done/`): satisfied iff every listed prd is present in `taskedSlugs`. An
87
- * untasked blocker ⇒ not yet taskable (so this prd's emitted tasks can
85
+ * Resolve a spec's `taskedAfter` against the slugs of prds already TASKED (NOT
86
+ * `done/`): satisfied iff every listed spec is present in `taskedSlugs`. An
87
+ * untasked blocker ⇒ not yet taskable (so this spec's emitted tasks can
88
88
  * reference the real slugs of those prds' tasks).
89
89
  */
90
90
  export function resolveTaskedAfter(
@@ -7,19 +7,19 @@ import {
7
7
  import {workItemRel} from './work-layout.js';
8
8
 
9
9
  /**
10
- * The **tasking concurrency lock** (prd `auto-slice`, task `autoslice-lock`).
10
+ * The **tasking concurrency lock** (spec `auto-slice`, task `autoslice-lock`).
11
11
  *
12
- * Serialises *concurrent* taskers (two CI runs, or human + CI) so a prd is never
12
+ * Serialises *concurrent* taskers (two CI runs, or human + CI) so a spec is never
13
13
  * double-tasked. As of the capstone cut-over (task
14
- * `cutover-retire-slicing-advancing-markers-and-trim-folder-sets`, prd
14
+ * `cutover-retire-slicing-advancing-markers-and-trim-folder-sets`, spec
15
15
  * `ledger-status-per-item-lock-refs`; ADR `ledger-status-on-per-item-lock-refs`)
16
- * the legacy `git mv work/prds/ready/<slug>.md → work/tasking/<slug>.md` MARKER on `main`
16
+ * the legacy `git mv work/specs/ready/<slug>.md → work/tasking/<slug>.md` MARKER on `main`
17
17
  * is GONE: the body NEVER relocates until the durable promotion, exactly as claim
18
18
  * no longer moves the task body (task
19
19
  * `cutover-claim-body-stays-and-complete-sources-from-backlog`). The tasking lock
20
20
  * is now ONLY the UNIFIED per-item lock (`refs/dorfl/lock/<entry>`,
21
- * `action: task`, keyed `prd:<slug>`) — the SAME ref claim and advance use for
22
- * the same item, so tasking a prd is mutually exclusive with claiming/advancing
21
+ * `action: task`, keyed `spec:<slug>`) — the SAME ref claim and advance use for
22
+ * the same item, so tasking a spec is mutually exclusive with claiming/advancing
23
23
  * the SAME item BY CONSTRUCTION (the second acquirer loses the SAME create-only
24
24
  * ref CAS, with NO retry budget and NO false contention). There is no transient
25
25
  * status in `main`'s tree anymore, so a work branch cut from `main` inherits no
@@ -29,9 +29,9 @@ import {workItemRel} from './work-layout.js';
29
29
  * A `lost` (the item is already held for implement/task/advance) makes the
30
30
  * tasking acquire lose DEFINITIVELY (exit 2, no retry). On a successful acquire
31
31
  * it returns {@link AcquireTaskingLockResult.lockedBlob}: the git blob sha of the
32
- * prd body the lock TOOK, read from `work/prds/ready/<slug>.md` on the arbiter — the
32
+ * spec body the lock TOOK, read from `work/specs/ready/<slug>.md` on the arbiter — the
33
33
  * snapshot the tasker reads + tasks from, handed back so the integrate
34
- * transition can fail loud if the held prd was edited concurrently (the
34
+ * transition can fail loud if the held spec was edited concurrently (the
35
35
  * read-stability backstop). A dry-run takes no lock (it mutates nothing).
36
36
  *
37
37
  * - **Release** ({@link releaseTaskingLock}) DELETES the unified lock ref. It
@@ -51,11 +51,11 @@ import {workItemRel} from './work-layout.js';
51
51
  * The READ-STABILITY backstop (the content-identity stale check that used to live
52
52
  * in the release, comparing the held `work/tasking/<slug>.md` blob against the
53
53
  * acquire-time snapshot) now lives at the integrate seam (`tasking.ts`
54
- * `heldSpecIsStale`, comparing `work/prds/ready/<slug>.md`) — relocated because the
54
+ * `heldSpecIsStale`, comparing `work/specs/ready/<slug>.md`) — relocated because the
55
55
  * completing transition, not the release, owns the commit. See
56
56
  * `work/notes/observations/tasking-lock-does-not-stabilise-prd-content.md`.
57
57
  *
58
- * This module provides the lock PRIMITIVES only. The orchestrating `do prd:<slug>`
58
+ * This module provides the lock PRIMITIVES only. The orchestrating `do spec:<slug>`
59
59
  * tasking command (`tasking.ts`) acquires, drives the agent's tasking, integrates
60
60
  * the emitted tasks + the durable `prd → prd-tasked` move, and releases. The
61
61
  * human path (no contention) may task on `main` directly without the lock.
@@ -74,7 +74,7 @@ export type AcquireTaskingLockOutcome =
74
74
  export type AcquireTaskingLockExitCode = 0 | 1 | 2 | 3;
75
75
 
76
76
  export interface AcquireTaskingLockOptions {
77
- /** The prd slug to lock (`work/prds/ready/<slug>.md`). */
77
+ /** The spec slug to lock (`work/specs/ready/<slug>.md`). */
78
78
  slug: string;
79
79
  /** Working clone/worktree the lock acquire runs in. */
80
80
  cwd: string;
@@ -98,10 +98,10 @@ export interface AcquireTaskingLockResult {
98
98
  /** Human-readable summary of the terminal condition. */
99
99
  message: string;
100
100
  /**
101
- * On a successful acquire (`acquired`), the git BLOB sha of the prd body that
102
- * the lock TOOK (`work/prds/ready/<slug>.md` on the arbiter). This IS the snapshot the
101
+ * On a successful acquire (`acquired`), the git BLOB sha of the spec body that
102
+ * the lock TOOK (`work/specs/ready/<slug>.md` on the arbiter). This IS the snapshot the
103
103
  * tasker reads + tasks from; the integrate transition compares the current
104
- * `work/prds/ready/<slug>.md` blob against it to fail loud on a concurrent edit (the
104
+ * `work/specs/ready/<slug>.md` blob against it to fail loud on a concurrent edit (the
105
105
  * read-stability backstop). `undefined` unless `outcome === 'acquired'` (and on
106
106
  * dry-run, where nothing was published).
107
107
  */
@@ -157,7 +157,7 @@ async function runAcquire(
157
157
  }
158
158
  const by = options.by || (await resolveBy(cwd, env));
159
159
 
160
- // Is the prd still lockable (present in work/prds/ready/ on the arbiter's main)?
160
+ // Is the spec still lockable (present in work/specs/ready/ on the arbiter's main)?
161
161
  await gitHard(['fetch', '--quiet', arbiter], cwd, env);
162
162
  const spec = workItemRel('specs-ready', `${slug}.md`);
163
163
  const specBlob = await gitSoft(
@@ -166,7 +166,7 @@ async function runAcquire(
166
166
  env,
167
167
  );
168
168
  if (specBlob.status !== 0) {
169
- const message = `'${spec}' not found on ${arbiter}/main (no such prd, or it was already moved/tasked).`;
169
+ const message = `'${spec}' not found on ${arbiter}/main (no such spec, or it was already moved/tasked).`;
170
170
  note(message);
171
171
  return {exitCode: 2, outcome: 'lost', message};
172
172
  }
@@ -180,18 +180,17 @@ async function runAcquire(
180
180
  return {exitCode: 0, outcome: 'acquired', message, lockedBlob};
181
181
  }
182
182
 
183
- // Acquire the UNIFIED per-item lock (`action: task`, keyed `prd:<slug>` so it
183
+ // Acquire the UNIFIED per-item lock (`action: task`, keyed `spec:<slug>` so it
184
184
  // shares the ONE ref with claim/advance of the SAME item). A create-only ref
185
185
  // CAS: the winner holds it, the loser is DEFINITIVELY `lost` (exit 2, no retry
186
186
  // budget). No auto-steal of an orphaned lock, consistent with claim/advance and
187
187
  // the ADR's recovery model (no liveness heartbeat / auto-sweep; a human asserts
188
188
  // a lock is dead via `release-lock` + `gc --ledger`).
189
- // MIGRATE step (prd `prd-to-spec-vocabulary-cutover-and-migration-command`):
190
- // EMIT the parent-spec item identity as `spec:<slug>` so the unified per-item
191
- // lock ref is `refs/dorfl/lock/spec-<slug>` (the expand-lock task made
192
- // `spec:<slug>` resolve to a `spec-<slug>` entry). The resolver still ACCEPTS
193
- // `prd:<slug>`, so any lock taken under the old identity stays readable; the
194
- // contract task removes the legacy form.
189
+ // Spec `prd-to-spec-vocabulary-cutover-and-migration-command`: the parent-spec
190
+ // item identity is `spec:<slug>`, so the unified per-item lock ref is
191
+ // `refs/dorfl/lock/spec-<slug>`. HARD CUTOVER: the legacy `prd:<slug>` identity
192
+ // is GONE the resolver no longer treats `prd:` as the spec namespace (a
193
+ // `prd:<slug>` arg is a bare literal task slug now).
195
194
  const lock = await acquireItemLock({
196
195
  item: `spec:${slug}`,
197
196
  action: 'task',
@@ -228,7 +227,7 @@ export type ReleaseTaskingLockOutcome =
228
227
  export type ReleaseTaskingLockExitCode = 0 | 1 | 2 | 3 | 4;
229
228
 
230
229
  export interface ReleaseTaskingLockOptions {
231
- /** The prd slug whose lock to release. */
230
+ /** The spec slug whose lock to release. */
232
231
  slug: string;
233
232
  /** Working clone/worktree the release runs in. */
234
233
  cwd: string;
@@ -249,9 +248,9 @@ export interface ReleaseTaskingLockOptions {
249
248
  /**
250
249
  * The tasker review→edit LOOP's **decomposition-unclear** verdict
251
250
  * (`slicer-review-edit-loop`), or the task-SET acceptance gate's `block`:
252
- * instead of DELETING the lock (returning the prd to the claimable/taskable
251
+ * instead of DELETING the lock (returning the spec to the claimable/taskable
253
252
  * pool), amend it `active → stuck` with this reason recorded on the entry,
254
- * emitting NO guessed tasks. The prd body stays in `work/prds/ready/` (it never moved
253
+ * emitting NO guessed tasks. The spec body stays in `work/specs/ready/` (it never moved
255
254
  * under the lock); the stuck lock IS the tasking needs-attention surface (no
256
255
  * `work/needs-attention/` folder write), so it is NOT re-taskable until a human
257
256
  * resolves it via `release-lock`/`resume`. Omitted ⇒ the normal release DELETES
@@ -275,7 +274,7 @@ export interface ReleaseTaskingLockResult {
275
274
  * Release the tasking lock for `slug`: DELETE the unified `action: task` lock ref
276
275
  * (idempotent — an already-absent ref is a clean `released`). It moves NO lifecycle
277
276
  * file: the durable `prd → prd-tasked` success move is owned by the integrate band,
278
- * and the prd body never left `work/prds/ready/` under the lock, so there is no
277
+ * and the spec body never left `work/specs/ready/` under the lock, so there is no
279
278
  * `tasking/ → prd/` restore.
280
279
  *
281
280
  * When `routeToNeedsAttention` is set (the tasker decomposition-unclear verdict /
@@ -328,7 +327,7 @@ async function runRelease(
328
327
 
329
328
  // DECOMPOSITION-UNCLEAR / TASK-GATE BLOCK: amend the lock `active → stuck` with
330
329
  // the reason on the entry (the tasking needs-attention surface), NOT delete it.
331
- // The prd body stays in `work/prds/ready/`; the stuck lock keeps it out of the
330
+ // The spec body stays in `work/specs/ready/`; the stuck lock keeps it out of the
332
331
  // taskable pool until a human resolves it (`release-lock`/`resume`).
333
332
  if (options.routeToNeedsAttention !== undefined) {
334
333
  // MIGRATE: EMIT `spec:<slug>` (keyed to the `spec-<slug>` lock entry).