@bonesofspring/ai-rules 0.2.55 → 0.2.57

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 (439) hide show
  1. package/CHANGELOG.md +80 -0
  2. package/README.md +27 -0
  3. package/docs/PRESET-CONTRIBUTION.md +13 -1
  4. package/docs/TEAM-DB.md +82 -13
  5. package/docs/openapi/team-db.v1.json +139 -4
  6. package/package.json +2 -1
  7. package/presets/_shared/ai-local/scripts/rule-improver.mjs +333 -26
  8. package/presets/_shared/ai-local/scripts/run.mjs +21 -6
  9. package/presets/_shared/ai-local/scripts/team-db-api.mjs +71 -4
  10. package/presets/_shared/ai-local/scripts/team-db-openapi.mjs +35 -4
  11. package/presets/_shared/ai-local/scripts/team-db-project.mjs +143 -2
  12. package/presets/_shared/ai-local/scripts/team-db-schema.mjs +79 -9
  13. package/presets/_shared/ai-local/scripts/team-db.mjs +50 -6
  14. package/presets/_shared/core/agent-team/agent-team-orchestrator.md +17 -6
  15. package/presets/_shared/core/quality/self-review-and-context-hygiene.md +3 -1
  16. package/presets/_shared/hooks/chain-team-phases.sh.tmpl +20 -15
  17. package/presets/claude/android-kotlin/agents/build-verifier.md +1 -1
  18. package/presets/claude/android-kotlin/agents/code-reviewer.md +1 -1
  19. package/presets/claude/android-kotlin/agents/debugger.md +1 -1
  20. package/presets/claude/android-kotlin/agents/feature-developer.md +1 -1
  21. package/presets/claude/android-kotlin/agents/task-analyst.md +1 -1
  22. package/presets/claude/android-kotlin/hooks/chain-team-phases.sh +20 -15
  23. package/presets/claude/android-kotlin/rules/tooling-and-review/agent-team-orchestrator.md +17 -6
  24. package/presets/claude/go/agents/build-verifier.md +1 -1
  25. package/presets/claude/go/agents/code-reviewer.md +1 -1
  26. package/presets/claude/go/agents/debugger.md +1 -1
  27. package/presets/claude/go/agents/feature-developer.md +1 -1
  28. package/presets/claude/go/agents/task-analyst.md +1 -1
  29. package/presets/claude/go/hooks/chain-team-phases.sh +20 -15
  30. package/presets/claude/go/rules/tooling-and-review/agent-team-orchestrator.md +17 -6
  31. package/presets/claude/ios-swift/agents/build-verifier.md +1 -1
  32. package/presets/claude/ios-swift/agents/code-reviewer.md +1 -1
  33. package/presets/claude/ios-swift/agents/debugger.md +1 -1
  34. package/presets/claude/ios-swift/agents/feature-developer.md +1 -1
  35. package/presets/claude/ios-swift/agents/task-analyst.md +1 -1
  36. package/presets/claude/ios-swift/hooks/chain-team-phases.sh +20 -15
  37. package/presets/claude/ios-swift/rules/tooling-and-review/agent-team-orchestrator.md +17 -6
  38. package/presets/claude/java/agents/build-verifier.md +1 -1
  39. package/presets/claude/java/agents/code-reviewer.md +1 -1
  40. package/presets/claude/java/agents/debugger.md +1 -1
  41. package/presets/claude/java/agents/feature-developer.md +1 -1
  42. package/presets/claude/java/agents/task-analyst.md +1 -1
  43. package/presets/claude/java/hooks/chain-team-phases.sh +20 -15
  44. package/presets/claude/java/rules/tooling-and-review/agent-team-orchestrator.md +17 -6
  45. package/presets/claude/mcp-ts/agents/build-verifier.md +1 -1
  46. package/presets/claude/mcp-ts/agents/feature-developer.md +1 -1
  47. package/presets/claude/mcp-ts/agents/task-analyst.md +1 -1
  48. package/presets/claude/mcp-ts/hooks/chain-team-phases.sh +20 -15
  49. package/presets/claude/mcp-ts/rules/tooling-and-review/agent-team-orchestrator.md +17 -6
  50. package/presets/claude/mol/agents/build-verifier.md +1 -1
  51. package/presets/claude/mol/agents/code-reviewer.md +1 -1
  52. package/presets/claude/mol/agents/debugger.md +1 -1
  53. package/presets/claude/mol/agents/feature-developer.md +1 -1
  54. package/presets/claude/mol/agents/task-analyst.md +1 -1
  55. package/presets/claude/mol/hooks/chain-team-phases.sh +20 -15
  56. package/presets/claude/mol/rules/tooling-and-review/agent-team-orchestrator.md +17 -6
  57. package/presets/claude/next/agents/build-verifier.md +16 -1
  58. package/presets/claude/next/agents/code-reviewer.md +1 -1
  59. package/presets/claude/next/agents/debugger.md +1 -1
  60. package/presets/claude/next/agents/feature-developer.md +13 -1
  61. package/presets/claude/next/agents/task-analyst.md +1 -1
  62. package/presets/claude/next/agents/task-router.md +10 -0
  63. package/presets/claude/next/hooks/chain-team-phases.sh +20 -15
  64. package/presets/claude/next/rules/tooling-and-review/agent-team-orchestrator.md +17 -6
  65. package/presets/claude/next/rules/tooling-and-review/code-review-mr.md +2 -1
  66. package/presets/claude/nuxt/agents/build-verifier.md +1 -1
  67. package/presets/claude/nuxt/agents/code-reviewer.md +1 -1
  68. package/presets/claude/nuxt/agents/debugger.md +1 -1
  69. package/presets/claude/nuxt/agents/feature-developer.md +1 -1
  70. package/presets/claude/nuxt/agents/task-analyst.md +1 -1
  71. package/presets/claude/nuxt/hooks/chain-team-phases.sh +20 -15
  72. package/presets/claude/nuxt/rules/tooling-and-review/agent-team-orchestrator.md +17 -6
  73. package/presets/claude/php-hexagonal/agents/build-verifier.md +1 -1
  74. package/presets/claude/php-hexagonal/agents/code-reviewer.md +1 -1
  75. package/presets/claude/php-hexagonal/agents/debugger.md +1 -1
  76. package/presets/claude/php-hexagonal/agents/feature-developer.md +1 -1
  77. package/presets/claude/php-hexagonal/agents/task-analyst.md +1 -1
  78. package/presets/claude/php-hexagonal/hooks/chain-team-phases.sh +20 -15
  79. package/presets/claude/php-hexagonal/rules/tooling-and-review/agent-team-orchestrator.md +17 -6
  80. package/presets/claude/php-laravel/agents/build-verifier.md +1 -1
  81. package/presets/claude/php-laravel/agents/code-reviewer.md +1 -1
  82. package/presets/claude/php-laravel/agents/debugger.md +1 -1
  83. package/presets/claude/php-laravel/agents/feature-developer.md +1 -1
  84. package/presets/claude/php-laravel/agents/task-analyst.md +1 -1
  85. package/presets/claude/php-laravel/hooks/chain-team-phases.sh +20 -15
  86. package/presets/claude/php-laravel/rules/tooling-and-review/agent-team-orchestrator.md +17 -6
  87. package/presets/claude/svelte/agents/build-verifier.md +1 -1
  88. package/presets/claude/svelte/agents/code-reviewer.md +1 -1
  89. package/presets/claude/svelte/agents/debugger.md +1 -1
  90. package/presets/claude/svelte/agents/feature-developer.md +1 -1
  91. package/presets/claude/svelte/agents/task-analyst.md +1 -1
  92. package/presets/claude/svelte/hooks/chain-team-phases.sh +20 -15
  93. package/presets/claude/svelte/rules/tooling-and-review/agent-team-orchestrator.md +17 -6
  94. package/presets/cursor/android-kotlin/agents/build-verifier.md +1 -1
  95. package/presets/cursor/android-kotlin/agents/code-reviewer.md +1 -1
  96. package/presets/cursor/android-kotlin/agents/debugger.md +1 -1
  97. package/presets/cursor/android-kotlin/agents/feature-developer.md +1 -1
  98. package/presets/cursor/android-kotlin/agents/task-analyst.md +1 -1
  99. package/presets/cursor/android-kotlin/hooks/chain-team-phases.sh +20 -15
  100. package/presets/cursor/android-kotlin/rules/agent-team-orchestrator.mdc +1 -1
  101. package/presets/cursor/go/agents/build-verifier.md +1 -1
  102. package/presets/cursor/go/agents/code-reviewer.md +1 -1
  103. package/presets/cursor/go/agents/debugger.md +1 -1
  104. package/presets/cursor/go/agents/feature-developer.md +1 -1
  105. package/presets/cursor/go/agents/task-analyst.md +1 -1
  106. package/presets/cursor/go/hooks/chain-team-phases.sh +20 -15
  107. package/presets/cursor/go/rules/agent-team-orchestrator.mdc +1 -1
  108. package/presets/cursor/ios-swift/agents/build-verifier.md +1 -1
  109. package/presets/cursor/ios-swift/agents/code-reviewer.md +1 -1
  110. package/presets/cursor/ios-swift/agents/debugger.md +1 -1
  111. package/presets/cursor/ios-swift/agents/feature-developer.md +1 -1
  112. package/presets/cursor/ios-swift/agents/task-analyst.md +1 -1
  113. package/presets/cursor/ios-swift/hooks/chain-team-phases.sh +20 -15
  114. package/presets/cursor/ios-swift/rules/agent-team-orchestrator.mdc +1 -1
  115. package/presets/cursor/java/agents/build-verifier.md +1 -1
  116. package/presets/cursor/java/agents/code-reviewer.md +1 -1
  117. package/presets/cursor/java/agents/debugger.md +1 -1
  118. package/presets/cursor/java/agents/feature-developer.md +1 -1
  119. package/presets/cursor/java/agents/task-analyst.md +1 -1
  120. package/presets/cursor/java/hooks/chain-team-phases.sh +20 -15
  121. package/presets/cursor/java/rules/agent-team-orchestrator.mdc +1 -1
  122. package/presets/cursor/mcp-ts/agents/build-verifier.md +1 -1
  123. package/presets/cursor/mcp-ts/agents/feature-developer.md +1 -1
  124. package/presets/cursor/mcp-ts/agents/task-analyst.md +1 -1
  125. package/presets/cursor/mcp-ts/hooks/chain-team-phases.sh +20 -15
  126. package/presets/cursor/mcp-ts/rules/agent-team-orchestrator.mdc +1 -1
  127. package/presets/cursor/mol/agents/build-verifier.md +1 -1
  128. package/presets/cursor/mol/agents/code-reviewer.md +1 -1
  129. package/presets/cursor/mol/agents/debugger.md +1 -1
  130. package/presets/cursor/mol/agents/feature-developer.md +1 -1
  131. package/presets/cursor/mol/agents/task-analyst.md +1 -1
  132. package/presets/cursor/mol/hooks/chain-team-phases.sh +20 -15
  133. package/presets/cursor/mol/rules/agent-team-orchestrator.mdc +1 -1
  134. package/presets/cursor/next/agents/README.md +2 -0
  135. package/presets/cursor/next/agents/build-verifier.md +16 -1
  136. package/presets/cursor/next/agents/code-reviewer.md +1 -1
  137. package/presets/cursor/next/agents/debugger.md +1 -1
  138. package/presets/cursor/next/agents/feature-developer.md +13 -1
  139. package/presets/cursor/next/agents/task-analyst.md +1 -1
  140. package/presets/cursor/next/agents/task-router.md +10 -0
  141. package/presets/cursor/next/hooks/chain-team-phases.sh +20 -15
  142. package/presets/cursor/next/rules/agent-team-orchestrator.mdc +1 -1
  143. package/presets/cursor/next/rules/code-review-mr.mdc +2 -1
  144. package/presets/cursor/next/team/fixtures/feature-l2-lite.json +27 -0
  145. package/presets/cursor/nuxt/agents/build-verifier.md +1 -1
  146. package/presets/cursor/nuxt/agents/code-reviewer.md +1 -1
  147. package/presets/cursor/nuxt/agents/debugger.md +1 -1
  148. package/presets/cursor/nuxt/agents/feature-developer.md +1 -1
  149. package/presets/cursor/nuxt/agents/task-analyst.md +1 -1
  150. package/presets/cursor/nuxt/hooks/chain-team-phases.sh +20 -15
  151. package/presets/cursor/nuxt/rules/agent-team-orchestrator.mdc +1 -1
  152. package/presets/cursor/php-hexagonal/agents/build-verifier.md +1 -1
  153. package/presets/cursor/php-hexagonal/agents/code-reviewer.md +1 -1
  154. package/presets/cursor/php-hexagonal/agents/debugger.md +1 -1
  155. package/presets/cursor/php-hexagonal/agents/feature-developer.md +1 -1
  156. package/presets/cursor/php-hexagonal/agents/task-analyst.md +1 -1
  157. package/presets/cursor/php-hexagonal/hooks/chain-team-phases.sh +20 -15
  158. package/presets/cursor/php-hexagonal/rules/agent-team-orchestrator.mdc +1 -1
  159. package/presets/cursor/php-laravel/agents/build-verifier.md +1 -1
  160. package/presets/cursor/php-laravel/agents/code-reviewer.md +1 -1
  161. package/presets/cursor/php-laravel/agents/debugger.md +1 -1
  162. package/presets/cursor/php-laravel/agents/feature-developer.md +1 -1
  163. package/presets/cursor/php-laravel/agents/task-analyst.md +1 -1
  164. package/presets/cursor/php-laravel/hooks/chain-team-phases.sh +20 -15
  165. package/presets/cursor/php-laravel/rules/agent-team-orchestrator.mdc +1 -1
  166. package/presets/cursor/svelte/agents/build-verifier.md +1 -1
  167. package/presets/cursor/svelte/agents/code-reviewer.md +1 -1
  168. package/presets/cursor/svelte/agents/debugger.md +1 -1
  169. package/presets/cursor/svelte/agents/feature-developer.md +1 -1
  170. package/presets/cursor/svelte/agents/task-analyst.md +1 -1
  171. package/presets/cursor/svelte/hooks/chain-team-phases.sh +20 -15
  172. package/presets/cursor/svelte/rules/agent-team-orchestrator.mdc +1 -1
  173. package/presets/mavis/android-kotlin/adapter-map.json +1 -1
  174. package/presets/mavis/android-kotlin/agents/build-verifier.md +1 -1
  175. package/presets/mavis/android-kotlin/agents/code-reviewer.md +1 -1
  176. package/presets/mavis/android-kotlin/agents/debugger.md +1 -1
  177. package/presets/mavis/android-kotlin/agents/feature-developer.md +1 -1
  178. package/presets/mavis/android-kotlin/agents/task-analyst.md +1 -1
  179. package/presets/mavis/android-kotlin/hooks/chain-team-phases.sh +20 -15
  180. package/presets/mavis/android-kotlin/rules/agent-team-orchestrator.md +17 -6
  181. package/presets/mavis/go/adapter-map.json +1 -1
  182. package/presets/mavis/go/agents/build-verifier.md +1 -1
  183. package/presets/mavis/go/agents/code-reviewer.md +1 -1
  184. package/presets/mavis/go/agents/debugger.md +1 -1
  185. package/presets/mavis/go/agents/feature-developer.md +1 -1
  186. package/presets/mavis/go/agents/task-analyst.md +1 -1
  187. package/presets/mavis/go/hooks/chain-team-phases.sh +20 -15
  188. package/presets/mavis/go/rules/agent-team-orchestrator.md +17 -6
  189. package/presets/mavis/ios-swift/adapter-map.json +1 -1
  190. package/presets/mavis/ios-swift/agents/build-verifier.md +1 -1
  191. package/presets/mavis/ios-swift/agents/code-reviewer.md +1 -1
  192. package/presets/mavis/ios-swift/agents/debugger.md +1 -1
  193. package/presets/mavis/ios-swift/agents/feature-developer.md +1 -1
  194. package/presets/mavis/ios-swift/agents/task-analyst.md +1 -1
  195. package/presets/mavis/ios-swift/hooks/chain-team-phases.sh +20 -15
  196. package/presets/mavis/ios-swift/rules/agent-team-orchestrator.md +17 -6
  197. package/presets/mavis/java/adapter-map.json +1 -1
  198. package/presets/mavis/java/agents/build-verifier.md +1 -1
  199. package/presets/mavis/java/agents/code-reviewer.md +1 -1
  200. package/presets/mavis/java/agents/debugger.md +1 -1
  201. package/presets/mavis/java/agents/feature-developer.md +1 -1
  202. package/presets/mavis/java/agents/task-analyst.md +1 -1
  203. package/presets/mavis/java/hooks/chain-team-phases.sh +20 -15
  204. package/presets/mavis/java/rules/agent-team-orchestrator.md +17 -6
  205. package/presets/mavis/mcp-ts/adapter-map.json +1 -1
  206. package/presets/mavis/mcp-ts/agents/build-verifier.md +1 -1
  207. package/presets/mavis/mcp-ts/agents/feature-developer.md +1 -1
  208. package/presets/mavis/mcp-ts/agents/task-analyst.md +1 -1
  209. package/presets/mavis/mcp-ts/hooks/chain-team-phases.sh +20 -15
  210. package/presets/mavis/mcp-ts/rules/agent-team-orchestrator.md +17 -6
  211. package/presets/mavis/mol/adapter-map.json +1 -1
  212. package/presets/mavis/mol/agents/build-verifier.md +1 -1
  213. package/presets/mavis/mol/agents/code-reviewer.md +1 -1
  214. package/presets/mavis/mol/agents/debugger.md +1 -1
  215. package/presets/mavis/mol/agents/feature-developer.md +1 -1
  216. package/presets/mavis/mol/agents/task-analyst.md +1 -1
  217. package/presets/mavis/mol/hooks/chain-team-phases.sh +20 -15
  218. package/presets/mavis/mol/rules/agent-team-orchestrator.md +17 -6
  219. package/presets/mavis/next/adapter-map.json +9 -1
  220. package/presets/mavis/next/agents/build-verifier.md +16 -1
  221. package/presets/mavis/next/agents/code-reviewer.md +1 -1
  222. package/presets/mavis/next/agents/debugger.md +1 -1
  223. package/presets/mavis/next/agents/feature-developer.md +13 -1
  224. package/presets/mavis/next/agents/task-analyst.md +1 -1
  225. package/presets/mavis/next/agents/task-router.md +10 -0
  226. package/presets/mavis/next/hooks/chain-team-phases.sh +20 -15
  227. package/presets/mavis/next/rules/agent-team-orchestrator.md +17 -6
  228. package/presets/mavis/next/rules/code-review-mr.md +2 -1
  229. package/presets/mavis/next/team/fixtures/feature-l2-lite.json +27 -0
  230. package/presets/mavis/nuxt/adapter-map.json +1 -1
  231. package/presets/mavis/nuxt/agents/build-verifier.md +1 -1
  232. package/presets/mavis/nuxt/agents/code-reviewer.md +1 -1
  233. package/presets/mavis/nuxt/agents/debugger.md +1 -1
  234. package/presets/mavis/nuxt/agents/feature-developer.md +1 -1
  235. package/presets/mavis/nuxt/agents/task-analyst.md +1 -1
  236. package/presets/mavis/nuxt/hooks/chain-team-phases.sh +20 -15
  237. package/presets/mavis/nuxt/rules/agent-team-orchestrator.md +17 -6
  238. package/presets/mavis/php-hexagonal/adapter-map.json +1 -1
  239. package/presets/mavis/php-hexagonal/agents/build-verifier.md +1 -1
  240. package/presets/mavis/php-hexagonal/agents/code-reviewer.md +1 -1
  241. package/presets/mavis/php-hexagonal/agents/debugger.md +1 -1
  242. package/presets/mavis/php-hexagonal/agents/feature-developer.md +1 -1
  243. package/presets/mavis/php-hexagonal/agents/task-analyst.md +1 -1
  244. package/presets/mavis/php-hexagonal/hooks/chain-team-phases.sh +20 -15
  245. package/presets/mavis/php-hexagonal/rules/agent-team-orchestrator.md +17 -6
  246. package/presets/mavis/php-laravel/adapter-map.json +1 -1
  247. package/presets/mavis/php-laravel/agents/build-verifier.md +1 -1
  248. package/presets/mavis/php-laravel/agents/code-reviewer.md +1 -1
  249. package/presets/mavis/php-laravel/agents/debugger.md +1 -1
  250. package/presets/mavis/php-laravel/agents/feature-developer.md +1 -1
  251. package/presets/mavis/php-laravel/agents/task-analyst.md +1 -1
  252. package/presets/mavis/php-laravel/hooks/chain-team-phases.sh +20 -15
  253. package/presets/mavis/php-laravel/rules/agent-team-orchestrator.md +17 -6
  254. package/presets/mavis/svelte/adapter-map.json +1 -1
  255. package/presets/mavis/svelte/agents/build-verifier.md +1 -1
  256. package/presets/mavis/svelte/agents/code-reviewer.md +1 -1
  257. package/presets/mavis/svelte/agents/debugger.md +1 -1
  258. package/presets/mavis/svelte/agents/feature-developer.md +1 -1
  259. package/presets/mavis/svelte/agents/task-analyst.md +1 -1
  260. package/presets/mavis/svelte/hooks/chain-team-phases.sh +20 -15
  261. package/presets/mavis/svelte/rules/agent-team-orchestrator.md +17 -6
  262. package/presets/opencode/android-kotlin/adapter-map.json +1 -1
  263. package/presets/opencode/android-kotlin/agents/build-verifier.md +1 -1
  264. package/presets/opencode/android-kotlin/agents/code-reviewer.md +1 -1
  265. package/presets/opencode/android-kotlin/agents/debugger.md +1 -1
  266. package/presets/opencode/android-kotlin/agents/feature-developer.md +1 -1
  267. package/presets/opencode/android-kotlin/agents/task-analyst.md +1 -1
  268. package/presets/opencode/android-kotlin/hooks/chain-team-phases.sh +20 -15
  269. package/presets/opencode/android-kotlin/rules/agent-team-orchestrator.md +17 -6
  270. package/presets/opencode/go/adapter-map.json +1 -1
  271. package/presets/opencode/go/agents/build-verifier.md +1 -1
  272. package/presets/opencode/go/agents/code-reviewer.md +1 -1
  273. package/presets/opencode/go/agents/debugger.md +1 -1
  274. package/presets/opencode/go/agents/feature-developer.md +1 -1
  275. package/presets/opencode/go/agents/task-analyst.md +1 -1
  276. package/presets/opencode/go/hooks/chain-team-phases.sh +20 -15
  277. package/presets/opencode/go/rules/agent-team-orchestrator.md +17 -6
  278. package/presets/opencode/ios-swift/adapter-map.json +1 -1
  279. package/presets/opencode/ios-swift/agents/build-verifier.md +1 -1
  280. package/presets/opencode/ios-swift/agents/code-reviewer.md +1 -1
  281. package/presets/opencode/ios-swift/agents/debugger.md +1 -1
  282. package/presets/opencode/ios-swift/agents/feature-developer.md +1 -1
  283. package/presets/opencode/ios-swift/agents/task-analyst.md +1 -1
  284. package/presets/opencode/ios-swift/hooks/chain-team-phases.sh +20 -15
  285. package/presets/opencode/ios-swift/rules/agent-team-orchestrator.md +17 -6
  286. package/presets/opencode/java/adapter-map.json +1 -1
  287. package/presets/opencode/java/agents/build-verifier.md +1 -1
  288. package/presets/opencode/java/agents/code-reviewer.md +1 -1
  289. package/presets/opencode/java/agents/debugger.md +1 -1
  290. package/presets/opencode/java/agents/feature-developer.md +1 -1
  291. package/presets/opencode/java/agents/task-analyst.md +1 -1
  292. package/presets/opencode/java/hooks/chain-team-phases.sh +20 -15
  293. package/presets/opencode/java/rules/agent-team-orchestrator.md +17 -6
  294. package/presets/opencode/mcp-ts/adapter-map.json +1 -1
  295. package/presets/opencode/mcp-ts/agents/build-verifier.md +1 -1
  296. package/presets/opencode/mcp-ts/agents/feature-developer.md +1 -1
  297. package/presets/opencode/mcp-ts/agents/task-analyst.md +1 -1
  298. package/presets/opencode/mcp-ts/hooks/chain-team-phases.sh +20 -15
  299. package/presets/opencode/mcp-ts/rules/agent-team-orchestrator.md +17 -6
  300. package/presets/opencode/mol/adapter-map.json +1 -1
  301. package/presets/opencode/mol/agents/build-verifier.md +1 -1
  302. package/presets/opencode/mol/agents/code-reviewer.md +1 -1
  303. package/presets/opencode/mol/agents/debugger.md +1 -1
  304. package/presets/opencode/mol/agents/feature-developer.md +1 -1
  305. package/presets/opencode/mol/agents/task-analyst.md +1 -1
  306. package/presets/opencode/mol/hooks/chain-team-phases.sh +20 -15
  307. package/presets/opencode/mol/rules/agent-team-orchestrator.md +17 -6
  308. package/presets/opencode/next/adapter-map.json +9 -1
  309. package/presets/opencode/next/agents/build-verifier.md +16 -1
  310. package/presets/opencode/next/agents/code-reviewer.md +1 -1
  311. package/presets/opencode/next/agents/debugger.md +1 -1
  312. package/presets/opencode/next/agents/feature-developer.md +13 -1
  313. package/presets/opencode/next/agents/task-analyst.md +1 -1
  314. package/presets/opencode/next/agents/task-router.md +10 -0
  315. package/presets/opencode/next/hooks/chain-team-phases.sh +20 -15
  316. package/presets/opencode/next/rules/agent-team-orchestrator.md +17 -6
  317. package/presets/opencode/next/rules/code-review-mr.md +2 -1
  318. package/presets/opencode/next/team/fixtures/feature-l2-lite.json +27 -0
  319. package/presets/opencode/nuxt/adapter-map.json +1 -1
  320. package/presets/opencode/nuxt/agents/build-verifier.md +1 -1
  321. package/presets/opencode/nuxt/agents/code-reviewer.md +1 -1
  322. package/presets/opencode/nuxt/agents/debugger.md +1 -1
  323. package/presets/opencode/nuxt/agents/feature-developer.md +1 -1
  324. package/presets/opencode/nuxt/agents/task-analyst.md +1 -1
  325. package/presets/opencode/nuxt/hooks/chain-team-phases.sh +20 -15
  326. package/presets/opencode/nuxt/rules/agent-team-orchestrator.md +17 -6
  327. package/presets/opencode/php-hexagonal/adapter-map.json +1 -1
  328. package/presets/opencode/php-hexagonal/agents/build-verifier.md +1 -1
  329. package/presets/opencode/php-hexagonal/agents/code-reviewer.md +1 -1
  330. package/presets/opencode/php-hexagonal/agents/debugger.md +1 -1
  331. package/presets/opencode/php-hexagonal/agents/feature-developer.md +1 -1
  332. package/presets/opencode/php-hexagonal/agents/task-analyst.md +1 -1
  333. package/presets/opencode/php-hexagonal/hooks/chain-team-phases.sh +20 -15
  334. package/presets/opencode/php-hexagonal/rules/agent-team-orchestrator.md +17 -6
  335. package/presets/opencode/php-laravel/adapter-map.json +1 -1
  336. package/presets/opencode/php-laravel/agents/build-verifier.md +1 -1
  337. package/presets/opencode/php-laravel/agents/code-reviewer.md +1 -1
  338. package/presets/opencode/php-laravel/agents/debugger.md +1 -1
  339. package/presets/opencode/php-laravel/agents/feature-developer.md +1 -1
  340. package/presets/opencode/php-laravel/agents/task-analyst.md +1 -1
  341. package/presets/opencode/php-laravel/hooks/chain-team-phases.sh +20 -15
  342. package/presets/opencode/php-laravel/rules/agent-team-orchestrator.md +17 -6
  343. package/presets/opencode/svelte/adapter-map.json +1 -1
  344. package/presets/opencode/svelte/agents/build-verifier.md +1 -1
  345. package/presets/opencode/svelte/agents/code-reviewer.md +1 -1
  346. package/presets/opencode/svelte/agents/debugger.md +1 -1
  347. package/presets/opencode/svelte/agents/feature-developer.md +1 -1
  348. package/presets/opencode/svelte/agents/task-analyst.md +1 -1
  349. package/presets/opencode/svelte/hooks/chain-team-phases.sh +20 -15
  350. package/presets/opencode/svelte/rules/agent-team-orchestrator.md +17 -6
  351. package/presets/zcode/android-kotlin/adapter-map.json +1 -1
  352. package/presets/zcode/android-kotlin/agents/build-verifier.md +1 -1
  353. package/presets/zcode/android-kotlin/agents/code-reviewer.md +1 -1
  354. package/presets/zcode/android-kotlin/agents/debugger.md +1 -1
  355. package/presets/zcode/android-kotlin/agents/feature-developer.md +1 -1
  356. package/presets/zcode/android-kotlin/agents/task-analyst.md +1 -1
  357. package/presets/zcode/android-kotlin/hooks/chain-team-phases.sh +20 -15
  358. package/presets/zcode/android-kotlin/rules/agent-team-orchestrator.md +17 -6
  359. package/presets/zcode/go/adapter-map.json +1 -1
  360. package/presets/zcode/go/agents/build-verifier.md +1 -1
  361. package/presets/zcode/go/agents/code-reviewer.md +1 -1
  362. package/presets/zcode/go/agents/debugger.md +1 -1
  363. package/presets/zcode/go/agents/feature-developer.md +1 -1
  364. package/presets/zcode/go/agents/task-analyst.md +1 -1
  365. package/presets/zcode/go/hooks/chain-team-phases.sh +20 -15
  366. package/presets/zcode/go/rules/agent-team-orchestrator.md +17 -6
  367. package/presets/zcode/ios-swift/adapter-map.json +1 -1
  368. package/presets/zcode/ios-swift/agents/build-verifier.md +1 -1
  369. package/presets/zcode/ios-swift/agents/code-reviewer.md +1 -1
  370. package/presets/zcode/ios-swift/agents/debugger.md +1 -1
  371. package/presets/zcode/ios-swift/agents/feature-developer.md +1 -1
  372. package/presets/zcode/ios-swift/agents/task-analyst.md +1 -1
  373. package/presets/zcode/ios-swift/hooks/chain-team-phases.sh +20 -15
  374. package/presets/zcode/ios-swift/rules/agent-team-orchestrator.md +17 -6
  375. package/presets/zcode/java/adapter-map.json +1 -1
  376. package/presets/zcode/java/agents/build-verifier.md +1 -1
  377. package/presets/zcode/java/agents/code-reviewer.md +1 -1
  378. package/presets/zcode/java/agents/debugger.md +1 -1
  379. package/presets/zcode/java/agents/feature-developer.md +1 -1
  380. package/presets/zcode/java/agents/task-analyst.md +1 -1
  381. package/presets/zcode/java/hooks/chain-team-phases.sh +20 -15
  382. package/presets/zcode/java/rules/agent-team-orchestrator.md +17 -6
  383. package/presets/zcode/mcp-ts/adapter-map.json +1 -1
  384. package/presets/zcode/mcp-ts/agents/build-verifier.md +1 -1
  385. package/presets/zcode/mcp-ts/agents/feature-developer.md +1 -1
  386. package/presets/zcode/mcp-ts/agents/task-analyst.md +1 -1
  387. package/presets/zcode/mcp-ts/hooks/chain-team-phases.sh +20 -15
  388. package/presets/zcode/mcp-ts/rules/agent-team-orchestrator.md +17 -6
  389. package/presets/zcode/mol/adapter-map.json +1 -1
  390. package/presets/zcode/mol/agents/build-verifier.md +1 -1
  391. package/presets/zcode/mol/agents/code-reviewer.md +1 -1
  392. package/presets/zcode/mol/agents/debugger.md +1 -1
  393. package/presets/zcode/mol/agents/feature-developer.md +1 -1
  394. package/presets/zcode/mol/agents/task-analyst.md +1 -1
  395. package/presets/zcode/mol/hooks/chain-team-phases.sh +20 -15
  396. package/presets/zcode/mol/rules/agent-team-orchestrator.md +17 -6
  397. package/presets/zcode/next/adapter-map.json +9 -1
  398. package/presets/zcode/next/agents/build-verifier.md +16 -1
  399. package/presets/zcode/next/agents/code-reviewer.md +1 -1
  400. package/presets/zcode/next/agents/debugger.md +1 -1
  401. package/presets/zcode/next/agents/feature-developer.md +13 -1
  402. package/presets/zcode/next/agents/task-analyst.md +1 -1
  403. package/presets/zcode/next/agents/task-router.md +10 -0
  404. package/presets/zcode/next/hooks/chain-team-phases.sh +20 -15
  405. package/presets/zcode/next/rules/agent-team-orchestrator.md +17 -6
  406. package/presets/zcode/next/rules/code-review-mr.md +2 -1
  407. package/presets/zcode/next/team/fixtures/feature-l2-lite.json +27 -0
  408. package/presets/zcode/nuxt/adapter-map.json +1 -1
  409. package/presets/zcode/nuxt/agents/build-verifier.md +1 -1
  410. package/presets/zcode/nuxt/agents/code-reviewer.md +1 -1
  411. package/presets/zcode/nuxt/agents/debugger.md +1 -1
  412. package/presets/zcode/nuxt/agents/feature-developer.md +1 -1
  413. package/presets/zcode/nuxt/agents/task-analyst.md +1 -1
  414. package/presets/zcode/nuxt/hooks/chain-team-phases.sh +20 -15
  415. package/presets/zcode/nuxt/rules/agent-team-orchestrator.md +17 -6
  416. package/presets/zcode/php-hexagonal/adapter-map.json +1 -1
  417. package/presets/zcode/php-hexagonal/agents/build-verifier.md +1 -1
  418. package/presets/zcode/php-hexagonal/agents/code-reviewer.md +1 -1
  419. package/presets/zcode/php-hexagonal/agents/debugger.md +1 -1
  420. package/presets/zcode/php-hexagonal/agents/feature-developer.md +1 -1
  421. package/presets/zcode/php-hexagonal/agents/task-analyst.md +1 -1
  422. package/presets/zcode/php-hexagonal/hooks/chain-team-phases.sh +20 -15
  423. package/presets/zcode/php-hexagonal/rules/agent-team-orchestrator.md +17 -6
  424. package/presets/zcode/php-laravel/adapter-map.json +1 -1
  425. package/presets/zcode/php-laravel/agents/build-verifier.md +1 -1
  426. package/presets/zcode/php-laravel/agents/code-reviewer.md +1 -1
  427. package/presets/zcode/php-laravel/agents/debugger.md +1 -1
  428. package/presets/zcode/php-laravel/agents/feature-developer.md +1 -1
  429. package/presets/zcode/php-laravel/agents/task-analyst.md +1 -1
  430. package/presets/zcode/php-laravel/hooks/chain-team-phases.sh +20 -15
  431. package/presets/zcode/php-laravel/rules/agent-team-orchestrator.md +17 -6
  432. package/presets/zcode/svelte/adapter-map.json +1 -1
  433. package/presets/zcode/svelte/agents/build-verifier.md +1 -1
  434. package/presets/zcode/svelte/agents/code-reviewer.md +1 -1
  435. package/presets/zcode/svelte/agents/debugger.md +1 -1
  436. package/presets/zcode/svelte/agents/feature-developer.md +1 -1
  437. package/presets/zcode/svelte/agents/task-analyst.md +1 -1
  438. package/presets/zcode/svelte/hooks/chain-team-phases.sh +20 -15
  439. package/presets/zcode/svelte/rules/agent-team-orchestrator.md +17 -6
