@bonesofspring/ai-rules 0.2.51 → 0.2.53

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 (376) hide show
  1. package/CHANGELOG.md +92 -0
  2. package/README.md +27 -3
  3. package/bin/cli.js +565 -61
  4. package/bin/lib/ai-local-drift.js +55 -14
  5. package/bin/lib/engine-scripts.js +10 -0
  6. package/bin/lib/mcp/clients.js +168 -0
  7. package/bin/lib/mcp/credentials.js +298 -0
  8. package/bin/lib/mcp/doctor.js +394 -0
  9. package/bin/lib/mcp/prompt.js +115 -0
  10. package/bin/lib/mcp/registry.js +170 -0
  11. package/bin/lib/mcp/run.js +123 -0
  12. package/bin/lib/merged-config.js +45 -0
  13. package/bin/lib/seed-ai-local-team.js +23 -7
  14. package/bin/lib/tool-installs.js +27 -0
  15. package/bin/mavis-install.js +2 -0
  16. package/bin/opencode-install.js +2 -0
  17. package/docs/LOCAL-OVERLAY.md +1 -1
  18. package/docs/MCP-SETUP.md +62 -0
  19. package/docs/PRESET-CONTRIBUTION.md +14 -10
  20. package/docs/TEAM-DB.md +173 -0
  21. package/docs/openapi/team-db.v1.json +5085 -0
  22. package/mcp/gitlab.mjs +123 -0
  23. package/mcp/lib/envfile.mjs +126 -0
  24. package/mcp/lib/yandex.mjs +384 -0
  25. package/mcp/yandex-mcp-proxy.mjs +155 -0
  26. package/mcp/yandex-token-refresh.mjs +65 -0
  27. package/package.json +18 -1
  28. package/presets/_shared/ai-local/scripts/manifest.mjs +112 -3
  29. package/presets/_shared/ai-local/scripts/rule-improver.mjs +428 -91
  30. package/presets/_shared/ai-local/scripts/run.mjs +22 -4
  31. package/presets/_shared/ai-local/scripts/signals.mjs +4 -1
  32. package/presets/_shared/ai-local/scripts/team-db-api.mjs +1275 -0
  33. package/presets/_shared/ai-local/scripts/team-db-dashboard.mjs +1067 -0
  34. package/presets/_shared/ai-local/scripts/team-db-openapi.mjs +1301 -0
  35. package/presets/_shared/ai-local/scripts/team-db-project.mjs +1506 -0
  36. package/presets/_shared/ai-local/scripts/team-db-schema.mjs +831 -0
  37. package/presets/_shared/ai-local/scripts/team-db.mjs +251 -0
  38. package/presets/_shared/core/meta/preset-pr-checklist.md +1 -1
  39. package/presets/_shared/core/quality/interactive-questions.md +8 -8
  40. package/presets/_shared/hooks/chain-team-phases.sh.tmpl +109 -0
  41. package/presets/claude/android-kotlin/agents/code-reviewer.md +1 -0
  42. package/presets/claude/android-kotlin/hooks/chain-team-phases.sh +109 -0
  43. package/presets/claude/android-kotlin/rules/tooling-and-review/interactive-questions.md +8 -8
  44. package/presets/claude/android-kotlin/rules/tooling-and-review/language-policy.md +1 -1
  45. package/presets/claude/android-kotlin/rules/tooling-and-review/preset-pr-checklist.md +1 -1
  46. package/presets/claude/android-kotlin/team/README.md +10 -0
  47. package/presets/claude/go/agents/code-reviewer.md +1 -0
  48. package/presets/claude/go/hooks/chain-team-phases.sh +109 -0
  49. package/presets/claude/go/rules/tooling-and-review/interactive-questions.md +8 -8
  50. package/presets/claude/go/rules/tooling-and-review/language-policy.md +1 -1
  51. package/presets/claude/go/rules/tooling-and-review/preset-pr-checklist.md +1 -1
  52. package/presets/claude/go/team/README.md +10 -0
  53. package/presets/claude/ios-swift/agents/code-reviewer.md +1 -0
  54. package/presets/claude/ios-swift/hooks/chain-team-phases.sh +109 -0
  55. package/presets/claude/ios-swift/rules/tooling-and-review/interactive-questions.md +8 -8
  56. package/presets/claude/ios-swift/rules/tooling-and-review/language-policy.md +1 -1
  57. package/presets/claude/ios-swift/rules/tooling-and-review/post-change-build.md +1 -1
  58. package/presets/claude/ios-swift/rules/tooling-and-review/preset-pr-checklist.md +1 -1
  59. package/presets/claude/ios-swift/team/README.md +10 -0
  60. package/presets/claude/java/agents/code-reviewer.md +1 -0
  61. package/presets/claude/java/hooks/chain-team-phases.sh +109 -0
  62. package/presets/claude/java/rules/tooling-and-review/interactive-questions.md +8 -8
  63. package/presets/claude/java/rules/tooling-and-review/language-policy.md +1 -1
  64. package/presets/claude/java/rules/tooling-and-review/preset-pr-checklist.md +1 -1
  65. package/presets/claude/java/team/README.md +10 -0
  66. package/presets/claude/mcp-ts/hooks/chain-team-phases.sh +109 -0
  67. package/presets/claude/mcp-ts/rules/tooling-and-review/interactive-questions.md +8 -8
  68. package/presets/claude/mcp-ts/rules/tooling-and-review/language-policy.md +1 -1
  69. package/presets/claude/mcp-ts/rules/tooling-and-review/preset-pr-checklist.md +1 -1
  70. package/presets/claude/mcp-ts/team/README.md +10 -0
  71. package/presets/claude/next/MCP.md +7 -0
  72. package/presets/claude/next/README.md +1 -1
  73. package/presets/claude/next/REPO_AGENTS.md +1 -1
  74. package/presets/claude/next/agents/README.md +3 -3
  75. package/presets/claude/next/agents/build-verifier.md +9 -3
  76. package/presets/claude/next/agents/code-reviewer.md +2 -1
  77. package/presets/claude/next/agents/codebase-analyzer.md +1 -1
  78. package/presets/claude/next/agents/feature-developer.md +18 -8
  79. package/presets/claude/next/agents/openspec-author.md +1 -1
  80. package/presets/claude/next/agents/playwright-test-generator.md +22 -68
  81. package/presets/claude/next/agents/playwright-test-healer.md +27 -54
  82. package/presets/claude/next/agents/playwright-test-planner.md +18 -51
  83. package/presets/claude/next/agents/task-analyst.md +25 -9
  84. package/presets/claude/next/agents/task-router.md +1 -1
  85. package/presets/claude/next/agents/tech-writer.md +1 -1
  86. package/presets/claude/next/hooks/chain-team-phases.sh +109 -0
  87. package/presets/claude/next/mcp.json +3 -3
  88. package/presets/claude/next/rules/anti-hallucination/react-next-anti-hallucination.md +1 -1
  89. package/presets/claude/next/rules/architecture/layer-barrel-exports.md +1 -1
  90. package/presets/claude/next/rules/architecture/reference-features.md +1 -1
  91. package/presets/claude/next/rules/stack/navigation-router-ui.md +1 -1
  92. package/presets/claude/next/rules/stack/navigation-router.md +14 -0
  93. package/presets/claude/next/rules/stack/next-app-core.md +19 -17
  94. package/presets/claude/next/rules/stack/next-app-router.md +5 -17
  95. package/presets/claude/next/rules/stack/next-static-export.md +1 -1
  96. package/presets/claude/next/rules/tooling-and-review/interactive-questions.md +8 -8
  97. package/presets/claude/next/rules/tooling-and-review/language-policy.md +1 -1
  98. package/presets/claude/next/rules/tooling-and-review/post-change-lint.md +1 -1
  99. package/presets/claude/next/rules/tooling-and-review/preset-pr-checklist.md +1 -1
  100. package/presets/claude/next/rules/tooling-and-review/preset-token-budget.md +1 -1
  101. package/presets/claude/next/rules/tooling-and-review/security-next.md +28 -3
  102. package/presets/claude/next/rules/ui-and-accessibility/css-property-order.md +1 -1
  103. package/presets/claude/next/rules/ui-and-accessibility/design-tokens-binding.md +4 -4
  104. package/presets/claude/next/rules/ui-and-accessibility/forms-validation.md +2 -2
  105. package/presets/claude/next/team/README.md +21 -0
  106. package/presets/claude/next/team/fixtures/feature-with-figma-url.json +10 -0
  107. package/presets/claude/next/team/fixtures/feature-with-ux-no-figma.json +10 -0
  108. package/presets/claude/next/team/fixtures/mockup-review-standalone.json +9 -0
  109. package/presets/claude/next/team/fixtures/ux-design-standalone.json +9 -0
  110. package/presets/claude/nuxt/agents/code-reviewer.md +1 -0
  111. package/presets/claude/nuxt/hooks/chain-team-phases.sh +109 -0
  112. package/presets/claude/nuxt/rules/architecture/layer-barrel-exports.md +1 -1
  113. package/presets/claude/nuxt/rules/stack/navigation-router-ui.md +1 -1
  114. package/presets/claude/nuxt/rules/tooling-and-review/interactive-questions.md +8 -8
  115. package/presets/claude/nuxt/rules/tooling-and-review/language-policy.md +1 -1
  116. package/presets/claude/nuxt/rules/tooling-and-review/post-change-lint.md +1 -1
  117. package/presets/claude/nuxt/rules/tooling-and-review/preset-pr-checklist.md +1 -1
  118. package/presets/claude/nuxt/team/README.md +10 -0
  119. package/presets/claude/php-hexagonal/agents/code-reviewer.md +1 -0
  120. package/presets/claude/php-hexagonal/hooks/chain-team-phases.sh +109 -0
  121. package/presets/claude/php-hexagonal/rules/tooling-and-review/interactive-questions.md +8 -8
  122. package/presets/claude/php-hexagonal/rules/tooling-and-review/language-policy.md +1 -1
  123. package/presets/claude/php-hexagonal/rules/tooling-and-review/preset-pr-checklist.md +1 -1
  124. package/presets/claude/php-hexagonal/team/README.md +10 -0
  125. package/presets/claude/php-laravel/agents/code-reviewer.md +1 -0
  126. package/presets/claude/php-laravel/hooks/chain-team-phases.sh +109 -0
  127. package/presets/claude/php-laravel/rules/tooling-and-review/interactive-questions.md +8 -8
  128. package/presets/claude/php-laravel/rules/tooling-and-review/language-policy.md +1 -1
  129. package/presets/claude/php-laravel/rules/tooling-and-review/preset-pr-checklist.md +1 -1
  130. package/presets/claude/php-laravel/team/README.md +10 -0
  131. package/presets/claude/svelte/agents/code-reviewer.md +1 -0
  132. package/presets/claude/svelte/hooks/chain-team-phases.sh +109 -0
  133. package/presets/claude/svelte/rules/architecture/layer-barrel-exports.md +1 -1
  134. package/presets/claude/svelte/rules/tooling-and-review/interactive-questions.md +8 -8
  135. package/presets/claude/svelte/rules/tooling-and-review/language-policy.md +1 -1
  136. package/presets/claude/svelte/rules/tooling-and-review/post-change-lint.md +1 -1
  137. package/presets/claude/svelte/rules/tooling-and-review/preset-pr-checklist.md +1 -1
  138. package/presets/claude/svelte/team/README.md +10 -0
  139. package/presets/cursor/android-kotlin/agents/code-reviewer.md +1 -0
  140. package/presets/cursor/android-kotlin/hooks/chain-team-phases.sh +109 -0
  141. package/presets/cursor/android-kotlin/rules/README.md +1 -0
  142. package/presets/cursor/android-kotlin/rules/agent-team-orchestrator.mdc +3 -3
  143. package/presets/cursor/android-kotlin/rules/interactive-questions.mdc +8 -8
  144. package/presets/cursor/android-kotlin/rules/preset-pr-checklist.mdc +1 -1
  145. package/presets/cursor/android-kotlin/team/README.md +10 -0
  146. package/presets/cursor/go/agents/code-reviewer.md +1 -0
  147. package/presets/cursor/go/hooks/chain-team-phases.sh +109 -0
  148. package/presets/cursor/go/rules/agent-team-orchestrator.mdc +2 -2
  149. package/presets/cursor/go/rules/interactive-questions.mdc +8 -8
  150. package/presets/cursor/go/rules/preset-pr-checklist.mdc +1 -1
  151. package/presets/cursor/go/team/README.md +10 -0
  152. package/presets/cursor/ios-swift/agents/code-reviewer.md +1 -0
  153. package/presets/cursor/ios-swift/hooks/chain-team-phases.sh +109 -0
  154. package/presets/cursor/ios-swift/rules/README.md +1 -0
  155. package/presets/cursor/ios-swift/rules/agent-team-orchestrator.mdc +3 -3
  156. package/presets/cursor/ios-swift/rules/interactive-questions.mdc +8 -8
  157. package/presets/cursor/ios-swift/rules/preset-pr-checklist.mdc +1 -1
  158. package/presets/cursor/ios-swift/team/README.md +10 -0
  159. package/presets/cursor/java/agents/code-reviewer.md +1 -0
  160. package/presets/cursor/java/hooks/chain-team-phases.sh +109 -0
  161. package/presets/cursor/java/rules/agent-team-orchestrator.mdc +2 -2
  162. package/presets/cursor/java/rules/interactive-questions.mdc +8 -8
  163. package/presets/cursor/java/rules/preset-pr-checklist.mdc +1 -1
  164. package/presets/cursor/java/team/README.md +10 -0
  165. package/presets/cursor/mcp-ts/hooks/chain-team-phases.sh +109 -0
  166. package/presets/cursor/mcp-ts/rules/agent-team-orchestrator.mdc +2 -2
  167. package/presets/cursor/mcp-ts/rules/interactive-questions.mdc +8 -8
  168. package/presets/cursor/mcp-ts/rules/preset-pr-checklist.mdc +1 -1
  169. package/presets/cursor/mcp-ts/team/README.md +10 -0
  170. package/presets/cursor/next/MCP.md +14 -0
  171. package/presets/cursor/next/REPO_AGENTS.md +1 -1
  172. package/presets/cursor/next/agents/code-reviewer.md +1 -0
  173. package/presets/cursor/next/agents/playwright-test-healer.md +1 -0
  174. package/presets/cursor/next/ai-local/rules-library/router-pages.md +5 -5
  175. package/presets/cursor/next/hooks/chain-team-phases.sh +109 -0
  176. package/presets/cursor/next/mcp.json +3 -3
  177. package/presets/cursor/next/rules/README.md +1 -1
  178. package/presets/cursor/next/rules/agent-team-orchestrator.mdc +1 -1
  179. package/presets/cursor/next/rules/css-property-order-stylelint.mdc +1 -1
  180. package/presets/cursor/next/rules/design-tokens-binding.mdc +4 -4
  181. package/presets/cursor/next/rules/forms-validation.mdc +2 -2
  182. package/presets/cursor/next/rules/interactive-questions.mdc +8 -8
  183. package/presets/cursor/next/rules/navigation-router-stack.mdc +14 -1
  184. package/presets/cursor/next/rules/next-app-core.mdc +19 -17
  185. package/presets/cursor/next/rules/next-app-router.mdc +5 -17
  186. package/presets/cursor/next/rules/next-static-export.mdc +1 -1
  187. package/presets/cursor/next/rules/preset-pr-checklist.mdc +1 -1
  188. package/presets/cursor/next/rules/preset-token-budget.mdc +1 -1
  189. package/presets/cursor/next/rules/react-next-anti-hallucination.mdc +1 -1
  190. package/presets/cursor/next/rules/reference-features.mdc +1 -1
  191. package/presets/cursor/next/rules/security-next.mdc +28 -3
  192. package/presets/cursor/next/team/README.md +21 -0
  193. package/presets/cursor/next/team/fixtures/feature-with-figma-url.json +10 -0
  194. package/presets/cursor/next/team/fixtures/feature-with-ux-no-figma.json +10 -0
  195. package/presets/cursor/next/team/fixtures/mockup-review-standalone.json +9 -0
  196. package/presets/cursor/next/team/fixtures/ux-design-standalone.json +9 -0
  197. package/presets/cursor/nuxt/agents/code-reviewer.md +1 -0
  198. package/presets/cursor/nuxt/hooks/chain-team-phases.sh +109 -0
  199. package/presets/cursor/nuxt/rules/agent-team-orchestrator.mdc +1 -1
  200. package/presets/cursor/nuxt/rules/interactive-questions.mdc +8 -8
  201. package/presets/cursor/nuxt/rules/preset-pr-checklist.mdc +1 -1
  202. package/presets/cursor/nuxt/team/README.md +10 -0
  203. package/presets/cursor/php-hexagonal/agents/code-reviewer.md +1 -0
  204. package/presets/cursor/php-hexagonal/hooks/chain-team-phases.sh +109 -0
  205. package/presets/cursor/php-hexagonal/rules/agent-team-orchestrator.mdc +2 -2
  206. package/presets/cursor/php-hexagonal/rules/interactive-questions.mdc +8 -8
  207. package/presets/cursor/php-hexagonal/rules/preset-pr-checklist.mdc +1 -1
  208. package/presets/cursor/php-hexagonal/team/README.md +10 -0
  209. package/presets/cursor/php-laravel/agents/code-reviewer.md +1 -0
  210. package/presets/cursor/php-laravel/hooks/chain-team-phases.sh +109 -0
  211. package/presets/cursor/php-laravel/rules/agent-team-orchestrator.mdc +2 -2
  212. package/presets/cursor/php-laravel/rules/interactive-questions.mdc +8 -8
  213. package/presets/cursor/php-laravel/rules/preset-pr-checklist.mdc +1 -1
  214. package/presets/cursor/php-laravel/team/README.md +10 -0
  215. package/presets/cursor/svelte/agents/code-reviewer.md +1 -0
  216. package/presets/cursor/svelte/hooks/chain-team-phases.sh +109 -0
  217. package/presets/cursor/svelte/rules/agent-team-orchestrator.mdc +1 -1
  218. package/presets/cursor/svelte/rules/interactive-questions.mdc +8 -8
  219. package/presets/cursor/svelte/rules/preset-pr-checklist.mdc +1 -1
  220. package/presets/cursor/svelte/team/README.md +10 -0
  221. package/presets/mavis/android-kotlin/adapter-map.json +1 -1
  222. package/presets/mavis/android-kotlin/agents/code-reviewer.md +1 -0
  223. package/presets/mavis/android-kotlin/hooks/chain-team-phases.sh +109 -0
  224. package/presets/mavis/android-kotlin/rules/interactive-questions.md +8 -8
  225. package/presets/mavis/android-kotlin/rules/preset-pr-checklist.md +1 -1
  226. package/presets/mavis/android-kotlin/team/README.md +10 -0
  227. package/presets/mavis/go/adapter-map.json +1 -1
  228. package/presets/mavis/go/agents/code-reviewer.md +1 -0
  229. package/presets/mavis/go/hooks/chain-team-phases.sh +109 -0
  230. package/presets/mavis/go/rules/interactive-questions.md +8 -8
  231. package/presets/mavis/go/rules/preset-pr-checklist.md +1 -1
  232. package/presets/mavis/go/team/README.md +10 -0
  233. package/presets/mavis/ios-swift/adapter-map.json +1 -1
  234. package/presets/mavis/ios-swift/agents/code-reviewer.md +1 -0
  235. package/presets/mavis/ios-swift/hooks/chain-team-phases.sh +109 -0
  236. package/presets/mavis/ios-swift/rules/interactive-questions.md +8 -8
  237. package/presets/mavis/ios-swift/rules/preset-pr-checklist.md +1 -1
  238. package/presets/mavis/ios-swift/team/README.md +10 -0
  239. package/presets/mavis/java/adapter-map.json +1 -1
  240. package/presets/mavis/java/agents/code-reviewer.md +1 -0
  241. package/presets/mavis/java/hooks/chain-team-phases.sh +109 -0
  242. package/presets/mavis/java/rules/interactive-questions.md +8 -8
  243. package/presets/mavis/java/rules/preset-pr-checklist.md +1 -1
  244. package/presets/mavis/java/team/README.md +10 -0
  245. package/presets/mavis/mcp-ts/adapter-map.json +1 -1
  246. package/presets/mavis/mcp-ts/hooks/chain-team-phases.sh +109 -0
  247. package/presets/mavis/mcp-ts/rules/interactive-questions.md +8 -8
  248. package/presets/mavis/mcp-ts/rules/preset-pr-checklist.md +1 -1
  249. package/presets/mavis/mcp-ts/team/README.md +10 -0
  250. package/presets/mavis/next/MCP.md +14 -0
  251. package/presets/mavis/next/REPO_AGENTS.md +1 -1
  252. package/presets/mavis/next/adapter-map.json +1 -1
  253. package/presets/mavis/next/agents/code-reviewer.md +1 -0
  254. package/presets/mavis/next/agents/playwright-test-healer.md +1 -0
  255. package/presets/mavis/next/ai-local/rules-library/router-pages.md +5 -5
  256. package/presets/mavis/next/hooks/chain-team-phases.sh +109 -0
  257. package/presets/mavis/next/mcp.json +3 -3
  258. package/presets/mavis/next/rules/css-property-order-stylelint.md +1 -1
  259. package/presets/mavis/next/rules/design-tokens-binding.md +4 -4
  260. package/presets/mavis/next/rules/forms-validation.md +2 -2
  261. package/presets/mavis/next/rules/interactive-questions.md +8 -8
  262. package/presets/mavis/next/rules/navigation-router-stack.md +12 -0
  263. package/presets/mavis/next/rules/next-app-core.md +18 -17
  264. package/presets/mavis/next/rules/next-app-router.md +4 -17
  265. package/presets/mavis/next/rules/next-static-export.md +1 -1
  266. package/presets/mavis/next/rules/preset-pr-checklist.md +1 -1
  267. package/presets/mavis/next/rules/react-next-anti-hallucination.md +1 -1
  268. package/presets/mavis/next/rules/reference-features.md +1 -1
  269. package/presets/mavis/next/rules/security-next.md +24 -3
  270. package/presets/mavis/next/team/README.md +21 -0
  271. package/presets/mavis/next/team/fixtures/feature-with-figma-url.json +10 -0
  272. package/presets/mavis/next/team/fixtures/feature-with-ux-no-figma.json +10 -0
  273. package/presets/mavis/next/team/fixtures/mockup-review-standalone.json +9 -0
  274. package/presets/mavis/next/team/fixtures/ux-design-standalone.json +9 -0
  275. package/presets/mavis/nuxt/adapter-map.json +1 -1
  276. package/presets/mavis/nuxt/agents/code-reviewer.md +1 -0
  277. package/presets/mavis/nuxt/hooks/chain-team-phases.sh +109 -0
  278. package/presets/mavis/nuxt/rules/interactive-questions.md +8 -8
  279. package/presets/mavis/nuxt/rules/preset-pr-checklist.md +1 -1
  280. package/presets/mavis/nuxt/team/README.md +10 -0
  281. package/presets/mavis/php-hexagonal/adapter-map.json +1 -1
  282. package/presets/mavis/php-hexagonal/agents/code-reviewer.md +1 -0
  283. package/presets/mavis/php-hexagonal/hooks/chain-team-phases.sh +109 -0
  284. package/presets/mavis/php-hexagonal/rules/interactive-questions.md +8 -8
  285. package/presets/mavis/php-hexagonal/rules/preset-pr-checklist.md +1 -1
  286. package/presets/mavis/php-hexagonal/team/README.md +10 -0
  287. package/presets/mavis/php-laravel/adapter-map.json +1 -1
  288. package/presets/mavis/php-laravel/agents/code-reviewer.md +1 -0
  289. package/presets/mavis/php-laravel/hooks/chain-team-phases.sh +109 -0
  290. package/presets/mavis/php-laravel/rules/interactive-questions.md +8 -8
  291. package/presets/mavis/php-laravel/rules/preset-pr-checklist.md +1 -1
  292. package/presets/mavis/php-laravel/team/README.md +10 -0
  293. package/presets/mavis/svelte/adapter-map.json +1 -1
  294. package/presets/mavis/svelte/agents/code-reviewer.md +1 -0
  295. package/presets/mavis/svelte/hooks/chain-team-phases.sh +109 -0
  296. package/presets/mavis/svelte/rules/interactive-questions.md +8 -8
  297. package/presets/mavis/svelte/rules/preset-pr-checklist.md +1 -1
  298. package/presets/mavis/svelte/team/README.md +10 -0
  299. package/presets/opencode/android-kotlin/adapter-map.json +1 -1
  300. package/presets/opencode/android-kotlin/agents/code-reviewer.md +1 -0
  301. package/presets/opencode/android-kotlin/hooks/chain-team-phases.sh +109 -0
  302. package/presets/opencode/android-kotlin/rules/interactive-questions.md +8 -8
  303. package/presets/opencode/android-kotlin/rules/preset-pr-checklist.md +1 -1
  304. package/presets/opencode/android-kotlin/team/README.md +10 -0
  305. package/presets/opencode/go/adapter-map.json +1 -1
  306. package/presets/opencode/go/agents/code-reviewer.md +1 -0
  307. package/presets/opencode/go/hooks/chain-team-phases.sh +109 -0
  308. package/presets/opencode/go/rules/interactive-questions.md +8 -8
  309. package/presets/opencode/go/rules/preset-pr-checklist.md +1 -1
  310. package/presets/opencode/go/team/README.md +10 -0
  311. package/presets/opencode/ios-swift/adapter-map.json +1 -1
  312. package/presets/opencode/ios-swift/agents/code-reviewer.md +1 -0
  313. package/presets/opencode/ios-swift/hooks/chain-team-phases.sh +109 -0
  314. package/presets/opencode/ios-swift/rules/interactive-questions.md +8 -8
  315. package/presets/opencode/ios-swift/rules/preset-pr-checklist.md +1 -1
  316. package/presets/opencode/ios-swift/team/README.md +10 -0
  317. package/presets/opencode/java/adapter-map.json +1 -1
  318. package/presets/opencode/java/agents/code-reviewer.md +1 -0
  319. package/presets/opencode/java/hooks/chain-team-phases.sh +109 -0
  320. package/presets/opencode/java/rules/interactive-questions.md +8 -8
  321. package/presets/opencode/java/rules/preset-pr-checklist.md +1 -1
  322. package/presets/opencode/java/team/README.md +10 -0
  323. package/presets/opencode/mcp-ts/adapter-map.json +1 -1
  324. package/presets/opencode/mcp-ts/hooks/chain-team-phases.sh +109 -0
  325. package/presets/opencode/mcp-ts/rules/interactive-questions.md +8 -8
  326. package/presets/opencode/mcp-ts/rules/preset-pr-checklist.md +1 -1
  327. package/presets/opencode/mcp-ts/team/README.md +10 -0
  328. package/presets/opencode/next/MCP.md +14 -0
  329. package/presets/opencode/next/REPO_AGENTS.md +1 -1
  330. package/presets/opencode/next/adapter-map.json +1 -1
  331. package/presets/opencode/next/agents/code-reviewer.md +1 -0
  332. package/presets/opencode/next/agents/playwright-test-healer.md +1 -0
  333. package/presets/opencode/next/ai-local/rules-library/router-pages.md +5 -5
  334. package/presets/opencode/next/hooks/chain-team-phases.sh +109 -0
  335. package/presets/opencode/next/opencode.json +3 -3
  336. package/presets/opencode/next/rules/css-property-order-stylelint.md +1 -1
  337. package/presets/opencode/next/rules/design-tokens-binding.md +4 -4
  338. package/presets/opencode/next/rules/forms-validation.md +2 -2
  339. package/presets/opencode/next/rules/interactive-questions.md +8 -8
  340. package/presets/opencode/next/rules/navigation-router-stack.md +12 -0
  341. package/presets/opencode/next/rules/next-app-core.md +18 -17
  342. package/presets/opencode/next/rules/next-app-router.md +4 -17
  343. package/presets/opencode/next/rules/next-static-export.md +1 -1
  344. package/presets/opencode/next/rules/preset-pr-checklist.md +1 -1
  345. package/presets/opencode/next/rules/react-next-anti-hallucination.md +1 -1
  346. package/presets/opencode/next/rules/reference-features.md +1 -1
  347. package/presets/opencode/next/rules/security-next.md +24 -3
  348. package/presets/opencode/next/team/README.md +21 -0
  349. package/presets/opencode/next/team/fixtures/feature-with-figma-url.json +10 -0
  350. package/presets/opencode/next/team/fixtures/feature-with-ux-no-figma.json +10 -0
  351. package/presets/opencode/next/team/fixtures/mockup-review-standalone.json +9 -0
  352. package/presets/opencode/next/team/fixtures/ux-design-standalone.json +9 -0
  353. package/presets/opencode/nuxt/adapter-map.json +1 -1
  354. package/presets/opencode/nuxt/agents/code-reviewer.md +1 -0
  355. package/presets/opencode/nuxt/hooks/chain-team-phases.sh +109 -0
  356. package/presets/opencode/nuxt/rules/interactive-questions.md +8 -8
  357. package/presets/opencode/nuxt/rules/preset-pr-checklist.md +1 -1
  358. package/presets/opencode/nuxt/team/README.md +10 -0
  359. package/presets/opencode/php-hexagonal/adapter-map.json +1 -1
  360. package/presets/opencode/php-hexagonal/agents/code-reviewer.md +1 -0
  361. package/presets/opencode/php-hexagonal/hooks/chain-team-phases.sh +109 -0
  362. package/presets/opencode/php-hexagonal/rules/interactive-questions.md +8 -8
  363. package/presets/opencode/php-hexagonal/rules/preset-pr-checklist.md +1 -1
  364. package/presets/opencode/php-hexagonal/team/README.md +10 -0
  365. package/presets/opencode/php-laravel/adapter-map.json +1 -1
  366. package/presets/opencode/php-laravel/agents/code-reviewer.md +1 -0
  367. package/presets/opencode/php-laravel/hooks/chain-team-phases.sh +109 -0
  368. package/presets/opencode/php-laravel/rules/interactive-questions.md +8 -8
  369. package/presets/opencode/php-laravel/rules/preset-pr-checklist.md +1 -1
  370. package/presets/opencode/php-laravel/team/README.md +10 -0
  371. package/presets/opencode/svelte/adapter-map.json +1 -1
  372. package/presets/opencode/svelte/agents/code-reviewer.md +1 -0
  373. package/presets/opencode/svelte/hooks/chain-team-phases.sh +109 -0
  374. package/presets/opencode/svelte/rules/interactive-questions.md +8 -8
  375. package/presets/opencode/svelte/rules/preset-pr-checklist.md +1 -1
  376. package/presets/opencode/svelte/team/README.md +10 -0
