@pellux/goodvibes-sdk 0.38.0 → 1.1.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 (559) hide show
  1. package/dist/contracts/artifacts/operator-contract.json +4468 -916
  2. package/dist/daemon.d.ts +2 -0
  3. package/dist/daemon.d.ts.map +1 -1
  4. package/dist/daemon.js +4 -0
  5. package/dist/events/communication.d.ts +1 -1
  6. package/dist/events/surfaces.d.ts +25 -3
  7. package/dist/events/surfaces.d.ts.map +1 -1
  8. package/dist/events/surfaces.js +22 -1
  9. package/dist/events/workflows.d.ts +7 -6
  10. package/dist/events/workflows.d.ts.map +1 -1
  11. package/dist/index.d.ts +1 -1
  12. package/dist/index.d.ts.map +1 -1
  13. package/dist/platform/agents/archetypes.d.ts.map +1 -1
  14. package/dist/platform/agents/archetypes.js +7 -0
  15. package/dist/platform/agents/index.d.ts +1 -0
  16. package/dist/platform/agents/index.d.ts.map +1 -1
  17. package/dist/platform/agents/index.js +1 -0
  18. package/dist/platform/agents/orchestrator-runner.d.ts +16 -3
  19. package/dist/platform/agents/orchestrator-runner.d.ts.map +1 -1
  20. package/dist/platform/agents/orchestrator-runner.js +20 -6
  21. package/dist/platform/agents/orchestrator.d.ts +42 -10
  22. package/dist/platform/agents/orchestrator.d.ts.map +1 -1
  23. package/dist/platform/agents/orchestrator.js +68 -20
  24. package/dist/platform/agents/planner-decomposition-runner.d.ts +38 -0
  25. package/dist/platform/agents/planner-decomposition-runner.d.ts.map +1 -0
  26. package/dist/platform/agents/planner-decomposition-runner.js +113 -0
  27. package/dist/platform/agents/turn-knowledge-injection.d.ts +88 -3
  28. package/dist/platform/agents/turn-knowledge-injection.d.ts.map +1 -1
  29. package/dist/platform/agents/turn-knowledge-injection.js +147 -30
  30. package/dist/platform/agents/worktree.d.ts +126 -8
  31. package/dist/platform/agents/worktree.d.ts.map +1 -1
  32. package/dist/platform/agents/worktree.js +240 -19
  33. package/dist/platform/agents/wrfc-controller.d.ts +24 -1
  34. package/dist/platform/agents/wrfc-controller.d.ts.map +1 -1
  35. package/dist/platform/agents/wrfc-controller.js +161 -35
  36. package/dist/platform/agents/wrfc-gate-runtime.d.ts +9 -0
  37. package/dist/platform/agents/wrfc-gate-runtime.d.ts.map +1 -1
  38. package/dist/platform/agents/wrfc-gate-runtime.js +7 -3
  39. package/dist/platform/agents/wrfc-gates.d.ts +1 -1
  40. package/dist/platform/agents/wrfc-gates.d.ts.map +1 -1
  41. package/dist/platform/agents/wrfc-gates.js +7 -1
  42. package/dist/platform/agents/wrfc-types.d.ts +23 -3
  43. package/dist/platform/agents/wrfc-types.d.ts.map +1 -1
  44. package/dist/platform/automation/types.d.ts +9 -1
  45. package/dist/platform/automation/types.d.ts.map +1 -1
  46. package/dist/platform/calendar/calendar-api-shared.d.ts +25 -0
  47. package/dist/platform/calendar/calendar-api-shared.d.ts.map +1 -0
  48. package/dist/platform/calendar/calendar-api-shared.js +100 -0
  49. package/dist/platform/calendar/calendar-connector.d.ts +79 -0
  50. package/dist/platform/calendar/calendar-connector.d.ts.map +1 -0
  51. package/dist/platform/calendar/calendar-connector.js +155 -0
  52. package/dist/platform/calendar/google-calendar-api.d.ts +25 -0
  53. package/dist/platform/calendar/google-calendar-api.d.ts.map +1 -0
  54. package/dist/platform/calendar/google-calendar-api.js +89 -0
  55. package/dist/platform/calendar/http-fetch-adapter.d.ts +25 -0
  56. package/dist/platform/calendar/http-fetch-adapter.d.ts.map +1 -0
  57. package/dist/platform/calendar/http-fetch-adapter.js +25 -0
  58. package/dist/platform/calendar/ics-parser.d.ts +35 -0
  59. package/dist/platform/calendar/ics-parser.d.ts.map +1 -0
  60. package/dist/platform/calendar/ics-parser.js +236 -0
  61. package/dist/platform/calendar/index.d.ts +41 -0
  62. package/dist/platform/calendar/index.d.ts.map +1 -0
  63. package/dist/platform/calendar/index.js +49 -0
  64. package/dist/platform/calendar/merged-calendar-model.d.ts +67 -0
  65. package/dist/platform/calendar/merged-calendar-model.d.ts.map +1 -0
  66. package/dist/platform/calendar/merged-calendar-model.js +181 -0
  67. package/dist/platform/calendar/microsoft-graph-api.d.ts +25 -0
  68. package/dist/platform/calendar/microsoft-graph-api.d.ts.map +1 -0
  69. package/dist/platform/calendar/microsoft-graph-api.js +95 -0
  70. package/dist/platform/calendar/oauth-flow.d.ts +62 -0
  71. package/dist/platform/calendar/oauth-flow.d.ts.map +1 -0
  72. package/dist/platform/calendar/oauth-flow.js +305 -0
  73. package/dist/platform/calendar/oauth-providers.d.ts +43 -0
  74. package/dist/platform/calendar/oauth-providers.d.ts.map +1 -0
  75. package/dist/platform/calendar/oauth-providers.js +120 -0
  76. package/dist/platform/calendar/oauth-token-store.d.ts +72 -0
  77. package/dist/platform/calendar/oauth-token-store.d.ts.map +1 -0
  78. package/dist/platform/calendar/oauth-token-store.js +189 -0
  79. package/dist/platform/calendar/oauth-types.d.ts +274 -0
  80. package/dist/platform/calendar/oauth-types.d.ts.map +1 -0
  81. package/dist/platform/calendar/oauth-types.js +22 -0
  82. package/dist/platform/calendar/rrule.d.ts +39 -0
  83. package/dist/platform/calendar/rrule.d.ts.map +1 -0
  84. package/dist/platform/calendar/rrule.js +261 -0
  85. package/dist/platform/calendar/subscription-store.d.ts +118 -0
  86. package/dist/platform/calendar/subscription-store.d.ts.map +1 -0
  87. package/dist/platform/calendar/subscription-store.js +293 -0
  88. package/dist/platform/calendar/types.d.ts +170 -0
  89. package/dist/platform/calendar/types.d.ts.map +1 -0
  90. package/dist/platform/calendar/types.js +21 -0
  91. package/dist/platform/companion/companion-chat-attachments.d.ts +29 -0
  92. package/dist/platform/companion/companion-chat-attachments.d.ts.map +1 -0
  93. package/dist/platform/companion/companion-chat-attachments.js +121 -0
  94. package/dist/platform/companion/companion-chat-branching.d.ts +66 -0
  95. package/dist/platform/companion/companion-chat-branching.d.ts.map +1 -0
  96. package/dist/platform/companion/companion-chat-branching.js +142 -0
  97. package/dist/platform/companion/companion-chat-broker-bridge.d.ts +40 -0
  98. package/dist/platform/companion/companion-chat-broker-bridge.d.ts.map +1 -0
  99. package/dist/platform/companion/companion-chat-broker-bridge.js +14 -0
  100. package/dist/platform/companion/companion-chat-broker-sync.d.ts +38 -0
  101. package/dist/platform/companion/companion-chat-broker-sync.d.ts.map +1 -0
  102. package/dist/platform/companion/companion-chat-broker-sync.js +80 -0
  103. package/dist/platform/companion/companion-chat-gc.d.ts +63 -0
  104. package/dist/platform/companion/companion-chat-gc.d.ts.map +1 -0
  105. package/dist/platform/companion/companion-chat-gc.js +38 -0
  106. package/dist/platform/companion/companion-chat-manager.d.ts +91 -23
  107. package/dist/platform/companion/companion-chat-manager.d.ts.map +1 -1
  108. package/dist/platform/companion/companion-chat-manager.js +195 -223
  109. package/dist/platform/companion/companion-chat-persistence.d.ts +9 -1
  110. package/dist/platform/companion/companion-chat-persistence.d.ts.map +1 -1
  111. package/dist/platform/companion/companion-chat-persistence.js +10 -2
  112. package/dist/platform/companion/companion-chat-routes.d.ts +2 -1
  113. package/dist/platform/companion/companion-chat-routes.d.ts.map +1 -1
  114. package/dist/platform/companion/companion-chat-routes.js +113 -4
  115. package/dist/platform/companion/companion-chat-turn-execution.d.ts +61 -0
  116. package/dist/platform/companion/companion-chat-turn-execution.d.ts.map +1 -0
  117. package/dist/platform/companion/companion-chat-turn-execution.js +107 -0
  118. package/dist/platform/companion/companion-chat-types.d.ts +67 -0
  119. package/dist/platform/companion/companion-chat-types.d.ts.map +1 -1
  120. package/dist/platform/config/credential-status.d.ts +28 -0
  121. package/dist/platform/config/credential-status.d.ts.map +1 -0
  122. package/dist/platform/config/credential-status.js +75 -0
  123. package/dist/platform/config/index.d.ts +25 -0
  124. package/dist/platform/config/index.d.ts.map +1 -1
  125. package/dist/platform/config/index.js +18 -0
  126. package/dist/platform/config/manager.d.ts +9 -0
  127. package/dist/platform/config/manager.d.ts.map +1 -1
  128. package/dist/platform/config/manager.js +21 -2
  129. package/dist/platform/config/migrations.d.ts +48 -0
  130. package/dist/platform/config/migrations.d.ts.map +1 -0
  131. package/dist/platform/config/migrations.js +54 -0
  132. package/dist/platform/config/schema-domain-core.d.ts +10 -1
  133. package/dist/platform/config/schema-domain-core.d.ts.map +1 -1
  134. package/dist/platform/config/schema-domain-core.js +46 -3
  135. package/dist/platform/config/schema-domain-runtime.d.ts +8 -0
  136. package/dist/platform/config/schema-domain-runtime.d.ts.map +1 -1
  137. package/dist/platform/config/schema-domain-runtime.js +32 -0
  138. package/dist/platform/config/schema-types.d.ts +21 -7
  139. package/dist/platform/config/schema-types.d.ts.map +1 -1
  140. package/dist/platform/config/schema.d.ts.map +1 -1
  141. package/dist/platform/config/schema.js +2 -0
  142. package/dist/platform/control-plane/approval-broker.d.ts +11 -0
  143. package/dist/platform/control-plane/approval-broker.d.ts.map +1 -1
  144. package/dist/platform/control-plane/approval-broker.js +17 -1
  145. package/dist/platform/control-plane/approval-hunk-apply.d.ts +77 -0
  146. package/dist/platform/control-plane/approval-hunk-apply.d.ts.map +1 -0
  147. package/dist/platform/control-plane/approval-hunk-apply.js +80 -0
  148. package/dist/platform/control-plane/gateway-disabled-response.d.ts +20 -0
  149. package/dist/platform/control-plane/gateway-disabled-response.d.ts.map +1 -0
  150. package/dist/platform/control-plane/gateway-disabled-response.js +24 -0
  151. package/dist/platform/control-plane/gateway-scope-enforcement.d.ts +68 -0
  152. package/dist/platform/control-plane/gateway-scope-enforcement.d.ts.map +1 -0
  153. package/dist/platform/control-plane/gateway-scope-enforcement.js +91 -0
  154. package/dist/platform/control-plane/gateway-utils.d.ts +17 -0
  155. package/dist/platform/control-plane/gateway-utils.d.ts.map +1 -1
  156. package/dist/platform/control-plane/gateway-utils.js +30 -0
  157. package/dist/platform/control-plane/gateway.d.ts +12 -2
  158. package/dist/platform/control-plane/gateway.d.ts.map +1 -1
  159. package/dist/platform/control-plane/gateway.js +27 -31
  160. package/dist/platform/control-plane/index.d.ts +8 -1
  161. package/dist/platform/control-plane/index.d.ts.map +1 -1
  162. package/dist/platform/control-plane/index.js +8 -0
  163. package/dist/platform/control-plane/invoke-input-validation.d.ts +56 -0
  164. package/dist/platform/control-plane/invoke-input-validation.d.ts.map +1 -0
  165. package/dist/platform/control-plane/invoke-input-validation.js +163 -0
  166. package/dist/platform/control-plane/method-catalog-admin.d.ts.map +1 -1
  167. package/dist/platform/control-plane/method-catalog-admin.js +12 -1
  168. package/dist/platform/control-plane/method-catalog-calendar.d.ts +16 -0
  169. package/dist/platform/control-plane/method-catalog-calendar.d.ts.map +1 -1
  170. package/dist/platform/control-plane/method-catalog-calendar.js +21 -0
  171. package/dist/platform/control-plane/method-catalog-channels.d.ts.map +1 -1
  172. package/dist/platform/control-plane/method-catalog-channels.js +32 -3
  173. package/dist/platform/control-plane/method-catalog-control-automation.d.ts.map +1 -1
  174. package/dist/platform/control-plane/method-catalog-control-automation.js +19 -34
  175. package/dist/platform/control-plane/method-catalog-control-companion.d.ts +15 -0
  176. package/dist/platform/control-plane/method-catalog-control-companion.d.ts.map +1 -0
  177. package/dist/platform/control-plane/method-catalog-control-companion.js +176 -0
  178. package/dist/platform/control-plane/method-catalog-control-core.d.ts.map +1 -1
  179. package/dist/platform/control-plane/method-catalog-control-core.js +104 -122
  180. package/dist/platform/control-plane/method-catalog-control.d.ts.map +1 -1
  181. package/dist/platform/control-plane/method-catalog-control.js +4 -0
  182. package/dist/platform/control-plane/method-catalog-email.d.ts +17 -0
  183. package/dist/platform/control-plane/method-catalog-email.d.ts.map +1 -1
  184. package/dist/platform/control-plane/method-catalog-email.js +21 -0
  185. package/dist/platform/control-plane/method-catalog-events.d.ts +28 -0
  186. package/dist/platform/control-plane/method-catalog-events.d.ts.map +1 -1
  187. package/dist/platform/control-plane/method-catalog-events.js +74 -1
  188. package/dist/platform/control-plane/method-catalog-fleet.d.ts +24 -0
  189. package/dist/platform/control-plane/method-catalog-fleet.d.ts.map +1 -0
  190. package/dist/platform/control-plane/method-catalog-fleet.js +65 -0
  191. package/dist/platform/control-plane/method-catalog-push.d.ts +30 -0
  192. package/dist/platform/control-plane/method-catalog-push.d.ts.map +1 -0
  193. package/dist/platform/control-plane/method-catalog-push.js +80 -0
  194. package/dist/platform/control-plane/method-catalog-route-reconcile.d.ts +84 -0
  195. package/dist/platform/control-plane/method-catalog-route-reconcile.d.ts.map +1 -0
  196. package/dist/platform/control-plane/method-catalog-route-reconcile.js +103 -0
  197. package/dist/platform/control-plane/method-catalog-runtime.d.ts.map +1 -1
  198. package/dist/platform/control-plane/method-catalog-runtime.js +83 -1
  199. package/dist/platform/control-plane/method-catalog-shared.d.ts +29 -0
  200. package/dist/platform/control-plane/method-catalog-shared.d.ts.map +1 -1
  201. package/dist/platform/control-plane/method-catalog.d.ts +9 -0
  202. package/dist/platform/control-plane/method-catalog.d.ts.map +1 -1
  203. package/dist/platform/control-plane/method-catalog.js +34 -3
  204. package/dist/platform/control-plane/operator-contract-schemas-admin.d.ts +8 -0
  205. package/dist/platform/control-plane/operator-contract-schemas-admin.d.ts.map +1 -1
  206. package/dist/platform/control-plane/operator-contract-schemas-admin.js +22 -1
  207. package/dist/platform/control-plane/operator-contract-schemas-fleet.d.ts +18 -0
  208. package/dist/platform/control-plane/operator-contract-schemas-fleet.d.ts.map +1 -0
  209. package/dist/platform/control-plane/operator-contract-schemas-fleet.js +182 -0
  210. package/dist/platform/control-plane/operator-contract-schemas-permissions.d.ts.map +1 -1
  211. package/dist/platform/control-plane/operator-contract-schemas-permissions.js +5 -0
  212. package/dist/platform/control-plane/operator-contract-schemas-runtime.d.ts +37 -0
  213. package/dist/platform/control-plane/operator-contract-schemas-runtime.d.ts.map +1 -1
  214. package/dist/platform/control-plane/operator-contract-schemas-runtime.js +100 -3
  215. package/dist/platform/control-plane/operator-contract-schemas.d.ts +1 -0
  216. package/dist/platform/control-plane/operator-contract-schemas.d.ts.map +1 -1
  217. package/dist/platform/control-plane/operator-contract-schemas.js +1 -0
  218. package/dist/platform/control-plane/operator-contract.d.ts.map +1 -1
  219. package/dist/platform/control-plane/operator-contract.js +8 -0
  220. package/dist/platform/control-plane/routes/checkpoints.d.ts +39 -0
  221. package/dist/platform/control-plane/routes/checkpoints.d.ts.map +1 -0
  222. package/dist/platform/control-plane/routes/checkpoints.js +166 -0
  223. package/dist/platform/control-plane/routes/fleet.d.ts +53 -0
  224. package/dist/platform/control-plane/routes/fleet.d.ts.map +1 -0
  225. package/dist/platform/control-plane/routes/fleet.js +153 -0
  226. package/dist/platform/control-plane/routes/gateway-verb-error.d.ts +30 -0
  227. package/dist/platform/control-plane/routes/gateway-verb-error.d.ts.map +1 -0
  228. package/dist/platform/control-plane/routes/gateway-verb-error.js +36 -0
  229. package/dist/platform/control-plane/routes/index.d.ts +0 -6
  230. package/dist/platform/control-plane/routes/index.d.ts.map +1 -1
  231. package/dist/platform/control-plane/routes/index.js +5 -5
  232. package/dist/platform/control-plane/routes/invocation-params.d.ts +23 -0
  233. package/dist/platform/control-plane/routes/invocation-params.d.ts.map +1 -0
  234. package/dist/platform/control-plane/routes/invocation-params.js +9 -0
  235. package/dist/platform/control-plane/routes/push.d.ts +26 -0
  236. package/dist/platform/control-plane/routes/push.d.ts.map +1 -0
  237. package/dist/platform/control-plane/routes/push.js +104 -0
  238. package/dist/platform/control-plane/routes/register-gateway-verb-groups.d.ts +31 -0
  239. package/dist/platform/control-plane/routes/register-gateway-verb-groups.d.ts.map +1 -0
  240. package/dist/platform/control-plane/routes/register-gateway-verb-groups.js +16 -0
  241. package/dist/platform/control-plane/routes/register-w3-s2.d.ts +26 -0
  242. package/dist/platform/control-plane/routes/register-w3-s2.d.ts.map +1 -0
  243. package/dist/platform/control-plane/routes/register-w3-s2.js +8 -0
  244. package/dist/platform/control-plane/routes/session-search.d.ts +37 -0
  245. package/dist/platform/control-plane/routes/session-search.d.ts.map +1 -0
  246. package/dist/platform/control-plane/routes/session-search.js +113 -0
  247. package/dist/platform/control-plane/session-broker-gc.d.ts +16 -0
  248. package/dist/platform/control-plane/session-broker-gc.d.ts.map +1 -1
  249. package/dist/platform/control-plane/session-broker-gc.js +23 -6
  250. package/dist/platform/control-plane/session-broker-helpers.d.ts +3 -3
  251. package/dist/platform/control-plane/session-broker-helpers.d.ts.map +1 -1
  252. package/dist/platform/control-plane/session-broker-inputs.d.ts +18 -0
  253. package/dist/platform/control-plane/session-broker-inputs.d.ts.map +1 -1
  254. package/dist/platform/control-plane/session-broker-inputs.js +34 -0
  255. package/dist/platform/control-plane/session-broker-sessions.d.ts +102 -3
  256. package/dist/platform/control-plane/session-broker-sessions.d.ts.map +1 -1
  257. package/dist/platform/control-plane/session-broker-sessions.js +179 -5
  258. package/dist/platform/control-plane/session-broker-state.d.ts +20 -1
  259. package/dist/platform/control-plane/session-broker-state.d.ts.map +1 -1
  260. package/dist/platform/control-plane/session-broker-state.js +67 -5
  261. package/dist/platform/control-plane/session-broker.d.ts +51 -38
  262. package/dist/platform/control-plane/session-broker.d.ts.map +1 -1
  263. package/dist/platform/control-plane/session-broker.js +183 -75
  264. package/dist/platform/control-plane/session-store-importer.d.ts +57 -0
  265. package/dist/platform/control-plane/session-store-importer.d.ts.map +1 -0
  266. package/dist/platform/control-plane/session-store-importer.js +227 -0
  267. package/dist/platform/control-plane/session-types.d.ts +142 -7
  268. package/dist/platform/control-plane/session-types.d.ts.map +1 -1
  269. package/dist/platform/core/execution-plan.d.ts +43 -1
  270. package/dist/platform/core/execution-plan.d.ts.map +1 -1
  271. package/dist/platform/core/execution-plan.js +46 -10
  272. package/dist/platform/core/index.d.ts +1 -0
  273. package/dist/platform/core/index.d.ts.map +1 -1
  274. package/dist/platform/core/index.js +1 -0
  275. package/dist/platform/core/orchestrator-runtime.d.ts +23 -3
  276. package/dist/platform/core/orchestrator-runtime.d.ts.map +1 -1
  277. package/dist/platform/core/orchestrator-tool-runtime.d.ts +7 -0
  278. package/dist/platform/core/orchestrator-tool-runtime.d.ts.map +1 -1
  279. package/dist/platform/core/orchestrator-tool-runtime.js +10 -0
  280. package/dist/platform/core/orchestrator-turn-loop.d.ts +13 -6
  281. package/dist/platform/core/orchestrator-turn-loop.d.ts.map +1 -1
  282. package/dist/platform/core/orchestrator-turn-loop.js +29 -22
  283. package/dist/platform/core/orchestrator.d.ts +16 -10
  284. package/dist/platform/core/orchestrator.d.ts.map +1 -1
  285. package/dist/platform/core/orchestrator.js +23 -8
  286. package/dist/platform/core/plan-decomposition.d.ts +196 -0
  287. package/dist/platform/core/plan-decomposition.d.ts.map +1 -0
  288. package/dist/platform/core/plan-decomposition.js +417 -0
  289. package/dist/platform/core/plan-proposal.d.ts +39 -0
  290. package/dist/platform/core/plan-proposal.d.ts.map +1 -1
  291. package/dist/platform/core/wrfc-routing.d.ts +1 -0
  292. package/dist/platform/core/wrfc-routing.d.ts.map +1 -1
  293. package/dist/platform/core/wrfc-routing.js +51 -1
  294. package/dist/platform/daemon/boot.d.ts +69 -0
  295. package/dist/platform/daemon/boot.d.ts.map +1 -0
  296. package/dist/platform/daemon/boot.js +61 -0
  297. package/dist/platform/daemon/cli.js +2 -1
  298. package/dist/platform/daemon/control-plane.d.ts.map +1 -1
  299. package/dist/platform/daemon/control-plane.js +50 -1
  300. package/dist/platform/daemon/facade-composition.d.ts.map +1 -1
  301. package/dist/platform/daemon/facade-composition.js +6 -0
  302. package/dist/platform/daemon/facade.d.ts +15 -6
  303. package/dist/platform/daemon/facade.d.ts.map +1 -1
  304. package/dist/platform/daemon/facade.js +48 -43
  305. package/dist/platform/daemon/http/router-route-contexts.d.ts +1 -0
  306. package/dist/platform/daemon/http/router-route-contexts.d.ts.map +1 -1
  307. package/dist/platform/daemon/http/router-route-contexts.js +1 -0
  308. package/dist/platform/daemon/http/router-session-broker-adapter.d.ts +13 -0
  309. package/dist/platform/daemon/http/router-session-broker-adapter.d.ts.map +1 -0
  310. package/dist/platform/daemon/http/router-session-broker-adapter.js +27 -0
  311. package/dist/platform/daemon/http/router.d.ts +2 -1
  312. package/dist/platform/daemon/http/router.d.ts.map +1 -1
  313. package/dist/platform/daemon/http/router.js +42 -40
  314. package/dist/platform/daemon/http/runtime-route-types.d.ts +42 -4
  315. package/dist/platform/daemon/http/runtime-route-types.d.ts.map +1 -1
  316. package/dist/platform/daemon/http/webui-serving.d.ts +68 -0
  317. package/dist/platform/daemon/http/webui-serving.d.ts.map +1 -0
  318. package/dist/platform/daemon/http/webui-serving.js +230 -0
  319. package/dist/platform/daemon/index.d.ts +2 -0
  320. package/dist/platform/daemon/index.d.ts.map +1 -1
  321. package/dist/platform/daemon/index.js +1 -0
  322. package/dist/platform/daemon/service-manager.d.ts +16 -0
  323. package/dist/platform/daemon/service-manager.d.ts.map +1 -1
  324. package/dist/platform/daemon/service-manager.js +79 -15
  325. package/dist/platform/intelligence/tree-sitter/service.d.ts.map +1 -1
  326. package/dist/platform/intelligence/tree-sitter/service.js +16 -2
  327. package/dist/platform/knowledge/browser-history/readers.d.ts.map +1 -1
  328. package/dist/platform/knowledge/browser-history/readers.js +15 -5
  329. package/dist/platform/knowledge/knowledge-api.d.ts +1 -1
  330. package/dist/platform/knowledge/project-planning/service.d.ts +14 -1
  331. package/dist/platform/knowledge/project-planning/service.d.ts.map +1 -1
  332. package/dist/platform/knowledge/project-planning/service.js +77 -0
  333. package/dist/platform/knowledge/project-planning/types.d.ts +32 -0
  334. package/dist/platform/knowledge/project-planning/types.d.ts.map +1 -1
  335. package/dist/platform/orchestration/bookkeeping.d.ts +12 -0
  336. package/dist/platform/orchestration/bookkeeping.d.ts.map +1 -0
  337. package/dist/platform/orchestration/bookkeeping.js +91 -0
  338. package/dist/platform/orchestration/budget.d.ts +2 -2
  339. package/dist/platform/orchestration/cancellation.d.ts +2 -2
  340. package/dist/platform/orchestration/controller-compat.d.ts +16 -3
  341. package/dist/platform/orchestration/controller-compat.d.ts.map +1 -1
  342. package/dist/platform/orchestration/controller-compat.js +18 -4
  343. package/dist/platform/orchestration/dirty-guard.js +1 -1
  344. package/dist/platform/orchestration/engine.d.ts +26 -1
  345. package/dist/platform/orchestration/engine.d.ts.map +1 -1
  346. package/dist/platform/orchestration/engine.js +229 -25
  347. package/dist/platform/orchestration/index.d.ts +6 -4
  348. package/dist/platform/orchestration/index.d.ts.map +1 -1
  349. package/dist/platform/orchestration/index.js +3 -2
  350. package/dist/platform/orchestration/persistence.d.ts.map +1 -1
  351. package/dist/platform/orchestration/persistence.js +6 -3
  352. package/dist/platform/orchestration/phase-runner.d.ts +33 -6
  353. package/dist/platform/orchestration/phase-runner.d.ts.map +1 -1
  354. package/dist/platform/orchestration/phase-runner.js +98 -25
  355. package/dist/platform/orchestration/proposal-workstream.d.ts +56 -0
  356. package/dist/platform/orchestration/proposal-workstream.d.ts.map +1 -0
  357. package/dist/platform/orchestration/proposal-workstream.js +76 -0
  358. package/dist/platform/orchestration/scheduler.d.ts +20 -1
  359. package/dist/platform/orchestration/scheduler.d.ts.map +1 -1
  360. package/dist/platform/orchestration/scheduler.js +16 -0
  361. package/dist/platform/orchestration/types.d.ts +289 -4
  362. package/dist/platform/orchestration/types.d.ts.map +1 -1
  363. package/dist/platform/orchestration/types.js +32 -0
  364. package/dist/platform/orchestration/worktree-isolation.d.ts +33 -0
  365. package/dist/platform/orchestration/worktree-isolation.d.ts.map +1 -0
  366. package/dist/platform/orchestration/worktree-isolation.js +248 -0
  367. package/dist/platform/presentation/glyphs.d.ts +91 -0
  368. package/dist/platform/presentation/glyphs.d.ts.map +1 -0
  369. package/dist/platform/presentation/glyphs.js +93 -0
  370. package/dist/platform/presentation/index.d.ts +28 -0
  371. package/dist/platform/presentation/index.d.ts.map +1 -0
  372. package/dist/platform/presentation/index.js +27 -0
  373. package/dist/platform/presentation/thinking-phrases.d.ts +12 -0
  374. package/dist/platform/presentation/thinking-phrases.d.ts.map +1 -0
  375. package/dist/platform/presentation/thinking-phrases.js +32 -0
  376. package/dist/platform/presentation/tones.d.ts +121 -0
  377. package/dist/platform/presentation/tones.d.ts.map +1 -0
  378. package/dist/platform/presentation/tones.js +145 -0
  379. package/dist/platform/presentation/waiting-wording.d.ts +54 -0
  380. package/dist/platform/presentation/waiting-wording.d.ts.map +1 -0
  381. package/dist/platform/presentation/waiting-wording.js +51 -0
  382. package/dist/platform/providers/runtime-snapshot.d.ts.map +1 -1
  383. package/dist/platform/providers/runtime-snapshot.js +12 -2
  384. package/dist/platform/push/delivery.d.ts +48 -0
  385. package/dist/platform/push/delivery.d.ts.map +1 -0
  386. package/dist/platform/push/delivery.js +117 -0
  387. package/dist/platform/push/encryption.d.ts +41 -0
  388. package/dist/platform/push/encryption.d.ts.map +1 -0
  389. package/dist/platform/push/encryption.js +82 -0
  390. package/dist/platform/push/index.d.ts +17 -0
  391. package/dist/platform/push/index.d.ts.map +1 -0
  392. package/dist/platform/push/index.js +10 -0
  393. package/dist/platform/push/service.d.ts +75 -0
  394. package/dist/platform/push/service.d.ts.map +1 -0
  395. package/dist/platform/push/service.js +95 -0
  396. package/dist/platform/push/subscription-store.d.ts +50 -0
  397. package/dist/platform/push/subscription-store.d.ts.map +1 -0
  398. package/dist/platform/push/subscription-store.js +123 -0
  399. package/dist/platform/push/types.d.ts +68 -0
  400. package/dist/platform/push/types.d.ts.map +1 -0
  401. package/dist/platform/push/types.js +13 -0
  402. package/dist/platform/push/vapid.d.ts +54 -0
  403. package/dist/platform/push/vapid.d.ts.map +1 -0
  404. package/dist/platform/push/vapid.js +113 -0
  405. package/dist/platform/runtime/bootstrap-services.d.ts +62 -2
  406. package/dist/platform/runtime/bootstrap-services.d.ts.map +1 -1
  407. package/dist/platform/runtime/bootstrap-services.js +217 -50
  408. package/dist/platform/runtime/daemon-version-compat.d.ts +39 -0
  409. package/dist/platform/runtime/daemon-version-compat.d.ts.map +1 -0
  410. package/dist/platform/runtime/daemon-version-compat.js +75 -0
  411. package/dist/platform/runtime/detached-daemon-runtime.d.ts +26 -0
  412. package/dist/platform/runtime/detached-daemon-runtime.d.ts.map +1 -0
  413. package/dist/platform/runtime/detached-daemon-runtime.js +49 -0
  414. package/dist/platform/runtime/emitters/workflows.d.ts +1 -1
  415. package/dist/platform/runtime/emitters/workflows.d.ts.map +1 -1
  416. package/dist/platform/runtime/events/index.d.ts +13 -0
  417. package/dist/platform/runtime/events/index.d.ts.map +1 -1
  418. package/dist/platform/runtime/events/index.js +13 -0
  419. package/dist/platform/runtime/feature-flags/flags.d.ts.map +1 -1
  420. package/dist/platform/runtime/feature-flags/flags.js +39 -1
  421. package/dist/platform/runtime/fleet/adapters/agent.d.ts +2 -2
  422. package/dist/platform/runtime/fleet/adapters/agent.d.ts.map +1 -1
  423. package/dist/platform/runtime/fleet/adapters/agent.js +4 -4
  424. package/dist/platform/runtime/fleet/adapters/automation.d.ts +1 -1
  425. package/dist/platform/runtime/fleet/adapters/automation.js +1 -1
  426. package/dist/platform/runtime/fleet/adapters/code-index.d.ts +1 -1
  427. package/dist/platform/runtime/fleet/adapters/code-index.js +1 -1
  428. package/dist/platform/runtime/fleet/adapters/orchestration.d.ts +40 -18
  429. package/dist/platform/runtime/fleet/adapters/orchestration.d.ts.map +1 -1
  430. package/dist/platform/runtime/fleet/adapters/orchestration.js +138 -34
  431. package/dist/platform/runtime/fleet/adapters/schedule.d.ts +4 -4
  432. package/dist/platform/runtime/fleet/adapters/schedule.js +4 -4
  433. package/dist/platform/runtime/fleet/adapters/trigger.d.ts +3 -4
  434. package/dist/platform/runtime/fleet/adapters/trigger.d.ts.map +1 -1
  435. package/dist/platform/runtime/fleet/adapters/trigger.js +3 -4
  436. package/dist/platform/runtime/fleet/adapters/wrfc.d.ts +13 -0
  437. package/dist/platform/runtime/fleet/adapters/wrfc.d.ts.map +1 -1
  438. package/dist/platform/runtime/fleet/adapters/wrfc.js +49 -2
  439. package/dist/platform/runtime/fleet/registry.d.ts +7 -7
  440. package/dist/platform/runtime/fleet/registry.d.ts.map +1 -1
  441. package/dist/platform/runtime/fleet/registry.js +41 -7
  442. package/dist/platform/runtime/fleet/types.d.ts +9 -9
  443. package/dist/platform/runtime/fleet/types.d.ts.map +1 -1
  444. package/dist/platform/runtime/memory-spine/client.d.ts +127 -0
  445. package/dist/platform/runtime/memory-spine/client.d.ts.map +1 -0
  446. package/dist/platform/runtime/memory-spine/client.js +113 -0
  447. package/dist/platform/runtime/memory-spine/index.d.ts +11 -0
  448. package/dist/platform/runtime/memory-spine/index.d.ts.map +1 -0
  449. package/dist/platform/runtime/memory-spine/index.js +10 -0
  450. package/dist/platform/runtime/operator-client.d.ts +20 -2
  451. package/dist/platform/runtime/operator-client.d.ts.map +1 -1
  452. package/dist/platform/runtime/operator-client.js +11 -1
  453. package/dist/platform/runtime/provider-accounts/registry.d.ts.map +1 -1
  454. package/dist/platform/runtime/provider-accounts/registry.js +11 -1
  455. package/dist/platform/runtime/services.d.ts +11 -9
  456. package/dist/platform/runtime/services.d.ts.map +1 -1
  457. package/dist/platform/runtime/services.js +24 -9
  458. package/dist/platform/runtime/session-spine/client.d.ts +234 -0
  459. package/dist/platform/runtime/session-spine/client.d.ts.map +1 -0
  460. package/dist/platform/runtime/session-spine/client.js +449 -0
  461. package/dist/platform/runtime/session-spine/index.d.ts +12 -0
  462. package/dist/platform/runtime/session-spine/index.d.ts.map +1 -0
  463. package/dist/platform/runtime/session-spine/index.js +11 -0
  464. package/dist/platform/runtime/session-spine/union-cache.d.ts +225 -0
  465. package/dist/platform/runtime/session-spine/union-cache.d.ts.map +1 -0
  466. package/dist/platform/runtime/session-spine/union-cache.js +333 -0
  467. package/dist/platform/runtime/shell-command-ops.d.ts +3 -1
  468. package/dist/platform/runtime/shell-command-ops.d.ts.map +1 -1
  469. package/dist/platform/runtime/transports/daemon-http-client-validators.d.ts.map +1 -1
  470. package/dist/platform/runtime/transports/daemon-http-client-validators.js +22 -0
  471. package/dist/platform/runtime/transports/daemon-http-client.d.ts.map +1 -1
  472. package/dist/platform/runtime/transports/daemon-http-client.js +25 -2
  473. package/dist/platform/runtime/transports/http-types.d.ts +9 -2
  474. package/dist/platform/runtime/transports/http-types.d.ts.map +1 -1
  475. package/dist/platform/state/canonical-memory.d.ts +95 -0
  476. package/dist/platform/state/canonical-memory.d.ts.map +1 -0
  477. package/dist/platform/state/canonical-memory.js +155 -0
  478. package/dist/platform/state/code-index-chunking.js +1 -1
  479. package/dist/platform/state/code-index-db.d.ts +1 -1
  480. package/dist/platform/state/code-index-reindex.d.ts +73 -0
  481. package/dist/platform/state/code-index-reindex.d.ts.map +1 -0
  482. package/dist/platform/state/code-index-reindex.js +156 -0
  483. package/dist/platform/state/code-index-store.d.ts.map +1 -1
  484. package/dist/platform/state/code-index-store.js +11 -3
  485. package/dist/platform/state/index.d.ts +8 -0
  486. package/dist/platform/state/index.d.ts.map +1 -1
  487. package/dist/platform/state/index.js +4 -0
  488. package/dist/platform/state/memory-recall-contract.d.ts +118 -0
  489. package/dist/platform/state/memory-recall-contract.d.ts.map +1 -0
  490. package/dist/platform/state/memory-recall-contract.js +170 -0
  491. package/dist/platform/state/memory-registry.d.ts +8 -0
  492. package/dist/platform/state/memory-registry.d.ts.map +1 -1
  493. package/dist/platform/state/memory-registry.js +10 -0
  494. package/dist/platform/state/memory-store.d.ts +2 -0
  495. package/dist/platform/state/memory-store.d.ts.map +1 -1
  496. package/dist/platform/state/memory-store.js +4 -0
  497. package/dist/platform/state/memory-vector-store.d.ts.map +1 -1
  498. package/dist/platform/state/memory-vector-store.js +14 -3
  499. package/dist/platform/state/sqlite-store.d.ts +2 -0
  500. package/dist/platform/state/sqlite-store.d.ts.map +1 -1
  501. package/dist/platform/state/sqlite-store.js +4 -0
  502. package/dist/platform/state/sqlite-vec-loader.d.ts +1 -1
  503. package/dist/platform/state/sqlite-vec-loader.js +1 -1
  504. package/dist/platform/state/vibe-projection.d.ts +67 -0
  505. package/dist/platform/state/vibe-projection.d.ts.map +1 -0
  506. package/dist/platform/state/vibe-projection.js +115 -0
  507. package/dist/platform/tools/agent/index.d.ts.map +1 -1
  508. package/dist/platform/tools/agent/index.js +8 -0
  509. package/dist/platform/tools/agent/manager.d.ts +22 -10
  510. package/dist/platform/tools/agent/manager.d.ts.map +1 -1
  511. package/dist/platform/tools/agent/manager.js +13 -7
  512. package/dist/platform/tools/agent/schema.d.ts +26 -0
  513. package/dist/platform/tools/agent/schema.d.ts.map +1 -1
  514. package/dist/platform/tools/agent/schema.js +2 -2
  515. package/dist/platform/tools/agent/wrfc-batch-policy.d.ts +13 -0
  516. package/dist/platform/tools/agent/wrfc-batch-policy.d.ts.map +1 -1
  517. package/dist/platform/tools/agent/wrfc-batch-policy.js +60 -0
  518. package/dist/platform/tools/exec/runtime.d.ts +10 -0
  519. package/dist/platform/tools/exec/runtime.d.ts.map +1 -1
  520. package/dist/platform/tools/exec/runtime.js +27 -10
  521. package/dist/platform/tools/exec/schema.d.ts +2 -2
  522. package/dist/platform/tools/exec/schema.d.ts.map +1 -1
  523. package/dist/platform/tools/exec/schema.js +2 -1
  524. package/dist/platform/tools/fetch/runtime.d.ts +1 -1
  525. package/dist/platform/tools/index.d.ts +2 -0
  526. package/dist/platform/tools/index.d.ts.map +1 -1
  527. package/dist/platform/tools/index.js +2 -0
  528. package/dist/platform/tools/registry.d.ts +1 -1
  529. package/dist/platform/tools/registry.js +1 -1
  530. package/dist/platform/tools/state/index.d.ts +9 -0
  531. package/dist/platform/tools/state/index.d.ts.map +1 -1
  532. package/dist/platform/tools/state/index.js +60 -3
  533. package/dist/platform/types/foundation-contract.d.ts +1 -1
  534. package/dist/platform/types/foundation-contract.d.ts.map +1 -1
  535. package/dist/platform/types/index.d.ts +1 -1
  536. package/dist/platform/types/index.d.ts.map +1 -1
  537. package/dist/platform/types/tools.d.ts +1 -1
  538. package/dist/platform/utils/request-body.d.ts.map +1 -1
  539. package/dist/platform/utils/request-body.js +50 -5
  540. package/dist/platform/version.js +1 -1
  541. package/package.json +25 -9
  542. package/dist/platform/control-plane/routes/automation.d.ts +0 -3
  543. package/dist/platform/control-plane/routes/automation.d.ts.map +0 -1
  544. package/dist/platform/control-plane/routes/automation.js +0 -63
  545. package/dist/platform/control-plane/routes/context.d.ts +0 -2
  546. package/dist/platform/control-plane/routes/context.d.ts.map +0 -1
  547. package/dist/platform/control-plane/routes/context.js +0 -1
  548. package/dist/platform/control-plane/routes/operator.d.ts +0 -8
  549. package/dist/platform/control-plane/routes/operator.d.ts.map +0 -1
  550. package/dist/platform/control-plane/routes/operator.js +0 -415
  551. package/dist/platform/control-plane/routes/remote.d.ts +0 -3
  552. package/dist/platform/control-plane/routes/remote.d.ts.map +0 -1
  553. package/dist/platform/control-plane/routes/remote.js +0 -35
  554. package/dist/platform/control-plane/routes/sessions.d.ts +0 -3
  555. package/dist/platform/control-plane/routes/sessions.d.ts.map +0 -1
  556. package/dist/platform/control-plane/routes/sessions.js +0 -43
  557. package/dist/platform/control-plane/routes/tasks.d.ts +0 -3
  558. package/dist/platform/control-plane/routes/tasks.d.ts.map +0 -1
  559. package/dist/platform/control-plane/routes/tasks.js +0 -22
