takt 0.48.0 → 0.49.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 (340) hide show
  1. package/README.md +13 -0
  2. package/builtins/en/facets/instructions/exec-loop-monitor.md +15 -0
  3. package/builtins/en/facets/instructions/exec-replan.md +5 -0
  4. package/builtins/en/facets/instructions/exec-review.md +10 -0
  5. package/builtins/en/facets/instructions/exec-worker.md +5 -0
  6. package/builtins/en/facets/knowledge/takt.md +16 -0
  7. package/builtins/en/facets/output-contracts/exec-review-result.md +13 -0
  8. package/builtins/en/facets/personas/exec-assistant.md +3 -0
  9. package/builtins/en/facets/personas/exec-worker.md +3 -0
  10. package/builtins/en/facets/policies/existing-system-respect.md +13 -0
  11. package/builtins/en/facets/policies/review.md +2 -0
  12. package/builtins/en/facets/policies/testing.md +13 -0
  13. package/builtins/en/workflows/draft.yaml +1 -1
  14. package/builtins/en/workflows/peer-review-with-fc.yaml +1 -1
  15. package/builtins/en/workflows/peer-review.yaml +1 -1
  16. package/builtins/exec/presets/backend.yaml +31 -0
  17. package/builtins/exec/presets/dual.yaml +34 -0
  18. package/builtins/exec/presets/frontend.yaml +31 -0
  19. package/builtins/exec/presets/research.yaml +45 -0
  20. package/builtins/ja/facets/instructions/exec-loop-monitor.md +15 -0
  21. package/builtins/ja/facets/instructions/exec-replan.md +5 -0
  22. package/builtins/ja/facets/instructions/exec-review.md +10 -0
  23. package/builtins/ja/facets/instructions/exec-worker.md +5 -0
  24. package/builtins/ja/facets/knowledge/takt.md +16 -0
  25. package/builtins/ja/facets/output-contracts/exec-review-result.md +13 -0
  26. package/builtins/ja/facets/personas/exec-assistant.md +3 -0
  27. package/builtins/ja/facets/personas/exec-worker.md +3 -0
  28. package/builtins/ja/facets/policies/existing-system-respect.md +13 -0
  29. package/builtins/ja/facets/policies/review.md +3 -0
  30. package/builtins/ja/facets/policies/testing.md +13 -0
  31. package/builtins/ja/workflows/draft.yaml +1 -1
  32. package/builtins/ja/workflows/peer-review-with-fc.yaml +1 -1
  33. package/builtins/ja/workflows/peer-review.yaml +1 -1
  34. package/builtins/skill/SKILL.md +1 -1
  35. package/builtins/skill/references/engine.md +1 -15
  36. package/builtins/skill-codex/SKILL.md +1 -1
  37. package/builtins/skill-codex/references/engine.md +0 -2
  38. package/dist/agents/decompose-task-usecase.d.ts +0 -1
  39. package/dist/agents/decompose-task-usecase.d.ts.map +1 -1
  40. package/dist/agents/decompose-task-usecase.js +0 -4
  41. package/dist/agents/decompose-task-usecase.js.map +1 -1
  42. package/dist/agents/runner.d.ts.map +1 -1
  43. package/dist/agents/runner.js +7 -6
  44. package/dist/agents/runner.js.map +1 -1
  45. package/dist/agents/structured-caller/prompt-based-structured-caller.d.ts.map +1 -1
  46. package/dist/agents/structured-caller/prompt-based-structured-caller.js +0 -3
  47. package/dist/agents/structured-caller/prompt-based-structured-caller.js.map +1 -1
  48. package/dist/agents/structured-caller/shared.d.ts.map +1 -1
  49. package/dist/agents/structured-caller/shared.js +2 -9
  50. package/dist/agents/structured-caller/shared.js.map +1 -1
  51. package/dist/app/cli/commands.js +13 -0
  52. package/dist/app/cli/commands.js.map +1 -1
  53. package/dist/core/models/workflow-schemas.d.ts +204 -16
  54. package/dist/core/models/workflow-schemas.d.ts.map +1 -1
  55. package/dist/core/models/workflow-schemas.js +37 -3
  56. package/dist/core/models/workflow-schemas.js.map +1 -1
  57. package/dist/core/models/workflow-types.d.ts +8 -0
  58. package/dist/core/models/workflow-types.d.ts.map +1 -1
  59. package/dist/core/workflow/engine/LoopMonitorJudgeRunner.d.ts +2 -2
  60. package/dist/core/workflow/engine/LoopMonitorJudgeRunner.d.ts.map +1 -1
  61. package/dist/core/workflow/engine/LoopMonitorJudgeRunner.js +8 -7
  62. package/dist/core/workflow/engine/LoopMonitorJudgeRunner.js.map +1 -1
  63. package/dist/core/workflow/engine/OptionsBuilder.d.ts +1 -0
  64. package/dist/core/workflow/engine/OptionsBuilder.d.ts.map +1 -1
  65. package/dist/core/workflow/engine/OptionsBuilder.js +23 -11
  66. package/dist/core/workflow/engine/OptionsBuilder.js.map +1 -1
  67. package/dist/core/workflow/engine/StepExecutor.d.ts.map +1 -1
  68. package/dist/core/workflow/engine/StepExecutor.js +4 -8
  69. package/dist/core/workflow/engine/StepExecutor.js.map +1 -1
  70. package/dist/core/workflow/engine/WorkflowEngineSetup.js +2 -2
  71. package/dist/core/workflow/engine/WorkflowEngineSetup.js.map +1 -1
  72. package/dist/core/workflow/engine/WorkflowRunLoop.d.ts.map +1 -1
  73. package/dist/core/workflow/engine/WorkflowRunLoop.js +31 -0
  74. package/dist/core/workflow/engine/WorkflowRunLoop.js.map +1 -1
  75. package/dist/core/workflow/engine/WorkflowValidator.d.ts.map +1 -1
  76. package/dist/core/workflow/engine/WorkflowValidator.js +17 -7
  77. package/dist/core/workflow/engine/WorkflowValidator.js.map +1 -1
  78. package/dist/core/workflow/engine/engine-provider-options.d.ts +1 -1
  79. package/dist/core/workflow/engine/engine-provider-options.d.ts.map +1 -1
  80. package/dist/core/workflow/engine/engine-provider-options.js +18 -6
  81. package/dist/core/workflow/engine/engine-provider-options.js.map +1 -1
  82. package/dist/core/workflow/findings/manager-runner.d.ts.map +1 -1
  83. package/dist/core/workflow/findings/manager-runner.js +9 -25
  84. package/dist/core/workflow/findings/manager-runner.js.map +1 -1
  85. package/dist/core/workflow/instruction/InstructionBuilder.js +1 -1
  86. package/dist/core/workflow/instruction/InstructionBuilder.js.map +1 -1
  87. package/dist/core/workflow/provider-model-compatibility.d.ts +0 -1
  88. package/dist/core/workflow/provider-model-compatibility.d.ts.map +1 -1
  89. package/dist/core/workflow/provider-model-compatibility.js +2 -2
  90. package/dist/core/workflow/provider-model-compatibility.js.map +1 -1
  91. package/dist/core/workflow/provider-resolution.d.ts +4 -6
  92. package/dist/core/workflow/provider-resolution.d.ts.map +1 -1
  93. package/dist/core/workflow/provider-resolution.js +19 -11
  94. package/dist/core/workflow/provider-resolution.js.map +1 -1
  95. package/dist/core/workflow/session-key.d.ts +4 -1
  96. package/dist/core/workflow/session-key.d.ts.map +1 -1
  97. package/dist/core/workflow/session-key.js +5 -2
  98. package/dist/core/workflow/session-key.js.map +1 -1
  99. package/dist/features/catalog/catalogFacets.d.ts +11 -1
  100. package/dist/features/catalog/catalogFacets.d.ts.map +1 -1
  101. package/dist/features/catalog/catalogFacets.js +36 -10
  102. package/dist/features/catalog/catalogFacets.js.map +1 -1
  103. package/dist/features/exec/assistantSession.d.ts +18 -0
  104. package/dist/features/exec/assistantSession.d.ts.map +1 -0
  105. package/dist/features/exec/assistantSession.js +51 -0
  106. package/dist/features/exec/assistantSession.js.map +1 -0
  107. package/dist/features/exec/command.d.ts +9 -0
  108. package/dist/features/exec/command.d.ts.map +1 -0
  109. package/dist/features/exec/command.js +143 -0
  110. package/dist/features/exec/command.js.map +1 -0
  111. package/dist/features/exec/commandAvailability.d.ts +4 -0
  112. package/dist/features/exec/commandAvailability.d.ts.map +1 -0
  113. package/dist/features/exec/commandAvailability.js +10 -0
  114. package/dist/features/exec/commandAvailability.js.map +1 -0
  115. package/dist/features/exec/configOps.d.ts +13 -0
  116. package/dist/features/exec/configOps.d.ts.map +1 -0
  117. package/dist/features/exec/configOps.js +129 -0
  118. package/dist/features/exec/configOps.js.map +1 -0
  119. package/dist/features/exec/configValidation.d.ts +15 -0
  120. package/dist/features/exec/configValidation.d.ts.map +1 -0
  121. package/dist/features/exec/configValidation.js +150 -0
  122. package/dist/features/exec/configValidation.js.map +1 -0
  123. package/dist/features/exec/defaults.d.ts +3 -0
  124. package/dist/features/exec/defaults.d.ts.map +1 -0
  125. package/dist/features/exec/defaults.js +30 -0
  126. package/dist/features/exec/defaults.js.map +1 -0
  127. package/dist/features/exec/facetEditor.d.ts +5 -0
  128. package/dist/features/exec/facetEditor.d.ts.map +1 -0
  129. package/dist/features/exec/facetEditor.js +293 -0
  130. package/dist/features/exec/facetEditor.js.map +1 -0
  131. package/dist/features/exec/index.d.ts +2 -0
  132. package/dist/features/exec/index.d.ts.map +1 -0
  133. package/dist/features/exec/index.js +2 -0
  134. package/dist/features/exec/index.js.map +1 -0
  135. package/dist/features/exec/labels.d.ts +11 -0
  136. package/dist/features/exec/labels.d.ts.map +1 -0
  137. package/dist/features/exec/labels.js +20 -0
  138. package/dist/features/exec/labels.js.map +1 -0
  139. package/dist/features/exec/presetSelection.d.ts +3 -0
  140. package/dist/features/exec/presetSelection.d.ts.map +1 -0
  141. package/dist/features/exec/presetSelection.js +16 -0
  142. package/dist/features/exec/presetSelection.js.map +1 -0
  143. package/dist/features/exec/presetSetup.d.ts +7 -0
  144. package/dist/features/exec/presetSetup.d.ts.map +1 -0
  145. package/dist/features/exec/presetSetup.js +120 -0
  146. package/dist/features/exec/presetSetup.js.map +1 -0
  147. package/dist/features/exec/presetStore.d.ts +25 -0
  148. package/dist/features/exec/presetStore.d.ts.map +1 -0
  149. package/dist/features/exec/presetStore.js +326 -0
  150. package/dist/features/exec/presetStore.js.map +1 -0
  151. package/dist/features/exec/projectLocalFiles.d.ts +9 -0
  152. package/dist/features/exec/projectLocalFiles.d.ts.map +1 -0
  153. package/dist/features/exec/projectLocalFiles.js +111 -0
  154. package/dist/features/exec/projectLocalFiles.js.map +1 -0
  155. package/dist/features/exec/promptUtils.d.ts +8 -0
  156. package/dist/features/exec/promptUtils.d.ts.map +1 -0
  157. package/dist/features/exec/promptUtils.js +32 -0
  158. package/dist/features/exec/promptUtils.js.map +1 -0
  159. package/dist/features/exec/runtimeConfig.d.ts +13 -0
  160. package/dist/features/exec/runtimeConfig.d.ts.map +1 -0
  161. package/dist/features/exec/runtimeConfig.js +59 -0
  162. package/dist/features/exec/runtimeConfig.js.map +1 -0
  163. package/dist/features/exec/setupMenu.d.ts +5 -0
  164. package/dist/features/exec/setupMenu.d.ts.map +1 -0
  165. package/dist/features/exec/setupMenu.js +431 -0
  166. package/dist/features/exec/setupMenu.js.map +1 -0
  167. package/dist/features/exec/types.d.ts +52 -0
  168. package/dist/features/exec/types.d.ts.map +1 -0
  169. package/dist/features/exec/types.js +2 -0
  170. package/dist/features/exec/types.js.map +1 -0
  171. package/dist/features/exec/workflowRunner.d.ts +9 -0
  172. package/dist/features/exec/workflowRunner.d.ts.map +1 -0
  173. package/dist/features/exec/workflowRunner.js +96 -0
  174. package/dist/features/exec/workflowRunner.js.map +1 -0
  175. package/dist/features/exec/workflowTemplate.d.ts +9 -0
  176. package/dist/features/exec/workflowTemplate.d.ts.map +1 -0
  177. package/dist/features/exec/workflowTemplate.js +159 -0
  178. package/dist/features/exec/workflowTemplate.js.map +1 -0
  179. package/dist/features/interactive/aiCaller.d.ts +3 -0
  180. package/dist/features/interactive/aiCaller.d.ts.map +1 -1
  181. package/dist/features/interactive/aiCaller.js +4 -0
  182. package/dist/features/interactive/aiCaller.js.map +1 -1
  183. package/dist/features/interactive/commandMatcher.d.ts +2 -1
  184. package/dist/features/interactive/commandMatcher.d.ts.map +1 -1
  185. package/dist/features/interactive/commandMatcher.js +13 -2
  186. package/dist/features/interactive/commandMatcher.js.map +1 -1
  187. package/dist/features/interactive/interactive-summary.d.ts.map +1 -1
  188. package/dist/features/interactive/interactive-summary.js +45 -23
  189. package/dist/features/interactive/interactive-summary.js.map +1 -1
  190. package/dist/features/interactive/interactive.js +2 -2
  191. package/dist/features/interactive/interactive.js.map +1 -1
  192. package/dist/features/interactive/promptSections.d.ts.map +1 -1
  193. package/dist/features/interactive/promptSections.js +3 -6
  194. package/dist/features/interactive/promptSections.js.map +1 -1
  195. package/dist/features/interactive/retryMode.d.ts.map +1 -1
  196. package/dist/features/interactive/retryMode.js +3 -3
  197. package/dist/features/interactive/retryMode.js.map +1 -1
  198. package/dist/features/interactive/runSessionReader.d.ts +4 -37
  199. package/dist/features/interactive/runSessionReader.d.ts.map +1 -1
  200. package/dist/features/interactive/runSessionReader.js +130 -49
  201. package/dist/features/interactive/runSessionReader.js.map +1 -1
  202. package/dist/features/interactive/slashCommandRegistry.d.ts +2 -0
  203. package/dist/features/interactive/slashCommandRegistry.d.ts.map +1 -1
  204. package/dist/features/interactive/slashCommandRegistry.js +5 -0
  205. package/dist/features/interactive/slashCommandRegistry.js.map +1 -1
  206. package/dist/features/prompt/preview.d.ts.map +1 -1
  207. package/dist/features/prompt/preview.js +58 -32
  208. package/dist/features/prompt/preview.js.map +1 -1
  209. package/dist/features/tasks/execute/selectAndExecute.d.ts.map +1 -1
  210. package/dist/features/tasks/execute/selectAndExecute.js +6 -2
  211. package/dist/features/tasks/execute/selectAndExecute.js.map +1 -1
  212. package/dist/features/tasks/execute/taskWorkflowExecution.d.ts.map +1 -1
  213. package/dist/features/tasks/execute/taskWorkflowExecution.js +41 -1
  214. package/dist/features/tasks/execute/taskWorkflowExecution.js.map +1 -1
  215. package/dist/features/tasks/execute/types.d.ts +8 -0
  216. package/dist/features/tasks/execute/types.d.ts.map +1 -1
  217. package/dist/features/tasks/execute/workflowExecutionEvents.d.ts.map +1 -1
  218. package/dist/features/tasks/execute/workflowExecutionEvents.js +3 -1
  219. package/dist/features/tasks/execute/workflowExecutionEvents.js.map +1 -1
  220. package/dist/features/tasks/list/instructMode.d.ts.map +1 -1
  221. package/dist/features/tasks/list/instructMode.js +3 -3
  222. package/dist/features/tasks/list/instructMode.js.map +1 -1
  223. package/dist/features/tasks/resume/directInstructMode.d.ts.map +1 -1
  224. package/dist/features/tasks/resume/directInstructMode.js +3 -3
  225. package/dist/features/tasks/resume/directInstructMode.js.map +1 -1
  226. package/dist/infra/config/configNormalizers.d.ts.map +1 -1
  227. package/dist/infra/config/configNormalizers.js +11 -8
  228. package/dist/infra/config/configNormalizers.js.map +1 -1
  229. package/dist/infra/config/loaders/resource-resolver.d.ts +3 -33
  230. package/dist/infra/config/loaders/resource-resolver.d.ts.map +1 -1
  231. package/dist/infra/config/loaders/resource-resolver.js +119 -46
  232. package/dist/infra/config/loaders/resource-resolver.js.map +1 -1
  233. package/dist/infra/config/loaders/workflowCallableArgResolver.d.ts.map +1 -1
  234. package/dist/infra/config/loaders/workflowCallableArgResolver.js +15 -7
  235. package/dist/infra/config/loaders/workflowCallableArgResolver.js.map +1 -1
  236. package/dist/infra/config/loaders/workflowDoctor.d.ts.map +1 -1
  237. package/dist/infra/config/loaders/workflowDoctor.js +19 -7
  238. package/dist/infra/config/loaders/workflowDoctor.js.map +1 -1
  239. package/dist/infra/config/loaders/workflowLoopMonitorNormalizer.d.ts +3 -1
  240. package/dist/infra/config/loaders/workflowLoopMonitorNormalizer.d.ts.map +1 -1
  241. package/dist/infra/config/loaders/workflowLoopMonitorNormalizer.js +3 -1
  242. package/dist/infra/config/loaders/workflowLoopMonitorNormalizer.js.map +1 -1
  243. package/dist/infra/config/loaders/workflowParser.d.ts.map +1 -1
  244. package/dist/infra/config/loaders/workflowParser.js +6 -8
  245. package/dist/infra/config/loaders/workflowParser.js.map +1 -1
  246. package/dist/infra/config/loaders/workflowPreview.d.ts +3 -0
  247. package/dist/infra/config/loaders/workflowPreview.d.ts.map +1 -1
  248. package/dist/infra/config/loaders/workflowPreview.js +17 -9
  249. package/dist/infra/config/loaders/workflowPreview.js.map +1 -1
  250. package/dist/infra/config/loaders/workflowStepNormalizer.d.ts +1 -1
  251. package/dist/infra/config/loaders/workflowStepNormalizer.d.ts.map +1 -1
  252. package/dist/infra/config/loaders/workflowStepNormalizer.js +18 -10
  253. package/dist/infra/config/loaders/workflowStepNormalizer.js.map +1 -1
  254. package/dist/infra/opencode/allowedTools.d.ts +1 -0
  255. package/dist/infra/opencode/allowedTools.d.ts.map +1 -1
  256. package/dist/infra/opencode/allowedTools.js +7 -0
  257. package/dist/infra/opencode/allowedTools.js.map +1 -1
  258. package/dist/infra/opencode/client.d.ts.map +1 -1
  259. package/dist/infra/opencode/client.js +47 -1
  260. package/dist/infra/opencode/client.js.map +1 -1
  261. package/dist/infra/opencode/types.d.ts +1 -0
  262. package/dist/infra/opencode/types.d.ts.map +1 -1
  263. package/dist/infra/opencode/types.js +10 -10
  264. package/dist/infra/opencode/types.js.map +1 -1
  265. package/dist/infra/providers/allowed-tool-edit-policy.d.ts +1 -0
  266. package/dist/infra/providers/allowed-tool-edit-policy.d.ts.map +1 -1
  267. package/dist/infra/providers/allowed-tool-edit-policy.js +35 -1
  268. package/dist/infra/providers/allowed-tool-edit-policy.js.map +1 -1
  269. package/dist/infra/providers/opencode.d.ts +2 -1
  270. package/dist/infra/providers/opencode.d.ts.map +1 -1
  271. package/dist/infra/providers/opencode.js +17 -7
  272. package/dist/infra/providers/opencode.js.map +1 -1
  273. package/dist/infra/providers/types.d.ts +1 -1
  274. package/dist/infra/providers/types.d.ts.map +1 -1
  275. package/dist/shared/constants.d.ts +1 -0
  276. package/dist/shared/constants.d.ts.map +1 -1
  277. package/dist/shared/constants.js +1 -0
  278. package/dist/shared/constants.js.map +1 -1
  279. package/dist/shared/i18n/labels_en.yaml +115 -0
  280. package/dist/shared/i18n/labels_ja.yaml +115 -0
  281. package/dist/shared/prompts/en/exec_assistant_clarify.md +14 -0
  282. package/dist/shared/prompts/en/exec_assistant_instruct.md +14 -0
  283. package/dist/shared/prompts/en/exec_assistant_summary.md +12 -0
  284. package/dist/shared/prompts/en/exec_facet_create.md +8 -0
  285. package/dist/shared/prompts/en/exec_facet_edit.md +8 -0
  286. package/dist/shared/prompts/en/finding_manager_instruction.md +28 -0
  287. package/dist/shared/prompts/en/opencode_agent_prompt.md +52 -0
  288. package/dist/shared/prompts/en/opencode_report_agent_prompt.md +8 -0
  289. package/dist/shared/prompts/en/opencode_review_agent_prompt.md +35 -0
  290. package/dist/shared/prompts/en/perform_phase1_message.md +1 -4
  291. package/dist/shared/prompts/en/perform_phase2_message.md +1 -0
  292. package/dist/shared/prompts/en/perform_phase3_message.md +1 -0
  293. package/dist/shared/prompts/en/provider_runtime_system_prompt.md +1 -0
  294. package/dist/shared/prompts/en/score_slug_system_prompt.md +1 -0
  295. package/dist/shared/prompts/en/score_slug_user_prompt.md +1 -0
  296. package/dist/shared/prompts/en/score_summary_system_prompt.md +1 -0
  297. package/dist/shared/prompts/en/source_context_section_guidance.md +6 -0
  298. package/dist/shared/prompts/en/source_context_system_guard.md +8 -0
  299. package/dist/shared/prompts/en/structured_json_schema_instruction.md +12 -0
  300. package/dist/shared/prompts/en/structured_json_step_instruction.md +12 -0
  301. package/dist/shared/prompts/en/sync_conflict_resolver_message.md +1 -0
  302. package/dist/shared/prompts/en/sync_conflict_resolver_system_prompt.md +1 -0
  303. package/dist/shared/prompts/index.d.ts.map +1 -1
  304. package/dist/shared/prompts/index.js +3 -1
  305. package/dist/shared/prompts/index.js.map +1 -1
  306. package/dist/shared/prompts/ja/exec_assistant_clarify.md +14 -0
  307. package/dist/shared/prompts/ja/exec_assistant_instruct.md +14 -0
  308. package/dist/shared/prompts/ja/exec_assistant_summary.md +12 -0
  309. package/dist/shared/prompts/ja/exec_facet_create.md +8 -0
  310. package/dist/shared/prompts/ja/exec_facet_edit.md +8 -0
  311. package/dist/shared/prompts/ja/finding_manager_instruction.md +28 -0
  312. package/dist/shared/prompts/ja/opencode_agent_prompt.md +52 -0
  313. package/dist/shared/prompts/ja/opencode_report_agent_prompt.md +8 -0
  314. package/dist/shared/prompts/ja/opencode_review_agent_prompt.md +35 -0
  315. package/dist/shared/prompts/ja/perform_phase1_message.md +1 -4
  316. package/dist/shared/prompts/ja/perform_phase2_message.md +1 -0
  317. package/dist/shared/prompts/ja/perform_phase3_message.md +1 -0
  318. package/dist/shared/prompts/ja/provider_runtime_system_prompt.md +1 -0
  319. package/dist/shared/prompts/ja/score_slug_system_prompt.md +1 -0
  320. package/dist/shared/prompts/ja/score_slug_user_prompt.md +1 -0
  321. package/dist/shared/prompts/ja/score_summary_system_prompt.md +1 -0
  322. package/dist/shared/prompts/ja/source_context_section_guidance.md +6 -0
  323. package/dist/shared/prompts/ja/source_context_system_guard.md +8 -0
  324. package/dist/shared/prompts/ja/structured_json_schema_instruction.md +12 -0
  325. package/dist/shared/prompts/ja/structured_json_step_instruction.md +12 -0
  326. package/dist/shared/prompts/ja/sync_conflict_resolver_message.md +1 -0
  327. package/dist/shared/prompts/ja/sync_conflict_resolver_system_prompt.md +1 -0
  328. package/dist/shared/utils/pathBoundary.d.ts +6 -0
  329. package/dist/shared/utils/pathBoundary.d.ts.map +1 -1
  330. package/dist/shared/utils/pathBoundary.js +38 -1
  331. package/dist/shared/utils/pathBoundary.js.map +1 -1
  332. package/package.json +1 -1
  333. package/builtins/en/provider-options/review-web.yaml +0 -14
  334. package/builtins/ja/provider-options/review-web.yaml +0 -14
  335. package/dist/features/interactive/policyPrompt.d.ts +0 -2
  336. package/dist/features/interactive/policyPrompt.d.ts.map +0 -1
  337. package/dist/features/interactive/policyPrompt.js +0 -18
  338. package/dist/features/interactive/policyPrompt.js.map +0 -1
  339. package/dist/shared/prompts/en/score_interactive_policy.md +0 -83
  340. package/dist/shared/prompts/ja/score_interactive_policy.md +0 -83
