oxe-cc 1.0.0 → 1.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 (322) hide show
  1. package/.cursor/commands/oxe-ask.md +3 -3
  2. package/.cursor/commands/oxe-capabilities.md +3 -3
  3. package/.cursor/commands/oxe-checkpoint.md +3 -3
  4. package/.cursor/commands/oxe-compact.md +3 -3
  5. package/.cursor/commands/oxe-dashboard.md +3 -3
  6. package/.cursor/commands/oxe-debug.md +3 -3
  7. package/.cursor/commands/oxe-discuss.md +3 -3
  8. package/.cursor/commands/oxe-execute.md +7 -4
  9. package/.cursor/commands/oxe-forensics.md +3 -3
  10. package/.cursor/commands/oxe-help.md +3 -3
  11. package/.cursor/commands/oxe-loop.md +3 -3
  12. package/.cursor/commands/oxe-milestone.md +3 -3
  13. package/.cursor/commands/oxe-next.md +3 -3
  14. package/.cursor/commands/oxe-obs.md +3 -3
  15. package/.cursor/commands/oxe-plan-agent.md +3 -3
  16. package/.cursor/commands/oxe-plan.md +3 -3
  17. package/.cursor/commands/oxe-project.md +3 -3
  18. package/.cursor/commands/oxe-quick.md +3 -3
  19. package/.cursor/commands/oxe-research.md +3 -3
  20. package/.cursor/commands/oxe-retro.md +3 -3
  21. package/.cursor/commands/oxe-review-pr.md +3 -3
  22. package/.cursor/commands/oxe-route.md +3 -3
  23. package/.cursor/commands/oxe-scan.md +3 -3
  24. package/.cursor/commands/oxe-security.md +3 -3
  25. package/.cursor/commands/oxe-session.md +4 -4
  26. package/.cursor/commands/oxe-ship.md +45 -0
  27. package/.cursor/commands/oxe-skill.md +3 -3
  28. package/.cursor/commands/oxe-spec.md +3 -3
  29. package/.cursor/commands/oxe-ui-review.md +3 -3
  30. package/.cursor/commands/oxe-ui-spec.md +3 -3
  31. package/.cursor/commands/oxe-update.md +3 -3
  32. package/.cursor/commands/oxe-validate-gaps.md +3 -3
  33. package/.cursor/commands/oxe-verify.md +6 -3
  34. package/.cursor/commands/oxe-workstream.md +3 -3
  35. package/.cursor/commands/oxe.md +6 -6
  36. package/.github/copilot-instructions.md +94 -4
  37. package/.github/prompts/oxe-ask.prompt.md +3 -3
  38. package/.github/prompts/oxe-capabilities.prompt.md +3 -3
  39. package/.github/prompts/oxe-checkpoint.prompt.md +3 -3
  40. package/.github/prompts/oxe-compact.prompt.md +3 -3
  41. package/.github/prompts/oxe-dashboard.prompt.md +3 -3
  42. package/.github/prompts/oxe-debug.prompt.md +3 -3
  43. package/.github/prompts/oxe-discuss.prompt.md +3 -3
  44. package/.github/prompts/oxe-execute.prompt.md +7 -4
  45. package/.github/prompts/oxe-forensics.prompt.md +3 -3
  46. package/.github/prompts/oxe-help.prompt.md +3 -3
  47. package/.github/prompts/oxe-loop.prompt.md +3 -3
  48. package/.github/prompts/oxe-milestone.prompt.md +3 -3
  49. package/.github/prompts/oxe-next.prompt.md +3 -3
  50. package/.github/prompts/oxe-obs.prompt.md +3 -3
  51. package/.github/prompts/oxe-plan-agent.prompt.md +3 -3
  52. package/.github/prompts/oxe-plan.prompt.md +3 -3
  53. package/.github/prompts/oxe-project.prompt.md +3 -3
  54. package/.github/prompts/oxe-quick.prompt.md +3 -3
  55. package/.github/prompts/oxe-research.prompt.md +3 -3
  56. package/.github/prompts/oxe-retro.prompt.md +3 -3
  57. package/.github/prompts/oxe-review-pr.prompt.md +3 -3
  58. package/.github/prompts/oxe-route.prompt.md +3 -3
  59. package/.github/prompts/oxe-scan.prompt.md +3 -3
  60. package/.github/prompts/oxe-security.prompt.md +3 -3
  61. package/.github/prompts/oxe-session.prompt.md +4 -4
  62. package/.github/prompts/oxe-ship.prompt.md +45 -0
  63. package/.github/prompts/oxe-skill.prompt.md +3 -3
  64. package/.github/prompts/oxe-spec.prompt.md +3 -3
  65. package/.github/prompts/oxe-ui-review.prompt.md +3 -3
  66. package/.github/prompts/oxe-ui-spec.prompt.md +3 -3
  67. package/.github/prompts/oxe-update.prompt.md +3 -3
  68. package/.github/prompts/oxe-validate-gaps.prompt.md +3 -3
  69. package/.github/prompts/oxe-verify.prompt.md +6 -3
  70. package/.github/prompts/oxe-workstream.prompt.md +3 -3
  71. package/.github/prompts/oxe.prompt.md +5 -5
  72. package/AGENTS.md +43 -28
  73. package/CHANGELOG.md +193 -0
  74. package/README.md +610 -529
  75. package/bin/banner.txt +1 -1
  76. package/bin/lib/oxe-agent-install.cjs +69 -69
  77. package/bin/lib/oxe-azure.cjs +1445 -1445
  78. package/bin/lib/oxe-context-engine.cjs +867 -867
  79. package/bin/lib/oxe-dashboard.cjs +76 -28
  80. package/bin/lib/oxe-operational.cjs +2144 -1340
  81. package/bin/lib/oxe-project-health.cjs +483 -1
  82. package/bin/lib/oxe-runtime-semantics.cjs +12 -0
  83. package/bin/oxe-cc.js +554 -152
  84. package/commands/oxe/ask.md +7 -3
  85. package/commands/oxe/capabilities.md +2 -2
  86. package/commands/oxe/checkpoint.md +3 -3
  87. package/commands/oxe/compact.md +3 -3
  88. package/commands/oxe/dashboard.md +2 -2
  89. package/commands/oxe/debug.md +3 -3
  90. package/commands/oxe/discuss.md +2 -2
  91. package/commands/oxe/execute.md +7 -4
  92. package/commands/oxe/forensics.md +3 -3
  93. package/commands/oxe/help.md +2 -2
  94. package/commands/oxe/loop.md +3 -3
  95. package/commands/oxe/milestone.md +3 -3
  96. package/commands/oxe/next.md +3 -3
  97. package/commands/oxe/obs.md +3 -3
  98. package/commands/oxe/oxe.md +5 -5
  99. package/commands/oxe/plan-agent.md +2 -2
  100. package/commands/oxe/plan.md +2 -2
  101. package/commands/oxe/project.md +3 -3
  102. package/commands/oxe/quick.md +2 -2
  103. package/commands/oxe/research.md +3 -3
  104. package/commands/oxe/retro.md +3 -3
  105. package/commands/oxe/review-pr.md +3 -3
  106. package/commands/oxe/route.md +3 -3
  107. package/commands/oxe/scan.md +3 -3
  108. package/commands/oxe/security.md +3 -3
  109. package/commands/oxe/session.md +4 -4
  110. package/commands/oxe/ship.md +49 -0
  111. package/commands/oxe/skill.md +2 -2
  112. package/commands/oxe/spec.md +4 -4
  113. package/commands/oxe/ui-review.md +3 -3
  114. package/commands/oxe/ui-spec.md +3 -3
  115. package/commands/oxe/update.md +2 -2
  116. package/commands/oxe/validate-gaps.md +3 -3
  117. package/commands/oxe/verify.md +7 -4
  118. package/commands/oxe/workstream.md +3 -3
  119. package/lib/runtime/audit/audit-trail.d.ts +71 -0
  120. package/lib/runtime/audit/audit-trail.js +154 -0
  121. package/lib/runtime/audit/index.d.ts +2 -0
  122. package/lib/runtime/audit/index.js +18 -0
  123. package/lib/runtime/audit/policy-pack.d.ts +15 -0
  124. package/lib/runtime/audit/policy-pack.js +57 -0
  125. package/lib/runtime/context/context-pack-builder.d.ts +15 -0
  126. package/lib/runtime/context/context-pack-builder.js +42 -0
  127. package/lib/runtime/context/context-pack-store.d.ts +38 -0
  128. package/lib/runtime/context/context-pack-store.js +142 -0
  129. package/lib/runtime/context/context-profiles.d.ts +11 -0
  130. package/lib/runtime/context/context-profiles.js +51 -0
  131. package/lib/runtime/context/index.d.ts +2 -0
  132. package/lib/runtime/context/index.js +2 -0
  133. package/lib/runtime/decision/decision-engine.d.ts +43 -0
  134. package/lib/runtime/decision/decision-engine.js +127 -0
  135. package/lib/runtime/decision/decision-memo.d.ts +53 -0
  136. package/lib/runtime/decision/decision-memo.js +173 -0
  137. package/lib/runtime/decision/index.d.ts +2 -0
  138. package/lib/runtime/decision/index.js +18 -0
  139. package/lib/runtime/delivery/branch-manager.d.ts +1 -0
  140. package/lib/runtime/delivery/branch-manager.js +7 -0
  141. package/lib/runtime/delivery/ci-checks.js +34 -1
  142. package/lib/runtime/delivery/delivery-records.d.ts +34 -0
  143. package/lib/runtime/delivery/delivery-records.js +48 -0
  144. package/lib/runtime/delivery/index.d.ts +2 -0
  145. package/lib/runtime/delivery/index.js +2 -0
  146. package/lib/runtime/delivery/promotion-pipeline.d.ts +63 -0
  147. package/lib/runtime/delivery/promotion-pipeline.js +224 -0
  148. package/lib/runtime/gate/gate-manager.d.ts +41 -0
  149. package/lib/runtime/gate/gate-manager.js +108 -1
  150. package/lib/runtime/index.d.ts +5 -2
  151. package/lib/runtime/index.js +7 -1
  152. package/lib/runtime/models/gate-decision.d.ts +4 -1
  153. package/lib/runtime/models/workspace.d.ts +3 -0
  154. package/lib/runtime/plugins/capability-adapter.d.ts +12 -0
  155. package/lib/runtime/plugins/capability-adapter.js +204 -0
  156. package/lib/runtime/plugins/capability-matrix.d.ts +25 -0
  157. package/lib/runtime/plugins/capability-matrix.js +90 -0
  158. package/lib/runtime/plugins/index.d.ts +3 -0
  159. package/lib/runtime/plugins/index.js +3 -0
  160. package/lib/runtime/plugins/plugin-abi.d.ts +2 -0
  161. package/lib/runtime/plugins/plugin-manifest.d.ts +22 -0
  162. package/lib/runtime/plugins/plugin-manifest.js +95 -0
  163. package/lib/runtime/plugins/plugin-registry.d.ts +46 -0
  164. package/lib/runtime/plugins/plugin-registry.js +84 -2
  165. package/lib/runtime/policy/policy-engine.d.ts +47 -1
  166. package/lib/runtime/policy/policy-engine.js +172 -9
  167. package/lib/runtime/projection/projection-engine.d.ts +9 -1
  168. package/lib/runtime/projection/projection-engine.js +73 -3
  169. package/lib/runtime/reducers/run-state-reducer.d.ts +26 -0
  170. package/lib/runtime/reducers/run-state-reducer.js +117 -1
  171. package/lib/runtime/scheduler/agent-registry.d.ts +44 -0
  172. package/lib/runtime/scheduler/agent-registry.js +96 -0
  173. package/lib/runtime/scheduler/agent-roles.d.ts +54 -0
  174. package/lib/runtime/scheduler/agent-roles.js +62 -0
  175. package/lib/runtime/scheduler/index.d.ts +3 -0
  176. package/lib/runtime/scheduler/index.js +3 -0
  177. package/lib/runtime/scheduler/multi-agent-coordinator.d.ts +45 -1
  178. package/lib/runtime/scheduler/multi-agent-coordinator.js +234 -35
  179. package/lib/runtime/scheduler/run-journal.d.ts +18 -0
  180. package/lib/runtime/scheduler/run-journal.js +54 -0
  181. package/lib/runtime/scheduler/scheduler.d.ts +29 -1
  182. package/lib/runtime/scheduler/scheduler.js +387 -14
  183. package/lib/runtime/verification/index.d.ts +1 -0
  184. package/lib/runtime/verification/index.js +1 -0
  185. package/lib/runtime/verification/verification-compiler.d.ts +43 -0
  186. package/lib/runtime/verification/verification-compiler.js +137 -0
  187. package/lib/runtime/verification/verification-manifest.d.ts +67 -0
  188. package/lib/runtime/verification/verification-manifest.js +179 -0
  189. package/lib/runtime/workspace/strategies/ephemeral-container.d.ts +1 -0
  190. package/lib/runtime/workspace/strategies/ephemeral-container.js +4 -0
  191. package/lib/runtime/workspace/strategies/git-worktree.d.ts +1 -0
  192. package/lib/runtime/workspace/strategies/git-worktree.js +2 -0
  193. package/lib/runtime/workspace/strategies/inplace.d.ts +1 -0
  194. package/lib/runtime/workspace/strategies/inplace.js +2 -0
  195. package/lib/runtime/workspace/workspace-manager.d.ts +2 -1
  196. package/lib/sdk/README.md +9 -9
  197. package/lib/sdk/index.cjs +33 -24
  198. package/lib/sdk/index.d.ts +149 -14
  199. package/oxe/templates/ACTIVE-RUN.template.json +32 -32
  200. package/oxe/templates/CAPABILITIES.template.md +7 -7
  201. package/oxe/templates/CAPABILITY.template.md +45 -45
  202. package/oxe/templates/CHECKPOINTS.template.md +7 -7
  203. package/oxe/templates/EXECUTION-RUNTIME.template.md +68 -68
  204. package/oxe/templates/HYPOTHESES.template.md +33 -33
  205. package/oxe/templates/LESSONS-METRICS.template.json +13 -13
  206. package/oxe/templates/NOTES.template.md +16 -16
  207. package/oxe/templates/PLAN-REVIEW.template.md +31 -31
  208. package/oxe/templates/SESSION.template.md +34 -34
  209. package/oxe/templates/SKILL.template.md +26 -26
  210. package/oxe/templates/STATE.md +55 -55
  211. package/oxe/templates/WORKFLOW_AUTHORING.md +18 -18
  212. package/oxe/workflows/ask.md +96 -92
  213. package/oxe/workflows/capabilities.md +25 -25
  214. package/oxe/workflows/checkpoint.md +14 -10
  215. package/oxe/workflows/dashboard.md +33 -33
  216. package/oxe/workflows/debug.md +19 -15
  217. package/oxe/workflows/discuss.md +12 -12
  218. package/oxe/workflows/execute.md +44 -2
  219. package/oxe/workflows/forensics.md +13 -9
  220. package/oxe/workflows/help.md +352 -304
  221. package/oxe/workflows/loop.md +17 -13
  222. package/oxe/workflows/next.md +22 -22
  223. package/oxe/workflows/obs.md +4 -0
  224. package/oxe/workflows/oxe.md +64 -31
  225. package/oxe/workflows/plan-agent.md +9 -9
  226. package/oxe/workflows/project.md +6 -1
  227. package/oxe/workflows/quick.md +10 -10
  228. package/oxe/workflows/references/reasoning-discovery.md +28 -28
  229. package/oxe/workflows/references/reasoning-execution.md +29 -29
  230. package/oxe/workflows/references/reasoning-planning.md +32 -32
  231. package/oxe/workflows/references/reasoning-review.md +29 -29
  232. package/oxe/workflows/references/reasoning-status.md +24 -24
  233. package/oxe/workflows/references/robustness-elevation.md +295 -295
  234. package/oxe/workflows/references/workflow-runtime-contracts.json +952 -907
  235. package/oxe/workflows/research.md +32 -28
  236. package/oxe/workflows/retro.md +4 -0
  237. package/oxe/workflows/review-pr.md +15 -11
  238. package/oxe/workflows/route.md +16 -16
  239. package/oxe/workflows/scan.md +4 -0
  240. package/oxe/workflows/security.md +14 -10
  241. package/oxe/workflows/session.md +213 -197
  242. package/oxe/workflows/ship.md +142 -0
  243. package/oxe/workflows/skill.md +44 -44
  244. package/oxe/workflows/spec.md +15 -0
  245. package/oxe/workflows/ui-review.md +20 -16
  246. package/oxe/workflows/ui-spec.md +7 -3
  247. package/oxe/workflows/validate-gaps.md +13 -9
  248. package/oxe/workflows/verify-audit.md +73 -73
  249. package/oxe/workflows/verify.md +52 -3
  250. package/package.json +92 -92
  251. package/packages/runtime/package.json +17 -17
  252. package/packages/runtime/src/audit/audit-trail.ts +243 -0
  253. package/packages/runtime/src/audit/index.ts +2 -0
  254. package/packages/runtime/src/audit/policy-pack.ts +62 -0
  255. package/packages/runtime/src/compiler/graph-compiler.ts +245 -245
  256. package/packages/runtime/src/compiler/index.ts +1 -1
  257. package/packages/runtime/src/context/context-pack-builder.ts +259 -193
  258. package/packages/runtime/src/context/context-pack-store.ts +197 -0
  259. package/packages/runtime/src/context/context-profiles.ts +60 -0
  260. package/packages/runtime/src/context/index.ts +3 -1
  261. package/packages/runtime/src/decision/decision-engine.ts +174 -0
  262. package/packages/runtime/src/decision/decision-memo.ts +211 -0
  263. package/packages/runtime/src/decision/index.ts +2 -0
  264. package/packages/runtime/src/delivery/branch-manager.ts +91 -84
  265. package/packages/runtime/src/delivery/ci-checks.ts +285 -252
  266. package/packages/runtime/src/delivery/delivery-records.ts +75 -0
  267. package/packages/runtime/src/delivery/index.ts +5 -3
  268. package/packages/runtime/src/delivery/pr-manager.ts +112 -112
  269. package/packages/runtime/src/delivery/promotion-pipeline.ts +334 -0
  270. package/packages/runtime/src/events/bus.ts +92 -92
  271. package/packages/runtime/src/events/catalog.ts +29 -29
  272. package/packages/runtime/src/events/envelope.ts +14 -14
  273. package/packages/runtime/src/events/index.ts +3 -3
  274. package/packages/runtime/src/evidence/evidence-store.ts +130 -130
  275. package/packages/runtime/src/evidence/index.ts +1 -1
  276. package/packages/runtime/src/gate/gate-manager.ts +289 -137
  277. package/packages/runtime/src/gate/index.ts +1 -1
  278. package/packages/runtime/src/index.ts +41 -32
  279. package/packages/runtime/src/models/attempt.ts +19 -19
  280. package/packages/runtime/src/models/evidence.ts +21 -21
  281. package/packages/runtime/src/models/gate-decision.ts +25 -21
  282. package/packages/runtime/src/models/index.ts +8 -8
  283. package/packages/runtime/src/models/run.ts +24 -24
  284. package/packages/runtime/src/models/session.ts +11 -11
  285. package/packages/runtime/src/models/verification-result.ts +10 -10
  286. package/packages/runtime/src/models/work-item.ts +25 -25
  287. package/packages/runtime/src/models/workspace.ts +31 -28
  288. package/packages/runtime/src/plugins/capability-adapter.ts +206 -0
  289. package/packages/runtime/src/plugins/capability-matrix.ts +126 -0
  290. package/packages/runtime/src/plugins/index.ts +5 -2
  291. package/packages/runtime/src/plugins/plugin-abi.ts +97 -95
  292. package/packages/runtime/src/plugins/plugin-manifest.ts +118 -0
  293. package/packages/runtime/src/plugins/plugin-registry.ts +232 -119
  294. package/packages/runtime/src/policy/index.ts +1 -1
  295. package/packages/runtime/src/policy/policy-engine.ts +330 -113
  296. package/packages/runtime/src/projection/index.ts +1 -1
  297. package/packages/runtime/src/projection/projection-engine.ts +328 -249
  298. package/packages/runtime/src/reducers/debug-reducer.ts +36 -36
  299. package/packages/runtime/src/reducers/index.ts +2 -2
  300. package/packages/runtime/src/reducers/run-state-reducer.ts +269 -127
  301. package/packages/runtime/src/scheduler/agent-registry.ts +132 -0
  302. package/packages/runtime/src/scheduler/agent-roles.ts +109 -0
  303. package/packages/runtime/src/scheduler/index.ts +4 -1
  304. package/packages/runtime/src/scheduler/multi-agent-coordinator.ts +521 -231
  305. package/packages/runtime/src/scheduler/run-journal.ts +62 -0
  306. package/packages/runtime/src/scheduler/scheduler.ts +722 -281
  307. package/packages/runtime/src/verification/index.ts +2 -1
  308. package/packages/runtime/src/verification/verification-compiler.ts +436 -225
  309. package/packages/runtime/src/verification/verification-manifest.ts +252 -0
  310. package/packages/runtime/src/workspace/index.ts +5 -5
  311. package/packages/runtime/src/workspace/strategies/ephemeral-container.ts +126 -121
  312. package/packages/runtime/src/workspace/strategies/git-worktree.ts +79 -77
  313. package/packages/runtime/src/workspace/strategies/inplace.ts +38 -35
  314. package/packages/runtime/src/workspace/workspace-manager.ts +16 -15
  315. package/packages/runtime/tsconfig.json +17 -17
  316. package/vscode-extension/.vscodeignore +7 -7
  317. package/vscode-extension/oxe-agents-1.0.0.vsix +0 -0
  318. package/vscode-extension/package.json +185 -185
  319. package/vscode-extension/src/extension.js +310 -310
  320. package/vscode-extension/src/shared/contextLoader.js +137 -137
  321. package/vscode-extension/src/shared/contractBuilder.js +159 -159
  322. package/vscode-extension/src/shared/stateReader.js +101 -101