package/CHANGELOG.md CHANGED
@@ -1,5 +1,85 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.2.57
4
+
5
+ ### L2-lite and a lighter bounded-contract pipeline
6
+
7
+ - **A fourth level.** The repository's `task-levels` overlay gains **L2-lite** for an additive public contract with a machine-checked gate (OpenAPI / JSON schema / protobuf), no migration, no auth / SSR-cookie / analytics / PII change, ≤ 3 work packages and ≤ 15 substantive files: the L1 execution artifacts plus the contract gate, no L2 OpenSpec. The selection order counts substantive files only — generated trees, snapshots, CLI goldens, docs, and test fixtures do not escalate the level — while L2 (no machine-checked gate), L3, and their OpenSpec path stay unchanged.
8
+ - **Ceremony budget.** L2-lite keeps the safety gates and drops the template weight: `task-analyst → api-contract-reviewer (contract change only) → feature-developer → build-verifier → security-reviewer (destructive / auth-bearing only) → code-reviewer → qa-tester (AC names e2e)`, exactly one human gate `after:task-analyst`, the 28-row block once in `brief.md`, and a ≤ 3 h / ≤ 8 step target. Exceeding the budget records `decision: replan rev N → N+1` instead of growing the template.
9
+ - **Router.** `task-router` on every `next` tree selects L2-lite at `profile: standard`, keeps only the risk specialists, sets `humanGates` to exactly `["after:task-analyst"]`, and records the level and the machine-checked gate in `routingReasons`. `feature-l2-lite.json` joins the seeded `team/fixtures/`.
10
+ - **Overlay-owned.** `init` never overwrites an existing `.ai.local/rules/task-levels.md`, so an installed overlay selects L2-lite only after the level and the selection-order rows are added to that file; the router is already updated.
11
+
12
+ ### Model tiers and a usage ledger
13
+
14
+ - **Tier map.** `.ai.local/team/model-tiers.json` (`schemaVersion`, `approvedBy`, `tiers.cheap|standard|strong`) is the provider-specific map the orchestrator resolves a `steps[i].model` tier through, passing `providerID/modelID` (or `#variant`) to the Task tool. This repository pins `cheap` and `standard` to `deepseek/deepseek-flash` and `strong` to `deepseek/deepseek-v4-pro`; `strong` is never downgraded to the parent default.
15
+ - **Fail closed.** A declared tier without a mapping stops the start with `model-tier-unmapped` instead of silently inheriting the parent model. A platform that takes no explicit model records the resolved tier in the handoff and lets the frontmatter pin apply. The tier changes no step order, gate, receipt, or retry policy.
16
+ - **Usage events.** `record-usage.mjs` appends one `usage_recorded` event (`input`, `output`, `cached`, `model`) to a task's `metrics.json` under the same advisory lock family as the hooks; the chain hook forwards a `usage` object from its input into `attempt_finished`. A count the host does not expose stays missing — nothing is estimated or invented.
17
+
18
+ ### The chain hook takes its slug explicitly
19
+
20
+ - **`TEAM_TASK_SLUG`.** All 55 `chain-team-phases.sh` bodies and the shared template prefer the environment slug over `.ai.local/team/active-task.json`; the pointer remains a single-slot fallback for the UI and older hosts. Two parallel sessions no longer overwrite each other's pointer and silently no-op a hook.
21
+ - **Callers and coverage.** The shared orchestrator and the OpenCode entry pass the slug on every call, and `m2-env-slug-overrides-pointer` proves an env slug wins over a foreign pointer slug; `m2-usage-forwarded` pins the `usage` hand-off.
22
+
23
+ ### A delta classifier for retries
24
+
25
+ - **New classifier.** `packages/ai-rules/scripts/check-preset-delta.mjs` maps a change-set to six domains (`team-db`, `app`, `preset-core`, `local-overlay`, `team-artifacts`, `docs`), lists the affected preset and app gates, and names what may be carried forward. It never runs a gate and never decides PASS/FAIL: exit `0` classified (including "no changes"), `2` usage/self-test failure. Flags: `--base <ref>`, `--paths a,b`, `--json`, `--self-test`.
26
+ - **Retry policy.** `build-verifier` runs the classifier before a re-validation: a gate in a changed domain must be re-run, and a gate in an unchanged domain may be carried only with the base ref, the classifier output, and the last green command + exit code in `validation-report.md`. Preset gates are never carried when `presets/**` or `scripts/**` changed, app gates never when `apps/team-tasks-ui/**` changed, and the team-db suites never when the `team-db` domain changed. The local `agent-pipeline-gates` rule carries the same row.
27
+ - **Wiring.** `yarn check:preset-delta` and a `preset-delta` self-test row in `check-preset-structure.sh` cover four cases: docs only, app e2e test only, OpenAPI contract, router rule.
28
+
29
+ ### Health reports its capabilities
30
+
31
+ - **API.** `GET /health` gains a required `capabilities: ["sync","delete"]` array; the OpenAPI schema adds the enum, the required list, and the example, and the contract gate still owns the frozen document.
32
+ - **UI.** `HealthDto.capabilities` stays optional so an older upstream parses; the mapper defaults it to `[]`, and `AppShell` renders a stale-upstream banner when a served API does not advertise `delete` (the copy names `restart team-db.mjs serve`). The footer no longer calls the app read-only.
33
+ - **Docs and tests.** `docs/TEAM-DB.md` states that `--allow-remote` exposes the confirmed delete and the rescan without authentication, and the app README states that `serve` loads its route table at start, so a stale process answers `405` on a route the new code serves. The API suite asserts the field; the mapper and copy suites cover the legacy shape and the banner text.
34
+
35
+ ### Requirements: one canonical block, stage rows downstream
36
+
37
+ - **Canonical downstream block.** Registry revision 5: the anchor (`brief.md` when routed, else the earliest block-bearing artifact) keeps the full 28-row table and `## Stage coverage`; every other block-bearing artifact may carry `Canonical: <anchor>.md#requirements-compliance` plus only the R-IDs its stage requires (`STAGE_REQUIREMENTS`). A full 28-row downstream block remains valid, and the anchor may never carry a canonical line.
38
+ - **Parser and checker.** `requirements-block.mjs` recognizes the canonical line (`E_CANONICAL_SYNTAX`, `E_CANONICAL_NOT_ALLOWED`) and validates the stage subset; `check-requirements-compliance.mjs` resolves the reference against the real anchor (`E_CANONICAL_REF`), allows extra touched rows on `implementation.md`, and reports canonical blocks in `--census`. The checklist documents the shape and the reference rule.
39
+ - **Local gate rules.** `gate-changes-requested` leaves the seed library and becomes an active rule; `gate-validation-failed` is added. Both point at the failing gate or the underlying behavior, never at a weaker test.
40
+
41
+ ### UI deltas close the existing expectations
42
+
43
+ - **Developer.** `feature-developer` gains an existing-suite impact check: a table shape, dialog/state machine, shared copy constant, or route/method change greps the existing specs and copy, updates every stale expectation in the same work package, runs the affected suite (not only the new test), and records the grep and the suite result in `implementation.md`. The local `agent-pipeline-gates` UI-surface row names the same duty.
44
+ - **Review.** `code-review-mr` states that with no Figma reference (no URL, fileKey/node id, or `figma-contract.json`) and `mockup-review.md` at `not-applicable`, the review emits `## Figma parity (UI) — fidelity: N/A` and raises no `REQUEST_CHANGES`; an explicit `fidelity: N/A` is not a finding, an absent one is.
45
+
46
+ ### Real delete coverage
47
+
48
+ - **Scratch server.** `yarn test:e2e:real-delete` starts the fixture API on its own temporary tree, deletes a task through the real HTTP `DELETE`, then asserts `404` on the detail route and absence from the list. The Playwright live project keeps a browser-boundary stub because it shares one projection across ~70 parallel scenarios.
49
+
50
+ ### Upgrade
51
+
52
+ - Run `npx @bonesofspring/ai-rules update` to refresh the 55 hooks, the shared orchestrator core, the `next` agents/rules, and the generated platform trees.
53
+ - `.ai.local/scripts/` stays skip-if-exists: delete `team-db-api.mjs` and `team-db-openapi.mjs` before the update to take the `capabilities` field, then restart `node .ai.local/scripts/team-db.mjs serve` — the process loads its modules at start, so an old one keeps answering the old surface.
54
+ - `model-tiers.json` is consumer-owned: create `.ai.local/team/model-tiers.json` with `tiers.cheap|standard|strong` to pin provider models; without it, the platform pin applies. The chain hook forwards usage without any script; the manual `record-usage.mjs` CLI is this repository's tooling.
55
+ - `task-levels.md` is consumer-owned; add the L2-lite level and selection-order rows to an existing overlay to activate it.
56
+
57
+ ## 0.2.56
58
+
59
+ ### Confirmed task delete
60
+
61
+ - **New endpoint.** `DELETE /api/v1/tasks/{slug}` (operationId `deleteTask`) deletes one task through the canonical CLI implementation, executed as one bounded child (30 s, `SIGKILL`): `200` with `{"slug":"<S>"}`, strict `404 E_NOT_FOUND`, `409 E_ACTIVE_TASK` with `details.activeSlug` when the slug is the active task, `503 E_DISABLED` under the kill switch, `503 E_BUSY` at the child deadline; the request body is ignored. The frozen contract grows to 23 operations (`docs/openapi/team-db.v1.json`, regenerated by the gate only), `E_ACTIVE_TASK` joins the error enum, and a 405 on the shared task path now advertises `Allow: GET, HEAD, DELETE`.
62
+ - **Folder first, then rows.** The task folder `.ai.local/team/tasks/<slug>/` is removed before one transaction deletes the task's search rows and the task row (every child row goes by foreign-key cascade); a crash between the legs converges toward deleted — the next `sync` marks the leftover rows absent and `--prune` removes them, so content never resurrects. A symlink at the task path is refused, never followed; the slug is validated at the API, the proxy, and the child.
63
+ - **CLI parity.** `team-db.mjs delete --slug <S> [--root <dir>] [--json]` is the single deletion implementation; exit `0` deleted or converged, `1` refusal (unknown slug, active task, kill switch, folder-delete failure), `2` database-level failure (without `node:sqlite` it refuses rather than deleting the folder only), `3` usage, `4` busy database. `--json` prints exactly one machine-readable line.
64
+ - **team-tasks-ui.** The task list and the task detail gain a danger-styled delete affordance over the same-origin proxy; the shared confirmation dialog names the slug, both consequences and irreversibility before any request, cancels with `Escape`/backdrop/`Cancel`, and renders the API error verbatim — including the active-task guard (`409`) and the converged "already deleted" state (`404`).
65
+ - **Docs and gates.** `docs/TEAM-DB.md` states the two-mutation policy; the API suite (16 checks) and the security suite (15 checks) pin the new route, the `Allow` header, the guard, the kill switch, hostile slugs, and the fault-injected leg order.
66
+
67
+ ### Upgrade
68
+
69
+ - Run `npx @bonesofspring/ai-rules update`, then delete the four changed modules in `.ai.local/scripts/` (`team-db.mjs`, `team-db-project.mjs`, `team-db-api.mjs`, `team-db-openapi.mjs`) to take the delete verb and route; seeding stays skip-if-exists.
70
+ - `AI_RULES_TEAM_DB_DISABLE=1` still stops every write point: the delete answers `503 E_DISABLED` over the API and refuses with exit 1 in the CLI.
71
+
72
+ ### Six preset and overlay improvements
73
+
74
+ - **Token-budget caps leave the checker.** The always-on count, the body cap, the slim-companion floor, and the 57-stem slim-companion allow-list move into `scripts/_lib/preset-token-budget-baseline.json`; every allow-list entry carries a reason. The numbers do not move — always-on 3–10, body sum ≤ 4000, slim-companion floor 5 lines. `check-preset-token-budget.sh --update` refuses to widen; only `--update --widen` accepts a widening and re-records the sanction. CI also compares the baseline to the base revision (`--base`), so an unrecorded edit of `caps` and `sanctioned` together no longer bypasses the ratchet; a recorded sanction remains a visible diff. The checker body holds no cap literal.
75
+ - **A third, advisory authoring tier.** `scripts/check-preset-authoring-advisory.mjs` reports four finding classes — `restated-stem`, `paraphrased-when-do`, `unjustified-body-size`, `issue-number-density` — one line per finding and a final `advisory-findings: <n>`. It always exits `0` and runs as a non-blocking row in `check:preset-structure` (and therefore `check:all`), so findings never block a release. The per-rule body threshold is the distinct `advisoryPerRuleBodyCap` baseline field; the tier holds no second copy of the number.
76
+ - **Per-store overlay budgets.** The in-task self-learning loop accounts the human store (`.ai.local/rules/**`, ≤ 5 rules and ≤ 170 lines) and the machine store (`.ai.local/conventions.md`, ≤ 30 lines) separately; the combined envelope stays 200 lines, and a saturated store refuses only its own write. The shipped `conventions.md` template is 27 non-empty lines, so a fresh install has three lines of machine headroom before the loop stages instead. `run.mjs --status` prints two envelopes. ADR `0001` guard 2 is amended in the same change.
77
+ - **Seed provenance and a mediated promotion.** Every seed the engine stages carries a four-field footer (`signature`, `stagedAt`, `sourceSlug`, `state: awaiting-human-promotion`) and no free text. `rule-improver.mjs --promote <stem>` strips every footer line, writes the reviewed rule into `.ai.local/rules/`, removes the seed, and appends a `seed-promoted` row bound to the reviewed snapshot — a seed edited between staging and promotion is reported as a divergence. A failed promotion leaves a recoverable commit intent; the next engine run finishes or drops it. Nothing auto-activates a seed.
78
+ - **An FTS shape registry for the team-db projection.** The released search layouts are enumerated oldest-first (`fts5-v1` today) and the installed layout is recorded in `schema_meta` under `search_fts_shape`. A drifted layout is **reported** in five states (`absent`, `current`, `unrecorded`, `superseded`, `unknown`) and never rebuilt: the live table stays untouched, `MIGRATIONS` and `SCHEMA_VERSION` are unchanged, `E_SCHEMA_NEWER` still fails closed, and FTS5 stays a runtime capability.
79
+ - **The learning loop's speed boundary.** The shared-core stem states that the loop runs no model-driven pass — rule text is template-derived from the validated signature, and a model-driven pass, if one is ever added, must be default-off and write only to the staged band. A hard gate row now checks the sentence in the core stem and in all 276 marker carriers, derives the loop-module list from `engine-scripts.js`, and rejects common static and dynamic HTTP/model imports in those modules.
80
+ - **Upgrade the consumer engine.** `.ai.local/scripts/` is seeded skip-if-exists: delete the changed modules — `rule-improver.mjs`, `run.mjs`, and `team-db-schema.mjs` for this preset work, plus `team-db.mjs`, `team-db-project.mjs`, `team-db-api.mjs`, and `team-db-openapi.mjs` for the delete-task work in the same release — and re-run `npx @bonesofspring/ai-rules update` to take the per-store budget split, the two-envelope status, the provenance footer, `--promote`, and the FTS shape registry.
81
+ - **Gates.** `check-preset-token-budget.sh`, `check-preset-structure.sh` (advisory row non-blocking), `check-rule-eval.mjs`, `check-shared-core-drift.sh`, `check-generated-drift.mjs`, `check-preset-self-review-contract.sh`, `test-team-db-schema.mjs`, `check-team-db-contract.mjs`, `test-rule-improver-ledger.mjs`, and `test-cli-init-clean.mjs` pass; the 55 CLI goldens are recaptured, never hand-edited.
82
+
3
83
  ## 0.2.55
