takt 0.40.0 → 0.42.0

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 (457) hide show
  1. package/README.md +58 -28
  2. package/builtins/en/config.yaml +2 -0
  3. package/builtins/en/facets/instructions/_system/fallback-notice.md +16 -0
  4. package/builtins/en/facets/instructions/ai-antipattern-fix.md +2 -14
  5. package/builtins/en/facets/instructions/ai-antipattern-review.md +5 -11
  6. package/builtins/en/facets/instructions/implement-after-tests.md +6 -7
  7. package/builtins/en/facets/instructions/implement.md +6 -7
  8. package/builtins/en/facets/instructions/review-arch.md +4 -36
  9. package/builtins/en/facets/instructions/review-cqrs-es.md +7 -23
  10. package/builtins/en/facets/instructions/review-frontend.md +6 -32
  11. package/builtins/en/facets/instructions/review-qa.md +5 -31
  12. package/builtins/en/facets/instructions/review-requirements.md +6 -24
  13. package/builtins/en/facets/instructions/review-security.md +13 -36
  14. package/builtins/en/facets/instructions/review-terraform.md +4 -28
  15. package/builtins/en/facets/instructions/review-test.md +8 -29
  16. package/builtins/en/facets/instructions/supervise.md +17 -35
  17. package/builtins/en/facets/instructions/write-tests-first.md +5 -0
  18. package/builtins/en/facets/knowledge/architecture.md +13 -13
  19. package/builtins/en/facets/knowledge/cqrs-es.md +66 -0
  20. package/builtins/en/facets/knowledge/frontend.md +17 -2
  21. package/builtins/en/facets/knowledge/react.md +3 -0
  22. package/builtins/en/facets/output-contracts/frontend-review.md +1 -0
  23. package/builtins/en/facets/policies/ai-antipattern.md +19 -0
  24. package/builtins/en/facets/policies/coding.md +85 -3
  25. package/builtins/en/facets/policies/qa.md +3 -1
  26. package/builtins/en/facets/policies/review.md +35 -3
  27. package/builtins/en/facets/policies/testing.md +33 -0
  28. package/builtins/en/workflows/auto-improvement-loop.yaml +40 -10
  29. package/builtins/ja/INSTRUCTION_STYLE_GUIDE.md +38 -3
  30. package/builtins/ja/config.yaml +2 -0
  31. package/builtins/ja/facets/instructions/_system/fallback-notice.md +16 -0
  32. package/builtins/ja/facets/instructions/ai-antipattern-fix.md +4 -16
  33. package/builtins/ja/facets/instructions/ai-antipattern-review.md +7 -13
  34. package/builtins/ja/facets/instructions/implement-after-tests.md +6 -7
  35. package/builtins/ja/facets/instructions/implement.md +6 -7
  36. package/builtins/ja/facets/instructions/review-arch.md +5 -37
  37. package/builtins/ja/facets/instructions/review-cqrs-es.md +7 -23
  38. package/builtins/ja/facets/instructions/review-frontend.md +6 -32
  39. package/builtins/ja/facets/instructions/review-qa.md +5 -31
  40. package/builtins/ja/facets/instructions/review-requirements.md +10 -28
  41. package/builtins/ja/facets/instructions/review-security.md +13 -36
  42. package/builtins/ja/facets/instructions/review-terraform.md +5 -29
  43. package/builtins/ja/facets/instructions/review-test.md +8 -29
  44. package/builtins/ja/facets/instructions/supervise.md +15 -33
  45. package/builtins/ja/facets/instructions/write-tests-first.md +5 -0
  46. package/builtins/ja/facets/knowledge/architecture.md +13 -13
  47. package/builtins/ja/facets/knowledge/cqrs-es.md +66 -0
  48. package/builtins/ja/facets/knowledge/frontend.md +17 -2
  49. package/builtins/ja/facets/knowledge/react.md +3 -0
  50. package/builtins/ja/facets/output-contracts/frontend-review.md +1 -0
  51. package/builtins/ja/facets/policies/ai-antipattern.md +19 -0
  52. package/builtins/ja/facets/policies/coding.md +85 -3
  53. package/builtins/ja/facets/policies/qa.md +3 -1
  54. package/builtins/ja/facets/policies/review.md +35 -3
  55. package/builtins/ja/facets/policies/testing.md +33 -0
  56. package/builtins/ja/workflows/auto-improvement-loop.yaml +40 -10
  57. package/builtins/schemas/followup-task.json +65 -10
  58. package/dist/agents/decompose-task-usecase.d.ts.map +1 -1
  59. package/dist/agents/decompose-task-usecase.js +3 -2
  60. package/dist/agents/decompose-task-usecase.js.map +1 -1
  61. package/dist/agents/judge-status-usecase.d.ts.map +1 -1
  62. package/dist/agents/judge-status-usecase.js +4 -3
  63. package/dist/agents/judge-status-usecase.js.map +1 -1
  64. package/dist/agents/provider-call-options.d.ts +4 -0
  65. package/dist/agents/provider-call-options.d.ts.map +1 -0
  66. package/dist/agents/provider-call-options.js +9 -0
  67. package/dist/agents/provider-call-options.js.map +1 -0
  68. package/dist/agents/runner.js +1 -1
  69. package/dist/agents/runner.js.map +1 -1
  70. package/dist/agents/structured-caller/prompt-based-structured-caller.d.ts +1 -0
  71. package/dist/agents/structured-caller/prompt-based-structured-caller.d.ts.map +1 -1
  72. package/dist/agents/structured-caller/prompt-based-structured-caller.js +67 -38
  73. package/dist/agents/structured-caller/prompt-based-structured-caller.js.map +1 -1
  74. package/dist/app/cli/program.js +1 -1
  75. package/dist/app/cli/program.js.map +1 -1
  76. package/dist/core/models/assistant-config.d.ts +4 -0
  77. package/dist/core/models/assistant-config.d.ts.map +1 -0
  78. package/dist/core/models/assistant-config.js +4 -0
  79. package/dist/core/models/assistant-config.js.map +1 -0
  80. package/dist/core/models/config-schemas.d.ts +120 -0
  81. package/dist/core/models/config-schemas.d.ts.map +1 -1
  82. package/dist/core/models/config-schemas.js +9 -2
  83. package/dist/core/models/config-schemas.js.map +1 -1
  84. package/dist/core/models/config-types.d.ts +23 -2
  85. package/dist/core/models/config-types.d.ts.map +1 -1
  86. package/dist/core/models/index.d.ts +1 -1
  87. package/dist/core/models/index.d.ts.map +1 -1
  88. package/dist/core/models/index.js.map +1 -1
  89. package/dist/core/models/part.d.ts +5 -0
  90. package/dist/core/models/part.d.ts.map +1 -1
  91. package/dist/core/models/provider-profiles.d.ts +1 -1
  92. package/dist/core/models/provider-profiles.d.ts.map +1 -1
  93. package/dist/core/models/response.d.ts +9 -0
  94. package/dist/core/models/response.d.ts.map +1 -1
  95. package/dist/core/models/response.js +1 -1
  96. package/dist/core/models/response.js.map +1 -1
  97. package/dist/core/models/schema-base.d.ts +85 -0
  98. package/dist/core/models/schema-base.d.ts.map +1 -1
  99. package/dist/core/models/schema-base.js +40 -2
  100. package/dist/core/models/schema-base.js.map +1 -1
  101. package/dist/core/models/status.d.ts +1 -1
  102. package/dist/core/models/status.d.ts.map +1 -1
  103. package/dist/core/models/status.js +1 -1
  104. package/dist/core/models/status.js.map +1 -1
  105. package/dist/core/models/types.d.ts +3 -3
  106. package/dist/core/models/types.d.ts.map +1 -1
  107. package/dist/core/models/workflow-condition-expression.d.ts +12 -0
  108. package/dist/core/models/workflow-condition-expression.d.ts.map +1 -0
  109. package/dist/core/models/workflow-condition-expression.js +26 -0
  110. package/dist/core/models/workflow-condition-expression.js.map +1 -0
  111. package/dist/core/models/workflow-provider-options.d.ts +8 -0
  112. package/dist/core/models/workflow-provider-options.d.ts.map +1 -1
  113. package/dist/core/models/workflow-provider-options.js.map +1 -1
  114. package/dist/core/models/workflow-schemas.d.ts +592 -30
  115. package/dist/core/models/workflow-schemas.d.ts.map +1 -1
  116. package/dist/core/models/workflow-schemas.js +59 -5
  117. package/dist/core/models/workflow-schemas.js.map +1 -1
  118. package/dist/core/models/workflow-system-input-types.d.ts +9 -1
  119. package/dist/core/models/workflow-system-input-types.d.ts.map +1 -1
  120. package/dist/core/models/workflow-system-schemas.d.ts +8 -1
  121. package/dist/core/models/workflow-system-schemas.d.ts.map +1 -1
  122. package/dist/core/models/workflow-system-schemas.js +13 -1
  123. package/dist/core/models/workflow-system-schemas.js.map +1 -1
  124. package/dist/core/models/workflow-types.d.ts +35 -2
  125. package/dist/core/models/workflow-types.d.ts.map +1 -1
  126. package/dist/core/models/workflow-types.js.map +1 -1
  127. package/dist/core/workflow/arpeggio/types.d.ts +3 -0
  128. package/dist/core/workflow/arpeggio/types.d.ts.map +1 -1
  129. package/dist/core/workflow/engine/ArpeggioRunner.d.ts +3 -6
  130. package/dist/core/workflow/engine/ArpeggioRunner.d.ts.map +1 -1
  131. package/dist/core/workflow/engine/ArpeggioRunner.js +40 -19
  132. package/dist/core/workflow/engine/ArpeggioRunner.js.map +1 -1
  133. package/dist/core/workflow/engine/OptionsBuilder.d.ts +1 -0
  134. package/dist/core/workflow/engine/OptionsBuilder.d.ts.map +1 -1
  135. package/dist/core/workflow/engine/OptionsBuilder.js +14 -5
  136. package/dist/core/workflow/engine/OptionsBuilder.js.map +1 -1
  137. package/dist/core/workflow/engine/ParallelRunner.d.ts +4 -6
  138. package/dist/core/workflow/engine/ParallelRunner.d.ts.map +1 -1
  139. package/dist/core/workflow/engine/ParallelRunner.js +55 -12
  140. package/dist/core/workflow/engine/ParallelRunner.js.map +1 -1
  141. package/dist/core/workflow/engine/StepExecutor.d.ts +10 -7
  142. package/dist/core/workflow/engine/StepExecutor.d.ts.map +1 -1
  143. package/dist/core/workflow/engine/StepExecutor.js +81 -11
  144. package/dist/core/workflow/engine/StepExecutor.js.map +1 -1
  145. package/dist/core/workflow/engine/TeamLeaderRunner.d.ts +3 -5
  146. package/dist/core/workflow/engine/TeamLeaderRunner.d.ts.map +1 -1
  147. package/dist/core/workflow/engine/TeamLeaderRunner.js +30 -7
  148. package/dist/core/workflow/engine/TeamLeaderRunner.js.map +1 -1
  149. package/dist/core/workflow/engine/WorkflowCallExecutor.d.ts.map +1 -1
  150. package/dist/core/workflow/engine/WorkflowCallExecutor.js +1 -0
  151. package/dist/core/workflow/engine/WorkflowCallExecutor.js.map +1 -1
  152. package/dist/core/workflow/engine/WorkflowCallRunner.d.ts +3 -6
  153. package/dist/core/workflow/engine/WorkflowCallRunner.d.ts.map +1 -1
  154. package/dist/core/workflow/engine/WorkflowCallRunner.js +1 -1
  155. package/dist/core/workflow/engine/WorkflowCallRunner.js.map +1 -1
  156. package/dist/core/workflow/engine/WorkflowEngine.d.ts +1 -0
  157. package/dist/core/workflow/engine/WorkflowEngine.d.ts.map +1 -1
  158. package/dist/core/workflow/engine/WorkflowEngine.js +47 -21
  159. package/dist/core/workflow/engine/WorkflowEngine.js.map +1 -1
  160. package/dist/core/workflow/engine/WorkflowEngineSetup.d.ts +4 -1
  161. package/dist/core/workflow/engine/WorkflowEngineSetup.d.ts.map +1 -1
  162. package/dist/core/workflow/engine/WorkflowEngineSetup.js +1 -0
  163. package/dist/core/workflow/engine/WorkflowEngineSetup.js.map +1 -1
  164. package/dist/core/workflow/engine/WorkflowEngineStepCoordinator.d.ts +9 -27
  165. package/dist/core/workflow/engine/WorkflowEngineStepCoordinator.d.ts.map +1 -1
  166. package/dist/core/workflow/engine/WorkflowEngineStepCoordinator.js +6 -6
  167. package/dist/core/workflow/engine/WorkflowEngineStepCoordinator.js.map +1 -1
  168. package/dist/core/workflow/engine/WorkflowRunLoop.d.ts +6 -6
  169. package/dist/core/workflow/engine/WorkflowRunLoop.d.ts.map +1 -1
  170. package/dist/core/workflow/engine/WorkflowRunLoop.js +171 -9
  171. package/dist/core/workflow/engine/WorkflowRunLoop.js.map +1 -1
  172. package/dist/core/workflow/engine/engine-provider-options.d.ts +1 -1
  173. package/dist/core/workflow/engine/engine-provider-options.d.ts.map +1 -1
  174. package/dist/core/workflow/engine/state-manager.d.ts +1 -0
  175. package/dist/core/workflow/engine/state-manager.d.ts.map +1 -1
  176. package/dist/core/workflow/engine/state-manager.js +11 -0
  177. package/dist/core/workflow/engine/state-manager.js.map +1 -1
  178. package/dist/core/workflow/engine/structured-output-normalizer.d.ts +23 -0
  179. package/dist/core/workflow/engine/structured-output-normalizer.d.ts.map +1 -0
  180. package/dist/core/workflow/engine/structured-output-normalizer.js +13 -0
  181. package/dist/core/workflow/engine/structured-output-normalizer.js.map +1 -0
  182. package/dist/core/workflow/engine/team-leader-part-runner.d.ts +2 -1
  183. package/dist/core/workflow/engine/team-leader-part-runner.d.ts.map +1 -1
  184. package/dist/core/workflow/engine/team-leader-part-runner.js +17 -6
  185. package/dist/core/workflow/engine/team-leader-part-runner.js.map +1 -1
  186. package/dist/core/workflow/instruction/InstructionBuilder.d.ts.map +1 -1
  187. package/dist/core/workflow/instruction/InstructionBuilder.js +7 -0
  188. package/dist/core/workflow/instruction/InstructionBuilder.js.map +1 -1
  189. package/dist/core/workflow/instruction/fallback-notice.d.ts +3 -0
  190. package/dist/core/workflow/instruction/fallback-notice.d.ts.map +1 -0
  191. package/dist/core/workflow/instruction/fallback-notice.js +20 -0
  192. package/dist/core/workflow/instruction/fallback-notice.js.map +1 -0
  193. package/dist/core/workflow/instruction/instruction-context.d.ts +3 -1
  194. package/dist/core/workflow/instruction/instruction-context.d.ts.map +1 -1
  195. package/dist/core/workflow/instruction/instruction-context.js.map +1 -1
  196. package/dist/core/workflow/observability/workflowSpans.d.ts +28 -0
  197. package/dist/core/workflow/observability/workflowSpans.d.ts.map +1 -0
  198. package/dist/core/workflow/observability/workflowSpans.js +107 -0
  199. package/dist/core/workflow/observability/workflowSpans.js.map +1 -0
  200. package/dist/core/workflow/permission-profile-resolution.d.ts.map +1 -1
  201. package/dist/core/workflow/permission-profile-resolution.js +1 -0
  202. package/dist/core/workflow/permission-profile-resolution.js.map +1 -1
  203. package/dist/core/workflow/phase-runner.d.ts +4 -4
  204. package/dist/core/workflow/phase-runner.d.ts.map +1 -1
  205. package/dist/core/workflow/phase-runner.js.map +1 -1
  206. package/dist/core/workflow/promotion/PromotionEvaluator.d.ts +13 -0
  207. package/dist/core/workflow/promotion/PromotionEvaluator.d.ts.map +1 -0
  208. package/dist/core/workflow/promotion/PromotionEvaluator.js +40 -0
  209. package/dist/core/workflow/promotion/PromotionEvaluator.js.map +1 -0
  210. package/dist/core/workflow/promotion/promotion-runtime.d.ts +11 -0
  211. package/dist/core/workflow/promotion/promotion-runtime.d.ts.map +1 -0
  212. package/dist/core/workflow/promotion/promotion-runtime.js +112 -0
  213. package/dist/core/workflow/promotion/promotion-runtime.js.map +1 -0
  214. package/dist/core/workflow/provider-options-trace.d.ts +3 -2
  215. package/dist/core/workflow/provider-options-trace.d.ts.map +1 -1
  216. package/dist/core/workflow/provider-resolution.js +10 -10
  217. package/dist/core/workflow/provider-resolution.js.map +1 -1
  218. package/dist/core/workflow/report-phase-runner.d.ts +5 -1
  219. package/dist/core/workflow/report-phase-runner.d.ts.map +1 -1
  220. package/dist/core/workflow/report-phase-runner.js +24 -5
  221. package/dist/core/workflow/report-phase-runner.js.map +1 -1
  222. package/dist/core/workflow/status-judgment-phase.d.ts.map +1 -1
  223. package/dist/core/workflow/status-judgment-phase.js +7 -3
  224. package/dist/core/workflow/status-judgment-phase.js.map +1 -1
  225. package/dist/core/workflow/system/system-step-effect-runner.d.ts.map +1 -1
  226. package/dist/core/workflow/system/system-step-effect-runner.js +20 -2
  227. package/dist/core/workflow/system/system-step-effect-runner.js.map +1 -1
  228. package/dist/core/workflow/types.d.ts +18 -3
  229. package/dist/core/workflow/types.d.ts.map +1 -1
  230. package/dist/features/interactive/assistantInitFiles.d.ts +2 -0
  231. package/dist/features/interactive/assistantInitFiles.d.ts.map +1 -0
  232. package/dist/features/interactive/assistantInitFiles.js +110 -0
  233. package/dist/features/interactive/assistantInitFiles.js.map +1 -0
  234. package/dist/features/interactive/conversationLoop.d.ts +5 -1
  235. package/dist/features/interactive/conversationLoop.d.ts.map +1 -1
  236. package/dist/features/interactive/conversationLoop.js +23 -3
  237. package/dist/features/interactive/conversationLoop.js.map +1 -1
  238. package/dist/features/interactive/interactive-summary.d.ts +1 -1
  239. package/dist/features/interactive/interactive-summary.d.ts.map +1 -1
  240. package/dist/features/interactive/interactive-summary.js +4 -3
  241. package/dist/features/interactive/interactive-summary.js.map +1 -1
  242. package/dist/features/interactive/interactive.d.ts +5 -3
  243. package/dist/features/interactive/interactive.d.ts.map +1 -1
  244. package/dist/features/interactive/interactive.js +4 -0
  245. package/dist/features/interactive/interactive.js.map +1 -1
  246. package/dist/features/interactive/promptSections.d.ts +2 -0
  247. package/dist/features/interactive/promptSections.d.ts.map +1 -1
  248. package/dist/features/interactive/promptSections.js +7 -1
  249. package/dist/features/interactive/promptSections.js.map +1 -1
  250. package/dist/features/interactive/slashCommandRegistry.d.ts.map +1 -1
  251. package/dist/features/interactive/slashCommandRegistry.js +1 -0
  252. package/dist/features/interactive/slashCommandRegistry.js.map +1 -1
  253. package/dist/features/tasks/add/issueTask.d.ts +1 -14
  254. package/dist/features/tasks/add/issueTask.d.ts.map +1 -1
  255. package/dist/features/tasks/add/issueTask.js +124 -20
  256. package/dist/features/tasks/add/issueTask.js.map +1 -1
  257. package/dist/features/tasks/execute/workflowExecution.d.ts.map +1 -1
  258. package/dist/features/tasks/execute/workflowExecution.js +15 -1
  259. package/dist/features/tasks/execute/workflowExecution.js.map +1 -1
  260. package/dist/features/tasks/execute/workflowExecutionBootstrap.d.ts +5 -1
  261. package/dist/features/tasks/execute/workflowExecutionBootstrap.d.ts.map +1 -1
  262. package/dist/features/tasks/execute/workflowExecutionBootstrap.js +8 -1
  263. package/dist/features/tasks/execute/workflowExecutionBootstrap.js.map +1 -1
  264. package/dist/features/tasks/execute/workflowExecutionEvents.d.ts.map +1 -1
  265. package/dist/features/tasks/execute/workflowExecutionEvents.js +18 -2
  266. package/dist/features/tasks/execute/workflowExecutionEvents.js.map +1 -1
  267. package/dist/infra/claude/client.d.ts.map +1 -1
  268. package/dist/infra/claude/client.js +5 -0
  269. package/dist/infra/claude/client.js.map +1 -1
  270. package/dist/infra/claude/executor.d.ts.map +1 -1
  271. package/dist/infra/claude/executor.js +56 -20
  272. package/dist/infra/claude/executor.js.map +1 -1
  273. package/dist/infra/claude/mcp-config.d.ts +7 -0
  274. package/dist/infra/claude/mcp-config.d.ts.map +1 -0
  275. package/dist/infra/claude/mcp-config.js +30 -0
  276. package/dist/infra/claude/mcp-config.js.map +1 -0
  277. package/dist/infra/claude/types.d.ts +2 -1
  278. package/dist/infra/claude/types.d.ts.map +1 -1
  279. package/dist/infra/claude-headless/client.d.ts.map +1 -1
  280. package/dist/infra/claude-headless/client.js +15 -43
  281. package/dist/infra/claude-headless/client.js.map +1 -1
  282. package/dist/infra/claude-headless/headless-spawn.d.ts +1 -0
  283. package/dist/infra/claude-headless/headless-spawn.d.ts.map +1 -1
  284. package/dist/infra/claude-headless/headless-spawn.js +16 -0
  285. package/dist/infra/claude-headless/headless-spawn.js.map +1 -1
  286. package/dist/infra/claude-headless/result-response.d.ts.map +1 -1
  287. package/dist/infra/claude-headless/result-response.js +34 -0
  288. package/dist/infra/claude-headless/result-response.js.map +1 -1
  289. package/dist/infra/claude-terminal/client.d.ts +4 -0
  290. package/dist/infra/claude-terminal/client.d.ts.map +1 -0
  291. package/dist/infra/claude-terminal/client.js +314 -0
  292. package/dist/infra/claude-terminal/client.js.map +1 -0
  293. package/dist/infra/claude-terminal/command.d.ts +4 -0
  294. package/dist/infra/claude-terminal/command.d.ts.map +1 -0
  295. package/dist/infra/claude-terminal/command.js +50 -0
  296. package/dist/infra/claude-terminal/command.js.map +1 -0
  297. package/dist/infra/claude-terminal/response-normalizer.d.ts +14 -0
  298. package/dist/infra/claude-terminal/response-normalizer.d.ts.map +1 -0
  299. package/dist/infra/claude-terminal/response-normalizer.js +118 -0
  300. package/dist/infra/claude-terminal/response-normalizer.js.map +1 -0
  301. package/dist/infra/claude-terminal/tmux-backend.d.ts +7 -0
  302. package/dist/infra/claude-terminal/tmux-backend.d.ts.map +1 -0
  303. package/dist/infra/claude-terminal/tmux-backend.js +177 -0
  304. package/dist/infra/claude-terminal/tmux-backend.js.map +1 -0
  305. package/dist/infra/claude-terminal/transcript-reader.d.ts +13 -0
  306. package/dist/infra/claude-terminal/transcript-reader.d.ts.map +1 -0
  307. package/dist/infra/claude-terminal/transcript-reader.js +329 -0
  308. package/dist/infra/claude-terminal/transcript-reader.js.map +1 -0
  309. package/dist/infra/claude-terminal/types.d.ts +106 -0
  310. package/dist/infra/claude-terminal/types.d.ts.map +1 -0
  311. package/dist/infra/claude-terminal/types.js +2 -0
  312. package/dist/infra/claude-terminal/types.js.map +1 -0
  313. package/dist/infra/codex/client.d.ts +1 -0
  314. package/dist/infra/codex/client.d.ts.map +1 -1
  315. package/dist/infra/codex/client.js +21 -1
  316. package/dist/infra/codex/client.js.map +1 -1
  317. package/dist/infra/config/configNormalizers.d.ts +20 -2
  318. package/dist/infra/config/configNormalizers.d.ts.map +1 -1
  319. package/dist/infra/config/configNormalizers.js +68 -3
  320. package/dist/infra/config/configNormalizers.js.map +1 -1
  321. package/dist/infra/config/env/global-current-env-specs.d.ts.map +1 -1
  322. package/dist/infra/config/env/global-current-env-specs.js +5 -0
  323. package/dist/infra/config/env/global-current-env-specs.js.map +1 -1
  324. package/dist/infra/config/env/project-current-env-specs.d.ts.map +1 -1
  325. package/dist/infra/config/env/project-current-env-specs.js +5 -0
  326. package/dist/infra/config/env/project-current-env-specs.js.map +1 -1
  327. package/dist/infra/config/global/globalConfigCore.d.ts.map +1 -1
  328. package/dist/infra/config/global/globalConfigCore.js +4 -1
  329. package/dist/infra/config/global/globalConfigCore.js.map +1 -1
  330. package/dist/infra/config/global/globalConfigSerializer.d.ts.map +1 -1
  331. package/dist/infra/config/global/globalConfigSerializer.js +10 -1
  332. package/dist/infra/config/global/globalConfigSerializer.js.map +1 -1
  333. package/dist/infra/config/global/initialization.d.ts +1 -1
  334. package/dist/infra/config/global/initialization.d.ts.map +1 -1
  335. package/dist/infra/config/global/initialization.js +1 -0
  336. package/dist/infra/config/global/initialization.js.map +1 -1
  337. package/dist/infra/config/loaders/workflowParser.d.ts.map +1 -1
  338. package/dist/infra/config/loaders/workflowParser.js +2 -1
  339. package/dist/infra/config/loaders/workflowParser.js.map +1 -1
  340. package/dist/infra/config/loaders/workflowRuleNormalizer.d.ts.map +1 -1
  341. package/dist/infra/config/loaders/workflowRuleNormalizer.js +8 -9
  342. package/dist/infra/config/loaders/workflowRuleNormalizer.js.map +1 -1
  343. package/dist/infra/config/loaders/workflowStepNormalizer.d.ts.map +1 -1
  344. package/dist/infra/config/loaders/workflowStepNormalizer.js +21 -0
  345. package/dist/infra/config/loaders/workflowStepNormalizer.js.map +1 -1
  346. package/dist/infra/config/observabilityConfig.d.ts +13 -0
  347. package/dist/infra/config/observabilityConfig.d.ts.map +1 -0
  348. package/dist/infra/config/observabilityConfig.js +52 -0
  349. package/dist/infra/config/observabilityConfig.js.map +1 -0
  350. package/dist/infra/config/project/projectConfig.d.ts.map +1 -1
  351. package/dist/infra/config/project/projectConfig.js +28 -3
  352. package/dist/infra/config/project/projectConfig.js.map +1 -1
  353. package/dist/infra/config/providerOptions.d.ts +9 -2
  354. package/dist/infra/config/providerOptions.d.ts.map +1 -1
  355. package/dist/infra/config/providerOptions.js +66 -4
  356. package/dist/infra/config/providerOptions.js.map +1 -1
  357. package/dist/infra/config/providerOptionsContract.d.ts +3 -3
  358. package/dist/infra/config/providerOptionsContract.d.ts.map +1 -1
  359. package/dist/infra/config/providerOptionsContract.js +17 -0
  360. package/dist/infra/config/providerOptionsContract.js.map +1 -1
  361. package/dist/infra/config/resolveConfigValue.d.ts.map +1 -1
  362. package/dist/infra/config/resolveConfigValue.js +18 -0
  363. package/dist/infra/config/resolveConfigValue.js.map +1 -1
  364. package/dist/infra/config/resolvedConfig.d.ts +2 -1
  365. package/dist/infra/config/resolvedConfig.d.ts.map +1 -1
  366. package/dist/infra/config/traced/tracedConfigSchema.d.ts.map +1 -1
  367. package/dist/infra/config/traced/tracedConfigSchema.js +16 -0
  368. package/dist/infra/config/traced/tracedConfigSchema.js.map +1 -1
  369. package/dist/infra/git/format.d.ts.map +1 -1
  370. package/dist/infra/git/format.js +75 -8
  371. package/dist/infra/git/format.js.map +1 -1
  372. package/dist/infra/git/index.d.ts +1 -1
  373. package/dist/infra/git/index.d.ts.map +1 -1
  374. package/dist/infra/git/types.d.ts +5 -0
  375. package/dist/infra/git/types.d.ts.map +1 -1
  376. package/dist/infra/github/pr.d.ts.map +1 -1
  377. package/dist/infra/github/pr.js +174 -28
  378. package/dist/infra/github/pr.js.map +1 -1
  379. package/dist/infra/mock/client.d.ts.map +1 -1
  380. package/dist/infra/mock/client.js +2 -0
  381. package/dist/infra/mock/client.js.map +1 -1
  382. package/dist/infra/mock/scenario.d.ts.map +1 -1
  383. package/dist/infra/mock/scenario.js +11 -0
  384. package/dist/infra/mock/scenario.js.map +1 -1
  385. package/dist/infra/mock/types.d.ts +9 -0
  386. package/dist/infra/mock/types.d.ts.map +1 -1
  387. package/dist/infra/observability/otelFoundation.d.ts +6 -0
  388. package/dist/infra/observability/otelFoundation.d.ts.map +1 -0
  389. package/dist/infra/observability/otelFoundation.js +89 -0
  390. package/dist/infra/observability/otelFoundation.js.map +1 -0
  391. package/dist/infra/opencode/client.d.ts +1 -0
  392. package/dist/infra/opencode/client.d.ts.map +1 -1
  393. package/dist/infra/opencode/client.js +41 -15
  394. package/dist/infra/opencode/client.js.map +1 -1
  395. package/dist/infra/opencode/types.d.ts +1 -0
  396. package/dist/infra/opencode/types.d.ts.map +1 -1
  397. package/dist/infra/providers/claude-terminal.d.ts +6 -0
  398. package/dist/infra/providers/claude-terminal.d.ts.map +1 -0
  399. package/dist/infra/providers/claude-terminal.js +70 -0
  400. package/dist/infra/providers/claude-terminal.js.map +1 -0
  401. package/dist/infra/providers/index.d.ts.map +1 -1
  402. package/dist/infra/providers/index.js +2 -0
  403. package/dist/infra/providers/index.js.map +1 -1
  404. package/dist/infra/providers/opencode.d.ts.map +1 -1
  405. package/dist/infra/providers/opencode.js +1 -0
  406. package/dist/infra/providers/opencode.js.map +1 -1
  407. package/dist/infra/providers/provider-capabilities.d.ts +1 -0
  408. package/dist/infra/providers/provider-capabilities.d.ts.map +1 -1
  409. package/dist/infra/providers/provider-capabilities.js +16 -0
  410. package/dist/infra/providers/provider-capabilities.js.map +1 -1
  411. package/dist/infra/rate-limit/detection.d.ts +15 -0
  412. package/dist/infra/rate-limit/detection.d.ts.map +1 -0
  413. package/dist/infra/rate-limit/detection.js +58 -0
  414. package/dist/infra/rate-limit/detection.js.map +1 -0
  415. package/dist/infra/task/clone-base-branch.d.ts +11 -0
  416. package/dist/infra/task/clone-base-branch.d.ts.map +1 -1
  417. package/dist/infra/task/clone-base-branch.js +34 -4
  418. package/dist/infra/task/clone-base-branch.js.map +1 -1
  419. package/dist/infra/task/clone.d.ts +1 -1
  420. package/dist/infra/task/clone.d.ts.map +1 -1
  421. package/dist/infra/task/clone.js +1 -1
  422. package/dist/infra/task/clone.js.map +1 -1
  423. package/dist/infra/task/index.d.ts +1 -1
  424. package/dist/infra/task/index.d.ts.map +1 -1
  425. package/dist/infra/task/index.js +1 -1
  426. package/dist/infra/task/index.js.map +1 -1
  427. package/dist/infra/workflow/structured-output/followup-task-normalizer.d.ts +3 -0
  428. package/dist/infra/workflow/structured-output/followup-task-normalizer.d.ts.map +1 -0
  429. package/dist/infra/workflow/structured-output/followup-task-normalizer.js +206 -0
  430. package/dist/infra/workflow/structured-output/followup-task-normalizer.js.map +1 -0
  431. package/dist/infra/workflow/system/system-enqueue-effect.d.ts +2 -2
  432. package/dist/infra/workflow/system/system-enqueue-effect.d.ts.map +1 -1
  433. package/dist/infra/workflow/system/system-enqueue-effect.js +9 -4
  434. package/dist/infra/workflow/system/system-enqueue-effect.js.map +1 -1
  435. package/dist/shared/constants.d.ts +1 -0
  436. package/dist/shared/constants.d.ts.map +1 -1
  437. package/dist/shared/constants.js +1 -0
  438. package/dist/shared/constants.js.map +1 -1
  439. package/dist/shared/i18n/labels_en.yaml +3 -1
  440. package/dist/shared/i18n/labels_ja.yaml +3 -1
  441. package/dist/shared/prompts/en/perform_phase1_message.md +11 -1
  442. package/dist/shared/prompts/ja/perform_phase1_message.md +11 -1
  443. package/dist/shared/types/provider.d.ts +1 -1
  444. package/dist/shared/types/provider.d.ts.map +1 -1
  445. package/dist/shared/utils/debug.d.ts +2 -0
  446. package/dist/shared/utils/debug.d.ts.map +1 -1
  447. package/dist/shared/utils/debug.js +1 -0
  448. package/dist/shared/utils/debug.js.map +1 -1
  449. package/dist/shared/utils/delay.d.ts +2 -0
  450. package/dist/shared/utils/delay.d.ts.map +1 -0
  451. package/dist/shared/utils/delay.js +4 -0
  452. package/dist/shared/utils/delay.js.map +1 -0
  453. package/dist/shared/utils/index.d.ts +1 -0
  454. package/dist/shared/utils/index.d.ts.map +1 -1
  455. package/dist/shared/utils/index.js +1 -0
  456. package/dist/shared/utils/index.js.map +1 -1
  457. package/package.json +4 -2