@@ -66,7 +66,7 @@ class ProjectionEngine {
66
66
  }
67
67
  return lines.join('\n');
68
68
  }
69
- projectVerify(state, results, checkResults) {
69
+ projectVerify(state, results, checkResults, manifest, riskLedger, evidenceCoverage) {
70
70
  const run = state.run;
71
71
  const lines = [
72
72
  '# OXE — Verificação',
@@ -92,6 +92,33 @@ class ProjectionEngine {
92
92
  }
93
93
  lines.push('');
94
94
  }
95
+ if (manifest) {
96
+ lines.push('## Verification Manifest');
97
+ lines.push('');
98
+ lines.push(`- **Checks:** ${manifest.summary.total}`);
99
+ lines.push(`- **Pass:** ${manifest.summary.pass}`);
100
+ lines.push(`- **Fail:** ${manifest.summary.fail}`);
101
+ lines.push(`- **Skip:** ${manifest.summary.skip}`);
102
+ lines.push(`- **Errors:** ${manifest.summary.error}`);
103
+ lines.push(`- **All passed:** ${manifest.summary.all_passed ? 'sim' : 'não'}`);
104
+ lines.push('');
105
+ }
106
+ if (evidenceCoverage) {
107
+ lines.push('## Evidence Coverage');
108
+ lines.push('');
109
+ lines.push(`- **Checks com evidência:** ${evidenceCoverage.checks_with_evidence}/${evidenceCoverage.total_checks}`);
110
+ lines.push(`- **Refs totais:** ${evidenceCoverage.total_evidence_refs}`);
111
+ lines.push(`- **Cobertura:** ${evidenceCoverage.coverage_percent}%`);
112
+ lines.push('');
113
+ }
114
+ if (riskLedger && riskLedger.risks.length > 0) {
115
+ lines.push('## Residual Risks');
116
+ lines.push('');
117
+ for (const risk of riskLedger.risks) {
118
+ lines.push(`- [${risk.severity.toUpperCase()}] ${risk.description}`);
119
+ }
120
+ lines.push('');
121
+ }
95
122
  if (checkResults && checkResults.length > 0) {
96
123
  lines.push('## Resultados dos checks executados');
97
124
  lines.push('');
@@ -181,11 +208,50 @@ class ProjectionEngine {
181
208
  return lines.join('\n');
182
209
  }
183
210
  projectPRSummary(state, graph) {
211
+ return this.projectPromotionSummary(state, graph);
212
+ }
213
+ projectCommitSummary(state, graph) {
184
214
  const run = state.run;
185
215
  const completed = [...state.completedWorkItems];
186
216
  const failed = [...state.failedWorkItems];
217
+ const blocked = [...state.blockedWorkItems];
187
218
  const lines = [
188
- '## Summary',
219
+ '## Commit Summary',
220
+ '',
221
+ `**Run:** \`${run?.run_id ?? '—'}\``,
222
+ `**Status:** ${run?.status ?? '—'}`,
223
+ '',
224
+ '### Included work items',
225
+ '',
226
+ ];
227
+ for (const id of completed) {
228
+ const node = graph.nodes.get(id);
229
+ lines.push(`- ✓ ${node?.title ?? id} (\`${id}\`)`);
230
+ }
231
+ if (failed.length || blocked.length) {
232
+ lines.push('');
233
+ lines.push('### Attention points');
234
+ lines.push('');
235
+ for (const id of failed) {
236
+ const node = graph.nodes.get(id);
237
+ lines.push(`- ✗ ${node?.title ?? id} (\`${id}\`)`);
238
+ }
239
+ for (const id of blocked) {
240
+ const node = graph.nodes.get(id);
241
+ lines.push(`- ⊘ ${node?.title ?? id} (\`${id}\`)`);
242
+ }
243
+ }
244
+ lines.push('');
245
+ lines.push('Generated by OXE Runtime.');
246
+ return lines.join('\n');
247
+ }
248
+ projectPromotionSummary(state, graph) {
249
+ const run = state.run;
250
+ const completed = [...state.completedWorkItems];
251
+ const failed = [...state.failedWorkItems];
252
+ const blocked = [...state.blockedWorkItems];
253
+ const lines = [
254
+ '## Promotion Summary',
189
255
  '',
190
256
  ];
191
257
  if (completed.length > 0) {
@@ -194,13 +260,17 @@ class ProjectionEngine {
194
260
  lines.push(`- ✓ ${node?.title ?? id} (\`${id}\`)`);
195
261
  }
196
262
  }
197
- if (failed.length > 0) {
263
+ if (failed.length > 0 || blocked.length > 0) {
198
264
  lines.push('');
199
265
  lines.push('**⚠️ Incomplete tasks:**');
200
266
  for (const id of failed) {
201
267
  const node = graph.nodes.get(id);
202
268
  lines.push(`- ✗ ${node?.title ?? id} (\`${id}\`)`);
203
269
  }
270
+ for (const id of blocked) {
271
+ const node = graph.nodes.get(id);
272
+ lines.push(`- ⊘ ${node?.title ?? id} (\`${id}\`)`);
273
+ }
204
274
  }
205
275
  lines.push('');
206
276
  lines.push('## Test plan');
@@ -3,6 +3,17 @@ import type { Run } from '../models/run';
3
3
  import type { WorkItem } from '../models/work-item';
4
4
  import type { Attempt } from '../models/attempt';
5
5
  import type { Workspace } from '../models/workspace';
6
+ export interface PolicyDecisionRecord {
7
+ allowed: boolean;
8
+ gate_required: boolean;
9
+ reason: string;
10
+ rule_id: string | null;
11
+ }
12
+ export interface ToolFailureRecord {
13
+ tool: string;
14
+ error: string;
15
+ timestamp: string;
16
+ }
6
17
  export interface RunState {
7
18
  run: Run | null;
8
19
  workItems: Map<string, WorkItem>;
@@ -11,6 +22,16 @@ export interface RunState {
11
22
  completedWorkItems: Set<string>;
12
23
  failedWorkItems: Set<string>;
13
24
  blockedWorkItems: Set<string>;
25
+ retryCounts: Map<string, number>;
26
+ policyDecisions: Map<string, PolicyDecisionRecord>;
27
+ pendingGates: Set<string>;
28
+ resolvedGates: Map<string, {
29
+ decision: string;
30
+ actor?: string;
31
+ }>;
32
+ verificationStatus: Map<string, 'started' | 'completed' | 'failed'>;
33
+ evidenceRefs: Map<string, string[]>;
34
+ toolFailures: Map<string, ToolFailureRecord[]>;
14
35
  }
15
36
  export declare function createEmptyRunState(): RunState;
16
37
  export declare function reduce(events: OxeEvent[]): RunState;
@@ -18,3 +39,8 @@ export { applyEvent as applyEventExported };
18
39
  declare function applyEvent(state: RunState, event: OxeEvent): RunState;
19
40
  export declare function getWorkItemStatus(state: RunState, workItemId: string): WorkItem['status'] | null;
20
41
  export declare function getAttemptCount(state: RunState, workItemId: string): number;
42
+ export declare function getRetryCount(state: RunState, workItemId: string): number;
43
+ export declare function getPolicyDecision(state: RunState, workItemId: string): PolicyDecisionRecord | null;
44
+ export declare function getVerificationStatus(state: RunState, workItemId: string): 'started' | 'completed' | 'failed' | null;
45
+ export declare function getEvidenceRefs(state: RunState, workItemId: string): string[];
46
+ export declare function getToolFailures(state: RunState, workItemId: string): ToolFailureRecord[];
@@ -5,6 +5,11 @@ exports.reduce = reduce;
5
5
  exports.applyEventExported = applyEvent;
6
6
  exports.getWorkItemStatus = getWorkItemStatus;
7
7
  exports.getAttemptCount = getAttemptCount;
8
+ exports.getRetryCount = getRetryCount;
9
+ exports.getPolicyDecision = getPolicyDecision;
10
+ exports.getVerificationStatus = getVerificationStatus;
11
+ exports.getEvidenceRefs = getEvidenceRefs;
12
+ exports.getToolFailures = getToolFailures;
8
13
  function createEmptyRunState() {
9
14
  return {
10
15
  run: null,
@@ -14,6 +19,13 @@ function createEmptyRunState() {
14
19
  completedWorkItems: new Set(),
15
20
  failedWorkItems: new Set(),
16
21
  blockedWorkItems: new Set(),
22
+ retryCounts: new Map(),
23
+ policyDecisions: new Map(),
24
+ pendingGates: new Set(),
25
+ resolvedGates: new Map(),
26
+ verificationStatus: new Map(),
27
+ evidenceRefs: new Map(),
28
+ toolFailures: new Map(),
17
29
  };
18
30
  }
19
31
  function reduce(events) {
@@ -43,7 +55,6 @@ function applyEvent(state, event) {
43
55
  workItems.set(event.work_item_id, { ...existing, status: 'ready' });
44
56
  }
45
57
  else {
46
- // First time we see this work item — create from payload
47
58
  const item = event.payload;
48
59
  workItems.set(event.work_item_id, { ...item, work_item_id: event.work_item_id, status: 'ready' });
49
60
  }
@@ -85,6 +96,14 @@ function applyEvent(state, event) {
85
96
  workItems.set(event.work_item_id, { ...item, status: 'completed' });
86
97
  const completedWorkItems = new Set(state.completedWorkItems);
87
98
  completedWorkItems.add(event.work_item_id);
99
+ // Collect evidence refs from payload
100
+ const evidence = event.payload.evidence ?? [];
101
+ if (evidence.length > 0) {
102
+ const evidenceRefs = new Map(state.evidenceRefs);
103
+ const existing = evidenceRefs.get(event.work_item_id) ?? [];
104
+ evidenceRefs.set(event.work_item_id, [...existing, ...evidence]);
105
+ return { ...state, workItems, completedWorkItems, evidenceRefs };
106
+ }
88
107
  return { ...state, workItems, completedWorkItems };
89
108
  }
90
109
  case 'WorkItemBlocked': {
@@ -98,6 +117,88 @@ function applyEvent(state, event) {
98
117
  blockedWorkItems.add(event.work_item_id);
99
118
  return { ...state, workItems, blockedWorkItems };
100
119
  }
120
+ case 'RetryScheduled': {
121
+ if (!event.work_item_id)
122
+ return state;
123
+ const retryCounts = new Map(state.retryCounts);
124
+ const current = retryCounts.get(event.work_item_id) ?? 0;
125
+ retryCounts.set(event.work_item_id, current + 1);
126
+ return { ...state, retryCounts };
127
+ }
128
+ case 'PolicyEvaluated': {
129
+ const p = event.payload;
130
+ const key = p.work_item_id ?? event.work_item_id;
131
+ if (!key)
132
+ return state;
133
+ const policyDecisions = new Map(state.policyDecisions);
134
+ policyDecisions.set(key, {
135
+ allowed: p.allowed ?? true,
136
+ gate_required: p.gate_required ?? false,
137
+ reason: p.reason ?? '',
138
+ rule_id: p.rule_id ?? null,
139
+ });
140
+ return { ...state, policyDecisions };
141
+ }
142
+ case 'GateRequested': {
143
+ const gateId = event.payload.gate_id;
144
+ if (!gateId)
145
+ return state;
146
+ const pendingGates = new Set(state.pendingGates);
147
+ pendingGates.add(gateId);
148
+ return { ...state, pendingGates };
149
+ }
150
+ case 'GateResolved': {
151
+ const p = event.payload;
152
+ if (!p.gate_id)
153
+ return state;
154
+ const pendingGates = new Set(state.pendingGates);
155
+ pendingGates.delete(p.gate_id);
156
+ const resolvedGates = new Map(state.resolvedGates);
157
+ resolvedGates.set(p.gate_id, { decision: p.decision ?? 'approved', actor: p.actor });
158
+ return { ...state, pendingGates, resolvedGates };
159
+ }
160
+ case 'VerificationStarted': {
161
+ const key = event.work_item_id ?? event.payload.work_item_id;
162
+ if (!key)
163
+ return state;
164
+ const verificationStatus = new Map(state.verificationStatus);
165
+ verificationStatus.set(key, 'started');
166
+ return { ...state, verificationStatus };
167
+ }
168
+ case 'VerificationCompleted': {
169
+ const p = event.payload;
170
+ const key = event.work_item_id ?? p.work_item_id;
171
+ if (!key)
172
+ return state;
173
+ const verificationStatus = new Map(state.verificationStatus);
174
+ verificationStatus.set(key, p.status ?? 'completed');
175
+ return { ...state, verificationStatus };
176
+ }
177
+ case 'ToolFailed': {
178
+ if (!event.work_item_id)
179
+ return state;
180
+ const p = event.payload;
181
+ const toolFailures = new Map(state.toolFailures);
182
+ const existing = toolFailures.get(event.work_item_id) ?? [];
183
+ toolFailures.set(event.work_item_id, [
184
+ ...existing,
185
+ { tool: p.tool ?? 'unknown', error: p.error ?? '', timestamp: event.timestamp },
186
+ ]);
187
+ return { ...state, toolFailures };
188
+ }
189
+ case 'EvidenceCollected': {
190
+ const p = event.payload;
191
+ const key = event.work_item_id ?? p.work_item_id;
192
+ if (!key)
193
+ return state;
194
+ const refs = p.refs ?? (p.ref ? [p.ref] : []);
195
+ if (refs.length === 0)
196
+ return state;
197
+ const evidenceRefs = new Map(state.evidenceRefs);
198
+ const existing = evidenceRefs.get(key) ?? [];
199
+ evidenceRefs.set(key, [...existing, ...refs]);
200
+ return { ...state, evidenceRefs };
201
+ }
101
202
  default:
102
203
  return state;
103
204
  }
@@ -108,3 +209,18 @@ function getWorkItemStatus(state, workItemId) {
108
209
  function getAttemptCount(state, workItemId) {
109
210
  return state.attempts.get(workItemId)?.length ?? 0;
110
211
  }
212
+ function getRetryCount(state, workItemId) {
213
+ return state.retryCounts.get(workItemId) ?? 0;
214
+ }
215
+ function getPolicyDecision(state, workItemId) {
216
+ return state.policyDecisions.get(workItemId) ?? null;
217
+ }
218
+ function getVerificationStatus(state, workItemId) {
219
+ return state.verificationStatus.get(workItemId) ?? null;
220
+ }
221
+ function getEvidenceRefs(state, workItemId) {
222
+ return state.evidenceRefs.get(workItemId) ?? [];
223
+ }
224
+ function getToolFailures(state, workItemId) {
225
+ return state.toolFailures.get(workItemId) ?? [];
226
+ }
@@ -0,0 +1,44 @@
1
+ import type { TaskExecutor } from './scheduler';
2
+ import type { WorkspaceManager } from '../workspace/workspace-manager';
3
+ import type { AgentRole, AgentActionLog } from './agent-roles';
4
+ export type AgentStatus = 'idle' | 'running' | 'paused' | 'failed' | 'timeout';
5
+ export interface AgentHeartbeat {
6
+ agent_id: string;
7
+ last_seen: string;
8
+ current_task: string | null;
9
+ status: AgentStatus;
10
+ }
11
+ export interface RegisteredAgent {
12
+ id: string;
13
+ executor: TaskExecutor;
14
+ workspaceManager: WorkspaceManager;
15
+ assignedTaskIds: string[];
16
+ heartbeat: AgentHeartbeat;
17
+ role?: AgentRole;
18
+ actionLog: AgentActionLog[];
19
+ }
20
+ export declare class AgentRegistry {
21
+ private agents;
22
+ private readonly heartbeatTimeoutMs;
23
+ constructor(heartbeatTimeoutMs?: number);
24
+ register(id: string, executor: TaskExecutor, workspaceManager: WorkspaceManager, assignedTaskIds?: string[], role?: AgentRole): RegisteredAgent;
25
+ unregister(id: string): void;
26
+ beat(id: string, currentTask?: string | null): void;
27
+ setStatus(id: string, status: AgentStatus): void;
28
+ isAlive(id: string): boolean;
29
+ /** Returns agents that haven't sent a heartbeat within the timeout window */
30
+ timedOut(): RegisteredAgent[];
31
+ liveAgents(): RegisteredAgent[];
32
+ get(id: string): RegisteredAgent | null;
33
+ list(): RegisteredAgent[];
34
+ /**
35
+ * Reassign orphaned tasks from timed-out agents to a fallback agent.
36
+ * Returns the list of task IDs that were reassigned.
37
+ */
38
+ failover(fallbackAgentId: string): string[];
39
+ /** Return all agents assigned to a given role */
40
+ getByRole(role: AgentRole): RegisteredAgent[];
41
+ /** Append an action log entry for a registered agent (no-op if unknown) */
42
+ logAction(agentId: string, log: AgentActionLog): void;
43
+ clear(): void;
44
+ }
@@ -0,0 +1,96 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.AgentRegistry = void 0;
4
+ class AgentRegistry {
5
+ constructor(heartbeatTimeoutMs = 30000) {
6
+ this.agents = new Map();
7
+ this.heartbeatTimeoutMs = heartbeatTimeoutMs;
8
+ }
9
+ register(id, executor, workspaceManager, assignedTaskIds = [], role) {
10
+ if (this.agents.has(id))
11
+ throw new Error(`Agent "${id}" is already registered`);
12
+ const agent = {
13
+ id,
14
+ executor,
15
+ workspaceManager,
16
+ assignedTaskIds,
17
+ heartbeat: {
18
+ agent_id: id,
19
+ last_seen: new Date().toISOString(),
20
+ current_task: null,
21
+ status: 'idle',
22
+ },
23
+ role,
24
+ actionLog: [],
25
+ };
26
+ this.agents.set(id, agent);
27
+ return agent;
28
+ }
29
+ unregister(id) {
30
+ this.agents.delete(id);
31
+ }
32
+ beat(id, currentTask = null) {
33
+ const agent = this.agents.get(id);
34
+ if (!agent)
35
+ return;
36
+ agent.heartbeat.last_seen = new Date().toISOString();
37
+ agent.heartbeat.current_task = currentTask;
38
+ agent.heartbeat.status = currentTask ? 'running' : 'idle';
39
+ }
40
+ setStatus(id, status) {
41
+ const agent = this.agents.get(id);
42
+ if (agent)
43
+ agent.heartbeat.status = status;
44
+ }
45
+ isAlive(id) {
46
+ const agent = this.agents.get(id);
47
+ if (!agent)
48
+ return false;
49
+ const elapsed = Date.now() - new Date(agent.heartbeat.last_seen).getTime();
50
+ return elapsed < this.heartbeatTimeoutMs;
51
+ }
52
+ /** Returns agents that haven't sent a heartbeat within the timeout window */
53
+ timedOut() {
54
+ return [...this.agents.values()].filter((a) => !this.isAlive(a.id));
55
+ }
56
+ liveAgents() {
57
+ return [...this.agents.values()].filter((a) => this.isAlive(a.id));
58
+ }
59
+ get(id) {
60
+ return this.agents.get(id) ?? null;
61
+ }
62
+ list() {
63
+ return [...this.agents.values()];
64
+ }
65
+ /**
66
+ * Reassign orphaned tasks from timed-out agents to a fallback agent.
67
+ * Returns the list of task IDs that were reassigned.
68
+ */
69
+ failover(fallbackAgentId) {
70
+ const fallback = this.agents.get(fallbackAgentId);
71
+ if (!fallback)
72
+ throw new Error(`Fallback agent "${fallbackAgentId}" not found`);
73
+ const orphaned = [];
74
+ for (const agent of this.timedOut()) {
75
+ orphaned.push(...agent.assignedTaskIds);
76
+ agent.assignedTaskIds = [];
77
+ agent.heartbeat.status = 'failed';
78
+ }
79
+ fallback.assignedTaskIds = [...fallback.assignedTaskIds, ...orphaned];
80
+ return orphaned;
81
+ }
82
+ /** Return all agents assigned to a given role */
83
+ getByRole(role) {
84
+ return [...this.agents.values()].filter((a) => a.role === role);
85
+ }
86
+ /** Append an action log entry for a registered agent (no-op if unknown) */
87
+ logAction(agentId, log) {
88
+ const agent = this.agents.get(agentId);
89
+ if (agent)
90
+ agent.actionLog.push(log);
91
+ }
92
+ clear() {
93
+ this.agents.clear();
94
+ }
95
+ }
96
+ exports.AgentRegistry = AgentRegistry;
@@ -0,0 +1,54 @@
1
+ import type { TaskResult } from './scheduler';
2
+ export type AgentRole = 'planner' | 'executor' | 'reviewer' | 'verifier';
3
+ export interface AgentBudget {
4
+ max_tokens: number;
5
+ max_time_ms: number;
6
+ max_retries: number;
7
+ consumed_tokens: number;
8
+ consumed_time_ms: number;
9
+ consumed_retries: number;
10
+ }
11
+ export interface CooperativeHandoff {
12
+ handoff_id: string;
13
+ from_agent_id: string;
14
+ to_agent_id: string;
15
+ from_role: AgentRole;
16
+ to_role: AgentRole;
17
+ work_item_id: string;
18
+ context_pack_ref: string | null;
19
+ transferred_at: string;
20
+ }
21
+ export interface AgentActionLog {
22
+ agent_id: string;
23
+ role: AgentRole;
24
+ work_item_id: string;
25
+ action: 'execute' | 'verify' | 'review' | 'plan';
26
+ result: 'success' | 'failure';
27
+ duration_ms: number;
28
+ timestamp: string;
29
+ }
30
+ export declare function createBudget(opts?: Partial<Omit<AgentBudget, 'consumed_tokens' | 'consumed_time_ms' | 'consumed_retries'>>): AgentBudget;
31
+ export declare function consumeBudget(budget: AgentBudget, delta: {
32
+ tokens?: number;
33
+ time_ms?: number;
34
+ retries?: number;
35
+ }): AgentBudget;
36
+ export declare function isBudgetExhausted(budget: AgentBudget): boolean;
37
+ export declare function buildHandoff(opts: {
38
+ from_agent_id: string;
39
+ to_agent_id: string;
40
+ from_role: AgentRole;
41
+ to_role: AgentRole;
42
+ work_item_id: string;
43
+ context_pack_ref?: string | null;
44
+ }): CooperativeHandoff;
45
+ export declare class ArbitrationEngine {
46
+ /**
47
+ * Choose the best result from multiple competing agents.
48
+ * Prefers success; among successes prefers more evidence; falls back to first.
49
+ */
50
+ arbitrate(results: Array<{
51
+ agent_id: string;
52
+ result: TaskResult;
53
+ }>): TaskResult;
54
+ }
@@ -0,0 +1,62 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ArbitrationEngine = void 0;
4
+ exports.createBudget = createBudget;
5
+ exports.consumeBudget = consumeBudget;
6
+ exports.isBudgetExhausted = isBudgetExhausted;
7
+ exports.buildHandoff = buildHandoff;
8
+ function createBudget(opts = {}) {
9
+ return {
10
+ max_tokens: opts.max_tokens ?? Infinity,
11
+ max_time_ms: opts.max_time_ms ?? Infinity,
12
+ max_retries: opts.max_retries ?? Infinity,
13
+ consumed_tokens: 0,
14
+ consumed_time_ms: 0,
15
+ consumed_retries: 0,
16
+ };
17
+ }
18
+ function consumeBudget(budget, delta) {
19
+ return {
20
+ ...budget,
21
+ consumed_tokens: budget.consumed_tokens + (delta.tokens ?? 0),
22
+ consumed_time_ms: budget.consumed_time_ms + (delta.time_ms ?? 0),
23
+ consumed_retries: budget.consumed_retries + (delta.retries ?? 0),
24
+ };
25
+ }
26
+ function isBudgetExhausted(budget) {
27
+ return (budget.consumed_tokens >= budget.max_tokens ||
28
+ budget.consumed_time_ms >= budget.max_time_ms ||
29
+ budget.consumed_retries >= budget.max_retries);
30
+ }
31
+ function buildHandoff(opts) {
32
+ return {
33
+ handoff_id: `hoff-${Date.now().toString(36)}-${Math.random().toString(36).slice(2, 6)}`,
34
+ from_agent_id: opts.from_agent_id,
35
+ to_agent_id: opts.to_agent_id,
36
+ from_role: opts.from_role,
37
+ to_role: opts.to_role,
38
+ work_item_id: opts.work_item_id,
39
+ context_pack_ref: opts.context_pack_ref ?? null,
40
+ transferred_at: new Date().toISOString(),
41
+ };
42
+ }
43
+ // ─── ArbitrationEngine ────────────────────────────────────────────────────────
44
+ class ArbitrationEngine {
45
+ /**
46
+ * Choose the best result from multiple competing agents.
47
+ * Prefers success; among successes prefers more evidence; falls back to first.
48
+ */
49
+ arbitrate(results) {
50
+ if (results.length === 0) {
51
+ return { success: false, failure_class: null, evidence: [], output: 'no results to arbitrate' };
52
+ }
53
+ const successes = results.filter((r) => r.result.success);
54
+ if (successes.length === 0) {
55
+ return results[0].result;
56
+ }
57
+ // Among successes, prefer the one with most evidence
58
+ successes.sort((a, b) => b.result.evidence.length - a.result.evidence.length);
59
+ return successes[0].result;
60
+ }
61
+ }
62
+ exports.ArbitrationEngine = ArbitrationEngine;
@@ -1 +1,4 @@
1
1
  export * from './scheduler';
2
+ export * from './run-journal';
3
+ export * from './agent-registry';
4
+ export * from './agent-roles';
@@ -15,3 +15,6 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
17
  __exportStar(require("./scheduler"), exports);
18
+ __exportStar(require("./run-journal"), exports);
19
+ __exportStar(require("./agent-registry"), exports);
20
+ __exportStar(require("./agent-roles"), exports);
@@ -1,6 +1,7 @@
1
1
  import type { ExecutionGraph } from '../compiler/graph-compiler';
2
2
  import type { WorkspaceManager } from '../workspace/workspace-manager';
3
- import type { TaskExecutor, SchedulerContext } from './scheduler';
3
+ import type { TaskExecutor, TaskResult, SchedulerContext } from './scheduler';
4
+ import type { CooperativeHandoff } from './agent-roles';
4
5
  export type CoordinationMode = 'parallel' | 'competitive' | 'cooperative';
5
6
  export interface AgentSpec {
6
7
  id: string;
@@ -17,6 +18,44 @@ export interface CoordinationOptions {
17
18
  runId: string;
18
19
  onEvent?: SchedulerContext['onEvent'];
19
20
  }
21
+ export interface ArbitrationRecord {
22
+ work_item_id: string;
23
+ mode: CoordinationMode;
24
+ winner_agent_id: string | null;
25
+ participant_agent_ids: string[];
26
+ success: boolean;
27
+ failure_class: TaskResult['failure_class'];
28
+ evidence_count: number;
29
+ recorded_at: string;
30
+ }
31
+ export interface MultiAgentOwnership {
32
+ work_item_id: string;
33
+ owner_agent_id: string;
34
+ }
35
+ export interface MultiAgentStatusSnapshot {
36
+ run_id: string;
37
+ mode: CoordinationMode;
38
+ workspace_isolation_required: 'isolated';
39
+ workspace_isolation_enforced: boolean;
40
+ agent_count: number;
41
+ ownership: MultiAgentOwnership[];
42
+ completed: string[];
43
+ failed: string[];
44
+ blocked: string[];
45
+ agent_results: Array<{
46
+ agent_id: string;
47
+ isolation_level: 'shared' | 'isolated';
48
+ assigned_task_ids: string[];
49
+ completed: string[];
50
+ failed: string[];
51
+ }>;
52
+ orphan_reassignments: Array<{
53
+ from_agent_id: string;
54
+ to_agent_id: string;
55
+ work_item_ids: string[];
56
+ }>;
57
+ updated_at: string;
58
+ }
20
59
  export interface CoordinationResult {
21
60
  mode: CoordinationMode;
22
61
  run_id: string;
@@ -28,7 +67,12 @@ export interface CoordinationResult {
28
67
  completed: string[];
29
68
  failed: string[];
30
69
  }>;
70
+ handoffs?: CooperativeHandoff[];
71
+ arbitration_results?: ArbitrationRecord[];
72
+ state?: MultiAgentStatusSnapshot;
31
73
  }
32
74
  export declare class MultiAgentCoordinator {
33
75
  run(graph: ExecutionGraph, opts: CoordinationOptions): Promise<CoordinationResult>;
34
76
  }
77
+ export declare function multiAgentStatePath(projectRoot: string, runId: string): string;
78
+ export declare function loadMultiAgentState(projectRoot: string, runId: string): MultiAgentStatusSnapshot | null;