4
84
 
5
85
  ### $mol preset (eleventh stack)
package/README.md CHANGED
@@ -42,6 +42,33 @@ tree is byte-identical to `presets/_shared/ai-local/scripts/`, and `.ai.local/.g
42
42
  required lines appended to an existing file) ignores `*.lock`, `*.tmp`, `.rollback/`, `team.db`, `team.db-wal`,
43
43
  `team.db-shm`, and `team-db-errors.log`; the root `.gitignore` is never edited.
44
44
 
45
+ The seeded engine copy is **skip-if-exists** too, so a consumer that already holds `.ai.local/scripts/rule-improver.mjs`
46
+ keeps the old engine and does **not** get the per-store budget split — the human store `.ai.local/rules/**` (≤ 5 rules,
47
+ ≤ 170 lines) and the machine store `.ai.local/conventions.md` (≤ 30 lines) now carry separate caps, the combined
48
+ envelope stays 200. The shipped `conventions.md` template is 27 non-empty lines, so a fresh install has three lines of
49
+ machine headroom before the loop stages instead. Delete the changed seeded modules and re-run `init` / `update`:
50
+
51
+ ```bash
52
+ rm .ai.local/scripts/rule-improver.mjs
53
+ rm .ai.local/scripts/run.mjs
54
+ rm .ai.local/scripts/team-db-schema.mjs
55
+ npx @bonesofspring/ai-rules update
56
+ ```
57
+
58
+ The 0.2.56 delete-task release also changes `team-db.mjs`, `team-db-project.mjs`, `team-db-api.mjs`, and
59
+ `team-db-openapi.mjs`; delete those too if you are taking both changes.
60
+
61
+ Promote a staged seed by hand; the engine never activates one on its own:
62
+
63
+ ```bash
64
+ node .ai.local/scripts/rule-improver.mjs --promote <stem>
65
+ ```
66
+
67
+ The command strips the provenance footer from `.ai.local/rules-library/<stem>.md`, writes the reviewed rule into
68
+ `.ai.local/rules/`, removes the seed, and appends a `seed-promoted` row bound to the reviewed snapshot. Every seed the
69
+ engine stages carries a four-field footer (`signature`, `stagedAt`, `sourceSlug`, `state: awaiting-human-promotion`); a
70
+ copy of a shipped template carries none.
71
+
45
72
  The same seeding ships `manifest.mjs`, the writer for `.ai.local/team/tasks/<slug>/artifact-manifest.json`:
46
73
 
47
74
  ```bash
@@ -413,7 +413,7 @@ Load these when editing files under `packages/ai-rules/presets/**`, `.cursor/**`
413
413
  | `scripts/check-preset-twin-drift.mjs` / `yarn check:preset-twin-drift` | **FAIL** when a hand-maintained Claude twin (`presets/claude/<stack>/{commands,skills}/**/*.md`) drifts further from its Cursor source than `scripts/_lib/claude-twin-drift-baseline.json` records, when the recorded divergence between the twins changes while the line delta does not, when a command/skill has no twin on the other side, when a new pair has no baseline row, when a baseline row has no live pair, or when the baseline itself is missing its hash rows. Full parity is not required: mirror a change in both twins (delta and divergence unchanged) or record a deliberate divergence with `--update`. Raising an allowance needs `--update --widen`; dropping a row needs `--update --prune`. Fixture `test-preset-twin-drift.mjs`. |
414
414
  | `scripts/check-claude-agent-parity.mjs` / `yarn check:claude-agent-parity` | **FAIL** when a hand-maintained Claude `agents/*.md` twin drifts from its Cursor source beyond `scripts/_lib/claude-agent-parity-baseline.json`: a grown or shrunk normalized line delta, a one-sided rewrite at an unchanged delta, a changed divergence hash, a missing twin, an unrecorded pair, an orphan row, or a pair in the static `parity` allowlist that is not at delta 0. Normalization masks packaging only — YAML frontmatter, the `## Rules to load (subagent context)` block, `<!-- shared-core -->` markers, the two anti-hallucination load lines, the `.cursor/` / `.claude/` root, and `.mdc` → `.md` — and reuses the twin-drift diff helpers. `--update` re-records deltas and hashes; `--widen` / `--prune` gate a raised allowance or a dropped row; `parity` is never edited by `--update`. Fixture `test-claude-agent-parity.mjs` proves one-sided Claude FAIL, one-sided Cursor FAIL and mirrored PASS. Wired into `check-preset-structure.sh` next to `claude-agent-blocks`. |
415
415
  | `scripts/check-consumer-links.mjs` / `yarn check:consumer-links` | **FAIL** when a generated Claude rule or agent carries a source-only `.cursor/` path or a `.mdc` reference whose stem resolves through `claude/<stack>/rules/README.md`; `README.md` and `preset-*.md` are exempt by class. `scripts/_lib/claude-consumer-link-allowlist.json` records the legitimate lines one hash at a time; a stale row fails, and a planted line in an allowlisted file still fails unless it matches the recorded hash. `--update` re-hashes recorded rows only and refuses to add one. Scans `next` by default; `--stack` opts another stack in. Fixture `test-consumer-links.mjs`. Wired into `check-preset-structure.sh` next to `generated-drift`. |
416
- | `scripts/check-preset-token-budget.sh` / `yarn check:preset-token-budget` | **FAIL** if Cursor `alwaysApply: true` or Claude no-`paths:` (excl. README) count is outside **3–10**, `preset-*` always-on, or intended body sum > **4000**. Stacks include `nuxt`, `svelte`. |
416
+ | `scripts/check-preset-token-budget.sh` / `yarn check:preset-token-budget` | **FAIL** if Cursor `alwaysApply: true` or Claude no-`paths:` (excl. README) count is outside **3–10**, `preset-*` always-on, or intended body sum > **4000**. Stacks include `nuxt`, `svelte`. CI also compares the baseline to the base revision (`--base`); a widening needs `--update --widen`. |
417
417
  | `scripts/check-preset-leakage.sh` / `yarn check:preset-leakage` | **FAIL** on forbidden stems in `hooks/**/*.sh` (recursive), wrong-stack agent filenames, or **positive** (non-negation) agent body mentions; **FAIL** if chain scripts are byte-identical across stacks. Explicit **negation** of forbidden stems in agent bodies is **suppressed** (INFO summary count only — not a merge blocker). Non-negation mentions in `build-verifier` → **WARN only**. |
418
418
  | `scripts/check-preset-prompt-persistence.sh` / `yarn check:preset-structure` | **FAIL** if the prompt-persistence contract (`prompt.md` + the append-only `prompt-log.md` ledger, both on the `routing` entry) is missing from any platform × stack command (`task.md` + `task-continue.md`), orchestrator, or intake body, from the **always-on** root `REPO_AGENTS.md` entry (check **E** — reachability without `/task`), or a core `agent-artifact-contracts` anchor (`## Prompt artifact` / `## Prompt log`) is gone; **refuses vacuous PASS** when the iteration set is empty. Wired into `check-preset-structure.sh` next to `goal-contract`; fixture `test-preset-prompt-persistence-fixtures.mjs`. |
