@bonesofspring/ai-rules 0.2.48 → 0.2.50

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 (508) hide show
  1. package/CHANGELOG.md +48 -0
  2. package/README.md +12 -1
  3. package/docs/PRESET-CONTRIBUTION.md +17 -4
  4. package/package.json +5 -1
  5. package/presets/_shared/ai-local/scripts/derive-gate-signals.mjs +1 -0
  6. package/presets/_shared/ai-local/scripts/manifest.mjs +30 -9
  7. package/presets/_shared/ai-local/scripts/rule-improver.mjs +42 -7
  8. package/presets/_shared/ai-local/scripts/signals.mjs +7 -1
  9. package/presets/_shared/core/agent-team/agent-artifact-contracts.md +5 -2
  10. package/presets/_shared/core/agent-team/agent-team-orchestrator.md +1 -1
  11. package/presets/_shared/core/quality/code-quality-and-refactoring.md +1 -8
  12. package/presets/_shared/core/quality/interactive-questions.md +27 -0
  13. package/presets/_shared/core/review/technical-retro.md +2 -0
  14. package/presets/_shared/hooks/chain-team-phases.sh.tmpl +9 -0
  15. package/presets/claude/android-kotlin/agents/build-verifier.md +1 -1
  16. package/presets/claude/android-kotlin/agents/code-reviewer.md +1 -1
  17. package/presets/claude/android-kotlin/agents/debugger.md +1 -1
  18. package/presets/claude/android-kotlin/agents/feature-developer.md +1 -1
  19. package/presets/claude/android-kotlin/agents/qa-tester.md +1 -1
  20. package/presets/claude/android-kotlin/commands/technical-retro.md +1 -1
  21. package/presets/claude/android-kotlin/hooks/chain-team-phases.sh +9 -0
  22. package/presets/claude/android-kotlin/rules/README.md +1 -0
  23. package/presets/claude/android-kotlin/rules/tooling-and-review/agent-team-orchestrator.md +1 -1
  24. package/presets/claude/android-kotlin/rules/tooling-and-review/code-quality.md +1 -8
  25. package/presets/claude/android-kotlin/rules/tooling-and-review/interactive-questions.md +34 -0
  26. package/presets/claude/android-kotlin/rules/tooling-and-review/technical-retro.md +2 -0
  27. package/presets/claude/android-kotlin/skills/technical-retro/SKILL.md +1 -1
  28. package/presets/claude/go/agents/build-verifier.md +1 -1
  29. package/presets/claude/go/agents/code-reviewer.md +1 -1
  30. package/presets/claude/go/agents/debugger.md +1 -1
  31. package/presets/claude/go/agents/feature-developer.md +1 -1
  32. package/presets/claude/go/agents/qa-tester.md +1 -1
  33. package/presets/claude/go/commands/technical-retro.md +1 -1
  34. package/presets/claude/go/hooks/chain-team-phases.sh +9 -0
  35. package/presets/claude/go/rules/README.md +1 -0
  36. package/presets/claude/go/rules/tooling-and-review/agent-team-orchestrator.md +1 -1
  37. package/presets/claude/go/rules/tooling-and-review/code-quality.md +1 -8
  38. package/presets/claude/go/rules/tooling-and-review/interactive-questions.md +34 -0
  39. package/presets/claude/go/rules/tooling-and-review/technical-retro.md +2 -0
  40. package/presets/claude/go/skills/technical-retro/SKILL.md +1 -1
  41. package/presets/claude/ios-swift/agents/build-verifier.md +1 -1
  42. package/presets/claude/ios-swift/agents/code-reviewer.md +1 -1
  43. package/presets/claude/ios-swift/agents/debugger.md +1 -1
  44. package/presets/claude/ios-swift/agents/feature-developer.md +1 -1
  45. package/presets/claude/ios-swift/agents/qa-tester.md +1 -1
  46. package/presets/claude/ios-swift/commands/technical-retro.md +1 -1
  47. package/presets/claude/ios-swift/hooks/chain-team-phases.sh +9 -0
  48. package/presets/claude/ios-swift/rules/README.md +2 -0
  49. package/presets/claude/ios-swift/rules/tooling-and-review/agent-team-orchestrator.md +1 -1
  50. package/presets/claude/ios-swift/rules/tooling-and-review/code-quality.md +1 -8
  51. package/presets/claude/ios-swift/rules/tooling-and-review/interactive-questions.md +34 -0
  52. package/presets/claude/ios-swift/rules/tooling-and-review/technical-retro.md +2 -0
  53. package/presets/claude/ios-swift/skills/technical-retro/SKILL.md +1 -1
  54. package/presets/claude/java/agents/build-verifier.md +1 -1
  55. package/presets/claude/java/agents/code-reviewer.md +1 -1
  56. package/presets/claude/java/agents/debugger.md +1 -1
  57. package/presets/claude/java/agents/feature-developer.md +1 -1
  58. package/presets/claude/java/agents/qa-tester.md +1 -1
  59. package/presets/claude/java/commands/technical-retro.md +1 -1
  60. package/presets/claude/java/hooks/chain-team-phases.sh +9 -0
  61. package/presets/claude/java/rules/README.md +1 -0
  62. package/presets/claude/java/rules/tooling-and-review/agent-team-orchestrator.md +1 -1
  63. package/presets/claude/java/rules/tooling-and-review/code-quality.md +1 -8
  64. package/presets/claude/java/rules/tooling-and-review/interactive-questions.md +34 -0
  65. package/presets/claude/java/rules/tooling-and-review/technical-retro.md +2 -0
  66. package/presets/claude/java/skills/technical-retro/SKILL.md +1 -1
  67. package/presets/claude/mcp-ts/agents/build-verifier.md +1 -1
  68. package/presets/claude/mcp-ts/agents/feature-developer.md +1 -1
  69. package/presets/claude/mcp-ts/commands/technical-retro.md +1 -1
  70. package/presets/claude/mcp-ts/hooks/chain-team-phases.sh +9 -0
  71. package/presets/claude/mcp-ts/rules/README.md +1 -0
  72. package/presets/claude/mcp-ts/rules/tooling-and-review/agent-team-orchestrator.md +1 -1
  73. package/presets/claude/mcp-ts/rules/tooling-and-review/code-quality.md +1 -8
  74. package/presets/claude/mcp-ts/rules/tooling-and-review/interactive-questions.md +34 -0
  75. package/presets/claude/mcp-ts/rules/tooling-and-review/technical-retro.md +2 -0
  76. package/presets/claude/next/agents/build-verifier.md +1 -1
  77. package/presets/claude/next/agents/code-reviewer.md +1 -1
  78. package/presets/claude/next/agents/debugger.md +1 -1
  79. package/presets/claude/next/agents/feature-developer.md +1 -1
  80. package/presets/claude/next/agents/qa-tester.md +1 -1
  81. package/presets/claude/next/commands/technical-retro.md +1 -1
  82. package/presets/claude/next/hooks/chain-team-phases.sh +9 -0
  83. package/presets/claude/next/rules/README.md +3 -1
  84. package/presets/claude/next/rules/tooling-and-review/agent-team-orchestrator.md +1 -1
  85. package/presets/claude/next/rules/tooling-and-review/code-quality.md +1 -8
  86. package/presets/claude/next/rules/tooling-and-review/interactive-questions.md +34 -0
  87. package/presets/claude/next/rules/tooling-and-review/technical-retro.md +2 -0
  88. package/presets/claude/next/skills/technical-retro/SKILL.md +1 -1
  89. package/presets/claude/nuxt/agents/build-verifier.md +1 -1
  90. package/presets/claude/nuxt/agents/code-reviewer.md +1 -1
  91. package/presets/claude/nuxt/agents/debugger.md +1 -1
  92. package/presets/claude/nuxt/agents/feature-developer.md +1 -1
  93. package/presets/claude/nuxt/agents/qa-tester.md +1 -1
  94. package/presets/claude/nuxt/commands/technical-retro.md +1 -1
  95. package/presets/claude/nuxt/hooks/chain-team-phases.sh +9 -0
  96. package/presets/claude/nuxt/rules/README.md +2 -0
  97. package/presets/claude/nuxt/rules/tooling-and-review/agent-team-orchestrator.md +1 -1
  98. package/presets/claude/nuxt/rules/tooling-and-review/code-quality.md +1 -8
  99. package/presets/claude/nuxt/rules/tooling-and-review/interactive-questions.md +34 -0
  100. package/presets/claude/nuxt/rules/tooling-and-review/technical-retro.md +2 -0
  101. package/presets/claude/nuxt/skills/technical-retro/SKILL.md +1 -1
  102. package/presets/claude/php-hexagonal/agents/build-verifier.md +1 -1
  103. package/presets/claude/php-hexagonal/agents/code-reviewer.md +1 -1
  104. package/presets/claude/php-hexagonal/agents/debugger.md +1 -1
  105. package/presets/claude/php-hexagonal/agents/feature-developer.md +1 -1
  106. package/presets/claude/php-hexagonal/agents/qa-tester.md +1 -1
  107. package/presets/claude/php-hexagonal/commands/technical-retro.md +1 -1
  108. package/presets/claude/php-hexagonal/hooks/chain-team-phases.sh +9 -0
  109. package/presets/claude/php-hexagonal/rules/README.md +1 -0
  110. package/presets/claude/php-hexagonal/rules/tooling-and-review/agent-team-orchestrator.md +1 -1
  111. package/presets/claude/php-hexagonal/rules/tooling-and-review/code-quality.md +1 -8
  112. package/presets/claude/php-hexagonal/rules/tooling-and-review/interactive-questions.md +34 -0
  113. package/presets/claude/php-hexagonal/rules/tooling-and-review/technical-retro.md +2 -0
  114. package/presets/claude/php-hexagonal/skills/technical-retro/SKILL.md +1 -1
  115. package/presets/claude/php-laravel/agents/build-verifier.md +1 -1
  116. package/presets/claude/php-laravel/agents/code-reviewer.md +1 -1
  117. package/presets/claude/php-laravel/agents/debugger.md +1 -1
  118. package/presets/claude/php-laravel/agents/feature-developer.md +1 -1
  119. package/presets/claude/php-laravel/agents/qa-tester.md +1 -1
  120. package/presets/claude/php-laravel/commands/technical-retro.md +1 -1
  121. package/presets/claude/php-laravel/hooks/chain-team-phases.sh +9 -0
  122. package/presets/claude/php-laravel/rules/README.md +1 -0
  123. package/presets/claude/php-laravel/rules/tooling-and-review/agent-team-orchestrator.md +1 -1
  124. package/presets/claude/php-laravel/rules/tooling-and-review/code-quality.md +1 -8
  125. package/presets/claude/php-laravel/rules/tooling-and-review/interactive-questions.md +34 -0
  126. package/presets/claude/php-laravel/rules/tooling-and-review/technical-retro.md +2 -0
  127. package/presets/claude/php-laravel/skills/technical-retro/SKILL.md +1 -1
  128. package/presets/claude/svelte/agents/build-verifier.md +1 -1
  129. package/presets/claude/svelte/agents/code-reviewer.md +1 -1
  130. package/presets/claude/svelte/agents/debugger.md +1 -1
  131. package/presets/claude/svelte/agents/feature-developer.md +1 -1
  132. package/presets/claude/svelte/agents/qa-tester.md +1 -1
  133. package/presets/claude/svelte/commands/technical-retro.md +1 -1
  134. package/presets/claude/svelte/hooks/chain-team-phases.sh +9 -0
  135. package/presets/claude/svelte/rules/README.md +2 -0
  136. package/presets/claude/svelte/rules/tooling-and-review/agent-team-orchestrator.md +1 -1
  137. package/presets/claude/svelte/rules/tooling-and-review/code-quality.md +1 -8
  138. package/presets/claude/svelte/rules/tooling-and-review/interactive-questions.md +34 -0
  139. package/presets/claude/svelte/rules/tooling-and-review/technical-retro.md +2 -0
  140. package/presets/claude/svelte/skills/technical-retro/SKILL.md +1 -1
  141. package/presets/cursor/android-kotlin/agents/build-verifier.md +1 -1
  142. package/presets/cursor/android-kotlin/agents/code-reviewer.md +1 -1
  143. package/presets/cursor/android-kotlin/agents/debugger.md +1 -1
  144. package/presets/cursor/android-kotlin/agents/feature-developer.md +1 -1
  145. package/presets/cursor/android-kotlin/agents/qa-tester.md +1 -1
  146. package/presets/cursor/android-kotlin/commands/technical-retro.md +1 -1
  147. package/presets/cursor/android-kotlin/hooks/chain-team-phases.sh +9 -0
  148. package/presets/cursor/android-kotlin/rules/README.md +1 -0
  149. package/presets/cursor/android-kotlin/rules/code-quality-and-refactoring.mdc +1 -8
  150. package/presets/cursor/android-kotlin/rules/interactive-questions.mdc +34 -0
  151. package/presets/cursor/android-kotlin/rules/technical-retro.mdc +2 -0
  152. package/presets/cursor/android-kotlin/skills/technical-retro/SKILL.md +1 -1
  153. package/presets/cursor/go/agents/build-verifier.md +1 -1
  154. package/presets/cursor/go/agents/code-reviewer.md +1 -1
  155. package/presets/cursor/go/agents/debugger.md +1 -1
  156. package/presets/cursor/go/agents/feature-developer.md +1 -1
  157. package/presets/cursor/go/agents/qa-tester.md +1 -1
  158. package/presets/cursor/go/commands/technical-retro.md +1 -1
  159. package/presets/cursor/go/hooks/chain-team-phases.sh +9 -0
  160. package/presets/cursor/go/rules/README.md +2 -1
  161. package/presets/cursor/go/rules/code-quality-and-refactoring.mdc +1 -8
  162. package/presets/cursor/go/rules/interactive-questions.mdc +34 -0
  163. package/presets/cursor/go/rules/technical-retro.mdc +2 -0
  164. package/presets/cursor/go/skills/technical-retro/SKILL.md +1 -1
  165. package/presets/cursor/ios-swift/agents/build-verifier.md +1 -1
  166. package/presets/cursor/ios-swift/agents/code-reviewer.md +1 -1
  167. package/presets/cursor/ios-swift/agents/debugger.md +1 -1
  168. package/presets/cursor/ios-swift/agents/feature-developer.md +1 -1
  169. package/presets/cursor/ios-swift/agents/qa-tester.md +1 -1
  170. package/presets/cursor/ios-swift/commands/technical-retro.md +1 -1
  171. package/presets/cursor/ios-swift/hooks/chain-team-phases.sh +9 -0
  172. package/presets/cursor/ios-swift/rules/README.md +1 -0
  173. package/presets/cursor/ios-swift/rules/code-quality-and-refactoring.mdc +1 -8
  174. package/presets/cursor/ios-swift/rules/interactive-questions.mdc +34 -0
  175. package/presets/cursor/ios-swift/rules/technical-retro.mdc +2 -0
  176. package/presets/cursor/ios-swift/skills/technical-retro/SKILL.md +1 -1
  177. package/presets/cursor/java/agents/build-verifier.md +1 -1
  178. package/presets/cursor/java/agents/code-reviewer.md +1 -1
  179. package/presets/cursor/java/agents/debugger.md +1 -1
  180. package/presets/cursor/java/agents/feature-developer.md +1 -1
  181. package/presets/cursor/java/agents/qa-tester.md +1 -1
  182. package/presets/cursor/java/commands/technical-retro.md +1 -1
  183. package/presets/cursor/java/hooks/chain-team-phases.sh +9 -0
  184. package/presets/cursor/java/rules/README.md +2 -1
  185. package/presets/cursor/java/rules/code-quality-and-refactoring.mdc +1 -8
  186. package/presets/cursor/java/rules/interactive-questions.mdc +34 -0
  187. package/presets/cursor/java/rules/technical-retro.mdc +2 -0
  188. package/presets/cursor/java/skills/technical-retro/SKILL.md +1 -1
  189. package/presets/cursor/mcp-ts/agents/build-verifier.md +1 -1
  190. package/presets/cursor/mcp-ts/agents/feature-developer.md +1 -1
  191. package/presets/cursor/mcp-ts/commands/technical-retro.md +1 -1
  192. package/presets/cursor/mcp-ts/hooks/chain-team-phases.sh +9 -0
  193. package/presets/cursor/mcp-ts/rules/README.md +2 -1
  194. package/presets/cursor/mcp-ts/rules/code-quality-and-refactoring.mdc +1 -8
  195. package/presets/cursor/mcp-ts/rules/interactive-questions.mdc +34 -0
  196. package/presets/cursor/mcp-ts/rules/technical-retro.mdc +2 -0
  197. package/presets/cursor/next/agents/build-verifier.md +1 -1
  198. package/presets/cursor/next/agents/code-reviewer.md +1 -1
  199. package/presets/cursor/next/agents/debugger.md +1 -1
  200. package/presets/cursor/next/agents/feature-developer.md +1 -1
  201. package/presets/cursor/next/agents/qa-tester.md +1 -1
  202. package/presets/cursor/next/commands/technical-retro.md +1 -1
  203. package/presets/cursor/next/hooks/chain-team-phases.sh +9 -0
  204. package/presets/cursor/next/rules/README.md +2 -1
  205. package/presets/cursor/next/rules/code-quality-and-refactoring.mdc +1 -8
  206. package/presets/cursor/next/rules/interactive-questions.mdc +34 -0
  207. package/presets/cursor/next/rules/technical-retro.mdc +2 -0
  208. package/presets/cursor/next/skills/technical-retro/SKILL.md +1 -1
  209. package/presets/cursor/nuxt/agents/build-verifier.md +1 -1
  210. package/presets/cursor/nuxt/agents/code-reviewer.md +1 -1
  211. package/presets/cursor/nuxt/agents/debugger.md +1 -1
  212. package/presets/cursor/nuxt/agents/feature-developer.md +1 -1
  213. package/presets/cursor/nuxt/agents/qa-tester.md +1 -1
  214. package/presets/cursor/nuxt/commands/technical-retro.md +1 -1
  215. package/presets/cursor/nuxt/hooks/chain-team-phases.sh +9 -0
  216. package/presets/cursor/nuxt/rules/README.md +2 -1
  217. package/presets/cursor/nuxt/rules/code-quality-and-refactoring.mdc +1 -8
  218. package/presets/cursor/nuxt/rules/interactive-questions.mdc +34 -0
  219. package/presets/cursor/nuxt/rules/technical-retro.mdc +2 -0
  220. package/presets/cursor/nuxt/skills/technical-retro/SKILL.md +1 -1
  221. package/presets/cursor/php-hexagonal/agents/build-verifier.md +1 -1
  222. package/presets/cursor/php-hexagonal/agents/code-reviewer.md +1 -1
  223. package/presets/cursor/php-hexagonal/agents/debugger.md +1 -1
  224. package/presets/cursor/php-hexagonal/agents/feature-developer.md +1 -1
  225. package/presets/cursor/php-hexagonal/agents/qa-tester.md +1 -1
  226. package/presets/cursor/php-hexagonal/commands/technical-retro.md +1 -1
  227. package/presets/cursor/php-hexagonal/hooks/chain-team-phases.sh +9 -0
  228. package/presets/cursor/php-hexagonal/rules/README.md +2 -1
  229. package/presets/cursor/php-hexagonal/rules/code-quality-and-refactoring.mdc +1 -8
  230. package/presets/cursor/php-hexagonal/rules/interactive-questions.mdc +34 -0
  231. package/presets/cursor/php-hexagonal/rules/technical-retro.mdc +2 -0
  232. package/presets/cursor/php-hexagonal/skills/technical-retro/SKILL.md +1 -1
  233. package/presets/cursor/php-laravel/agents/build-verifier.md +1 -1
  234. package/presets/cursor/php-laravel/agents/code-reviewer.md +1 -1
  235. package/presets/cursor/php-laravel/agents/debugger.md +1 -1
  236. package/presets/cursor/php-laravel/agents/feature-developer.md +1 -1
  237. package/presets/cursor/php-laravel/agents/qa-tester.md +1 -1
  238. package/presets/cursor/php-laravel/commands/technical-retro.md +1 -1
  239. package/presets/cursor/php-laravel/hooks/chain-team-phases.sh +9 -0
  240. package/presets/cursor/php-laravel/rules/README.md +2 -1
  241. package/presets/cursor/php-laravel/rules/code-quality-and-refactoring.mdc +1 -8
  242. package/presets/cursor/php-laravel/rules/interactive-questions.mdc +34 -0
  243. package/presets/cursor/php-laravel/rules/technical-retro.mdc +2 -0
  244. package/presets/cursor/php-laravel/skills/technical-retro/SKILL.md +1 -1
  245. package/presets/cursor/svelte/agents/build-verifier.md +1 -1
  246. package/presets/cursor/svelte/agents/code-reviewer.md +1 -1
  247. package/presets/cursor/svelte/agents/debugger.md +1 -1
  248. package/presets/cursor/svelte/agents/feature-developer.md +1 -1
  249. package/presets/cursor/svelte/agents/qa-tester.md +1 -1
  250. package/presets/cursor/svelte/commands/technical-retro.md +1 -1
  251. package/presets/cursor/svelte/hooks/chain-team-phases.sh +9 -0
  252. package/presets/cursor/svelte/rules/README.md +2 -1
  253. package/presets/cursor/svelte/rules/code-quality-and-refactoring.mdc +1 -8
  254. package/presets/cursor/svelte/rules/interactive-questions.mdc +34 -0
  255. package/presets/cursor/svelte/rules/technical-retro.mdc +2 -0
  256. package/presets/cursor/svelte/skills/technical-retro/SKILL.md +1 -1
  257. package/presets/mavis/android-kotlin/adapter-map.json +10 -1
  258. package/presets/mavis/android-kotlin/agents/build-verifier.md +1 -1
  259. package/presets/mavis/android-kotlin/agents/code-reviewer.md +1 -1
  260. package/presets/mavis/android-kotlin/agents/debugger.md +1 -1
  261. package/presets/mavis/android-kotlin/agents/feature-developer.md +1 -1
  262. package/presets/mavis/android-kotlin/agents/qa-tester.md +1 -1
  263. package/presets/mavis/android-kotlin/commands/technical-retro.md +1 -1
  264. package/presets/mavis/android-kotlin/hooks/chain-team-phases.sh +9 -0
  265. package/presets/mavis/android-kotlin/rules/agent-team-orchestrator.md +1 -1
  266. package/presets/mavis/android-kotlin/rules/code-quality-and-refactoring.md +1 -8
  267. package/presets/mavis/android-kotlin/rules/interactive-questions.md +29 -0
  268. package/presets/mavis/android-kotlin/rules/technical-retro.md +2 -0
  269. package/presets/mavis/android-kotlin/skills/technical-retro/SKILL.md +1 -1
  270. package/presets/mavis/go/adapter-map.json +10 -1
  271. package/presets/mavis/go/agents/build-verifier.md +1 -1
  272. package/presets/mavis/go/agents/code-reviewer.md +1 -1
  273. package/presets/mavis/go/agents/debugger.md +1 -1
  274. package/presets/mavis/go/agents/feature-developer.md +1 -1
  275. package/presets/mavis/go/agents/qa-tester.md +1 -1
  276. package/presets/mavis/go/commands/technical-retro.md +1 -1
  277. package/presets/mavis/go/hooks/chain-team-phases.sh +9 -0
  278. package/presets/mavis/go/rules/agent-team-orchestrator.md +1 -1
  279. package/presets/mavis/go/rules/code-quality-and-refactoring.md +1 -8
  280. package/presets/mavis/go/rules/interactive-questions.md +29 -0
  281. package/presets/mavis/go/rules/technical-retro.md +2 -0
  282. package/presets/mavis/go/skills/technical-retro/SKILL.md +1 -1
  283. package/presets/mavis/ios-swift/adapter-map.json +10 -1
  284. package/presets/mavis/ios-swift/agents/build-verifier.md +1 -1
  285. package/presets/mavis/ios-swift/agents/code-reviewer.md +1 -1
  286. package/presets/mavis/ios-swift/agents/debugger.md +1 -1
  287. package/presets/mavis/ios-swift/agents/feature-developer.md +1 -1
  288. package/presets/mavis/ios-swift/agents/qa-tester.md +1 -1
  289. package/presets/mavis/ios-swift/commands/technical-retro.md +1 -1
  290. package/presets/mavis/ios-swift/hooks/chain-team-phases.sh +9 -0
  291. package/presets/mavis/ios-swift/rules/agent-team-orchestrator.md +1 -1
  292. package/presets/mavis/ios-swift/rules/code-quality-and-refactoring.md +1 -8
  293. package/presets/mavis/ios-swift/rules/interactive-questions.md +29 -0
  294. package/presets/mavis/ios-swift/rules/technical-retro.md +2 -0
  295. package/presets/mavis/ios-swift/skills/technical-retro/SKILL.md +1 -1
  296. package/presets/mavis/java/adapter-map.json +10 -1
  297. package/presets/mavis/java/agents/build-verifier.md +1 -1
  298. package/presets/mavis/java/agents/code-reviewer.md +1 -1
  299. package/presets/mavis/java/agents/debugger.md +1 -1
  300. package/presets/mavis/java/agents/feature-developer.md +1 -1
  301. package/presets/mavis/java/agents/qa-tester.md +1 -1
  302. package/presets/mavis/java/commands/technical-retro.md +1 -1
  303. package/presets/mavis/java/hooks/chain-team-phases.sh +9 -0
  304. package/presets/mavis/java/rules/agent-team-orchestrator.md +1 -1
  305. package/presets/mavis/java/rules/code-quality-and-refactoring.md +1 -8
  306. package/presets/mavis/java/rules/interactive-questions.md +29 -0
  307. package/presets/mavis/java/rules/technical-retro.md +2 -0
  308. package/presets/mavis/java/skills/technical-retro/SKILL.md +1 -1
  309. package/presets/mavis/mcp-ts/adapter-map.json +10 -1
  310. package/presets/mavis/mcp-ts/agents/build-verifier.md +1 -1
  311. package/presets/mavis/mcp-ts/agents/feature-developer.md +1 -1
  312. package/presets/mavis/mcp-ts/commands/technical-retro.md +1 -1
  313. package/presets/mavis/mcp-ts/hooks/chain-team-phases.sh +9 -0
  314. package/presets/mavis/mcp-ts/rules/agent-team-orchestrator.md +1 -1
  315. package/presets/mavis/mcp-ts/rules/code-quality-and-refactoring.md +1 -8
  316. package/presets/mavis/mcp-ts/rules/interactive-questions.md +29 -0
  317. package/presets/mavis/mcp-ts/rules/technical-retro.md +2 -0
  318. package/presets/mavis/next/adapter-map.json +10 -1
  319. package/presets/mavis/next/agents/build-verifier.md +1 -1
  320. package/presets/mavis/next/agents/code-reviewer.md +1 -1
  321. package/presets/mavis/next/agents/debugger.md +1 -1
  322. package/presets/mavis/next/agents/feature-developer.md +1 -1
  323. package/presets/mavis/next/agents/qa-tester.md +1 -1
  324. package/presets/mavis/next/commands/technical-retro.md +1 -1
  325. package/presets/mavis/next/hooks/chain-team-phases.sh +9 -0
  326. package/presets/mavis/next/rules/agent-team-orchestrator.md +1 -1
  327. package/presets/mavis/next/rules/code-quality-and-refactoring.md +1 -8
  328. package/presets/mavis/next/rules/interactive-questions.md +29 -0
  329. package/presets/mavis/next/rules/technical-retro.md +2 -0
  330. package/presets/mavis/next/skills/technical-retro/SKILL.md +1 -1
  331. package/presets/mavis/nuxt/adapter-map.json +10 -1
  332. package/presets/mavis/nuxt/agents/build-verifier.md +1 -1
  333. package/presets/mavis/nuxt/agents/code-reviewer.md +1 -1
  334. package/presets/mavis/nuxt/agents/debugger.md +1 -1
  335. package/presets/mavis/nuxt/agents/feature-developer.md +1 -1
  336. package/presets/mavis/nuxt/agents/qa-tester.md +1 -1
  337. package/presets/mavis/nuxt/commands/technical-retro.md +1 -1
  338. package/presets/mavis/nuxt/hooks/chain-team-phases.sh +9 -0
  339. package/presets/mavis/nuxt/rules/agent-team-orchestrator.md +1 -1
  340. package/presets/mavis/nuxt/rules/code-quality-and-refactoring.md +1 -8
  341. package/presets/mavis/nuxt/rules/interactive-questions.md +29 -0
  342. package/presets/mavis/nuxt/rules/technical-retro.md +2 -0
  343. package/presets/mavis/nuxt/skills/technical-retro/SKILL.md +1 -1
  344. package/presets/mavis/php-hexagonal/adapter-map.json +10 -1
  345. package/presets/mavis/php-hexagonal/agents/build-verifier.md +1 -1
  346. package/presets/mavis/php-hexagonal/agents/code-reviewer.md +1 -1
  347. package/presets/mavis/php-hexagonal/agents/debugger.md +1 -1
  348. package/presets/mavis/php-hexagonal/agents/feature-developer.md +1 -1
  349. package/presets/mavis/php-hexagonal/agents/qa-tester.md +1 -1
  350. package/presets/mavis/php-hexagonal/commands/technical-retro.md +1 -1
  351. package/presets/mavis/php-hexagonal/hooks/chain-team-phases.sh +9 -0
  352. package/presets/mavis/php-hexagonal/rules/agent-team-orchestrator.md +1 -1
  353. package/presets/mavis/php-hexagonal/rules/code-quality-and-refactoring.md +1 -8
  354. package/presets/mavis/php-hexagonal/rules/interactive-questions.md +29 -0
  355. package/presets/mavis/php-hexagonal/rules/technical-retro.md +2 -0
  356. package/presets/mavis/php-hexagonal/skills/technical-retro/SKILL.md +1 -1
  357. package/presets/mavis/php-laravel/adapter-map.json +10 -1
  358. package/presets/mavis/php-laravel/agents/build-verifier.md +1 -1
  359. package/presets/mavis/php-laravel/agents/code-reviewer.md +1 -1
  360. package/presets/mavis/php-laravel/agents/debugger.md +1 -1
  361. package/presets/mavis/php-laravel/agents/feature-developer.md +1 -1
  362. package/presets/mavis/php-laravel/agents/qa-tester.md +1 -1
  363. package/presets/mavis/php-laravel/commands/technical-retro.md +1 -1
  364. package/presets/mavis/php-laravel/hooks/chain-team-phases.sh +9 -0
  365. package/presets/mavis/php-laravel/rules/agent-team-orchestrator.md +1 -1
  366. package/presets/mavis/php-laravel/rules/code-quality-and-refactoring.md +1 -8
  367. package/presets/mavis/php-laravel/rules/interactive-questions.md +29 -0
  368. package/presets/mavis/php-laravel/rules/technical-retro.md +2 -0
  369. package/presets/mavis/php-laravel/skills/technical-retro/SKILL.md +1 -1
  370. package/presets/mavis/svelte/adapter-map.json +10 -1
  371. package/presets/mavis/svelte/agents/build-verifier.md +1 -1
  372. package/presets/mavis/svelte/agents/code-reviewer.md +1 -1
  373. package/presets/mavis/svelte/agents/debugger.md +1 -1
  374. package/presets/mavis/svelte/agents/feature-developer.md +1 -1
  375. package/presets/mavis/svelte/agents/qa-tester.md +1 -1
  376. package/presets/mavis/svelte/commands/technical-retro.md +1 -1
  377. package/presets/mavis/svelte/hooks/chain-team-phases.sh +9 -0
  378. package/presets/mavis/svelte/rules/agent-team-orchestrator.md +1 -1
  379. package/presets/mavis/svelte/rules/code-quality-and-refactoring.md +1 -8
  380. package/presets/mavis/svelte/rules/interactive-questions.md +29 -0
  381. package/presets/mavis/svelte/rules/technical-retro.md +2 -0
  382. package/presets/mavis/svelte/skills/technical-retro/SKILL.md +1 -1
  383. package/presets/opencode/android-kotlin/adapter-map.json +10 -1
  384. package/presets/opencode/android-kotlin/agents/build-verifier.md +1 -1
  385. package/presets/opencode/android-kotlin/agents/code-reviewer.md +1 -1
  386. package/presets/opencode/android-kotlin/agents/debugger.md +1 -1
  387. package/presets/opencode/android-kotlin/agents/feature-developer.md +1 -1
  388. package/presets/opencode/android-kotlin/agents/qa-tester.md +1 -1
  389. package/presets/opencode/android-kotlin/commands/technical-retro.md +1 -1
  390. package/presets/opencode/android-kotlin/hooks/chain-team-phases.sh +9 -0
  391. package/presets/opencode/android-kotlin/rules/agent-team-orchestrator.md +1 -1
  392. package/presets/opencode/android-kotlin/rules/code-quality-and-refactoring.md +1 -8
  393. package/presets/opencode/android-kotlin/rules/interactive-questions.md +29 -0
  394. package/presets/opencode/android-kotlin/rules/technical-retro.md +2 -0
  395. package/presets/opencode/android-kotlin/skills/technical-retro/SKILL.md +1 -1
  396. package/presets/opencode/go/adapter-map.json +10 -1
  397. package/presets/opencode/go/agents/build-verifier.md +1 -1
  398. package/presets/opencode/go/agents/code-reviewer.md +1 -1
  399. package/presets/opencode/go/agents/debugger.md +1 -1
  400. package/presets/opencode/go/agents/feature-developer.md +1 -1
  401. package/presets/opencode/go/agents/qa-tester.md +1 -1
  402. package/presets/opencode/go/commands/technical-retro.md +1 -1
  403. package/presets/opencode/go/hooks/chain-team-phases.sh +9 -0
  404. package/presets/opencode/go/rules/agent-team-orchestrator.md +1 -1
  405. package/presets/opencode/go/rules/code-quality-and-refactoring.md +1 -8
  406. package/presets/opencode/go/rules/interactive-questions.md +29 -0
  407. package/presets/opencode/go/rules/technical-retro.md +2 -0
  408. package/presets/opencode/go/skills/technical-retro/SKILL.md +1 -1
  409. package/presets/opencode/ios-swift/adapter-map.json +10 -1
  410. package/presets/opencode/ios-swift/agents/build-verifier.md +1 -1
  411. package/presets/opencode/ios-swift/agents/code-reviewer.md +1 -1
  412. package/presets/opencode/ios-swift/agents/debugger.md +1 -1
  413. package/presets/opencode/ios-swift/agents/feature-developer.md +1 -1
  414. package/presets/opencode/ios-swift/agents/qa-tester.md +1 -1
  415. package/presets/opencode/ios-swift/commands/technical-retro.md +1 -1
  416. package/presets/opencode/ios-swift/hooks/chain-team-phases.sh +9 -0
  417. package/presets/opencode/ios-swift/rules/agent-team-orchestrator.md +1 -1
  418. package/presets/opencode/ios-swift/rules/code-quality-and-refactoring.md +1 -8
  419. package/presets/opencode/ios-swift/rules/interactive-questions.md +29 -0
  420. package/presets/opencode/ios-swift/rules/technical-retro.md +2 -0
  421. package/presets/opencode/ios-swift/skills/technical-retro/SKILL.md +1 -1
  422. package/presets/opencode/java/adapter-map.json +10 -1
  423. package/presets/opencode/java/agents/build-verifier.md +1 -1
  424. package/presets/opencode/java/agents/code-reviewer.md +1 -1
  425. package/presets/opencode/java/agents/debugger.md +1 -1
  426. package/presets/opencode/java/agents/feature-developer.md +1 -1
  427. package/presets/opencode/java/agents/qa-tester.md +1 -1
  428. package/presets/opencode/java/commands/technical-retro.md +1 -1
  429. package/presets/opencode/java/hooks/chain-team-phases.sh +9 -0
  430. package/presets/opencode/java/rules/agent-team-orchestrator.md +1 -1
  431. package/presets/opencode/java/rules/code-quality-and-refactoring.md +1 -8
  432. package/presets/opencode/java/rules/interactive-questions.md +29 -0
  433. package/presets/opencode/java/rules/technical-retro.md +2 -0
  434. package/presets/opencode/java/skills/technical-retro/SKILL.md +1 -1
  435. package/presets/opencode/mcp-ts/adapter-map.json +10 -1
  436. package/presets/opencode/mcp-ts/agents/build-verifier.md +1 -1
  437. package/presets/opencode/mcp-ts/agents/feature-developer.md +1 -1
  438. package/presets/opencode/mcp-ts/commands/technical-retro.md +1 -1
  439. package/presets/opencode/mcp-ts/hooks/chain-team-phases.sh +9 -0
  440. package/presets/opencode/mcp-ts/rules/agent-team-orchestrator.md +1 -1
  441. package/presets/opencode/mcp-ts/rules/code-quality-and-refactoring.md +1 -8
  442. package/presets/opencode/mcp-ts/rules/interactive-questions.md +29 -0
  443. package/presets/opencode/mcp-ts/rules/technical-retro.md +2 -0
  444. package/presets/opencode/next/adapter-map.json +10 -1
  445. package/presets/opencode/next/agents/build-verifier.md +1 -1
  446. package/presets/opencode/next/agents/code-reviewer.md +1 -1
  447. package/presets/opencode/next/agents/debugger.md +1 -1
  448. package/presets/opencode/next/agents/feature-developer.md +1 -1
  449. package/presets/opencode/next/agents/qa-tester.md +1 -1
  450. package/presets/opencode/next/commands/technical-retro.md +1 -1
  451. package/presets/opencode/next/hooks/chain-team-phases.sh +9 -0
  452. package/presets/opencode/next/rules/agent-team-orchestrator.md +1 -1
  453. package/presets/opencode/next/rules/code-quality-and-refactoring.md +1 -8
  454. package/presets/opencode/next/rules/interactive-questions.md +29 -0
  455. package/presets/opencode/next/rules/technical-retro.md +2 -0
  456. package/presets/opencode/next/skills/technical-retro/SKILL.md +1 -1
  457. package/presets/opencode/nuxt/adapter-map.json +10 -1
  458. package/presets/opencode/nuxt/agents/build-verifier.md +1 -1
  459. package/presets/opencode/nuxt/agents/code-reviewer.md +1 -1
  460. package/presets/opencode/nuxt/agents/debugger.md +1 -1
  461. package/presets/opencode/nuxt/agents/feature-developer.md +1 -1
  462. package/presets/opencode/nuxt/agents/qa-tester.md +1 -1
  463. package/presets/opencode/nuxt/commands/technical-retro.md +1 -1
  464. package/presets/opencode/nuxt/hooks/chain-team-phases.sh +9 -0
  465. package/presets/opencode/nuxt/rules/agent-team-orchestrator.md +1 -1
  466. package/presets/opencode/nuxt/rules/code-quality-and-refactoring.md +1 -8
  467. package/presets/opencode/nuxt/rules/interactive-questions.md +29 -0
  468. package/presets/opencode/nuxt/rules/technical-retro.md +2 -0
  469. package/presets/opencode/nuxt/skills/technical-retro/SKILL.md +1 -1
  470. package/presets/opencode/php-hexagonal/adapter-map.json +10 -1
  471. package/presets/opencode/php-hexagonal/agents/build-verifier.md +1 -1
  472. package/presets/opencode/php-hexagonal/agents/code-reviewer.md +1 -1
  473. package/presets/opencode/php-hexagonal/agents/debugger.md +1 -1
  474. package/presets/opencode/php-hexagonal/agents/feature-developer.md +1 -1
  475. package/presets/opencode/php-hexagonal/agents/qa-tester.md +1 -1
  476. package/presets/opencode/php-hexagonal/commands/technical-retro.md +1 -1
  477. package/presets/opencode/php-hexagonal/hooks/chain-team-phases.sh +9 -0
  478. package/presets/opencode/php-hexagonal/rules/agent-team-orchestrator.md +1 -1
  479. package/presets/opencode/php-hexagonal/rules/code-quality-and-refactoring.md +1 -8
  480. package/presets/opencode/php-hexagonal/rules/interactive-questions.md +29 -0
  481. package/presets/opencode/php-hexagonal/rules/technical-retro.md +2 -0
  482. package/presets/opencode/php-hexagonal/skills/technical-retro/SKILL.md +1 -1
  483. package/presets/opencode/php-laravel/adapter-map.json +10 -1
  484. package/presets/opencode/php-laravel/agents/build-verifier.md +1 -1
  485. package/presets/opencode/php-laravel/agents/code-reviewer.md +1 -1
  486. package/presets/opencode/php-laravel/agents/debugger.md +1 -1
  487. package/presets/opencode/php-laravel/agents/feature-developer.md +1 -1
  488. package/presets/opencode/php-laravel/agents/qa-tester.md +1 -1
  489. package/presets/opencode/php-laravel/commands/technical-retro.md +1 -1
  490. package/presets/opencode/php-laravel/hooks/chain-team-phases.sh +9 -0
  491. package/presets/opencode/php-laravel/rules/agent-team-orchestrator.md +1 -1
  492. package/presets/opencode/php-laravel/rules/code-quality-and-refactoring.md +1 -8
  493. package/presets/opencode/php-laravel/rules/interactive-questions.md +29 -0
  494. package/presets/opencode/php-laravel/rules/technical-retro.md +2 -0
  495. package/presets/opencode/php-laravel/skills/technical-retro/SKILL.md +1 -1
  496. package/presets/opencode/svelte/adapter-map.json +10 -1
  497. package/presets/opencode/svelte/agents/build-verifier.md +1 -1
  498. package/presets/opencode/svelte/agents/code-reviewer.md +1 -1
  499. package/presets/opencode/svelte/agents/debugger.md +1 -1
  500. package/presets/opencode/svelte/agents/feature-developer.md +1 -1
  501. package/presets/opencode/svelte/agents/qa-tester.md +1 -1
  502. package/presets/opencode/svelte/commands/technical-retro.md +1 -1
  503. package/presets/opencode/svelte/hooks/chain-team-phases.sh +9 -0
  504. package/presets/opencode/svelte/rules/agent-team-orchestrator.md +1 -1
  505. package/presets/opencode/svelte/rules/code-quality-and-refactoring.md +1 -8
  506. package/presets/opencode/svelte/rules/interactive-questions.md +29 -0
  507. package/presets/opencode/svelte/rules/technical-retro.md +2 -0
  508. package/presets/opencode/svelte/skills/technical-retro/SKILL.md +1 -1