@@ -1,32 +1,11 @@
1
- Review the changes from a test quality perspective.
1
+ Focus on reviewing **test quality**.
2
2
 
3
- **Review criteria:**
4
- - Whether all test plan items are covered
5
- - Test quality (Given-When-Then structure, independence, reproducibility)
6
- - Test naming conventions
7
- - Completeness (unnecessary tests, missing cases)
8
- - Appropriateness of mocks and fixtures
9
- - When an external contract exists, whether request body / query / path input locations are verified as defined
10
- - Whether the tests would catch an implementation that incorrectly reuses a response envelope for request parsing
3
+ Procedure:
4
+ 1. Open the Knowledge and Policy Source paths with the Read tool and obtain the full content
5
+ 2. List every `##` section in each of them (do not cherry-pick)
6
+ 3. Match the criteria in each listed section against the diff and detect any issues
11
7
 
8
+ ## Step-Specific Additional Procedure
12
9
 
13
- **Design decisions reference:**
14
- Review {report:coder-decisions.md} to understand the recorded design decisions.
15
- - Do not flag intentionally documented decisions as FP
16
- - However, also evaluate whether the design decisions themselves are sound, and flag any problems
17
-
18
- **Previous finding tracking (required):**
19
- - First, inspect the review result previously produced by this step and its timestamped history in the Report Directory, treating the unversioned file as the latest result and the most recent timestamped file as the previous result
20
- - If "Previous Response" is available, use it only as supporting context; use report history as the source of truth for finding state transitions
21
- - Assign `finding_id` to each finding and classify current status as `new / persists / resolved / reopened`
22
- - If status is `persists`, provide concrete unresolved evidence (file/line)
23
- - Do not drop open findings from the prior report when producing the current report
24
-
25
- ## Judgment Procedure
26
-
27
- 1. First, extract prior open findings from report history and preliminarily classify them as `new / persists / resolved / reopened`
28
- 2. Cross-reference the test plan/test scope reports in the Report Directory with the implemented tests
29
- 3. When citing build, test, or functional verification as evidence, record the verified target, what was checked, and the observed result in the report
30
- 4. For each detected issue, classify as blocking/non-blocking based on Policy's scope determination table and judgment rules
31
- 5. If there is even one blocking issue, judge as REJECT
32
- 6. If an external contract exists and input locations (root body / query / path) are not verified, treat it as a coverage gap by default
10
+ 1. Cross-reference the test plan / test scope reports in the Report Directory with the implemented tests
11
+ 2. If an external contract exists and input locations (root body / query / path) are not verified, treat it as a coverage gap by default
@@ -1,52 +1,34 @@
1
1
  Verify existing evidence for tests, builds, and functional checks, then perform final approval.