419
419
  | `scripts/check-preset-reachability.sh` / `yarn check:preset-reachability` | **FAIL** if a non-`preset-*` OpenCode/Mavis rule is reachable by neither a direct reference (entry / agent / command / skill) nor the transitive closure of rule→rule references from the `root-entry` rules. `preset-*` meta rules are exempt as preset-authoring-only. **Refuses vacuous PASS** on an empty iteration set. Wired into `check-preset-structure.sh` next to `prompt-persistence`. |
@@ -466,6 +466,18 @@ Skills are behavior-shaping, not essays. When adding or editing `skills/**/SKILL
466
466
 
467
467
  Author-only: this section is **not** copied by `init`.
468
468
 
469
+ ### Advisory tier (rule authoring)
470
+
471
+ `scripts/check-preset-authoring-advisory.mjs` is the third tier: it reports, it never blocks.
472
+
473
+ - Expect four finding classes: `restated-stem`, `paraphrased-when-do`, `unjustified-body-size`, `issue-number-density`.
474
+ - Expect one line per finding and a final `advisory-findings: <n>`; the checker always exits `0`.
475
+ - Read a finding as a review item, never as a gate failure.
476
+ - Run it through `check:preset-structure`: the `authoring-advisory` row is non-blocking (`<<< authoring-advisory: WARN (<n> finding(s); not a hard gate)`), so `check:all` stays green with findings present.
477
+ - Read the per-rule body threshold (`advisoryPerRuleBodyCap`) from `scripts/_lib/preset-token-budget-baseline.json` — the same baseline the blocking token-budget gate reads. The advisory tier holds no cap literal of its own; the threshold is advisory metadata, not one of the five ratcheted hard caps.
478
+ - Fix a `restated-stem` finding by linking the sibling stem instead of repeating its sentence.
479
+ - Keep the tier out of the pipeline hook tree: it is a repository gate, not a hook.
480
+
469
481
  ### B1–B5 stems (all stacks)
470
482
 
471
483
  | Stem | Drift mode | Why | Consumers |
package/docs/TEAM-DB.md CHANGED
@@ -8,10 +8,10 @@ The projection is installed by `init` as six modules under `.ai.local/scripts/`:
8
8
 
9
9
  | Module | Role |
10
10
  |---|---|
11
- | `team-db.mjs` | CLI: `init`, `sync`, `migrate-tasks`, `check`, `serve` |
11
+ | `team-db.mjs` | CLI: `init`, `sync`, `delete`, `migrate-tasks`, `check`, `serve` |
12
12
  | `team-db-schema.mjs` | capability probe, embedded migrations, pragmas, fingerprint, integrity |
13
- | `team-db-project.mjs` | parsers, idempotent projector, retention, search |
14
- | `team-db-api.mjs` | read-only `node:http` server, query layer, security boundary |
13
+ | `team-db-project.mjs` | parsers, idempotent projector, confirmed task deletion, retention, search |
14
+ | `team-db-api.mjs` | `node:http` server (reads plus two bounded mutations), query layer, security boundary |
15
15
  | `team-db-openapi.mjs` | the OpenAPI 3.1 document source |
16
16
  | `team-db-dashboard.mjs` | the no-build dashboard (HTML, CSS, JS strings) |
17
17
 
@@ -22,11 +22,16 @@ The projection is installed by `init` as six modules under `.ai.local/scripts/`:
22
22
  No agent writes a lifecycle field through the projection.
23
23
  - **The database is rebuildable.** Delete `team.db*` and run `sync`; the next run recreates
24
24
  the schema and reconverges. A schema fingerprint mismatch rebuilds automatically.
25
- - **Writes are isolated.** A projection failure never fails a file write or a receipt. The
26
- hook and `manifest.mjs` run a bounded child (5 s, `SIGKILL`) and append one line to
27
- `team-db-errors.log` on failure.
28
- - **One read-only surface.** `POST /api/v1/sync` is the only mutation; every other route is
29
- `GET`/`HEAD`. There is no write-back, no telemetry, and no outbound request.
25
+ - **Writes are isolated.** A projection or deletion failure never fails a file write or a
26
+ receipt. The hook and `manifest.mjs` each run a bounded child (5 s, `SIGKILL`) and append
27
+ one line to `team-db-errors.log` on failure; the confirmed task delete runs its own
28
+ bounded child (30 s, `SIGKILL`), and its failure reaches the caller through the one error
29
+ envelope, or one stderr line on the CLI.
30
+ - **Two bounded mutations.** `POST /api/v1/sync` re-runs the projector; `DELETE
31
+ /api/v1/tasks/{slug}` deletes one confirmed task (the folder first, then the rows). Every
32
+ other route is `GET`/`HEAD`, and both mutations run as bounded child processes — the
33
+ server process never opens a writable connection, and the kill switch stops both before a
34
+ child is spawned. There is no write-back, no telemetry, and no outbound request.
30
35
  - **Local only.** The server binds loopback by default, checks `Host` and `Origin`, sends no
31
36
  CORS header, and serves raw documents from SQLite by exact `(slug, path)` lookup.
32
37
 
@@ -63,6 +68,7 @@ below the floor, or a build without `node:sqlite`, is detected at runtime:
63
68
  | `manifest.mjs` upsert | one line, return 0 after the receipt | silent, return 0 |
64
69
  | `team-db.mjs init` / `sync` / `migrate-tasks` | one line, exit 0, no file | one line, exit 0, no file |
65
70
  | `team-db.mjs check` | one line, exit 1 | one line, exit 1 |
71
+ | `team-db.mjs delete` | one line, exit 2 | one line, exit 1 |
66
72
  | `team-db.mjs serve` | one line, exit 0 | one line, exit 0 |
67
73
 
68
74
  The file-only pipeline is unchanged: `status.json` / `metrics.json` writes, manifest upserts,
@@ -75,6 +81,7 @@ node .ai.local/scripts/team-db.mjs init [--root <team-dir>] [--rebuild]
75
81
  node .ai.local/scripts/team-db.mjs sync [--root <team-dir>] [--slug <slug>] [--quiet] [--json]
76
82
  [--maintain] [--prune] [--vacuum]
77
83
  [--rebuild | --no-rebuild] [--deadline-ms <n>]
84
+ node .ai.local/scripts/team-db.mjs delete --slug <slug> [--root <team-dir>] [--json]
78
85
  node .ai.local/scripts/team-db.mjs migrate-tasks [--root <team-dir>] [--quiet] [--json]
79
86
  [--rebuild | --no-rebuild]
80
87
  node .ai.local/scripts/team-db.mjs check [--root <team-dir>]
@@ -82,9 +89,11 @@ node .ai.local/scripts/team-db.mjs serve [--root <team-dir>] [--host <addr>] [--
82
89
  [--allow-remote] [--open]
83
90
  ```