@@ -14,6 +14,7 @@ import { isTransportFailureMessage } from '../types/errors.js';
14
14
  import { buildEngineerConstraintAddendum, } from './wrfc-prompt-addenda.js';
15
15
  import { completeWrfcOrchestrationNode, createWrfcWorkflowContext, emitWrfcAutoCommitted, emitWrfcCascadeAbort, emitWrfcChainCreated, emitWrfcChainPassed, emitWrfcConstraintsEnumerated, emitWrfcGraphCreated, emitWrfcScoreRegression, emitWrfcStateChanged, failWrfcOrchestrationNode, startWrfcOrchestrationNode, } from './wrfc-runtime-events.js';
16
16
  import { runWrfcGateChecks } from './wrfc-gate-runtime.js';
17
+ import { isFanoutShapeConstraintText } from '../tools/agent/wrfc-batch-policy.js';
17
18
  export { extractScoreFromText, extractPassedFromText, extractIssuesFromText } from './wrfc-reporting.js';
18
19
  /**
19
20
  * Schema version for the serialized WRFC chain envelope.
@@ -315,7 +316,7 @@ export class WrfcController {
315
316
  return true;
316
317
  }
317
318
  /**
318
- * Item d5 (Wave 6, wo-F): resurrection-safe zombie check for a chain about
319
+ * Item d5 (see CHANGELOG 0.38.0): resurrection-safe zombie check for a chain about
319
320
  * to be imported at rehydrate. A non-terminal chain whose ENTIRE roster
320
321
  * (allAgentIds) is absent from THIS process's live AgentManager never
321
322
  * survived the restart — no in-process execution is coming back to finish
@@ -769,14 +770,21 @@ export class WrfcController {
769
770
  this.cancelChain(chain, reason ?? 'WRFC owner agent cancelled');
770
771
  return;
771
772
  }
773
+ // A CANCELLED member agent means the whole chain was cancelled — an operator
774
+ // kill of any member (the fleet cascade cancels the running leaf first), or an
775
+ // explicit interrupt. That is an intended STOP, not a failure: cancel the chain
776
+ // so the chain row, owner row, cohort tally, and completion narration all read
777
+ // 'cancelled', not '✗ failed'. (Genuine agent CRASHES arrive as 'failed' via a
778
+ // separate path and still failChain — see onAgentFailed.) The controller's own
779
+ // cascade re-cancels are guarded by the isChainTerminal check above.
772
780
  this.setWrfcWorkPlanTaskStatus(chain, agentId, 'cancelled', reason ?? `Agent ${agentId} cancelled`);
773
- this.failChain(chain, reason ?? `Agent ${agentId} cancelled`);
781
+ this.cancelChain(chain, reason ?? `Agent ${agentId} cancelled`);
774
782
  }
775
783
  startReview(chain, report) {
776
784
  this.transition(chain, 'reviewing');
777
785
  // Prepend any synthetic issues from the controller (e.g. fixer constraint-continuity
778
786
  // violations) to the review task body, then clear them so they fire only once.
779
- let reviewTask = buildReviewTask(chain.id, chain.task, report, getWrfcScoreThreshold(this.configManager), chain.constraints);
787
+ let reviewTask = buildReviewTask(chain.id, chain.task, report, getWrfcScoreThreshold(this.configManager), this.reviewableConstraints(chain));
780
788
  if (chain.syntheticIssues?.length) {
781
789
  reviewTask = this.prependSyntheticIssues(chain.syntheticIssues, reviewTask);
782
790
  chain.syntheticIssues = [];
@@ -933,7 +941,16 @@ export class WrfcController {
933
941
  },
934
942
  });
935
943
  }
936
- evaluateConstraintSet(constraints, review) {
944
+ evaluateConstraintSet(allConstraints, review, systemUnsatisfiableIds = []) {
945
+ // System-unsatisfiable constraints (e.g. a "separate agent per file" constraint
946
+ // that a fan-out collapse invalidated) are removed from the rubric BEFORE
947
+ // accounting: they can never be counted as unsatisfied and can never force a
948
+ // failure, because no fix agent can satisfy a constraint whose precondition the
949
+ // system itself removed. This is the un-loopable guarantee (WO UX-A item 1c).
950
+ const excluded = systemUnsatisfiableIds.length > 0 ? new Set(systemUnsatisfiableIds) : null;
951
+ const constraints = excluded
952
+ ? allConstraints.filter((constraint) => !excluded.has(constraint.id))
953
+ : allConstraints;
937
954
  if (constraints.length === 0) {
938
955
  return {
939
956
  constraintsSatisfied: 0,
@@ -948,6 +965,11 @@ export class WrfcController {
948
965
  const ignoredConstraintFindingIds = [];
949
966
  for (const finding of review.constraintFindings ?? []) {
950
967
  if (!expectedIds.has(finding.constraintId)) {
968
+ // A finding for a system-unsatisfiable constraint is known-but-excluded, not
969
+ // unknown: drop it silently instead of injecting a "reviewed an unknown
970
+ // constraint" penalty.
971
+ if (excluded?.has(finding.constraintId))
972
+ continue;
951
973
  ignoredConstraintFindingIds.push(finding.constraintId);
952
974
  continue;
953
975
  }
@@ -975,7 +997,20 @@ export class WrfcController {
975
997
  };
976
998
  }
977
999
  evaluateConstraints(chain, review) {
978
- return this.evaluateConstraintSet(chain.constraints, review);
1000
+ return this.evaluateConstraintSet(chain.constraints, review, chain.systemUnsatisfiableConstraintIds ?? []);
1001
+ }
1002
+ /**
1003
+ * The constraints a reviewer/fixer is asked to verify: the full enumerated set
1004
+ * MINUS the ones a system action (a fan-out collapse) made unsatisfiable. Keeping
1005
+ * chain.constraints itself intact preserves fixer constraint-continuity checks;
1006
+ * only the rubric handed to review/gate-fix is narrowed.
1007
+ */
1008
+ reviewableConstraints(chain) {
1009
+ const excluded = chain.systemUnsatisfiableConstraintIds;
1010
+ if (!excluded || excluded.length === 0)
1011
+ return chain.constraints;
1012
+ const excludedSet = new Set(excluded);
1013
+ return chain.constraints.filter((constraint) => !excludedSet.has(constraint.id));
979
1014
  }