2
2
 
3
- **Overall workflow verification:**
4
- 1. Check all reports in the report directory and verify overall workflow consistency
5
- - Does implementation match the plan?
6
- - Were all review step findings properly addressed?
7
- - Was the original task objective achieved?
8
- - Are prior review findings themselves valid against the task spec, plan, and actual code?
9
- 2. Verify the task spec, plan, and decision history as primary sources
10
- - Read `order.md` and extract required behavior and prohibitions
11
- - Read `plan.md` and confirm intended approach and scope
12
- - Read `coder-decisions.md` and confirm why the implementation moved in that direction
13
- - Do not treat prior review conclusions or requirements-review conclusions as authoritative unless they align with all three and the code
14
- 3. Whether each task spec requirement has been achieved
15
- - Extract requirements one by one from the task spec
3
+ Procedure:
4
+ 1. Open the Knowledge and Policy Source paths with the Read tool and obtain the full content
5
+ 2. List every `##` section in each of them (do not cherry-pick)
6
+ 3. Match the criteria in each listed section against the diff, execution evidence, and reports
7
+
8
+ ## Step-Specific Additional Procedure
9
+
10
+ 1. Extract each requirement from the task spec one by one
16
11
  - If a single sentence contains multiple conditions or paths, split it into the smallest independently verifiable units