84
91
 
85
- Exit codes: `0` ok, `1` at least one task failed or a migration checksum drifted, `2`
86
- database-level failure, `3` usage, `4` deadline or busy database on the hook-shaped `--slug`
87
- path.
92
+ Exit codes: `0` ok, `1` at least one task failed, a delete refusal (unknown slug, active
93
+ task, kill switch, folder-delete failure) or a migration checksum drifted, `2`
94
+ database-level failure — a `delete` without `node:sqlite` refuses here rather than deleting
95
+ the folder only, `3` usage, `4` deadline or busy database (the hook-shaped `sync --slug`
96
+ deadline, or a delete that meets a locked database).
88
97
 
89
98
  `sync` is idempotent: a second run reports `inserted=0 updated=0 unchanged=<n>`. One changed
90
99
  byte changes exactly one document hash and one task content hash. A removed task directory is
@@ -102,6 +111,20 @@ suppresses only the human line. `failed` is an overlay counter — a malformed t
102
111
  `inserted`/`updated` **and** in `failed`, so the counters are not a partition. `--slug`,
103
112
  `--maintain`, `--prune`, `--vacuum`, and `--deadline-ms` do not apply to this verb (exit 3).
104
113
 
114
+ `delete` removes one task on explicit request. The slug is validated against the shared
115
+ pattern and confined to `.ai.local/team/tasks/<slug>/` — a symlink at that path is refused
116
+ with `E_NOT_FOUND`, never followed or removed. The kill switch refuses with `E_DISABLED`
117
+ before anything runs; a task whose slug equals `active-task.json`'s slug is refused with
118
+ `E_ACTIVE_TASK`; an unknown slug is refused with `E_NOT_FOUND`. The deletion itself is
119
+ folder first, then one transaction that removes the task's search rows and the task row
120
+ (every child row goes by foreign-key cascade); no `sync_runs` row is written. If the
121
+ process dies between the two legs, the next `sync` marks the leftover rows absent and
122
+ `sync --prune` removes them — content never resurrects. Repeating a finished delete
123
+ refuses with `E_NOT_FOUND`. With `--json` the command prints exactly one machine-readable
124
+ line: `{ ok: true, slug, folderRemoved, rowsDeleted }` on success, `{ ok: false, code,
125
+ message }` on a refusal. The delete runs wherever the command runs: the team root it
126
+ targets must be on the same host.
127
+
105
128
  ## Environment names