980
1015
  evaluateSubtaskConstraints(subtask, review) {
981
1016
  return this.evaluateConstraintSet(subtask.constraints, review);
@@ -1030,9 +1065,12 @@ export class WrfcController {
1030
1065
  chainId: chain.id,
1031
1066
  attempt: chain.fixAttempts,
1032
1067
  maxAttempts: maxGateRetries,
1033
- ...(chain.constraints.length > 0 ? { targetConstraintIds: chain.constraints.map((constraint) => constraint.id) } : {}),
1068
+ ...((() => {
1069
+ const reviewable = this.reviewableConstraints(chain);
1070
+ return reviewable.length > 0 ? { targetConstraintIds: reviewable.map((constraint) => constraint.id) } : {};
1071
+ })()),
1034
1072
  });
1035
- const gateFixTask = buildGateFailureTask(chain.id, chain.task, failedGates, chain.constraints);
1073
+ const gateFixTask = buildGateFailureTask(chain.id, chain.task, failedGates, this.reviewableConstraints(chain));
1036
1074
  const fixerRecord = this.spawnWrfcAgent(chain, 'fixer', 'engineer', gateFixTask, true);
1037
1075
  chain.fixerAgentId = fixerRecord.id;
1038
1076
  this.registerSpawnedChild(chain, fixerRecord, 'fixer');