package/README.md CHANGED
@@ -234,6 +234,7 @@ See the [Builtin Catalog](./docs/builtin-catalog.md) for all workflows and perso
234
234
  | Command | Description |
235
235
  |---------|-------------|
236
236
  | `takt` | Talk to AI, refine requirements, execute or queue tasks |
237
+ | `takt exec` | Start instant Assistant/Worker/Review agent mode without writing workflow YAML |
237
238
  | `takt run` | Execute all pending tasks |
238
239
  | `takt list` | Manage task branches (merge, retry, requeue, force-fail, instruct, delete) |
239
240
  | `takt #N` | Execute GitHub Issue as task |
@@ -244,6 +245,18 @@ See the [Builtin Catalog](./docs/builtin-catalog.md) for all workflows and perso
244
245
 
245
246
  See the [CLI Reference](./docs/cli-reference.md) for all commands and options.
246
247
 
248
+ ### Instant exec mode
249
+
250
+ `takt exec` starts TAKT's interactive task-entry mode. The Assistant agent clarifies the request, `/go` turns the conversation into a generated workflow, Worker agent(s) implement the task, Review agent(s) review the result, the Replanning agent asks the user for direction when needed, and loop detection prevents repeated unproductive cycles.
251
+
252
+ Exec starts from the previous exec configuration, or the default configuration on first run. Pass a preset name to start from that preset. Use `/setup` during the conversation to edit agents, loop detection thresholds, presets, and referenced instruction/knowledge/policy facets. Builtin/default presets define the agent roles, facets, and loop thresholds only. Provider and model are resolved from normal TAKT configuration when exec mode starts, and the same resolved values are used for the Assistant dialogue, `/setup` display, and workflow generation. An exec config overrides provider/model only when it sets them explicitly. `effort` is emitted only when it is explicitly configured.
253
+
254
+ Exec presets resolve in this order: project `.takt/exec/presets/` → global `$TAKT_CONFIG_DIR/exec/presets/` (default `~/.takt/exec/presets/`) → builtin `builtins/exec/presets/`. Changes made in `/setup` are saved to `$TAKT_CONFIG_DIR/exec.yaml` (default `~/.takt/exec.yaml`) for the next exec session. `/setup` can also save or delete project/global presets, and created facets are stored under `.takt/facets/` or `$TAKT_CONFIG_DIR/facets/` (default `~/.takt/facets/`).
255
+
256
+ When `/go` runs, TAKT generates `.takt/exec/workflow.yaml` and executes it through the normal workflow engine. Inline text after `/go` is treated as an additional note. `/go` without prior conversation or inline task text does not generate the workflow. Use `/cancel` to exit without running.
257
+
258
+ Normal agent steps, parallel sub-steps, and loop detection judges may set `session_key` to share or isolate persona sessions. System steps, workflow_call steps, and parallel parent steps cannot set `session_key`. TAKT builds the runtime key as `session_key` plus the resolved provider, so values must be non-empty strings that do not collide with other generated session routes.
259
+
247
260
  ## Configuration