17
12
  - Example: treat `global/project` as separate requirements
18
13
  - Example: treat `JSON override / leaf override` as separate requirements
19
14
  - Example: split parallel expressions such as `A and B`, `A/B`, `allow/deny`, or `read/write`
20
- - For each requirement, identify the implementing code (file:line)
21
- - Verify the code actually fulfills the requirement (read the file, check existing test/build evidence)
15
+ 2. For each requirement, identify the implementing code (file:line)
16
+ 3. Verify the code actually fulfills the requirement (read the file, check existing test/build evidence)
22
17
  - Do not mark a composite requirement as ✅ based on only one side of the cases
23
- - Evidence must cover the full content of the requirement row
24
- - Do not rely on the plan report's judgment; independently verify each requirement
18
+ - Do not rely on the plan report or requirements-review judgment; independently verify each requirement
25
19
  - If any requirement is unfulfilled, REJECT
26
20
  4. Re-evaluate prior review findings
27
- - Re-check each `new / persists / resolved` finding against the task spec, `plan.md`, `coder-decisions.md`, and actual code
28
21
  - If a finding does not hold in code, classify it as `false_positive`
29
22
  - If a finding holds technically but pushes work beyond the task objective or justified scope, classify it as `overreach`
30
23
  - Do not leave `false_positive` / `overreach` reasoning implicit
