smol-symphony 0.2.0 → 0.3.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 (716) hide show
  1. package/AGENTS.md +41 -22
  2. package/DESIGN.md +494 -273
  3. package/README.md +109 -57
  4. package/SPEC.md +33 -24
  5. package/WORKFLOW.minimal.yaml +34 -0
  6. package/{WORKFLOW.template.md → WORKFLOW.template.yaml} +409 -256
  7. package/WORKFLOW.yaml +487 -0
  8. package/assets/skills/symphony-issues/SKILL.md +136 -0
  9. package/assets/symphony-mise.system.toml +68 -0
  10. package/dist/src/bin/symphony.js +30 -0
  11. package/dist/src/bin/symphony.js.map +1 -0
  12. package/dist/src/core/actions/context.js +109 -0
  13. package/dist/src/core/actions/context.js.map +1 -0
  14. package/dist/{actions/parsing.js → src/core/actions/parse.js} +33 -114
  15. package/dist/src/core/actions/parse.js.map +1 -0
  16. package/dist/src/core/actions/plan.js +197 -0
  17. package/dist/src/core/actions/plan.js.map +1 -0
  18. package/dist/src/core/actions/predicates.js +111 -0
  19. package/dist/src/core/actions/predicates.js.map +1 -0
  20. package/dist/src/core/actions/run-fold.js +248 -0
  21. package/dist/src/core/actions/run-fold.js.map +1 -0
  22. package/dist/src/core/actions/template.js +118 -0
  23. package/dist/src/core/actions/template.js.map +1 -0
  24. package/dist/src/core/cli/args.js +116 -0
  25. package/dist/src/core/cli/args.js.map +1 -0
  26. package/dist/src/core/coerce.js +75 -0
  27. package/dist/src/core/coerce.js.map +1 -0
  28. package/dist/src/core/credential/account-id.js +20 -0
  29. package/dist/src/core/credential/account-id.js.map +1 -0
  30. package/dist/src/core/credential/adapter-config.js +136 -0
  31. package/dist/src/core/credential/adapter-config.js.map +1 -0
  32. package/dist/src/core/credential/availability.js +98 -0
  33. package/dist/src/core/credential/availability.js.map +1 -0
  34. package/dist/src/core/credential/extract.js +228 -0
  35. package/dist/src/core/credential/extract.js.map +1 -0
  36. package/dist/src/core/credential/fake-creds.js +171 -0
  37. package/dist/src/core/credential/fake-creds.js.map +1 -0
  38. package/dist/src/core/credential/identity.js +125 -0
  39. package/dist/src/core/credential/identity.js.map +1 -0
  40. package/dist/src/core/credential/shape.js +230 -0
  41. package/dist/src/core/credential/shape.js.map +1 -0
  42. package/dist/src/core/credential/strings.js +15 -0
  43. package/dist/src/core/credential/strings.js.map +1 -0
  44. package/dist/src/core/doctor/checks.js +303 -0
  45. package/dist/src/core/doctor/checks.js.map +1 -0
  46. package/dist/src/core/git/result.js +107 -0
  47. package/dist/src/core/git/result.js.map +1 -0
  48. package/dist/src/core/http/decisions.js +225 -0
  49. package/dist/src/core/http/decisions.js.map +1 -0
  50. package/dist/{http.js → src/core/http/render.js} +472 -738
  51. package/dist/src/core/http/render.js.map +1 -0
  52. package/dist/{http-handlers.js → src/core/http/routes.js} +52 -87
  53. package/dist/src/core/http/routes.js.map +1 -0
  54. package/dist/src/core/http/views.js +181 -0
  55. package/dist/src/core/http/views.js.map +1 -0
  56. package/dist/src/core/image/managed-image.js +95 -0
  57. package/dist/src/core/image/managed-image.js.map +1 -0
  58. package/dist/src/core/issue/file.js +149 -0
  59. package/dist/src/core/issue/file.js.map +1 -0
  60. package/dist/src/core/issue/parse.js +210 -0
  61. package/dist/src/core/issue/parse.js.map +1 -0
  62. package/dist/src/core/mcp/dispatch.js +239 -0
  63. package/dist/src/core/mcp/dispatch.js.map +1 -0
  64. package/dist/src/core/mcp/post-move.js +92 -0
  65. package/dist/src/core/mcp/post-move.js.map +1 -0
  66. package/dist/src/core/mcp/protocol.js +293 -0
  67. package/dist/src/core/mcp/protocol.js.map +1 -0
  68. package/dist/src/core/mcp/url.js +162 -0
  69. package/dist/src/core/mcp/url.js.map +1 -0
  70. package/dist/src/core/path.js +63 -0
  71. package/dist/src/core/path.js.map +1 -0
  72. package/dist/src/core/reconcile/image-decide.js +48 -0
  73. package/dist/src/core/reconcile/image-decide.js.map +1 -0
  74. package/dist/src/core/reconcile/ledger.js +142 -0
  75. package/dist/src/core/reconcile/ledger.js.map +1 -0
  76. package/dist/src/core/reconcile/pr-classify.js +62 -0
  77. package/dist/src/core/reconcile/pr-classify.js.map +1 -0
  78. package/dist/{reconciler → src/core/reconcile}/pr-decide.js +25 -12
  79. package/dist/src/core/reconcile/pr-decide.js.map +1 -0
  80. package/dist/src/core/reconcile/pr-loop.js +161 -0
  81. package/dist/src/core/reconcile/pr-loop.js.map +1 -0
  82. package/dist/src/core/reconcile/pr-notes.js +35 -0
  83. package/dist/src/core/reconcile/pr-notes.js.map +1 -0
  84. package/dist/src/core/reconcile/vm-decide.js +70 -0
  85. package/dist/src/core/reconcile/vm-decide.js.map +1 -0
  86. package/dist/src/core/reconcile/vm-reap.js +207 -0
  87. package/dist/src/core/reconcile/vm-reap.js.map +1 -0
  88. package/dist/src/core/reconcile/workspace-decide.js +162 -0
  89. package/dist/src/core/reconcile/workspace-decide.js.map +1 -0
  90. package/dist/src/core/runlog/summary.js +231 -0
  91. package/dist/src/core/runlog/summary.js.map +1 -0
  92. package/dist/src/core/runner/dispatch-config.js +95 -0
  93. package/dist/src/core/runner/dispatch-config.js.map +1 -0
  94. package/dist/src/core/runner/injection.js +61 -0
  95. package/dist/src/core/runner/injection.js.map +1 -0
  96. package/dist/src/core/runner/mise.js +210 -0
  97. package/dist/src/core/runner/mise.js.map +1 -0
  98. package/dist/src/core/runner/prompt.js +720 -0
  99. package/dist/src/core/runner/prompt.js.map +1 -0
  100. package/dist/src/core/runner/turn.js +242 -0
  101. package/dist/src/core/runner/turn.js.map +1 -0
  102. package/dist/src/core/runner/vm-plan.js +390 -0
  103. package/dist/src/core/runner/vm-plan.js.map +1 -0
  104. package/dist/src/core/schedule/admission.js +123 -0
  105. package/dist/src/core/schedule/admission.js.map +1 -0
  106. package/dist/src/core/schedule/circuit-breaker.js +111 -0
  107. package/dist/src/core/schedule/circuit-breaker.js.map +1 -0
  108. package/dist/src/core/schedule/eligibility.js +83 -0
  109. package/dist/src/core/schedule/eligibility.js.map +1 -0
  110. package/dist/src/core/schedule/reconcile-issue.js +82 -0
  111. package/dist/src/core/schedule/reconcile-issue.js.map +1 -0
  112. package/dist/src/core/schedule/retry.js +96 -0
  113. package/dist/src/core/schedule/retry.js.map +1 -0
  114. package/dist/src/core/schedule/sleep-cycle.js +133 -0
  115. package/dist/src/core/schedule/sleep-cycle.js.map +1 -0
  116. package/dist/src/core/schedule/slots.js +124 -0
  117. package/dist/src/core/schedule/slots.js.map +1 -0
  118. package/dist/src/core/schedule/tick.js +553 -0
  119. package/dist/src/core/schedule/tick.js.map +1 -0
  120. package/dist/src/core/schedule/token-fold.js +181 -0
  121. package/dist/src/core/schedule/token-fold.js.map +1 -0
  122. package/dist/src/core/state-resolve.js +86 -0
  123. package/dist/src/core/state-resolve.js.map +1 -0
  124. package/dist/src/core/vm-guards.js +278 -0
  125. package/dist/src/core/vm-guards.js.map +1 -0
  126. package/dist/src/core/workflow/derive.js +107 -0
  127. package/dist/src/core/workflow/derive.js.map +1 -0
  128. package/dist/src/core/workflow/parse.js +687 -0
  129. package/dist/src/core/workflow/parse.js.map +1 -0
  130. package/dist/src/core/workflow/prompt-probe.js +78 -0
  131. package/dist/src/core/workflow/prompt-probe.js.map +1 -0
  132. package/dist/src/core/workflow/validate.js +189 -0
  133. package/dist/src/core/workflow/validate.js.map +1 -0
  134. package/dist/src/core/workspace-key.js +19 -0
  135. package/dist/src/core/workspace-key.js.map +1 -0
  136. package/dist/src/shell/actions-runner.js +356 -0
  137. package/dist/src/shell/actions-runner.js.map +1 -0
  138. package/dist/src/shell/adapter/adapter-registry.js +45 -0
  139. package/dist/src/shell/adapter/adapter-registry.js.map +1 -0
  140. package/dist/src/shell/adapter/clock-random.js +96 -0
  141. package/dist/src/shell/adapter/clock-random.js.map +1 -0
  142. package/dist/src/shell/adapter/gondolin-dispatch-helpers.js +158 -0
  143. package/dist/src/shell/adapter/gondolin-dispatch-helpers.js.map +1 -0
  144. package/dist/src/shell/adapter/gondolin-dispatch.js +385 -0
  145. package/dist/src/shell/adapter/gondolin-dispatch.js.map +1 -0
  146. package/dist/src/shell/adapter/gondolin-image-converter.js +233 -0
  147. package/dist/src/shell/adapter/gondolin-image-converter.js.map +1 -0
  148. package/dist/src/shell/adapter/gondolin-image-fetch.js +180 -0
  149. package/dist/src/shell/adapter/gondolin-image-fetch.js.map +1 -0
  150. package/dist/src/shell/adapter/launcher-asset.js +57 -0
  151. package/dist/src/shell/adapter/launcher-asset.js.map +1 -0
  152. package/dist/src/shell/adapter/mise-config-asset.js +65 -0
  153. package/dist/src/shell/adapter/mise-config-asset.js.map +1 -0
  154. package/dist/src/shell/adapter/workflow-loader.js +304 -0
  155. package/dist/src/shell/adapter/workflow-loader.js.map +1 -0
  156. package/dist/src/shell/cli/doctor.js +268 -0
  157. package/dist/src/shell/cli/doctor.js.map +1 -0
  158. package/dist/src/shell/effect-interpreter-families.js +314 -0
  159. package/dist/src/shell/effect-interpreter-families.js.map +1 -0
  160. package/dist/src/shell/effect-interpreter.js +29 -0
  161. package/dist/src/shell/effect-interpreter.js.map +1 -0
  162. package/dist/src/shell/interp/acp-frame.js +137 -0
  163. package/dist/src/shell/interp/acp-frame.js.map +1 -0
  164. package/dist/src/shell/interp/acp-ws-conn.js +320 -0
  165. package/dist/src/shell/interp/acp-ws-conn.js.map +1 -0
  166. package/dist/src/shell/interp/acp-ws-frames.js +159 -0
  167. package/dist/src/shell/interp/acp-ws-frames.js.map +1 -0
  168. package/dist/src/shell/interp/acp-ws.js +197 -0
  169. package/dist/src/shell/interp/acp-ws.js.map +1 -0
  170. package/dist/src/shell/interp/acp.js +319 -0
  171. package/dist/src/shell/interp/acp.js.map +1 -0
  172. package/dist/src/shell/interp/credential-defaults.js +128 -0
  173. package/dist/src/shell/interp/credential-defaults.js.map +1 -0
  174. package/dist/src/shell/interp/credential-hooks.js +149 -0
  175. package/dist/src/shell/interp/credential-hooks.js.map +1 -0
  176. package/dist/src/shell/interp/credential-registry.js +226 -0
  177. package/dist/src/shell/interp/credential-registry.js.map +1 -0
  178. package/dist/src/shell/interp/credential.js +103 -0
  179. package/dist/src/shell/interp/credential.js.map +1 -0
  180. package/dist/src/shell/interp/gh.js +163 -0
  181. package/dist/src/shell/interp/gh.js.map +1 -0
  182. package/dist/src/shell/interp/git.js +28 -0
  183. package/dist/src/shell/interp/git.js.map +1 -0
  184. package/dist/src/shell/interp/log.js +213 -0
  185. package/dist/src/shell/interp/log.js.map +1 -0
  186. package/dist/src/shell/interp/process.js +178 -0
  187. package/dist/src/shell/interp/process.js.map +1 -0
  188. package/dist/src/shell/interp/runlog.js +193 -0
  189. package/dist/src/shell/interp/runlog.js.map +1 -0
  190. package/dist/src/shell/interp/timer.js +64 -0
  191. package/dist/src/shell/interp/timer.js.map +1 -0
  192. package/dist/src/shell/interp/tracker-disk.js +99 -0
  193. package/dist/src/shell/interp/tracker-disk.js.map +1 -0
  194. package/dist/src/shell/interp/tracker-parse.js +71 -0
  195. package/dist/src/shell/interp/tracker-parse.js.map +1 -0
  196. package/dist/src/shell/interp/tracker-scan.js +238 -0
  197. package/dist/src/shell/interp/tracker-scan.js.map +1 -0
  198. package/dist/src/shell/interp/tracker-write.js +91 -0
  199. package/dist/src/shell/interp/tracker-write.js.map +1 -0
  200. package/dist/src/shell/interp/tracker.js +41 -0
  201. package/dist/src/shell/interp/tracker.js.map +1 -0
  202. package/dist/src/shell/interp/tty.js +48 -0
  203. package/dist/src/shell/interp/tty.js.map +1 -0
  204. package/dist/src/shell/interp/vm.js +199 -0
  205. package/dist/src/shell/interp/vm.js.map +1 -0
  206. package/dist/src/shell/interp/workspace.js +310 -0
  207. package/dist/src/shell/interp/workspace.js.map +1 -0
  208. package/dist/src/shell/main-acp.js +78 -0
  209. package/dist/src/shell/main-acp.js.map +1 -0
  210. package/dist/src/shell/main-adapters.js +222 -0
  211. package/dist/src/shell/main-adapters.js.map +1 -0
  212. package/dist/src/shell/main-credential.js +122 -0
  213. package/dist/src/shell/main-credential.js.map +1 -0
  214. package/dist/src/shell/main-doctor.js +22 -0
  215. package/dist/src/shell/main-doctor.js.map +1 -0
  216. package/dist/src/shell/main-entry.js +46 -0
  217. package/dist/src/shell/main-entry.js.map +1 -0
  218. package/dist/src/shell/main-http-csrf.js +45 -0
  219. package/dist/src/shell/main-http-csrf.js.map +1 -0
  220. package/dist/src/shell/main-http-handler.js +389 -0
  221. package/dist/src/shell/main-http-handler.js.map +1 -0
  222. package/dist/src/shell/main-http-mcp.js +122 -0
  223. package/dist/src/shell/main-http-mcp.js.map +1 -0
  224. package/dist/src/shell/main-http-views.js +253 -0
  225. package/dist/src/shell/main-http-views.js.map +1 -0
  226. package/dist/src/shell/main-http.js +76 -0
  227. package/dist/src/shell/main-http.js.map +1 -0
  228. package/dist/src/shell/main-loops.js +130 -0
  229. package/dist/src/shell/main-loops.js.map +1 -0
  230. package/dist/src/shell/main-mcp.js +129 -0
  231. package/dist/src/shell/main-mcp.js.map +1 -0
  232. package/dist/src/shell/main-orchestrator.js +120 -0
  233. package/dist/src/shell/main-orchestrator.js.map +1 -0
  234. package/dist/src/shell/main-preflight.js +43 -0
  235. package/dist/src/shell/main-preflight.js.map +1 -0
  236. package/dist/src/shell/main-reconcilers-helpers.js +244 -0
  237. package/dist/src/shell/main-reconcilers-helpers.js.map +1 -0
  238. package/dist/src/shell/main-reconcilers-pr.js +148 -0
  239. package/dist/src/shell/main-reconcilers-pr.js.map +1 -0
  240. package/dist/src/shell/main-reconcilers.js +225 -0
  241. package/dist/src/shell/main-reconcilers.js.map +1 -0
  242. package/dist/src/shell/main-runner.js +355 -0
  243. package/dist/src/shell/main-runner.js.map +1 -0
  244. package/dist/src/shell/main-scaffold.js +116 -0
  245. package/dist/src/shell/main-scaffold.js.map +1 -0
  246. package/dist/src/shell/main-shutdown.js +115 -0
  247. package/dist/src/shell/main-shutdown.js.map +1 -0
  248. package/dist/src/shell/main-startup.js +48 -0
  249. package/dist/src/shell/main-startup.js.map +1 -0
  250. package/dist/src/shell/main-substrates.js +43 -0
  251. package/dist/src/shell/main-substrates.js.map +1 -0
  252. package/dist/src/shell/main.js +385 -0
  253. package/dist/src/shell/main.js.map +1 -0
  254. package/dist/src/shell/orchestrator-feedback.js +69 -0
  255. package/dist/src/shell/orchestrator-feedback.js.map +1 -0
  256. package/dist/src/shell/orchestrator-image.js +167 -0
  257. package/dist/src/shell/orchestrator-image.js.map +1 -0
  258. package/dist/src/shell/orchestrator-loop.js +468 -0
  259. package/dist/src/shell/orchestrator-loop.js.map +1 -0
  260. package/dist/src/shell/orchestrator-reconcile.js +36 -0
  261. package/dist/src/shell/orchestrator-reconcile.js.map +1 -0
  262. package/dist/src/shell/reconciler-loop.js +228 -0
  263. package/dist/src/shell/reconciler-loop.js.map +1 -0
  264. package/dist/src/shell/runner-loop-turn.js +301 -0
  265. package/dist/src/shell/runner-loop-turn.js.map +1 -0
  266. package/dist/src/shell/runner-loop.js +338 -0
  267. package/dist/src/shell/runner-loop.js.map +1 -0
  268. package/dist/src/shell/server/http.js +208 -0
  269. package/dist/src/shell/server/http.js.map +1 -0
  270. package/dist/src/shell/server/mcp-runtime-effects.js +237 -0
  271. package/dist/src/shell/server/mcp-runtime-effects.js.map +1 -0
  272. package/dist/src/shell/server/mcp-runtime.js +99 -0
  273. package/dist/src/shell/server/mcp-runtime.js.map +1 -0
  274. package/dist/src/shell/workspace-key.js +14 -0
  275. package/dist/src/shell/workspace-key.js.map +1 -0
  276. package/dist/src/types/acp.js +8 -0
  277. package/dist/src/types/acp.js.map +1 -0
  278. package/dist/src/types/actions/plan.js +6 -0
  279. package/dist/src/types/actions/plan.js.map +1 -0
  280. package/dist/src/types/actions/predicates.js +6 -0
  281. package/dist/src/types/actions/predicates.js.map +1 -0
  282. package/dist/src/types/actions/run-fold.js +8 -0
  283. package/dist/src/types/actions/run-fold.js.map +1 -0
  284. package/dist/src/types/actions.js +7 -0
  285. package/dist/src/types/actions.js.map +1 -0
  286. package/dist/src/types/adapter/clock-random.js +4 -0
  287. package/dist/src/types/adapter/clock-random.js.map +1 -0
  288. package/dist/src/types/adapter/gondolin-image-converter.js +5 -0
  289. package/dist/src/types/adapter/gondolin-image-converter.js.map +1 -0
  290. package/dist/src/types/adapter/gondolin-image-fetch.js +5 -0
  291. package/dist/src/types/adapter/gondolin-image-fetch.js.map +1 -0
  292. package/dist/src/types/adapter/workflow-loader.js +4 -0
  293. package/dist/src/types/adapter/workflow-loader.js.map +1 -0
  294. package/dist/src/types/cli/args.js +8 -0
  295. package/dist/src/types/cli/args.js.map +1 -0
  296. package/dist/src/types/config.js +8 -0
  297. package/dist/src/types/config.js.map +1 -0
  298. package/dist/src/types/credential-interp.js +6 -0
  299. package/dist/src/types/credential-interp.js.map +1 -0
  300. package/dist/src/types/credentials.js +10 -0
  301. package/dist/src/types/credentials.js.map +1 -0
  302. package/dist/src/types/doctor.js +7 -0
  303. package/dist/src/types/doctor.js.map +1 -0
  304. package/dist/src/types/domain.js +7 -0
  305. package/dist/src/types/domain.js.map +1 -0
  306. package/dist/src/types/effect.js +15 -0
  307. package/dist/src/types/effect.js.map +1 -0
  308. package/dist/src/types/errors.js +39 -0
  309. package/dist/src/types/errors.js.map +1 -0
  310. package/dist/src/types/http/decisions.js +6 -0
  311. package/dist/src/types/http/decisions.js.map +1 -0
  312. package/dist/src/types/http/render.js +10 -0
  313. package/dist/src/types/http/render.js.map +1 -0
  314. package/dist/src/types/http/views.js +6 -0
  315. package/dist/src/types/http/views.js.map +1 -0
  316. package/dist/src/types/http.js +9 -0
  317. package/dist/src/types/http.js.map +1 -0
  318. package/dist/src/types/image/managed-image.js +7 -0
  319. package/dist/src/types/image/managed-image.js.map +1 -0
  320. package/dist/src/types/interp/effect-interpreter.js +8 -0
  321. package/dist/src/types/interp/effect-interpreter.js.map +1 -0
  322. package/dist/src/types/interp/tracker.js +7 -0
  323. package/dist/src/types/interp/tracker.js.map +1 -0
  324. package/dist/src/types/issue/file.js +6 -0
  325. package/dist/src/types/issue/file.js.map +1 -0
  326. package/dist/src/types/issue/parse.js +8 -0
  327. package/dist/src/types/issue/parse.js.map +1 -0
  328. package/dist/src/types/main-acp.js +13 -0
  329. package/dist/src/types/main-acp.js.map +1 -0
  330. package/dist/src/types/main-adapters.js +5 -0
  331. package/dist/src/types/main-adapters.js.map +1 -0
  332. package/dist/src/types/main-credential.js +21 -0
  333. package/dist/src/types/main-credential.js.map +1 -0
  334. package/dist/src/types/main-doctor.js +6 -0
  335. package/dist/src/types/main-doctor.js.map +1 -0
  336. package/dist/src/types/main-http-handler.js +12 -0
  337. package/dist/src/types/main-http-handler.js.map +1 -0
  338. package/dist/src/types/main-http.js +5 -0
  339. package/dist/src/types/main-http.js.map +1 -0
  340. package/dist/src/types/main-loops.js +5 -0
  341. package/dist/src/types/main-loops.js.map +1 -0
  342. package/dist/src/types/main-mcp.js +12 -0
  343. package/dist/src/types/main-mcp.js.map +1 -0
  344. package/dist/src/types/main-orchestrator.js +5 -0
  345. package/dist/src/types/main-orchestrator.js.map +1 -0
  346. package/dist/src/types/main-reconcilers.js +11 -0
  347. package/dist/src/types/main-reconcilers.js.map +1 -0
  348. package/dist/src/types/main-runner.js +13 -0
  349. package/dist/src/types/main-runner.js.map +1 -0
  350. package/dist/src/types/main-startup.js +5 -0
  351. package/dist/src/types/main-startup.js.map +1 -0
  352. package/dist/src/types/main-substrates.js +5 -0
  353. package/dist/src/types/main-substrates.js.map +1 -0
  354. package/dist/src/types/mcp/dispatch.js +4 -0
  355. package/dist/src/types/mcp/dispatch.js.map +1 -0
  356. package/dist/src/types/mcp/post-move.js +7 -0
  357. package/dist/src/types/mcp/post-move.js.map +1 -0
  358. package/dist/src/types/mcp.js +9 -0
  359. package/dist/src/types/mcp.js.map +1 -0
  360. package/dist/src/types/ports.js +12 -0
  361. package/dist/src/types/ports.js.map +1 -0
  362. package/dist/src/types/reconcile/image-decide.js +5 -0
  363. package/dist/src/types/reconcile/image-decide.js.map +1 -0
  364. package/dist/src/types/reconcile/ledger.js +7 -0
  365. package/dist/src/types/reconcile/ledger.js.map +1 -0
  366. package/dist/src/types/reconcile/pr-loop.js +8 -0
  367. package/dist/src/types/reconcile/pr-loop.js.map +1 -0
  368. package/dist/src/types/reconcile/vm-reap.js +8 -0
  369. package/dist/src/types/reconcile/vm-reap.js.map +1 -0
  370. package/dist/src/types/reconcile/workspace-decide.js +7 -0
  371. package/dist/src/types/reconcile/workspace-decide.js.map +1 -0
  372. package/dist/src/types/reconcile.js +9 -0
  373. package/dist/src/types/reconcile.js.map +1 -0
  374. package/dist/src/types/runlog.js +7 -0
  375. package/dist/src/types/runlog.js.map +1 -0
  376. package/dist/src/types/runner/actions-runner.js +12 -0
  377. package/dist/src/types/runner/actions-runner.js.map +1 -0
  378. package/dist/src/types/runner/gondolin-dispatch.js +5 -0
  379. package/dist/src/types/runner/gondolin-dispatch.js.map +1 -0
  380. package/dist/src/types/runner/injection.js +6 -0
  381. package/dist/src/types/runner/injection.js.map +1 -0
  382. package/dist/src/types/runner/runner-loop.js +5 -0
  383. package/dist/src/types/runner/runner-loop.js.map +1 -0
  384. package/dist/src/types/runner/turn.js +4 -0
  385. package/dist/src/types/runner/turn.js.map +1 -0
  386. package/dist/src/types/runner/vm-plan.js +4 -0
  387. package/dist/src/types/runner/vm-plan.js.map +1 -0
  388. package/dist/src/types/runtime.js +9 -0
  389. package/dist/src/types/runtime.js.map +1 -0
  390. package/dist/src/types/schedule/admission.js +7 -0
  391. package/dist/src/types/schedule/admission.js.map +1 -0
  392. package/dist/src/types/schedule/circuit-breaker.js +2 -0
  393. package/dist/src/types/schedule/circuit-breaker.js.map +1 -0
  394. package/dist/src/types/schedule/eligibility.js +9 -0
  395. package/dist/src/types/schedule/eligibility.js.map +1 -0
  396. package/dist/src/types/schedule/orchestrator-loop.js +10 -0
  397. package/dist/src/types/schedule/orchestrator-loop.js.map +1 -0
  398. package/dist/src/types/schedule/sleep-cycle.js +4 -0
  399. package/dist/src/types/schedule/sleep-cycle.js.map +1 -0
  400. package/dist/src/types/schedule/slots.js +8 -0
  401. package/dist/src/types/schedule/slots.js.map +1 -0
  402. package/dist/src/types/schedule/tick.js +9 -0
  403. package/dist/src/types/schedule/tick.js.map +1 -0
  404. package/dist/src/types/server/mcp-runtime.js +8 -0
  405. package/dist/src/types/server/mcp-runtime.js.map +1 -0
  406. package/dist/src/types/workflow/parse.js +4 -0
  407. package/dist/src/types/workflow/parse.js.map +1 -0
  408. package/dist/tests/core/account-id.test.js +35 -0
  409. package/dist/tests/core/account-id.test.js.map +1 -0
  410. package/dist/tests/core/actions-parse.test.js +176 -0
  411. package/dist/tests/core/actions-parse.test.js.map +1 -0
  412. package/dist/tests/core/adapter-config.test.js +133 -0
  413. package/dist/tests/core/adapter-config.test.js.map +1 -0
  414. package/dist/tests/core/admission.test.js +215 -0
  415. package/dist/tests/core/admission.test.js.map +1 -0
  416. package/dist/tests/core/args.test.js +132 -0
  417. package/dist/tests/core/args.test.js.map +1 -0
  418. package/dist/tests/core/availability.test.js +62 -0
  419. package/dist/tests/core/availability.test.js.map +1 -0
  420. package/dist/tests/core/checks.test.js +395 -0
  421. package/dist/tests/core/checks.test.js.map +1 -0
  422. package/dist/tests/core/circuit-breaker.test.js +172 -0
  423. package/dist/tests/core/circuit-breaker.test.js.map +1 -0
  424. package/dist/tests/core/coerce.test.js +87 -0
  425. package/dist/tests/core/coerce.test.js.map +1 -0
  426. package/dist/tests/core/context.test.js +228 -0
  427. package/dist/tests/core/context.test.js.map +1 -0
  428. package/dist/tests/core/decisions.test.js +310 -0
  429. package/dist/tests/core/decisions.test.js.map +1 -0
  430. package/dist/tests/core/derive.test.js +205 -0
  431. package/dist/tests/core/derive.test.js.map +1 -0
  432. package/dist/tests/core/dispatch-config.test.js +164 -0
  433. package/dist/tests/core/dispatch-config.test.js.map +1 -0
  434. package/dist/tests/core/dispatch.test.js +302 -0
  435. package/dist/tests/core/dispatch.test.js.map +1 -0
  436. package/dist/tests/core/eligibility.test.js +163 -0
  437. package/dist/tests/core/eligibility.test.js.map +1 -0
  438. package/dist/tests/core/extract.test.js +139 -0
  439. package/dist/tests/core/extract.test.js.map +1 -0
  440. package/dist/tests/core/fake-creds.test.js +134 -0
  441. package/dist/tests/core/fake-creds.test.js.map +1 -0
  442. package/dist/tests/core/file.test.js +197 -0
  443. package/dist/tests/core/file.test.js.map +1 -0
  444. package/dist/tests/core/git-result.test.js +113 -0
  445. package/dist/tests/core/git-result.test.js.map +1 -0
  446. package/dist/tests/core/identity.test.js +180 -0
  447. package/dist/tests/core/identity.test.js.map +1 -0
  448. package/dist/tests/core/image-decide.test.js +59 -0
  449. package/dist/tests/core/image-decide.test.js.map +1 -0
  450. package/dist/tests/core/injection.test.js +163 -0
  451. package/dist/tests/core/injection.test.js.map +1 -0
  452. package/dist/tests/core/ledger.test.js +218 -0
  453. package/dist/tests/core/ledger.test.js.map +1 -0
  454. package/dist/tests/core/managed-image.test.js +68 -0
  455. package/dist/tests/core/managed-image.test.js.map +1 -0
  456. package/dist/tests/core/mise.test.js +138 -0
  457. package/dist/tests/core/mise.test.js.map +1 -0
  458. package/dist/tests/core/parse.test.js +174 -0
  459. package/dist/tests/core/parse.test.js.map +1 -0
  460. package/dist/tests/core/path.test.js +50 -0
  461. package/dist/tests/core/path.test.js.map +1 -0
  462. package/dist/tests/core/plan.test.js +218 -0
  463. package/dist/tests/core/plan.test.js.map +1 -0
  464. package/dist/tests/core/post-move.test.js +162 -0
  465. package/dist/tests/core/post-move.test.js.map +1 -0
  466. package/dist/tests/core/pr-classify.test.js +117 -0
  467. package/dist/tests/core/pr-classify.test.js.map +1 -0
  468. package/dist/tests/core/pr-decide.test.js +298 -0
  469. package/dist/tests/core/pr-decide.test.js.map +1 -0
  470. package/dist/tests/core/pr-loop.test.js +301 -0
  471. package/dist/tests/core/pr-loop.test.js.map +1 -0
  472. package/dist/tests/core/pr-notes.test.js +165 -0
  473. package/dist/tests/core/pr-notes.test.js.map +1 -0
  474. package/dist/tests/core/predicates.test.js +154 -0
  475. package/dist/tests/core/predicates.test.js.map +1 -0
  476. package/dist/tests/core/prompt.test.js +189 -0
  477. package/dist/tests/core/prompt.test.js.map +1 -0
  478. package/dist/tests/core/protocol.test.js +195 -0
  479. package/dist/tests/core/protocol.test.js.map +1 -0
  480. package/dist/tests/core/reconcile-issue.test.js +116 -0
  481. package/dist/tests/core/reconcile-issue.test.js.map +1 -0
  482. package/dist/tests/core/render.test.js +549 -0
  483. package/dist/tests/core/render.test.js.map +1 -0
  484. package/dist/tests/core/retry.test.js +186 -0
  485. package/dist/tests/core/retry.test.js.map +1 -0
  486. package/dist/tests/core/routes.test.js +247 -0
  487. package/dist/tests/core/routes.test.js.map +1 -0
  488. package/dist/tests/core/run-fold.test.js +299 -0
  489. package/dist/tests/core/run-fold.test.js.map +1 -0
  490. package/dist/tests/core/shape.test.js +185 -0
  491. package/dist/tests/core/shape.test.js.map +1 -0
  492. package/dist/tests/core/sleep-cycle.test.js +150 -0
  493. package/dist/tests/core/sleep-cycle.test.js.map +1 -0
  494. package/dist/tests/core/slots.test.js +201 -0
  495. package/dist/tests/core/slots.test.js.map +1 -0
  496. package/dist/tests/core/state-resolve.test.js +80 -0
  497. package/dist/tests/core/state-resolve.test.js.map +1 -0
  498. package/dist/tests/core/summary.test.js +200 -0
  499. package/dist/tests/core/summary.test.js.map +1 -0
  500. package/dist/tests/core/template.test.js +116 -0
  501. package/dist/tests/core/template.test.js.map +1 -0
  502. package/dist/tests/core/tick.test.js +558 -0
  503. package/dist/tests/core/tick.test.js.map +1 -0
  504. package/dist/tests/core/token-fold.test.js +176 -0
  505. package/dist/tests/core/token-fold.test.js.map +1 -0
  506. package/dist/tests/core/turn.test.js +388 -0
  507. package/dist/tests/core/turn.test.js.map +1 -0
  508. package/dist/tests/core/url.test.js +118 -0
  509. package/dist/tests/core/url.test.js.map +1 -0
  510. package/dist/tests/core/validate.test.js +247 -0
  511. package/dist/tests/core/validate.test.js.map +1 -0
  512. package/dist/tests/core/views.test.js +252 -0
  513. package/dist/tests/core/views.test.js.map +1 -0
  514. package/dist/tests/core/vm-decide.test.js +110 -0
  515. package/dist/tests/core/vm-decide.test.js.map +1 -0
  516. package/dist/tests/core/vm-guards.test.js +153 -0
  517. package/dist/tests/core/vm-guards.test.js.map +1 -0
  518. package/dist/tests/core/vm-plan.test.js +332 -0
  519. package/dist/tests/core/vm-plan.test.js.map +1 -0
  520. package/dist/tests/core/vm-reap.test.js +196 -0
  521. package/dist/tests/core/vm-reap.test.js.map +1 -0
  522. package/dist/tests/core/workflow-parse.test.js +493 -0
  523. package/dist/tests/core/workflow-parse.test.js.map +1 -0
  524. package/dist/tests/core/workspace-decide.test.js +236 -0
  525. package/dist/tests/core/workspace-decide.test.js.map +1 -0
  526. package/dist/tests/helpers/fixtures.js +167 -0
  527. package/dist/tests/helpers/fixtures.js.map +1 -0
  528. package/dist/tests/shell/acp-substrate.test.js +101 -0
  529. package/dist/tests/shell/acp-substrate.test.js.map +1 -0
  530. package/dist/tests/shell/actions-runner-push.test.js +203 -0
  531. package/dist/tests/shell/actions-runner-push.test.js.map +1 -0
  532. package/dist/tests/shell/credential-hooks.test.js +36 -0
  533. package/dist/tests/shell/credential-hooks.test.js.map +1 -0
  534. package/dist/tests/shell/credential-registry.test.js +165 -0
  535. package/dist/tests/shell/credential-registry.test.js.map +1 -0
  536. package/dist/tests/shell/credential-substrate.test.js +179 -0
  537. package/dist/tests/shell/credential-substrate.test.js.map +1 -0
  538. package/dist/tests/shell/dockerfile-mise-pin.test.js +51 -0
  539. package/dist/tests/shell/dockerfile-mise-pin.test.js.map +1 -0
  540. package/dist/tests/shell/doctor.test.js +101 -0
  541. package/dist/tests/shell/doctor.test.js.map +1 -0
  542. package/dist/tests/shell/effect-vm-create.test.js +52 -0
  543. package/dist/tests/shell/effect-vm-create.test.js.map +1 -0
  544. package/dist/tests/shell/gh-port.test.js +63 -0
  545. package/dist/tests/shell/gh-port.test.js.map +1 -0
  546. package/dist/tests/shell/gondolin-dispatch-guard.test.js +144 -0
  547. package/dist/tests/shell/gondolin-dispatch-guard.test.js.map +1 -0
  548. package/dist/tests/shell/gondolin-dispatch-shquote.test.js +168 -0
  549. package/dist/tests/shell/gondolin-dispatch-shquote.test.js.map +1 -0
  550. package/dist/tests/shell/gondolin-image-converter.test.js +208 -0
  551. package/dist/tests/shell/gondolin-image-converter.test.js.map +1 -0
  552. package/dist/tests/shell/gondolin-image-fetch.test.js +93 -0
  553. package/dist/tests/shell/gondolin-image-fetch.test.js.map +1 -0
  554. package/dist/tests/shell/http-handler.test.js +608 -0
  555. package/dist/tests/shell/http-handler.test.js.map +1 -0
  556. package/dist/tests/shell/http-server.test.js +53 -0
  557. package/dist/tests/shell/http-server.test.js.map +1 -0
  558. package/dist/tests/shell/mcp-runtime.test.js +366 -0
  559. package/dist/tests/shell/mcp-runtime.test.js.map +1 -0
  560. package/dist/tests/shell/mise-config-asset.test.js +87 -0
  561. package/dist/tests/shell/mise-config-asset.test.js.map +1 -0
  562. package/dist/tests/shell/orchestrator-loop.test.js +583 -0
  563. package/dist/tests/shell/orchestrator-loop.test.js.map +1 -0
  564. package/dist/tests/shell/reconciler-passes.test.js +314 -0
  565. package/dist/tests/shell/reconciler-passes.test.js.map +1 -0
  566. package/dist/tests/shell/runner-loop-turn.test.js +97 -0
  567. package/dist/tests/shell/runner-loop-turn.test.js.map +1 -0
  568. package/dist/tests/shell/runner-slice.test.js +536 -0
  569. package/dist/tests/shell/runner-slice.test.js.map +1 -0
  570. package/dist/tests/shell/scaffold.test.js +65 -0
  571. package/dist/tests/shell/scaffold.test.js.map +1 -0
  572. package/dist/tests/shell/tick-config.test.js +83 -0
  573. package/dist/tests/shell/tick-config.test.js.map +1 -0
  574. package/dist/tests/shell/tracker-parse-dates.test.js +44 -0
  575. package/dist/tests/shell/tracker-parse-dates.test.js.map +1 -0
  576. package/dist/tests/shell/tracker-write-issue.test.js +154 -0
  577. package/dist/tests/shell/tracker-write-issue.test.js.map +1 -0
  578. package/dist/tests/shell/workflow-prompt-split.test.js +208 -0
  579. package/dist/tests/shell/workflow-prompt-split.test.js.map +1 -0
  580. package/dist/tests/shell/workspace-live-config.test.js +140 -0
  581. package/dist/tests/shell/workspace-live-config.test.js.map +1 -0
  582. package/package.json +21 -9
  583. package/patches/@earendil-works+gondolin+0.12.0.patch +173 -0
  584. package/prompts/Reflect.md +91 -0
  585. package/prompts/Review.md +97 -0
  586. package/prompts/Todo.md +96 -0
  587. package/prompts/_footer.md +41 -0
  588. package/prompts/_preamble.md +42 -0
  589. package/prompts-minimal/Todo.md +26 -0
  590. package/scripts/postinstall.mjs +63 -0
  591. package/scripts/vm-agent.mjs +312 -90
  592. package/WORKFLOW.md +0 -744
  593. package/dist/acp-bridge.js +0 -324
  594. package/dist/acp-bridge.js.map +0 -1
  595. package/dist/actions/cache.js +0 -191
  596. package/dist/actions/cache.js.map +0 -1
  597. package/dist/actions/effects.js +0 -41
  598. package/dist/actions/effects.js.map +0 -1
  599. package/dist/actions/executor.js +0 -570
  600. package/dist/actions/executor.js.map +0 -1
  601. package/dist/actions/index.js +0 -13
  602. package/dist/actions/index.js.map +0 -1
  603. package/dist/actions/parsing.js.map +0 -1
  604. package/dist/actions/predicate-env.js +0 -27
  605. package/dist/actions/predicate-env.js.map +0 -1
  606. package/dist/actions/predicates.js +0 -49
  607. package/dist/actions/predicates.js.map +0 -1
  608. package/dist/actions/templating.js +0 -66
  609. package/dist/actions/templating.js.map +0 -1
  610. package/dist/actions/types.js +0 -15
  611. package/dist/actions/types.js.map +0 -1
  612. package/dist/agent/acp.js +0 -473
  613. package/dist/agent/acp.js.map +0 -1
  614. package/dist/agent/adapter-names.js +0 -159
  615. package/dist/agent/adapter-names.js.map +0 -1
  616. package/dist/agent/adapters.js +0 -511
  617. package/dist/agent/adapters.js.map +0 -1
  618. package/dist/agent/credential-extractors.js +0 -342
  619. package/dist/agent/credential-extractors.js.map +0 -1
  620. package/dist/agent/credential-secrets.js +0 -628
  621. package/dist/agent/credential-secrets.js.map +0 -1
  622. package/dist/agent/credential-ticker.js +0 -57
  623. package/dist/agent/credential-ticker.js.map +0 -1
  624. package/dist/agent/gondolin-creds-staging.js +0 -356
  625. package/dist/agent/gondolin-creds-staging.js.map +0 -1
  626. package/dist/agent/gondolin-dispatch.js +0 -375
  627. package/dist/agent/gondolin-dispatch.js.map +0 -1
  628. package/dist/agent/gondolin.js +0 -124
  629. package/dist/agent/gondolin.js.map +0 -1
  630. package/dist/agent/runner-decisions.js +0 -134
  631. package/dist/agent/runner-decisions.js.map +0 -1
  632. package/dist/agent/runner.js +0 -1456
  633. package/dist/agent/runner.js.map +0 -1
  634. package/dist/agent/tool-call-summary.js +0 -102
  635. package/dist/agent/tool-call-summary.js.map +0 -1
  636. package/dist/agent/vm-acp-mapping.js +0 -73
  637. package/dist/agent/vm-acp-mapping.js.map +0 -1
  638. package/dist/agent/vm-guards.js +0 -262
  639. package/dist/agent/vm-guards.js.map +0 -1
  640. package/dist/agent/vm-port.js +0 -22
  641. package/dist/agent/vm-port.js.map +0 -1
  642. package/dist/agent/vm-process-registry.js +0 -79
  643. package/dist/agent/vm-process-registry.js.map +0 -1
  644. package/dist/bin/cli-args.js +0 -105
  645. package/dist/bin/cli-args.js.map +0 -1
  646. package/dist/bin/symphony.js +0 -794
  647. package/dist/bin/symphony.js.map +0 -1
  648. package/dist/errors.js +0 -15
  649. package/dist/errors.js.map +0 -1
  650. package/dist/http-disk.js +0 -135
  651. package/dist/http-disk.js.map +0 -1
  652. package/dist/http-handlers.js.map +0 -1
  653. package/dist/http.js.map +0 -1
  654. package/dist/issues.js +0 -178
  655. package/dist/issues.js.map +0 -1
  656. package/dist/logging.js +0 -203
  657. package/dist/logging.js.map +0 -1
  658. package/dist/mcp.js +0 -706
  659. package/dist/mcp.js.map +0 -1
  660. package/dist/memory.js +0 -85
  661. package/dist/memory.js.map +0 -1
  662. package/dist/orchestrator-decisions.js +0 -331
  663. package/dist/orchestrator-decisions.js.map +0 -1
  664. package/dist/orchestrator.js +0 -1569
  665. package/dist/orchestrator.js.map +0 -1
  666. package/dist/prompt.js +0 -65
  667. package/dist/prompt.js.map +0 -1
  668. package/dist/reconciler/cache.js +0 -65
  669. package/dist/reconciler/cache.js.map +0 -1
  670. package/dist/reconciler/index.js +0 -448
  671. package/dist/reconciler/index.js.map +0 -1
  672. package/dist/reconciler/ledger.js +0 -131
  673. package/dist/reconciler/ledger.js.map +0 -1
  674. package/dist/reconciler/pr-adapters.js +0 -174
  675. package/dist/reconciler/pr-adapters.js.map +0 -1
  676. package/dist/reconciler/pr-decide.js.map +0 -1
  677. package/dist/reconciler/pr.js +0 -422
  678. package/dist/reconciler/pr.js.map +0 -1
  679. package/dist/reconciler/types.js +0 -12
  680. package/dist/reconciler/types.js.map +0 -1
  681. package/dist/reconciler/vm.js +0 -243
  682. package/dist/reconciler/vm.js.map +0 -1
  683. package/dist/reconciler/workspace-defaults.js +0 -83
  684. package/dist/reconciler/workspace-defaults.js.map +0 -1
  685. package/dist/reconciler/workspace.js +0 -272
  686. package/dist/reconciler/workspace.js.map +0 -1
  687. package/dist/runlog.js +0 -403
  688. package/dist/runlog.js.map +0 -1
  689. package/dist/scaffold.js +0 -165
  690. package/dist/scaffold.js.map +0 -1
  691. package/dist/trackers/local.js +0 -445
  692. package/dist/trackers/local.js.map +0 -1
  693. package/dist/trackers/types.js +0 -10
  694. package/dist/trackers/types.js.map +0 -1
  695. package/dist/types.js +0 -3
  696. package/dist/types.js.map +0 -1
  697. package/dist/util/clock.js +0 -12
  698. package/dist/util/clock.js.map +0 -1
  699. package/dist/util/crypto.js +0 -25
  700. package/dist/util/crypto.js.map +0 -1
  701. package/dist/util/frontmatter.js +0 -70
  702. package/dist/util/frontmatter.js.map +0 -1
  703. package/dist/util/fs-issues.js +0 -22
  704. package/dist/util/fs-issues.js.map +0 -1
  705. package/dist/util/process.js +0 -152
  706. package/dist/util/process.js.map +0 -1
  707. package/dist/util/workspace-key.js +0 -10
  708. package/dist/util/workspace-key.js.map +0 -1
  709. package/dist/workflow-loader.js +0 -147
  710. package/dist/workflow-loader.js.map +0 -1
  711. package/dist/workflow.js +0 -822
  712. package/dist/workflow.js.map +0 -1
  713. package/dist/workspace-types.js +0 -8
  714. package/dist/workspace-types.js.map +0 -1
  715. package/dist/workspace.js +0 -443
  716. package/dist/workspace.js.map +0 -1
