orkeon-code 1.0.0-rc.1 → 1.0.0-rc.2

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 (440) hide show
  1. package/.orkeon-runtime +10 -0
  2. package/.orkeon-version +1 -1
  3. package/NOTICE.md +1 -1
  4. package/README.fr.md +16 -22
  5. package/README.md +16 -22
  6. package/config/appsettings.jev.example.json +4 -1
  7. package/config/appsettings.kev.example.json +4 -1
  8. package/config/appsettings.liquid.example.json +4 -1
  9. package/config/appsettings.ollama-whisper.example.json +1 -0
  10. package/config/appsettings.whisper.example.json +1 -0
  11. package/mcp/whisper/README.md +2 -1
  12. package/orkeon-code +206 -11
  13. package/orkeon-code.ps1 +109 -7
  14. package/package.json +2 -1
  15. package/src/commands/.orkeon/orkeon-cli.d.ts +1 -4
  16. package/src/commands/_lib/args.ts +5 -4
  17. package/src/commands/_lib/dev/dev-batches.ts +34 -36
  18. package/src/commands/_lib/dev/dev-implement.ts +11 -14
  19. package/src/commands/_lib/dev/dev-source.ts +7 -11
  20. package/src/commands/_lib/dev/dev.ts +34 -37
  21. package/src/commands/_lib/dev/markers.ts +7 -0
  22. package/src/commands/_lib/dev/messages.ts +112 -0
  23. package/src/commands/_lib/dev-step.ts +16 -13
  24. package/src/commands/_lib/dispatch.ts +62 -39
  25. package/src/commands/_lib/git/branch.ts +9 -10
  26. package/src/commands/_lib/git/commit.ts +9 -13
  27. package/src/commands/_lib/git/diff.ts +22 -12
  28. package/src/commands/_lib/git/messages.ts +54 -0
  29. package/src/commands/_lib/git/review.ts +9 -10
  30. package/src/commands/_lib/memory/memory-admit.ts +19 -21
  31. package/src/commands/_lib/memory/memory.ts +3 -2
  32. package/src/commands/_lib/memory/messages.ts +32 -0
  33. package/src/commands/_lib/messages.ts +48 -0
  34. package/src/commands/_lib/project/messages.ts +8 -0
  35. package/src/commands/_lib/session/export.ts +3 -2
  36. package/src/commands/_lib/session/messages.ts +87 -0
  37. package/src/commands/_lib/session/prompts.ts +4 -0
  38. package/src/commands/_lib/session/resume.ts +15 -24
  39. package/src/commands/_lib/session/tasks.ts +20 -23
  40. package/src/commands/_lib/settings/advisor.ts +11 -16
  41. package/src/commands/_lib/settings/agents.ts +18 -28
  42. package/src/commands/_lib/settings/choices.ts +8 -0
  43. package/src/commands/_lib/settings/config.ts +43 -43
  44. package/src/commands/_lib/settings/effort.ts +147 -0
  45. package/src/commands/_lib/settings/hooks.ts +12 -20
  46. package/src/commands/_lib/settings/messages.ts +408 -0
  47. package/src/commands/_lib/settings/mode.ts +33 -24
  48. package/src/commands/_lib/settings/model.ts +71 -36
  49. package/src/commands/_lib/settings/output-style.ts +39 -0
  50. package/src/commands/_lib/settings/permissions.ts +71 -93
  51. package/src/commands/_lib/settings/route.ts +63 -0
  52. package/src/commands/_lib/settings/skills.ts +53 -11
  53. package/src/commands/_lib/settings/theme.ts +42 -0
  54. package/src/commands/_lib/speech/messages.ts +58 -0
  55. package/src/commands/_lib/speech/prompts.ts +4 -0
  56. package/src/commands/_lib/speech/say.ts +9 -10
  57. package/src/commands/_lib/speech/transcribe.ts +14 -23
  58. package/src/commands/_lib/speech/voice.ts +14 -18
  59. package/src/commands/_lib/status/doctor.ts +47 -28
  60. package/src/commands/_lib/status/messages.ts +100 -0
  61. package/src/commands/_lib/status/meta.ts +3 -24
  62. package/src/commands/_lib/status/status.ts +10 -11
  63. package/src/commands/_lib/status/usage-tools.ts +2 -3
  64. package/src/commands/_lib/status/usage.ts +7 -18
  65. package/src/commands/_lib/view.ts +6 -1
  66. package/src/commands/dev/dev-batches.cmd.ts +4 -3
  67. package/src/commands/dev/dev-learn.cmd.ts +3 -3
  68. package/src/commands/dev/dev-plan.cmd.ts +6 -7
  69. package/src/commands/dev/dev-spec.cmd.ts +6 -7
  70. package/src/commands/git/commit.cmd.ts +3 -3
  71. package/src/commands/git/review.cmd.ts +3 -3
  72. package/src/commands/memory/memory.cmd.ts +2 -2
  73. package/src/commands/project/analyze.cmd.ts +3 -3
  74. package/src/commands/project/debug-tool-call.cmd.ts +4 -9
  75. package/src/commands/project/init-verifiers.cmd.ts +3 -3
  76. package/src/commands/project/init.cmd.ts +3 -3
  77. package/src/commands/project/verify.cmd.ts +2 -2
  78. package/src/commands/session/assistant.cmd.ts +2 -2
  79. package/src/commands/session/compact.cmd.ts +1 -1
  80. package/src/commands/session/copy.cmd.ts +8 -7
  81. package/src/commands/session/rename.cmd.ts +3 -2
  82. package/src/commands/session/rewind.cmd.ts +3 -4
  83. package/src/commands/session/summary.cmd.ts +3 -3
  84. package/src/commands/session/tasks.cmd.ts +4 -2
  85. package/src/commands/settings/config.cmd.ts +4 -2
  86. package/src/commands/settings/effort.cmd.ts +10 -31
  87. package/src/commands/settings/fast.cmd.ts +2 -1
  88. package/src/commands/settings/mode.cmd.ts +3 -3
  89. package/src/commands/settings/model.cmd.ts +3 -2
  90. package/src/commands/settings/output-style.cmd.ts +9 -38
  91. package/src/commands/settings/permissions.cmd.ts +2 -2
  92. package/src/commands/settings/proactive.cmd.ts +2 -1
  93. package/src/commands/settings/route.cmd.ts +16 -0
  94. package/src/commands/settings/skills.cmd.ts +3 -3
  95. package/src/commands/settings/theme.cmd.ts +14 -0
  96. package/src/commands/speech/say.cmd.ts +2 -2
  97. package/src/commands/speech/transcribe.cmd.ts +2 -2
  98. package/src/commands/status/release-notes.cmd.ts +1 -1
  99. package/src/crews/.orkeon/orkeon.d.ts +538 -93
  100. package/src/crews/_probe-shared-memory/domain/messages.ts +54 -0
  101. package/src/crews/_probe-shared-memory/domain/probe-verdict.ts +17 -12
  102. package/src/crews/_probe-shared-memory/domain/prompts.ts +5 -0
  103. package/src/crews/_probe-shared-memory/probe.ork.ts +5 -3
  104. package/src/crews/advisor/application/messages.ts +4 -0
  105. package/src/crews/advisor/application/prompts.ts +4 -0
  106. package/src/crews/advisor/application/run-advisor.ts +2 -1
  107. package/src/crews/advisor/crew.ork.ts +5 -4
  108. package/src/crews/advisor/domain/advice.ts +7 -23
  109. package/src/crews/advisor/domain/messages.ts +8 -0
  110. package/src/crews/advisor/domain/prompts.ts +26 -0
  111. package/src/crews/agent-run/application/messages.ts +18 -0
  112. package/src/crews/agent-run/application/run-agent-run.ts +5 -4
  113. package/src/crews/agent-run/crew.ork.ts +3 -3
  114. package/src/crews/analyze/application/messages.ts +27 -0
  115. package/src/crews/analyze/application/prompts.ts +4 -0
  116. package/src/crews/analyze/application/run-analyze.ts +16 -14
  117. package/src/crews/analyze/crew.ork.ts +5 -4
  118. package/src/crews/analyze/domain/harvest.ts +33 -65
  119. package/src/crews/analyze/domain/prompts.ts +86 -0
  120. package/src/crews/code-review/application/lens-material.ts +24 -0
  121. package/src/crews/code-review/application/messages.ts +17 -0
  122. package/src/crews/code-review/application/prompts.ts +10 -17
  123. package/src/crews/code-review/application/review.ts +4 -1
  124. package/src/crews/code-review/application/run-code-review.ts +13 -15
  125. package/src/crews/code-review/crew.ork.ts +5 -4
  126. package/src/crews/code-review/domain/lenses.ts +6 -45
  127. package/src/crews/code-review/domain/messages.ts +25 -0
  128. package/src/crews/code-review/domain/prompts.ts +58 -0
  129. package/src/crews/code-review/domain/report.ts +5 -6
  130. package/src/crews/code-review/domain/scope.ts +6 -12
  131. package/src/crews/dev-batches/application/messages.ts +127 -0
  132. package/src/crews/dev-batches/application/plan-close.ts +12 -12
  133. package/src/crews/dev-batches/application/prompts.ts +10 -0
  134. package/src/crews/dev-batches/application/run-dev-batches.ts +57 -50
  135. package/src/crews/dev-batches/application/run-wave.ts +24 -22
  136. package/src/crews/dev-batches/application/seed-harvest.ts +8 -7
  137. package/src/crews/dev-batches/crew.ork.ts +12 -9
  138. package/src/crews/dev-batches/domain/batches-log.ts +1 -3
  139. package/src/crews/dev-batches/domain/markers.ts +5 -0
  140. package/src/crews/dev-batches/domain/messages.ts +6 -0
  141. package/src/crews/dev-batches/domain/wave-order.ts +3 -2
  142. package/src/crews/dev-change/application/change-material.ts +44 -0
  143. package/src/crews/dev-change/application/evidence.ts +25 -22
  144. package/src/crews/dev-change/application/messages.ts +81 -0
  145. package/src/crews/dev-change/application/{change-prompt.ts → prompts.ts} +40 -43
  146. package/src/crews/dev-change/application/run-dev-change.ts +43 -34
  147. package/src/crews/dev-change/crew.ork.ts +11 -9
  148. package/src/crews/dev-change/domain/change-answer.ts +24 -20
  149. package/src/crews/dev-change/domain/change-render.ts +13 -15
  150. package/src/crews/dev-change/domain/markers.ts +28 -0
  151. package/src/crews/dev-change/domain/messages.ts +16 -0
  152. package/src/crews/dev-implement/application/close.ts +21 -18
  153. package/src/crews/dev-implement/application/locate-sheet.ts +7 -5
  154. package/src/crews/dev-implement/application/messages.ts +161 -0
  155. package/src/crews/dev-implement/application/observe.ts +4 -2
  156. package/src/crews/dev-implement/application/prompts.ts +9 -0
  157. package/src/crews/dev-implement/application/report-writes.ts +14 -9
  158. package/src/crews/dev-implement/application/run-dev-implement.ts +84 -73
  159. package/src/crews/dev-implement/application/suite-job.ts +15 -11
  160. package/src/crews/dev-implement/crew.ork.ts +2 -1
  161. package/src/crews/dev-implement/domain/contracts.ts +59 -60
  162. package/src/crews/dev-implement/domain/correction.ts +16 -15
  163. package/src/crews/dev-implement/domain/cycles.ts +2 -1
  164. package/src/crews/dev-implement/domain/markers.ts +23 -0
  165. package/src/crews/dev-implement/domain/messages.ts +58 -0
  166. package/src/crews/dev-implement/domain/prompts.ts +93 -0
  167. package/src/crews/dev-implement/domain/roles.ts +3 -7
  168. package/src/crews/dev-implement/domain/sheet-edits.ts +6 -5
  169. package/src/crews/dev-implement/domain/sheet-ticks.ts +5 -4
  170. package/src/crews/dev-implement/domain/step-checks.ts +17 -16
  171. package/src/crews/dev-implement/domain/step-section.ts +6 -4
  172. package/src/crews/dev-learn/application/learn-prompt-fit.ts +63 -0
  173. package/src/crews/dev-learn/application/messages.ts +51 -0
  174. package/src/crews/dev-learn/application/{learn-prompt.ts → prompts.ts} +24 -65
  175. package/src/crews/dev-learn/application/run-dev-learn.ts +37 -32
  176. package/src/crews/dev-learn/crew.ork.ts +4 -3
  177. package/src/crews/dev-learn/domain/learn-answer.ts +25 -27
  178. package/src/crews/dev-learn/domain/messages.ts +65 -0
  179. package/src/crews/dev-learn/domain/owner-lines.ts +12 -9
  180. package/src/crews/dev-learn/domain/proposals-render.ts +8 -9
  181. package/src/crews/dev-plan/application/anchor-paths.ts +57 -20
  182. package/src/crews/dev-plan/application/inventory.ts +17 -13
  183. package/src/crews/dev-plan/application/messages.ts +88 -0
  184. package/src/crews/dev-plan/application/plan-prompt-fit.ts +44 -0
  185. package/src/crews/dev-plan/application/{plan-prompt.ts → prompts.ts} +37 -55
  186. package/src/crews/dev-plan/application/run-dev-plan.ts +103 -75
  187. package/src/crews/dev-plan/crew.ork.ts +11 -8
  188. package/src/crews/dev-plan/domain/inventory-model.ts +3 -3
  189. package/src/crews/dev-plan/domain/markers.ts +18 -0
  190. package/src/crews/dev-plan/domain/messages.ts +118 -0
  191. package/src/crews/dev-plan/domain/plan-answer.ts +118 -103
  192. package/src/crews/dev-plan/domain/plan-render.ts +30 -31
  193. package/src/crews/dev-plan/domain/prompts.ts +44 -0
  194. package/src/crews/dev-spec/application/messages.ts +30 -0
  195. package/src/crews/dev-spec/application/{spec-prompt.ts → prompts.ts} +42 -47
  196. package/src/crews/dev-spec/application/run-dev-spec.ts +67 -36
  197. package/src/crews/dev-spec/application/spec-material.ts +42 -0
  198. package/src/crews/dev-spec/crew.ork.ts +11 -9
  199. package/src/crews/dev-spec/domain/markers.ts +30 -0
  200. package/src/crews/dev-spec/domain/messages.ts +39 -0
  201. package/src/crews/dev-spec/domain/spec-answer.ts +46 -47
  202. package/src/crews/dev-spec/domain/spec-render.ts +18 -18
  203. package/src/crews/dev-verify/application/audit-brief.ts +187 -0
  204. package/src/crews/dev-verify/application/audit.ts +38 -30
  205. package/src/crews/dev-verify/application/capture.ts +34 -26
  206. package/src/crews/dev-verify/application/messages.ts +119 -0
  207. package/src/crews/dev-verify/application/prompts.ts +209 -0
  208. package/src/crews/dev-verify/application/run-dev-verify.ts +60 -46
  209. package/src/crews/dev-verify/application/run-gate.ts +11 -9
  210. package/src/crews/dev-verify/crew.ork.ts +6 -6
  211. package/src/crews/dev-verify/domain/audit-answer.ts +16 -12
  212. package/src/crews/dev-verify/domain/capture-sections.ts +5 -4
  213. package/src/crews/dev-verify/domain/commands.ts +3 -3
  214. package/src/crews/dev-verify/domain/gate.ts +21 -16
  215. package/src/crews/dev-verify/domain/markers.ts +16 -0
  216. package/src/crews/dev-verify/domain/mechanical-table.ts +37 -44
  217. package/src/crews/dev-verify/domain/messages.ts +92 -0
  218. package/src/crews/dev-verify/domain/verdict.ts +4 -4
  219. package/src/crews/git-commit/application/draft.ts +16 -37
  220. package/src/crews/git-commit/application/messages.ts +15 -0
  221. package/src/crews/git-commit/application/prompts.ts +47 -0
  222. package/src/crews/git-commit/application/run-git-commit.ts +13 -12
  223. package/src/crews/git-commit/crew.ork.ts +5 -4
  224. package/src/crews/git-commit/domain/commit.ts +15 -35
  225. package/src/crews/git-commit/domain/markers.ts +4 -0
  226. package/src/crews/git-commit/domain/messages.ts +48 -0
  227. package/src/crews/init-verifiers/application/authoring.ts +2 -1
  228. package/src/crews/init-verifiers/application/messages.ts +13 -0
  229. package/src/crews/init-verifiers/application/prompts.ts +5 -1
  230. package/src/crews/init-verifiers/application/run-init-verifiers.ts +3 -2
  231. package/src/crews/init-verifiers/crew.ork.ts +5 -4
  232. package/src/crews/main-loop/application/auto-compact.ts +2 -1
  233. package/src/crews/main-loop/application/messages.ts +81 -0
  234. package/src/crews/main-loop/application/prompts.ts +12 -0
  235. package/src/crews/main-loop/application/run-main-loop.ts +63 -30
  236. package/src/crews/main-loop/application/{turn-prompt.ts → turn-context.ts} +7 -8
  237. package/src/crews/main-loop/crew.ork.ts +12 -7
  238. package/src/crews/main-loop/domain/prompt-assembly.ts +45 -228
  239. package/src/crews/main-loop/domain/prompts.ts +336 -0
  240. package/src/crews/main-loop/domain/turn-chains.ts +10 -9
  241. package/src/crews/project-init/application/detect.ts +5 -4
  242. package/src/crews/project-init/application/messages.ts +15 -0
  243. package/src/crews/project-init/application/prompts.ts +11 -7
  244. package/src/crews/project-init/crew.ork.ts +5 -4
  245. package/src/crews/project-init/domain/existing-files.ts +6 -4
  246. package/src/crews/project-init/domain/messages.ts +13 -0
  247. package/src/crews/project-init/domain/package-map.ts +3 -3
  248. package/src/crews/project-init/domain/prompts.ts +10 -0
  249. package/src/crews/session-compact/application/prompts.ts +5 -0
  250. package/src/crews/session-compact/crew.ork.ts +5 -4
  251. package/src/crews/shared-memory-admit/application/prompts.ts +5 -0
  252. package/src/crews/shared-memory-admit/crew.ork.ts +3 -2
  253. package/src/crews/speech/application/messages.ts +3 -0
  254. package/src/crews/speech/application/prompts.ts +3 -0
  255. package/src/crews/speech/application/run-speech.ts +2 -1
  256. package/src/crews/speech/crew.ork.ts +2 -1
  257. package/src/shared/application/agents/child-agent.ts +11 -7
  258. package/src/shared/application/agents/messages.ts +35 -0
  259. package/src/shared/application/agents/route-agent.ts +115 -0
  260. package/src/shared/application/agents/run-sub-agent.ts +31 -8
  261. package/src/shared/application/compaction/compact-session.ts +19 -14
  262. package/src/shared/application/compaction/messages.ts +20 -0
  263. package/src/shared/application/compaction/prune-context.ts +94 -0
  264. package/src/shared/application/compaction/pruned-llm.ts +35 -0
  265. package/src/shared/application/dev/brief-inventory.ts +6 -4
  266. package/src/shared/application/dev/close-batch.ts +9 -7
  267. package/src/shared/application/dev/find-repo-pack.ts +4 -3
  268. package/src/shared/application/dev/learn-decision.ts +20 -18
  269. package/src/shared/application/dev/load-dev-context.ts +7 -8
  270. package/src/shared/application/dev/measure-access-cost.ts +5 -4
  271. package/src/shared/application/dev/messages.ts +132 -0
  272. package/src/shared/application/dev/phase-timer.ts +54 -0
  273. package/src/shared/application/dev/plan-source.ts +12 -8
  274. package/src/shared/application/dev/preflight.ts +8 -8
  275. package/src/shared/application/dev/prompts.ts +34 -0
  276. package/src/shared/application/dev/question-round.ts +25 -17
  277. package/src/shared/application/dev/resolve-work-folder.ts +4 -3
  278. package/src/shared/application/dev/settle-questions.ts +4 -2
  279. package/src/shared/application/dev/source-review.ts +12 -8
  280. package/src/shared/application/dev/source-step.ts +12 -10
  281. package/src/shared/application/dev/spend.ts +17 -4
  282. package/src/shared/application/dev/step-precedents.ts +2 -1
  283. package/src/shared/application/dev/tool-call-policy.ts +9 -11
  284. package/src/shared/application/dev/tool-callbacks.ts +52 -5
  285. package/src/shared/application/dev/tool-trace-recorder.ts +2 -1
  286. package/src/shared/application/dev/verdict-sources.ts +5 -3
  287. package/src/shared/application/dev/wrapped-tools.ts +4 -2
  288. package/src/shared/application/extra-tools.ts +2 -1
  289. package/src/shared/application/git/batch-worktree.ts +22 -17
  290. package/src/shared/application/git/commit-files.ts +24 -19
  291. package/src/shared/application/git/merge-batch.ts +11 -7
  292. package/src/shared/application/git/messages.ts +75 -0
  293. package/src/shared/application/git/open-pull-request.ts +4 -3
  294. package/src/shared/application/host-context.ts +59 -0
  295. package/src/shared/application/host-layout-store.ts +45 -0
  296. package/src/shared/application/llm-profile.ts +4 -3
  297. package/src/shared/application/messages.ts +14 -0
  298. package/src/shared/application/permission-rules.ts +10 -0
  299. package/src/shared/application/ports/decision.ts +14 -0
  300. package/src/shared/application/ports/human.ts +25 -0
  301. package/src/shared/application/ports/llm.ts +32 -3
  302. package/src/shared/application/ports/memory.ts +1 -1
  303. package/src/shared/application/ports/theme.ts +11 -0
  304. package/src/shared/application/ports.ts +4 -2
  305. package/src/shared/application/session-io.ts +2 -1
  306. package/src/shared/application/shared-memory/admit-entries.ts +16 -14
  307. package/src/shared/application/shared-memory/harvest-after-gaps.ts +5 -8
  308. package/src/shared/application/shared-memory/harvest-mistakes.ts +3 -2
  309. package/src/shared/application/shared-memory/import-agent-memory.ts +9 -7
  310. package/src/shared/application/shared-memory/memory-files.ts +2 -1
  311. package/src/shared/application/shared-memory/memory-settings.ts +2 -1
  312. package/src/shared/application/shared-memory/messages.ts +63 -0
  313. package/src/shared/application/shared-memory/push-candidate.ts +14 -11
  314. package/src/shared/application/shared-memory/recall-precedents.ts +2 -1
  315. package/src/shared/application/skills/messages.ts +4 -0
  316. package/src/shared/application/skills/suggest-skills.ts +102 -0
  317. package/src/shared/application/workflow/messages.ts +8 -0
  318. package/src/shared/application/workflow/workflow-state.ts +7 -6
  319. package/src/shared/domain/agent-policy/behavior-flags.ts +4 -10
  320. package/src/shared/domain/agent-policy/extra-tools.ts +2 -4
  321. package/src/shared/domain/agent-policy/messages.ts +66 -0
  322. package/src/shared/domain/agent-policy/path-rules.ts +299 -0
  323. package/src/shared/domain/agent-policy/permission.ts +20 -18
  324. package/src/shared/domain/agent-policy/prompts.ts +17 -0
  325. package/src/shared/domain/agent-policy/reasoning.ts +59 -0
  326. package/src/shared/domain/agent-policy/rule-sets.ts +18 -14
  327. package/src/shared/domain/agent-policy/tool-access.ts +17 -3
  328. package/src/shared/domain/agent-registry.ts +6 -5
  329. package/src/shared/domain/agents/chain.ts +2 -2
  330. package/src/shared/domain/agents/charter.ts +8 -5
  331. package/src/shared/domain/agents/exclusive.ts +2 -1
  332. package/src/shared/domain/agents/instances.ts +18 -15
  333. package/src/shared/domain/agents/messages.ts +39 -0
  334. package/src/shared/domain/agents/model-route.ts +199 -0
  335. package/src/shared/domain/agents/prompts.ts +20 -0
  336. package/src/shared/domain/code-intel-contract.ts +5 -4
  337. package/src/shared/domain/code-intel-routing.ts +8 -61
  338. package/src/shared/domain/compact-outcome.ts +5 -3
  339. package/src/shared/domain/compaction-thresholds.ts +2 -1
  340. package/src/shared/domain/compaction.ts +22 -113
  341. package/src/shared/domain/config-schema.ts +94 -81
  342. package/src/shared/domain/context-prune.ts +176 -0
  343. package/src/shared/domain/decision/questions.ts +102 -0
  344. package/src/shared/domain/dev/access-cost.ts +19 -15
  345. package/src/shared/domain/dev/batches-concurrency.ts +5 -6
  346. package/src/shared/domain/dev/build-commands.ts +5 -4
  347. package/src/shared/domain/dev/call-guard.ts +29 -28
  348. package/src/shared/domain/dev/carried-text.ts +3 -5
  349. package/src/shared/domain/dev/learn-proposals.ts +5 -4
  350. package/src/shared/domain/dev/learn-state.ts +3 -2
  351. package/src/shared/domain/dev/markers.ts +107 -0
  352. package/src/shared/domain/dev/messages.ts +259 -0
  353. package/src/shared/domain/dev/phase-timing.ts +50 -0
  354. package/src/shared/domain/dev/plan-checks.ts +24 -23
  355. package/src/shared/domain/dev/plan-format.ts +14 -24
  356. package/src/shared/domain/dev/project-files.ts +1 -15
  357. package/src/shared/domain/dev/prompts/brief-blocks.ts +20 -0
  358. package/src/shared/domain/dev/{review-prompt.ts → prompts.ts} +91 -61
  359. package/src/shared/domain/dev/questions.ts +33 -15
  360. package/src/shared/domain/dev/repo-pack.ts +12 -9
  361. package/src/shared/domain/dev/review-answer.ts +40 -17
  362. package/src/shared/domain/dev/review-brief.ts +54 -0
  363. package/src/shared/domain/dev/reviewer-charter.ts +4 -0
  364. package/src/shared/domain/dev/sheet-facts.ts +2 -4
  365. package/src/shared/domain/dev/spec-format.ts +13 -14
  366. package/src/shared/domain/dev/step-budget.ts +4 -2
  367. package/src/shared/domain/dev/step-rules.ts +3 -4
  368. package/src/shared/domain/dev/test-commands.ts +14 -10
  369. package/src/shared/domain/dev/tool-guards.ts +4 -3
  370. package/src/shared/domain/dev/trait-pattern.ts +14 -10
  371. package/src/shared/domain/dev/verdict-format.ts +14 -21
  372. package/src/shared/domain/dev/whitespace.ts +3 -2
  373. package/src/shared/domain/dev/work-folder.ts +4 -3
  374. package/src/shared/domain/dev/yaml-subset.ts +8 -26
  375. package/src/shared/domain/error-text.ts +13 -0
  376. package/src/shared/domain/git/close.ts +5 -4
  377. package/src/shared/domain/git/messages.ts +20 -0
  378. package/src/shared/domain/git/pull-request.ts +5 -5
  379. package/src/shared/domain/host-layout.ts +147 -0
  380. package/src/shared/domain/host-paths.ts +399 -0
  381. package/src/shared/domain/llm-failure.ts +35 -7
  382. package/src/shared/domain/llm-profile.ts +22 -3
  383. package/src/shared/domain/marked-message.ts +1 -5
  384. package/src/shared/domain/markers.ts +30 -0
  385. package/src/shared/domain/messages.ts +291 -0
  386. package/src/shared/domain/model-catalog.ts +2 -9
  387. package/src/shared/domain/permission-modes.ts +4 -8
  388. package/src/shared/domain/prelude.ts +2 -2
  389. package/src/shared/domain/project-manifests.ts +3 -2
  390. package/src/shared/domain/prompts.ts +233 -0
  391. package/src/shared/domain/search-routing.ts +3 -11
  392. package/src/shared/domain/secret-patterns.ts +3 -2
  393. package/src/shared/domain/session-keys.ts +7 -0
  394. package/src/shared/domain/session-start.ts +3 -2
  395. package/src/shared/domain/shared-memory/agent-memory-import.ts +4 -2
  396. package/src/shared/domain/shared-memory/candidates.ts +3 -4
  397. package/src/shared/domain/shared-memory/entry.ts +26 -20
  398. package/src/shared/domain/shared-memory/front-matter.ts +17 -13
  399. package/src/shared/domain/shared-memory/gate.ts +4 -3
  400. package/src/shared/domain/shared-memory/harvest.ts +9 -6
  401. package/src/shared/domain/shared-memory/layout.ts +11 -8
  402. package/src/shared/domain/shared-memory/markers.ts +9 -0
  403. package/src/shared/domain/shared-memory/messages.ts +66 -0
  404. package/src/shared/domain/shared-memory/precedents-block.ts +4 -15
  405. package/src/shared/domain/shared-memory/prompts.ts +28 -0
  406. package/src/shared/domain/shared-memory/refused.ts +3 -3
  407. package/src/shared/domain/skills/prompts.ts +4 -0
  408. package/src/shared/domain/skills/shortlist.ts +149 -0
  409. package/src/shared/domain/snip-turns.ts +2 -14
  410. package/src/shared/domain/speech.ts +2 -1
  411. package/src/shared/domain/tool-trace.ts +5 -7
  412. package/src/shared/domain/verifiers.ts +7 -11
  413. package/src/shared/domain/vfs.ts +8 -1
  414. package/src/shared/domain/workflow/prompts.ts +15 -0
  415. package/src/shared/domain/workflow/state-file.ts +14 -12
  416. package/src/shared/infrastructure/globals.ts +7 -2
  417. package/src/shared/infrastructure/orkeon/child-agents.ts +11 -16
  418. package/src/shared/infrastructure/orkeon/chooser.ts +32 -0
  419. package/src/shared/infrastructure/orkeon/decision-model.ts +31 -0
  420. package/src/shared/infrastructure/orkeon/dev-deps.ts +21 -14
  421. package/src/shared/infrastructure/orkeon/files.ts +24 -6
  422. package/src/shared/infrastructure/orkeon/github-pull-requests.ts +3 -2
  423. package/src/shared/infrastructure/orkeon/host-context.ts +36 -0
  424. package/src/shared/infrastructure/orkeon/human-input.ts +1 -5
  425. package/src/shared/infrastructure/orkeon/llm-profile.ts +36 -16
  426. package/src/shared/infrastructure/orkeon/llm.ts +85 -30
  427. package/src/shared/infrastructure/orkeon/markers.ts +6 -0
  428. package/src/shared/infrastructure/orkeon/memory-store.ts +1 -1
  429. package/src/shared/infrastructure/orkeon/memory-tools.ts +18 -20
  430. package/src/shared/infrastructure/orkeon/messages.ts +15 -0
  431. package/src/shared/infrastructure/orkeon/prompts.ts +47 -0
  432. package/src/shared/infrastructure/orkeon/reasoning.ts +40 -0
  433. package/src/shared/infrastructure/orkeon/script-tools.ts +14 -19
  434. package/src/shared/infrastructure/orkeon/session-store.ts +7 -51
  435. package/src/shared/infrastructure/orkeon/shell-jobs.ts +13 -7
  436. package/src/shared/infrastructure/orkeon/shell.ts +13 -5
  437. package/src/shared/infrastructure/orkeon/tool-catalogue.ts +3 -2
  438. package/src/shared/infrastructure/orkeon/wiring.ts +68 -12
  439. package/src/crews/dev-verify/application/auditor-prompt.ts +0 -323
  440. package/src/shared/domain/session-summary.ts +0 -13