31
- 5. Handling tests, builds, and functional checks
32
- - Do not assume this step will rerun commands
33
- - Use only evidence available in this run, such as execution logs, reports, or CI results
34
- - If evidence is missing, mark the item as unverified rather than successful
35
- - If report text conflicts with execution evidence, call out the inconsistency explicitly
36
-
37
- **How to read reports:**
38
- - For reports with the same base name, treat the unversioned file as the latest result and `{report}.{timestamp}` files as history
39
- - When re-evaluating prior findings, compare the unversioned file with the most recent timestamped history file and verify that the meaning of `new / persists / resolved / reopened` is preserved
40
- - Treat summary reports as summaries, not as primary evidence. Prefer reports that record execution results, reviewer reports with concrete verification details, and then actual code
41
- - You may treat `Build Results` / `Test Results` sections in reports that record execution results as primary evidence
42
- - For `architecture-review`, `qa-review`, `testing-review`, `security-review`, and `requirements-review`, prioritize each report's `Verification Evidence` section when checking evidence
24
+
25
+ ## Report Priority (supervise-specific)
26
+
27
+ - Do not treat summary reports as primary evidence. Use execution-result reports, reviewer reports with concrete verification details, and actual code in that order
28
+ - You may treat `Build Results` / `Test Results` sections in execution-result reports as primary evidence
29
+ - For `architecture-review`, `qa-review`, `testing-review`, `security-review`, and `requirements-review`, prioritize each report's `Verification Evidence` section
43
30
  - Treat each `Verification Evidence` item as supporting evidence only when it states the verified target, what was checked, and observed result. If any part is missing, mark that item as `unverified`
44
- - Treat reviewer claims such as "confirmed success" as supporting evidence only when they state the verified target, what was checked, and the observed result
45
31
  - If items of evidence conflict, prioritize them in this order: `execution-result report > reviewer report with concrete verification details > summary report`
46
- - If a later report reclassifies an earlier finding as `resolved`, `false_positive`, or `overreach`, decide whether to accept that reclassification by checking it against the task, plan, and code
47
-
48
- **Report verification:** Read all reports in the Report Directory and
49
- check whether any blocking finding remains unresolved and whether those findings are themselves valid.
50
32
 
51
33
  **Validation output contract:**
52
34
  ```markdown
@@ -24,6 +24,11 @@ Refer only to files within the Report Directory shown in the Workflow Context. D
24
24
  - Include tests that would catch implementations that incorrectly reuse a response envelope when reading requests
25
25
  - Write tests that are expected to pass after implementation is complete (build errors and test failures are expected at this stage)
26
26
 
27
+ **Non-executable asset constraints:**
28
+ - Do not create tests that freeze prose, headings, or structure in explanations, guides, README files, or Markdown documentation
29
+ - For docs-only changes, do not add tests unless an explicit executable contract exists
30
+ - Tests are only needed when assets contain contracts tied to code behavior or machine processing, such as CLI examples, config examples, or generated artifacts
31
+
27
32
  **Test execution:**
28
33
  - Run tests after creating them to check results
29
34
  - Test failures and import errors are expected before implementation (including imports of not-yet-implemented modules)
@@ -374,14 +374,14 @@ Don't overlook compromises made to "just make it work."
374
374
  | Swallowed errors | Empty `catch {}`, `rescue nil` |
375
375
  | Magic numbers | Unexplained `if (status == 3)` |
376
376
 
377
- ## Strict TODO Comment Prohibition
377
+ ## Unfinished Code Detection
378
378
 
379
- "We'll do it later" never gets done. What's not done now is never done.
379
+ Unfinished-code judgment follows the coding policy. In architecture review, check whether TODO/FIXME comments, empty implementations, or stubs are being used as substitutes for required boundaries, authorization, validation, or contract updates.
380
380
 
381
- TODO comments are immediate REJECT.
381
+ TODO/FIXME without an issue number, external blocker, and removal condition is REJECT.
382
382
 
383
383
  ```kotlin
384
- // REJECT - Future-looking TODO
384
+ // REJECT - Authorization check deferred with TODO
385
385
  // TODO: Add authorization check by facility ID