@@ -0,0 +1,155 @@
1
+ #!/usr/bin/env node
2
+ /**
3
+ * Yandex Tracker / Wiki MCP proxy (stdio JSON-RPC 2.0 ↔ streamable HTTP/SSE).
4
+ *
5
+ * The client starts this through `npx -y @bonesofspring/ai-rules@<version> mcp run
6
+ * <yandex-tracker|yandex-wiki>`. It obtains a fresh IAM token from
7
+ * `yc iam create-token` on first upstream request, forwards each JSON-RPC message
8
+ * to the target MCP endpoint with `Authorization: Bearer` + `X-Cloud-Org-ID`, and
9
+ * on a 401 invalidates the token, re-fetches it once and retries. A second
10
+ * failure returns a fixed, token-free re-login error.
11
+ */
12
+ import { createInterface } from 'node:readline';
13
+ import {
14
+ RELOGIN_MESSAGE,
15
+ ReloginError,
16
+ YcCommandError,
17
+ YcSpawnError,
18
+ UnauthorizedError,
19
+ fetchToken,
20
+ loadYandexConfig,
21
+ postJsonRpc,
22
+ resolveTarget,
23
+ } from './lib/yandex.mjs';
24
+
25
+ let target;
26
+ let config;
27
+
28
+ try {
29
+ target = resolveTarget(process.argv[2]);
30
+ config = loadYandexConfig();
31
+ } catch (error) {
32
+ process.stderr.write(`${error instanceof Error ? error.message : String(error)}\n`);
33
+ if (error instanceof YcSpawnError) {
34
+ process.stderr.write('next: install the Yandex Cloud CLI (https://yandex.cloud/en/docs/cli/operations/install-cli)\n');
35
+ }
36
+ process.exit(1);
37
+ }
38
+
39
+ const { orgId, noProxy, ycBin } = config;
40
+
41
+ let cachedToken = null;
42
+ let sessionId = null;
43
+
44
+ function write(message) {
45
+ process.stdout.write(`${JSON.stringify(message)}\n`);
46
+ }
47
+
48
+ function fail(id, code, message) {
49
+ write({ jsonrpc: '2.0', id, error: { code, message } });
50
+ }
51
+
52
+ async function getToken() {
53
+ if (cachedToken) {
54
+ return cachedToken;
55
+ }
56
+
57
+ const { token } = await fetchToken({ interactive: false, ycBin, noProxy });
58
+ cachedToken = token;
59
+ return token;
60
+ }
61
+
62
+ async function relay(message) {
63
+ const protocolVersion = message.method === 'initialize' ? message.params?.protocolVersion : undefined;
64
+ let token = await getToken();
65
+
66
+ for (let attempt = 0; ; attempt += 1) {
67
+ try {
68
+ const result = await postJsonRpc({
69
+ url: target,
70
+ token,
71
+ orgId,
72
+ sessionId,
73
+ protocolVersion,
74
+ message,
75
+ });
76
+
77
+ if (result.sessionId) {
78
+ sessionId = result.sessionId;
79
+ }
80
+
81
+ return result.messages;
82
+ } catch (error) {
83
+ if (!(error instanceof UnauthorizedError) || attempt >= 1) {
84
+ throw error;
85
+ }
86
+
87
+ // Stale token: invalidate, re-fetch once, retry. A failing re-fetch
88
+ // (ReloginError) propagates as the re-login signal.
89
+ cachedToken = null;
90
+ token = await getToken();
91
+ }
92
+ }
93
+ }
94
+
95
+ async function handle(message) {
96
+ const { id, method } = message;
97
+
98
+ if (method === undefined) {
99
+ return;
100
+ }
101
+
102
+ try {
103
+ const messages = await relay(message);
104
+
105
+ if (id === undefined) {
106
+ return; // notification — no response expected
107
+ }
108
+
109
+ for (const emitted of messages) {
110
+ write(emitted);
111
+ }
112
+ } catch (error) {
113
+ if (id === undefined) {
114
+ return;
115
+ }
116
+
117
+ if (error instanceof ReloginError || error instanceof YcCommandError || error instanceof UnauthorizedError) {
118
+ fail(id, -32603, RELOGIN_MESSAGE);
119
+ return;
120
+ }
121
+
122
+ if (error instanceof Error) {
123
+ fail(id, -32603, error.message);
124
+ return;
125
+ }
126
+
127
+ fail(id, -32603, String(error));
128
+ }
129
+ }
130
+
131
+ const reader = createInterface({ input: process.stdin, crlfDelay: Infinity });
132
+ let chain = Promise.resolve();
133
+
134
+ reader.on('line', (line) => {
135
+ const trimmed = line.trim();
136
+
137
+ if (!trimmed) {
138
+ return;
139
+ }
140
+
141
+ let message;
142
+
143
+ try {
144
+ message = JSON.parse(trimmed);
145
+ } catch {
146
+ fail(null, -32700, 'Parse error');
147
+ return;
148
+ }
149
+
150
+ chain = chain.then(() => handle(message)).catch(() => undefined);
151
+ });
152
+
153
+ reader.on('close', () => {
154
+ chain.then(() => process.exit(0));
155
+ });
@@ -0,0 +1,65 @@
1
+ #!/usr/bin/env node
2
+ /**
3
+ * Yandex IAM token refresh (yc federation) — `ai-rules mcp refresh yandex`.
4
+ *
5
+ * Re-runs `yc iam create-token` interactively so yc can open the browser and
6
+ * complete the federation login when the SSO session has expired. Exit codes:
7
+ * 0 — fresh IAM token (session live, or login just completed)
8
+ * 1 — yc not found / non-zero exit / unexpected error
9
+ * 2 — re-login required (yc produced no valid token)
10
+ *
11
+ * The token is not printed by default; `--print` is an opt-in for a developer
12
+ * terminal (never a log or committed artifact).
13
+ */
14
+ import {
15
+ ReloginError,
16
+ YcCommandError,
17
+ YcSpawnError,
18
+ fetchToken,
19
+ loadYandexConfig,
20
+ } from './lib/yandex.mjs';
21
+
22
+ const printToken = process.argv.includes('--print');
23
+
24
+ async function main() {
25
+ const { ycBin, noProxy } = loadYandexConfig({ requireOrg: false });
26
+
27
+ try {
28
+ const { token } = await fetchToken({ interactive: true, ycBin, noProxy });
29
+
30
+ if (printToken) {
31
+ process.stdout.write(`${token}\n`);
32
+ }
33
+
34
+ process.stderr.write('Yandex IAM token refreshed — federation session live.\n');
35
+ return 0;
36
+ } catch (error) {
37
+ if (error instanceof YcSpawnError) {
38
+ process.stderr.write(`${error.message}\n`);
39
+ process.stderr.write('next: install the Yandex Cloud CLI (https://yandex.cloud/en/docs/cli/operations/install-cli)\n');
40
+ return 1;
41
+ }
42
+
43
+ if (error instanceof YcCommandError) {
44
+ process.stderr.write(`${error.message}\n`);
45
+ process.stderr.write(
46
+ 'next: run `yc init --federation-id <id>` once, then re-run `ai-rules mcp refresh yandex`.\n',
47
+ );
48
+ return 1;
49
+ }
50
+
51
+ if (error instanceof ReloginError) {
52
+ process.stderr.write(
53
+ 'Yandex SSO session expired — re-login required. Complete the login in the browser window yc opened, then reconnect the MCP server.\n',
54
+ );
55
+ return 2;
56
+ }
57
+
58
+ process.stderr.write(`${error instanceof Error ? (error.stack ?? error.message) : String(error)}\n`);
59
+ return 1;
60
+ }
61
+ }
62
+
63
+ main().then((code) => {
64
+ process.exitCode = code;
65
+ });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bonesofspring/ai-rules",
3
- "version": "0.2.51",
3
+ "version": "0.2.53",
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",
@@ -25,6 +25,7 @@
25
25
  "CHANGELOG.md",
