@bonesofspring/ai-rules 0.2.64 → 0.2.65

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 (293) hide show
  1. package/CHANGELOG.md +46 -11
  2. package/README.md +6 -6
  3. package/bin/lib/engine-scripts.js +14 -5
  4. package/bin/lib/seed-ai-local-team.js +7 -0
  5. package/docs/PRESET-CONTRIBUTION.md +41 -0
  6. package/docs/TEAM-DB.md +193 -52
  7. package/docs/openapi/team-db.v1.json +1238 -377
  8. package/mcp/defectdojo-mcp.mjs +7 -5
  9. package/mcp/lib/defectdojo.mjs +26 -14
  10. package/package.json +26 -20
  11. package/presets/_shared/ai-local/scripts/process-lease.mjs +576 -0
  12. package/presets/_shared/ai-local/scripts/processes.mjs +1618 -0
  13. package/presets/_shared/ai-local/scripts/run.mjs +5 -5
  14. package/presets/_shared/ai-local/scripts/team-db-api.mjs +465 -152
  15. package/presets/_shared/ai-local/scripts/team-db-dashboard.mjs +235 -10
  16. package/presets/_shared/ai-local/scripts/team-db-openapi.mjs +416 -176
  17. package/presets/_shared/ai-local/scripts/team-db-project.mjs +171 -62
  18. package/presets/_shared/ai-local/scripts/team-db-scheduler.mjs +4 -0
  19. package/presets/_shared/ai-local/scripts/team-db-schema.mjs +143 -5
  20. package/presets/_shared/ai-local/scripts/team-db-task-runner.mjs +567 -0
  21. package/presets/_shared/ai-local/scripts/{team-db-backlog.mjs → team-db-tracker.mjs} +900 -197
  22. package/presets/_shared/ai-local/scripts/team-db-ui.mjs +750 -0
  23. package/presets/_shared/ai-local/scripts/team-db.mjs +104 -23
  24. package/presets/_shared/core/agent-team/agent-team-orchestrator.md +1 -1
  25. package/presets/_shared/hooks/chain-team-phases.sh.tmpl +105 -17
  26. package/presets/_shared/hooks/guard-shell-command.mjs.tmpl +40 -2
  27. package/presets/claude/android-kotlin/hooks/chain-team-phases.sh +105 -17
  28. package/presets/claude/android-kotlin/hooks/guard-shell-command.mjs +41 -2
  29. package/presets/claude/android-kotlin/rules/tooling-and-review/agent-team-orchestrator.md +1 -1
  30. package/presets/claude/android-kotlin/settings.json +6 -1
  31. package/presets/claude/go/hooks/chain-team-phases.sh +105 -17
  32. package/presets/claude/go/hooks/guard-shell-command.mjs +41 -2
  33. package/presets/claude/go/rules/tooling-and-review/agent-team-orchestrator.md +1 -1
  34. package/presets/claude/go/settings.json +6 -1
  35. package/presets/claude/ios-swift/hooks/chain-team-phases.sh +105 -17
  36. package/presets/claude/ios-swift/hooks/guard-shell-command.mjs +41 -2
  37. package/presets/claude/ios-swift/rules/tooling-and-review/agent-team-orchestrator.md +1 -1
  38. package/presets/claude/ios-swift/settings.json +6 -1
  39. package/presets/claude/java/hooks/chain-team-phases.sh +105 -17
  40. package/presets/claude/java/hooks/guard-shell-command.mjs +41 -2
  41. package/presets/claude/java/rules/tooling-and-review/agent-team-orchestrator.md +1 -1
  42. package/presets/claude/java/settings.json +6 -1
  43. package/presets/claude/mcp-ts/hooks/chain-team-phases.sh +105 -17
  44. package/presets/claude/mcp-ts/hooks/guard-shell-command.mjs +41 -2
  45. package/presets/claude/mcp-ts/rules/tooling-and-review/agent-team-orchestrator.md +1 -1
  46. package/presets/claude/mcp-ts/settings.json +6 -1
  47. package/presets/claude/mol/hooks/chain-team-phases.sh +105 -17
  48. package/presets/claude/mol/hooks/guard-shell-command.mjs +41 -2
  49. package/presets/claude/mol/rules/tooling-and-review/agent-team-orchestrator.md +1 -1
  50. package/presets/claude/mol/settings.json +6 -1
  51. package/presets/claude/next/MCP.md +2 -0
  52. package/presets/claude/next/REPO_AGENTS.md +2 -0
  53. package/presets/claude/next/agents/build-verifier.md +1 -1
  54. package/presets/claude/next/agents/ci-investigator.md +3 -0
  55. package/presets/claude/next/agents/debugger.md +3 -0
  56. package/presets/claude/next/agents/feature-developer.md +3 -0
  57. package/presets/claude/next/agents/mockup-reviewer.md +2 -0
  58. package/presets/claude/next/agents/performance-auditor.md +2 -0
  59. package/presets/claude/next/agents/playwright-test-generator.md +3 -0
  60. package/presets/claude/next/agents/playwright-test-healer.md +3 -0
  61. package/presets/claude/next/agents/playwright-test-planner.md +3 -0
  62. package/presets/claude/next/agents/qa-tester.md +3 -0
  63. package/presets/claude/next/commands/README.md +6 -0
  64. package/presets/claude/next/commands/ui-start.md +78 -0
  65. package/presets/claude/next/commands/ui-stop.md +71 -0
  66. package/presets/claude/next/hooks/chain-team-phases.sh +105 -17
  67. package/presets/claude/next/hooks/guard-shell-command.mjs +41 -2
  68. package/presets/claude/next/rules/README.md +2 -1
  69. package/presets/claude/next/rules/stack/next-app-core.md +1 -0
  70. package/presets/claude/next/rules/tooling-and-review/agent-team-orchestrator.md +1 -1
  71. package/presets/claude/next/rules/tooling-and-review/dev-process-lifecycle.md +43 -0
  72. package/presets/claude/next/settings.json +6 -1
  73. package/presets/claude/nuxt/hooks/chain-team-phases.sh +105 -17
  74. package/presets/claude/nuxt/hooks/guard-shell-command.mjs +41 -2
  75. package/presets/claude/nuxt/rules/tooling-and-review/agent-team-orchestrator.md +1 -1
  76. package/presets/claude/nuxt/settings.json +6 -1
  77. package/presets/claude/php-hexagonal/hooks/chain-team-phases.sh +105 -17
  78. package/presets/claude/php-hexagonal/hooks/guard-shell-command.mjs +41 -2
  79. package/presets/claude/php-hexagonal/rules/tooling-and-review/agent-team-orchestrator.md +1 -1
  80. package/presets/claude/php-hexagonal/settings.json +6 -1
  81. package/presets/claude/php-laravel/hooks/chain-team-phases.sh +106 -18
  82. package/presets/claude/php-laravel/hooks/guard-shell-command.mjs +41 -2
  83. package/presets/claude/php-laravel/rules/tooling-and-review/agent-team-orchestrator.md +1 -1
  84. package/presets/claude/php-laravel/settings.json +6 -1
  85. package/presets/claude/svelte/hooks/chain-team-phases.sh +105 -17
  86. package/presets/claude/svelte/hooks/guard-shell-command.mjs +41 -2
  87. package/presets/claude/svelte/rules/tooling-and-review/agent-team-orchestrator.md +1 -1
  88. package/presets/claude/svelte/settings.json +6 -1
  89. package/presets/cursor/android-kotlin/hooks/chain-team-phases.sh +105 -17
  90. package/presets/cursor/android-kotlin/hooks/guard-shell-command.mjs +41 -2
  91. package/presets/cursor/go/hooks/chain-team-phases.sh +105 -17
  92. package/presets/cursor/go/hooks/guard-shell-command.mjs +41 -2
  93. package/presets/cursor/ios-swift/hooks/chain-team-phases.sh +105 -17
  94. package/presets/cursor/ios-swift/hooks/guard-shell-command.mjs +41 -2
  95. package/presets/cursor/java/hooks/chain-team-phases.sh +105 -17
  96. package/presets/cursor/java/hooks/guard-shell-command.mjs +41 -2
  97. package/presets/cursor/mcp-ts/hooks/chain-team-phases.sh +105 -17
  98. package/presets/cursor/mcp-ts/hooks/guard-shell-command.mjs +41 -2
  99. package/presets/cursor/mol/hooks/chain-team-phases.sh +105 -17
  100. package/presets/cursor/mol/hooks/guard-shell-command.mjs +41 -2
  101. package/presets/cursor/next/MCP.md +2 -0
  102. package/presets/cursor/next/REPO_AGENTS.md +2 -0
  103. package/presets/cursor/next/agents/build-verifier.md +1 -1
  104. package/presets/cursor/next/agents/ci-investigator.md +2 -0
  105. package/presets/cursor/next/agents/debugger.md +2 -0
  106. package/presets/cursor/next/agents/feature-developer.md +2 -0
  107. package/presets/cursor/next/agents/mockup-reviewer.md +2 -0
  108. package/presets/cursor/next/agents/performance-auditor.md +2 -0
  109. package/presets/cursor/next/agents/playwright-test-generator.md +2 -0
  110. package/presets/cursor/next/agents/playwright-test-healer.md +2 -0
  111. package/presets/cursor/next/agents/playwright-test-planner.md +2 -0
  112. package/presets/cursor/next/agents/qa-tester.md +2 -0
  113. package/presets/cursor/next/ai-local/rules-library/storybook-dev-compare-figma.md +1 -1
  114. package/presets/cursor/next/commands/README.md +6 -0
  115. package/presets/cursor/next/commands/ui-start.md +78 -0
  116. package/presets/cursor/next/commands/ui-stop.md +71 -0
  117. package/presets/cursor/next/hooks/chain-team-phases.sh +105 -17
  118. package/presets/cursor/next/hooks/guard-shell-command.mjs +41 -2
  119. package/presets/cursor/next/rules/README.md +2 -1
  120. package/presets/cursor/next/rules/dev-process-lifecycle.mdc +43 -0
  121. package/presets/cursor/next/rules/next-app-core.mdc +1 -0
  122. package/presets/cursor/nuxt/hooks/chain-team-phases.sh +105 -17
  123. package/presets/cursor/nuxt/hooks/guard-shell-command.mjs +41 -2
  124. package/presets/cursor/php-hexagonal/hooks/chain-team-phases.sh +105 -17
  125. package/presets/cursor/php-hexagonal/hooks/guard-shell-command.mjs +41 -2
  126. package/presets/cursor/php-laravel/hooks/chain-team-phases.sh +106 -18
  127. package/presets/cursor/php-laravel/hooks/guard-shell-command.mjs +41 -2
  128. package/presets/cursor/svelte/hooks/chain-team-phases.sh +105 -17
  129. package/presets/cursor/svelte/hooks/guard-shell-command.mjs +41 -2
  130. package/presets/mavis/android-kotlin/adapter-map.json +1 -1
  131. package/presets/mavis/android-kotlin/hooks/chain-team-phases.sh +105 -17
  132. package/presets/mavis/android-kotlin/rules/agent-team-orchestrator.md +1 -1
  133. package/presets/mavis/go/adapter-map.json +1 -1
  134. package/presets/mavis/go/hooks/chain-team-phases.sh +105 -17
  135. package/presets/mavis/go/rules/agent-team-orchestrator.md +1 -1
  136. package/presets/mavis/ios-swift/adapter-map.json +1 -1
  137. package/presets/mavis/ios-swift/hooks/chain-team-phases.sh +105 -17
  138. package/presets/mavis/ios-swift/rules/agent-team-orchestrator.md +1 -1
  139. package/presets/mavis/java/adapter-map.json +1 -1
  140. package/presets/mavis/java/hooks/chain-team-phases.sh +105 -17
  141. package/presets/mavis/java/rules/agent-team-orchestrator.md +1 -1
  142. package/presets/mavis/mcp-ts/adapter-map.json +1 -1
  143. package/presets/mavis/mcp-ts/hooks/chain-team-phases.sh +105 -17
  144. package/presets/mavis/mcp-ts/rules/agent-team-orchestrator.md +1 -1
  145. package/presets/mavis/mol/adapter-map.json +1 -1
  146. package/presets/mavis/mol/hooks/chain-team-phases.sh +105 -17
  147. package/presets/mavis/mol/rules/agent-team-orchestrator.md +1 -1
  148. package/presets/mavis/next/MCP.md +2 -0
  149. package/presets/mavis/next/REPO_AGENTS.md +2 -0
  150. package/presets/mavis/next/adapter-map.json +25 -1
  151. package/presets/mavis/next/agents/build-verifier.md +1 -1
  152. package/presets/mavis/next/agents/ci-investigator.md +3 -0
  153. package/presets/mavis/next/agents/debugger.md +3 -0
  154. package/presets/mavis/next/agents/feature-developer.md +3 -0
  155. package/presets/mavis/next/agents/mockup-reviewer.md +2 -0
  156. package/presets/mavis/next/agents/performance-auditor.md +2 -0
  157. package/presets/mavis/next/agents/playwright-test-generator.md +3 -0
  158. package/presets/mavis/next/agents/playwright-test-healer.md +3 -0
  159. package/presets/mavis/next/agents/playwright-test-planner.md +3 -0
  160. package/presets/mavis/next/agents/qa-tester.md +3 -0
  161. package/presets/mavis/next/ai-local/rules-library/storybook-dev-compare-figma.md +1 -1
  162. package/presets/mavis/next/commands/README.md +6 -0
  163. package/presets/mavis/next/commands/ui-start.md +73 -0
  164. package/presets/mavis/next/commands/ui-stop.md +66 -0
  165. package/presets/mavis/next/hooks/chain-team-phases.sh +105 -17
  166. package/presets/mavis/next/rules/agent-team-orchestrator.md +1 -1
  167. package/presets/mavis/next/rules/dev-process-lifecycle.md +38 -0
  168. package/presets/mavis/next/rules/next-app-core.md +1 -0
  169. package/presets/mavis/nuxt/adapter-map.json +1 -1
  170. package/presets/mavis/nuxt/hooks/chain-team-phases.sh +105 -17
  171. package/presets/mavis/nuxt/rules/agent-team-orchestrator.md +1 -1
  172. package/presets/mavis/php-hexagonal/adapter-map.json +1 -1
  173. package/presets/mavis/php-hexagonal/hooks/chain-team-phases.sh +105 -17
  174. package/presets/mavis/php-hexagonal/rules/agent-team-orchestrator.md +1 -1
  175. package/presets/mavis/php-laravel/adapter-map.json +1 -1
  176. package/presets/mavis/php-laravel/hooks/chain-team-phases.sh +106 -18
  177. package/presets/mavis/php-laravel/rules/agent-team-orchestrator.md +1 -1
  178. package/presets/mavis/svelte/adapter-map.json +1 -1
  179. package/presets/mavis/svelte/hooks/chain-team-phases.sh +105 -17
  180. package/presets/mavis/svelte/rules/agent-team-orchestrator.md +1 -1
  181. package/presets/opencode/android-kotlin/adapter-map.json +1 -1
  182. package/presets/opencode/android-kotlin/hooks/chain-team-phases.sh +105 -17
  183. package/presets/opencode/android-kotlin/opencode.json +5 -1
  184. package/presets/opencode/android-kotlin/rules/agent-team-orchestrator.md +1 -1
  185. package/presets/opencode/go/adapter-map.json +1 -1
  186. package/presets/opencode/go/hooks/chain-team-phases.sh +105 -17
  187. package/presets/opencode/go/opencode.json +5 -1
  188. package/presets/opencode/go/rules/agent-team-orchestrator.md +1 -1
  189. package/presets/opencode/ios-swift/adapter-map.json +1 -1
  190. package/presets/opencode/ios-swift/hooks/chain-team-phases.sh +105 -17
  191. package/presets/opencode/ios-swift/opencode.json +5 -1
  192. package/presets/opencode/ios-swift/rules/agent-team-orchestrator.md +1 -1
  193. package/presets/opencode/java/adapter-map.json +1 -1
  194. package/presets/opencode/java/hooks/chain-team-phases.sh +105 -17
  195. package/presets/opencode/java/opencode.json +5 -1
  196. package/presets/opencode/java/rules/agent-team-orchestrator.md +1 -1
  197. package/presets/opencode/mcp-ts/adapter-map.json +1 -1
  198. package/presets/opencode/mcp-ts/hooks/chain-team-phases.sh +105 -17
  199. package/presets/opencode/mcp-ts/opencode.json +5 -1
  200. package/presets/opencode/mcp-ts/rules/agent-team-orchestrator.md +1 -1
  201. package/presets/opencode/mol/adapter-map.json +1 -1
  202. package/presets/opencode/mol/hooks/chain-team-phases.sh +105 -17
  203. package/presets/opencode/mol/opencode.json +4 -0
  204. package/presets/opencode/mol/rules/agent-team-orchestrator.md +1 -1
  205. package/presets/opencode/next/MCP.md +2 -0
  206. package/presets/opencode/next/REPO_AGENTS.md +2 -0
  207. package/presets/opencode/next/adapter-map.json +25 -1
  208. package/presets/opencode/next/agents/build-verifier.md +1 -1
  209. package/presets/opencode/next/agents/ci-investigator.md +3 -0
  210. package/presets/opencode/next/agents/debugger.md +3 -0
  211. package/presets/opencode/next/agents/feature-developer.md +3 -0
  212. package/presets/opencode/next/agents/mockup-reviewer.md +2 -0
  213. package/presets/opencode/next/agents/performance-auditor.md +2 -0
  214. package/presets/opencode/next/agents/playwright-test-generator.md +3 -0
  215. package/presets/opencode/next/agents/playwright-test-healer.md +3 -0
  216. package/presets/opencode/next/agents/playwright-test-planner.md +3 -0
  217. package/presets/opencode/next/agents/qa-tester.md +3 -0
  218. package/presets/opencode/next/ai-local/rules-library/storybook-dev-compare-figma.md +1 -1
  219. package/presets/opencode/next/commands/README.md +6 -0
  220. package/presets/opencode/next/commands/ui-start.md +81 -0
  221. package/presets/opencode/next/commands/ui-stop.md +74 -0
  222. package/presets/opencode/next/hooks/chain-team-phases.sh +105 -17
  223. package/presets/opencode/next/opencode.json +4 -0
  224. package/presets/opencode/next/rules/agent-team-orchestrator.md +1 -1
  225. package/presets/opencode/next/rules/dev-process-lifecycle.md +38 -0
  226. package/presets/opencode/next/rules/next-app-core.md +1 -0
  227. package/presets/opencode/nuxt/adapter-map.json +1 -1
  228. package/presets/opencode/nuxt/hooks/chain-team-phases.sh +105 -17
  229. package/presets/opencode/nuxt/opencode.json +4 -0
  230. package/presets/opencode/nuxt/rules/agent-team-orchestrator.md +1 -1
  231. package/presets/opencode/php-hexagonal/adapter-map.json +1 -1
  232. package/presets/opencode/php-hexagonal/hooks/chain-team-phases.sh +105 -17
  233. package/presets/opencode/php-hexagonal/opencode.json +5 -1
  234. package/presets/opencode/php-hexagonal/rules/agent-team-orchestrator.md +1 -1
  235. package/presets/opencode/php-laravel/adapter-map.json +1 -1
  236. package/presets/opencode/php-laravel/hooks/chain-team-phases.sh +106 -18
  237. package/presets/opencode/php-laravel/opencode.json +5 -1
  238. package/presets/opencode/php-laravel/rules/agent-team-orchestrator.md +1 -1
  239. package/presets/opencode/svelte/adapter-map.json +1 -1
  240. package/presets/opencode/svelte/hooks/chain-team-phases.sh +105 -17
  241. package/presets/opencode/svelte/opencode.json +4 -0
  242. package/presets/opencode/svelte/rules/agent-team-orchestrator.md +1 -1
  243. package/presets/zcode/android-kotlin/adapter-map.json +1 -1
  244. package/presets/zcode/android-kotlin/hooks/chain-team-phases.sh +105 -17
  245. package/presets/zcode/android-kotlin/rules/agent-team-orchestrator.md +1 -1
  246. package/presets/zcode/go/adapter-map.json +1 -1
  247. package/presets/zcode/go/hooks/chain-team-phases.sh +105 -17
  248. package/presets/zcode/go/rules/agent-team-orchestrator.md +1 -1
  249. package/presets/zcode/ios-swift/adapter-map.json +1 -1
  250. package/presets/zcode/ios-swift/hooks/chain-team-phases.sh +105 -17
  251. package/presets/zcode/ios-swift/rules/agent-team-orchestrator.md +1 -1
  252. package/presets/zcode/java/adapter-map.json +1 -1
  253. package/presets/zcode/java/hooks/chain-team-phases.sh +105 -17
  254. package/presets/zcode/java/rules/agent-team-orchestrator.md +1 -1
  255. package/presets/zcode/mcp-ts/adapter-map.json +1 -1
  256. package/presets/zcode/mcp-ts/hooks/chain-team-phases.sh +105 -17
  257. package/presets/zcode/mcp-ts/rules/agent-team-orchestrator.md +1 -1
  258. package/presets/zcode/mol/adapter-map.json +1 -1
  259. package/presets/zcode/mol/hooks/chain-team-phases.sh +105 -17
  260. package/presets/zcode/mol/rules/agent-team-orchestrator.md +1 -1
  261. package/presets/zcode/next/MCP.md +2 -0
  262. package/presets/zcode/next/REPO_AGENTS.md +2 -0
  263. package/presets/zcode/next/adapter-map.json +25 -1
  264. package/presets/zcode/next/agents/build-verifier.md +1 -1
  265. package/presets/zcode/next/agents/ci-investigator.md +3 -0
  266. package/presets/zcode/next/agents/debugger.md +3 -0
  267. package/presets/zcode/next/agents/feature-developer.md +3 -0
  268. package/presets/zcode/next/agents/mockup-reviewer.md +2 -0
  269. package/presets/zcode/next/agents/performance-auditor.md +2 -0
  270. package/presets/zcode/next/agents/playwright-test-generator.md +3 -0
  271. package/presets/zcode/next/agents/playwright-test-healer.md +3 -0
  272. package/presets/zcode/next/agents/playwright-test-planner.md +3 -0
  273. package/presets/zcode/next/agents/qa-tester.md +3 -0
  274. package/presets/zcode/next/ai-local/rules-library/storybook-dev-compare-figma.md +1 -1
  275. package/presets/zcode/next/commands/README.md +6 -0
  276. package/presets/zcode/next/commands/ui-start.md +81 -0
  277. package/presets/zcode/next/commands/ui-stop.md +74 -0
  278. package/presets/zcode/next/hooks/chain-team-phases.sh +105 -17
  279. package/presets/zcode/next/rules/agent-team-orchestrator.md +1 -1
  280. package/presets/zcode/next/rules/dev-process-lifecycle.md +38 -0
  281. package/presets/zcode/next/rules/next-app-core.md +1 -0
  282. package/presets/zcode/nuxt/adapter-map.json +1 -1
  283. package/presets/zcode/nuxt/hooks/chain-team-phases.sh +105 -17
  284. package/presets/zcode/nuxt/rules/agent-team-orchestrator.md +1 -1
  285. package/presets/zcode/php-hexagonal/adapter-map.json +1 -1
  286. package/presets/zcode/php-hexagonal/hooks/chain-team-phases.sh +105 -17
  287. package/presets/zcode/php-hexagonal/rules/agent-team-orchestrator.md +1 -1
  288. package/presets/zcode/php-laravel/adapter-map.json +1 -1
  289. package/presets/zcode/php-laravel/hooks/chain-team-phases.sh +106 -18
  290. package/presets/zcode/php-laravel/rules/agent-team-orchestrator.md +1 -1
  291. package/presets/zcode/svelte/adapter-map.json +1 -1
  292. package/presets/zcode/svelte/hooks/chain-team-phases.sh +105 -17
  293. package/presets/zcode/svelte/rules/agent-team-orchestrator.md +1 -1