package/CHANGELOG.md CHANGED
@@ -1,5 +1,53 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.2.49
4
+
5
+ ### Interactive questions: the free-form answer is mandatory, the “Other” option is not
6
+
7
+ - **Conditional rule.** The widget contract now requires a free-form answer path and states when an explicit “other” option is wrong: OpenCode `question` and Claude Code `AskUserQuestion` append that entry for single and multi select, so a hand-written “Other” duplicates it — and because option values are the labels, a chosen “Other” returns that word instead of the user’s text.
8
+ - **Hosts without it.** A custom `dialog.select`, an MCP elicitation `enum`, or a headless run has no free-form entry → supply one explicitly: a final “Other” whose selection opens a text prompt, or ask in prose when the answer cannot be enumerated. The host’s own entry does not count toward the 2–5 option range.
9
+ - **Requestable, not always-on.** The contract moved into the new requestable stem `interactive-questions` (shared core + 40 adapters); the always-on quality rule keeps a two-line pointer. `next-attached-budget` reports UI 414 of 420 (6 lines of headroom), STORE 355 of 400, API 347 of 400. `next` keeps its four always-on stems — no new always-on slot.
10
+
11
+ ### The manifest writer and the hook agree on the artifact status
12
+
13
+ - **Reopening an entry.** `manifest.mjs upsert` without `--outcome` drops the previous terminal receipt and its `completedAt`. The stale receipt used to contradict the new status, and the mandatory closeout `check` rejected the manifest the writer had just produced.
14
+ - **A receipt outcome is not a status.** The hook now rejects `status: "changes_requested"` and names the repair; `check` reports it the same way: `manifest.mjs upsert --slug <slug> --id <id> --status blocked --outcome changes_requested`.
15
+ - **Legacy manifests.** A manifest written before the writer shipped can carry an out-of-enum status or a stale receipt. `check` names the entry, the producer and the repair command.
16
+
17
+ ### A release ships the changelog of its own version
18
+
19
+ - **Gate.** `scripts/check-release-consistency.mjs` fails when the `package.json` version and the newest `## <version>` heading in `CHANGELOG.md` disagree. Every published tag so far carried the previous release’s notes, because the tag commit only bumped the version.
20
+ - **Order.** Changelog section and version bump in one commit, then the tag. See `docs/PRESET-CONTRIBUTION.md` § Release order.
21
+
22
+ ### The write-protocol gate checks coverage, not presence
23
+
24
+ - **Callout coverage.** `check-manifest-write-protocol.mjs` now requires the receipt-binding callout in every owning-agent prompt that exists (`feature-developer`, `build-verifier`, `code-reviewer`, `debugger`, `qa-tester`). Dropping the callout from one of them used to leave the gate green.
25
+
26
+ ### The attached-budget gate keeps room to grow
27
+
28
+ - `check-next-attached-budget.mjs` fails when a fixture leaves fewer than 5 free lines under its cap. 0.2.48 shipped the UI fixture at exactly 420 of 420, so the next line of prose would have been a build break.
29
+
30
+ ### The engine test suite runs in CI
31
+
32
+ - **Gate.** `preset-structure.yml` gains the `ai-local-engine-tests` job (`node --test .ai.local/scripts/*.test.mjs`, ~3 s) and the workflow path filter now includes `.ai.local/**`. The consumer-local suite was outside every CI trigger, so a red test — a new signal field the fixtures did not expect — could reach `main` unnoticed.
33
+ - **Local alias.** `yarn test:ai-local` from the repo root runs the same suite.
34
+
35
+ ### Prose contracts: an attached tail is drift too
36
+
37
+ - **Loop sentence.** `check-preset-self-review-contract.sh` now requires the canonical self-learning-loop sentence to be followed only by a sanctioned clause (`LOOP_TAIL_ALLOWED`). The old substring check accepted a sentence that had extra prose spliced onto it — the shape a bad find/replace produces — because the canonical text stayed intact.
38
+ - **Retro category.** The same gate enforces `finding_category` in every retro carrier — command, skill, and rule — on all four platforms. The Claude skill and command had missed the 0.2.49 wording while Cursor, Mavis, and OpenCode carried it; no gate covered that surface.
39
+
40
+ ### Claude command and skill twins are ratcheted
41
+
42
+ - **Why a ratchet, not parity.** Claude `commands/**` and `skills/**` are hand-maintained twins (generation covers rules + hooks). They legitimately diverge, so `check-preset-twin-drift.mjs` records the per-pair line delta in `_lib/claude-twin-drift-baseline.json` and fails only when the delta grows — a change mirrored in both twins passes either way.
43
+ - **Coverage.** A command/skill without a twin on the other side fails, and a new pair needs a baseline row. `twin-map` still covers rules only; the docs now say so.
44
+ - **Update.** `node scripts/check-preset-twin-drift.mjs --update` records a deliberate divergence; `yarn check:preset-twin-drift` runs the gate.
45
+
46
+ ### Upgrade
47
+
48
+ - Run `npx @bonesofspring/ai-rules update`. The writer is seeded skip-if-exists — delete `.ai.local/scripts/manifest.mjs` to take the hardened copy, then run `node .ai.local/scripts/manifest.mjs check --slug <slug>` on every task with an open entry: a manifest written before 0.2.46 can carry `status: "changes_requested"` or a stale receipt, and `check` names the entry and the repair command.
49
+ - The new requestable stem `interactive-questions` ships with the preset; the always-on quality rule points at it. No always-on slot added, no install-path change.
50
+
3
51
  ## 0.2.48