26
26
  "LICENSE",
27
27
  "bin",
28
+ "mcp",
28
29
  "docs",
29
30
  "presets",
30
31
  "scripts/check-product-specs.sh",
@@ -40,6 +41,10 @@
40
41
  "check:step-graph-contract": "bash scripts/check-step-graph-contract.sh",
41
42
  "test:parallel-plan-fixtures": "node scripts/test-parallel-plan-fixtures.mjs",
42
43
  "check:claude-agent-blocks": "node scripts/check-claude-agent-blocks.mjs",
44
+ "check:claude-agent-parity": "node scripts/check-claude-agent-parity.mjs",
45
+ "test:claude-agent-parity": "node scripts/test-claude-agent-parity.mjs",
46
+ "check:consumer-links": "node scripts/check-consumer-links.mjs",
47
+ "test:consumer-links": "node scripts/test-consumer-links.mjs",
43
48
  "check:preset-twin-map": "bash scripts/check-preset-twin-map.sh",
44
49
  "check:preset-twin-drift": "node scripts/check-preset-twin-drift.mjs",
45
50
  "test:twin-drift-fixtures": "node scripts/test-preset-twin-drift.mjs",
@@ -69,8 +74,20 @@
69
74
  "test:cli-mcp-merge": "node scripts/test-cli-mcp-merge.mjs",