@@ -1121,19 +1159,25 @@ export class WrfcController {
1121
1159
  }
1122
1160
  const commitCandidateIds = this.autoCommitCandidateAgentIds(chain);
1123
1161
  if (commitCandidateIds.length === 0) {
1124
- this.failChain(chain, 'autoCommit: no write-capable WRFC agent found on chain');
1162
+ // A structurally odd chain (no engineer/fixer/integrator) cannot be auto-committed, but the
1163
+ // full-scope review and gates already passed — that is what determines success. Surface the
1164
+ // miss as a warning on a passing chain rather than flipping a green chain to FAILED.
1165
+ logger.warn('WrfcController.autoCommit: no write-capable WRFC agent found on chain; skipping commit', {
1166
+ chainId: chain.id,
1167
+ });
1168
+ this.completeChainAsPassed(chain, 'commit skipped: no write-capable WRFC agent on chain');
1125
1169
  return;
1126
1170
  }
1127
1171
  if (!existsSync(join(this.projectRoot, '.git'))) {
1128
1172
  logger.debug('WrfcController.autoCommit: not a git repo, skipping commit', { chainId: chain.id });
1129
- this.completeChainAsPassed(chain);
1173
+ this.completeChainAsPassed(chain, 'commit skipped: not a git repository');
1130
1174
  return;
1131
1175
  }