4
52
 
5
53
  ### Interactive questions are the preferred way to ask the user
package/README.md CHANGED
@@ -21,7 +21,7 @@ Run `init` from the **app root** (`--cwd` if needed). Default `--preset` is `nex
21
21
  | MCP | `.cursor/mcp.json` (merge) | **`.mcp.json`** (merge) | `.mavis/mcp.json` (merge) | `opencode.json` (merge) |
22
22
  | Root agents | `REPO_AGENTS.md` → `AGENTS.md` (same file on all four) | | | |
23
23
  | `/task` artifacts | **`.ai.local/team/`** (shared; templates refreshed; `tasks/<slug>/` never overwritten) | | | |
24
- | Self-learning engine | **`.ai.local/scripts/`** (shared; six modules; existing files never overwritten) | | | |
24
+ | Self-learning engine | **`.ai.local/scripts/`** (shared; seven scripts — the engine plus `manifest.mjs`, the manifest writer; existing files never overwritten) | | | |
25
25
  | Specs seed | `docs/specs/` copied only if the directory is **absent** | | | |
26
26
 
27
27
  The engine is the in-task self-learning loop: `.ai.local/signals.jsonl` → `.ai.local/rule-changes.jsonl` →
@@ -39,6 +39,17 @@ node .ai.local/scripts/run.mjs --strict # read-only check: exit 1 when capture
39
39
  tree is byte-identical to `presets/_shared/ai-local/scripts/`, and `.ai.local/.gitignore` (created only when absent)
40
40
  ignores `*.lock`, `*.tmp`, and `.rollback/`; the root `.gitignore` is never edited.
41
41
 
42
+ The same seeding ships `manifest.mjs`, the writer for `.ai.local/team/tasks/<slug>/artifact-manifest.json`:
43
+
44
+ ```bash
45
+ node .ai.local/scripts/manifest.mjs init --slug <slug>
46
+ node .ai.local/scripts/manifest.mjs upsert --slug <slug> --id <id> --producer <agent> \
47
+ --outcome completed --paths brief.md --acs AC-1 --attempt <attemptId>
48
+ node .ai.local/scripts/manifest.mjs check --slug <slug>
49
+ ```
50
+
51
+ Producers merge their receipt with it — the manifest is a whole-file merge target, never a fragment edit.
52
+
42
53
  Living exceptions: **`.ai.local/rules/`** and **`.ai.local/conventions.md`** (`init` does not overwrite them). Overlay does not load `.ai.local/team/**` as rules.
43
54
 
44
55
  **`clean <tool>`** removes only CLI-managed paths under that tool root. It does **not** wipe the whole `.cursor/` / `.claude/` tree, and it **never** deletes `.ai.local/`. Root `AGENTS.md` is removed only when no other tool install remains.
@@ -169,9 +169,19 @@ Summary:
169
169
  - [ ] Embed drift: `scripts/check-shared-core-drift.sh` after core/embed edits
170
170
  - [ ] Anti-hallucination: `check-anti-hallucination-coverage.mjs` passes. New skill families are registered in `SKILL_CONTRACT_CLASS` (`writer` loads the stack floor; `reader` loads the contract only). `code-review` is `writer`.
171
171
  - [ ] Structure gates: `yarn check:preset-structure` (or `bash scripts/check-preset-structure.sh`) passes
172
+ - [ ] Twin drift: after editing a Claude `commands/**` or `skills/**` file, `node scripts/check-preset-twin-drift.mjs` passes — mirror the change in the Cursor twin (delta unchanged) or record a deliberate divergence with `--update`
172
173
  - [ ] Generated trees regenerated (`generate-mavis.mjs` + `generate-opencode.mjs`) and CLI goldens recaptured (`capture-cli-golden.mjs`) after any preset-installed file changes
173
174
 
174
- Validation: `yarn check:preset-structure` + the `preset-pr-checklist` rule; CI workflow `preset-structure.yml`.
175
+ Validation: `yarn check:preset-structure` + the `preset-pr-checklist` rule; CI workflow `preset-structure.yml` (`check`, `hooks`, `ai-local-engine-tests`).
176
+
177
+ ## Release order
178
+
179
+ The published artifact must document the release it carries.
180
+
181
+ 1. Write the `CHANGELOG.md` section for the version and bump `packages/ai-rules/package.json` to that version **in one commit** — the gate compares the two, so a changelog-only commit is red.
182
+ 2. Tag the release and publish the tag.
183
+
184
+ A tag that carries a version bump without its changelog section ships the previous release's notes. `scripts/check-release-consistency.mjs` (wired into `check-preset-structure.sh`, alias `yarn check:release-consistency`) fails the build when `package.json` version and the newest `## <version>` heading in `CHANGELOG.md` disagree; fixture `test-release-consistency.mjs` covers the two failure shapes.
175
185
 
176
186
  ## Anti-hallucination oracle
177
187
 
@@ -268,7 +278,7 @@ Recent additions: **`android-kotlin`** (scaffolded from `ios-swift` agent-team +
268
278
  6. **Meta-rules** — add six `preset-*.mdc` / `preset-*.md` wrappers with preset-path globs (same as existing stacks).
269
279
  7. **build-verifier** — consumer gate only (stack tooling); preset-structure checks live in `scripts/check-*.sh` and `preset-pr-checklist`.
270
280
  8. **Platform artifacts** — see next section.
271
- 9. **Structure scripts** — add stack name to `STACKS` in `check-preset-twin-map.sh`, `check-preset-token-budget.sh`, `check-preset-leakage.sh`; fork `chain-team-phases.sh` byte-wise from other stacks.
281
+ 9. **Structure scripts** — add stack name to `STACKS` in `check-preset-twin-map.sh`, `check-preset-token-budget.sh`, `check-preset-leakage.sh`; fork `chain-team-phases.sh` byte-wise from other stacks; run `node scripts/check-preset-twin-drift.mjs --update` once the new stack ships Claude `commands/**` and `skills/**` (every new twin pair needs a baseline row).
272
282
  10. **Platform registration** — add the stack to `STACK_PROFILES` in `scripts/lib/stack-platform-profiles.mjs`, to `releasedStacks` in both `presets/mavis/platform-contract.json` and `presets/opencode/platform-contract.json`, then generate the derived trees: `node scripts/generate-mavis.mjs --stack <name>` and `node scripts/generate-opencode.mjs --stack <name>`. Verify with `node scripts/check-generated-drift.mjs`.
273
283
  11. **Document** — stack `README.md`, `rules/README.md` core→stack table, twin row in this guide, link `_shared/README.md`.
274
284
  12. **Package README** — list new preset name under install examples for all four platforms (`init cursor|claude|mavis|opencode --preset <name>`).
@@ -350,6 +360,7 @@ Hooks scripts may fork per stack (e.g. ios-swift `chain-team-phases.sh` must not
350
360
  2. **One stack only?** → add `presets/cursor/<stack>/rules/<stem>.mdc`, add its Claude README mapping row, then run `generate-claude.mjs --stack <stack>`.
351
361
  3. **Preset author workflow?** → `_shared/core/meta/` + `preset-*.mdc` / `tooling-and-review/preset-*.md` with preset globs only.
352
362
  4. **Heavy workflow (orchestrator, feature-delivery, code-review)?** → requestable / `paths:` / globs — **not** always-on.
363
+ 5. **Situational guidance that every turn would carry?** → keep it out of the always-on rule: add a requestable stem (`_shared/core/quality/<stem>.md` + `presets/cursor/<stack>/rules/<stem>.mdc` with `alwaysApply: false`, classify it in `scripts/_lib/embed-stems.json`, add the Claude README mapping rows) and leave a pointer in the always-on rule. `scripts/check-next-attached-budget.mjs` keeps 5 free lines under the `next` UI cap, so a release cannot land on the cap.
353
364
 
354
365
  See packaged **`preset-layering`** and **`preset-no-cross-stack-leakage`** for details.
355
366
 
@@ -386,18 +397,20 @@ Load these when editing files under `packages/ai-rules/presets/**`, `.cursor/**`
386
397
  | `yarn fix:generated` | Regenerate every released generated platform and recapture all required CLI goldens. Run after changing Cursor SoT, before fail-only checks. Dogfood sync remains separate. |
387
398
  | `scripts/sync-dogfood-cursor.sh` | Copy `presets/cursor/<preset>/` → root `.cursor/` (`AI_RULES_DOGFOOD_PRESET`, default `next`). Also copies `REPO_AGENTS.md` → repo-root `AGENTS.md`. Seeds `.ai.local/team` templates; preserves `.ai.local/team/tasks/`. |
388
399
  | `scripts/check-shared-core-drift.sh` / `yarn check:shared-core-drift` | Check embed-mode adapters vs core; lists lineage consumers. **Always hard:** every `_shared/core/**` file must be classified `embed | lineage | internal` in `_lib/embed-stems.json` (unclassified → exit 1). Drift is soft by default; set `AI_RULES_DRIFT_FAIL=1` (or use `check:preset-structure`) to exit non-zero. |
389
- | `scripts/check-preset-twin-map.sh` / `yarn check:preset-twin-map` | **FAIL** if Cursor `.mdc` missing from Claude mapping table, twin file missing, or orphan topic `.md` (excl. `**/README.md`). Stacks: `next`, `nuxt`, `svelte`, `ios-swift`, `android-kotlin`, `go`, `java`, `mcp-ts`, `php-hexagonal`, `php-laravel`. |
400
+ | `scripts/check-preset-twin-map.sh` / `yarn check:preset-twin-map` | **FAIL** if Cursor `.mdc` missing from Claude mapping table, twin file missing, or orphan topic `.md` (excl. `**/README.md`). Stacks: `next`, `nuxt`, `svelte`, `ios-swift`, `android-kotlin`, `go`, `java`, `mcp-ts`, `php-hexagonal`, `php-laravel`. **Rules only** — commands and skills are guarded by `check-preset-twin-drift.mjs`. |
401
+ | `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 a command/skill has no twin on the other side, or when a new pair has no baseline row. Full parity is not required: mirror a change in both twins (delta unchanged) or record a deliberate divergence with `--update`. Fixture `test-preset-twin-drift.mjs`. |
390
402
  | `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`. |