248
261
 
249
262
  Minimal `~/.takt/config.yaml`:
@@ -0,0 +1,15 @@
1
+ # Exec Loop Monitor Instruction
2
+
3
+ Review whether the repeated exec loop is productive.
4
+
5
+ This loop has repeated {cycle_count} times.
6
+
7
+ Review recent reports in chronological order and choose one of the following conditions.
8
+
9
+ Small loop (execute ↔ review):
10
+ - `Healthy (progress being made)` — findings are decreasing or meaningful progress is visible.
11
+ - `Unproductive (same rework repeating)` — the same fixes repeat with no improvement.
12
+
13
+ Large loop (replan → execute → review):
14
+ - `Healthy (progress being made)` — findings are decreasing or meaningful progress is visible.
15
+ - `Unproductive (no convergence)` — workers stay blocked or no convergence is visible.
@@ -0,0 +1,5 @@
1
+ # Exec Replan Instruction
2
+
3
+ Discuss replanning with the user after a review requests needs_replan.
4
+
5
+ Summarize the blocking issue from the review report, ask for the minimum needed clarification, and produce a revised plan when ready.
@@ -0,0 +1,10 @@
1
+ # Exec Review Instruction
2
+
3
+ Review the worker result in an independent session.
4
+
5
+ Check the task requirement, worker reports, and actual code changes. Return one of these statuses:
6
+ - approved: the task is complete.
7
+ - needs_fix: small implementation fixes are required.
8
+ - needs_replan: the approach needs user-level replanning.
9
+
10
+ Include concise evidence and concrete next steps.
@@ -0,0 +1,5 @@
1
+ # Exec Worker Instruction
2
+
3
+ Implement the requested task.
4
+
5
+ Use the task instruction and reports in the Report Directory as primary context. If this is a fix pass, address review findings first. Keep changes inside the assigned scope, run the relevant checks, and report changed files and verification results.
@@ -88,6 +88,22 @@ In TAKT, workflow runtime is not the only user-visible contract entry. Preview,
88
88
  | Doctor or validation accepts config that fails at runtime due to different conditions | Warning |