@@ -0,0 +1 @@
1
+ {"version":3,"file":"vm.js","sourceRoot":"","sources":["../../../../src/shell/interp/vm.ts"],"names":[],"mappings":"AAAA,gFAAgF;AAChF,wCAAwC;AACxC,EAAE;AACF,gFAAgF;AAChF,mFAAmF;AACnF,kFAAkF;AAClF,yEAAyE;AACzE,iFAAiF;AACjF,4EAA4E;AAC5E,iFAAiF;AACjF,8EAA8E;AAC9E,iCAAiC;AACjC,EAAE;AACF,gFAAgF;AAChF,6EAA6E;AAE7E,OAAO,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AACzC,OAAO,EACL,EAAE,EACF,cAAc,EACd,gBAAgB,EAChB,YAAY,IAAI,oBAAoB,EACpC,UAAU,GAMX,MAAM,0BAA0B,CAAC;AAyBlC;;;;;GAKG;AACH,SAAS,eAAe,CAAC,QAA0C,EAAE,OAAe;IAClF,MAAM,GAAG,GAAG,IAAI,GAAG,EAAU,CAAC;IAC9B,KAAK,MAAM,GAAG,IAAI,QAAQ,EAAE,CAAC;QAC3B,IAAI,GAAG,IAAI,IAAI,IAAI,CAAC,MAAM,CAAC,aAAa,CAAC,GAAG,CAAC,IAAI,GAAG,IAAI,CAAC,IAAI,GAAG,KAAK,OAAO;YAAE,SAAS;QACvF,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;IACf,CAAC;IACD,OAAO,CAAC,GAAG,GAAG,CAAC,CAAC;AAClB,CAAC;AAED,MAAM,iBAAiB;IACJ,IAAI,GAAG,IAAI,GAAG,EAAc,CAAC;IAC7B,IAAI,CAAoD;IACxD,OAAO,CAAS;IAEjC,YAAY,OAAiC,EAAE;QAC7C,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,IAAI,IAAI,CAAC,CAAC,GAAG,EAAE,MAAM,EAAE,EAAE,CAA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AAC;IACtB,CAAC;CACF"}
@@ -0,0 +1,310 @@
1
+ // FCIS rewrite — WorkspaceEffect adapter (kind: adapter) implementing the
2
+ // `WorkspacePort` over the host filesystem + git/gh CLIs.
3
+ //
4
+ // Responsibility (ported from the read-only reference, NOT modified):
5
+ // • src/workspace.ts — ensureFor (per-identifier lock, assertContained
6
+ // guard, mkdir, canonical clone+branch+origin
7
+ // restore + restorePushedBranch on re-dispatch),
8
+ // fetchBaseInWorkspace, remove, workspacePathFor.
9
+ // • src/reconciler/workspace-defaults.ts — list (dirs under root) + inspect
10
+ // (HEAD / base-sha / dirty / commits-ahead).
11
+ //
12
+ // The central effect-interpreter routes the `workspace` family to this port
13
+ // (effect-interpreter.ts `workspace()`); ZERO decisions live here. Env-driven
14
+ // repo/base resolution (SYMPHONY_REPO / SYMPHONY_BASE_BRANCH / SYMPHONY_SOURCE_REPO)
15
+ // now lives in core — the port receives an ALREADY-RESOLVED `{ baseBranch,
16
+ // githubRepo }`, so this adapter only performs IO.
17
+ //
18
+ // Shell rule: imports from src/types/** ONLY. Git/gh spawn lifecycle is injected
19
+ // as a `ProcessRunner` port by the composition root, so this file stays a thin
20
+ // fs+verb mapper. NodeNext ESM with .js extensions on relative imports.
21
+ import { mkdir, rm, lstat, stat, readdir, writeFile, access } from 'node:fs/promises';
22
+ import path from 'node:path';
23
+ import { sanitizeWorkspaceKey } from '../workspace-key.js';
24
+ // Pinned commit identity for work the in-VM agent makes. Local-only so it never
25
+ // leaks into ~/.gitconfig. Mirrors workspace.ts resolveSetupOptions.
26
+ const GIT_IDENTITY = { name: 'symphony-agent', email: 'agent@symphony.local' };
27
+ // Network git verbs fail fast on a credential prompt rather than blocking
28
+ // (workspace.ts `noPrompt`).
29
+ const NO_PROMPT_ENV = { GIT_TERMINAL_PROMPT: '0' };
30
+ // Marker file (workspace-dir root) the runner drops when a terminal-state phase-8
31
+ // handoff push FAILED; the janitor stats it and RETAINS the dir so the only copy
32
+ // of the completed commit survives for manual push/recovery (issue 234). A dotfile
33
+ // at the clone root so an operator doing manual recovery sees it (and the reason)
34
+ // in a plain `ls -la`.
35
+ const HANDOFF_PENDING_MARKER = '.symphony-handoff-pending';
36
+ class WorkspaceError extends Error {
37
+ code;
38
+ constructor(code, message) {
39
+ super(message);
40
+ this.code = code;
41
+ this.name = 'WorkspaceError';
42
+ }
43
+ }
44
+ function workspacePathFor(root, identifier) {
45
+ const key = sanitizeWorkspaceKey(identifier);
46
+ if (key.length === 0) {
47
+ throw new WorkspaceError('invalid_workspace_key', `cannot sanitize identifier: ${identifier}`);
48
+ }
49
+ return path.join(root, key);
50
+ }
51
+ // git/gh runner pair bound to a single deps.process seam. `expect` throws on a
52
+ // non-zero exit; the bare runner returns the result for the caller to branch on.
53
+ function gitRunners(proc) {
54
+ const run = (argv, cwd, env) => proc.run(['git', ...argv], { cwd, env });
55
+ const expect = async (argv, cwd, env) => {
56
+ const r = await run(argv, cwd, env);
57
+ if (r.exit_code !== 0) {
58
+ throw new WorkspaceError('workspace_setup_git_failed', `git ${argv.join(' ')} exited ${r.exit_code}: ${(r.stderr.trim() || r.stdout.trim())}`);
59
+ }
60
+ return r;
61
+ };
62
+ return { run, expect };
63
+ }
64
+ // Restore an already-pushed agent/<id> branch into a fresh clone so a re-dispatch
65
+ // continues from pushed work. Returns false when there is no origin (local-only)
66
+ // or the remote branch genuinely doesn't exist yet (ls-remote exit 2 = first
67
+ // dispatch). Fails CLOSED on any other non-zero exit (128 transport/auth) so a
68
+ // later push can't force-with-lease over already-pushed work once origin recovers.
69
+ async function restorePushedBranch(git, wsPath, branch) {
70
+ const remoteCheck = await git.run(['remote', 'get-url', 'origin'], wsPath);
71
+ if (remoteCheck.exit_code !== 0)
72
+ return false;
73
+ // Probe the EXACT head ref (`refs/heads/<branch>`) — `ls-remote <branch>` does
74
+ // suffix matching and a colliding ref would false-positive.
75
+ const exists = await git.run(['ls-remote', '--exit-code', 'origin', `refs/heads/${branch}`], wsPath, NO_PROMPT_ENV);
76
+ if (exists.exit_code === 2)
77
+ return false; // reached remote, no such ref → cut fresh
78
+ if (exists.exit_code !== 0) {
79
+ throw new WorkspaceError('workspace_setup_origin_unreachable', `git ls-remote origin ${branch} failed (exit ${exists.exit_code}): ${(exists.stderr || exists.stdout).trim()}`);
80
+ }
81
+ // Fetch the EXACT head ref (a bare <branch> refspec could resolve a same-named tag).
82
+ const fetched = await git.run(['fetch', '--no-tags', 'origin', `refs/heads/${branch}`], wsPath, NO_PROMPT_ENV);
83
+ if (fetched.exit_code !== 0) {
84
+ throw new WorkspaceError('workspace_setup_branch_fetch_failed', `git fetch origin ${branch} failed (exit ${fetched.exit_code}): ${(fetched.stderr || fetched.stdout).trim()}`);
85
+ }
86
+ await git.expect(['checkout', '-b', branch, 'FETCH_HEAD'], wsPath);
87
+ return true;
88
+ }
89
+ // Canonical per-issue clone+branch+remote setup (workspace.ts setupWorkspaceDir).
90
+ // `wsPath` exists and is empty; on failure the caller unwinds the dir.
91
+ async function setup(deps, git, wsPath, baseBranch, branch, githubRepo) {
92
+ // 1. Source repo must look like a git repo. Read the LIVE source repo so a
93
+ // reloaded workflow_dir is honoured.
94
+ const sourceRepo = deps.sourceRepo();
95
+ try {
96
+ const st = await stat(path.join(sourceRepo, '.git'));
97
+ if (!st.isDirectory() && !st.isFile())
98
+ throw new Error('not a git dir');
99
+ }
100
+ catch (err) {
101
+ throw new WorkspaceError('workspace_setup_no_source_repo', `source repo ${sourceRepo} is not a git repository: ${err.message}`);
102
+ }
103
+ // 2. Hardlinked, narrow-refspec clone landing on base (`.` cwd = wsPath).
104
+ await git.expect(['clone', '--local', '--no-tags', '--branch', baseBranch, sourceRepo, '.'], wsPath);
105
+ // 3. Strip every remote the clone copied (network targets stay zero) + unset
106
+ // any inherited credential.helper (best-effort: empty config → exit 5).
107
+ const remotes = await git.expect(['remote'], wsPath);
108
+ for (const remote of remotes.stdout.split(/\r?\n/).map((r) => r.trim()).filter((r) => r.length > 0)) {
109
+ await git.expect(['remote', 'remove', remote], wsPath);
110
+ }
111
+ await git.run(['config', '--local', '--unset', 'credential.helper'], wsPath);
112
+ // 4. Conditional origin restore (PR mode): canonical HTTPS URL (no token; auth
113
+ // is the host's gh, never the VM). Deliberately NO origin fetch+reset — the
114
+ // source repo's local <base> is the canonical base ref (avoids drift false
115
+ // positives, see workspace.ts comment).
116
+ if (githubRepo && githubRepo.length > 0) {
117
+ await git.expect(['remote', 'add', 'origin', `https://github.com/${githubRepo}.git`], wsPath);
118
+ // gh auth setup-git best-effort: a host without gh still gets a usable origin.
119
+ await deps.process.run(['gh', 'auth', 'setup-git'], { cwd: wsPath });
120
+ }
121
+ // 5. Pin commit identity (local-only).
122
+ await git.expect(['config', '--local', 'user.name', GIT_IDENTITY.name], wsPath);
123
+ await git.expect(['config', '--local', 'user.email', GIT_IDENTITY.email], wsPath);
124
+ // 6. Land HEAD on the per-issue branch. On re-dispatch (origin/<branch> already
125
+ // pushed) restore it so the agent's pushed work is carried forward; else cut
126
+ // fresh. See restorePushedBranch for the non-converging loop this closes.
127
+ if (await restorePushedBranch(git, wsPath, branch))
128
+ return;
129
+ await git.expect(['checkout', '-b', branch], wsPath);
130
+ }
131
+ // Resolve (creating if missing) the workspace dir. Returns true when THIS call
132
+ // did the mkdir (gates one-time canonical setup). Rejects symlinks (containment
133
+ // risk) and non-directory entries.
134
+ async function ensureDirExists(wsPath) {
135
+ try {
136
+ // lstat (not stat): a symlink could redirect setup + the returned cwd
137
+ // outside the root, violating the §5.5 containment invariant.
138
+ const st = await lstat(wsPath);
139
+ if (st.isSymbolicLink()) {
140
+ throw new WorkspaceError('workspace_path_is_symlink', `workspace path ${wsPath} is a symlink; refusing to use`);
141
+ }
142
+ if (!st.isDirectory()) {
143
+ throw new WorkspaceError('workspace_path_not_directory', `expected directory at ${wsPath}, found a non-directory`);
144
+ }
145
+ return false;
146
+ }
147
+ catch (err) {
148
+ if (err.code === 'ENOENT') {
149
+ await mkdir(wsPath, { recursive: true });
150
+ return true;
151
+ }
152
+ throw err;
153
+ }
154
+ }
155
+ async function doEnsureFor(deps, git, identifier, opts) {
156
+ // Read the LIVE workspace root so a hot-reloaded workspace.root retargets here.
157
+ const root = deps.root();
158
+ await mkdir(root, { recursive: true });
159
+ const wsPath = workspacePathFor(root, identifier);
160
+ deps.assertContained(root, wsPath);
161
+ const createdNow = await ensureDirExists(wsPath);
162
+ if (createdNow) {
163
+ try {
164
+ await setup(deps, git, wsPath, opts.baseBranch, `agent/${identifier}`, opts.githubRepo);
165
+ }
166
+ catch (err) {
167
+ // Best-effort unwind so the next dispatch tick retries cleanly.
168
+ await rm(wsPath, { recursive: true, force: true }).catch(() => undefined);
169
+ throw err;
170
+ }
171
+ }
172
+ return { path: wsPath, created: createdNow };
173
+ }
174
+ // git inspection of one workspace for drift detection (workspace-defaults.ts
175
+ // defaultInspectWorkspace). HEAD-less / non-repo dirs return a null head so the
176
+ // janitor treats them as "don't touch". All git is workspace-local.
177
+ async function inspect(git, workspacePath, baseBranch) {
178
+ const head = await git.run(['rev-parse', 'HEAD'], workspacePath);
179
+ if (head.exit_code !== 0 || head.stdout.trim().length === 0) {
180
+ return { head: null, workspaceBaseSha: null, hasUncommitted: false, commitsAheadOfBase: 0 };
181
+ }
182
+ const headSha = head.stdout.trim();
183
+ const status = await git.run(['status', '--porcelain'], workspacePath);
184
+ const hasUncommitted = status.exit_code === 0 && status.stdout.length > 0;
185
+ const wsBase = await git.run(['rev-parse', baseBranch], workspacePath);
186
+ const workspaceBaseSha = wsBase.exit_code === 0 && wsBase.stdout.trim().length > 0 ? wsBase.stdout.trim() : null;
187
+ let aheadCount = 0;
188
+ if (workspaceBaseSha !== null) {
189
+ // `<base>..HEAD` walks only objects the workspace owns. Malformed-ref
190
+ // non-zero → 0 ahead rather than poisoning the snapshot.
191
+ const ahead = await git.run(['rev-list', '--count', `${workspaceBaseSha}..${headSha}`], workspacePath);
192
+ aheadCount = ahead.exit_code === 0 ? Number(ahead.stdout.trim()) || 0 : 0;
193
+ }
194
+ return { head: headSha, workspaceBaseSha, hasUncommitted, commitsAheadOfBase: aheadCount };
195
+ }
196
+ // Enumerate workspace dirs under root (workspace-defaults.ts
197
+ // defaultListWorkspaceDirs). Non-directories filtered out; ENOENT on root →
198
+ // empty (cold start). Other errors propagate (don't reap on a transient hiccup).
199
+ async function listDirs(root) {
200
+ let entries;
201
+ try {
202
+ entries = await readdir(root);
203
+ }
204
+ catch (err) {
205
+ if (err.code === 'ENOENT')
206
+ return [];
207
+ throw err;
208
+ }
209
+ const out = [];
210
+ for (const name of entries) {
211
+ const p = path.join(root, name);
212
+ try {
213
+ const st = await stat(p);
214
+ if (st.isDirectory())
215
+ out.push({ name, path: p });
216
+ }
217
+ catch {
218
+ // Entry vanished mid-pass; next reconcile picks it up.
219
+ }
220
+ }
221
+ return out;
222
+ }
223
+ /**
224
+ * Build the workspace adapter. Returns the {@link WorkspacePort} the central
225
+ * effect-interpreter drains the `workspace` family through. A per-identifier
226
+ * in-flight promise map coalesces concurrent `ensureFor` calls (dispatch runner
227
+ * + reconciler eager-create) into one `git clone --local` so they don't race on
228
+ * the same dir; the entry is removed in a `finally` so a re-dispatch re-enters.
229
+ */
230
+ export function createWorkspaceAdapter(deps) {
231
+ const git = gitRunners(deps.process);
232
+ const ensureInFlight = new Map();
233
+ return {
234
+ workspacePathFor: (identifier) => workspacePathFor(deps.root(), identifier),
235
+ workspaceKeyFor: sanitizeWorkspaceKey,
236
+ // Coalesce concurrent ensureFor for the same identifier into one setup pass.
237
+ // Key by the LIVE root + sanitized identifier: a WORKFLOW.yaml hot-reload that
238
+ // moves workspace.root mid-clone must NOT let a fresh ensureFor(id) reuse the
239
+ // stale promise still cloning into the OLD root — that would return a path
240
+ // under the wrong root. Including the live root in the key starts a fresh
241
+ // in-flight entry whenever the root changes (and the finally-delete uses the
242
+ // same captured key so the right entry is cleared).
243
+ async ensureFor(identifier, opts) {
244
+ const key = `${deps.root()}\0${sanitizeWorkspaceKey(identifier)}`;
245
+ const existing = ensureInFlight.get(key);
246
+ if (existing)
247
+ return existing;
248
+ const p = doEnsureFor(deps, git, identifier, opts);
249
+ ensureInFlight.set(key, p);
250
+ try {
251
+ return await p;
252
+ }
253
+ finally {
254
+ ensureInFlight.delete(key);
255
+ }
256
+ },
257
+ // Per-dispatch fetch of the workspace's base ref so the in-VM `git rebase
258
+ // origin/<base>` sees a current ref (workspace.ts fetchBaseInWorkspace). No-op
259
+ // when there's no origin (local-only). Throws on a configured-origin fetch
260
+ // failure so the caller aborts rather than launching against a stale ref.
261
+ async fetchBaseInWorkspace(workspacePath, baseBranch) {
262
+ const remoteCheck = await git.run(['remote', 'get-url', 'origin'], workspacePath);
263
+ if (remoteCheck.exit_code !== 0)
264
+ return; // local-only: nothing to fetch
265
+ const fetched = await git.run(['fetch', '--no-tags', 'origin', baseBranch], workspacePath, NO_PROMPT_ENV);
266
+ if (fetched.exit_code !== 0) {
267
+ throw new WorkspaceError('workspace_fetch_base_failed', `git fetch origin ${baseBranch} failed (exit ${fetched.exit_code}): ${(fetched.stderr || fetched.stdout).trim()}`);
268
+ }
269
+ },
270
+ // Best-effort fs removal of the per-issue dir. A symlink/non-directory at the
271
+ // path is a no-op (containment safety). `reason` is carried for the run log.
272
+ async remove(identifier, _reason) {
273
+ const root = deps.root();
274
+ const wsPath = workspacePathFor(root, identifier);
275
+ deps.assertContained(root, wsPath);
276
+ try {
277
+ const st = await lstat(wsPath);
278
+ if (st.isSymbolicLink() || !st.isDirectory())
279
+ return;
280
+ }
281
+ catch {
282
+ return; // ENOENT etc. → already gone
283
+ }
284
+ await rm(wsPath, { recursive: true, force: true });
285
+ },
286
+ inspect: (workspacePath, baseBranch) => inspect(git, workspacePath, baseBranch),
287
+ list: () => listDirs(deps.root()),
288
+ // Drop the handoff-pending marker into the per-issue dir (issue 234). Resolved +
289
+ // containment-guarded like remove(); the reason is the body so manual recovery
290
+ // can read why the push failed. No-op if the dir vanished (best-effort).
291
+ async markHandoffPending(identifier, reason) {
292
+ const root = deps.root();
293
+ const wsPath = workspacePathFor(root, identifier);
294
+ deps.assertContained(root, wsPath);
295
+ await writeFile(path.join(wsPath, HANDOFF_PENDING_MARKER), `${reason}\n`, 'utf8');
296
+ },
297
+ // Stat the marker for the janitor's retention gate. Any access error (ENOENT,
298
+ // the dir gone) reads as "no marker" → the dir reaps as today.
299
+ async hasHandoffPendingMarker(workspacePath) {
300
+ try {
301
+ await access(path.join(workspacePath, HANDOFF_PENDING_MARKER));
302
+ return true;
303
+ }
304
+ catch {
305
+ return false;
306
+ }
307
+ },
308
+ };
309
+ }
310
+ //# sourceMappingURL=workspace.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"workspace.js","sourceRoot":"","sources":["../../../../src/shell/interp/workspace.ts"],"names":[],"mappings":"AAAA,0EAA0E;AAC1E,0DAA0D;AAC1D,EAAE;AACF,sEAAsE;AACtE,oFAAoF;AACpF,iFAAiF;AACjF,oFAAoF;AACpF,qFAAqF;AACrF,8EAA8E;AAC9E,gFAAgF;AAChF,EAAE;AACF,4EAA4E;AAC5E,8EAA8E;AAC9E,qFAAqF;AACrF,2EAA2E;AAC3E,mDAAmD;AACnD,EAAE;AACF,iFAAiF;AACjF,+EAA+E;AAC/E,wEAAwE;AAExE,OAAO,EAAE,KAAK,EAAE,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AACtF,OAAO,IAAI,MAAM,WAAW,CAAC;AAI7B,OAAO,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAC;AAE3D,gFAAgF;AAChF,qEAAqE;AACrE,MAAM,YAAY,GAAG,EAAE,IAAI,EAAE,gBAAgB,EAAE,KAAK,EAAE,sBAAsB,EAAW,CAAC;AAExF,0EAA0E;AAC1E,6BAA6B;AAC7B,MAAM,aAAa,GAA2B,EAAE,mBAAmB,EAAE,GAAG,EAAE,CAAC;AAE3E,kFAAkF;AAClF,iFAAiF;AACjF,mFAAmF;AACnF,kFAAkF;AAClF,u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IAAI,CAAC;YACd,CAAC;YAAC,MAAM,CAAC;gBACP,OAAO,KAAK,CAAC;YACf,CAAC;QACH,CAAC;KACF,CAAC;AACJ,CAAC"}
@@ -0,0 +1,78 @@
1
+ // FCIS rewrite — ACP-substrate construction for the composition root (kind: shell).
2
+ //
3
+ // Builds the REAL {@link AcpPort} (createAcpInterpreter, shell/interp/acp.ts) over
4
+ // the `/acp` WebSocket, replacing the placeholderAcp() stub. The interpreter binds
5
+ // to the SAME {@link AcpWsRegistry} the unified HTTP server exposes on the `/acp`
6
+ // Upgrade (passed in as `input.registry` = a.acpWs from buildConcreteAdapters), so
7
+ // a guest dial-back resolves the Duplex the host SDK drives.
8
+ //
9
+ // The interpreter resolves `vmId → dispatch context` through a small mutable
10
+ // DISPATCH-CONTEXT registry the runner slice populates at per-dispatch bring-up:
11
+ // constructed empty here (no dispatch active until the runner registers one) and
12
+ // returned alongside the port so the runner slice can wire it.
13
+ //
14
+ // Core-free: imports src/types + sibling shell only — the pure `toolCallLifecycle`
15
+ // decider arrives injected via `input.core` (only the composition root imports core).
16
+ import { createAcpInterpreter } from './interp/acp.js';
17
+ /** The mutable per-dispatch context registry (runner writes; ACP interpreter reads). */
18
+ function createDispatchContextRegistry() {
19
+ const byVm = new Map();
20
+ return {
21
+ register: (vmId, ctx) => {
22
+ byVm.set(vmId, ctx);
23
+ },
24
+ deregister: (vmId) => {
25
+ byVm.delete(vmId);
26
+ },
27
+ contextForVm: (vmId) => byVm.get(vmId),
28
+ };
29
+ }
30
+ /**
31
+ * Construct the real ACP substrate. The returned `port` is the live AcpPort wired
32
+ * into the EffectAdapters bundle; `context` is the registry the runner slice
33
+ * populates so `sessionNew(vmId)` can resolve the dispatch's issue / workspace /
34
+ * MCP-server set. The `mcpServersFor` seam reads the SAME registry the runner
35
+ * populated (per-dispatch MCP servers), defaulting to none when MCP is disabled.
36
+ */
37
+ export function buildAcpSubstrate(input) {
38
+ const context = createDispatchContextRegistry();
39
+ const port = createAcpInterpreter({
40
+ toolCallLifecycle: input.core.toolCallLifecycle,
41
+ isTransportError: input.core.isTransportError,
42
+ selectPermissionOption: input.core.selectPermissionOption,
43
+ // vmId → the per-dispatch ACP context captured at bring-up (runner-populated):
44
+ // the issue/workspace identity AND the dial-back `accepted` stream of the WS
45
+ // registration the runner created BEFORE launch (token → launch env). The
46
+ // interpreter CONSUMES `accepted` in sessionNew — it never registers again.
47
+ contextForVm: (vmId) => {
48
+ const ctx = context.contextForVm(vmId);
49
+ return ctx
50
+ ? {
51
+ issueId: ctx.issueId,
52
+ identifier: ctx.identifier,
53
+ workspacePath: ctx.workspacePath,
54
+ accepted: ctx.accepted,
55
+ cancelAccept: ctx.cancelAccept,
56
+ }
57
+ : undefined;
58
+ },
59
+ // The per-dispatch MCP server set (registered alongside the context); when the
60
+ // dispatch ran with mcp disabled OR no context is registered, expose none.
61
+ mcpServersFor: (vmId, opts) => {
62
+ if (!opts.mcpEnabled)
63
+ return [];
64
+ return context.contextForVm(vmId)?.mcpServers ?? [];
65
+ },
66
+ runlog: input.runlog,
67
+ readTimeoutMs: input.readTimeoutMs(),
68
+ promptTimeoutMs: input.promptTimeoutMs(),
69
+ connectTimeoutMs: input.connectTimeoutMs(),
70
+ iso: () => input.clock.iso(),
71
+ });
72
+ // Expose the host `/acp` WS registry so the runner slice can `register(issueId,
73
+ // identifier)` EARLY — before the agent launches — and thread the returned token
74
+ // into the launch env. (Was previously consumed only here for the late, racy
75
+ // in-sessionNew registration.)
76
+ return { port, context, registry: input.registry };
77
+ }
78
+ //# sourceMappingURL=main-acp.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"main-acp.js","sourceRoot":"","sources":["../../../src/shell/main-acp.ts"],"names":[],"mappings":"AAAA,oFAAoF;AACpF,EAAE;AACF,mFAAmF;AACnF,mFAAmF;AACnF,kFAAkF;AAClF,mFAAmF;AACnF,6DAA6D;AAC7D,EAAE;AACF,6EAA6E;AAC7E,iFAAiF;AACjF,iFAAiF;AACjF,+DAA+D;AAC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,CAAC,CAAC,SAAS,CAAC;QAChB,CAAC;QACD,+EAA+E;QAC/E,2EAA2E;QAC3E,aAAa,EAAE,CAAC,IAAI,EAAE,IAAI,EAAe,EAAE;YACzC,IAAI,CAAC,IAAI,CAAC,UAAU;gBAAE,OAAO,EAAE,CAAC;YAChC,OAAO,OAAO,CAAC,YAAY,CAAC,IAAI,CAAC,EAAE,UAAU,IAAI,EAAE,CAAC;QACtD,CAAC;QACD,MAAM,EAAE,KAAK,CAAC,MAAM;QACpB,aAAa,EAAE,KAAK,CAAC,aAAa,EAAE;QACpC,eAAe,EAAE,KAAK,CAAC,eAAe,EAAE;QACxC,gBAAgB,EAAE,KAAK,CAAC,gBAAgB,EAAE;QAC1C,GAAG,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC,KAAK,CAAC,GAAG,EAAE;KAC7B,CAAC,CAAC;IAEH,gFAAgF;IAChF,iFAAiF;IACjF,6EAA6E;IAC7E,+BAA+B;IAC/B,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,QAAQ,EAAE,KAAK,CAAC,QAAQ,EAAE,CAAC;AACrD,CAAC"}
@@ -0,0 +1,222 @@
1
+ // FCIS rewrite — adapter construction for the composition root (kind: shell).
2
+ //
3
+ // Sliced out of src/shell/main.ts so the root keeps only the core-wiring under
4
+ // the max-lines budget. This module constructs the resolvable adapters + the
5
+ // deterministic seams and folds them into the EffectAdapters bundle the central
6
+ // interpreter routes through. It imports NO core (only the root may) — every
7
+ // pure decider arrives already injected by the root.
8
+ //
9
+ // The real ACP client (main-acp.ts: createAcpInterpreter over the `/acp`
10
+ // WebSocket) + the host-only credential adapter (main-credential.ts:
11
+ // GondolinCredentialAdapter) are now LIVE: the root builds each substrate and
12
+ // injects the resolved port here. The remaining heavy / stateful sub-vocabularies
13
+ // (the live runner pipeline, PR autopilot, VM-reaper fold) are owned by their own
14
+ // shell slices and wired by the root once those slices stabilize; here they
15
+ // surface a clean `{ ok:false }` / honest fallback so the interpreter stays total
16
+ // and the scheduler reducer drains end-to-end while they land. The MCP runtime's
17
+ // `mcp_tool`-family applier (`applyMcpEffect`) IS wired now (main-mcp.ts); the
18
+ // root injects it so it shares the tracker move/write IO with the live runtime.
19
+ import path from 'node:path';
20
+ import process from 'node:process';
21
+ import { mkdir, readdir, rm, stat, writeFile, readFile, access } from 'node:fs/promises';
22
+ import { systemClock, tokenRandomSource, nodeCryptoEnv, nodeMemProbe } from './adapter/clock-random.js';
23
+ import { setLogFile } from './interp/log.js';
24
+ import { createProcessRunner, createProcessSignalPort } from './interp/process.js';
25
+ import { createTimerPort } from './interp/timer.js';
26
+ import { createGitAdapter } from './interp/git.js';
27
+ import { GhCliPort } from './interp/gh.js';
28
+ import { GondolinVmClient } from './interp/vm.js';
29
+ import { createTrackerAdapter } from './interp/tracker.js';
30
+ import { createWorkspaceAdapter } from './interp/workspace.js';
31
+ import { FsRunLogStore } from './interp/runlog.js';
32
+ import { AcpWsRegistry } from './interp/acp-ws.js';
33
+ /** Resolve the persistent log-file path: env override > <logs.root>/symphony.log. */
34
+ export function resolveLogFile(envLogFile, cfg) {
35
+ if (envLogFile === undefined)
36
+ return path.join(cfg.logs.root, 'symphony.log');
37
+ return envLogFile === '' ? null : envLogFile;
38
+ }
39
+ /**
40
+ * Point the persistent log sink at the resolved file for `cfg` and return a
41
+ * `retarget` closure for reloads. The startup banner names the file once; on a
42
+ * WORKFLOW.yaml edit the sink only moves when the resolved target actually
43
+ * changed (a `logs.root` edit with no SYMPHONY_LOG_FILE override — the override
44
+ * pins the path), and we print one short stdout line so the operator sees the new
45
+ * destination. Steady-state reloads stay silent.
46
+ */
47
+ export function wireLogSink(envLogFile, cfg) {
48
+ let current = resolveLogFile(envLogFile, cfg);
49
+ setLogFile(current);
50
+ return (next) => {
51
+ const nextFile = resolveLogFile(envLogFile, next);
52
+ if (nextFile === current)
53
+ return;
54
+ current = nextFile;
55
+ setLogFile(nextFile);
56
+ if (nextFile !== null)
57
+ process.stdout.write(`reloaded; logs → ${nextFile}\n`);
58
+ };
59
+ }
60
+ /**
61
+ * Construct the resolvable adapters + the four deterministic seams. `getCfg` is
62
+ * read lazily so each adapter sees the live (reloaded) config; `log` is the
63
+ * already-built structured sink.
64
+ */
65
+ export function buildConcreteAdapters(getCfg, log, resolveIssueMatch, core) {
66
+ const proc = createProcessRunner();
67
+ return {
68
+ clock: systemClock(),
69
+ random: tokenRandomSource(),
70
+ crypto: nodeCryptoEnv(),
71
+ mem: nodeMemProbe(core.parseMemAvailableMib),
72
+ process: proc,
73
+ signal: createProcessSignalPort(),
74
+ timer: createTimerPort(),
75
+ git: createGitAdapter({ process: proc }),
76
+ gh: new GhCliPort(proc, { repoSlug: () => getCfg().workspace.github_repo }),
77
+ vm: new GondolinVmClient(),
78
+ tracker: createTrackerAdapter({
79
+ config: () => getCfg().tracker,
80
+ log,
81
+ resolveMatch: resolveIssueMatch,
82
+ composeIssueFile: core.composeIssueFile,
83
+ pickNextNumericIdentifier: core.pickNextNumericIdentifier,
84
+ }),
85
+ workspace: createWorkspaceAdapter({
86
+ // LIVE closures (not boot snapshots) so a WORKFLOW.yaml hot-reload that moves
87
+ // workspace.root / workflow_dir retargets create/list/remove (finding #3).
88
+ // SYMPHONY_SOURCE_REPO still wins when set (a static env override).
89
+ root: () => getCfg().workspace.root,
90
+ sourceRepo: () => process.env.SYMPHONY_SOURCE_REPO ?? getCfg().workflow_dir,
91
+ process: proc,
92
+ assertContained: core.assertContained,
93
+ }),
94
+ runlog: new FsRunLogStore(log),
95
+ acpWs: new AcpWsRegistry({ log }),
96
+ };
97
+ }
98
+ /**
99
+ * Assemble the EffectAdapters bundle the central interpreter routes through. The
100
+ * resolvable adapters pass straight through; the remaining sub-vocabulary
101
+ * families are honest fallbacks (see file header) until their owning slice wires
102
+ * them through the root.
103
+ */
104
+ export function buildEffectAdapters(deps) {
105
+ const diskTracker = {
106
+ listIssues: (root) => deps.tracker.listIssues(root),
107
+ readIssue: (root, identifier) => deps.tracker.readIssue(root, identifier),
108
+ };
109
+ return {
110
+ tracker: deps.tracker,
111
+ diskTracker,
112
+ vm: deps.vm,
113
+ // The runner slice owns the live vmId→VmHandle table; no live attempts run
114
+ // through the root yet, so no handle resolves.
115
+ vmHandleFor: () => undefined,
116
+ // The REAL ACP port (over the `/acp` WebSocket) + host-only credential port,
117
+ // built in the main-acp / main-credential substrates and injected by the root.
118
+ acp: deps.acp,
119
+ git: deps.git,
120
+ gh: deps.gh,
121
+ classifyPushResult: deps.classifyPushResult,
122
+ parsePrNumberFromUrl: deps.parsePrNumberFromUrl,
123
+ fs: nodeIssueFs(),
124
+ workspace: deps.workspace,
125
+ credential: deps.credential,
126
+ log: deps.log,
127
+ runlog: deps.runlog,
128
+ timer: deps.timer,
129
+ signal: deps.signal,
130
+ process: deps.process,
131
+ // <logsRoot>/<identifier>.jsonl (REF sanitizeWorkspaceKey → file path).
132
+ runlogPathFor: (_issueId, identifier) => path.join(deps.logsRoot(), `${identifier}.jsonl`),
133
+ // PR autopilot + VM reaper appliers: the reconciler slice owns them (the PR
134
+ // pass + the SIGTERM→…→SIGKILL escalation drive the same instances). The root
135
+ // injects them here so a core-emitted `pr`/`reaper` Effect shares pass state;
136
+ // an honest fallback covers the (unwired) case so the interpreter stays total.
137
+ applyPrEffect: deps.applyPrEffect ?? (async () => ({ ok: false, error: 'pr autopilot not wired in composition root' })),
138
+ applyMcpEffect: deps.applyMcpEffect ?? (async () => ({ kind: 'move_failed', message: 'mcp runtime not wired in composition root' })),
139
+ // The `steering` family resolves/cancels the per-issue awaiter (the ONE live
140
+ // Promise); the root injects McpRuntime's so a steering Effect lands it.
141
+ steering: deps.steering,
142
+ // The `mcp` family activates/deactivates the per-dispatch active entry; the root
143
+ // injects the live McpRuntime so the runner's bracket effect mints/tears it down.
144
+ mcpLifecycle: deps.mcpLifecycle,
145
+ applyKillStep: deps.applyKillStep ?? (async () => ({ kind: 'gone' })),
146
+ ttyPromptLine: async (question) => {
147
+ const { promptLine } = await import('./interp/tty.js');
148
+ return promptLine(question);
149
+ },
150
+ ttyWrite: (text) => process.stdout.write(text),
151
+ };
152
+ }
153
+ /**
154
+ * Real node:fs/promises-backed IssueFs (issue files + predicate file_present
155
+ * probes + action body staging). The thin port the interpreter's fs family
156
+ * routes through; lives here rather than its own interp slice while that slice
157
+ * is unsliced.
158
+ */
159
+ export function nodeIssueFs() {
160
+ return {
161
+ mkdir: async (p, opts) => {
162
+ await mkdir(p, { recursive: opts.recursive });
163
+ },
164
+ readdir: (p) => readdir(p),
165
+ stat: async (p) => {
166
+ const st = await stat(p);
167
+ return { isDirectory: () => st.isDirectory() };
168
+ },
169
+ writeFile: (p, data, encoding) => writeFile(p, data, encoding),
170
+ readFile: (p, encoding) => readFile(p, encoding),
171
+ rm: (p, opts) => rm(p, { recursive: opts.recursive, force: opts.force }),
172
+ access: (p) => access(p)
173
+ .then(() => true)
174
+ .catch(() => false),
175
+ };
176
+ }
177
+ /**
178
+ * Minimal real RunningEntry the loop fills in until the runner slice supplies the
179
+ * pinned one (workspace path, pinned dispatch config, …). Carries the live
180
+ * `cancel` closure + the `active_tool_calls` Set the loop driver mutates directly.
181
+ */
182
+ export function buildPlaceholderEntry(plan, cancel) {
183
+ const issue = plan.issue;
184
+ return {
185
+ issue_id: issue.id,
186
+ identifier: issue.identifier,
187
+ issue,
188
+ session_id: null,
189
+ thread_id: null,
190
+ turn_id: null,
191
+ adapter_pid: null,
192
+ last_event: null,
193
+ last_event_at: null,
194
+ last_message: null,
195
+ input_tokens: 0,
196
+ output_tokens: 0,
197
+ total_tokens: 0,
198
+ last_reported_input_tokens: 0,
199
+ last_reported_output_tokens: 0,
200
+ last_reported_total_tokens: 0,
201
+ turn_count: 0,
202
+ retry_attempt: plan.attempt,
203
+ started_at: new Date().toISOString(),
204
+ workspace_path: '',
205
+ cancel,
206
+ recent_events: [],
207
+ last_error: null,
208
+ cleanup_workspace_on_exit: false,
209
+ mcp_token: null,
210
+ tracker_root_at_dispatch: plan.trackerRoot,
211
+ github_repo_at_dispatch: null,
212
+ base_branch_at_dispatch: '',
213
+ resolved_actor: '',
214
+ transitioned: false,
215
+ steering_requested: false,
216
+ steering_question: null,
217
+ steering_context: null,
218
+ active_tool_calls: new Set(),
219
+ last_transition: null,
220
+ };
221
+ }
222
+ //# sourceMappingURL=main-adapters.js.map