1132
1176
  const worktree = this.createWorktree();
1133
- let completed = false;
1134
1177
  try {
1135
1178
  const commitMessage = this.buildAutoCommitMessage(chain, commitScope);
1136
- let directCommitHash = null;
1179
+ let commitResult = { hash: null, skippedIgnored: [] };
1180
+ let ledgerEmpty = false;
1137
1181
  if (worktree.commitWorkingTree) {
1138
1182
  if (commitScope === 'scoped') {
1139
1183
  const touchedPaths = this.collectChainTouchedPaths(chain);
@@ -1141,17 +1185,18 @@ export class WrfcController {
1141
1185
  // Do NOT fall back to a full-tree `--all` sweep here — an empty self-reported
1142
1186
  // ledger means we genuinely don't know what this chain touched, and committing
1143
1187
  // everything dirty in the working tree is exactly the trust bug this fixes.
1188
+ ledgerEmpty = true;
1144
1189
  logger.warn('WrfcController.autoCommit: commitScope is scoped but the chain edit ledger is empty; skipping commit rather than falling back to a full-tree sweep', {
1145
1190
  chainId: chain.id,
1146
1191
  });
1147
1192
  }
1148
1193
  else {
1149
- directCommitHash = await worktree.commitWorkingTree(commitMessage, touchedPaths);
1194
+ commitResult = await worktree.commitWorkingTree(commitMessage, touchedPaths);
1150
1195
  }
1151
1196
  }
1152
1197
  else {
1153
1198
  // commitScope === 'all': legacy full-tree sweep, no paths argument.
1154
- directCommitHash = await worktree.commitWorkingTree(commitMessage);
1199
+ commitResult = await worktree.commitWorkingTree(commitMessage);
1155
1200
  }
1156
1201
  }
1157
1202
  let mergedCount = 0;
@@ -1160,28 +1205,35 @@ export class WrfcController {
1160
1205
  mergedCount += 1;
1161
1206
  }
1162
1207
  }