89
89
  | Runtime and auxiliary entries share the same normalized input or resolver | OK |
90
90
 
91
+ ## Runtime Asset Consumption Boundaries
92
+
93
+ TAKT runtime assets get their meaning from the entry point that consumes them, not only from their location or name. The same string can be an asset reference, session identifier, display name, or directly supplied body, and each is a separate contract.
94
+
95
+ | Criteria | Judgment |
96
+ |----------|----------|
97
+ | Treating an entry that resolves asset references and an entry that only uses identifiers as equivalent | REJECT |
98
+ | Adding a same-named facet and assuming it affects an entry that receives body content directly | REJECT |
99
+ | Workflow-derived runtime assets and feature-local runtime assets share the same responsibility name | Warning |
100
+ | Each entry point confirms which resolver or loader consumes which asset type before placing the asset | OK |
101
+ | Shared body content is centralized behind the existing runtime asset loader | OK |
102
+
103
+ ### Reference Names and Identity Names
104
+
105
+ Strings such as `persona`, `session_key`, and `name` mean different things depending on whether they are reference names or identity names. A reference name causes the corresponding resolver to load an asset. An identity name is a key for sessions, logs, state, or display, and a same-named file is not used unless that entry reads it. When adding a new asset, trace the loader that reads it and the call site that consumes it.
106
+
91
107
  ## Facet Assembly