106
129
 
107
130
  | Name | Effect |
@@ -134,18 +157,62 @@ and sets `content_omitted=size` (binary content sets `binary`). Raw content olde
134
157
  days on an absent task is nulled only by `sync --maintain`; `sync --vacuum` checkpoints WAL and
135
158
  runs `VACUUM`. The `sync_runs` table keeps the newest 200 runs.
136
159
 
160
+ ### FTS shape registry
161
+
162
+ `team-db-schema.mjs` enumerates the released search layouts in `FTS_SHAPES`, oldest-first, with the current shape
163
+ last. One shape is released today: `fts5-v1` — columns `task_slug UNINDEXED`, `doc_path UNINDEXED`, `kind
164
+ UNINDEXED`, `body`, tokenizer `unicode61 remove_diacritics 2`. `CURRENT_FTS_SHAPE` is the last entry; append the next
165
+ layout, never edit a released one in place.
166
+
167
+ The shape identity is recorded in `schema_meta` under the key `search_fts_shape`, next to the `search` mode row. The
168
+ token is written **only when the search table is created**: a database that predates the registry keeps an absent
169
+ token and keeps being reported.
170
+
171
+ `detectFtsShapeDrift(db)` returns one of five states:
172
+
173
+ | State | Meaning |
174
+ |---|---|
175
+ | `absent` | no `search_fts` table — the runtime stayed on the `LIKE` path |
176
+ | `current` | the recorded token is the current shape and the installed columns match it |
177
+ | `unrecorded` | the table exists and no `search_fts_shape` row does — a pre-registry database |
178
+ | `superseded` | the recorded token names a released, older shape |
179
+ | `unknown` | the token names no released shape, or the installed columns differ from the recorded shape |
180
+
181
+ Drift is **reported, never repaired**: the live table is never dropped, altered, or rebuilt, the database stays
182
+ readable, and the existing rebuild path (`team-db.mjs sync --rebuild`) stays the remedy. `team-db.mjs check` names a
183
+ drifted state in its `search-shape <state>` field.
184
+
185
+ The registry is not a migration chain: `MIGRATIONS` and `SCHEMA_VERSION` are unchanged, `E_SCHEMA_NEWER` still fails
186
+ closed, and FTS5 stays a **runtime capability** — a runtime without FTS5 records `like` in `schema_meta`, so the
187
+ registry never turns FTS5 into a hard schema dependency.
188
+
137
189
  ## Dashboard and API