391
403
  | `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**. |
392
404
  | `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`. |
393
405
  | `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`. |
394
406
  | `scripts/check-preset-language-policy.sh` / `yarn check:preset-structure` | **FAIL** if the native-language policy is absent: the core `_shared/core/agent-team/language-policy.md` tokens, the `language-policy` consumer + `<!-- shared-core -->` marker, the Cursor `globs:`/`alwaysApply: false` + Claude `paths:` shape, the `## Language` setting home (with a BCP-47 marker) in `ai-local/conventions.md`, the always-on anchors (`ai-local-overlay` + `<app-core>` + `REPO_AGENTS.md` must contain `native language` and `every user message`), or the `language:` persistence token in `commands/task.md`; **refuses vacuous PASS** when the iteration set is empty. Wired into `check-preset-structure.sh` next to `goal-contract` / `prompt-persistence`; fixture `test-preset-language-policy-fixtures.mjs`. |
395
- | `scripts/check-preset-self-review-contract.sh` / `yarn check:preset-structure` | **FAIL** if the producer-side self-review / context-hygiene contract is absent: the core `_shared/core/quality/self-review-and-context-hygiene.md` tokens (G0 non-vacuous guard), the `<!-- shared-core: quality/self-review-and-context-hygiene.md -->` marker on `task-analyst` / `feature-developer` / `build-verifier` (×10) and on `debugger` / `code-reviewer` where present (skip-if-absent → `mcp-ts`), the `Self-review` + `re-anchor` tokens on every orchestrator rule, `Self-review` in `team/README.md` + `commands/task.md`, and leakage-free core + docs; **refuses vacuous PASS** when the iteration set is empty. Wired into `check-preset-structure.sh` next to `goal-contract`; fixture `test-preset-self-review-contract-fixtures.mjs`. |
407
+ | `scripts/check-preset-self-review-contract.sh` / `yarn check:preset-structure` | **FAIL** if the producer-side self-review / context-hygiene contract is absent: the core `_shared/core/quality/self-review-and-context-hygiene.md` tokens (G0 non-vacuous guard), the `<!-- shared-core: quality/self-review-and-context-hygiene.md -->` marker on `task-analyst` / `feature-developer` / `build-verifier` (×10) and on `debugger` / `code-reviewer` where present (skip-if-absent → `mcp-ts`), the `Self-review` + `re-anchor` tokens on every orchestrator rule, `Self-review` in `team/README.md` + `commands/task.md`, and leakage-free core + docs; **refuses vacuous PASS** when the iteration set is empty. Also holds two prose contracts: the canonical self-learning-loop sentence must not be followed by unsanctioned prose (an allowlist — a spliced tail fails), and every retro carrier (command, skill, rule) must state `finding_category`. Wired into `check-preset-structure.sh` next to `goal-contract`; fixture `test-preset-self-review-contract-fixtures.mjs`. |
396
408
  | `scripts/check-anti-hallucination-coverage.mjs` | **FAIL** when the shared contract, a Cursor load-line embed, a writer stack floor, or a generated Rules-to-load stem is missing. Writer roles are `implementer`, `unit-test`, `e2e`, `qa`, and `reviewer` (`code-reviewer` loads `STACK_FLOOR_STEMS` plus the contract). `/task` and the orchestrator must not name a floor stem. Does not scan consumer `app/**` and does not call Context7. Fixture `test-anti-hallucination-coverage.mjs` deletes `anti-hallucination-contract` from `next.reviewer` in memory and expects FAIL mentioning `next` and `reviewer`. Wired into `check-preset-structure.sh` immediately after `check-claude-agent-blocks.mjs`. |