92
108
 
93
109
  The faceted-prompting module is independent from TAKT core.
@@ -0,0 +1,13 @@
1
+ # Exec Review Result
2
+
3
+ ## Status
4
+
5
+ approved | needs_fix | needs_replan
6
+
7
+ ## Evidence
8
+
9
+ Concise evidence for the status.
10
+
11
+ ## Required Next Step
12
+
13
+ Concrete next action, if any.
@@ -0,0 +1,3 @@
1
+ # Assistant Persona
2
+
3
+ You are a TAKT assistant. Stay helpful, concise, and action-oriented.
@@ -0,0 +1,3 @@
1
+ # Worker Persona
2
+
3
+ You are a TAKT worker. Stay focused, precise, and self-contained.
@@ -12,6 +12,7 @@ For released or operational systems, make changes that are causally related to t
12
12
  | Respect existing structure | Do not change file placement, type names, public APIs, or responsibility boundaries without causal relationship to the request |
13
13
  | Preserve comments | Do not delete comments that explain intent, constraints, or calculation rationale |
14
14
  | Tests are contracts | Do not treat behavior asserted by existing tests as incidental |
15
+ | Verify external contracts from primary evidence | Confirm behavior of external services, SDKs, and generated artifacts from official specs or actual types/schemas |
15
16
  | Causal improvement judgment | Perform style improvements and refactoring when causally related to the request. Do not mix improvements without causal relationship |
16
17
  | Protect unrelated code | Prioritize preserving existing behavior and structure that is not causally related to the request |
17
18
 
@@ -51,6 +52,18 @@ UI, accessibility, tests, logs, APIs, types, file placement, and comments can be
51
52
  | Comments | Change only when correcting inaccurate comments or when code makes them truly obsolete |
52
53
  | File placement | Change only when causally related to the request |
53
54
 
55
+ ## External Dependency Contracts
56
+
57
+ Treat behavior of external services, SDKs, generated code, schemas, and CLIs as boundary contracts of the existing system. Do not infer one operation's error types, statuses, return values, idempotency, limits, or optionality from another operation without verification.
58
+
59
+ | Criteria | Verdict |
60
+ |----------|---------|
61
+ | The concrete contract is verified from official specs, actual type definitions, generated schemas, or existing equivalent implementation | OK |
62
+ | Error types, statuses, or return values from a different operation in the same service are generalized as "equivalent" and reused for an unverified operation | REJECT |
63
+ | Compile success, mock success, or stub expectations alone are treated as proof of the external contract | REJECT |
64
+ | Plans or implementation guidelines keep vague external-contract wording such as "equivalent" or "same as" | REJECT |
65
+ | When the external contract cannot be verified, the unverified scope, risk, and verification method are recorded | OK |
66
+
54
67
  ## Test Changes
55
68
 
56
69
  Tests should distinguish existing contracts from new requirements, not merely follow the implementation.
@@ -13,6 +13,7 @@ Define the shared judgment criteria and behavioral principles for all reviewers.
13
13
  | State consistency | For side effects and state changes, verify that success, failure, and interruption paths have no missing, duplicated, or inconsistent effects |
14
14
  | Contract coverage | Verify new contracts across normal entries, derived conditions, validation, evaluation, output, and re-injection paths |
15
15
  | Contract consistency | Verify that contracts carried by consolidation or abstraction are applied to existing equivalent branches by the same standard |
16
+ | External contract verification | Verify semantic contracts of external services, SDKs, and generated artifacts from primary evidence or actual types |
16
17
  | Specification completeness | When changing a user-facing contract, verify that implementation, tests, and documentation describe the same lookup order, override rules, special syntax, and failure conditions |
17
18
  | Requirement anchoring | Do not reinterpret required task items as optional, out of scope, or different requirements for implementation convenience |
18
19
  | Resolution judgment | Judge `resolved` against the original finding acceptance criteria and original task requirements, not merely against the presence of a fix |
@@ -57,6 +58,7 @@ REJECT without exception if any of the following apply.
57
58
  - User-facing contract changes for configuration, CLI, or file formats where documentation or examples omit priority, first-match/merge behavior, inline overrides, scoped/special references, or failure conditions
58
59
  - Existing branches with the same contract remain on the old implementation after adding or changing a shared helper, normalizer, builder, or adapter
59
60
  - Fields, attributes, outputs, settings, or identifiers requested by the task are treated as optional, unset, out of scope, or missing for some entry point or execution mode without explicit evidence
61
+ - Operation-specific error types, statuses, return values, or idempotency of an external service, SDK, or generated artifact are not verified, and another operation's contract or mock success is used instead
60
62
  - Missing, duplicated, or incorrectly ordered effects in side-effect or state-change paths
61
63
  - Sensitive data exposed in logs, error responses, or test output
62
64
 
@@ -14,6 +14,7 @@ Every behavior change requires a corresponding test, and every bug fix requires
14
14
  | Reproducibility | Do not depend on time or randomness. Same result every run |
15
15
  | Do not freeze non-executable assets | Do not make prose or section structure that does not define runtime behavior a CI failure condition |
16
16
  | Verify negative contracts at observable units | Do not pass prohibition, rejection, non-inheritance, or unsupported cases by exact-string absence alone |
17
+ | Mock contract fidelity | Keep external SDK/API mocks aligned with real contracts and do not freeze wrong assumptions in tests |
17
18
 