@@ -57,6 +57,18 @@ import type { PrContext } from "./touched.ts";
57
57
  import { closeDevBatch } from "./close.ts";
58
58
  import { BATCHES_ACTIVE_RECORD, batchesRunCode } from "../../../shared/domain/dev/batches-state.ts";
59
59
  import { WORKSPACE, workspaceRelative } from "../../../shared/domain/vfs.ts";
60
+ import { askCostLine } from "./prompts.ts";
61
+ import {
62
+ BUILD_LINE_NOT_RUN, FAILURE_NOT_CHECKED, NO_PRODUCTION_CHANGED, NO_REPOSITORY_PACK, NO_TEST_LAYOUT, SHEET_PUT_BACK, TEST_NOT_RUN,
63
+ WHOLE_SUITE_EVERY_TEST, WHOLE_SUITE_NO_TEST_PROJECT, affectedDone, affectedExited, affectedRefused, affectedStillRunning, firstAndMore,
64
+ assumptionsNotWritten, assumptionsWritten, batchGreen, batchIsFn, blockedLine, buildDone, buildExited, buildRefused,
65
+ buildStillRunning, cannotBeReadColonReason, correctionAppended, correctionProblem, correctionStillOpen, costDone, costFlagged, costMeasured,
66
+ measuredNotComputed, gapsRoundsWarned, graphAdded, graphNotRead, graphProjectsLeftOut, greenDone, indexNotIndexed, indexNotRefreshed,
67
+ indexRefreshed, indexReindexFailed, notPushedInRun, notRun, readOnlyMode, readOnlyModeAtClose, redDone, restoreCouldNotRun,
68
+ restored, restoreExited, restoreNoVerdict, restoreRefused, restoreStillRunning, roleChangedPlanFolder, runTitle, sheetMalformed,
69
+ sheetNotPutBack, sheetNotWritten, shownLog, stepActProblem, testDone, testExited, testRefused, testStillRunning, whitespaceFixed,
70
+ whitespaceNotWritten, wholeSuiteUnplaced, workFolderOutsideMounts,
71
+ } from "./messages.ts";
60
72
 