397
409
  | `scripts/check-preset-structure.sh` / `yarn check:preset-structure` | Orchestrator: twin-map + token-budget + leakage + shared-core drift + anti-hallucination coverage (**all hard**; drift via `AI_RULES_DRIFT_FAIL=1`). Does **not** run rule-eval. |
398
410
  | `scripts/check-product-specs.sh` / `yarn check:product-specs` | Opt-in consumer tree check: frontmatter v1 keys + required body headings on `docs/specs/**` (bash; does **not** run JSON Schema). Ships in the npm package `files` (`scripts/`). **WARN** by default; **`--strict`** exits non-zero. |
399
411
  | `yarn check:product-specs:dogfood` | Same script against monorepo `dogfood/mcp-ts-sample`. Soft WARN inside `check:preset-structure` + CI step (`continue-on-error`); not a hard consumer CI gate. |
400
412
  | `scripts/check-rule-eval.mjs` / `yarn check:rule-eval` | Opt-in: validates Incorrect/Correct pairs + `impact:` on **next-only** golden stems (`eval/next/manifest.json`). Backend / ios / php-hexagonal / php-laravel stems are out of scope until a stack adds `eval/<stack>/`. Not part of `check:preset-structure`. |
413
+ | `scripts/check-release-consistency.mjs` / `yarn check:release-consistency` | **FAIL** when `packages/ai-rules/package.json` version and the newest `## <version>` heading in `CHANGELOG.md` disagree — a tag must not ship the previous release's notes. Wired into `check-preset-structure.sh`; fixture `test-release-consistency.mjs`. |
401
414
 
402
415
  Run from `packages/ai-rules/`:
403
416
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bonesofspring/ai-rules",
3
- "version": "0.2.48",
3
+ "version": "0.2.50",
4
4
  "description": "Presets of Cursor, Claude, Mavis, and OpenCode rules/commands for Revy Ross personal use",
5
5
  "license": "MIT",
6
6
  "author": "Revy Ross",
@@ -41,6 +41,8 @@
41
41
  "test:parallel-plan-fixtures": "node scripts/test-parallel-plan-fixtures.mjs",
42
42
  "check:claude-agent-blocks": "node scripts/check-claude-agent-blocks.mjs",
43
43
  "check:preset-twin-map": "bash scripts/check-preset-twin-map.sh",
44
+ "check:preset-twin-drift": "node scripts/check-preset-twin-drift.mjs",
45
+ "test:twin-drift-fixtures": "node scripts/test-preset-twin-drift.mjs",
44
46
  "check:preset-token-budget": "bash scripts/check-preset-token-budget.sh",
45
47
  "check:preset-leakage": "bash scripts/check-preset-leakage.sh",
46
48
  "check:figma-contract": "bash scripts/check-figma-contract-presence.sh",
@@ -55,6 +57,7 @@
55
57
  "check:product-specs:dogfood": "bash scripts/check-product-specs.sh ../../dogfood/mcp-ts-sample",
56
58
  "check:rule-eval": "node scripts/check-rule-eval.mjs",
57
59
  "check:next-attached-budget": "node scripts/check-next-attached-budget.mjs",
60
+ "check:release-consistency": "node scripts/check-release-consistency.mjs",
58
61
  "check:generated-drift": "node scripts/check-generated-drift.mjs",
59
62
  "check:hook-body-parity": "node scripts/check-hook-body-parity.mjs",
60
63
  "test:hook-body-parity-fixtures": "node scripts/test-hook-body-parity-fixtures.mjs",