@@ -1,8 +1,8 @@
1
1
  /**
2
- * The OpenAPI 3.1 document for the team-db API: reads plus ten bounded
2
+ * The OpenAPI 3.1 document for the team-db API: reads plus fourteen bounded
3
3
  * mutations (the idempotent rescan, the confirmed task delete, the four job
4
- * writes, and the four backlog writes: item create/update, queue
5
- * enqueue/cancel).
4
+ * writes, and the eight tracker writes: item create/update/delete, queue
5
+ * enqueue/cancel, task start/stop/continue).
6
6
  *
7
7
  * This module is the single source of the checked-in
8
8
  * `packages/ai-rules/docs/openapi/team-db.v1.json`: `check-team-db-contract.mjs
@@ -17,7 +17,7 @@
17
17
 
18
18
  // The run-reason vocabulary is the scheduler's own list: one source, no drift.
19
19
  import { REASON_CODES } from './team-db-scheduler.mjs';
20
- // The backlog vocabularies are the engine's own lists: one source, no drift.
20
+ // The tracker vocabularies are the engine's own lists: one source, no drift.
21
21
  import {
22
22
  EFFECTIVE_ENTRY_STATUSES,
23
23
  EFFECTIVE_ITEM_STATUSES,
@@ -26,7 +26,7 @@ import {
26
26
  ITEM_HISTORY_TYPES,
27
27
  ITEM_STATUSES,
28
28
  ITEM_TYPES,
29
- } from './team-db-backlog.mjs';
29
+ } from './team-db-tracker.mjs';
30
30
 
31
31
  export const API_MAJOR = 1;
32
32
  export const API_VERSION = '1.0.0';
@@ -34,16 +34,16 @@ export const OPENAPI_VERSION = '3.1.0';
34
34
  export const OPENAPI_JSON_SCHEMA_DIALECT = 'https://json-schema.org/draft/2020-12/schema';
35
35
  export const OPENAPI_SERVER_URL = 'http://127.0.0.1:4178';
36
36
 
37
- /** The backlog vocabularies, in the engine's declaration order. */
38
- export const BACKLOG_ITEM_STATUS = [...ITEM_STATUSES];
39
- export const BACKLOG_EFFECTIVE_ITEM_STATUS = [...EFFECTIVE_ITEM_STATUSES];
40
- export const BACKLOG_ENTRY_STATUS = [...ENTRY_STATUSES];
41
- export const BACKLOG_EFFECTIVE_ENTRY_STATUS = [...EFFECTIVE_ENTRY_STATUSES];
42
- export const BACKLOG_ITEM_TYPES = [...ITEM_TYPES];
43
- export const BACKLOG_ITEM_HISTORY_TYPES = [...ITEM_HISTORY_TYPES];
44
- export const BACKLOG_ENTRY_HISTORY_TYPES = [...ENTRY_HISTORY_TYPES];
37
+ /** The tracker vocabularies, in the engine's declaration order. */
38
+ export const TRACKER_ITEM_STATUS = [...ITEM_STATUSES];
39
+ export const TRACKER_EFFECTIVE_ITEM_STATUS = [...EFFECTIVE_ITEM_STATUSES];
40
+ export const TRACKER_ENTRY_STATUS = [...ENTRY_STATUSES];
41
+ export const TRACKER_EFFECTIVE_ENTRY_STATUS = [...EFFECTIVE_ENTRY_STATUSES];
42
+ export const TRACKER_ITEM_TYPES = [...ITEM_TYPES];
43
+ export const TRACKER_ITEM_HISTORY_TYPES = [...ITEM_HISTORY_TYPES];
44
+ export const TRACKER_ENTRY_HISTORY_TYPES = [...ENTRY_HISTORY_TYPES];
45
45
  /** One history schema serves both stores: item and entry event types united. */