1163
- const headHash = mergedCount > 0 && worktree.currentHead ? await worktree.currentHead() : directCommitHash;
1208
+ const headHash = mergedCount > 0 && worktree.currentHead ? await worktree.currentHead() : commitResult.hash;
1164
1209
  emitWrfcAutoCommitted(this.runtimeBus, this.sessionId, chain.id, headHash ?? undefined);
1165
- this.completeChainAsPassed(chain);
1166
- completed = true;
1210
+ const commitNote = this.describeCommitOutcome(headHash, commitResult.skippedIgnored, ledgerEmpty);
1211
+ this.completeChainAsPassed(chain, commitNote);
1167
1212
  logger.debug('WrfcController.autoCommit: success', {
1168
1213
  chainId: chain.id,
1169
1214
  commitCandidateIds,
1170
- directCommitHash,
1215
+ commitHash: commitResult.hash,
1216
+ skippedIgnored: commitResult.skippedIgnored,
1171
1217
  mergedCount,
1172
1218
  headHash,
1173
1219
  });
1174
1220
  }
1175
1221
  catch (error) {
1176
1222
  const reason = summarizeError(error);
1177
- logger.error('WrfcController.autoCommit: failed', { chainId: chain.id, error: reason });
1178
- this.failChain(chain, `autoCommit failed: ${reason}`);
1223
+ // Non-fatal: the full-scope review and quality gates already passed, so the chain SUCCEEDED.
1224
+ // A commit that could not complete (permissions, a rejecting hook, a dirty/locked index) is a
1225
+ // warning on a passing chain, never a flip to FAILED. AgentWorktree.commitWorkingTree already
1226
+ // reset the paths it staged before rethrowing, so the user's staging area is left clean.
1227
+ logger.warn('WrfcController.autoCommit: commit did not complete; completing chain as passed with a warning', {
1228
+ chainId: chain.id,
1229
+ error: reason,
1230
+ });
1231
+ this.completeChainAsPassed(chain, `commit failed (non-fatal): ${reason}`);
1179
1232
  }