@@ -62,6 +65,7 @@
62
65
  "test:generated-drift-fixtures": "node scripts/test-generated-drift-fixtures.mjs",
63
66
  "test:generate-claude-fixtures": "node scripts/test-generate-claude-fixtures.mjs",
64
67
  "test:generated-drift-claude-fixtures": "node scripts/test-generated-drift-claude-fixtures.mjs",
68
+ "test:rule-improver": "node scripts/test-rule-improver-ledger.mjs",
65
69
  "test:cli-mcp-merge": "node scripts/test-cli-mcp-merge.mjs",
66
70
  "test:cli-init-clean": "node scripts/test-cli-init-clean.mjs",
67
71
  "test:cli-update": "node scripts/test-cli-update.mjs",
@@ -170,6 +170,7 @@ export function deriveGateSignals({ baseDir = DEFAULT_BASE_DIR, isDenied = defau
170
170
  stem,
171
171
  source: 'gate',
172
172
  status: 'proposed',
173
+ finding_category: 'process',
173
174
  });
174
175
  }
175
176
  }
@@ -99,7 +99,7 @@ export const manifestPath = (slug, teamRoot = DEFAULT_TEAM_ROOT) =>
99
99
  * `archive/<date>/` and rewrites that entry's `authoritativePaths`, so only an
100
100
  * open entry is required to cite current files.
101
101
  */