18
19
  ## Coverage Criteria
19
20
 
@@ -164,6 +165,18 @@ Test data should explicitly generate the minimum facts needed by each test. Muta
164
165
  | Factories provide defaults and each test overrides only relevant fields | OK |
165
166
  | Contract changes update fixtures, mocks, and snapshots in the same change | OK |
166
167
 
168
+ ## External Contract Mocks
169
+
170
+ When mocking an external SDK, external API, generated client, or CLI, align mocked exception types, statuses, return values, missing values, partial successes, and idempotency with the real contract. Type compatibility alone does not verify the semantic contract.
171
+
172
+ | Criteria | Verdict |
173
+ |----------|---------|
174
+ | Mock values are chosen by checking official specs, SDK types, generated schemas, or existing equivalent tests | OK |
175
+ | The mock throws the exception or return value expected by the implementation, and test success is used as proof of the external contract | REJECT |
176
+ | Error types or response shapes from a different operation in the same service are reused | REJECT |
177
+ | The mock is type-safe but operation-specific semantic contracts, such as existing-resource behavior, partial success, or missing detection, are not verified | REJECT |
178
+ | When real integration is stubbed, the report separates what the mock verifies from the unverified real-integration scope | OK |
179
+
167
180
  ### Naming
168
181
 
169
182
  Test names describe expected behavior. Use the `should {expected behavior} when {condition}` pattern.
@@ -98,7 +98,7 @@ steps:
98
98
  - review
99
99
  - ai-antipattern
100
100
  provider_options:
101
- extends: review-web
101
+ extends: review-readonly
102
102
  rules:
103
103
  - condition: No AI-specific issues
104
104
  next: COMPLETE
@@ -163,7 +163,7 @@ steps:
163
163
  - review
164
164
  - ai-antipattern
165
165
  provider_options:
166
- extends: review-web
166
+ extends: review-readonly
167
167
  instruction: ai-antipattern-review
168
168
  rules:
169
169
  - condition: approved
@@ -156,7 +156,7 @@ steps:
156
156
  - review
157
157
  - ai-antipattern
158
158
  provider_options:
159
- extends: review-web
159
+ extends: review-readonly
160
160
  instruction: ai-antipattern-review
161
161
  rules:
162
162
  - condition: approved
@@ -0,0 +1,31 @@
1
+ name: backend
2
+ description: Backend development team
3
+ session: {}
4
+ replan:
5
+ instruction: exec-replan
6
+ knowledge:
7
+ - architecture
8
+ - backend
9
+ policy: []
10
+ workers:
11
+ - name: worker-1
12
+ instruction: exec-worker
13
+ knowledge:
14
+ - architecture
15
+ - backend
16
+ - security
17
+ policy:
18
+ - coding
19
+ - testing
20
+ reviews:
21
+ - name: review-1
22
+ instruction: exec-review
23
+ knowledge:
24
+ - architecture
25
+ - security
26
+ policy:
27
+ - review
28
+ loop:
29
+ threshold: 3
30
+ large_threshold: 2
31
+ max_steps: 20
@@ -0,0 +1,34 @@
1
+ name: dual
2
+ description: Two-worker development team
3
+ session: {}
4
+ replan:
5
+ instruction: exec-replan
6
+ knowledge:
7
+ - architecture
8
+ policy: []
9
+ workers:
10
+ - name: worker-1
11
+ instruction: exec-worker
12
+ knowledge:
13
+ - architecture
14
+ policy:
15
+ - coding
16
+ - testing
17
+ - name: worker-2
18
+ instruction: exec-worker
19
+ knowledge:
20
+ - unit-testing
21
+ policy:
22
+ - coding
23
+ - testing
24
+ reviews:
25
+ - name: review-1
26
+ instruction: exec-review
27
+ knowledge:
28
+ - architecture
29
+ policy:
30
+ - review
31
+ loop:
32
+ threshold: 3
33
+ large_threshold: 2
34
+ max_steps: 20
@@ -0,0 +1,31 @@
1
+ name: frontend
2
+ description: Frontend development team
3
+ session: {}
4
+ replan:
5
+ instruction: exec-replan
6
+ knowledge:
7
+ - architecture
8
+ - frontend
9
+ - react
10
+ policy: []
11
+ workers:
12
+ - name: worker-1
13
+ instruction: exec-worker
14
+ knowledge:
15
+ - frontend
16
+ - react
17
+ policy:
18
+ - coding
19
+ - testing
20
+ reviews:
21
+ - name: review-1
22
+ instruction: exec-review
23
+ knowledge:
24
+ - frontend
25
+ - react
26
+ policy:
27
+ - review
28
+ loop:
29
+ threshold: 3
30
+ large_threshold: 2
31
+ max_steps: 20
@@ -0,0 +1,45 @@
1
+ name: research
2
+ description: Research and implementation team
3
+ session: {}
4
+ replan:
5
+ instruction: exec-replan
6
+ knowledge:
7
+ - research
8
+ policy: []
9
+ workers:
10
+ - name: worker-1
11
+ instruction: exec-worker
12
+ knowledge:
13
+ - research
14
+ - architecture
15
+ policy:
16
+ - coding
17
+ - testing
18
+ - name: worker-2
19
+ instruction: exec-worker
20
+ knowledge:
21
+ - research
22
+ - unit-testing
23
+ policy:
24
+ - coding
25
+ - testing
26
+ - name: worker-3
27
+ instruction: exec-worker
28
+ knowledge:
29
+ - research
30
+ - architecture
31
+ policy:
32
+ - coding
33
+ - testing
34
+ reviews:
35
+ - name: review-1
36
+ instruction: exec-review
37
+ knowledge:
38
+ - research
39
+ - architecture
40
+ policy:
41
+ - review
42
+ loop:
43
+ threshold: 3
44
+ large_threshold: 2
45
+ max_steps: 20
@@ -0,0 +1,15 @@
1
+ # Exec ループモニター指示
2
+
3
+ 繰り返されている exec ループが生産的か判定する。
4
+
5
+ このループは {cycle_count} 回繰り返されています。
6
+
7
+ 直近のレポートを時系列で確認し、次のいずれかの条件を選ぶ。
8
+
9
+ 小ループ(execute ↔ review):
10
+ - `Healthy (progress being made)` — 指摘が減っている、または意味のある進捗がある。
11
+ - `Unproductive (same rework repeating)` — 同じ修正が改善なく繰り返されている。
12
+
13
+ 大ループ(replan → execute → review):
14
+ - `Healthy (progress being made)` — 指摘が減っている、または意味のある進捗がある。
15
+ - `Unproductive (no convergence)` — Worker が blocked を続ける、または収束が見えない。
@@ -0,0 +1,5 @@
1
+ # Exec Replan 指示
2
+
3
+ review が needs_replan を求めた場合に、ユーザーと再計画を相談する。
4
+
5
+ review レポートの問題点を要約し、必要最小限の確認を行い、合意できたら改訂計画を作成する。
@@ -0,0 +1,10 @@
1
+ # Exec Review 指示
2
+
3
+ Worker の結果を独立セッションでレビューする。
4
+
5
+ タスク要件、Worker レポート、実際のコード変更を確認する。次のいずれかのステータスを返す:
6
+ - approved: タスクは完了している。
7
+ - needs_fix: 軽微な実装修正が必要。
8
+ - needs_replan: ユーザーと方針を再計画する必要がある。
9
+
10
+ 根拠と次の具体的な手順を簡潔に含める。
@@ -0,0 +1,5 @@
1
+ # Exec Worker 指示
2
+
3
+ 依頼されたタスクを実装する。
4
+
5
+ タスク指示と Report Directory 内のレポートを主要な文脈として扱う。差し戻しの場合は review の指摘を最優先で修正する。担当範囲内に変更を限定し、必要な検証を実行し、変更ファイルと検証結果を報告する。
@@ -88,6 +88,22 @@ TAKT では workflow 実行経路だけでなく、preview、doctor、workflow s
88
88
  | doctor や validation が正常とする設定が runtime では別条件により失敗する | 警告 |