70
75
  "test:cli-init-clean": "node scripts/test-cli-init-clean.mjs",
71
76
  "test:cli-update": "node scripts/test-cli-update.mjs",
77
+ "test:cli-mcp-registration": "node scripts/test-cli-mcp-registration.mjs",
78
+ "test:mcp-pack-tarball": "node scripts/test-mcp-pack-tarball.mjs",
72
79
  "test:chain-coverage": "node scripts/test-chain-team-phases-coverage.mjs",
73
80
  "test:agent-task-metrics-hooks": "node scripts/test-agent-task-metrics-hooks.mjs",
81
+ "test:team-db:schema": "node scripts/test-team-db-schema.mjs",
82
+ "test:team-db:project": "node scripts/test-team-db-project.mjs",
83
+ "test:team-db:dualwrite": "node scripts/test-team-db-dualwrite.mjs",
84
+ "test:team-db:api": "node scripts/test-team-db-api.mjs",
85
+ "test:team-db:security": "node scripts/test-team-db-security.mjs",
86
+ "test:team-db:dashboard": "node scripts/test-team-db-dashboard.mjs",
87
+ "test:team-db:concurrency": "node scripts/test-team-db-concurrency.mjs",
88
+ "test:team-db:fixtures": "node scripts/test-team-db-fixtures.mjs",
89
+ "test:team-db": "node scripts/test-team-db-schema.mjs && node scripts/test-team-db-project.mjs && node scripts/test-team-db-dualwrite.mjs && node scripts/check-team-db-contract.mjs && node scripts/test-team-db-api.mjs && node scripts/test-team-db-security.mjs && node scripts/test-team-db-dashboard.mjs && node scripts/test-team-db-concurrency.mjs && node scripts/test-team-db-fixtures.mjs",
90
+ "check:team-db-contract": "node scripts/check-team-db-contract.mjs",
74
91
  "check:mavis-platform-contract": "node scripts/check-mavis-platform-contract.mjs --self-test",