46
- export const BACKLOG_HISTORY_TYPES = [...new Set([...BACKLOG_ITEM_HISTORY_TYPES, ...BACKLOG_ENTRY_HISTORY_TYPES])];
46
+ export const TRACKER_HISTORY_TYPES = [...new Set([...TRACKER_ITEM_HISTORY_TYPES, ...TRACKER_ENTRY_HISTORY_TYPES])];
47
47
 
48
48
  /** Mirrors `SLUG_RE` in `team-db-project.mjs`; a path parameter, never a file path. */
49
49
  export const SLUG_PATTERN = '^[a-z0-9]+(?:-[a-z0-9]+)*$';
@@ -636,6 +636,12 @@ const schemas = {
636
636
  Health: object(
637
637
  {
638
638
  status: { type: 'string', enum: ['ok', 'degraded'] },
639
+ rootId: {
640
+ type: 'string',
641
+ pattern: '^[0-9a-f]{12}$',
642
+ description:
643
+ 'Identity of the repository this server projects: the first 12 hex characters of sha256 of the resolved team root. A hash, never a path. Additive and optional — a v1 consumer must not require it, and its absence means "no identity", never a mismatch.',
644
+ },
639
645
  db: object(
640
646
  {
641
647
  file: { type: 'string' },
@@ -656,7 +662,7 @@ const schemas = {
656
662
  projectedAt: nullable('string'),
657
663
  capabilities: {
658
664
  type: 'array',
659
- items: { type: 'string', enum: ['sync', 'delete', 'jobs', 'schedule', 'backlog'] },
665
+ items: { type: 'string', enum: ['sync', 'delete', 'jobs', 'schedule', 'tracker'] },
660
666
  },
661
667
  scheduler: object(
662
668
  {
@@ -1003,39 +1009,39 @@ const schemas = {
1003
1009
  },
1004
1010
  ['requested', 'requestedAt', 'schedulerOnline'],
1005
1011
  ),
1006
- BacklogDependency: object(
1012
+ TrackerDependency: object(
1007
1013
  {
1008
- id: { type: 'string', pattern: SLUG_PATTERN },
1014
+ id: { type: 'integer', minimum: 1 },
1009
1015
  title: { type: 'string' },
1010
1016
  // The effective status of the related item, what an operator sees.
1011
- status: { type: 'string', enum: BACKLOG_EFFECTIVE_ITEM_STATUS },
1017
+ status: { type: 'string', enum: TRACKER_EFFECTIVE_ITEM_STATUS },
1012
1018
  satisfied: { type: 'boolean' },
1013
1019
  },
1014
1020
  ['id', 'title', 'status', 'satisfied'],
1015
1021
  ),
1016
- BacklogHistoryEntry: object(
1022
+ TrackerHistoryEntry: object(
1017
1023
  {
1018
1024
  at: { type: 'string' },
1019
- type: { type: 'string', enum: BACKLOG_HISTORY_TYPES },
1025
+ type: { type: 'string', enum: TRACKER_HISTORY_TYPES },
1020
1026
  actor: { type: 'string' },
1021
1027
  detail: nullable('string'),
1022
1028
  },
1023
1029
  ['at', 'type', 'actor', 'detail'],
1024
1030
  ),
1025
- BacklogItem: object(
1031
+ TrackerItem: object(
1026
1032
  {
1027
1033
  schemaVersion: { type: 'integer', const: 1 },
1028
- id: { type: 'string', pattern: SLUG_PATTERN },
1034
+ id: { type: 'integer', minimum: 1 },
1029
1035
  revision: { type: 'integer', minimum: 1 },
1030
1036
  title: { type: 'string' },
1031
1037
  // The stored decision only; `effectiveStatus` is the derived view.
1032
- status: { type: 'string', enum: BACKLOG_ITEM_STATUS },
1038
+ status: { type: 'string', enum: TRACKER_ITEM_STATUS },
1033
1039
  priority: { type: 'integer', minimum: 0, maximum: 9 },
1034
- type: { type: 'string', enum: BACKLOG_ITEM_TYPES },
1040
+ type: { type: 'string', enum: TRACKER_ITEM_TYPES },
1035
1041
  description: nullable('string'),
1036
1042
  labels: { type: 'array', items: { type: 'string' } },
1037
- history: { type: 'array', items: ref('BacklogHistoryEntry') },
1038
- dependsOn: { type: 'array', items: { type: 'string', pattern: SLUG_PATTERN } },
1043
+ history: { type: 'array', items: ref('TrackerHistoryEntry') },
1044
+ dependsOn: { type: 'array', items: { type: 'integer', minimum: 1 } },
1039
1045
  sourceTask: nullable('string'),
1040
1046
  sourceRefs: { type: 'array', items: { type: 'string' } },
1041
1047
  createdAt: { type: 'string' },
@@ -1043,11 +1049,11 @@ const schemas = {
1043
1049
  completedAt: nullable('string'),
1044
1050
  cancelledAt: nullable('string'),
1045
1051
  cancelReason: nullable('string'),
1046
- supersededBy: nullable('string'),
1047
- effectiveStatus: { type: 'string', enum: BACKLOG_EFFECTIVE_ITEM_STATUS },
1052
+ supersededBy: { type: ['integer', 'null'], minimum: 1 },
1053
+ effectiveStatus: { type: 'string', enum: TRACKER_EFFECTIVE_ITEM_STATUS },
1048
1054
  taskState: nullable('string'),
1049
1055
  ready: { type: 'boolean' },
1050
- waitingOn: { type: 'array', items: { type: 'string', pattern: SLUG_PATTERN } },
1056
+ waitingOn: { type: 'array', items: { type: 'integer', minimum: 1 } },
1051
1057
  queueEntryId: nullable('string'),
1052
1058
  queuedAt: nullable('string'),
1053
1059
  },
@@ -1079,18 +1085,18 @@ const schemas = {
1079
1085
  'queuedAt',
1080
1086
  ],
1081
1087
  ),
1082
- BacklogItemSummary: object(
1088
+ TrackerItemSummary: object(
1083
1089
  {
1084
- id: { type: 'string', pattern: SLUG_PATTERN },
1090
+ id: { type: 'integer', minimum: 1 },
1085
1091
  title: { type: 'string' },
1086
- status: { type: 'string', enum: BACKLOG_ITEM_STATUS },
1087
- effectiveStatus: { type: 'string', enum: BACKLOG_EFFECTIVE_ITEM_STATUS },
1092
+ status: { type: 'string', enum: TRACKER_ITEM_STATUS },
1093
+ effectiveStatus: { type: 'string', enum: TRACKER_EFFECTIVE_ITEM_STATUS },
1088
1094
  priority: { type: 'integer', minimum: 0, maximum: 9 },
1089
- type: { type: 'string', enum: BACKLOG_ITEM_TYPES },
1095
+ type: { type: 'string', enum: TRACKER_ITEM_TYPES },
1090
1096
  description: nullable('string'),
1091
1097
  labels: { type: 'array', items: { type: 'string' } },
1092
- dependsOn: { type: 'array', items: { type: 'string', pattern: SLUG_PATTERN } },
1093
- waitingOn: { type: 'array', items: { type: 'string', pattern: SLUG_PATTERN } },
1098
+ dependsOn: { type: 'array', items: { type: 'integer', minimum: 1 } },
1099
+ waitingOn: { type: 'array', items: { type: 'integer', minimum: 1 } },
1094
1100
  ready: { type: 'boolean' },
1095
1101
  sourceTask: nullable('string'),
1096
1102
  sourceRefs: { type: 'array', items: { type: 'string' } },
@@ -1098,6 +1104,8 @@ const schemas = {
1098
1104
  createdAt: { type: 'string' },
1099
1105
  updatedAt: { type: 'string' },
1100
1106
  queueEntryId: nullable('string'),
1107
+ linkCount: { type: 'integer', minimum: 0 },
1108
+ linkedTasks: { type: 'array', items: { type: 'string' } },
1101
1109
  },
1102
1110
  [
1103
1111
  'id',
@@ -1117,70 +1125,133 @@ const schemas = {
1117
1125
  'createdAt',
1118
1126
  'updatedAt',
1119
1127
  'queueEntryId',
1128
+ 'linkCount',
1129
+ 'linkedTasks',
1120
1130
  ],
1121
1131
  ),
1122
- BacklogItemDetail: object(
1132
+ TrackerTaskRun: object(
1123
1133
  {
1124
- item: ref('BacklogItem'),
1125
- dependencies: { type: 'array', items: ref('BacklogDependency') },
1126
- dependents: { type: 'array', items: ref('BacklogDependency') },
1127
- queue: { type: 'array', items: ref('BacklogQueueEntry') },
1128
- criticalPath: { type: 'array', items: { type: 'string', pattern: SLUG_PATTERN } },
1134
+ runId: { type: 'string', pattern: RUN_ID_PATTERN },
1135
+ state: { type: 'string' },
1136
+ startedAt: nullable('string'),
1137
+ finishedAt: nullable('string'),
1138
+ error: nullable('string'),
1129
1139
  },
1130
- ['item', 'dependencies', 'dependents', 'queue', 'criticalPath'],
1140
+ ['runId', 'state', 'startedAt', 'finishedAt', 'error'],
1131
1141
  ),
1132
- BacklogItemList: object(
1142
+ TrackerTaskLink: object(
1133
1143
  {
1134
- items: { type: 'array', items: ref('BacklogItemSummary') },
1144
+ schemaVersion: { type: 'integer', const: 1 },
1145
+ linkId: { type: 'string', pattern: '^[1-9][0-9]*--[a-z0-9]+(?:-[a-z0-9]+)*$' },
1146
+ itemId: { type: 'integer', minimum: 1 },
1147
+ taskSlug: { type: 'string', pattern: SLUG_PATTERN },
1148
+ entryId: nullable('string'),
1149
+ role: { type: 'string', enum: ['primary', 'follow-up'] },
1150
+ decision: { type: 'string', enum: ['requested', 'stopped', 'unlinked'] },
1151
+ promptPath: nullable('string'),
1152
+ language: nullable('string'),
1153
+ revision: { type: 'integer', minimum: 0 },
1154
+ createdAt: { type: 'string' },
1155
+ updatedAt: { type: 'string' },
1156
+ history: { type: 'array', items: ref('TrackerHistoryEntry') },
1157
+ effectiveState: {
1158
+ type: 'string',
1159
+ enum: ['requested', 'claimed', 'active', 'paused', 'stopped', 'completed', 'failed', 'unlinked'],
1160
+ },
1161
+ taskState: nullable('string'),
1162
+ taskStartAt: nullable('string'),
1163
+ taskEndAt: nullable('string'),
1164
+ entryStatus: nullable('string'),
1165
+ latestRun: { oneOf: [ref('TrackerTaskRun'), { type: 'null' }] },
1166
+ legacy: { type: 'boolean' },
1167
+ },
1168
+ [
1169
+ 'schemaVersion',
1170
+ 'linkId',
1171
+ 'itemId',
1172
+ 'taskSlug',
1173
+ 'entryId',
1174
+ 'role',
1175
+ 'decision',
1176
+ 'promptPath',
1177
+ 'language',
1178
+ 'revision',
1179
+ 'createdAt',
1180
+ 'updatedAt',
1181
+ 'history',
1182
+ 'effectiveState',
1183
+ 'taskState',
1184
+ 'taskStartAt',
1185
+ 'taskEndAt',
1186
+ 'entryStatus',
1187
+ 'latestRun',
1188
+ ],
1189
+ ),
1190
+ TrackerItemDetail: object(
1191
+ {
1192
+ item: ref('TrackerItem'),
1193
+ dependencies: { type: 'array', items: ref('TrackerDependency') },
1194
+ dependents: { type: 'array', items: ref('TrackerDependency') },
1195
+ queue: { type: 'array', items: ref('TrackerQueueEntry') },
1196
+ tasks: { type: 'array', items: ref('TrackerTaskLink') },
1197
+ criticalPath: { type: 'array', items: { type: 'integer', minimum: 1 } },
1198
+ },
1199
+ ['item', 'dependencies', 'dependents', 'queue', 'tasks', 'criticalPath'],
1200
+ ),
1201
+ TrackerItemList: object(
1202
+ {
1203
+ items: { type: 'array', items: ref('TrackerItemSummary') },
1135
1204
  total: { type: 'integer', minimum: 0 },
1136
1205
  limit: { type: 'integer', minimum: 1, maximum: 200 },
1137
1206
  offset: { type: 'integer', minimum: 0 },
1138
1207
  nextOffset: nullable('integer'),
1139
1208
  asOf: { type: 'string' },
1140
1209
  readyCount: { type: 'integer', minimum: 0 },
1141
- criticalPathIds: { type: 'array', items: { type: 'string', pattern: SLUG_PATTERN } },
1210
+ criticalPathIds: { type: 'array', items: { type: 'integer', minimum: 1 } },
1142
1211
  maxActive: { type: 'integer', minimum: 1, maximum: 8 },
1143
1212
  activeCount: { type: 'integer', minimum: 0 },
1144
1213
  },
1145
1214
  ['items', 'total', 'limit', 'offset', 'nextOffset', 'asOf', 'readyCount', 'criticalPathIds', 'maxActive', 'activeCount'],
1146
1215
  ),
1147
- BacklogCreateRequest: object(
1216
+ TrackerCreateRequest: object(
1148
1217
  {
1149
- id: { type: 'string', pattern: SLUG_PATTERN },
1150
1218
  title: { type: 'string' },
1151
- dependsOn: { type: 'array', items: { type: 'string', pattern: SLUG_PATTERN } },
1219
+ status: { type: 'string', enum: TRACKER_ITEM_STATUS },
1220
+ dependsOn: { type: 'array', items: { type: 'integer', minimum: 1 } },
1152
1221
  priority: { type: 'integer', minimum: 0, maximum: 9 },
1153
1222
  sourceTask: { type: 'string', pattern: SLUG_PATTERN },
1154
1223
  sourceRefs: { type: 'array', items: { type: 'string' } },
1155
- type: { type: 'string', enum: BACKLOG_ITEM_TYPES },
1224
+ type: { type: 'string', enum: TRACKER_ITEM_TYPES },
1156
1225
  description: nullable('string'),
1157
1226
  labels: { type: 'array', items: { type: 'string' } },
1158
1227
  },
1159
- ['id', 'title'],
1228
+ ['title'],
1160
1229
  ),
1161
- BacklogUpdateRequest: object(
1230
+ TrackerUpdateRequest: object(
1162
1231
  {
1163
1232
  revision: { type: 'integer', minimum: 1 },
1164
1233
  title: { type: 'string' },
1165
- status: { type: 'string', enum: BACKLOG_ITEM_STATUS },
1234
+ status: { type: 'string', enum: TRACKER_ITEM_STATUS },
1166
1235
  priority: { type: 'integer', minimum: 0, maximum: 9 },
1167
- dependsOn: { type: 'array', items: { type: 'string', pattern: SLUG_PATTERN } },
1236
+ dependsOn: { type: 'array', items: { type: 'integer', minimum: 1 } },
1168
1237
  completedAt: nullable('string'),
1169
1238
  cancelledAt: nullable('string'),
1170
1239
  cancelReason: { type: 'string' },
1171
- supersededBy: { type: 'string', pattern: SLUG_PATTERN },
1172
- type: { type: 'string', enum: BACKLOG_ITEM_TYPES },
1240
+ supersededBy: { type: ['integer', 'null'], minimum: 1 },
1241
+ type: { type: 'string', enum: TRACKER_ITEM_TYPES },
1173
1242
  description: nullable('string'),
1174
1243
  labels: { type: 'array', items: { type: 'string' } },
1175
1244
  },
1176
1245
  ['revision'],
1177
1246
  ),
1178
- BacklogQueueEntry: object(
1247
+ TrackerQueueEntry: object(
1179
1248
  {
1180
1249
  entryId: { type: 'string', pattern: RUN_ID_PATTERN },
1181
- itemId: { type: 'string', pattern: SLUG_PATTERN },
1250
+ itemId: { type: 'integer', minimum: 1 },
1251
+ taskSlug: { type: 'string', pattern: SLUG_PATTERN },
1252
+ linkId: nullable('string'),
1182
1253
  // The derived effective entry status; `active`/`done` are never stored.
1183
- status: { type: 'string', enum: BACKLOG_EFFECTIVE_ENTRY_STATUS },
1254
+ status: { type: 'string', enum: TRACKER_EFFECTIVE_ENTRY_STATUS },
1184
1255
  reason: { type: 'string' },
1185
1256
  requestedBy: { type: 'string' },
1186
1257
  command: nullable('string'),
@@ -1188,7 +1259,7 @@ const schemas = {
1188
1259
  requestedAt: { type: 'string' },
1189
1260
  claimedAt: nullable('string'),
1190
1261
  finishedAt: nullable('string'),
1191
- history: { type: 'array', items: ref('BacklogHistoryEntry') },
1262
+ history: { type: 'array', items: ref('TrackerHistoryEntry') },
1192
1263
  itemTitle: { type: 'string' },
1193
1264
  taskState: nullable('string'),
1194
1265
  taskStartAt: nullable('string'),
@@ -1197,6 +1268,8 @@ const schemas = {
1197
1268
  [
1198
1269
  'entryId',
1199
1270
  'itemId',
1271
+ 'taskSlug',
1272
+ 'linkId',
1200
1273
  'status',
1201
1274
  'reason',
1202
1275
  'requestedBy',
@@ -1212,9 +1285,9 @@ const schemas = {
1212
1285
  'taskEndAt',
1213
1286
  ],
1214
1287
  ),
1215
- BacklogQueueList: object(
1288
+ TrackerQueueList: object(
1216
1289
  {
1217
- items: { type: 'array', items: ref('BacklogQueueEntry') },
1290
+ items: { type: 'array', items: ref('TrackerQueueEntry') },
1218
1291
  total: { type: 'integer', minimum: 0 },
1219
1292
  limit: { type: 'integer', minimum: 1, maximum: 200 },
1220
1293
  offset: { type: 'integer', minimum: 0 },
@@ -1224,15 +1297,41 @@ const schemas = {
1224
1297
  },
1225
1298
  ['items', 'total', 'limit', 'offset', 'nextOffset', 'asOf', 'activeEntryId'],
1226
1299
  ),
1227
- BacklogEnqueueRequest: object(
1300
+ TrackerEnqueueRequest: object(
1228
1301
  {
1229
- itemId: { type: 'string', pattern: SLUG_PATTERN },
1302
+ itemId: { type: 'integer', minimum: 1 },
1303
+ taskSlug: { type: 'string', pattern: SLUG_PATTERN },
1304
+ linkId: { type: 'string', pattern: '^[1-9][0-9]*--[a-z0-9]+(?:-[a-z0-9]+)*$' },
1230
1305
  reason: { type: 'string' },
1231
1306
  requestedBy: { type: 'string' },
1232
1307
  command: { type: 'string' },
1233
1308
  },
1234
1309
  ['itemId', 'reason', 'requestedBy'],
1235
1310
  ),
1311
+ TrackerTaskStartRequest: object(
1312
+ {
1313
+ taskSlug: { type: 'string', pattern: SLUG_PATTERN },
1314
+ prompt: { type: 'string' },
1315
+ language: nullable('string'),
1316
+ role: { type: 'string', enum: ['primary', 'follow-up'] },
1317
+ reason: { type: 'string' },
1318
+ requestedBy: { type: 'string' },
1319
+ },
1320
+ ['taskSlug'],
1321
+ ),
1322
+ TrackerTaskActionRequest: object(
1323
+ {
1324
+ reason: nullable('string'),
1325
+ requestedBy: { type: 'string' },
1326
+ },
1327
+ [],
1328
+ ),
1329
+ TrackerDeleteResult: object(
1330
+ {
1331
+ id: { type: 'integer', minimum: 1 },
1332
+ },
1333
+ ['id'],
1334
+ ),
1236
1335
  };
1237
1336
 
1238
1337
 
@@ -1364,46 +1463,70 @@ const syncRunExample = {
1364
1463
  error: null,
1365
1464
  };
1366
1465
 
1367
- const backlogHistoryExample = { at: '2026-11-12T10:00:00.000Z', type: 'created', actor: 'operator', detail: null };
1466
+ const trackerHistoryExample = { at: '2026-11-12T10:00:00.000Z', type: 'created', actor: 'operator', detail: null };
1368
1467
 
1369
- const backlogQueueEntryExample = {
1468
+ const trackerQueueEntryExample = {
1370
1469
  entryId: '20261112T100000Z-1a2b3c4d',
1371
- itemId: 'ship-backlog-ui',
1470
+ itemId: 1,
1471
+ taskSlug: 'ship-tracker-ui',
1472
+ linkId: '1--ship-tracker-ui',
1372
1473
  status: 'queued',
1373
1474
  reason: 'ready to ship',
1374
1475
  requestedBy: 'operator',
1375
- command: '/task ship-backlog-ui',
1476
+ command: '/task ship-tracker-ui',
1376
1477
  revision: 2,
1377
1478
  requestedAt: '2026-11-12T10:00:00.000Z',
1378
1479
  claimedAt: null,
1379
1480
  finishedAt: null,
1380
1481
  history: [{ at: '2026-11-12T10:00:00.000Z', type: 'enqueued', actor: 'operator', detail: null }],
1381
- itemTitle: 'Ship the backlog operator UI',
1482
+ itemTitle: 'Ship the tracker operator UI',
1483
+ taskState: null,
1484
+ taskStartAt: null,
1485
+ taskEndAt: null,
1486
+ };
1487
+
1488
+ const trackerTaskLinkExample = {
1489
+ schemaVersion: 1,
1490
+ linkId: '1--ship-tracker-ui',
1491
+ itemId: 1,
1492
+ taskSlug: 'ship-tracker-ui',
1493
+ entryId: '20261112T100000Z-1a2b3c4d',
1494
+ role: 'primary',
1495
+ decision: 'requested',
1496
+ promptPath: 'tracker/links/1--ship-tracker-ui.md',
1497
+ language: 'ru',
1498
+ revision: 1,
1499
+ createdAt: '2026-11-12T09:59:00.000Z',
1500
+ updatedAt: '2026-11-12T10:00:00.000Z',
1501
+ history: [{ at: '2026-11-12T09:59:00.000Z', type: 'created', actor: 'operator', detail: null }],
1502
+ effectiveState: 'requested',
1382
1503
  taskState: null,
1383
1504
  taskStartAt: null,
1384
1505
  taskEndAt: null,
1506
+ entryStatus: 'queued',
1507
+ latestRun: null,
1385
1508
  };
1386
1509
 
1387
- const backlogDependencyExample = {
1388
- id: 'backlog-engine',
1389
- title: 'The file-authoritative backlog engine',
1510
+ const trackerDependencyExample = {
1511
+ id: 2,
1512
+ title: 'The file-authoritative tracker engine',
1390
1513
  status: 'completed',
1391
1514
  satisfied: true,
1392
1515
  };
1393
1516
 
1394
- const backlogItemExample = {
1517
+ const trackerItemExample = {
1395
1518
  schemaVersion: 1,
1396
- id: 'ship-backlog-ui',
1519
+ id: 1,
1397
1520
  revision: 3,
1398
- title: 'Ship the backlog operator UI',
1521
+ title: 'Ship the tracker operator UI',
1399
1522
  status: 'planned',
1400
1523
  priority: 2,
1401
1524
  type: 'feature',
1402
- description: 'The /backlog list and the /backlog/[id] detail over the existing proxy.',
1403
- labels: ['backlog', 'ui'],
1404
- history: [backlogHistoryExample],
1405
- dependsOn: ['backlog-engine'],
1406
- sourceTask: 'task-backlog-tracker-impl',
1525
+ description: 'The /tracker list and the /tracker/[id] detail over the existing proxy.',
1526
+ labels: ['tracker', 'ui'],
1527
+ history: [trackerHistoryExample],
1528
+ dependsOn: [2],
1529
+ sourceTask: 'task-tracker-tracker-impl',
1407
1530
  sourceRefs: ['AC-5', 'WP7'],
1408
1531
  createdAt: '2026-11-10T09:00:00.000Z',
1409
1532
  updatedAt: '2026-11-12T10:00:00.000Z',
@@ -1419,52 +1542,53 @@ const backlogItemExample = {
1419
1542
  queuedAt: '2026-11-12T10:00:00.000Z',
1420
1543
  };
1421
1544
 
1422
- const backlogItemSummaryExample = {
1423
- id: 'ship-backlog-ui',
1424
- title: 'Ship the backlog operator UI',
1545
+ const trackerItemSummaryExample = {
1546
+ id: 1,
1547
+ title: 'Ship the tracker operator UI',
1425
1548
  status: 'planned',
1426
1549
  effectiveStatus: 'queued',
1427
1550
  priority: 2,
1428
1551
  type: 'feature',
1429
- description: 'The /backlog list and the /backlog/[id] detail over the existing proxy.',
1430
- labels: ['backlog', 'ui'],
1431
- dependsOn: ['backlog-engine'],
1552
+ description: 'The /tracker list and the /tracker/[id] detail over the existing proxy.',
1553
+ labels: ['tracker', 'ui'],
1554
+ dependsOn: [2],
1432
1555
  waitingOn: [],
1433
1556
  ready: true,
1434
- sourceTask: 'task-backlog-tracker-impl',
1557
+ sourceTask: 'task-tracker-tracker-impl',
1435
1558
  sourceRefs: ['AC-5', 'WP7'],
1436
1559
  taskState: null,
1437
1560
  createdAt: '2026-11-10T09:00:00.000Z',
1438
1561
  updatedAt: '2026-11-12T10:00:00.000Z',
1439
1562
  queueEntryId: '20261112T100000Z-1a2b3c4d',
1563
+ linkCount: 1,
1564
+ linkedTasks: ['ship-tracker-ui'],
1440
1565
  };
1441
1566
 
1442
- const backlogCreateRequestExample = {
1443
- id: 'ship-backlog-ui',
1444
- title: 'Ship the backlog operator UI',
1445
- dependsOn: ['backlog-engine'],
1567
+ const trackerCreateRequestExample = {
1568
+ title: 'Ship the tracker operator UI',
1569
+ dependsOn: [2],
1446
1570
  priority: 2,
1447
- sourceTask: 'task-backlog-tracker-impl',
1571
+ sourceTask: 'task-tracker-tracker-impl',
1448
1572
  sourceRefs: ['AC-5', 'WP7'],
1449
1573
  type: 'feature',
1450
- description: 'The /backlog list and the /backlog/[id] detail over the existing proxy.',
1451
- labels: ['backlog', 'ui'],
1574
+ description: 'The /tracker list and the /tracker/[id] detail over the existing proxy.',
1575
+ labels: ['tracker', 'ui'],
1452
1576
  };
1453
1577
 
1454
- const backlogUpdateRequestExample = {
1578
+ const trackerUpdateRequestExample = {
1455
1579
  revision: 3,
1456
- title: 'Ship the backlog operator UI',
1580
+ title: 'Ship the tracker operator UI',
1457
1581
  priority: 1,
1458
1582
  type: 'feature',
1459
- description: 'The /backlog list and the /backlog/[id] detail over the existing proxy.',
1460
- labels: ['backlog', 'ui'],
1583
+ description: 'The /tracker list and the /tracker/[id] detail over the existing proxy.',
1584
+ labels: ['tracker', 'ui'],
1461
1585
  };
1462
1586
 
1463
- const backlogEnqueueRequestExample = {
1464
- itemId: 'ship-backlog-ui',
1587
+ const trackerEnqueueRequestExample = {
1588
+ itemId: 1,
1465
1589
  reason: 'ready to ship',
1466
1590
  requestedBy: 'operator',
1467
- command: '/task ship-backlog-ui',
1591
+ command: '/task ship-tracker-ui',
1468
1592
  };
1469
1593
 
1470
1594
  const EXAMPLES = {
@@ -1581,10 +1705,11 @@ const EXAMPLES = {
1581
1705
  Health: [
1582
1706
  {
1583
1707
  status: 'ok',
1708
+ rootId: 'a1b2c3d4e5f6',
1584
1709
  db: { file: 'team.db', present: true, schemaVersion: 1, fingerprintOk: true, search: 'fts5' },
1585
1710
  tasks: { total: 90, absent: 0 },
1586
1711
  projectedAt: '2026-11-06T08:00:04.000Z',
1587
- capabilities: ['sync', 'delete', 'jobs', 'schedule', 'backlog'],
1712
+ capabilities: ['sync', 'delete', 'jobs', 'schedule', 'tracker'],
1588
1713
  scheduler: {
1589
1714
  state: 'running',
1590
1715
  pid: 41231,
@@ -1594,6 +1719,21 @@ const EXAMPLES = {
1594
1719
  jobsDue: 1,
1595
1720
  },
1596
1721
  },
1722
+ {
1723
+ status: 'ok',
1724
+ db: { file: 'team.db', present: true, schemaVersion: 1, fingerprintOk: true, search: 'fts5' },
1725
+ tasks: { total: 0, absent: 0 },
1726
+ projectedAt: null,
1727
+ capabilities: ['sync', 'delete', 'jobs', 'schedule', 'tracker'],
1728
+ scheduler: {
1729
+ state: 'stopped',
1730
+ pid: null,
1731
+ startedAt: null,
1732
+ heartbeatAt: null,
1733
+ nextTickAt: null,
1734
+ jobsDue: 0,
1735
+ },
1736
+ },
1597
1737
  ],
1598
1738
  JobSchedule: [{ kind: 'cron', expression: '0 3 * * *', timezone: 'Europe/Berlin' }],
1599
1739
  JobPayload: [{ kind: 'command', argv: ['node', '.ai.local/scripts/run.mjs', '--nightly'] }],
@@ -1795,39 +1935,40 @@ const EXAMPLES = {
1795
1935
  ],
1796
1936
  JobDeleteResult: [{ ok: true, id: 'nightly-retro', runsRemoved: 12 }],
1797
1937
  JobRunRequest: [{ requested: true, requestedAt: '2026-11-10T12:00:00.000Z', schedulerOnline: true }],
1798
- BacklogDependency: [backlogDependencyExample],
1799
- BacklogHistoryEntry: [backlogHistoryExample],
1800
- BacklogItem: [backlogItemExample],
1801
- BacklogItemSummary: [backlogItemSummaryExample],
1802
- BacklogItemDetail: [
1803
- {
1804
- item: backlogItemExample,
1805
- dependencies: [backlogDependencyExample],
1938
+ TrackerDependency: [trackerDependencyExample],
1939
+ TrackerHistoryEntry: [trackerHistoryExample],
1940
+ TrackerItem: [trackerItemExample],
1941
+ TrackerItemSummary: [trackerItemSummaryExample],
1942
+ TrackerItemDetail: [
1943
+ {
1944
+ item: trackerItemExample,
1945
+ dependencies: [trackerDependencyExample],
1806
1946
  dependents: [],
1807
- queue: [backlogQueueEntryExample],
1808
- criticalPath: ['ship-backlog-ui'],
1947
+ queue: [trackerQueueEntryExample],
1948
+ tasks: [trackerTaskLinkExample],
1949
+ criticalPath: [2, 1],
1809
1950
  },
1810
1951
  ],
1811
- BacklogItemList: [
1952
+ TrackerItemList: [
1812
1953
  {
1813
- items: [backlogItemSummaryExample],
1954
+ items: [trackerItemSummaryExample],
1814
1955
  total: 3,
1815
1956
  limit: 50,
1816
1957
  offset: 0,
1817
1958
  nextOffset: null,
1818
1959
  asOf: '2026-11-12T10:00:00.000Z',
1819
1960
  readyCount: 1,
1820
- criticalPathIds: ['ship-backlog-ui'],
1961
+ criticalPathIds: [2, 1],
1821
1962
  maxActive: 1,
1822
1963
  activeCount: 0,
1823
1964
  },
1824
1965
  ],
1825
- BacklogCreateRequest: [backlogCreateRequestExample],
1826
- BacklogUpdateRequest: [backlogUpdateRequestExample],
1827
- BacklogQueueEntry: [backlogQueueEntryExample],
1828
- BacklogQueueList: [
1966
+ TrackerCreateRequest: [trackerCreateRequestExample],
1967
+ TrackerUpdateRequest: [trackerUpdateRequestExample],
1968
+ TrackerQueueEntry: [trackerQueueEntryExample],
1969
+ TrackerQueueList: [
1829
1970
  {
1830
- items: [backlogQueueEntryExample],
1971
+ items: [trackerQueueEntryExample],
1831
1972
  total: 1,
1832
1973
  limit: 50,
1833
1974
  offset: 0,
@@ -1836,7 +1977,7 @@ const EXAMPLES = {
1836
1977
  activeEntryId: null,
1837
1978
  },
1838
1979
  ],
1839
- BacklogEnqueueRequest: [backlogEnqueueRequestExample],
1980
+ TrackerEnqueueRequest: [trackerEnqueueRequestExample],
1840
1981
  Meta: [
1841
1982
  {
1842
1983
  apiVersion: API_VERSION,
@@ -1982,15 +2123,23 @@ const jobWriteBody = {
1982
2123
  content: { 'application/json': { schema: ref('JobWrite') } },
1983
2124
  };
1984
2125
 
1985
- const backlogIdParameter = {
2126
+ const trackerIdParameter = {
1986
2127
  name: 'id',
1987
2128
  in: 'path',
1988
2129
  required: true,
1989
- description: 'Backlog item id: the item key and the `/task` slug it launches under.',
2130
+ description: 'Tracker item id: the immutable positive integer key; linked team tasks carry their own slugs.',
2131
+ schema: { type: 'integer', minimum: 1 },
2132
+ };
2133
+
2134
+ const trackerTaskSlugParameter = {
2135
+ name: 'taskSlug',
2136
+ in: 'path',
2137
+ required: true,
2138
+ description: 'Team-task slug linked to this tracker item.',
1990
2139
  schema: { type: 'string', pattern: SLUG_PATTERN },
1991
2140
  };
1992
2141
 
1993
- const backlogEntryIdParameter = {
2142
+ const trackerEntryIdParameter = {
1994
2143
  name: 'entryId',
1995
2144
  in: 'path',
1996
2145
  required: true,
@@ -1998,45 +2147,57 @@ const backlogEntryIdParameter = {
1998
2147
  schema: { type: 'string', pattern: RUN_ID_PATTERN },
1999
2148
  };
2000
2149
 
2001
- const backlogListStatusParameter = {
2150
+ const trackerListStatusParameter = {
2002
2151
  name: 'status',
2003
2152
  in: 'query',
2004
- description: csvParameterDescription('effective item statuses (any subset)', BACKLOG_EFFECTIVE_ITEM_STATUS),
2153
+ description: csvParameterDescription('effective item statuses (any subset)', TRACKER_EFFECTIVE_ITEM_STATUS),
2005
2154
  required: false,
2006
2155
  schema: { type: 'string' },
2007
2156
  };
2008
2157
 
2009
- const backlogQueueStatusParameter = {
2158
+ const trackerQueueStatusParameter = {
2010
2159
  name: 'status',
2011
2160
  in: 'query',
2012
- description: csvParameterDescription('effective entry statuses (any subset)', BACKLOG_EFFECTIVE_ENTRY_STATUS),
2161
+ description: csvParameterDescription('effective entry statuses (any subset)', TRACKER_EFFECTIVE_ENTRY_STATUS),
2013
2162
  required: false,
2014
2163
  schema: { type: 'string' },
2015
2164
  };
2016
2165
 
2017
- const BACKLOG_LIST_PARAMETERS = [
2018
- backlogListStatusParameter,
2166
+ const TRACKER_LIST_PARAMETERS = [
2167
+ trackerListStatusParameter,
2019
2168
  { name: 'ready', in: 'query', description: 'Narrow to launchable items.', required: false, schema: { type: 'boolean' } },
2020
2169
  { name: 'sourceTask', in: 'query', required: false, schema: { type: 'string', pattern: SLUG_PATTERN } },
2021
2170
  ...paginationParameters,
2022
2171
  ];
2023
2172
 
2024
- const BACKLOG_QUEUE_LIST_PARAMETERS = [
2025
- backlogQueueStatusParameter,
2026
- { name: 'itemId', in: 'query', required: false, schema: { type: 'string', pattern: SLUG_PATTERN } },
2173
+ const TRACKER_QUEUE_LIST_PARAMETERS = [
2174
+ trackerQueueStatusParameter,
2175
+ { name: 'itemId', in: 'query', required: false, schema: { type: 'integer', minimum: 1 } },
2027
2176
  ...paginationParameters,
2028
2177
  ];
2029
2178
 
2030
- const backlogItemWriteBody = (schemaName) => ({
2179
+ const trackerItemWriteBody = (schemaName) => ({
2031
2180
  required: true,
2032
2181
  description: `One item payload as \`application/json\`, at most 16 KiB.`,
2033
2182
  content: { 'application/json': { schema: ref(schemaName) } },
2034
2183
  });
2035
2184
 
2036
- const backlogEnqueueBody = {
2185
+ const trackerEnqueueBody = {
2037
2186
  required: true,
2038
2187
  description: 'One enqueue payload as `application/json`, at most 1 KiB.',
2039
- content: { 'application/json': { schema: ref('BacklogEnqueueRequest') } },
2188
+ content: { 'application/json': { schema: ref('TrackerEnqueueRequest') } },
2189
+ };
2190
+
2191
+ const trackerTaskStartBody = {
2192
+ required: true,
2193
+ description: 'One task-start payload as `application/json`, at most 64 KiB (the prompt is the largest field).',
2194
+ content: { 'application/json': { schema: ref('TrackerTaskStartRequest') } },
2195
+ };
2196
+
2197
+ const trackerTaskActionBody = {
2198
+ required: false,
2199
+ description: 'An optional action body as `application/json`, at most 1 KiB.',
2200
+ content: { 'application/json': { schema: ref('TrackerTaskActionRequest') } },
2040
2201
  };
2041
2202
 
2042
2203
  const emptyBody = {
@@ -2178,9 +2339,9 @@ export const OPENAPI_DOCUMENT = {
2178
2339
  info: {
2179
2340
  title: 'Agent team SQLite projection API',
2180
2341
  summary:
2181
- 'Projection of `.ai.local/team`. Task files, job definitions, run manifests and the backlog store are authoritative; the database is a rebuildable copy. Ten mutations exist — the idempotent rescan, the confirmed task delete, the four job writes, and the four backlog writes — and every one runs as a bounded child process.',
2342
+ 'Projection of `.ai.local/team`. Task files, job definitions, run manifests and the tracker store are authoritative; the database is a rebuildable copy. Fourteen mutations exist — the idempotent rescan, the confirmed task delete, the four job writes, and the eight tracker writes — and every one runs as a bounded child process.',
2182
2343
  description:
2183
- 'Loopback-only operator API. No authentication by design, no CORS, no outbound request. Errors use one `{error:{code,message,details?}}` envelope. Every non-GET/HEAD request to a read-only path returns 405 `E_METHOD_NOT_ALLOWED` with `Allow: GET, HEAD`; `GET` and `HEAD` on `/api/v1/sync` return 405 with `Allow: POST`; any other method on `/api/v1/tasks/{slug}` returns 405 with `Allow: GET, HEAD, DELETE`. The backlog paths advertise `GET, HEAD, POST` (`/api/v1/backlog`, `/api/v1/backlog/queue`), `GET, HEAD, PUT` (`/api/v1/backlog/{id}`) and `POST` (`/api/v1/backlog/queue/{entryId}/cancel`).',
2344
+ 'Loopback-only operator API. No authentication by design, no CORS, no outbound request. Errors use one `{error:{code,message,details?}}` envelope. Every non-GET/HEAD request to a read-only path returns 405 `E_METHOD_NOT_ALLOWED` with `Allow: GET, HEAD`; `GET` and `HEAD` on `/api/v1/sync` return 405 with `Allow: POST`; any other method on `/api/v1/tasks/{slug}` returns 405 with `Allow: GET, HEAD, DELETE`. The tracker paths advertise `GET, HEAD, POST` (`/api/v1/tracker`, `/api/v1/tracker/queue`), `GET, HEAD, PUT, DELETE` (`/api/v1/tracker/{id}`), `POST` (`/api/v1/tracker/queue/{entryId}/cancel`, `/api/v1/tracker/{id}/tasks`, `/api/v1/tracker/{id}/tasks/{taskSlug}/stop|continue`).',
2184
2345
  version: API_VERSION,
2185
2346
  'x-api-major': API_MAJOR,
2186
2347
  },
@@ -2201,7 +2362,7 @@ export const OPENAPI_DOCUMENT = {
2201
2362
  { name: 'stats', description: 'Aggregate counts and durations' },
2202
2363
  { name: 'sync', description: 'Projection runs and the one idempotent rescan' },
2203
2364
  { name: 'jobs', description: 'Scheduled jobs, their runs and their logs' },
2204
- { name: 'backlog', description: 'The file-authoritative task backlog: items, ordering and the launch queue' },
2365
+ { name: 'tracker', description: 'The file-authoritative task tracker: items, ordering and the launch queue' },
2205
2366
  ],
2206
2367
  paths: {
2207
2368
  '/': {
@@ -2506,57 +2667,56 @@ export const OPENAPI_DOCUMENT = {
2506
2667
  },
2507
2668
  }),
2508
2669
  },
2509
- '/api/v1/backlog': {
2670
+ '/api/v1/tracker': {
2510
2671
  get: listOperation(
2511
- ['backlog'],
2512
- 'List backlog items in the canonical total order',
2513
- 'listBacklogItems',
2514
- 'BacklogItemList',
2515
- BACKLOG_LIST_PARAMETERS,
2672
+ ['tracker'],
2673
+ 'List tracker items in the canonical total order',
2674
+ 'listTrackerItems',
2675
+ 'TrackerItemList',
2676
+ TRACKER_LIST_PARAMETERS,
2516
2677
  {},
2517
2678
  'The canonical order is `priority ASC → createdAt ASC → id ASC`; there is deliberately no `sort` parameter, so the UI and the drain can never disagree. `status` matches the derived effective status, not the four-value stored decision — which stays visible per item as `status` in the payload. `ready` narrows to launchable items.',
2518
2679
  ),
2519
2680
  post: operation({
2520
- tags: ['backlog'],
2521
- summary: 'Create one backlog item',
2681
+ tags: ['tracker'],
2682
+ summary: 'Create one tracker item',
2522
2683
  description:
2523
- 'The body is the file-authoritative item (`backlog/items/<id>.json`); the server never writes it directly. Not idempotent: a repeated `POST` for an existing id is 409 `E_CONFLICT`. A refusal carries `details.code` with the CLI code (`E_SCHEMA`/`E_BACKLOG_UNKNOWN_DEP`/`E_BACKLOG_CYCLE`/`E_ID_COLLISION`). Executed as a bounded child (10 s, `SIGKILL`); `AI_RULES_TEAM_DB_DISABLE=1` answers 503 `E_DISABLED` before the child.',
2524
- operationId: 'createBacklogItem',
2684
+ 'The body is the file-authoritative item (`tracker/items/<id>.json`); the server never writes it directly. The store assigns the next positive integer id from `tracker/sequence.json`; the body carries no id. A refusal carries `details.code` with the CLI code (`E_SCHEMA`/`E_TRACKER_UNKNOWN_DEP`/`E_TRACKER_CYCLE`). Executed as a bounded child (10 s, `SIGKILL`) that projects the tracker store before returning; `AI_RULES_TEAM_DB_DISABLE=1` answers 503 `E_DISABLED` before the child.',
2685
+ operationId: 'createTrackerItem',
2525
2686
  parameters: [],
2526
- requestBody: backlogItemWriteBody('BacklogCreateRequest'),
2687
+ requestBody: trackerItemWriteBody('TrackerCreateRequest'),
2527
2688
  responses: {
2528
- 201: jsonResponse('BacklogItemDetail', 'The stored item with its dependency and queue context'),
2689
+ 201: jsonResponse('TrackerItemDetail', 'The stored item with its dependency and queue context'),
2529
2690
  400: errorResponse('Malformed request'),
2530
2691
  403: errorResponse('A non-loopback Host or Origin was rejected before routing'),
2531
2692
  405: methodNotAllowedResponse,
2532
- 409: errorResponse('The id already names an item'),
2533
2693
  413: errorResponse('The body exceeds the 16 KiB JSON bound'),
2534
2694
  422: errorResponse('A field is outside its documented bound or the media type is not JSON; `details.code` carries the CLI refusal'),
2535
2695
  503: errorResponse('The projection is disabled, the database is missing, unusable, busy, or the child exceeded its time bound'),
2536
2696
  },
2537
2697
  }),
2538
2698
  },
2539
- '/api/v1/backlog/queue': {
2699
+ '/api/v1/tracker/queue': {
2540
2700
  get: listOperation(
2541
- ['backlog'],
2701
+ ['tracker'],
2542
2702
  'List launch-queue entries',
2543
- 'listBacklogQueue',
2544
- 'BacklogQueueList',
2545
- BACKLOG_QUEUE_LIST_PARAMETERS,
2703
+ 'listTrackerQueue',
2704
+ 'TrackerQueueList',
2705
+ TRACKER_QUEUE_LIST_PARAMETERS,
2546
2706
  {},
2547
2707
  '`status` matches the derived effective entry status (`active` and `done` are computed from the task row, never stored); `itemId` narrows to one item.',
2548
2708
  ),
2549
2709
  post: operation({
2550
- tags: ['backlog'],
2551
- summary: 'Enqueue one backlog item',
2710
+ tags: ['tracker'],
2711
+ summary: 'Enqueue one tracker item',
2552
2712
  description:
2553
2713
  'Idempotent per item: a non-terminal entry already exists → 200 with that entry and the new reason appended to its history (R3-5); otherwise a new entry is written → 201. A blocked item is still enqueueable — a blocked launch request is legal. A terminal item is 409 `E_CONFLICT`. Executed as a bounded child (10 s, `SIGKILL`) behind the `E_DISABLED` guard.',
2554
- operationId: 'enqueueBacklogItem',
2714
+ operationId: 'enqueueTrackerItem',
2555
2715
  parameters: [],
2556
- requestBody: backlogEnqueueBody,
2716
+ requestBody: trackerEnqueueBody,
2557
2717
  responses: {
2558
- 200: jsonResponse('BacklogQueueEntry', 'The existing entry, unchanged apart from the appended history event'),
2559
- 201: jsonResponse('BacklogQueueEntry', 'The newly written entry'),
2718
+ 200: jsonResponse('TrackerQueueEntry', 'The existing entry, unchanged apart from the appended history event'),
2719
+ 201: jsonResponse('TrackerQueueEntry', 'The newly written entry'),
2560
2720
  400: errorResponse('Malformed request'),
2561
2721
  403: errorResponse('A non-loopback Host or Origin was rejected before routing'),
2562
2722
  404: errorResponse('The item does not exist'),
@@ -2568,21 +2728,21 @@ export const OPENAPI_DOCUMENT = {
2568
2728
  },
2569
2729
  }),
2570
2730
  },
2571
- '/api/v1/backlog/queue/{entryId}/cancel': {
2731
+ '/api/v1/tracker/queue/{entryId}/cancel': {
2572
2732
  post: operation({
2573
- tags: ['backlog'],
2733
+ tags: ['tracker'],
2574
2734
  summary: 'Cancel one launch-queue entry',
2575
2735
  description:
2576
2736
  'Idempotent for any non-`active` entry: an already cancelled or done entry answers 200 unchanged. The `active` entry belongs to the hook and is refused with 409 `E_CONFLICT`. An absent or empty body is accepted; any other body is 422 `E_VALIDATION`. Executed as a bounded child (10 s, `SIGKILL`) behind the `E_DISABLED` guard.',
2577
- operationId: 'cancelBacklogQueueEntry',
2578
- parameters: [backlogEntryIdParameter],
2737
+ operationId: 'cancelTrackerQueueEntry',
2738
+ parameters: [trackerEntryIdParameter],
2579
2739
  requestBody: {
2580
2740
  required: false,
2581
2741
  description: 'Absent or empty; a non-empty body is rejected with 422.',
2582
2742
  content: { 'application/json': { schema: object({}, []) } },
2583
2743
  },
2584
2744
  responses: {
2585
- 200: jsonResponse('BacklogQueueEntry', 'The entry at its terminal state'),
2745
+ 200: jsonResponse('TrackerQueueEntry', 'The entry at its terminal state'),
2586
2746
  400: errorResponse('Malformed request'),
2587
2747
  403: errorResponse('A non-loopback Host or Origin was rejected before routing'),
2588
2748
  404: errorResponse('The entry does not exist'),
@@ -2594,18 +2754,18 @@ export const OPENAPI_DOCUMENT = {
2594
2754
  },
2595
2755
  }),
2596
2756
  },
2597
- '/api/v1/backlog/{id}': {
2598
- get: taskScopedOperation(['backlog'], 'One backlog item with its dependency and queue context', 'getBacklogItem', 'BacklogItemDetail', [backlogIdParameter]),
2757
+ '/api/v1/tracker/{id}': {
2758
+ get: taskScopedOperation(['tracker'], 'One tracker item with its dependency and queue context', 'getTrackerItem', 'TrackerItemDetail', [trackerIdParameter]),
2599
2759
  put: operation({
2600
- tags: ['backlog'],
2601
- summary: 'Update one backlog item (optimistic on `revision`)',
2760
+ tags: ['tracker'],
2761
+ summary: 'Update one tracker item (optimistic on `revision`)',
2602
2762
  description:
2603
2763
  'Optimistic concurrency: `revision` is required and must equal the stored revision; a missing or stale `revision` is 409 `E_CONFLICT` and the file is untouched. The body `id`, when present, must equal the path id. A terminal transition, a stale revision or a live queue entry is 409; the item is 404 when it does not exist. Executed as a bounded child (10 s, `SIGKILL`) behind the `E_DISABLED` guard.',
2604
- operationId: 'updateBacklogItem',
2605
- parameters: [backlogIdParameter],
2606
- requestBody: backlogItemWriteBody('BacklogUpdateRequest'),
2764
+ operationId: 'updateTrackerItem',
2765
+ parameters: [trackerIdParameter],
2766
+ requestBody: trackerItemWriteBody('TrackerUpdateRequest'),
2607
2767
  responses: {
2608
- 200: jsonResponse('BacklogItemDetail', 'The stored item at its incremented revision'),
2768
+ 200: jsonResponse('TrackerItemDetail', 'The stored item at its incremented revision'),
2609
2769
  400: errorResponse('Malformed request: an invalid item id'),
2610
2770
  403: errorResponse('A non-loopback Host or Origin was rejected before routing'),
2611
2771
  404: errorResponse('The item does not exist'),
@@ -2616,6 +2776,86 @@ export const OPENAPI_DOCUMENT = {
2616
2776
  503: errorResponse('The projection is disabled, the database is missing, unusable, busy, or the child exceeded its time bound'),
2617
2777
  },
2618
2778
  }),
2779
+ delete: operation({
2780
+ tags: ['tracker'],
2781
+ summary: 'Hard delete one tracker item with its links and prompts',
2782
+ description:
2783
+ 'Removes `tracker/items/<id>.json`, every `tracker/links/<linkId>.json` and its prompt, and terminal queue entries for the item. Team tasks are never removed. Refused with 409 while a linked task is active or a queue entry is non-terminal. Executed as a bounded child (30 s, `SIGKILL`) behind the `E_DISABLED` guard.',
2784
+ operationId: 'deleteTrackerItem',
2785
+ parameters: [trackerIdParameter],
2786
+ responses: {
2787
+ 200: jsonResponse('TrackerDeleteResult', 'The deleted item id'),
2788
+ 400: errorResponse('Malformed request: an invalid item id'),
2789
+ 403: errorResponse('A non-loopback Host or Origin was rejected before routing'),
2790
+ 404: errorResponse('The item does not exist'),
2791
+ 405: methodNotAllowedResponse,
2792
+ 409: errorResponse('A linked task is active or a queue entry is non-terminal; `details.code` names the refusal'),
2793
+ 413: errorResponse('The body exceeds the declared bound'),
2794
+ 503: errorResponse('The projection is disabled, the database is missing, unusable, busy, or the child exceeded its time bound'),
2795
+ },
2796
+ }),
2797
+ },
2798
+ '/api/v1/tracker/{id}/tasks': {
2799
+ post: operation({
2800
+ tags: ['tracker'],
2801
+ summary: 'Start a new team task linked to one tracker item',
2802
+ description:
2803
+ 'Writes one `tracker/links/<itemId>--<taskSlug>.json` plus its prompt and enqueues a launch request. The item id and the task slug are independent: the same item may accumulate several linked tasks. The hook drain bootstraps `tasks/<taskSlug>/`; this route never starts an agent. Executed as two bounded children (10 s each, `SIGKILL`); the link is removed if the enqueue fails.',
2804
+ operationId: 'startTrackerTask',
2805
+ parameters: [trackerIdParameter],
2806
+ requestBody: trackerTaskStartBody,
2807
+ responses: {
2808
+ 201: jsonResponse('TrackerItemDetail', 'The item with the new link and queue request'),
2809
+ 400: errorResponse('Malformed request: an invalid item id or task slug'),
2810
+ 403: errorResponse('A non-loopback Host or Origin was rejected before routing'),
2811
+ 404: errorResponse('The item does not exist'),
2812
+ 405: methodNotAllowedResponse,
2813
+ 409: errorResponse('The link already exists or the item is terminal'),
2814
+ 413: errorResponse('The body exceeds the 64 KiB JSON bound'),
2815
+ 422: errorResponse('A field is outside its documented bound or the media type is not JSON'),
2816
+ 503: errorResponse('The projection is disabled, the database is missing, unusable, busy, or a child exceeded its time bound'),
2817
+ },
2818
+ }),
2819
+ },
2820
+ '/api/v1/tracker/{id}/tasks/{taskSlug}/stop': {
2821
+ post: operation({
2822
+ tags: ['tracker'],
2823
+ summary: 'Stop a linked task and request a pause',
2824
+ description:
2825
+ 'Cancels a queued or claimed entry, writes the per-task `STOP` sentinel so the chain hook pauses at its next stop, and terminates the opt-in runner process group when one is active. Never writes `status.json`. Executed as bounded children (10 s).',
2826
+ operationId: 'stopTrackerTask',
2827
+ parameters: [trackerIdParameter, trackerTaskSlugParameter],
2828
+ requestBody: trackerTaskActionBody,
2829
+ responses: {
2830
+ 200: jsonResponse('TrackerItemDetail', 'The item after the stop request'),
2831
+ 400: errorResponse('Malformed request: an invalid item id or task slug'),
2832
+ 403: errorResponse('A non-loopback Host or Origin was rejected before routing'),
2833
+ 404: errorResponse('The item or the link does not exist'),
2834
+ 405: methodNotAllowedResponse,
2835
+ 409: errorResponse('The link cannot be stopped in its current state'),
2836
+ 503: errorResponse('The projection is disabled, the database is missing, unusable, busy, or a child exceeded its time bound'),
2837
+ },
2838
+ }),
2839
+ },
2840
+ '/api/v1/tracker/{id}/tasks/{taskSlug}/continue': {
2841
+ post: operation({
2842
+ tags: ['tracker'],
2843
+ summary: 'Continue a linked task through the opt-in runner',
2844
+ description:
2845
+ 'Clears the per-task `STOP` sentinel and starts `team/runner.json` with a generated `/task-continue <taskSlug>` prompt. The runner is supervised: argv only, no shell, cwd confined to the repository, env allow-list, timeout and process-group kill. Without `team/runner.json` the route answers 409 `E_RUNNER_OFFLINE` and changes nothing.',
2846
+ operationId: 'continueTrackerTask',
2847
+ parameters: [trackerIdParameter, trackerTaskSlugParameter],
2848
+ requestBody: trackerTaskActionBody,
2849
+ responses: {
2850
+ 202: jsonResponse('TrackerItemDetail', 'The item after the runner was started'),
2851
+ 400: errorResponse('Malformed request: an invalid item id or task slug'),
2852
+ 403: errorResponse('A non-loopback Host or Origin was rejected before routing'),
2853
+ 404: errorResponse('The item or the link does not exist'),
2854
+ 405: methodNotAllowedResponse,
2855
+ 409: errorResponse('The task is not bootstrapped, the runner is not configured, or another run is active'),
2856
+ 503: errorResponse('The projection is disabled, the database is missing, unusable, busy, or a child exceeded its time bound'),
2857
+ },
2858
+ }),
2619
2859
  },
2620
2860
  '/api/v1/stats': {
2621
2861
  get: listOperation(['stats'], 'Aggregate counts and durations', 'getStats', 'Stats', [