61
73
  export interface DevImplementInputs {
62
74
  batch?: unknown; plan?: unknown; close?: unknown; pr?: unknown; push?: unknown;
@@ -118,7 +130,7 @@ const GAPS_ROUNDS_WARNED = 2;
118
130
 
119
131
  const answer = (lines: string[], next?: ImplementAnswer["next"]): string =>
120
132
  JSON.stringify(next === undefined ? { lines } : { lines, next });
121
- const blocked = (lines: string[], line: string): string => answer([...lines, `BLOCKED — ${line}`]);
133
+ const blocked = (lines: string[], line: string): string => answer([...lines, blockedLine(line)]);
122
134
  const reasonOf = (e: unknown): string => String((e as Error)?.message ?? e).split("\n")[0];
123
135
 
124
136
  interface Run {
@@ -174,7 +186,7 @@ async function writeSheet(run: Run, text: string): Promise<string | null> {
174
186
  try {
175
187
  await run.deps.files.write(run.sheetPath, text);
176
188
  } catch (e) {
177
- return `the sheet could not be written: ${reasonOf(e)}`;
189
+ return sheetNotWritten(reasonOf(e));
178
190
  }
179
191
  run.sheetText = text;
180
192
  return null;
@@ -201,8 +213,8 @@ async function keepAssumptions(run: Run, text: string): Promise<void> {
201
213
  if (added.length === 0) return;
202
214
  const failed = await writeSheet(run, next);
203
215
  run.lines.push(failed === null
204
- ? `assumption${added.length === 1 ? "" : "s"} written to ## Assumptions, to be validated by the user: ${added.join("; ")}`
205
- : `⚠ assumptions not written (${failed}): ${added.join("; ")}`);
216
+ ? assumptionsWritten(added)
217
+ : assumptionsNotWritten(failed, added));
206
218
  }
207
219
 
208
220
  /** A path a write tool named, relative to /workspace. */
@@ -221,9 +233,9 @@ async function sheetPutBack(run: Run): Promise<string | null> {
221
233
  if (now === run.sheetText) return null;
222
234
  try {
223
235
  await run.deps.files.write(run.sheetPath, run.sheetText);
224
- return "the sheet was changed by the role, and put back";
236
+ return SHEET_PUT_BACK;
225
237
  } catch (e) {
226
- return `the sheet was changed by the role and could not be put back: ${reasonOf(e)}`;
238
+ return sheetNotPutBack(reasonOf(e));
227
239
  }
228
240
  }
229
241
 
@@ -244,7 +256,7 @@ async function act(
244
256
  .filter((p) => under(p, run.planFolder) && !under(p, run.planLogs)).sort();
245
257
  const putBack = await sheetPutBack(run);
246
258
  if (planChanges.length > 0 || putBack !== null) {
247
- return `${role} changed the plan folder (${planChanges.join(", ") || run.located.name}): the sheet and the plan are code's own${putBack === null ? "" : `; ${putBack}`}`;
259
+ return roleChangedPlanFolder(role, planChanges.join(", ") || run.located.name, putBack);
248
260
  }
249
261
  if (!said.ok) return said.reason;
250
262
  if (!after.ok) return after.problem;
@@ -272,9 +284,9 @@ async function tidyChanged(run: Run, changed: readonly string[]): Promise<void>
272
284
  if (tidy.fixed.length === 0) continue;
273
285
  try {
274
286
  await run.deps.files.write(`${WORKSPACE}/${path}`, tidy.text);
275
- run.lines.push(`whitespace ✓ — ${path}: ${tidy.fixed.join(", ")}`);
287
+ run.lines.push(whitespaceFixed(path, tidy.fixed));
276
288
  } catch (error) {
277
- run.lines.push(`⚠ whitespace — ${path}: ${tidy.fixed.join(", ")}, not written (${error instanceof Error ? error.message.split("\n")[0] : String(error)})`);
289
+ run.lines.push(whitespaceNotWritten(path, tidy.fixed, error instanceof Error ? error.message.split("\n")[0] : String(error)));
278
290
  }
279
291
  }
280
292
  }
@@ -322,13 +334,13 @@ async function costFiles(run: Run, paths: readonly string[]): Promise<CostFile[]
322
334
  /** The measured cost of the cycle's production changes, after its stated Cost line passed: a problem when the
323
335
  * measure flags a port call or a memory filter on an added line; else the line it adds to the run's. */
324
336
  async function measuredCost(run: Run, production: readonly string[]): Promise<{ problem: string } | { line: string }> {
325
- if (production.length === 0) return { line: "measured: not computed — no production file changed in this run" };
337
+ if (production.length === 0) return { line: NO_PRODUCTION_CHANGED };
326
338
  const cost = await measureAccessCost(run.deps.costIndex, run.pack, [], await costFiles(run, production), run.isTest);
327
- if (cost.state === "not-computed") return { line: `measured: not computed — ${cost.reason}` };
339
+ if (cost.state === "not-computed") return { line: measuredNotComputed(cost.reason) };
328
340
  if (cost.exit === 2) {
329
- return { problem: `measured ${cost.costLine}; flagged: ${cost.flagged.join("; ")} — back to /dev-plan (the design names the access, the code cannot move it)` };
341
+ return { problem: costFlagged(cost.costLine, cost.flagged) };
330
342
  }
331
- return { line: `measured: ${cost.costLine}` };
343
+ return { line: costMeasured(cost.costLine) };
332
344
  }
333
345
 
334
346
  /** The step's `to create` production paths that are still to create: neither written in this run nor present in the
@@ -401,31 +413,31 @@ async function runCycle(run: Run, cycle: Cycle): Promise<string | null> {
401
413
  const t3 = await recallForRed(run, step);
402
414
  const carried = await carriedFor(run, [testFileOf(step)]);
403
415
  const done = await act(run, "test-author", withPrecedents(redContract({ ...contractInput(run, step, command.command, carried), stubs }), [t3, run.correction, run.stale]), stubs);
404
- if (typeof done === "string") return `step ${step.number} RED: ${done}`;
416
+ if (typeof done === "string") return stepActProblem(step.number, "RED", done);
405
417
  run.ran.push(step);
406
418
  const earlier = before;
407
419
  red = await run.tools.runTests({ command: command.command });
408
420
  const problem = redProblem(done.changed, run.isTest, observedRun(red), stubs);
409
- if (problem !== null) return `step ${step.number} RED: ${problem}${logOf(red)}`;
421
+ if (problem !== null) return stepActProblem(step.number, "RED", `${problem}${logOf(red)}`);
410
422
  // A later step of the cycle: its file failed already, so its own tests must add a failure.
411
423
  const added = earlier !== null && red.ok ? addedFailure(earlier, red.tail) : "ok";
412
- if (typeof added === "object") return `step ${step.number} RED: ${added.problem}${logOf(red)}`;
424
+ if (typeof added === "object") return stepActProblem(step.number, "RED", `${added.problem}${logOf(red)}`);
413
425
  done.changed.forEach((p) => { run.touched.add(p); if (!run.isTest(p)) production.add(p); });
414
426
  const failed = await tick(run, step, "RED");
415
- if (failed !== null) return `step ${step.number} RED: ${failed}`;
427
+ if (failed !== null) return stepActProblem(step.number, "RED", failed);
416
428
  before = red.ok ? red.tail : null;
417
429
  await recordRedCount(run, step, red.ok ? failureCount(red.tail) : null);
418
430
  const wroteStubs = done.changed.filter((p) => !run.isTest(p));
419
431
  wroteStubs.forEach((p) => stubbed.add(p));
420
- const unchecked = added === "unknown" ? " (its own failure not checked: the run's tail shows no failure count)" : "";
421
- run.lines.push(`step ${step.number} RED ✓ — ${done.changed.filter(run.isTest).join(", ")}${wroteStubs.length === 0 ? "" : ` (stubs: ${wroteStubs.join(", ")})`}${unchecked}`);
432
+ const unchecked = added === "unknown" ? FAILURE_NOT_CHECKED : "";
433
+ run.lines.push(redDone(step.number, done.changed.filter(run.isTest).join(", "), wroteStubs, unchecked));
422
434
  }
423
435
 
424
436
  let costText: string | null = null;
425
437
  const green = steps.filter((s) => !s.tdd?.green);
426
438
  if (green.length > 0) {
427
439
  red ??= await run.tools.runTests({ command: command.command });
428
- const redTail = red.ok ? { tail: red.tail, log: red.log } : { tail: `(not run: ${red.refused})`, log: null };
440
+ const redTail = red.ok ? { tail: red.tail, log: red.log } : { tail: notRun(red.refused), log: null };
429
441
  const greenLabel = stepsLabel(green);
430
442
  // The production files too: a stub RED wrote, an existing module, so that GREEN opens none of them.
431
443
  const productionFiles = green.flatMap((s) => (s.anchor?.production ?? []).filter((r) => r.state !== "member").map((r) => r.path));
@@ -439,7 +451,7 @@ async function runCycle(run: Run, cycle: Cycle): Promise<string | null> {
439
451
  done.changed.forEach((p) => { run.touched.add(p); production.add(p); });
440
452
  const failed = await tickAll(run, green, "GREEN");
441
453
  if (failed !== null) return `${greenLabel} GREEN: ${failed}`;
442
- run.lines.push(`${greenLabel} GREEN ✓ — ${done.changed.join(", ") || "no file changed"}`);
454
+ run.lines.push(greenDone(greenLabel, done.changed.join(", ")));
443
455
  costText = done.text;
444
456
  }
445
457
 
@@ -449,8 +461,7 @@ async function runCycle(run: Run, cycle: Cycle): Promise<string | null> {
449
461
  let cost = readCost(costText ?? "");
450
462
  if (!cost.ok && cost.line === undefined) {
451
463
  const asked = await askLine(run.deps.roleLlm("implementer", run.pack.layout, run.wrote, []), IMPLEMENTER,
452
- `${label[0].toUpperCase()}${label.slice(1)} of ${run.located.code} ${run.sheet.batch}: answer with one line only, ` +
453
- "`Cost: <reads> reads, <writes> writes; <where a port call sits in a loop, a lambda or a memory filter, or none>`.");
464
+ askCostLine(`${label[0].toUpperCase()}${label.slice(1)}`, run.located.code, run.sheet.batch));
454
465
  if (!asked.ok) return `${costLabel} COST: ${asked.reason}`;
455
466
  cost = readCost(asked.text);
456
467
  }
@@ -459,16 +470,16 @@ async function runCycle(run: Run, cycle: Cycle): Promise<string | null> {
459
470
  if ("problem" in measured) return `${costLabel} COST: ${measured.problem}`;
460
471
  const failed = await tickAll(run, costed, "COST");
461
472
  if (failed !== null) return `${costLabel} COST: ${failed}`;
462
- run.lines.push(`${costLabel} COST ✓ — ${cost.line}; ${measured.line}`);
473
+ run.lines.push(costDone(costLabel, cost.line, measured.line));
463
474
  }
464
475
  return null;
465
476
  }
466
477
 
467
478
  function logOf(run: WrappedRun): string {
468
- return run.ok && run.log !== null ? ` (log: ${run.log.replace(`${WORKSPACE}/`, "")})` : "";
479
+ return run.ok && run.log !== null ? shownLog(run.log.replace(`${WORKSPACE}/`, "")) : "";
469
480
  }
470
481
 
471
- const shownPath = (path: string | null): string => (path === null ? "" : ` (log: ${path.replace(`${WORKSPACE}/`, "")})`);
482
+ const shownPath = (path: string | null): string => (path === null ? "" : shownLog(path.replace(`${WORKSPACE}/`, "")));
472
483
 
473
484
  /** The pack's restore, once, before any act: true when it ran green, null when the pack has none. */
474
485
  async function restore(
@@ -477,23 +488,23 @@ async function restore(
477
488
  const command = run.pack.commands.restore?.trim();
478
489
  if (!command) return { restored: false };
479
490
  const refusal = shellRuleGuard(stepRules("dev-implement"))(command);
480
- if (refusal !== null) return { problem: `restore: ${refusal}` };
491
+ if (refusal !== null) return { problem: restoreRefused(refusal) };
481
492
  let r;
482
493
  try {
483
494
  r = await run.deps.shell.run(command, { timeoutSeconds: RESTORE_TIMEOUT_SECONDS });
484
495
  } catch (e) {
485
- return { problem: `restore: '${command}' could not run: ${reasonOf(e)}` };
496
+ return { problem: restoreCouldNotRun(command, reasonOf(e)) };
486
497
  }
487
498
  const log = `${run.logFolder}/${batch}-restore.txt`;
488
499
  const output = [r.stdout.trimEnd(), r.stderr.trimEnd()].filter((t) => t !== "").join("\n");
489
500
  try {
490
- await run.deps.files.write(log, logText(command, r.timedOut === true ? [`still running after ${RESTORE_TIMEOUT_SECONDS} s: no verdict`] : [], output, r.timedOut === true ? NO_VERDICT_EXIT : r.exitCode));
501
+ await run.deps.files.write(log, logText(command, r.timedOut === true ? [restoreNoVerdict(RESTORE_TIMEOUT_SECONDS)] : [], output, r.timedOut === true ? NO_VERDICT_EXIT : r.exitCode));
491
502
  } catch {
492
503
  // the log is a help, never a verdict
493
504
  }
494
- if (r.timedOut === true) return { problem: `restore: '${command}' still running after ${RESTORE_TIMEOUT_SECONDS} s` };
495
- if (r.exitCode !== 0) return { problem: `restore: '${command}' exited ${r.exitCode}${shownPath(log)}` };
496
- run.lines.push(`restored once: ${command}`);
505
+ if (r.timedOut === true) return { problem: restoreStillRunning(command, RESTORE_TIMEOUT_SECONDS) };
506
+ if (r.exitCode !== 0) return { problem: restoreExited(command, r.exitCode, shownPath(log)) };
507
+ run.lines.push(restored(command));
497
508
  return { restored: true };
498
509
  }
499
510
 
@@ -542,19 +553,19 @@ async function refreshIndex(run: Run): Promise<boolean> {
542
553
  try {
543
554
  const roots = (await index.roots()).map((r) => (r.length > 1 ? r.replace(/\/+$/, "") : r));
544
555
  if (!roots.includes(WORKSPACE)) {
545
- run.lines.push(`index: not refreshed — ${WORKSPACE} is not indexed`);
556
+ run.lines.push(indexNotIndexed(WORKSPACE));
546
557
  return false;
547
558
  }
548
559
  const errors = await index.refresh(WORKSPACE, files);
549
560
  if (errors.length > 0) {
550
- run.lines.push(`index: not refreshed — incremental_reindex: ${reasonOf(errors[0])}`);
561
+ run.lines.push(indexReindexFailed(reasonOf(errors[0])));
551
562
  return false;
552
563
  }
553
564
  } catch (e) {
554
- run.lines.push(`index: not refreshed — ${reasonOf(e)}`);
565
+ run.lines.push(indexNotRefreshed(reasonOf(e)));
555
566
  return false;
556
567
  }
557
- run.lines.push(`index: ${files.length} file${files.length === 1 ? "" : "s"} of ${run.sheet.batch} refreshed`);
568
+ run.lines.push(indexRefreshed(files.length, run.sheet.batch));
558
569
  return true;
559
570
  }
560
571
 
@@ -567,7 +578,7 @@ async function graphAffected(run: Run): Promise<AffectedTests | null> {
567
578
  // Relative to the indexed root: affected_tests looks each file up as `<root>/<file>`, an absolute path never resolves.
568
579
  return await index.affected([...run.touched].sort());
569
580
  } catch (e) {
570
- run.lines.push(`affected tests: the graph was not read — ${reasonOf(e)}; the sheet's projects alone`);
581
+ run.lines.push(graphNotRead(reasonOf(e)));
571
582
  return null;
572
583
  }
573
584
  }
@@ -581,74 +592,74 @@ async function suites(run: Run, suiteGreen: boolean): Promise<SuiteResult> {
581
592
  // The tree changed whatever the build says: the index is refreshed first, so a red build leaves no stale graph.
582
593
  const indexed = await refreshIndex(run);
583
594
  const build = run.pack.commands.build?.trim();
584
- if (!build) run.lines.push("build: not run — the pack has no commands.build");
595
+ if (!build) run.lines.push(BUILD_LINE_NOT_RUN);
585
596
  else {
586
597
  const refusal = guard(build);
587
- if (refusal !== null) return { problem: `build: ${refusal}` };
598
+ if (refusal !== null) return { problem: buildRefused(refusal) };
588
599
  const outcome = await oneSuite(run, "build", build, `${run.logFolder}/${batch}-build.txt`);
589
600
  if (outcome.status === "not-run") return { problem: outcome.reason };
590
- if (outcome.status === "running") return { problem: `build still running after ${outcome.seconds} s${shownPath(outcome.log)}` };
591
- if (outcome.status === "failed") return { problem: `build: '${build}' exited ${outcome.exit}${shownPath(outcome.log)}\n${outcome.tail}` };
592
- run.lines.push(`build ✓ — ${build}${outcome.how === "blocking" ? " (run blocking)" : ""}${shownPath(outcome.log)}`);
601
+ if (outcome.status === "running") return { problem: buildStillRunning(outcome.seconds, shownPath(outcome.log)) };
602
+ if (outcome.status === "failed") return { problem: buildExited(build, outcome.exit, shownPath(outcome.log), outcome.tail) };
603
+ run.lines.push(buildDone(build, outcome.how === "blocking", shownPath(outcome.log)));
593
604
  }
594
605
 
595
606
  const graph = suiteGreen && indexed ? await graphAffected(run) : null;
596
607
  const affected = suiteGreen && graph?.all !== true ? affectedCommands(run, graph?.projects ?? []) : null;
597
608
  if (affected !== null && affected.leftOut.length > 0) {
598
- run.lines.push(`affected tests: the graph's projects left out, no command can be named for them — ${affected.leftOut.join("; ")}`);
609
+ run.lines.push(graphProjectsLeftOut(affected.leftOut));
599
610
  }
600
611
  if (affected !== null) {
601
612
  const texts: string[] = [];
602
613
  let exit = 0;
603
614
  for (const command of affected.commands) {
604
615
  const refusal = guard(command);
605
- if (refusal !== null) return { problem: `affected tests: ${refusal}` };
616
+ if (refusal !== null) return { problem: affectedRefused(refusal) };
606
617
  const outcome = await oneSuite(run, "affected tests", command, null);
607
618
  if (outcome.status === "not-run") return { problem: outcome.reason };
608
619
  texts.push(outcome.text.trimEnd());
609
620
  if (outcome.status === "running") {
610
621
  await writeLogQuietly(run, affectedLog, `${texts.join("\n")}\n`);
611
- return { problem: `affected tests still running after ${outcome.seconds} s${shownPath(affectedLog)}` };
622
+ return { problem: affectedStillRunning(outcome.seconds, shownPath(affectedLog)) };
612
623
  }
613
624
  if (outcome.status === "failed") {
614
625
  if (exit === 0) exit = outcome.exit;
615
626
  await writeLogQuietly(run, affectedLog, `${texts.join("\n")}\nexit=${exit}\n`);
616
- return { problem: `affected tests: '${command}' exited ${outcome.exit}${shownPath(affectedLog)}\n${outcome.tail}` };
627
+ return { problem: affectedExited(command, outcome.exit, shownPath(affectedLog), outcome.tail) };
617
628
  }
618
629
  }
619
630
  await writeLogQuietly(run, affectedLog, `${texts.join("\n")}\nexit=${exit}\n`);
620
631
  const byGraph = graph === null ? ""
621
- : `; the graph added ${affected.fromGraph.length === 0 ? "no project" : affected.fromGraph.join(", ")}${graph.classes.length === 0 ? "" : ` (${graph.classes.length} test class${graph.classes.length === 1 ? "" : "es"} reached)`}`;
622
- run.lines.push(`affected tests ✓ — ${affected.commands.join("; ")} (the whole suite went green once for ${batch}${byGraph})${shownPath(affectedLog)}`);
632
+ : graphAdded(affected.fromGraph, graph.classes.length);
633
+ run.lines.push(affectedDone(affected.commands, batch, byGraph, shownPath(affectedLog)));
623
634
  return { ok: true, whole: false };
624
635
  }
625
636
 
626
637
  const test = run.pack.commands.test?.trim();
627
638
  if (!test) {
628
- run.lines.push("test: not run — the pack has no commands.test");
639
+ run.lines.push(TEST_NOT_RUN);
629
640
  return { ok: true, whole: false };
630
641
  }
631
642
  const refusal = guard(test);
632
- if (refusal !== null) return { problem: `test: ${refusal}` };
643
+ if (refusal !== null) return { problem: testRefused(refusal) };
633
644
  // A whole-suite run empties the affected log: the audit then reads this one.
634
645
  await writeLogQuietly(run, affectedLog, "");
635
646
  const outcome = await oneSuite(run, "test", test, `${run.logFolder}/${batch}-test.txt`);
636
647
  if (outcome.status === "not-run") return { problem: outcome.reason };
637
- if (outcome.status === "running") return { problem: `test still running after ${outcome.seconds} s${shownPath(outcome.log)}` };
638
- if (outcome.status === "failed") return { problem: `test: '${test}' exited ${outcome.exit}${shownPath(outcome.log)}\n${outcome.tail}` };
648
+ if (outcome.status === "running") return { problem: testStillRunning(outcome.seconds, shownPath(outcome.log)) };
649
+ if (outcome.status === "failed") return { problem: testExited(test, outcome.exit, shownPath(outcome.log), outcome.tail) };
639
650
  const again = !suiteGreen ? ""
640
651
  : graph?.all === true && graph.unresolved.length > 0
641
- ? ` (the whole suite again: the graph could not place ${cutList(graph.unresolved)})`
642
- : graph?.all === true ? " (the whole suite again: the graph reaches every test from these changes)"
643
- : " (the whole suite again: the pack has no commands.test_project)";
644
- run.lines.push(`test ✓ — ${test}${outcome.how === "blocking" ? " (run blocking)" : ""}${again}${shownPath(outcome.log)}`);
652
+ ? wholeSuiteUnplaced(cutList(graph.unresolved))
653
+ : graph?.all === true ? WHOLE_SUITE_EVERY_TEST
654
+ : WHOLE_SUITE_NO_TEST_PROJECT;
655
+ run.lines.push(testDone(test, outcome.how === "blocking", again, shownPath(outcome.log)));
645
656
  return { ok: true, whole: true };
646
657
  }
647
658
 
648
659
  /** At most three paths, then how many more. */
649
660
  function cutList(paths: readonly string[]): string {
650
661
  const shown = paths.slice(0, 3).join(", ");
651
- return paths.length > 3 ? `${shown} and ${paths.length - 3} more` : shown;
662
+ return paths.length > 3 ? firstAndMore(shown, paths.length - 3) : shown;
652
663
  }
653
664
 
654
665
  async function writeLogQuietly(run: Run, path: string, text: string): Promise<void> {
@@ -673,18 +684,18 @@ async function verdictState(files: Pick<Files, "read">, path: string): Promise<{
673
684
 
674
685
  export async function runDevImplement(input: DevImplementInputs, deps: DevImplementDeps): Promise<string> {
675
686
  const batch = String(input.batch ?? "").trim();
676
- if (!BATCH.test(batch)) return blocked([], `the batch is F<n>, e.g. /dev-batches <code> F1: got '${batch}'`);
687
+ if (!BATCH.test(batch)) return blocked([], batchIsFn(batch));
677
688
  const plan = typeof input.plan === "string" && input.plan.trim() !== "" ? input.plan.trim() : null;
678
689
  const inputContext = prContextOf(input);
679
690
  const mode = typeof input.permissionMode === "string" ? input.permissionMode.trim() : "";
680
691
  if (mode !== "" && policyFor(mode).readOnly) {
681
- return blocked([], `the session mode ${mode} is read-only: /dev-batches writes files and commits (/mode default, then run it again)`);
692
+ return blocked([], readOnlyMode(mode));
682
693
  }
683
694
 
684
695
  const context = await loadDevContext({ files: deps.files, shell: deps.shell, config: deps.config });
685
696
  const lines = context.warnings.slice(0, 5).map((w) => `⚠ ${w}`);
686
- if (context.pack === null) return blocked(lines, "no repository pack (.orkeon/repo.yaml): its layout and commands drive the steps");
687
- if (context.work.vfsPath === null) return blocked(lines, `the work folder ${context.work.folder} is outside the mounts`);
697
+ if (context.pack === null) return blocked(lines, NO_REPOSITORY_PACK);
698
+ if (context.work.vfsPath === null) return blocked(lines, workFolderOutsideMounts(context.work.folder));
688
699
  const pack = context.pack.pack;
689
700
 
690
701
  const located = await locateSheet(deps.files, context.work.folder, batch, plan);
@@ -698,13 +709,13 @@ export async function runDevImplement(input: DevImplementInputs, deps: DevImplem
698
709
  const pr = inputContext ?? record.pr;
699
710
  const closeMode = pr?.permissionMode.trim() ?? "";
700
711
  if (closeMode !== "" && policyFor(closeMode).readOnly) {
701
- return blocked(lines, `the session mode ${closeMode} (read at the launch) is read-only: the close commits (/mode default, then ${closeCommand(located.code, batch)})`);
712
+ return blocked(lines, readOnlyModeAtClose(closeMode, closeCommand(located.code, batch)));
702
713
  }
703
714
  const opener = pr !== null && pr.githubTool ? deps.openerFor?.(pr) : undefined;
704
715
  // A batch of a /dev-batches run in progress is committed, never pushed, even when its close is typed (after a
705
716
  // GAPS stop, a refused hop): the run's own close pushes the plan's branch once.
706
717
  const inRun = input.push !== false && batchesRunCode(await deps.files.read(BATCHES_ACTIVE_RECORD).catch(() => "")) === located.code;
707
- if (inRun) lines.push(`not pushed: /dev-batches ${located.code} is in progress, its close pushes the plan's branch once`);
718
+ if (inRun) lines.push(notPushedInRun(located.code));
708
719
  return answer([...lines, ...await closeDevBatch({ ...deps, opener }, {
709
720
  pack, work: context.work, located, batch, touched: record.touched, verdictMark: record.verdictMark,
710
721
  openPr: input.pr === true, push: input.push !== false && !inRun, today: isoDay(deps.clock()),
@@ -713,13 +724,13 @@ export async function runDevImplement(input: DevImplementInputs, deps: DevImplem
713
724
  }
714
725
 
715
726
  if (!hasTestLayout(pack.layout)) {
716
- return blocked(lines, "the pack gives neither layout.tests nor layout.test_files: code cannot tell a test file from a production one");
727
+ return blocked(lines, NO_TEST_LAYOUT);
717
728
  }
718
729
  let sheetText: string;
719
730
  try {
720
731
  sheetText = await deps.files.read(sheetPath);
721
732
  } catch (e) {
722
- return blocked(lines, `${located.dir}/${located.name} cannot be read: ${reasonOf(e)}`);
733
+ return blocked(lines, cannotBeReadColonReason(`${located.dir}/${located.name}`, reasonOf(e)));
723
734
  }
724
735
  const verdictPath = `${WORKSPACE}/${located.dir}/${located.prefix}-VERIFY-${batch}.md`;
725
736
  const verdicts = await verdictState(deps.files, verdictPath);
@@ -727,30 +738,30 @@ export async function runDevImplement(input: DevImplementInputs, deps: DevImplem
727
738
  const finding = typeof input.correction === "string" ? input.correction.trim() : "";
728
739
  if (finding !== "") {
729
740
  const edit = addCorrection(sheetText, finding);
730
- if (!edit.ok) return blocked(lines, `correction: ${edit.reason}`);
741
+ if (!edit.ok) return blocked(lines, correctionProblem(edit.reason));
731
742
  if (edit.appended) {
732
743
  try {
733
744
  await deps.files.write(sheetPath, edit.text);
734
745
  } catch (e) {
735
- return blocked(lines, `correction: the sheet could not be written: ${reasonOf(e)}`);
746
+ return blocked(lines, correctionProblem(sheetNotWritten(reasonOf(e))));
736
747
  }
737
- lines.push(`correction appended to ${located.name} as step ${edit.step} — ${edit.title}`);
748
+ lines.push(correctionAppended(located.name, edit.step, edit.title));
738
749
  } else {
739
- lines.push(`correction still open as step ${edit.step} — ${edit.title}: run again, nothing appended`);
750
+ lines.push(correctionStillOpen(edit.step, edit.title));
740
751
  }
741
752
  sheetText = edit.text;
742
753
  if (verdicts.gapsRounds >= GAPS_ROUNDS_WARNED) {
743
- lines.push(`⚠ ${verdicts.gapsRounds} audit rounds in GAPS: the third still GAPS goes to a human`);
754
+ lines.push(gapsRoundsWarned(verdicts.gapsRounds));
744
755
  }
745
756
  }
746
757
  const sheet = parseImplementSheet(sheetText);
747
- if (sheet.problems.length > 0) return blocked(lines, `the sheet is malformed: ${sheet.problems.join("; ")}`);
758
+ if (sheet.problems.length > 0) return blocked(lines, sheetMalformed(sheet.problems));
748
759
 
749
760
  const logFolder = `${context.work.vfsPath}/${located.code}/logs`;
750
761
  const written = new Set<string>();
751
762
  const wrote = (path: string): void => { if (path.trim() !== "") written.add(workspacePath(path)); };
752
763
  const pr = inputContext ?? record.pr;
753
- const runLines = [...lines, `dev-implement ${batch} (${located.code}): ${located.dir}/${located.name}`];
764
+ const runLines = [...lines, runTitle(batch, located.code, `${located.dir}/${located.name}`)];
754
765
  const open = openSteps(sheet);
755
766
  let restored = false;
756
767
  if (open.length > 0) {
@@ -799,7 +810,7 @@ export async function runDevImplement(input: DevImplementInputs, deps: DevImplem
799
810
  if (recalledLine !== "") run.lines.push(recalledLine);
800
811
  const planArg = plan ?? located.code;
801
812
  const auditMode = verdicts.last === "GAPS" ? "resume" : "fast";
802
- run.lines.push(`→ Batch ${batch}: every step ticked, the build and the tests green. The audit follows: ${auditCommand(planArg, batch, auditMode)}`);
813
+ run.lines.push(batchGreen(batch, auditCommand(planArg, batch, auditMode)));
803
814
  return answer(run.lines, {
804
815
  crew: "dev-verify",
805
816
  input: {
@@ -8,6 +8,10 @@
8
8
  // The log is what dev-verify's capture reads (`<work>/<code>/logs/F<n>-build.txt`, `F<n>-test.txt`,
9
9
  // `F<n>-test-affected.txt`): a `#` header, the output, then a last line `exit=<n>`, the harness's shape.
10
10
  import type { Files, Shell, ShellJobs } from "../../../shared/application/ports.ts";
11
+ import {
12
+ CODE_CANNOT_WAIT, jobCannotBeRead, jobCouldNotBeRead, jobDidNotStart, jobLogHeader, jobStillRunning, lostWaitOnJob, noVerdict,
13
+ runBlocking, stillRunningNoVerdict, tailNotRead,
14
+ } from "./messages.ts";
11
15
 
12
16
  export const TAIL_LINES = 500;
13
17
  export const SHOWN_LINES = 15;
@@ -51,7 +55,7 @@ async function writeLog(files: Pick<Files, "write">, path: string | null, text:
51
55
 
52
56
  /** A job lost after it started: no verdict, and a log saying so, so that an earlier log is never read for this run. */
53
57
  async function lost(deps: { files: Pick<Files, "write"> }, req: SuiteRequest, why: string): Promise<SuiteOutcome> {
54
- await writeLog(deps.files, req.log, logText(req.command, [`${why}: no verdict (exit=${NO_VERDICT_EXIT} below)`], "", NO_VERDICT_EXIT));
58
+ await writeLog(deps.files, req.log, logText(req.command, [noVerdict(why, NO_VERDICT_EXIT)], "", NO_VERDICT_EXIT));
55
59
  return { status: "not-run", reason: `${req.label}: ${why}` };
56
60
  }
57
61
 
@@ -63,9 +67,9 @@ async function blocking(deps: { shell: Pick<Shell, "run">; files: Pick<Files, "w
63
67
  return { status: "not-run", reason: `${req.label}: ${reasonOf(e)}` };
64
68
  }
65
69
  const output = [r.stdout.trimEnd(), r.stderr.trimEnd()].filter((t) => t !== "").join("\n");
66
- const header = [`run blocking (${why}): the runtime cuts a result at 32 000 characters`];
70
+ const header = [runBlocking(why)];
67
71
  if (r.timedOut === true) {
68
- const text = logText(req.command, [...header, `still running after ${req.limitSeconds} s: no verdict (exit=${NO_VERDICT_EXIT} below)`], output, NO_VERDICT_EXIT);
72
+ const text = logText(req.command, [...header, stillRunningNoVerdict(req.limitSeconds, NO_VERDICT_EXIT)], output, NO_VERDICT_EXIT);
69
73
  return { status: "running", seconds: req.limitSeconds, log: await writeLog(deps.files, req.log, text), text };
70
74
  }
71
75
  const text = logText(req.command, header, output, r.exitCode);
@@ -76,12 +80,12 @@ async function blocking(deps: { shell: Pick<Shell, "run">; files: Pick<Files, "w
76
80
  export async function runSuite(
77
81
  deps: { jobs: ShellJobs; shell: Pick<Shell, "run">; files: Pick<Files, "write"> }, req: SuiteRequest,
78
82
  ): Promise<SuiteOutcome> {
79
- if (!(await deps.jobs.wait(1))) return blocking(deps, req, "code cannot wait here");
83
+ if (!(await deps.jobs.wait(1))) return blocking(deps, req, CODE_CANNOT_WAIT);
80
84
  let job;
81
85
  try {
82
86
  job = await deps.jobs.start(req.command);
83
87
  } catch (e) {
84
- return blocking(deps, req, `the job did not start: ${reasonOf(e)}`);
88
+ return blocking(deps, req, jobDidNotStart(reasonOf(e)));
85
89
  }
86
90
  let seconds = 0;
87
91
  for (let looks = 0; ; looks++) {
@@ -91,27 +95,27 @@ export async function runSuite(
91
95
  } catch (e) {
92
96
  // A job never seen running may not run at all: once, the suite runs blocking (the job, if it runs, dies
93
97
  // with the run). A job seen before and lost now gives no verdict.
94
- if (looks === 0) return blocking(deps, req, `job ${job.id} could not be read: ${reasonOf(e)}`);
95
- return lost(deps, req, `job ${job.id} cannot be read: ${reasonOf(e)}`);
98
+ if (looks === 0) return blocking(deps, req, jobCouldNotBeRead(job.id, reasonOf(e)));
99
+ return lost(deps, req, jobCannotBeRead(job.id, reasonOf(e)));
96
100
  }
97
101
  if (!status.running) {
98
102
  let tail = "";
99
103
  try {
100
104
  tail = await deps.jobs.tail(job.id, TAIL_LINES);
101
105
  } catch (e) {
102
- tail = `(the tail could not be read: ${reasonOf(e)})`;
106
+ tail = tailNotRead(reasonOf(e));
103
107
  }
104
- const text = logText(req.command, [`job ${job.id}, its whole log at ${job.log} (the run's own); the last ${TAIL_LINES} lines follow`], tail, status.exitCode);
108
+ const text = logText(req.command, [jobLogHeader(job.id, job.log, TAIL_LINES)], tail, status.exitCode);
105
109
  const log = await writeLog(deps.files, req.log, text);
106
110
  return { status: status.exitCode === 0 ? "passed" : "failed", exit: status.exitCode, tail: lastLines(tail, SHOWN_LINES), log, how: "job", text };
107
111
  }
108
112
  if (seconds >= req.limitSeconds) {
109
- const text = logText(req.command, [`job ${job.id} still running after ${seconds} s: no verdict (exit=${NO_VERDICT_EXIT} below); its log at ${job.log}`], "", NO_VERDICT_EXIT);
113
+ const text = logText(req.command, [jobStillRunning(job.id, seconds, NO_VERDICT_EXIT, job.log)], "", NO_VERDICT_EXIT);
110
114
  return { status: "running", seconds, log: await writeLog(deps.files, req.log, text), text };
111
115
  }
112
116
  const slice = Math.min(req.sliceSeconds, 2 ** looks, req.limitSeconds - seconds);
113
117
  if (!(await deps.jobs.wait(slice))) {
114
- return lost(deps, req, `code could no longer wait on job ${job.id}`);
118
+ return lost(deps, req, lostWaitOnJob(job.id));
115
119
  }
116
120
  seconds += slice;
117
121
  }
@@ -29,6 +29,7 @@ import { providerEffort } from "../../shared/domain/agent-policy/behavior-flags.
29
29
  import { implementBudget } from "./domain/implement-budget.ts";
30
30
  import { CREW_TOOLS } from "./domain/roles.ts";
31
31
  import { implementInputs, runDevImplement } from "./application/run-dev-implement.ts";
32
+ import { DEV_IMPLEMENT_GOAL } from "./application/prompts.ts";
32
33
 
33
34
  // run_tests and run_build: built here, bound by the body to the run's wrapped tools (its pack, its rules, its logs).
34
35
  const toolSlot = scriptToolSlot<WrappedTools>();
@@ -42,7 +43,7 @@ const memoryOn = memoryRecallOn(inputs());
42
43
  const builder = orkeonAgent()
43
44
  .name("dev-implement")
44
45
  .role("Batch implementer")
45
- .goal("Run the steps of one batch sheet test-first: red tests by the test author, then the least code that turns them green")
46
+ .goal(DEV_IMPLEMENT_GOAL)
46
47
  .tools([...CREW_TOOLS])
47
48
  .withAutonomousTool(runTestsTool(ToolBuilder, toolSlot))
48
49
  .withAutonomousTool(runBuildTool(ToolBuilder, toolSlot))