75
92
  "check:mavis-adapter-map": "node scripts/check-mavis-adapter-map.mjs --self-test",
76
93
  "check:mavis-token-budget": "node scripts/check-mavis-token-budget.mjs",
@@ -19,12 +19,16 @@
19
19
 
20
20
  import fs from 'node:fs';
21
21
  import path from 'node:path';
22
+ import { spawnSync } from 'node:child_process';
23
+ import { createRequire } from 'node:module';
22
24
  import { fileURLToPath } from 'node:url';
23
25
 
24
26
  import { acquireLock, releaseLock } from './lock.mjs';
25
27
 
26
28
  export const MANIFEST_FILE = 'artifact-manifest.json';
27
29
  export const DEFAULT_TEAM_ROOT = path.join(process.cwd(), '.ai.local', 'team');
30
+ const TEAM_DB_MIN_NODE = '22.13.0';
31
+ const TEAM_DB_UNAVAILABLE_LINE = `team-db: node:sqlite unavailable (requires Node >= ${TEAM_DB_MIN_NODE}); file-only mode`;
28
32
 
29
33
  const ARTIFACT_STATUSES = ['planned', 'in_progress', 'completed', 'blocked', 'superseded'];
30
34
  const TERMINAL_STATUSES = new Set(['completed', 'blocked', 'superseded']);