89
89
  | runtime と補助入口が同じ正規化済み入力または同じ resolver を共有している | OK |
90
90
 
91
+ ## 実行資産の消費境界
92
+
93
+ TAKT の実行資産は、配置場所や名前だけではなく、それを消費する入口で意味が決まる。同じ文字列でも、資産参照、セッション識別子、表示名、直接渡される本文は別契約として扱う。
94
+
95
+ | 基準 | 判定 |
96
+ |------|------|
97
+ | 資産参照を解決する入口と、識別子だけを使う入口を同一視している | REJECT |
98
+ | 同名の facet を追加しただけで、直接本文を渡す入口にも反映されると扱っている | REJECT |
99
+ | workflow 由来の実行資産と機能固有の実行資産が同じ責務名で混在している | 警告 |
100
+ | 入口ごとに、どの resolver / loader がどの資産種別を消費するかを確認して配置している | OK |
101
+ | 共有すべき本文を、既存の実行資産 loader から読む形に集約している | OK |
102
+
103
+ ### 参照名と識別名
104
+
105
+ `persona`、`session_key`、`name` のような文字列は、参照名か識別名かで意味が異なる。参照名なら対応する resolver が資産を読み込む。識別名ならセッション、ログ、状態、表示のキーであり、同名ファイルの存在だけでは内容は使われない。新しい資産を追加した場合は、その資産を読む loader と呼び出し元まで追う。
106
+
91
107
  ## ファセット組み立て
92
108
 
93
109
  faceted-prompting モジュールは TAKT 本体に依存しない独立モジュール。
@@ -0,0 +1,13 @@
1
+ # Exec Review Result
2
+
3
+ ## Status
4
+
5
+ approved | needs_fix | needs_replan
6
+
7
+ ## Evidence
8
+
9
+ レビューの根拠を簡潔に書く。
10
+
11
+ ## Required Next Step
12
+
13
+ 必要な次の行動を具体的に書く。
@@ -0,0 +1,3 @@
1
+ # アシスタント ペルソナ
2
+
3
+ あなたは TAKT アシスタントです。簡潔で、的確で、行動指向を保ちます。
@@ -0,0 +1,3 @@
1
+ # ワーカー ペルソナ
2
+
3
+ あなたは TAKT ワーカーです。集中し、正確で、自己完結的に行動します。
@@ -12,6 +12,7 @@
12
12
  | 既存構造尊重 | ファイル配置、型名、公開API、責務境界を要求と因果関係なく変えない |
13
13
  | コメント保全 | 意図、制約、算出根拠を示すコメントを削除しない |
14
14
  | テストの契約性 | 既存テストが検証する挙動を軽微扱いしない |
15
+ | 外部契約一次確認 | 外部サービス・SDK・生成物の挙動は、公式仕様または実際の型・スキーマで確認する |
15
16
  | 改善の因果判定 | 作法改善・リファクタは要求と因果関係がある場合に実施する。因果関係のない改善は混ぜない |
16
17
  | 無関係保護優先 | 要求と因果関係のない既存挙動・構造の保持を優先する |
17
18
 
@@ -51,6 +52,18 @@ UI、アクセシビリティ、テスト、ログ、API、型、ファイル配
51
52
  | コメント | 誤りを直す場合、またはコードで完全に不要になった場合のみ変更する |
52
53
  | ファイル配置 | 要求と因果関係がある場合のみ変更する |
53
54
 
55
+ ## 外部依存契約
56
+
57
+ 外部サービス、SDK、生成コード、スキーマ、CLI の挙動は既存システムの境界契約として扱う。操作ごとのエラー型、ステータス、戻り値、冪等性、上限、optional 条件を推測で共通化しない。
58
+
59
+ | 基準 | 判定 |
60
+ |------|------|
61
+ | 公式仕様、実際の型定義、生成スキーマ、または既存の同種実装で具体契約を確認している | OK |
62
+ | 同じサービス内の別操作の例外型・ステータス・戻り値を「相当」とみなし、未確認の操作へ流用する | REJECT |
63
+ | コンパイル成功、モック成功、スタブの期待値だけで外部契約を確認済みと扱う | REJECT |
64
+ | 計画や実装ガイドラインに外部契約の曖昧語が残る(例: 「相当」「同様」) | REJECT |
65
+ | 外部契約を確認できない場合に、未確認範囲・リスク・確認方法を記録している | OK |
66
+
54
67
  ## テスト変更
55
68
 
56
69
  テストは実装へ追随させるものではなく、既存契約と新要求を区別するために使う。
@@ -13,6 +13,7 @@
13
13
  | 状態整合性 | 副作用や状態変更は、正常・失敗・中断の各経路で漏れ・重複・不整合がないことを確認する |
14
14
  | 契約全入口 | 新しい契約は通常入口だけでなく、派生条件・検証・評価・出力・再注入経路まで同じ基準で確認する |
15
15
  | 契約一貫性 | 共通化・抽象化で担う契約は、既存の同種分岐にも同じ基準で適用されていることを確認する |
16
+ | 外部契約検証 | 外部サービス・SDK・生成物の意味契約を、一次情報または実型で確認する |
16
17
  | 仕様完全性 | 利用者向け契約を変える場合、実装・テスト・ドキュメントが同じ探索順、上書き規則、特殊記法、失敗条件を説明していることを確認する |
17
18
  | 元要件固定 | タスク指示書の必須項目を、実装都合で optional・対象外・別要件に読み替えない |
18
19
  | 解消判定 | resolved 判定は修正内容ではなく、元 finding の受入条件と元要件に戻って確認する |
@@ -57,6 +58,7 @@
57
58
  - 設定・CLI・ファイル形式などの利用者向け契約変更に対して、ドキュメントや例が優先順位、first-match/merge、inline上書き、scope/特殊参照、失敗条件のいずれかを欠落している
58
59
  - 共通ヘルパー、正規化関数、builder、adapter の追加・変更後に、同じ契約を持つ既存分岐が旧実装のまま残っている
59
60
  - タスクで要求されたフィールド、属性、出力、設定、識別子を、明示根拠なく optional・未設定・対象外として扱う、または入口や実行モードによって欠落させている
61
+ - 外部サービス・SDK・生成物の操作ごとのエラー型、ステータス、戻り値、冪等性を確認せず、別操作の契約やモックの成功で代用している
60
62
  - 副作用や状態変更の実行経路に、漏れ・重複・順序不整合がある
61
63
  - ログ、エラーレスポンス、テスト出力への機密情報露出
62
64
 
@@ -101,6 +103,7 @@ DRY違反の修正案は、単に共通化を求めるだけでは不十分と
101
103
  | ファイルを開いて実コードを確認 | 「修正済みのはず」と思い込む |
102
104
  | 呼び出し元・使用箇所を検索 | 記憶に基づいて指摘する |
103
105
  | 型定義・スキーマを突合 | 推測でデッドコードと判断する |
106
+ | 外部SDK・APIの操作別契約を公式仕様または実型で確認 | コンパイル成功やモック成功だけで意味契約を確認済みとする |
104
107
  | 生成ファイル(レポート等)とソースを区別 | 生成ファイルをソースコードとしてレビュー |