386
386
  fun deleteCustomHoliday(@PathVariable id: String) {
387
387
  deleteCustomHolidayInputPort.execute(input)
@@ -398,12 +398,12 @@ fun deleteCustomHoliday(@PathVariable id: String) {
398
398
  }
399
399
  ```
400
400
 
401
- Only acceptable TODO cases:
401
+ Acceptable TODO/FIXME cases:
402
402
 
403
403
  | Condition | Example | Judgment |
404
404
  |-----------|---------|----------|
405
- | External dependency prevents implementation + Issued | `// TODO(#123): Implement after API key obtained` | Acceptable |
406
- | Technical constraint prevents + Issued | `// TODO(#456): Waiting for library bug fix` | Acceptable |
405
+ | External dependency prevents implementation + issue exists + removal condition documented | `// TODO(#123): Implement after API key obtained` | Acceptable |
406
+ | Technical constraint prevents implementation + issue exists + removal condition documented | `// TODO(#456): Waiting for library bug fix` | Acceptable |
407
407
  | "Future implementation", "add later" | `// TODO: Add validation` | REJECT |
408
408
  | "No time for now" | `// TODO: Refactor` | REJECT |
409
409
 
@@ -429,7 +429,7 @@ When NOT to apply DRY:
429
429
 
430
430
  ## Spec Compliance Verification
431
431
 
432
- Verify that changes comply with the project's documented specifications.
432
+ Contract-change consistency follows the coding policy. In architecture review, check whether changes contradict documented specifications, types, schemas, or config formats.
433
433
 
434
434
  Verification targets:
435
435
 
@@ -460,10 +460,10 @@ REJECT when these patterns are found:
460
460
 
461
461
  ## Call Chain Verification
462
462
 
463
- When new parameters/fields are added, verify not just the changed file but also callers.
463
+ Missing wiring after contract changes follows the coding policy. In architecture review, check whether new parameters or fields actually reach callers, producers, and readers instead of staying local to the changed file.
464
464
 
465
465
  Verification steps:
466
- 1. When finding new optional parameters or interface fields, `Grep` all callers
466
+ 1. When finding new optional parameters or interface fields, search all callers
467
467
  2. Check if all callers pass the new parameter
468
468
  3. If fallback value (`?? default`) exists, verify if fallback is used as intended
469
469
 
@@ -471,7 +471,7 @@ Danger patterns:
471
471
 
472
472
  | Pattern | Problem | Detection |
473
473
  |---------|---------|-----------|
474
- | `options.xxx ?? fallback` where all callers omit `xxx` | Feature implemented but always falls back | grep callers |
474
+ | `options.xxx ?? fallback` where all callers omit `xxx` | Feature implemented but always falls back | Check callers |
475
475
  | Tests set values directly with mocks | Don't go through actual call chain | Check test construction |
476
476
  | `executeXxx()` doesn't receive `options` it uses internally | No route to pass value from above | Check function signature |
477
477
 
@@ -493,12 +493,12 @@ Call chain verification applies not only to "missing wiring" but also to the rev
493
493
 
494
494
  | Pattern | Problem | Detection |
495
495
  |---------|---------|-----------|
496
- | TTY check when all callers require TTY | Unreachable branch remains | grep all callers' preconditions |
496
+ | TTY check when all callers require TTY | Unreachable branch remains | Check all callers' preconditions |
497
497
  | Null guard when callers already check null | Redundant defense | Trace caller constraints |
498
498
  | Runtime type check when TypeScript types constrain | Not trusting type safety | Check TypeScript type constraints |
499
499
 
500
500
  Verification steps:
501
- 1. When finding defensive branches (TTY check, null guard, etc.), grep all callers
501
+ 1. When finding defensive branches (TTY check, null guard, etc.), check all callers
502
502
  2. If all callers already guarantee the condition, guard is unnecessary → REJECT
503
503
  3. If some callers don't guarantee it, keep the guard
504
504
 
@@ -84,6 +84,54 @@ Event Granularity:
84
84
  - Appropriate: `ShippingAddressChanged` → Intent is clear
85
85
  - Too coarse: `OrderModified` → What changed is unclear
86
86
 
87
+ ## Event Evolution
88
+
89
+ Events are persisted contracts. When the current event type changes, old events must still be replayable. Translation of old events belongs in the upcaster / migration layer at the event-store boundary, not in the event type itself or in domain logic.
90
+
91
+ | Criteria | Judgment |
92
+ |----------|----------|
93
+ | Persisted event type or fields changed with no translation path | REJECT |
94
+ | Current event type keeps aliases or compatibility-only properties for old field names | REJECT. Keep history compatibility in upcasters |
95
+ | Aggregate or apply directly interprets old event shapes | REJECT. Convert to current events before replay |
96
+ | Event carries "previous value" only for compatibility | REJECT. Events represent the fact after it happened |
97
+ | Upcaster converts old payloads to the current event meaning | OK |
98
+ | Tests verify old payloads deserialize into current events through the upcaster | OK |
99
+
100
+ Responsibility split for event evolution:
101
+
102
+ | Responsibility | Place |
103
+ |----------------|-------|
104
+ | Current event meaning and fields | Event type |
105
+ | Translation of old payloads | Upcaster / migration layer |
106
+ | State restoration by event replay | Aggregate `apply` |
107
+ | Guarantee that old events can become current events | Upcaster tests |
108
+
109
+ ```kotlin
110
+ // NG - mixing old-field compatibility into the current event type
111
+ data class OrderAssignedEvent(
112
+ val orderId: String,
113
+ @JsonAlias("assigneeId")
114
+ val assigneeIds: List<String>
115
+ )
116
+
117
+ // OK - current event type represents only the current contract
118
+ data class OrderAssignedEvent(
119
+ val orderId: String,
120
+ val assigneeIds: List<String>
121
+ )
122
+ ```
123
+
124
+ ```kotlin
125
+ // OK - convert old payloads to current payloads in the upcaster
126
+ when (eventType) {
127
+ OrderAssignedEvent::class.java.typeName -> {
128
+ event.moveTextFieldToArray("assigneeId", "assigneeIds")
129
+ }
130
+ }
131
+ ```
132
+
133
+ Whether to keep old event classes depends on the framework and operations policy. In general, do not treat old classes as normal domain events; treat old serialized type names and payloads as the upcaster input contract and cover them with tests.
134
+
87
135
  ## Command Handlers
88
136
 
89
137
  | Criteria | Judgment |
@@ -101,6 +149,24 @@ Good Command Handler:
101
149
  4. Save emitted events
102
150
  ```
103
151
 
152
+ ### Aggregate Decision Boundary
153
+
154
+ Aggregates make decisions only from state that can be restored from their event history and facts explicitly carried by commands. They are not the place to interpret, normalize, or authorize boundary-originated inputs.
155
+
156
+ Validation inside an Aggregate should be limited to facts reproducible by event replay. Other validation should be resolved before command dispatch, and the Aggregate should receive already-resolved facts.
157
+
158
+ | Decision target | Place |
159
+ |-----------------|-------|
160
+ | Whether the current state allows the operation | Aggregate |
161
+ | Whether the command requester matches the Aggregate owner | Aggregate |
162
+ | Whether HTTP/API input shape is valid | API layer |
163
+ | Parsing external identifiers such as object keys, URLs, or paths | UseCase layer or boundary-side Policy/Verifier |
164
+ | Whether an external identifier belongs to the current user/tenant | UseCase layer or boundary-side Policy/Verifier |
165
+ | Checking Read Models or other Aggregate state | UseCase layer |
166
+ | Checking that an external resource exists | Application-layer integration with the external service |
167
+
168
+ Example: for an upload-completed command, the Aggregate decides whether the session owner matches the requester and whether the current state can be completed. The storage object key format and whether the key belongs to the current user/tenant are validated in the UseCase layer before sending the command.
169
+
104
170
  ## Projection Design
105
171
 
106
172
  | Criteria | Judgment |
@@ -84,6 +84,7 @@ Third-party UI libraries such as data grids, date pickers, charts, and virtualiz
84
84
  ## State Management
85
85
 
86
86
  Child components do not modify their own state. They bubble events to parent, and parent manipulates state.
87
+ When multiple components read or update the same state, first place that state in their nearest common parent, then pass data and event callbacks down through props.
87
88
 
88
89
  ```tsx
89
90
  // ❌ Child modifies its own state
@@ -110,19 +111,33 @@ Exception (OK for child to have local state):
110
111
  | Criteria | Judgment |
111
112
  |----------|----------|
112
113
  | Unnecessary global state | Consider localizing |
113
- | Same state managed in multiple places | Needs normalization |
114
+ | Same state managed in multiple places | REJECT. Normalize it in the nearest common parent or shared store |
114
115
  | State changes from child to parent (reverse data flow) | REJECT |
115
116
  | API response stored as-is in state | Consider normalization |
116
117
  | Inappropriate useEffect dependencies | REJECT |
117
118
  | Initial load tied to unstable Context/Provider function references | REJECT |
118
119
 
120
+ ### Canonical and Derived State
121
+
122
+ State should hold canonical values such as user input, server data, and temporary UI state. Display values, aggregates, selection states, sorted results, and grouped results that can be computed from canonical state are derived values and must not be kept as independent state.
123
+
124
+ | Criteria | Judgment |
125
+ |----------|----------|
126
+ | A value that can always be computed from one state is kept as another state | REJECT |
127
+ | Multiple state fields have invariants that require constant synchronization | REJECT |
128
+ | Display labels, counts, totals, all-selected flags, sorted results, or grouped results are kept as canonical state | REJECT |
129
+ | API sending, persistence, or diffing depends on derived state instead of canonical state | REJECT |
130
+ | Only canonical state is stored, and display, aggregation, and decisions are derived via selectors, render logic, or useMemo | OK |
131
+ | Derived values required by external contracts are generated from canonical state at send or persistence boundaries | OK |
132
+
119
133
  State Placement Guidelines:
120
134
 
121
135
  | State Nature | Recommended Placement |
122
136
  |--------------|----------------------|
123
137
  | Temporary UI state (modal open/close, etc.) | Local (useState) |
124
138
  | Form input values | Local or form library |
125
- | Shared across multiple components | Context or state management library |
139
+ | Shared across nearby parent/child or sibling components | Nearest common parent, passed through props |
140
+ | Shared across deep hierarchy or multiple screens | Context or state management library |
126
141
  | Server data cache | Data fetching library (TanStack Query, etc.) |
127
142
 
128
143
  ## Initial load and refetch boundaries
@@ -109,12 +109,15 @@ const loadMore = async () => {
109
109
  ## Custom Hook Responsibility
110
110
 
111
111
  A React custom hook should encapsulate state, effects, refs, or event translation. Pure calculations belong in function modules, not in a `use*` hook.
112
+ `useState` inside a custom hook creates a separate state instance for each caller. Calling the same hook from multiple components does not share state.
113
+ When shared state is required, call the hook once in the nearest common parent and pass data through props, or move the state into Context/external store.
112
114
 
113
115
  | Criteria | Judgment |
114
116
  |----------|----------|
115
117
  | A module is named `use*` but does not use React state/effect/ref | Warning |
116
118
  | Pure functions are modeled as a custom hook | Warning |
117
119
  | Stateful UI control lives in a custom hook and pure calculations live in functions | OK |
120
+ | Multiple components call the same stateful hook independently when they need shared state | REJECT |
118
121
  | A hook returns JSX | REJECT |
119
122
 
120
123
  ## Handling exhaustive-deps
@@ -11,6 +11,7 @@
11
11
  |--------|--------|-------|
12
12
  | Component design | ✅ | - |
13
13
  | State management | ✅ | - |
14
+ | Canonical and derived state | ✅ | - |
14
15
  | Performance | ✅ | - |
15
16
  | Accessibility | ✅ | - |
16
17
  | Type safety | ✅ | - |
@@ -153,6 +153,25 @@ Legacy support criteria:
153
153
  - Do not add `.transform()` normalization, `LEGACY_*_MAP` mappings, or `@deprecated` type definitions
154
154
  - Support only new values and keep it simple
155
155
 
156
+ ### Over-Abstracting with Function Objects
157
+
158
+ AI often turns a small number of concrete branches into config arrays, function objects, and generic loops to make the code look "extensible". The problem is not Strategy itself; the problem is hiding differences in data without naming the concept. A Strategy is useful when it names a domain concept and makes the replacement boundary explicit.
159
+
160
+ | Pattern | Example | Verdict |
161
+ |---------|---------|---------|
162
+ | Single-use operation config array | Processing `[{ kind, fields, removedFields }]` in a loop | REJECT |
163
+ | Deletions, side effects, or exception cases are hidden in config objects | Readers must inspect config values to find destructive behavior | REJECT |
164
+ | Function object introduced when each branch is only 1-3 lines | `handlers[type]()` adds indirection only | REJECT |
165
+ | Strategy represents a domain concept and clarifies the implementation boundary | `TaxPolicy`, `PaymentMethod`, `RetryStrategy` | OK |
166
+ | Many branches share the same shape and are expected to grow | Consider a handler map | OK |
167
+
168
+ Verification approach:
169
+ 1. Grep usage sites for added arrays, Maps, Strategies, or function objects
170
+ 2. If used in only one place, check whether explicit branching would be clearer
171
+ 3. Check whether side effects, deleted fields, or compatibility behavior are hidden in config objects
172
+ 4. Prefer `when` / `switch` when branch names sufficiently express domain meaning
173
+ 5. Allow Strategy when naming the concept improves understanding
174
+
156
175
  ## Premature Caching Strategy Introduction
157
176
 
158
177
  AI tends to proactively introduce caching mechanisms to "improve" performance. Do not add caching strategies until explicitly requested.
@@ -14,6 +14,7 @@ Prioritize correctness over speed, and code accuracy over ease of implementation
14
14
  | Boy Scout | Leave touched areas a little better than you found them |
15
15
  | Fail Fast | Detect errors early. Never swallow them |
16
16
  | Project scripts first | Use project-defined scripts for tool execution. Direct invocation is a last resort |
17
+ | State normalization | Do not keep the same fact in multiple states |
17
18
 
18
19
  ## No Fallbacks or Default Arguments
19
20
 
@@ -183,6 +184,41 @@ const handlers = { A: handleA, B: handleB, C: handleC };
183
184
  handlers[type]?.();
184
185
  ```
185
186
 
187
+ ### Do Not Over-Abstract
188
+
189
+ Use abstraction to reduce duplication and real axes of change, and also to name concepts so the code is easier to understand. Turning a few concrete operations into "config objects + function objects + loops" is not abstraction if it only makes domain differences harder to read.
190
+
191
+ | Criteria | Judgment |
192
+ |----------|----------|
193
+ | A small number of branches differs by event type, state, or domain concept | Use explicit `when` / `switch` |
194
+ | The same operation with the same argument shape repeats in 3+ places | Consider abstraction |
195
+ | A config array or function object is used in only one place | REJECT. Prefer explicit branching first |
196
+ | Side effects or removed fields cannot be understood without reading config objects | REJECT |
197
+ | Strategy names a domain concept and makes interchangeable implementations explicit | OK |
198
+ | Branch names read as domain concepts | OK |
199
+
200
+ ```typescript
201
+ // ❌ Over-abstracted - readers must inspect both the config array and loop to see behavior
202
+ const operations = [
203
+ { kind: 'create', normalize: ['owner'], remove: [] },
204
+ { kind: 'revise', normalize: ['owner'], remove: ['legacyOwner'] },
205
+ ]
206
+ for (const operation of operations) {
207
+ applyOperation(record, operation)
208
+ }
209
+
210
+ // ✅ When branch meaning matters, make it explicit
211
+ switch (record.kind) {
212
+ case 'create':
213
+ normalizeOwner(record)
214
+ break
215
+ case 'revise':
216
+ removeLegacyOwner(record)
217
+ normalizeOwner(record)
218
+ break
219
+ }
220
+ ```
221
+
186
222
  ### Keep Abstraction Levels Consistent
187
223
 
188
224
  Within a single function, keep operations at the same granularity. Extract detailed operations into separate functions. Do not mix "what to do" with "how to do it."
@@ -319,11 +355,56 @@ Dependencies and triggers must match the conditions under which the behavior sho
319
355
  | Rerun conditions correspond to URL, filters, explicit refresh actions, or other intended behavior | OK |
320
356
  | Initialization and later refetch triggers are designed separately | OK |
321
357
 
358
+ ## Contract Change Consistency
359
+
360
+ When changing contracts that other code or users depend on — types, interfaces, APIs, config schemas, persistence formats, events, or file formats — keep definitions, producers, consumers, and verification aligned in the same change.
361
+
362
+ | Criteria | Judgment |
363
+ |----------|----------|
364
+ | Only the contract definition is changed, while callers, producers, or readers are not updated | REJECT |
365
+ | A new argument, field, or config value is added but there is no route to pass it to consumers | REJECT |
366
+ | Fields or values not present in the documented schema/config format are used | REJECT |
367
+ | Mocks, fixtures, or test data return shapes that differ from the real contract | REJECT |
368
+ | The contract change and updates to callers, producers, and tests are made in the same change | OK |
369
+
322
370
  ## State Management
323
371
 
324
372
  - Confine state to where it is used
325
373
  - Children do not modify state directly (notify parents via events)
326
374
  - State flow is unidirectional
375
+ - Do not keep derived values that can be computed from canonical state as independent state
376
+ - If multiple fields require constant synchronization, revisit the state model
377
+
378
+ | Criteria | Judgment |
379
+ |----------|----------|
380
+ | A value that can always be computed from one state is kept as another state | REJECT |
381
+ | Multiple states have invariants that must always stay in sync | REJECT |
382
+ | Persistence, sending, or diffing depends on derived values | REJECT |
383
+ | Only canonical state is stored, and derived values are generated at use sites or boundaries | OK |
384
+
385
+ ## Unfinished Code
386
+
387
+ Do not leave TODO/FIXME comments, empty implementations, stubs, or commented-out old implementations as substitutes for completed code. Implement what is needed now and delete what is not needed.
388
+
389
+ | Criteria | Judgment |
390
+ |----------|----------|
391
+ | TODO/FIXME without an issue number, external blocker, and removal condition | REJECT |
392
+ | Authorization, validation, persistence, or error handling is deferred with TODO | REJECT |
393
+ | Empty implementations, `return null`, `pass`, or commented-out old implementations remain | REJECT |
394
+ | An external dependency or known blocker makes implementation impossible now, with issue number and removal condition documented | Acceptable |
395
+ | TODO only for future extension | REJECT |
396
+
397
+ ## Sensitive Information Handling
398
+
399
+ Do not expose passwords, tokens, API keys, session IDs, auth headers, personal information, or other sensitive data in code, logs, error responses, or test output.
400
+
401
+ | Criteria | Judgment |
402
+ |----------|----------|
403
+ | Sensitive data is hardcoded in source code or config files | REJECT |
404
+ | Logs, exceptions, error responses, or test snapshots contain sensitive data | REJECT |
405
+ | Whole requests or DTOs are logged and may include sensitive fields | REJECT |
406
+ | Sensitive fields are explicitly omitted or masked | OK |
407
+ | Debug logs include personal data but are assumed disabled in production | Warning. Verify it cannot leak through misconfiguration |
327
408
 
328
409
  ## Error Handling
329
410
 
@@ -486,10 +567,11 @@ Verification approach:
486
567
  - **Fallbacks are prohibited by default** - Do not write fallbacks using `?? 'unknown'`, `|| 'default'`, or swallowing via `try-catch`. Propagate errors upward. If absolutely necessary, add a comment explaining why
487
568
  - **Explanatory comments** - Express intent through code. Do not write What/How comments
488
569
  - **Unused code** - Do not write "just in case" code
570
+ - **Unfinished code** - Do not leave TODO/FIXME without an issue number, external blocker, and removal condition; do not leave stubs or commented-out old code
489
571
  - **any type** - Do not break type safety
490
572
  - **Direct mutation of objects/arrays** - Create new instances with spread operators
491
573
  - **console.log** - Do not leave in production code
492
- - **Hardcoded secrets**
574
+ - **Sensitive information exposure** - Do not include sensitive data in hardcoded values, logs, error responses, or test output
493
575
  - **Scattered hardcoded contract strings** - File names and config key names must be defined as constants in one place. Scattered literals are prohibited
494
576
  - **Scattered try-catch** - Centralize error handling at the upper layer
495
577
  - **Unsolicited backward compatibility / legacy support** - Not needed unless explicitly instructed
@@ -497,6 +579,6 @@ Verification approach:
497
579
  - **Replaced code surviving after refactoring** - Remove replaced code and exports. Do not keep unless explicitly told to
498
580
  - **Workarounds that bypass safety mechanisms** - If the root fix is correct, no additional bypass is needed
499
581
  - **Direct tool execution bypassing project scripts** - `npx tool` and similar bypass the lockfile, causing version mismatches. Look for project-defined scripts (npm scripts, Makefile, etc.) first. Only consider direct execution when no script exists
500
- - **Missing wiring** - When adding new parameters or fields, grep the entire call chain to verify. If callers do not pass the value, `options.xxx ?? fallback` always uses the fallback
582
+ - **Missing wiring** - When adding new parameters or fields, search the entire call chain to verify. If callers do not pass the value, `options.xxx ?? fallback` always uses the fallback
501
583
  - **Redundant conditionals** - When if/else calls the same function with only argument differences, unify using ternary operators or spread syntax
502
- - **Copy-paste patterns** - Before writing new code, grep for existing implementations of the same kind and follow the existing pattern. Do not introduce your own style
584
+ - **Copy-paste patterns** - Before writing new code, search for existing implementations of the same kind and follow the existing pattern. Do not introduce your own style
@@ -22,7 +22,9 @@
22
22
 
23
23
  | Pattern | Verdict |
24
24
  |---------|---------|
25
- | Abandoned TODO/FIXME | Warning |
25
+ | TODO/FIXME without an issue number, external blocker, and removal condition | REJECT |
26
+ | TODO/FIXME with issue number, external blocker, and removal condition | Warning |
27
+ | Empty implementations, stubs, or commented-out old implementations left behind | REJECT |
26
28
  | @ts-ignore, @ts-expect-error without reason | Warning |
27
29
  | eslint-disable without reason | Warning |
28
30
  | Usage of deprecated APIs | Warning |
@@ -37,13 +37,15 @@ REJECT without exception if any of the following apply.
37
37
  - Unused code ("just in case" code)
38
38
  - Direct mutation of objects/arrays
39
39
  - Swallowed errors (empty catch blocks)
40
- - TODO comments (not tracked in an issue)
40
+ - TODO/FIXME without an issue number, external blocker, and removal condition
41
41
  - Essentially identical logic duplicated (DRY violation)
42
42
  - Method proliferation doing the same thing (should be absorbed by configuration differences)
43
43
  - Specific implementation leaking into generic layers (imports and branching for specific implementations in generic layers)
44
44
  - Internal implementation exported from public API (infrastructure functions or internal classes exposed publicly)
45
45
  - Replaced code/exports surviving after refactoring
46
46
  - Missing cross-validation of related fields (invariants of semantically coupled config values left unverified)
47
+ - Missing caller, producer, or test data updates after a contract change
48
+ - Sensitive data exposed in logs, error responses, or test output
47
49
 
48
50
  A DRY finding is not complete unless the proposed consolidation target is also sound. A consolidation proposal is invalid unless all of the following hold.
49
51
 
@@ -59,7 +61,7 @@ Not blocking, but improvement is recommended.
59
61
  - Tests coupled to implementation details
60
62
  - Overly complex functions/files
61
63
  - Unclear naming
62
- - Abandoned TODO/FIXME (those with issue numbers are acceptable)
64
+ - TODO/FIXME with issue number, external blocker, and removal condition
63
65
  - `@ts-ignore` or `eslint-disable` without justification
64
66
 
65
67
  ### APPROVE
@@ -73,7 +75,7 @@ Always verify facts before raising an issue.
73
75
  | Do | Do Not |
74
76
  |----|--------|
75
77
  | Open the file and check actual code | Assume "it should be fixed already" |
76
- | Search for call sites and usages with grep | Raise issues based on memory |
78
+ | Search for call sites and usages | Raise issues based on memory |
77
79
  | Cross-reference type definitions and schemas | Guess that code is dead |
78
80
  | Distinguish generated files (reports, etc.) from source | Review generated files as if they were source code |
79
81
  | Verify tool output is readable and uncorrupted | Raise issues based on garbled or abnormal output |
@@ -203,6 +205,36 @@ Do not tolerate problems just because existing code does the same. If existing c
203
205
  - "The code itself existed before" is not a valid reason for non-blocking. As long as it is in a changed file, the Boy Scout rule applies
204
206
  - If even one issue exists, REJECT. "APPROVE with warnings" or "APPROVE with suggestions" is prohibited
205
207
 
208
+ ## Basic Review Procedure
209
+
210
+ Common procedure that every reviewer must follow. Do not duplicate this in individual instructions.
211
+
212
+ ### Referring to Primary Sources
213
+
214
+ - Use `order.md`, `plan.md`, and the actual code as primary sources
215
+ - Treat decisions from earlier steps (prior review results, planning decisions) as supplementary
216
+ - When information conflicts, prioritize `order.md` / `plan.md` / actual code
217
+
218
+ ### Referring to Design Decisions
219
+
220
+ - If the implementation step has emitted `coder-decisions.md`, read it and understand the recorded design decisions
221
+ - Do not dismiss intentional decisions as false positives just because they were recorded. Evaluate validity against `order.md` / `plan.md` / actual code
222
+ - If the design decision itself is flawed, raise it
223
+
224
+ ### Tracking Findings from Previous Reviews
225
+
226
+ - Look in the Report Directory for review reports this step has previously produced, along with their timestamped history
227
+ - Treat the unsuffixed file as the latest result and the most recent `{report-name}.{timestamp}` as the previous result
228
+ - `Previous Response` may be used as supplementary information, but finding state determinations must prioritize the report history
229
+ - Do not drop open findings from the previous report when producing the new report
230
+ - Apply the `finding_id` management rules when classifying each finding as `new` / `persists` / `resolved` / `reopened`
231
+
232
+ ### Final Decision Steps
233
+
234
+ 1. Classify each detected issue as blocking / non-blocking according to the scope rules and decision rules above
235
+ 2. When citing test, build, or behavior verification as evidence, record the target, the check, and the result in the report
236
+ 3. REJECT if there is at least one blocking issue (`new`, `persists`, or `reopened`)
237
+
206
238
  ## Detecting Circular Arguments
207
239
 
208
240
  When the same kind of issue keeps recurring, reconsider the approach itself rather than repeating the same fix instructions.