@@ -173,8 +177,17 @@ export function readManifest(slug, teamRoot = DEFAULT_TEAM_ROOT) {
173
177
  /** Atomic whole-file write: temp file in the same directory, then rename. */
174
178
  export function writeManifestSync(filePath, manifest) {
175
179
  fs.mkdirSync(path.dirname(filePath), { recursive: true });
176
- const temporary = `${filePath}.${process.pid}.tmp`;
177
- fs.writeFileSync(temporary, `${JSON.stringify(manifest, null, 2)}\n`, 'utf8');
180
+ const temporary = `${filePath}.${process.pid}.${Date.now()}.tmp`;
181
+ const fd = fs.openSync(temporary, 'w');
182
+ try {
183
+ fs.writeSync(fd, `${JSON.stringify(manifest, null, 2)}\n`);
184
+ try { fs.fsyncSync(fd); } catch { /* a platform without fsync still renames the complete write */ }
185
+ } finally {
186
+ try { fs.closeSync(fd); } catch (error) {
187
+ try { fs.unlinkSync(temporary); } catch { /* the close error is the one to surface */ }
188
+ throw error;
189
+ }
190
+ }
178
191
  fs.renameSync(temporary, filePath);
179
192
  }
180
193
 
@@ -223,6 +236,98 @@ export function upsertManifestEntry({ slug, entry, teamRoot = DEFAULT_TEAM_ROOT
223
236
  return { filePath, entry: merged };
224
237
  }
225
238
 
239
+ /* ------------------------- post-receipt projection seam ------------------------- */
240
+
241
+ /**
242
+ * The projection seam. Mirrors the `TEAM_DB_PROJECTION` block in
243
+ * `chain-team-phases.sh.tmpl`; the duplication is deliberate — the hook block
244
+ * runs inside a shell heredoc and cannot import, and this module must not import
245
+ * a `team-db` module so an install without them still works.
246
+ *
247
+ * Runs only after the manifest is durable and the receipt line is printed. It
248
+ * never throws, never changes the exit code, and never writes a task file.
249
+ */
250
+ const TEAM_DB_TRUTHY = (value) => {
251
+ if (typeof value !== 'string') return false;
252
+ const normalized = value.trim().toLowerCase();
253
+ return normalized === '1' || normalized === 'true' || normalized === 'yes';
254
+ };
255
+
256
+ const TEAM_DB_LOG_PHASE = (env) => {
257
+ const value = typeof env.AI_RULES_TEAM_DB_SEAM === 'string' ? env.AI_RULES_TEAM_DB_SEAM.trim() : '';
258
+ return value === 'hook' || value === 'receipt' || value === 'cli' || value === 'serve' ? value : 'receipt';
259
+ };
260
+
261
+ const teamDbLogPath = (env) => {
262
+ const override = typeof env.AI_RULES_TEAM_DB_LOG === 'string' ? env.AI_RULES_TEAM_DB_LOG.trim() : '';
263
+ if (override) return path.resolve(override);
264
+ return path.join(process.cwd(), '.ai.local', 'team', 'team-db-errors.log');
265
+ };
266
+
267
+ /** One line per failure; newest 200 lines and at most 64 KiB, no prompt body. */
268
+ const logProjectionFailure = (env, code, message) => {
269
+ try {
270
+ const target = teamDbLogPath(env);
271
+ fs.mkdirSync(path.dirname(target), { recursive: true });
272
+ fs.appendFileSync(target, `${new Date().toISOString()} ${code} ${TEAM_DB_LOG_PHASE(env)} ${message}\n`);
273
+ let lines = fs.readFileSync(target, 'utf8').split('\n').filter((entry) => entry.length > 0);
274
+ if (lines.length > 200) lines = lines.slice(lines.length - 200);
275
+ while (Buffer.byteLength(`${lines.join('\n')}\n`, 'utf8') > 65536 && lines.length > 1) lines.shift();
276
+ fs.writeFileSync(target, lines.length > 0 ? `${lines.join('\n')}\n` : '');
277
+ } catch {
278
+ /* a log failure is not a receipt failure */
279
+ }
280
+ };
281
+
282
+ let sqliteProbe = null;
283
+ const teamDbSqliteAvailable = (env) => {
284
+ if (TEAM_DB_TRUTHY(env.AI_RULES_TEAM_DB_FORCE_FALLBACK)) return false;
285
+ const match = /^(\d+)\.(\d+)\.(\d+)/.exec(String(process.versions.node || ''));
286
+ if (!match) return false;
287
+ const major = Number(match[1]);
288
+ const minor = Number(match[2]);
289
+ if (major < 22) return false;
290
+ if (major === 22 && minor < 13) return false;
291
+ if (sqliteProbe !== null) return sqliteProbe;
292
+ try {
293
+ const sqlite = createRequire(import.meta.url)('node:sqlite');
294
+ sqliteProbe = typeof sqlite.DatabaseSync === 'function';
295
+ } catch {
296
+ sqliteProbe = false;
297
+ }
298
+ return sqliteProbe;
299
+ };
300
+
301
+ export function projectAfterReceipt({ slug, teamRoot = DEFAULT_TEAM_ROOT, env = process.env }) {
302
+ try {
303
+ if (TEAM_DB_TRUTHY(env.AI_RULES_TEAM_DB_DISABLE)) return;
304
+ const script = path.join(process.cwd(), '.ai.local', 'scripts', 'team-db.mjs');
305
+ if (!fs.existsSync(script)) return;
306
+ if (!teamDbSqliteAvailable(env)) {
307
+ process.stderr.write(`${TEAM_DB_UNAVAILABLE_LINE}\n`);
308
+ return;
309
+ }
310
+ const result = spawnSync(
311
+ process.execPath,
312
+ ['.ai.local/scripts/team-db.mjs', 'sync', '--slug', slug, '--quiet', '--no-rebuild', '--deadline-ms', '4500', '--root', teamRoot],
313
+ { cwd: process.cwd(), env, encoding: 'utf8', timeout: 5000, killSignal: 'SIGKILL', stdio: ['ignore', 'pipe', 'pipe'] },
314
+ );
315
+ if (result.error && result.error.code === 'ETIMEDOUT') {
316
+ logProjectionFailure(env, 'E_PROJECTION_TIMEOUT', 'projection exceeded 5000 ms and was killed');
317
+ return;
318
+ }
319
+ if (result.error) {
320
+ logProjectionFailure(env, 'E_PROJECTION_FAILED', `projection could not start: ${String(result.error.code || 'unknown')}`);
321
+ return;
322
+ }
323
+ if (typeof result.status === 'number' && result.status !== 0) {
324
+ logProjectionFailure(env, 'E_PROJECTION_FAILED', `projection exited ${result.status}`);
325
+ }
326
+ } catch {
327
+ /* the seam never fails a receipt */
328
+ }
329
+ }
330
+
226
331
  const buildEntry = (flags, slug) => {
227
332
  const id = flags.id;
228
333
  const producer = flags.producer;
@@ -288,8 +393,9 @@ export function validateManifest(manifest, slug) {
288
393
  // A receipt outcome was written into `status`. Name the repair command:
289
394
  // the writer cannot fix a foreign entry, so the owner must.
290
395
  const expected = OUTCOME_STATUS[entry.status];
396
+ const producer = typeof entry.producer === 'string' && entry.producer !== '' ? entry.producer : '<missing>';
291
397
  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>"`,
398
+ `${at}.status "${entry.status}" is a receipt outcome, not an artifact status. Rewrite the entry: "manifest.mjs upsert --slug ${slug} --id ${entry.id} --producer ${producer} --status ${expected} --outcome ${entry.status} --paths <path>"`,
293
399
  );
294
400
  } else {
295
401
  problems.push(`${at}.status must be one of ${ARTIFACT_STATUSES.join(' | ')}`);
@@ -400,6 +506,9 @@ export function runCli(argv) {
400
506
  `${result.filePath}: ${result.entry.id} → ${result.entry.status}` +
401
507
  `${result.entry.receipt ? ` (${result.entry.receipt.outcome})` : ''}\n`,
402
508
  );
509
+ // AC-3.5: a completed receipt has its row when the caller sees success, so
510
+ // the child is bounded-synchronous and starts only after the durable write.
511
+ projectAfterReceipt({ slug, teamRoot });
403
512
  return 0;
404
513
  }
405
514