102
- export function assertAuthoritativePath(value, slug, status) {
102
+ export function assertAuthoritativePath(value, status) {
103
103
  if (typeof value !== 'string' || value.trim() === '') fail('authoritativePaths entries must be non-empty strings');
104
104
  const candidate = value.trim();
105
105
  if (path.isAbsolute(candidate)) {
@@ -124,7 +124,6 @@ export function assertAuthoritativePath(value, slug, status) {
124
124
  `authoritativePaths must point at current files, got archived "${candidate}" — only a completed or superseded entry may cite archive/`,
125
125
  );
126
126
  }
127
- void slug;
128
127
  return normalized;
129
128
  }
130
129
 
@@ -188,12 +187,20 @@ function mergeEntry(manifest, entry) {
188
187
  createdAt: previous?.timestamps?.createdAt || now,
189
188
  updatedAt: now,
190
189
  };
191
- if (TERMINAL_STATUSES.has(entry.status)) timestamps.completedAt = now;
192
190
  const merged = {
193
191
  ...(previous || {}),
194
192
  ...entry,
195
193
  timestamps,
196
194
  };
195
+ // A reopened entry carries no receipt. The previous terminal receipt and its
196
+ // `completedAt` are stale: keeping them makes `check` reject the manifest
197
+ // ("status contradicts receipt.outcome") even though the writer produced it.
198
+ if (!entry.receipt) {
199
+ delete merged.receipt;
200
+ delete timestamps.completedAt;
201
+ } else if (TERMINAL_STATUSES.has(entry.status)) {
202
+ timestamps.completedAt = now;
203
+ }
197
204
  if (index >= 0) manifest.artifacts[index] = merged;
198
205
  else manifest.artifacts.push(merged);
199
206
  return merged;
@@ -207,7 +214,9 @@ export function upsertManifestEntry({ slug, entry, teamRoot = DEFAULT_TEAM_ROOT
207
214
  const { manifest, filePath } = readManifest(slug, teamRoot);
208
215
  delete manifest.entries;
209
216
  manifest.schemaVersion = manifest.schemaVersion || 1;
210
- manifest.slug = manifest.slug || slug;
217
+ // The task directory owns the slug: a manifest copied from another task is
218
+ // repaired here instead of failing `check` with no repair path.
219
+ manifest.slug = slug;
211
220
  const merged = mergeEntry(manifest, entry);
212
221
  manifest.updatedAt = new Date().toISOString();
213
222
  writeManifestSync(filePath, manifest);
@@ -228,7 +237,7 @@ const buildEntry = (flags, slug) => {
228
237
  fail(`--status ${status} contradicts --outcome ${outcome}; use --status ${impliedStatus} (superseded is also allowed)`);
229
238
  }
230
239
  if (TERMINAL_STATUSES.has(status) && !outcome) fail(`--outcome is required when --status is ${status}`);
231
- const authoritativePaths = csv(flags.paths).map((value) => assertAuthoritativePath(value, slug, status));
240
+ const authoritativePaths = csv(flags.paths).map((value) => assertAuthoritativePath(value, status));
232
241
  if (authoritativePaths.length === 0) fail('--paths is required (comma-separated task-relative paths)');
233
242
  const entry = {
234
243
  id,
@@ -274,15 +283,26 @@ export function validateManifest(manifest, slug) {
274
283
  else if (seen.has(entry.id)) problems.push(`${at}.id "${entry.id}" is duplicated`);
275
284
  else seen.add(entry.id);
276
285
  if (typeof entry.producer !== 'string' || entry.producer === '') problems.push(`${at}.producer is required`);
277
- if (!ARTIFACT_STATUSES.includes(entry.status)) problems.push(`${at}.status must be one of ${ARTIFACT_STATUSES.join(' | ')}`);
286
+ if (!ARTIFACT_STATUSES.includes(entry.status)) {
287
+ if (OUTCOMES.includes(entry.status)) {
288
+ // A receipt outcome was written into `status`. Name the repair command:
289
+ // the writer cannot fix a foreign entry, so the owner must.
290
+ const expected = OUTCOME_STATUS[entry.status];
291
+ problems.push(
292
+ `${at}.status "${entry.status}" is a receipt outcome, not an artifact status. Rewrite the entry: "manifest.mjs upsert --slug ${slug} --id ${entry.id} --producer ${entry.producer} --status ${expected} --outcome ${entry.status} --paths <path>"`,
293
+ );
294
+ } else {
295
+ problems.push(`${at}.status must be one of ${ARTIFACT_STATUSES.join(' | ')}`);
296
+ }
297
+ }
278
298
  if (!Array.isArray(entry.authoritativePaths) || entry.authoritativePaths.length === 0) {
279
299
  problems.push(`${at}.authoritativePaths must be a non-empty array`);
280
300
  } else {
281
301
  for (const value of entry.authoritativePaths) {
282
302
  try {
283
- assertAuthoritativePath(value, slug, entry.status);
303
+ assertAuthoritativePath(value, entry.status);
284
304
  } catch (error) {
285
- problems.push(`${at}.authoritativePaths: ${error.message}`);
305
+ problems.push(`${at} (producer "${entry.producer}") authoritativePaths: ${error.message}`);
286
306
  }
287
307
  }
288
308
  }
@@ -304,8 +324,9 @@ export function validateManifest(manifest, slug) {
304
324
  entry.status !== OUTCOME_STATUS[entry.receipt.outcome] &&
305
325
  entry.status !== 'superseded'
306
326
  ) {
327
+ const expected = OUTCOME_STATUS[entry.receipt.outcome];
307
328
  problems.push(
308
- `${at}.status "${entry.status}" contradicts receipt.outcome "${entry.receipt.outcome}"; expected "${OUTCOME_STATUS[entry.receipt.outcome]}"`,
329
+ `${at}.status "${entry.status}" contradicts receipt.outcome "${entry.receipt.outcome}"; expected "${expected}" — rewrite the entry with "manifest.mjs upsert --slug ${slug} --id ${entry.id} --status ${expected} --outcome ${entry.receipt.outcome}"`,
309
330
  );
310
331
  }
311
332
  });
@@ -104,12 +104,37 @@ function writeFileAtomic(target, content) {
104
104
  fs.renameSync(temporary, target);
105
105
  }
106
106
 
107
+ /**
108
+ * The ledger is committed, so its `target` is repo-relative: a host path would
109
+ * leak the machine layout (`agent-artifacts-no-local-paths`). File I/O keeps
110
+ * absolute paths; only the serialized line is normalized.
111
+ */
112
+ export function projectRootFor(ledgerPath) {
113
+ return path.dirname(path.dirname(path.resolve(ledgerPath)));
114
+ }
115
+
116
+ /** Absolute (or already project-relative) path -> the ledger's repo-relative form. */
117
+ export function toLedgerTarget(target, rootDir) {
118
+ const absolute = path.isAbsolute(target) ? target : path.resolve(rootDir, target);
119
+ const relative = path.relative(rootDir, absolute);
120
+ if (relative === '' || relative.startsWith('..') || path.isAbsolute(relative)) {
121
+ throw new Error(`ledger target escapes the project root: ${target}`);
122
+ }
123
+ return relative.split(path.sep).join('/');
124
+ }
125
+
126
+ /** Ledger form -> the absolute path file I/O needs; tolerates legacy absolute rows. */
127
+ export function resolveLedgerTarget(target, rootDir) {
128
+ return path.isAbsolute(target) ? target : path.resolve(rootDir, target);
129
+ }
130
+
107
131
  function appendLedgerLine(ledgerPath, entry) {
132
+ const normalized = { ...entry, target: toLedgerTarget(entry.target, projectRootFor(ledgerPath)) };
108
133
  const existing = readExisting(ledgerPath) ?? '';
109
134
  const temporary = `${ledgerPath}.${process.pid}.${Date.now()}.tmp`;
110
135
  const fd = fs.openSync(temporary, 'w');
111
136
  try {
112
- fs.writeSync(fd, existing + `${JSON.stringify(entry)}\n`);
137
+ fs.writeSync(fd, existing + `${JSON.stringify(normalized)}\n`);
113
138
  try { fs.fsyncSync(fd); } catch {}
114
139
  } finally {
115
140
  try { fs.closeSync(fd); } catch {}
@@ -358,13 +383,14 @@ export function rollbackInverse(entry, options = {}) {
358
383
  at: now(),
359
384
  };
360
385
  const token = acquireLock(lockPath);
386
+ const target = resolveLedgerTarget(entry.target, projectRootFor(ledgerPath));
361
387
  try {
362
388
  if (inverse.after == null) {
363
- try { fs.unlinkSync(entry.target); } catch (error) {
389
+ try { fs.unlinkSync(target); } catch (error) {
364
390
  if (!error || error.code !== 'ENOENT') throw error;
365
391
  }
366
392
  } else {
367
- writeFileAtomic(entry.target, inverse.after);
393
+ writeFileAtomic(target, inverse.after);
368
394
  }
369
395
  appendLedgerLine(ledgerPath, inverse);
370
396
  return inverse;
@@ -759,20 +785,29 @@ export function runImprover(options = {}) {
759
785
  rejected,
760
786
  errors,
761
787
  envelope,
762
- report: renderReport({ applied, staged, skipped, rejected, errors, envelope }),
788
+ report: renderReport({ applied, staged, skipped, rejected, errors, envelope, ledgerPath }),
763
789
  };
764
790
  }
765
791
 
766
- function renderReport({ applied, staged, skipped, rejected, errors, envelope }) {
792
+ function renderTarget(target, ledgerPath) {
793
+ if (typeof target !== 'string') return String(target);
794
+ try {
795
+ return toLedgerTarget(target, projectRootFor(ledgerPath));
796
+ } catch {
797
+ return target;
798
+ }
799
+ }
800
+
801
+ function renderReport({ applied, staged, skipped, rejected, errors, envelope, ledgerPath }) {
767
802
  const lines = [
768
803
  'Self-learning rule improver',
769
804
  `envelope: ${envelope.ruleCount}/${MAX_ACTIVE_RULES} rules, ${envelope.lineCount}/${MAX_TOTAL_LINES} lines`,
770
805
  '',
771
806
  `applied (${applied.length}) — auto, low-risk, reversible`,
772
807
  ];
773
- for (const item of applied) lines.push(` - ${item.signature} → ${item.target}`);
808
+ for (const item of applied) lines.push(` - ${item.signature} → ${renderTarget(item.target, ledgerPath)}`);
774
809
  lines.push('', `staged (${staged.length}) — human promote`);
775
- for (const item of staged) lines.push(` - ${item.signature} → ${item.target} (${item.reason})`);
810
+ for (const item of staged) lines.push(` - ${item.signature} → ${renderTarget(item.target, ledgerPath)} (${item.reason})`);
776
811
  if (skipped.length > 0) {
777
812
  lines.push('', `skipped (${skipped.length}) — dedup no-op`);
778
813
  for (const item of skipped) lines.push(` - ${item.signature} (${item.reason})`);
@@ -39,7 +39,10 @@ export const ISSUE_BODY_RE = new RegExp(`^${ISSUE_BODY}$`);
39
39
  export const SIGNATURE_RE = new RegExp(`^(?:${KINDS.join('|')}):(?=[a-z0-9-]{2,63}$)${ISSUE_BODY}$`);
40
40
 
41
41
  const KEBAB_RE = ISSUE_BODY_RE;
42
- const SIGNAL_KEYS = ['id', 'at', 'slug', 'agent', 'kind', 'severity', 'confidence', 'signature', 'target', 'stem', 'source', 'status'];
42
+ const SIGNAL_KEYS = ['id', 'at', 'slug', 'agent', 'kind', 'severity', 'confidence', 'signature', 'target', 'stem', 'source', 'status', 'finding_category'];
43
+
44
+ /** Optional defect class of a retro signal; absent on rows written before the field existed. */
45
+ export const FINDING_CATEGORIES = ['correctness', 'contract', 'perf', 'hygiene', 'process'];
43
46
 
44
47
  /** A parsed journal line that can be field-accessed. `JSON.parse('null')` is not one. */
45
48
  export function isSignalRecord(value) {
@@ -106,6 +109,9 @@ export function validateSignal(signal) {
106
109
  }
107
110
  if (!SOURCES.includes(signal.source)) throw new Error(`"source" must be one of: ${SOURCES.join(' | ')}`);
108
111
  if (!STATUSES.includes(signal.status)) throw new Error(`"status" must be one of: ${STATUSES.join(' | ')}`);
112
+ if (signal.finding_category !== undefined && !FINDING_CATEGORIES.includes(signal.finding_category)) {
113
+ throw new Error(`"finding_category" must be one of: ${FINDING_CATEGORIES.join(' | ')}`);
114
+ }
109
115
  }
110
116
 
111
117
  /**
@@ -75,7 +75,7 @@ A producer finishes its step by upserting only its owned artifact entry and term
75
75
  - `evidencePaths`: authoritative files that support the outcome
76
76
  - `authoritativePaths`: paths relative to the task directory (`brief.md`). A repo-root path (`.ai.local/team/tasks/<slug>/brief.md`) resolves outside that directory and the hook rejects the receipt.
77
77
 
78
- `changes_requested` and `validation_failed` use artifact `status: "blocked"` while retaining their distinct receipt outcome; `outcome: "blocked"` maps to `status: "blocked"` too. A later successful attempt updates the same owned entry to `completed`; timestamps and evidence must reflect the latest result. Do not infer success from a Markdown filename alone.
78
+ `changes_requested` and `validation_failed` use artifact `status: "blocked"` while retaining their distinct receipt outcome; `outcome: "blocked"` maps to `status: "blocked"` too. A later successful attempt updates the same owned entry to `completed`; timestamps and evidence must reflect the latest result. Do not infer success from a Markdown filename alone. A receipt outcome is never an artifact status: the hook rejects `status: "changes_requested"` and `check` names the repair command.
79
79
 
80
80
  `blocked` is terminal for the producer attempt but non-advancing for the pipeline: the hook persists `status.state` / `phase` as `blocked` and emits no next-agent handoff. A receipt must either carry the active `attemptId` or belong to the step's assigned output entry. Its terminal timestamp must be at or after the active attempt's `startedAt`; otherwise the hook keeps the attempt active in `awaiting_artifact_receipt` and does not advance or retry.
81
81
 
@@ -83,7 +83,6 @@ A producer finishes its step by upserting only its owned artifact entry and term
83
83
 
84
84
  > **Plan closure is part of the receipt.** When the change carries `openspec/changes/<id>/tasks.md`, the producing agent ticks (`- [ ]` → `- [x]`) every row it closed in the same turn as the receipt. A closed receipt with unticked rows makes `openspec list` report stale progress and hides the real exit criteria from the next agent; the owner reconciles it before the next handoff and names the gap when it cannot.
85
85
 
86
-
87
86
  ## Ownership and writes
88
87
 
89
88
  - Agents own their output artifacts and their items in `manifest.artifacts[]` (with their receipts). They merge by stable `id` and preserve all foreign items.
@@ -109,9 +108,11 @@ The manifest is a **whole-file merge target**, never a substring patch. Producer
109
108
  node .ai.local/scripts/manifest.mjs check --slug <slug>
110
109
  ```
111
110
  It normalizes each path before judging it, so `reports/../../x.md` and `./archive/x.md` hit the same guards as `../x.md` and `archive/x.md`; it rejects absolute paths, `..` escapes, and repo-root `authoritativePaths`, and it drops a stray top-level `entries` key. `archive/` is accepted only on a `completed` or `superseded` entry, because the hook relocates a closed body there and rewrites that entry's paths. An outcome implies the status (`completed` → `completed`; `blocked` / `changes_requested` / `validation_failed` → `blocked`); a contradictory `--status` is rejected and `check` reports a stored mismatch. `init` takes the same `.manifest.lock` and re-checks existence after acquiring it, so it never replaces entries a concurrent `upsert` already wrote. A non-array `artifacts` (or a missing key) is a hard read error (exit 2) that leaves the file untouched: repair the file by hand — an empty array belongs only to a new skeleton.
111
+ An `upsert` without `--outcome` reopens the entry: the previous terminal receipt and its `completedAt` are dropped, because a stale receipt contradicts the new status and fails `check`. Reopen with `--status in_progress`, then write the new receipt with `--outcome` when the attempt ends.
112
112
  5. Never patch the JSON with a fragment/replace edit (`edit`, `str_replace`, `apply_patch`). A single-byte mismatch aborts the receipt mid-task, leaves the manifest out of sync with the produced artifact, and stalls the step in `awaiting_artifact_receipt`.
113
113
  6. A failed merge or parse is a retry signal, not a guess signal: re-read, merge again, at most twice, then report `blocked` with the parse/merge error. Never leave the file truncated or half-written.
114
114
  7. Parallel wave: the writer holds `.manifest.lock` in the task directory, so concurrent producers serialize. A hand-written merge must take the same lock. Entry `id` uniqueness stays the only shared invariant — the manifest is not a coordination lock.
115
+ 8. A receipt outcome is not an artifact status. An entry that carries `status: "changes_requested"` (or another outcome) is invalid: the hook rejects it and `check` names the repair. Rewrite it with the writer — `--status blocked --outcome changes_requested` — never by editing the JSON.
115
116
 
116
117
  ## Figma contract artifact
117
118
 
@@ -299,6 +300,8 @@ Before the terminal receipt, run `node .ai.local/scripts/manifest.mjs check --sl
299
300
 
300
301
  The orchestration hook may close a producer artifact by moving its body to `archive/<date>/` and repointing `authoritativePaths`. `check` accepts an archived path only on a completed or superseded entry, but a later write can leave a root-path reference without the root file. Resolve it at closeout: restore the root copy from `archive/<date>/` and point the entry at the root path, or keep the archived path only when the entry is terminal. Never leave a deleted root file plus an untracked archive copy for the human commit.
301
302
 
303
+ A manifest written before the writer shipped can carry an entry whose `status` is a receipt outcome, or a stale receipt on a reopened entry. `check` names the repair command; run it for the entry you own — the writer merges only your entry, so a foreign defect is the foreign producer's to repair.
304
+
302
305
  ## Minimal terminal handoff
303
306
 
304
307
  Report the owned entry ID, outcome, authoritative paths, covered AC/task IDs, and remaining gaps. The hook advances pipeline state from the terminal receipt; the agent receipt is evidence that drives the state transition, not a substitute for writing `status.json`.
@@ -142,7 +142,7 @@ Replanning is a **named, auditable operation** — never a silent reorder. Trigg
142
142
 
143
143
  ## Context budget & checkpoint/resume
144
144
 
145
- Work in bounded waves (one artifact class across the target surface). **Checkpoint** each completed wave to `.memlog.md` (`## <date>` + an `event:` line) and record the produced paths on the `implementation` manifest entry (`authoritativePaths`). That checkpoint is the hook `writeStatus` path: it rewrites `.ai.local/team/tasks/<slug>/focus.md`. `focus.md` is a view, not the system of record. It lists slug, pipeline step index, authoritative paths for incomplete manifest ids, the last `.memlog.md` `event:` line, the next gate, one decomposition ready-set line, and one archive index line, and it stays under 100 lines. `status.json`, `metrics.json`, `artifact-manifest.json`, and `.memlog.md` stay the system of record. A resumed run (`/task-continue`) reads `focus.md` first, then `artifact-manifest.json` and `.memlog.md`, and continues at the first stage whose exit criteria are unmet — never re-derive state from the chat. A completed manifest entry keeps id, status, and `authoritativePaths`, and the default resume read omits that entry's markdown body; closing it appends one new `.memlog.md` event: line, moves the bulky body to `.ai.local/team/tasks/<slug>/archive/YYYY-MM-DD/`, and leaves earlier memlog lines, the human-readable slug and artifact ids, and the manifest entry in place, with no Beads hash ids and no Taskmaster tags. Mechanical waves (generation, embed sync) are delegated to repo scripts. See **context-and-iteration** for the budget, checkpoint, resume, and refinement loop.
145
+ Work in bounded waves (one artifact class across the target surface). **Checkpoint** each completed wave to `.memlog.md` (`## <date>` + an `event:` line) and record the produced paths on the `implementation` manifest entry (`authoritativePaths`). That checkpoint is the hook `writeStatus` path: it rewrites `.ai.local/team/tasks/<slug>/focus.md`. `focus.md` is a view, not the system of record. It lists slug, pipeline step index, authoritative paths for incomplete manifest ids, the last `.memlog.md` `event:` line, the next gate, one decomposition ready-set line, and one archive index line, and it stays under 100 lines. `status.json`, `metrics.json`, `artifact-manifest.json`, and `.memlog.md` stay the system of record. A resumed run (`/task-continue`) reads `focus.md` first, then `artifact-manifest.json` and `.memlog.md`, and continues at the first stage whose exit criteria are unmet — never re-derive state from the chat. A completed manifest entry keeps id, status, and `authoritativePaths`, and the default resume read omits that entry's markdown body; closing it appends one new `.memlog.md` event: line, moves the bulky body to `.ai.local/team/tasks/<slug>/archive/YYYY-MM-DD/`, and leaves earlier memlog lines, the human-readable slug and artifact ids, and the manifest entry in place, with no Beads hash ids and no Taskmaster tags. Mechanical waves (generation, embed sync) are delegated to repo scripts. An **interrupted producer** (tool abort, killed session) is resumed, not restarted: run the stack's compile gate on the working tree first, and when it is red hand the failing output to the same producer with a `fix and finish` brief instead of starting a second parallel attempt. When the host runtime writes no `status.json` (manual-hook hosts such as OpenCode), the resume checkpoint is `artifact-manifest.json` + `.memlog.md`; never gate a resume on a file the runtime does not produce. See **context-and-iteration** for the budget, checkpoint, resume, and refinement loop.
146
146
 
147
147
  ## Self-review & context hygiene
148
148
 
@@ -60,14 +60,7 @@ Essentials below. Full procedural set (~17 rules) → load **`anti-sycophancy-di
60
60
 
61
61
  ## Questions to the user
62
62
 
63
- **Interactive first.** When the answer is a decision only the user can make, ask through the host’s interactive question tool (OpenCode `question`, Claude Code `AskUserQuestion`, a client dialog) and structure the question for that tool. Plain prose is the **fallback** for a host without one, a headless run, or an answer that cannot be enumerated.
64
-
65
- - One decision per question; put independent decisions in separate entries so the host walks them as steps.
66
- - Header → a short label (≤30 characters); option label → 1–5 words in the user’s terms; option description → the consequence or trade-off, not a restatement of the label.
67
- - Two to five options; enable multi-select only when the choices are not mutually exclusive.
68
- - Never add an “other”/free-form option — the host adds it, and the user can always type an answer.
69
- - Put the option you would recommend first and justify it in its description; do not pad the list with options you cannot defend.
70
- - Ask once, before the work that depends on the answer — not a screening question per option, and not a question the repository already answers.
63
+ **Interactive first.** A decision only the user can make goes through the host's interactive question tool (OpenCode `question`, Claude Code `AskUserQuestion`, a client dialog); prose is the fallback for a host without one. Load **`interactive-questions`** for the widget format and the free-form-answer rule.
71
64
 
72
65
  Style enforcement (formatter / linter / post-change gate) lives in the **stack toolchain** — see each adapter’s **Stack notes**.
73
66
 
@@ -0,0 +1,27 @@
1
+ # Interactive questions (requestable)
2
+
3
+ How to put a user-only decision to the user. Load when the answer blocks the work and the host offers an interactive question tool (OpenCode `question`, Claude Code `AskUserQuestion`, a client dialog). The always-on quality rule keeps the short preference; this file carries the full contract.
4
+
5
+ ## When to ask
6
+
7
+ 1. **Interactive first.** Ask through the host's interactive question tool and structure the question for that tool. Plain prose is the fallback for a host without one, a headless run, or an answer that cannot be enumerated.
8
+ 2. **One decision per question.** Independent decisions go into separate entries so the host walks them as steps.
9
+ 3. **Ask before the dependent work.** Never a screening question per option, and never a question the repository already answers.
10
+
11
+ ## Widget format
12
+
13
+ 4. **Header** → a short label (≤30 characters).
14
+ 5. **Option label** → 1–5 words, in the user's terms.
15
+ 6. **Option description** → the consequence or the trade-off, not a restatement of the label.
16
+ 7. **Two to five options.** Put the option you recommend first and justify it in its description; do not pad the list with options you cannot defend.
17
+ 8. **Multi-select** only when the choices are not mutually exclusive. The host's own free-form entry does not count toward the range.
18
+
19
+ ## The free-form answer is mandatory, the option is not
20
+
21
+ 9. OpenCode `question` and Claude Code `AskUserQuestion` append their own free-form entry for single and multi select. Never add an “other” option there: option values are labels, so a chosen “Other” returns that word, not the user’s text.
22
+ 10. A host without that entry (a custom `dialog.select`, an MCP elicitation `enum`, a headless run) needs an explicit “Other” whose selection opens a text prompt — or prose when the answer cannot be enumerated.
23
+
24
+ ## Fallback
25
+
26
+ 11. **Prose.** With no question tool, ask in plain language with the same shape: the decision, the options, and the trade-off each option carries. One decision per message.
27
+ 12. **Do not block.** When the answer is not needed for the next step, state the assumption, continue, and name what a different answer would change.
@@ -6,4 +6,6 @@ Full scenario (including the **“Agent work”** block for a slug from team tas
6
6
 
7
7
  When a task has `metrics.json`, use the local aggregation script and state the cohort, sample size, incomplete artifacts, attribution confidence, active attempt duration, and human-gate wait separately. Do not score malformed artifacts or gate wait as agent work.
8
8
 
9
+ **Findings carry a category.** When a retro appends a signal it sets `finding_category` to one of `correctness` (wrong result, missed transition, bad math), `contract` (shape, route, param, enum drift), `perf` (budget, cost, unmeasured claim), `hygiene` (paths, dead code, artifacts), or `process` (sizing, ordering, gate choreography). Without the category, repeated `gate-changes-requested` rows cannot be turned into a rule: the signature only says that a gate rejected something. Gate-derived signals default to `process`; a retro that classifies a finding appends its own categorized row instead of rewriting the gate row.
10
+
9
11
  Use this rule only if the command is unavailable. Do not duplicate the command contents in the response — follow the command file and skill `technical-retro`.
@@ -200,6 +200,10 @@ const DEFAULT_ARTIFACT_OUTPUT_IDS = {
200
200
  // <<<hook-slot:ARTIFACT_OUTPUT_IDS>>>
201
201
  // <<<hook-slot:/ARTIFACT_OUTPUT_IDS>>>
202
202
  };
203
+ // Artifact status enum — mirrors the writer (`manifest.mjs`) and the schema
204
+ // table in agent-artifact-contracts.md. A receipt outcome is not a status.
205
+ const ARTIFACT_STATUSES = ['planned', 'in_progress', 'completed', 'blocked', 'superseded'];
206
+ const RECEIPT_OUTCOME_STATUS = { completed: 'completed', blocked: 'blocked', changes_requested: 'blocked', validation_failed: 'blocked' };
203
207
  function artifactOutputIdFor(step, agent) {
204
208
  if (step && typeof step.artifactOutputId === 'string') return step.artifactOutputId;
205
209
  if (step?.artifactOutputIds && typeof step.artifactOutputIds[agent] === 'string') return step.artifactOutputIds[agent];
@@ -778,6 +782,11 @@ function readBoundReceiptOutcome(agent, step, resolved) {
778
782
  process.stderr.write(`WARNING: ${manifestPath} receipt for producer "${agent}" id "${owned[0].id}" lacks entry.receipt.attemptId on a non-parallel step. The receipt is bound by output-id fallback; the agent should always include the attemptId the orchestrator provides. See agent-artifact-contracts.md (Receipt binding).` + '\n');
779
783
  }
780
784
  const outcome = owned[0]?.receipt?.outcome || null;
785
+ const bound = owned[0];
786
+ if (bound && typeof bound.status === 'string' && !ARTIFACT_STATUSES.includes(bound.status)) {
787
+ const expected = RECEIPT_OUTCOME_STATUS[bound.receipt.outcome] || 'blocked';
788
+ return { outcome: null, receiptRequired: true, stallMessage: `[chain-team-phases] ${slug}: receipt "${bound.id}" has artifact status "${bound.status}", which is not one of ${ARTIFACT_STATUSES.join(' | ')}. A receipt outcome is not a status — rewrite the entry with "node .ai.local/scripts/manifest.mjs upsert --slug ${slug} --id ${bound.id} --producer ${agent} --status ${expected} --outcome ${bound.receipt.outcome} --paths <artifact>.md", then resume with: /task-continue ${slug}` };
789
+ }
781
790
  if (outcome === 'completed') {
782
791
  const stallMessage = validateCompletedArtifact(owned[0]);
783
792
  if (stallMessage) return { outcome: null, receiptRequired: true, stallMessage };
@@ -71,7 +71,7 @@ Write `.ai.local/team/tasks/<slug>/validation-report.md` with verdict, commands,
71
71
 
72
72
  Write the owned validation receipt (`completed` or `validation_failed`). Do not fix code — report only.
73
73
 
74
- **Receipt binding.** When writing the terminal receipt to `artifact-manifest.json`, set `entry.receipt.attemptId = <attemptId supplied by the orchestrator>` (the orchestrator provides this via `attemptId` on invocation). The hook at `chain-team-phases.sh:readBoundReceiptOutcome` rejects entries whose `attemptId` does not match the current attempt, or whose `Date.parse(timestamps.completedAt) < Date.parse(attemptStartedAt)`. A missing or stale attemptId causes `awaiting_artifact_receipt` stalls. Write the receipt as a whole-file merge — `node .ai.local/scripts/manifest.mjs upsert --slug <slug> --id <id> --producer <agent> --outcome <outcome> --attempt <attemptId> …` — and never patch the JSON with a fragment/replace edit: a foreign parallel write or a refreshed `updatedAt` breaks the match and aborts the receipt mid-task. If the merge or parse fails, re-read and merge again (at most twice), then report `blocked` with the error. <!-- shared-core: receipt-binding -->
74
+ **Receipt binding.** When writing the terminal receipt to `artifact-manifest.json`, set `entry.receipt.attemptId = <attemptId supplied by the orchestrator>` (the orchestrator provides this via `attemptId` on invocation). The hook at `chain-team-phases.sh:readBoundReceiptOutcome` rejects entries whose `attemptId` does not match the current attempt, or whose `Date.parse(timestamps.completedAt) < Date.parse(attemptStartedAt)`. A missing or stale attemptId causes `awaiting_artifact_receipt` stalls. Write the receipt as a whole-file merge — `node .ai.local/scripts/manifest.mjs upsert --slug <slug> --id <id> --producer <agent> --outcome <outcome> --attempt <attemptId> …` — and never patch the JSON with a fragment/replace edit: a foreign parallel write or a refreshed `updatedAt` breaks the match and aborts the receipt mid-task. If the merge or parse fails, re-read and merge again (at most twice), then report `blocked` with the error. <!-- shared-core: receipt-binding -->
75
75
 
76
76
  ## Artifact contract
77
77
 
@@ -98,7 +98,7 @@ Write the owned terminal receipt described under **Artifact contract**. If **REQ
98
98
 
99
99
  Do not mix this output with retrospective facilitation — keep review and retro separate.
100
100
 
101
- **Receipt binding.** When writing the terminal receipt to `artifact-manifest.json`, set `entry.receipt.attemptId = <attemptId supplied by the orchestrator>` (the orchestrator provides this via `attemptId` on invocation). The hook at `chain-team-phases.sh:readBoundReceiptOutcome` rejects entries whose `attemptId` does not match the current attempt, or whose `Date.parse(timestamps.completedAt) < Date.parse(attemptStartedAt)`. A missing or stale attemptId causes `awaiting_artifact_receipt` stalls. Write the receipt as a whole-file merge — `node .ai.local/scripts/manifest.mjs upsert --slug <slug> --id <id> --producer <agent> --outcome <outcome> --attempt <attemptId> …` — and never patch the JSON with a fragment/replace edit: a foreign parallel write or a refreshed `updatedAt` breaks the match and aborts the receipt mid-task. If the merge or parse fails, re-read and merge again (at most twice), then report `blocked` with the error. <!-- shared-core: receipt-binding -->
101
+ **Receipt binding.** When writing the terminal receipt to `artifact-manifest.json`, set `entry.receipt.attemptId = <attemptId supplied by the orchestrator>` (the orchestrator provides this via `attemptId` on invocation). The hook at `chain-team-phases.sh:readBoundReceiptOutcome` rejects entries whose `attemptId` does not match the current attempt, or whose `Date.parse(timestamps.completedAt) < Date.parse(attemptStartedAt)`. A missing or stale attemptId causes `awaiting_artifact_receipt` stalls. Write the receipt as a whole-file merge — `node .ai.local/scripts/manifest.mjs upsert --slug <slug> --id <id> --producer <agent> --outcome <outcome> --attempt <attemptId> …` — and never patch the JSON with a fragment/replace edit: a foreign parallel write or a refreshed `updatedAt` breaks the match and aborts the receipt mid-task. If the merge or parse fails, re-read and merge again (at most twice), then report `blocked` with the error. <!-- shared-core: receipt-binding -->
102
102
 
103
103
  ## Design guidance
104
104
 
@@ -84,7 +84,7 @@ fixApplied: false
84
84
 
85
85
  Write the owned terminal receipt described under **Artifact contract**.
86
86
 
87
- **Receipt binding.** When writing the terminal receipt to `artifact-manifest.json`, set `entry.receipt.attemptId = <attemptId supplied by the orchestrator>` (the orchestrator provides this via `attemptId` on invocation). The hook at `chain-team-phases.sh:readBoundReceiptOutcome` rejects entries whose `attemptId` does not match the current attempt, or whose `Date.parse(timestamps.completedAt) < Date.parse(attemptStartedAt)`. A missing or stale attemptId causes `awaiting_artifact_receipt` stalls. Write the receipt as a whole-file merge — `node .ai.local/scripts/manifest.mjs upsert --slug <slug> --id <id> --producer <agent> --outcome <outcome> --attempt <attemptId> …` — and never patch the JSON with a fragment/replace edit: a foreign parallel write or a refreshed `updatedAt` breaks the match and aborts the receipt mid-task. If the merge or parse fails, re-read and merge again (at most twice), then report `blocked` with the error. <!-- shared-core: receipt-binding -->
87
+ **Receipt binding.** When writing the terminal receipt to `artifact-manifest.json`, set `entry.receipt.attemptId = <attemptId supplied by the orchestrator>` (the orchestrator provides this via `attemptId` on invocation). The hook at `chain-team-phases.sh:readBoundReceiptOutcome` rejects entries whose `attemptId` does not match the current attempt, or whose `Date.parse(timestamps.completedAt) < Date.parse(attemptStartedAt)`. A missing or stale attemptId causes `awaiting_artifact_receipt` stalls. Write the receipt as a whole-file merge — `node .ai.local/scripts/manifest.mjs upsert --slug <slug> --id <id> --producer <agent> --outcome <outcome> --attempt <attemptId> …` — and never patch the JSON with a fragment/replace edit: a foreign parallel write or a refreshed `updatedAt` breaks the match and aborts the receipt mid-task. If the merge or parse fails, re-read and merge again (at most twice), then report `blocked` with the error. <!-- shared-core: receipt-binding -->
88
88
 
89
89
  ## 3-fix architecture gate
90
90
 
@@ -75,7 +75,7 @@ When copying from `next` into `android-kotlin` (or another stack):
75
75
 
76
76
  Emit the owned implementation receipt with outcome `completed`. Handoff by layer + gaps for verifier/reviewer. No formal code review.
77
77
 
78
- **Receipt binding.** When writing the terminal receipt to `artifact-manifest.json`, set `entry.receipt.attemptId = <attemptId supplied by the orchestrator>` (the orchestrator provides this via `attemptId` on invocation). The hook at `chain-team-phases.sh:readBoundReceiptOutcome` rejects entries whose `attemptId` does not match the current attempt, or whose `Date.parse(timestamps.completedAt) < Date.parse(attemptStartedAt)`. A missing or stale attemptId causes `awaiting_artifact_receipt` stalls. Write the receipt as a whole-file merge — `node .ai.local/scripts/manifest.mjs upsert --slug <slug> --id <id> --producer <agent> --outcome <outcome> --attempt <attemptId> …` — and never patch the JSON with a fragment/replace edit: a foreign parallel write or a refreshed `updatedAt` breaks the match and aborts the receipt mid-task. If the merge or parse fails, re-read and merge again (at most twice), then report `blocked` with the error. <!-- shared-core: receipt-binding -->
78
+ **Receipt binding.** When writing the terminal receipt to `artifact-manifest.json`, set `entry.receipt.attemptId = <attemptId supplied by the orchestrator>` (the orchestrator provides this via `attemptId` on invocation). The hook at `chain-team-phases.sh:readBoundReceiptOutcome` rejects entries whose `attemptId` does not match the current attempt, or whose `Date.parse(timestamps.completedAt) < Date.parse(attemptStartedAt)`. A missing or stale attemptId causes `awaiting_artifact_receipt` stalls. Write the receipt as a whole-file merge — `node .ai.local/scripts/manifest.mjs upsert --slug <slug> --id <id> --producer <agent> --outcome <outcome> --attempt <attemptId> …` — and never patch the JSON with a fragment/replace edit: a foreign parallel write or a refreshed `updatedAt` breaks the match and aborts the receipt mid-task. If the merge or parse fails, re-read and merge again (at most twice), then report `blocked` with the error. <!-- shared-core: receipt-binding -->
79
79
 
80
80
  ## Design guidance
81
81