105
108
  | ツール出力が正常に読めることを確認 | 文字化け・異常文字を含む出力に基づいて指摘する |
106
109
  | 「存在しない」主張は対象行を直接読んで検証 | 検索結果だけで「コードにない」と断定する |
@@ -13,6 +13,7 @@
13
13
  | 再現性 | 時間やランダム性に依存せず、毎回同じ結果 |
14
14
  | 非実行資産を固定しない | 実行時の振る舞いを定義しない本文や章構成を CI の失敗条件にしない |
15
15
  | 否定契約を観測単位で検証 | 禁止・拒否・非継承・非対応は、完全一致文字列の不在だけで合格にしない |
16
+ | モック契約一致 | 外部SDK・APIのモックは実契約と一致させ、誤った前提をテストで固定しない |
16
17
 
17
18
  ## カバレッジ基準
18
19
 
@@ -164,6 +165,18 @@ test('ユーザーが存在しない場合、NotFoundエラーを返す', async
164
165
  | factory でデフォルトを用意し、テストに関係するフィールドだけ上書きしている | OK |
165
166
  | 契約変更時に fixture、mock、snapshot を同じ変更で更新している | OK |
166
167
 
168
+ ## 外部契約モック
169
+
170
+ 外部SDK、外部API、生成クライアント、CLI をモックする場合、モックの例外型、ステータス、戻り値、欠落値、部分成功、冪等性は実契約に合わせる。型が合うだけでは、意味契約を検証したことにならない。
171
+
172
+ | 基準 | 判定 |
173
+ |------|------|
174
+ | 公式仕様、SDK型、生成スキーマ、既存同種テストのいずれかと突合してモック値を決めている | OK |
175
+ | 実装が期待する例外や戻り値をモックに投げさせ、そのテスト成功を外部契約の根拠にしている | REJECT |
176
+ | 同じサービス内の別操作のエラー型やレスポンス shape を流用している | REJECT |
177
+ | 型安全なモックだが、操作ごとの意味契約(既存リソース時、部分成功時、未検出時など)を確認していない | REJECT |
178
+ | 実連携をスタブ化する場合、モックで確認した範囲と未確認の実連携範囲をレポートに分けて記録している | OK |
179
+
167
180
  ### 命名
168
181
 
169
182
  テスト名は期待される振る舞いを記述する。`should {期待する振る舞い} when {条件}` パターンを使う。
@@ -98,7 +98,7 @@ steps:
98
98
  - review
99
99
  - ai-antipattern
100
100
  provider_options:
101
- extends: review-web
101
+ extends: review-readonly
102
102
  rules:
103
103
  - condition: AI特有の問題なし
104
104
  next: COMPLETE
@@ -163,7 +163,7 @@ steps:
163
163
  - review
164
164
  - ai-antipattern
165
165
  provider_options:
166
- extends: review-web
166
+ extends: review-readonly
167
167
  instruction: ai-antipattern-review
168
168
  rules:
169
169
  - condition: approved
@@ -156,7 +156,7 @@ steps:
156
156
  - review
157
157
  - ai-antipattern
158
158
  provider_options:
159
- extends: review-web
159
+ extends: review-readonly
160
160
  instruction: ai-antipattern-review
161
161
  rules:
162
162
  - condition: approved
@@ -137,7 +137,7 @@ current_step のプロンプトを構築する(→ references/engine.md のプ
137
137
 
138
138
  プロンプト構築の要素:
139
139
  1. **ペルソナ**: `persona:` キー → `personas:` セクション → .md ファイル内容
140
- 2. **ポリシー**: `policy:` キー → `policies:` セクション → .md ファイル内容(複数可、末尾にリマインダー再掲)
140
+ 2. **ポリシー**: `policy:` キー → `policies:` セクション → .md ファイル内容(複数可)
141
141
  3. **実行コンテキスト**: cwd, ワークフロー名, step 名, イテレーション情報
142
142
  4. **ナレッジ**: `knowledge:` キー → `knowledge:` セクション → .md ファイル内容
143
143
  5. **インストラクション**: `instruction:` キー → `instructions:` セクション → .md ファイル内容(テンプレート変数展開済み)
@@ -89,7 +89,6 @@ Task tool:
89
89
  9. 前の step の出力(pass_previous_response: true の場合、自動追加)
90
90
  10. レポート出力指示(report フィールドがある場合、自動追加)
91
91
  11. ステータスタグ出力指示(rules がある場合、自動追加)
92
- 12. ポリシーリマインダー(ポリシーがある場合、末尾に再掲)
93
92
  ```
94
93
 
95
94
  ### ペルソナプロンプト
@@ -100,19 +99,6 @@ step の `persona:` キーからセクションマップを経由して .md フ
100
99
 
101
100
  step の `policy:` キー(単一または配列)からポリシーファイルを解決し、内容を結合する。ポリシーは行動ルール(コーディング規約、レビュー基準等)を定義する。
102
101
 
103
- **Lost in the Middle 対策**: ポリシーはプロンプトの前半に配置し、末尾にリマインダーとして再掲する。
104
-
105
- ```
106
- (プロンプト冒頭付近)
107
- ## ポリシー(行動ルール)
108
- {ポリシーの内容}
109
-
110
- (プロンプト末尾)
111
- ---
112
- **リマインダー**: 以下のポリシーに従ってください。
113
- {ポリシーの内容(再掲)}
114
- ```
115
-
116
102
  ### ナレッジ注入
117
103
 
118
104
  step の `knowledge:` キーからナレッジファイルを解決し、ドメイン固有の参考情報としてプロンプトに含める。
@@ -410,7 +396,7 @@ initial_step を取得
410
396
  │ ├── 通常: 1つの Task tool 呼び出し
411
397
  │ │ prompt = persona + policy + context + knowledge
412
398
  │ │ + instruction + task + previous_response
413
- │ │ + レポート指示 + タグ指示 + ポリシーリマインダー
399
+ │ │ + レポート指示 + タグ指示
414
400
  │ └── parallel: 複数の Task tool を1メッセージで並列呼び出し
415
401
  │ 各サブステップを別々のチームメイトとして起動
416
402
  │ ↓
@@ -124,7 +124,7 @@ current_step のプロンプトを構築する(→ references/engine.md のプ
124
124
 
125
125
  プロンプト構築の要素:
126
126
  1. **ペルソナ**: `persona:` キー → `personas:` セクション → .md ファイル内容
127
- 2. **ポリシー**: `policy:` キー → `policies:` セクション → .md ファイル内容(複数可、末尾にリマインダー再掲)
127
+ 2. **ポリシー**: `policy:` キー → `policies:` セクション → .md ファイル内容(複数可)
128
128
  3. **実行コンテキスト**: cwd, ワークフロー名, step 名, イテレーション情報
129
129
  4. **ナレッジ**: `knowledge:` キー → `knowledge:` セクション → .md ファイル内容
130
130
  5. **インストラクション**: `instruction:` キー → `instructions:` セクション → .md ファイル内容(テンプレート変数展開済み)
@@ -91,8 +91,6 @@ codex exec --full-auto - < "$tmp_prompt_file"
91
91
  9. 前回出力(`pass_previous_response: true` のとき)
92
92
  10. レポート出力指示(`report` または `output_contracts.report` があるとき)
93
93
  11. ステータスタグ出力指示(`rules` があるとき)
94
- 12. ポリシーリマインダー(ポリシーを末尾再掲)
95
-
96
94
  ### テンプレート変数展開
97
95
 
98
96
  インストラクション内のプレースホルダーを置換する。