1180
1233
  finally {
1181
- const cleanupIds = completed
1182
- ? chain.allAgentIds
1183
- : chain.allAgentIds.filter((id) => !commitCandidateIds.includes(id));
1184
- for (const id of cleanupIds) {
1234
+ // The chain has completed (passed) on every path above, so every agent's worktree can be
1235
+ // released regardless of whether the commit succeeded.
1236
+ for (const id of chain.allAgentIds) {
1185
1237
  worktree.cleanup(id).catch((error) => {
1186
1238
  logger.warn('WrfcController.autoCommit: cleanup failed', {
1187
1239
  agentId: id,
@@ -1191,6 +1243,26 @@ export class WrfcController {
1191
1243
  }
1192
1244
  }
1193
1245
  }
1246
+ /**
1247
+ * Render the commit outcome as an honest, single-line note for the chain-completion message.
1248
+ * Distinguishes a real commit (with any gitignored paths that were skipped) from the several
1249
+ * "nothing was committed" cases, so the completion message states the commit result plainly
1250
+ * instead of implying a commit happened when it did not.
1251
+ */
1252
+ describeCommitOutcome(headHash, skippedIgnored, ledgerEmpty) {
1253
+ const ignoredNote = skippedIgnored.length > 0
1254
+ ? `${skippedIgnored.length} ignored path${skippedIgnored.length === 1 ? '' : 's'} skipped`
1255
+ : null;
1256
+ if (headHash) {
1257
+ const shortHash = headHash.slice(0, 8);
1258
+ return ignoredNote ? `committed ${shortHash} (${ignoredNote})` : `committed ${shortHash}`;
1259
+ }
1260
+ if (ignoredNote)
1261
+ return `commit skipped: ${ignoredNote}`;
1262
+ if (ledgerEmpty)
1263
+ return 'commit skipped: chain edit ledger empty';
1264
+ return 'commit skipped: nothing to stage';
1265
+ }
1194
1266
  autoCommitCandidateAgentIds(chain) {
1195
1267
  const candidates = [];
1196
1268
  const add = (agentId) => {
@@ -1344,23 +1416,41 @@ export class WrfcController {
1344
1416
  if (wasActive) {
1345
1417
  this.activeChainCount = Math.max(0, this.activeChainCount - 1);
1346
1418
  }
1347
- chain.error = reason;
1419
+ // Honest completion narration: an operator cancellation summarises the work
1420
+ // that already landed on disk from the chain's edit ledger, mirroring the
1421
+ // dual-outcome message pattern used for a passed chain's commit note. So the
1422
+ // user sees "cancelled — N file(s) already modified on disk" rather than a bare
1423
+ // stop that hides in-flight edits.
1424
+ const landed = this.collectChainTouchedPaths(chain);
1425
+ const narration = landed.length > 0
1426
+ ? `${reason} — ${landed.length} file${landed.length === 1 ? '' : 's'} already modified on disk`
1427
+ : reason;
1428
+ chain.error = narration;
1429
+ // 'cancelled' failureKind flags this terminal-'failed' state as an intended
1430
+ // operator stop so every surface (fleet chain row, cohort tally, narration)
1431
+ // renders it as cancelled rather than a failure.
1432
+ chain.failureKind = 'cancelled';
1348
1433
  chain.completedAt = Date.now();
1349
1434
  chain.ownerTerminalEmitted = true;
1350
- this.setWrfcWorkPlanTaskStatus(chain, chain.ownerAgentId, 'cancelled', reason);
1351
- this.appendOwnerDecision(chain, 'chain_cancelled', reason, {
1435
+ this.setWrfcWorkPlanTaskStatus(chain, chain.ownerAgentId, 'cancelled', narration);
1436
+ this.appendOwnerDecision(chain, 'chain_cancelled', narration, {
1352
1437
  agentId: chain.ownerAgentId,
1353
1438
  });
1354
1439
  const owner = this.agentManager.getStatus(chain.ownerAgentId);
1355
- if (isAgentInFlight(owner)) {
1440
+ if (owner) {
1356
1441
  owner.status = 'cancelled';
1357
1442
  owner.completedAt = Date.now();
1358
- owner.progress = reason;
1443
+ owner.progress = narration;
1444
+ // Roll up member usage onto the owner (same as completeOwnerAgent) so the
1445
+ // owner row shows the chain's real, priceable token totals at cancel time
1446
+ // instead of the never-updated spawn-time zeros.
1447
+ owner.usage = this.aggregateChainUsage(chain);
1448
+ owner.toolCallCount = this.aggregateChainToolCallCount(chain);
1359
1449
  }
1360
1450
  this.cancelRunningChildren(chain);
1361
- this.workmap.append({ ts: new Date().toISOString(), wrfcId: chain.id, event: 'chain_failed', reason });
1362
- emitWorkflowChainFailed(this.runtimeBus, createWrfcWorkflowContext(this.sessionId, chain.id), { chainId: chain.id, reason });
1363
- logger.warn('WrfcController.cancelChain', { chainId: chain.id, reason });
1451
+ this.workmap.append({ ts: new Date().toISOString(), wrfcId: chain.id, event: 'chain_failed', reason: narration });
1452
+ emitWorkflowChainFailed(this.runtimeBus, createWrfcWorkflowContext(this.sessionId, chain.id), { chainId: chain.id, reason: narration, failureKind: 'cancelled' });
1453
+ logger.warn('WrfcController.cancelChain', { chainId: chain.id, reason: narration });
1364
1454
  this.scheduleChainCleanup(chain);
1365
1455
  this.safeDequeueNext();
1366
1456
  }
@@ -1476,6 +1566,7 @@ export class WrfcController {
1476
1566
  createdAt: Date.now(),
1477
1567
  transportRetryCount: 0,
1478
1568
  ...(subtasks.length > 1 ? { subtasks } : {}),
1569
+ ...(ownerRecord.fanoutCollapse ? { fanoutCollapse: ownerRecord.fanoutCollapse } : {}),
1479
1570
  };
1480
1571
  this.chains.set(chain.id, chain);
1481
1572
  emitWrfcGraphCreated(this.runtimeBus, this.sessionId, chain.id, `WRFC: ${ownerRecord.task}`);
@@ -1590,6 +1681,25 @@ export class WrfcController {
1590
1681
  if (!chain.constraintsEnumerated) {
1591
1682
  chain.constraints = isEngineerReportShape(report) ? (report.constraints ?? []) : [];
1592
1683
  chain.constraintsEnumerated = true;
1684
+ // Mechanically derive the system-unsatisfiable constraints from the collapse
1685
+ // action: only when this chain was created by collapsing a requested fan-out,
1686
+ // and only for constraints whose text describes the parallelism/spawn-count
1687
+ // topology the collapse removed. Such a constraint cannot be satisfied by ANY
1688
+ // fix agent (the precondition is gone), so it is excluded from the rubric and
1689
+ // can never fail the review — no fix-loop re-billing while chasing it.
1690
+ if (chain.fanoutCollapse) {
1691
+ const unsatisfiable = chain.constraints
1692
+ .filter((constraint) => isFanoutShapeConstraintText(constraint.text))
1693
+ .map((constraint) => constraint.id);
1694
+ if (unsatisfiable.length > 0) {
1695
+ chain.systemUnsatisfiableConstraintIds = unsatisfiable;
1696
+ logger.warn('WrfcController: excluded fan-out-collapse-invalidated constraints from review', {
1697
+ chainId: chain.id,
1698
+ systemUnsatisfiableConstraintIds: unsatisfiable,
1699
+ requestedAgentCount: chain.fanoutCollapse.requestedAgentCount,
1700
+ });
1701
+ }
1702
+ }
1593
1703
  emitWrfcConstraintsEnumerated(this.runtimeBus, this.sessionId, chain.id, chain.constraints);
1594
1704
  }
1595
1705
  else {
@@ -2049,19 +2159,35 @@ export class WrfcController {
2049
2159
  withRouteReason(baseReason, record) {
2050
2160
  return record.wrfcRouteReason ? `${baseReason}; route: ${record.wrfcRouteReason}` : baseReason;
2051
2161
  }
2052
- completeChainAsPassed(chain) {
2162
+ /**
2163
+ * Terminal success path — the ONE derivation point for a passing chain (its counterpart is
2164
+ * failChain). The chain's terminal status derives here from the full-scope review and quality
2165
+ * gates, never from the auto-commit result: the optional `commitNote` states the commit outcome
2166
+ * SEPARATELY in the completion message so a skipped/failed commit reads as a warning on a passing
2167
+ * chain, and can never contradict the "succeeded" verdict the transcript already showed.
2168
+ */
2169
+ completeChainAsPassed(chain, commitNote) {
2053
2170
  this.activeChainCount = Math.max(0, this.activeChainCount - 1);
2054
2171
  this.transition(chain, 'passed');
2055
2172
  chain.completedAt = Date.now();
2173
+ const reviewOutcome = this.describeReviewOutcome(chain);
2174
+ const summary = commitNote
2175
+ ? `WRFC chain ${chain.id} passed (${reviewOutcome}); ${commitNote}`
2176
+ : `WRFC chain ${chain.id} passed (${reviewOutcome})`;
2056
2177
  this.appendOwnerDecision(chain, 'chain_passed', 'WRFC full-scope review and quality gates passed', {
2057
2178
  agentId: chain.ownerAgentId,
2058
2179
  });
2059
2180
  this.setWrfcWorkPlanTaskStatus(chain, chain.ownerAgentId, 'done', 'WRFC full-scope review and quality gates passed');
2060
- this.completeOwnerAgent(chain, 'completed', `WRFC chain ${chain.id} passed`);
2181
+ this.completeOwnerAgent(chain, 'completed', summary);
2061
2182
  emitWrfcChainPassed(this.runtimeBus, this.sessionId, chain.id);
2062
2183
  this.scheduleChainCleanup(chain);
2063
2184
  this.safeDequeueNext();
2064
2185
  }
2186
+ /** The review outcome for the completion message — the last recorded review score out of 10, or a plain "review passed" for a chain with no numeric score on record. */
2187
+ describeReviewOutcome(chain) {
2188
+ const lastScore = chain.reviewScores.at(-1);
2189
+ return typeof lastScore === 'number' ? `review ${lastScore}/10` : 'review passed';
2190
+ }
2065
2191
  completeOwnerAgent(chain, status, message) {
2066
2192
  if (chain.ownerTerminalEmitted)
2067
2193
  return;
@@ -2078,8 +2204,8 @@ export class WrfcController {
2078
2204
  // default forever unless rolled up here from the real numbers its phase
2079
2205
  // agents accumulated. This is what makes AgentManager.getStatus()/list()
2080
2206
  // — the read path TUI per-agent surfaces actually use — return real data
2081
- // for the owner instead of the never-updated zeros (WO-305 wired the
2082
- // AGENT_COMPLETED.usage forwarding but nothing populated the source).
2207
+ // for the owner instead of the never-updated zeros (a previous fix wired
2208
+ // the AGENT_COMPLETED.usage forwarding but nothing populated the source).
2083
2209
  owner.usage = this.aggregateChainUsage(chain);
2084
2210
  owner.toolCallCount = this.aggregateChainToolCallCount(chain);
2085
2211
  chain.ownerTerminalEmitted = true;
@@ -7,6 +7,15 @@ export declare function runWrfcGateChecks(options: {
7
7
  readonly runtimeBus: RuntimeEventBus;
8
8
  readonly sessionId: string;
9
9
  readonly chainId: string;
10
+ /**
11
+ * Working directory to RUN the gate commands (and detect skip conditions) in
12
+ * (BIG-3 item 5). Defaults to `projectRoot`. In worktree-isolation mode the
13
+ * orchestration phase-runner passes the item's worktree path here, so gates
14
+ * execute against the item's isolated tree rather than the shared root —
15
+ * threaded exactly like the phantom-work guard's worktree path. Omitted ⇒
16
+ * projectRoot, i.e. shared-mode behavior unchanged.
17
+ */
18
+ readonly cwd?: string | undefined;
10
19
  readonly onResult?: ((results: readonly QualityGateResult[], result: QualityGateResult) => void) | undefined;
11
20
  }): Promise<QualityGateResult[]>;
12
21
  //# sourceMappingURL=wrfc-gate-runtime.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"wrfc-gate-runtime.d.ts","sourceRoot":"","sources":["../../../src/platform/agents/wrfc-gate-runtime.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAC1D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAElE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AASzD,wBAAsB,iBAAiB,CAAC,OAAO,EAAE;IAC/C,QAAQ,CAAC,aAAa,EAAE,IAAI,CAAC,aAAa,EAAE,KAAK,GAAG,aAAa,CAAC,CAAC;IACnE,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,UAAU,EAAE,eAAe,CAAC;IACrC,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,OAAO,EAAE,SAAS,iBAAiB,EAAE,EAAE,MAAM,EAAE,iBAAiB,KAAK,IAAI,CAAC,GAAG,SAAS,CAAC;CAC9G,GAAG,OAAO,CAAC,iBAAiB,EAAE,CAAC,CAuD/B"}
1
+ {"version":3,"file":"wrfc-gate-runtime.d.ts","sourceRoot":"","sources":["../../../src/platform/agents/wrfc-gate-runtime.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAC1D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAElE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AASzD,wBAAsB,iBAAiB,CAAC,OAAO,EAAE;IAC/C,QAAQ,CAAC,aAAa,EAAE,IAAI,CAAC,aAAa,EAAE,KAAK,GAAG,aAAa,CAAC,CAAC;IACnE,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,UAAU,EAAE,eAAe,CAAC;IACrC,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB;;;;;;;OAOG;IACH,QAAQ,CAAC,GAAG,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAClC,QAAQ,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,OAAO,EAAE,SAAS,iBAAiB,EAAE,EAAE,MAAM,EAAE,iBAAiB,KAAK,IAAI,CAAC,GAAG,SAAS,CAAC;CAC9G,GAAG,OAAO,CAAC,iBAAiB,EAAE,CAAC,CA2D/B"}
@@ -12,10 +12,14 @@ export async function runWrfcGateChecks(options) {
12
12
  chainId: options.chainId,
13
13
  gateCount: gates.length,
14
14
  });
15
- const pkgScripts = await loadPackageScripts(options.projectRoot);
15
+ // Resolve/detect/execute all relative to the gate cwd (worktree path in
16
+ // isolation mode, else projectRoot) so skip detection and command execution
17
+ // agree on which tree they're inspecting.
18
+ const gateCwd = options.cwd ?? options.projectRoot;
19
+ const pkgScripts = await loadPackageScripts(gateCwd);
16
20
  const results = [];
17
21
  for (const gate of gates) {
18
- const skipReason = getSkippedGateReason(gate.name, options.projectRoot, pkgScripts);
22
+ const skipReason = getSkippedGateReason(gate.name, gateCwd, pkgScripts);
19
23
  if (skipReason !== null) {
20
24
  const result = {
21
25
  gate: gate.name,
@@ -34,7 +38,7 @@ export async function runWrfcGateChecks(options) {
34
38
  continue;
35
39
  }
36
40
  const startedAt = Date.now();
37
- const { passed, output } = await executeGateCommand(gate.command);
41
+ const { passed, output } = await executeGateCommand(gate.command, options.cwd);
38
42
  const result = {
39
43
  gate: gate.name,
40
44
  passed,
@@ -1,7 +1,7 @@
1
1
  export declare const WRFC_GATE_TIMEOUT_MS = 120000;
2
2
  export declare function loadPackageScripts(cwd: string): Promise<Record<string, string>>;
3
3
  export declare function getSkippedGateReason(gateName: string, cwd: string, pkgScripts: Record<string, string>): string | null;
4
- export declare function executeGateCommand(command: string): Promise<{
4
+ export declare function executeGateCommand(command: string, cwd?: string): Promise<{
5
5
  passed: boolean;
6
6
  output: string;
7
7
  }>;
@@ -1 +1 @@
1
- {"version":3,"file":"wrfc-gates.d.ts","sourceRoot":"","sources":["../../../src/platform/agents/wrfc-gates.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,oBAAoB,SAAU,CAAC;AAE5C,wBAAsB,kBAAkB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CASrF;AAED,wBAAgB,oBAAoB,CAClC,QAAQ,EAAE,MAAM,EAChB,GAAG,EAAE,MAAM,EACX,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GACjC,MAAM,GAAG,IAAI,CAgBf;AAED,wBAAsB,kBAAkB,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC;IAAE,MAAM,EAAE,OAAO,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,CAAC,CA+BtG"}
1
+ {"version":3,"file":"wrfc-gates.d.ts","sourceRoot":"","sources":["../../../src/platform/agents/wrfc-gates.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,oBAAoB,SAAU,CAAC;AAE5C,wBAAsB,kBAAkB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CASrF;AAED,wBAAgB,oBAAoB,CAClC,QAAQ,EAAE,MAAM,EAChB,GAAG,EAAE,MAAM,EACX,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GACjC,MAAM,GAAG,IAAI,CAgBf;AAED,wBAAsB,kBAAkB,CAAC,OAAO,EAAE,MAAM,EAAE,GAAG,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC;IAAE,MAAM,EAAE,OAAO,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,CAAC,CAqCpH"}
@@ -33,11 +33,17 @@ export function getSkippedGateReason(gateName, cwd, pkgScripts) {
33
33
  return 'Skipped: no build script in package.json';
34
34
  return null;
35
35
  }
36
- export async function executeGateCommand(command) {
36
+ export async function executeGateCommand(command, cwd) {
37
37
  try {
38
+ // `cwd` (BIG-3 item 5): in worktree-isolation mode the caller passes the
39
+ // item's worktree path so the gate command runs INSIDE that worktree — its
40
+ // typecheck/lint/test (and any file it writes) see the item's isolated
41
+ // changes, not the shared projectRoot. Omitted (shared mode) ⇒ Bun.spawn
42
+ // inherits the process cwd exactly as before — shared-mode gates unchanged.
38
43
  const proc = Bun.spawn(['/bin/sh', '-c', command], {
39
44
  stdout: 'pipe',
40
45
  stderr: 'pipe',
46
+ ...(cwd ? { cwd } : {}),
41
47
  });
42
48
  const timer = setTimeout(() => {
43
49
  killGateProcess(proc, 'timeout');
@@ -1,5 +1,6 @@
1
1
  import type { CompletionReport, Constraint, ReviewerReport } from './completion-report.js';
2
2
  import type { AgentRecord } from '../tools/agent/index.js';
3
+ import type { FanoutCollapseInfo } from '../tools/agent/schema.js';
3
4
  /** Queued chain waiting to start. */
4
5
  export interface QueuedChain {
5
6
  record: AgentRecord;
@@ -14,10 +15,13 @@ export type WrfcOwnerDecisionAction = 'chain_created' | 'compound_started' | 'sp
14
15
  /**
15
16
  * Why a chain reached the terminal 'failed' state. Distinguishes a transport/network
16
17
  * blip (which gets one automatic retry, see WrfcChain.transportRetryCount) from an
17
- * ordinary review/gate rejection, so a consumer (e.g. the TUI) can render the two
18
- * differently instead of showing every failure identically.
18
+ * ordinary review/gate rejection and from an operator-initiated cancellation, so a
19
+ * consumer (e.g. the TUI) can render the three differently instead of showing every
20
+ * terminal-'failed' identically. 'cancelled' is an operator kill/interrupt of the
21
+ * chain — an intended stop, not a failure — and must read as cancelled at every
22
+ * surface (chain row, owner row, cohort tally, completion narration).
19
23
  */
20
- export type WrfcChainFailureKind = 'transport' | 'other';
24
+ export type WrfcChainFailureKind = 'transport' | 'other' | 'cancelled';
21
25
  export interface WrfcOwnerDecision {
22
26
  id: string;
23
27
  ts: string;
@@ -142,6 +146,22 @@ export interface WrfcChain {
142
146
  constraints: Constraint[];
143
147
  /** True once constraints have been captured and WORKFLOW_CONSTRAINTS_ENUMERATED has been emitted. */
144
148
  constraintsEnumerated: boolean;
149
+ /**
150
+ * Set when this chain was created by collapsing a requested multi-agent fan-out
151
+ * into one owner chain (schema.ts FanoutCollapseInfo). Its presence is what makes
152
+ * a parallelism/spawn-count constraint SYSTEM-UNSATISFIABLE — the collapse removed
153
+ * the precondition, so no fix agent can ever satisfy it.
154
+ */
155
+ fanoutCollapse?: FanoutCollapseInfo | undefined;
156
+ /**
157
+ * Constraint ids that no fix agent can satisfy because the system itself removed
158
+ * their precondition (e.g. the fan-out collapse invalidated a "separate agent per
159
+ * file / in parallel" constraint). Derived mechanically from fanoutCollapse at
160
+ * enumeration time. These are excluded from the review rubric, never counted as
161
+ * unsatisfied, and never entered into the fix-loop target set — an un-loopable
162
+ * constraint can never fail the review.
163
+ */
164
+ systemUnsatisfiableConstraintIds?: string[] | undefined;
145
165
  /**
146
166
  * Synthetic critical issues injected by the controller (e.g. fixer constraint-continuity
147
167
  * violations). Prepended to the next review task body, then cleared so they fire once per cycle.
@@ -1 +1 @@
1
- {"version":3,"file":"wrfc-types.d.ts","sourceRoot":"","sources":["../../../src/platform/agents/wrfc-types.ts"],"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M,CAAC;IAChB,OAAO,EAAE,OAAO,CAAC;CAClB;AAED,wCAAwC;AACxC,MAAM,WAAW,iBAAiB;IAChC,IAAI,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;IAC1B,MAAM,EAAE,OAAO,CAAC;IAChB,MAAM,EAAE,MAAM,CAAC;IACf,UAAU,EAAE,MAAM,CAAC;CACpB"}
@@ -3,10 +3,18 @@
3
3
  * Shared automation type vocabulary used across jobs, runs, routes, delivery,
4
4
  * watchers, and control-plane domains.
5
5
  */
6
+ import type { TransportSurfaceKind } from '../../events/surfaces.js';
6
7
  export type AutomationJobStatus = 'enabled' | 'paused' | 'error' | 'archived';
7
8
  export type AutomationRunStatus = 'queued' | 'running' | 'completed' | 'failed' | 'cancelled';
8
9
  export type AutomationRunTrigger = 'scheduled' | 'manual' | 'catch_up' | 'webhook' | 'surface' | 'watcher';
9
- export type AutomationSurfaceKind = 'tui' | 'web' | 'slack' | 'discord' | 'ntfy' | 'webhook' | 'homeassistant' | 'telegram' | 'google-chat' | 'signal' | 'whatsapp' | 'telephony' | 'imessage' | 'msteams' | 'bluebubbles' | 'mattermost' | 'matrix' | 'service';
10
+ /**
11
+ * The transport surface axis for routes, channels, and delivery. Collapsed onto
12
+ * the canonical {@link TransportSurfaceKind} (= the strict route-binding list in
13
+ * events/routes.ts) so there is no longer a parallel literal union to drift.
14
+ * This is the STRICT set — product surfaces (agent/webui/companion) live only on
15
+ * the wider {@link SurfaceKind} used by the participant/message identity axis.
16
+ */
17
+ export type AutomationSurfaceKind = TransportSurfaceKind;
10
18
  export type AutomationRouteKind = 'session' | 'thread' | 'channel' | 'message';
11
19
  export type AutomationSourceKind = 'schedule' | 'manual' | 'hook' | 'webhook' | 'surface' | 'watcher';
12
20
  export type AutomationExecutionKind = 'isolated' | 'current' | 'pinned' | 'background' | 'main';
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/platform/automation/types.ts"],"names":[],"mappings":"AAAA,qFAA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CAAC,UAAU,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IACzC,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,GAAG,kBAAkB,GAAG,eAAe,GAAG,SAAS,CAAC;CAChF;AAED,MAAM,WAAW,uBAAuB;IACtC,QAAQ,CAAC,IAAI,EAAE,qBAAqB,CAAC;IACrC,QAAQ,CAAC,sBAAsB,EAAE,MAAM,CAAC;IACxC,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IACzC,QAAQ,CAAC,oBAAoB,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;CACpD;AAED,MAAM,WAAW,mBAAmB;IAClC,QAAQ,CAAC,IAAI,EAAE,oBAAoB,CAAC;IACpC,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;CACrB"}
@@ -0,0 +1,25 @@
1
+ /**
2
+ * calendar-api-shared.ts — the bearer-auth HTTP helper and honest degraded-state
3
+ * mapping shared by the Google Calendar and Microsoft Graph clients. Every failed
4
+ * response is turned into a NAMED ApiDegradedState (never a generic throw): a 401 is
5
+ * `reconnect-needed`, a 403 that names a missing scope is `insufficient-scope` naming
6
+ * that scope, a 429 is `rate-limited` carrying the honored Retry-After, everything
7
+ * else is `provider-error` with the status.
8
+ */
9
+ import type { ApiDegradedState, CalendarProviderId, HttpFetch, HttpResponse } from './oauth-types.js';
10
+ /** A named, honest API failure. */
11
+ export declare class CalendarApiError extends Error {
12
+ readonly degraded: ApiDegradedState;
13
+ constructor(degraded: ApiDegradedState);
14
+ }
15
+ /** Map a non-OK response to a CalendarApiError with a named degraded state. */
16
+ export declare function errorFromResponse(res: HttpResponse, provider: CalendarProviderId): Promise<CalendarApiError>;
17
+ /** Issue a bearer-authorized request, throwing a CalendarApiError on failure. */
18
+ export declare function authedRequest(fetchImpl: HttpFetch, provider: CalendarProviderId, input: {
19
+ readonly url: string;
20
+ readonly method: 'GET' | 'POST';
21
+ readonly token: string;
22
+ readonly body?: unknown;
23
+ readonly extraHeaders?: Readonly<Record<string, string>>;
24
+ }): Promise<unknown>;
25
+ //# sourceMappingURL=calendar-api-shared.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"calendar-api-shared.d.ts","sourceRoot":"","sources":["../../../src/platform/calendar/calendar-api-shared.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAE,gBAAgB,EAAE,kBAAkB,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAEtG,mCAAmC;AACnC,qBAAa,gBAAiB,SAAQ,KAAK;IACzC,QAAQ,CAAC,QAAQ,EAAE,gBAAgB,CAAC;gBACxB,QAAQ,EAAE,gBAAgB;CAKvC;AA0BD,+EAA+E;AAC/E,wBAAsB,iBAAiB,CAAC,GAAG,EAAE,YAAY,EAAE,QAAQ,EAAE,kBAAkB,GAAG,OAAO,CAAC,gBAAgB,CAAC,CA2BlH;AAED,iFAAiF;AACjF,wBAAsB,aAAa,CACjC,SAAS,EAAE,SAAS,EACpB,QAAQ,EAAE,kBAAkB,EAC5B,KAAK,EAAE;IACL,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,MAAM,EAAE,KAAK,GAAG,MAAM,CAAC;IAChC,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,IAAI,CAAC,EAAE,OAAO,CAAC;IACxB,QAAQ,CAAC,YAAY,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;CAC1D,GACA,OAAO,CAAC,OAAO,CAAC,CAuBlB"}