138
190
 
139
191
  `team-db.mjs serve` prints one line with the bound URL (default
140
192
  `http://127.0.0.1:4178`). The dashboard is a single no-build HTML document at `/`, its CSS and
141
193
  JS are served from `/assets/`, and the OpenAPI 3.1 document is at `/openapi.json`. The frozen
142
194
  document is checked in at `packages/ai-rules/docs/openapi/team-db.v1.json`; the gate is
143
- `node scripts/check-team-db-contract.mjs`.
195
+ `node scripts/check-team-db-contract.mjs`. The server loads its modules at start: restart
196
+ `serve` after an update to take a new route or method set — a stale process keeps answering
197
+ the old surface (for example, `405` on a route the new code serves).
198
+
199
+ The API exposes the delete as `DELETE /api/v1/tasks/{slug}` — the same canonical deletion
200
+ as the CLI, executed as one bounded child. It answers `200` with `{"slug":"<S>"}` on
201
+ success, `404 E_NOT_FOUND` for an unknown slug, `409 E_ACTIVE_TASK` with
202
+ `details.activeSlug` when the slug is the active task, `503 E_DISABLED` when the kill
203
+ switch is set, and `503 E_BUSY` when the child is killed at its 30 s bound; a wrong method
204
+ on the shared path answers `405` with `Allow: GET, HEAD, DELETE`, and the request body is
205
+ ignored. An unexpected child failure maps to the generic `E_INTERNAL` envelope with one
206
+ trimmed stderr line from the child. The delete executes wherever the API runs — the host
207
+ that owns `.ai.local/team/`; a UI that only proxies to the API (for example the
208
+ containerized team-tasks-ui) deletes through it on that same host.
144
209
 
145
210
  Security boundary: loopback bind by default (`--host` outside loopback needs
146
211
  `--allow-remote`, and a wildcard address is refused), exact `Host`/`Origin` allow-list,
147
212
  no `Access-Control-*` header, hardened response headers, request bodies bounded at 1 KiB,
148
213
  document chunks at 1 MiB, exports at 5 MiB, parameterized SQL only, and no outbound call.
214
+ `--allow-remote` also exposes the confirmed delete and the rescan to the named interface
215
+ without authentication.
149
216
 
150
217
  ## Privacy and retention
151
218
 
@@ -156,7 +223,9 @@ for tasks absent longer than 90 days while keeping normalized rows and hashes.
156
223
 
157
224
  ## Rollback
158
225
 
159
- 1. Set `AI_RULES_TEAM_DB_DISABLE=1`. Every write point and `serve` becomes a no-op with exit 0.
226
+ 1. Set `AI_RULES_TEAM_DB_DISABLE=1`. Every write point becomes a no-op: the hook,
227
+ `manifest.mjs`, `init`/`sync`/`migrate-tasks` and `serve` exit 0; `delete` refuses with
228
+ exit 1 and touches nothing.
160
229
  2. Delete the projection: `rm -f .ai.local/team/team.db .ai.local/team/team.db-wal
161
230
  .ai.local/team/team.db-shm .ai.local/team/team-db-errors.log`. No task file is touched.
162
231
  3. Revert the code: remove the hook region and the `projectAfterReceipt` call, delete the six
@@ -3,8 +3,8 @@
3
3
  "jsonSchemaDialect": "https://json-schema.org/draft/2020-12/schema",
4
4
  "info": {
5
5
  "title": "Agent team SQLite projection API",
6
- "summary": "Read-only projection of `.ai.local/team`. Task files are authoritative; the database is a rebuildable copy. The only mutation is an idempotent rescan.",
7
- "description": "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`.",
6
+ "summary": "Projection of `.ai.local/team`. Task files are authoritative; the database is a rebuildable copy. Two mutations exist — the idempotent rescan and the confirmed task delete — and both run as bounded child processes.",
7
+ "description": "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`.",
8
8
  "version": "1.0.0",
9
9
  "x-api-major": 1
10
10
  },
@@ -759,6 +759,107 @@
759
759
  }
760
760
  },
761
761
  "security": []
762
+ },
763
+ "delete": {
764
+ "tags": [
765
+ "tasks"
766
+ ],
767
+ "summary": "Delete one task: the task folder first, then its projection rows",
768
+ "description": "Confirmed, destructive and irreversible. The task folder `.ai.local/team/tasks/{slug}` is removed before the database rows, so a crash between the two legs converges toward deleted on the next rescan and never resurrects content. The row delete is one transaction: the task row plus every child row by cascade, plus the task's search rows. The slug in `active-task.json` is refused with 409 `E_ACTIVE_TASK`. An unknown slug answers 404 `E_NOT_FOUND` and touches nothing. The request body is ignored and no query parameters are declared. Executed as a bounded child process; `AI_RULES_TEAM_DB_DISABLE=1` answers 503 `E_DISABLED` before anything runs.",
769
+ "operationId": "deleteTask",
770
+ "parameters": [
771
+ {
772
+ "name": "slug",
773
+ "in": "path",
774
+ "required": true,
775
+ "description": "Task directory name.",
776
+ "schema": {
777
+ "type": "string",
778
+ "pattern": "^[a-z0-9]+(?:-[a-z0-9]+)*$"
779
+ }
780
+ }
781
+ ],
782
+ "responses": {
783
+ "200": {
784
+ "description": "The deleted slug",
785
+ "content": {
786
+ "application/json": {
787
+ "schema": {
788
+ "$ref": "#/components/schemas/TaskDeleteResult"
789
+ }
790
+ }
791
+ }
792
+ },
793
+ "400": {
794
+ "description": "Malformed request: an invalid slug",
795
+ "content": {
796
+ "application/json": {
797
+ "schema": {
798
+ "$ref": "#/components/schemas/ErrorEnvelope"
799
+ }
800
+ }
801
+ }
802
+ },
803
+ "403": {
804
+ "description": "A non-loopback Host or Origin was rejected before routing",
805
+ "content": {
806
+ "application/json": {
807
+ "schema": {
808
+ "$ref": "#/components/schemas/ErrorEnvelope"
809
+ }
810
+ }
811
+ }
812
+ },
813
+ "404": {
814
+ "description": "The task does not exist in the projection or on disk",
815
+ "content": {
816
+ "application/json": {
817
+ "schema": {
818
+ "$ref": "#/components/schemas/ErrorEnvelope"
819
+ }
820
+ }
821
+ }
822
+ },
823
+ "405": {
824
+ "description": "The route does not accept this method; the response carries an Allow header",
825
+ "headers": {
826
+ "Allow": {
827
+ "description": "HTTP methods allowed on this path, for example `GET, HEAD`",
828
+ "schema": {
829
+ "type": "string"
830
+ }
831
+ }
832
+ },
833
+ "content": {
834
+ "application/json": {
835
+ "schema": {
836
+ "$ref": "#/components/schemas/ErrorEnvelope"
837
+ }
838
+ }
839
+ }
840
+ },
841
+ "409": {
842
+ "description": "The slug is the active task; the delete is refused with `details.activeSlug` naming it",
843
+ "content": {
844
+ "application/json": {
845
+ "schema": {
846
+ "$ref": "#/components/schemas/ErrorEnvelope"
847
+ }
848
+ }
849
+ }
850
+ },
851
+ "503": {
852
+ "description": "The projection is disabled, the database is missing, unusable, busy, or the child exceeded its time bound",
853
+ "content": {
854
+ "application/json": {
855
+ "schema": {
856
+ "$ref": "#/components/schemas/ErrorEnvelope"
857
+ }
858
+ }
859
+ }
860
+ }
861
+ },
862
+ "security": []
762
863
  }
763
864
  },
764
865
  "/api/v1/tasks/{slug}/pipeline": {
@@ -2490,6 +2591,7 @@
2490
2591
  "E_DOC_NOT_FOUND",
2491
2592
  "E_DOC_BINARY",
2492
2593
  "E_DOC_CONTENT_OMITTED",
2594
+ "E_ACTIVE_TASK",
2493
2595
  "E_RANGE",
2494
2596
  "E_DISABLED",
2495
2597
  "E_DB_MISSING",
@@ -2842,6 +2944,24 @@
2842
2944
  }
2843
2945
  ]
2844
2946
  },
2947
+ "TaskDeleteResult": {
2948
+ "type": "object",
2949
+ "additionalProperties": false,
2950
+ "properties": {
2951
+ "slug": {
2952
+ "type": "string",
2953
+ "pattern": "^[a-z0-9]+(?:-[a-z0-9]+)*$"
2954
+ }
2955
+ },
2956
+ "required": [
2957
+ "slug"
2958
+ ],
2959
+ "examples": [
2960
+ {
2961
+ "slug": "agent-team-sqlite-dashboard"
2962
+ }
2963
+ ]
2964
+ },
2845
2965
  "TaskDetail": {
2846
2966
  "type": "object",
2847
2967
  "additionalProperties": false,
@@ -4662,13 +4782,24 @@
4662
4782
  "string",
4663
4783
  "null"
4664
4784
  ]
4785
+ },
4786
+ "capabilities": {
4787
+ "type": "array",
4788
+ "items": {
4789
+ "type": "string",
4790
+ "enum": [
4791
+ "sync",
4792
+ "delete"
4793
+ ]
4794
+ }
4665
4795
  }
4666
4796
  },
4667
4797
  "required": [
4668
4798
  "status",
4669
4799
  "db",
4670
4800
  "tasks",
4671
- "projectedAt"
4801
+ "projectedAt",
4802
+ "capabilities"
4672
4803
  ],
4673
4804
  "examples": [
4674
4805
  {
@@ -4684,7 +4815,11 @@
4684
4815
  "total": 90,
4685
4816
  "absent": 0
4686
4817
  },
4687
- "projectedAt": "2026-11-06T08:00:04.000Z"
4818
+ "projectedAt": "2026-11-06T08:00:04.000Z",
4819
+ "capabilities": [
4820
+ "sync",
4821
+ "delete"
4822
+ ]
4688
4823
  }
4689
4824
  ]
4690
4825
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bonesofspring/ai-rules",
3
- "version": "0.2.55",
3
+ "version": "0.2.57",
4
4
  "description": "Presets of Cursor, Claude, Mavis, OpenCode, and ZCode rules/commands for Revy Ross personal use",
5
5
  "license": "MIT",
6
6
  "author": "Revy Ross",
@@ -38,6 +38,7 @@
38
38
  "check:fast": "AI_RULES_SKIP_HOOK_TESTS=1 bash scripts/check-preset-structure.sh",
39
39
  "test:hooks": "node scripts/test-chain-team-phases-coverage.mjs && node scripts/test-agent-task-metrics-hooks.mjs",
40
40
  "check:preset-structure": "bash scripts/check-preset-structure.sh",
41
+ "check:preset-delta": "node scripts/check-preset-delta.mjs",
41
42
  "check:parallel-plan": "bash scripts/check-parallel-plan.sh",
42
43
  "check:step-graph-contract": "bash scripts/check-step-graph-contract.sh",
43
44
  "test:parallel-plan-fixtures": "node scripts/test-parallel-plan-fixtures.mjs",