@jmanuelcorral/openteam 0.2.1 → 0.9.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 (312) hide show
  1. package/.opencode/command/openteam.md +2 -1
  2. package/.opencode/openteam.example.json +27 -8
  3. package/AGENTS.md +5 -2
  4. package/README.es.md +155 -59
  5. package/README.md +418 -62
  6. package/dist/capabilities/types.d.ts +3 -3
  7. package/dist/capabilities/types.d.ts.map +1 -1
  8. package/dist/classifier/localClassifier.d.ts +0 -2
  9. package/dist/classifier/localClassifier.d.ts.map +1 -1
  10. package/dist/cli/consoleServe.d.ts +30 -1
  11. package/dist/cli/consoleServe.d.ts.map +1 -1
  12. package/dist/cli/graphOperator.d.ts +22 -0
  13. package/dist/cli/graphOperator.d.ts.map +1 -0
  14. package/dist/cli/graphStatusSnapshot.d.ts +16 -0
  15. package/dist/cli/graphStatusSnapshot.d.ts.map +1 -0
  16. package/dist/cli/graphViewProvider.d.ts +30 -0
  17. package/dist/cli/graphViewProvider.d.ts.map +1 -0
  18. package/dist/cli/migrateAdapter.d.ts +12 -0
  19. package/dist/cli/migrateAdapter.d.ts.map +1 -0
  20. package/dist/cli/purgeAdapter.d.ts +10 -0
  21. package/dist/cli/purgeAdapter.d.ts.map +1 -0
  22. package/dist/cli/setupAdapters.d.ts.map +1 -1
  23. package/dist/cli.js +13480 -5176
  24. package/dist/commands/agents.d.ts +102 -2
  25. package/dist/commands/agents.d.ts.map +1 -1
  26. package/dist/commands/baseline.d.ts.map +1 -1
  27. package/dist/commands/clearCache.d.ts +23 -0
  28. package/dist/commands/clearCache.d.ts.map +1 -0
  29. package/dist/commands/dispatch.d.ts +197 -4
  30. package/dist/commands/dispatch.d.ts.map +1 -1
  31. package/dist/commands/doctor.d.ts +40 -0
  32. package/dist/commands/doctor.d.ts.map +1 -1
  33. package/dist/commands/frontierCatalog.d.ts +8 -14
  34. package/dist/commands/frontierCatalog.d.ts.map +1 -1
  35. package/dist/commands/graph.d.ts +0 -27
  36. package/dist/commands/graph.d.ts.map +1 -1
  37. package/dist/commands/local.d.ts.map +1 -1
  38. package/dist/commands/migrate.d.ts +11 -0
  39. package/dist/commands/migrate.d.ts.map +1 -0
  40. package/dist/commands/purge.d.ts +132 -0
  41. package/dist/commands/purge.d.ts.map +1 -0
  42. package/dist/commands/report.d.ts +1 -0
  43. package/dist/commands/report.d.ts.map +1 -1
  44. package/dist/commands/setup.d.ts +62 -5
  45. package/dist/commands/setup.d.ts.map +1 -1
  46. package/dist/config/errors.d.ts +10 -0
  47. package/dist/config/errors.d.ts.map +1 -0
  48. package/dist/config/legacyMigration.d.ts +82 -0
  49. package/dist/config/legacyMigration.d.ts.map +1 -0
  50. package/dist/config/legacyPaths.d.ts +105 -0
  51. package/dist/config/legacyPaths.d.ts.map +1 -0
  52. package/dist/config/load.d.ts.map +1 -1
  53. package/dist/config/opencode.d.ts +63 -0
  54. package/dist/config/opencode.d.ts.map +1 -0
  55. package/dist/config/persist.d.ts +8 -0
  56. package/dist/config/persist.d.ts.map +1 -1
  57. package/dist/config/resolve.d.ts +1 -1
  58. package/dist/config/resolve.d.ts.map +1 -1
  59. package/dist/config/runtime.d.ts +62 -0
  60. package/dist/config/runtime.d.ts.map +1 -0
  61. package/dist/config/schema.d.ts +145 -77
  62. package/dist/config/schema.d.ts.map +1 -1
  63. package/dist/console/assets.d.ts +2 -2
  64. package/dist/console/assets.d.ts.map +1 -1
  65. package/dist/console/configView.d.ts +74 -0
  66. package/dist/console/configView.d.ts.map +1 -0
  67. package/dist/console/opencodeClient.d.ts +8 -6
  68. package/dist/console/opencodeClient.d.ts.map +1 -1
  69. package/dist/console/protocol.d.ts +30 -6
  70. package/dist/console/protocol.d.ts.map +1 -1
  71. package/dist/console/render.d.ts +30 -1
  72. package/dist/console/render.d.ts.map +1 -1
  73. package/dist/console/types.d.ts +1 -1
  74. package/dist/console/types.d.ts.map +1 -1
  75. package/dist/context/redaction.d.ts +27 -19
  76. package/dist/context/redaction.d.ts.map +1 -1
  77. package/dist/context/schema.d.ts +26 -26
  78. package/dist/context/schema.d.ts.map +1 -1
  79. package/dist/context/types.d.ts +3 -3
  80. package/dist/contract/opencode.d.ts +39 -23
  81. package/dist/contract/opencode.d.ts.map +1 -1
  82. package/dist/graph/certificate.d.ts +37 -16
  83. package/dist/graph/certificate.d.ts.map +1 -1
  84. package/dist/graph/langgraph/adapter.d.ts +56 -0
  85. package/dist/graph/langgraph/adapter.d.ts.map +1 -0
  86. package/dist/graph/langgraph/certification.d.ts +64 -0
  87. package/dist/graph/langgraph/certification.d.ts.map +1 -0
  88. package/dist/graph/langgraph/checkpointReplay.d.ts +49 -0
  89. package/dist/graph/langgraph/checkpointReplay.d.ts.map +1 -0
  90. package/dist/graph/langgraph/checkpointer.d.ts +49 -0
  91. package/dist/graph/langgraph/checkpointer.d.ts.map +1 -0
  92. package/dist/graph/langgraph/engine.d.ts +34 -0
  93. package/dist/graph/langgraph/engine.d.ts.map +1 -0
  94. package/dist/graph/langgraph/graphModel.d.ts +37 -0
  95. package/dist/graph/langgraph/graphModel.d.ts.map +1 -0
  96. package/dist/graph/langgraph/reducer.d.ts +18 -0
  97. package/dist/graph/langgraph/reducer.d.ts.map +1 -0
  98. package/dist/graph/langgraph/retirement.d.ts +59 -0
  99. package/dist/graph/langgraph/retirement.d.ts.map +1 -0
  100. package/dist/graph/langgraph/types.d.ts +65 -0
  101. package/dist/graph/langgraph/types.d.ts.map +1 -0
  102. package/dist/graph/privacyPolicy.d.ts +7 -0
  103. package/dist/graph/privacyPolicy.d.ts.map +1 -1
  104. package/dist/graph/soakLedger.d.ts.map +1 -1
  105. package/dist/graph/types.d.ts +0 -2
  106. package/dist/graph/types.d.ts.map +1 -1
  107. package/dist/index.d.ts +48 -16
  108. package/dist/index.d.ts.map +1 -1
  109. package/dist/index.js +11596 -4180
  110. package/dist/local/cacheAdapter.d.ts +7 -0
  111. package/dist/local/cacheAdapter.d.ts.map +1 -0
  112. package/dist/local/concurrency.d.ts +52 -0
  113. package/dist/local/concurrency.d.ts.map +1 -0
  114. package/dist/local/embeddings.d.ts +10 -10
  115. package/dist/local/embeddings.d.ts.map +1 -1
  116. package/dist/local/extractClient.d.ts +13 -10
  117. package/dist/local/extractClient.d.ts.map +1 -1
  118. package/dist/local/lemonade.d.ts +4 -0
  119. package/dist/local/lemonade.d.ts.map +1 -0
  120. package/dist/local/registry.d.ts +16 -0
  121. package/dist/local/registry.d.ts.map +1 -1
  122. package/dist/local/types.d.ts +1 -1
  123. package/dist/local/types.d.ts.map +1 -1
  124. package/dist/mcp/semanticRecall.d.ts +18 -1
  125. package/dist/mcp/semanticRecall.d.ts.map +1 -1
  126. package/dist/mcp/server.d.ts +41 -1
  127. package/dist/mcp/server.d.ts.map +1 -1
  128. package/dist/memory/embedText.d.ts +4 -0
  129. package/dist/memory/embedText.d.ts.map +1 -0
  130. package/dist/memory/extract.d.ts +33 -18
  131. package/dist/memory/extract.d.ts.map +1 -1
  132. package/dist/memory/fold.d.ts +3 -2
  133. package/dist/memory/fold.d.ts.map +1 -1
  134. package/dist/memory/index.d.ts +1 -0
  135. package/dist/memory/index.d.ts.map +1 -1
  136. package/dist/memory/inject.d.ts.map +1 -1
  137. package/dist/memory/log.d.ts +15 -4
  138. package/dist/memory/log.d.ts.map +1 -1
  139. package/dist/memory/merge.d.ts +18 -1
  140. package/dist/memory/merge.d.ts.map +1 -1
  141. package/dist/memory/traverse.d.ts +80 -0
  142. package/dist/memory/traverse.d.ts.map +1 -0
  143. package/dist/memory/types.d.ts +53 -7
  144. package/dist/memory/types.d.ts.map +1 -1
  145. package/dist/messages/commands.d.ts +84 -0
  146. package/dist/messages/commands.d.ts.map +1 -0
  147. package/dist/messages/index.d.ts +46 -0
  148. package/dist/messages/index.d.ts.map +1 -0
  149. package/dist/opencodeArtifacts/index.d.ts +33 -0
  150. package/dist/opencodeArtifacts/index.d.ts.map +1 -0
  151. package/dist/opencodeArtifacts/orchestratorAgent.d.ts +29 -0
  152. package/dist/opencodeArtifacts/orchestratorAgent.d.ts.map +1 -0
  153. package/dist/opencodeArtifacts/slashCommand.d.ts +31 -0
  154. package/dist/opencodeArtifacts/slashCommand.d.ts.map +1 -0
  155. package/dist/orchestrator/coordinator.d.ts +188 -2
  156. package/dist/orchestrator/coordinator.d.ts.map +1 -1
  157. package/dist/orchestrator/graphCancellation.d.ts +40 -37
  158. package/dist/orchestrator/graphCancellation.d.ts.map +1 -1
  159. package/dist/orchestrator/graphEffects.d.ts +24 -24
  160. package/dist/orchestrator/graphEffects.d.ts.map +1 -1
  161. package/dist/orchestrator/graphFacade.d.ts +16 -16
  162. package/dist/orchestrator/graphFacade.d.ts.map +1 -1
  163. package/dist/orchestrator/graphIngress.d.ts +49 -45
  164. package/dist/orchestrator/graphIngress.d.ts.map +1 -1
  165. package/dist/orchestrator/graphReview.d.ts +24 -23
  166. package/dist/orchestrator/graphReview.d.ts.map +1 -1
  167. package/dist/orchestrator/graphRuntime.d.ts +27 -26
  168. package/dist/orchestrator/graphRuntime.d.ts.map +1 -1
  169. package/dist/orchestrator/graphShadow.d.ts +70 -69
  170. package/dist/orchestrator/graphShadow.d.ts.map +1 -1
  171. package/dist/orchestrator/opencodeSessionAdapter.d.ts +25 -25
  172. package/dist/orchestrator/opencodeSessionAdapter.d.ts.map +1 -1
  173. package/dist/orchestrator/permissions.d.ts.map +1 -1
  174. package/dist/orchestrator/ralphLoop.d.ts +57 -0
  175. package/dist/orchestrator/ralphLoop.d.ts.map +1 -0
  176. package/dist/orchestrator/roles.d.ts +50 -8
  177. package/dist/orchestrator/roles.d.ts.map +1 -1
  178. package/dist/orchestrator/roster.d.ts +103 -0
  179. package/dist/orchestrator/roster.d.ts.map +1 -0
  180. package/dist/orchestrator/rosterPersistence.d.ts +22 -0
  181. package/dist/orchestrator/rosterPersistence.d.ts.map +1 -0
  182. package/dist/orchestrator/runtimeSelection.d.ts +46 -0
  183. package/dist/orchestrator/runtimeSelection.d.ts.map +1 -0
  184. package/dist/orchestrator/sddCompiler.d.ts +34 -34
  185. package/dist/orchestrator/sddCompiler.d.ts.map +1 -1
  186. package/dist/orchestrator/sessionReconciler.d.ts +31 -29
  187. package/dist/orchestrator/sessionReconciler.d.ts.map +1 -1
  188. package/dist/orchestrator/shadowComparator.d.ts +23 -23
  189. package/dist/orchestrator/shadowComparator.d.ts.map +1 -1
  190. package/dist/orchestrator/subsessions.d.ts.map +1 -1
  191. package/dist/orchestrator/worktreeAdapter.d.ts +12 -12
  192. package/dist/orchestrator/worktreeAdapter.d.ts.map +1 -1
  193. package/dist/orchestrator/worktreeDispatch.d.ts +34 -34
  194. package/dist/orchestrator/worktreeDispatch.d.ts.map +1 -1
  195. package/dist/orchestrator/worktreeReconciler.d.ts +37 -36
  196. package/dist/orchestrator/worktreeReconciler.d.ts.map +1 -1
  197. package/dist/plugin/availability.d.ts.map +1 -1
  198. package/dist/plugin/capture.d.ts +12 -12
  199. package/dist/plugin/capture.d.ts.map +1 -1
  200. package/dist/plugin/commandTool.d.ts +1 -1
  201. package/dist/plugin/commandTool.d.ts.map +1 -1
  202. package/dist/plugin/graphShadowIngress.d.ts +50 -48
  203. package/dist/plugin/graphShadowIngress.d.ts.map +1 -1
  204. package/dist/plugin/graphTool.d.ts +25 -23
  205. package/dist/plugin/graphTool.d.ts.map +1 -1
  206. package/dist/plugin/hooks.d.ts +10 -10
  207. package/dist/plugin/hooks.d.ts.map +1 -1
  208. package/dist/plugin/legacyRunProducer.d.ts +22 -22
  209. package/dist/plugin/legacyRunProducer.d.ts.map +1 -1
  210. package/dist/plugin/memoryInject.d.ts +6 -6
  211. package/dist/plugin/memoryInject.d.ts.map +1 -1
  212. package/dist/plugin/memoryTool.d.ts +36 -0
  213. package/dist/plugin/memoryTool.d.ts.map +1 -0
  214. package/dist/plugin/orchestrateTool.d.ts +230 -0
  215. package/dist/plugin/orchestrateTool.d.ts.map +1 -0
  216. package/dist/plugin/reportRunSchema.d.ts +8 -8
  217. package/dist/plugin/reportRunSchema.d.ts.map +1 -1
  218. package/dist/plugin/sessionTracker.d.ts +15 -15
  219. package/dist/plugin/sessionTracker.d.ts.map +1 -1
  220. package/dist/plugin/shadowPipeline.d.ts +2 -1
  221. package/dist/plugin/shadowPipeline.d.ts.map +1 -1
  222. package/dist/plugin/soakObserver.d.ts +18 -11
  223. package/dist/plugin/soakObserver.d.ts.map +1 -1
  224. package/dist/plugin/toolcalls.d.ts +3 -3
  225. package/dist/router/chooseModel.d.ts.map +1 -1
  226. package/dist/router/frontierBaseline.d.ts +3 -3
  227. package/dist/router/modelSelection.d.ts +12 -4
  228. package/dist/router/modelSelection.d.ts.map +1 -1
  229. package/dist/router/types.d.ts +6 -1
  230. package/dist/router/types.d.ts.map +1 -1
  231. package/dist/storage/graph/snapshot.d.ts.map +1 -1
  232. package/dist/storage/graph/soakRecorder.d.ts +14 -1
  233. package/dist/storage/graph/soakRecorder.d.ts.map +1 -1
  234. package/dist/storage/graph/workspaceLease.d.ts +1 -1
  235. package/dist/storage/graph/workspaceLease.d.ts.map +1 -1
  236. package/dist/storage/graph/worktreeRegistry.d.ts +1 -1
  237. package/dist/storage/graph/worktreeRegistry.d.ts.map +1 -1
  238. package/dist/storage/httpStorageProvider.d.ts +2 -2
  239. package/dist/storage/index/bunSqlite.d.ts +1 -0
  240. package/dist/storage/index/bunSqlite.d.ts.map +1 -1
  241. package/dist/storage/index/memoryConsolidate.d.ts +2 -0
  242. package/dist/storage/index/memoryConsolidate.d.ts.map +1 -1
  243. package/dist/storage/index/memoryEmbeddings.d.ts +51 -0
  244. package/dist/storage/index/memoryEmbeddings.d.ts.map +1 -0
  245. package/dist/storage/index/memoryIndex.d.ts +36 -4
  246. package/dist/storage/index/memoryIndex.d.ts.map +1 -1
  247. package/dist/storage/index/memoryRecall.d.ts +1 -1
  248. package/dist/storage/index/memoryRecall.d.ts.map +1 -1
  249. package/dist/storage/index/memoryRuntime.d.ts +2 -0
  250. package/dist/storage/index/memoryRuntime.d.ts.map +1 -1
  251. package/dist/storage/index/sqliteIndex.d.ts +18 -1
  252. package/dist/storage/index/sqliteIndex.d.ts.map +1 -1
  253. package/dist/storage/path.d.ts.map +1 -1
  254. package/dist/telemetry/aggregate.d.ts +12 -12
  255. package/dist/telemetry/aggregate.d.ts.map +1 -1
  256. package/dist/telemetry/cost.d.ts.map +1 -1
  257. package/dist/telemetry/decisions.d.ts +11 -11
  258. package/dist/telemetry/decisions.d.ts.map +1 -1
  259. package/dist/telemetry/eventLog.d.ts +41 -25
  260. package/dist/telemetry/eventLog.d.ts.map +1 -1
  261. package/dist/telemetry/events.d.ts +79 -34
  262. package/dist/telemetry/events.d.ts.map +1 -1
  263. package/dist/telemetry/fanout.d.ts +18 -0
  264. package/dist/telemetry/fanout.d.ts.map +1 -0
  265. package/dist/telemetry/graphProjection.d.ts +12 -12
  266. package/dist/telemetry/graphProjection.d.ts.map +1 -1
  267. package/dist/telemetry/graphRuntimeHealth.d.ts +26 -26
  268. package/dist/telemetry/graphRuntimeHealth.d.ts.map +1 -1
  269. package/dist/telemetry/graphView.d.ts +20 -20
  270. package/dist/telemetry/graphView.d.ts.map +1 -1
  271. package/dist/telemetry/otel.d.ts +86 -0
  272. package/dist/telemetry/otel.d.ts.map +1 -0
  273. package/dist/telemetry/otelConfig.d.ts +128 -0
  274. package/dist/telemetry/otelConfig.d.ts.map +1 -0
  275. package/dist/telemetry/otelExporter.d.ts +7 -0
  276. package/dist/telemetry/otelExporter.d.ts.map +1 -0
  277. package/dist/telemetry/read.d.ts +18 -4
  278. package/dist/telemetry/read.d.ts.map +1 -1
  279. package/dist/telemetry/types.d.ts +3 -2
  280. package/dist/telemetry/types.d.ts.map +1 -1
  281. package/dist/version.d.ts +3 -0
  282. package/dist/version.d.ts.map +1 -0
  283. package/dist/web/configApi.d.ts +154 -0
  284. package/dist/web/configApi.d.ts.map +1 -0
  285. package/dist/web/configRoute.d.ts +57 -0
  286. package/dist/web/configRoute.d.ts.map +1 -0
  287. package/dist/web/console.d.ts +8 -0
  288. package/dist/web/console.d.ts.map +1 -1
  289. package/dist/web/paths.d.ts +4 -3
  290. package/dist/web/paths.d.ts.map +1 -1
  291. package/dist/web/server.d.ts +30 -1
  292. package/dist/web/server.d.ts.map +1 -1
  293. package/dist/web/start.d.ts +15 -0
  294. package/dist/web/start.d.ts.map +1 -1
  295. package/dist/web/storageRoute.d.ts +2 -2
  296. package/package.json +13 -7
  297. package/dist/cli/tunnel.d.ts +0 -89
  298. package/dist/cli/tunnel.d.ts.map +0 -1
  299. package/dist/commands/orchestratorAgent.d.ts +0 -30
  300. package/dist/commands/orchestratorAgent.d.ts.map +0 -1
  301. package/dist/commands/slashCommand.d.ts +0 -39
  302. package/dist/commands/slashCommand.d.ts.map +0 -1
  303. package/dist/orchestrator/ledger.d.ts +0 -28
  304. package/dist/orchestrator/ledger.d.ts.map +0 -1
  305. package/dist/storage/graph/importLegacy.d.ts +0 -62
  306. package/dist/storage/graph/importLegacy.d.ts.map +0 -1
  307. package/dist/storage/graph/migrateLegacyBriefs.d.ts +0 -32
  308. package/dist/storage/graph/migrateLegacyBriefs.d.ts.map +0 -1
  309. package/dist/storage/graph/migration.d.ts +0 -91
  310. package/dist/storage/graph/migration.d.ts.map +0 -1
  311. package/dist/storage/graph/projections.d.ts +0 -31
  312. package/dist/storage/graph/projections.d.ts.map +0 -1
@@ -3,63 +3,62 @@ import type { GraphState } from "../graph/types";
3
3
  import type { LegacyExecutionTraceV1 } from "../plugin/graphShadowIngress";
4
4
  import type { ShadowRunSummary } from "./shadowComparator";
5
5
  /**
6
- * **Espejo shadow sin efectos** (GE-043): compila el trace productivo de
7
- * GE-042 a un `GraphSpecV1` validado, sintetiza el journal que ese run habría
8
- * escrito y lo pliega con el **reducer real** para producir el
9
- * `ShadowRunSummary` que consume el comparador de paridad (GE-044).
6
+ * **Side-effect-free shadow mirror** (GE-043): compiles the production trace
7
+ * from GE-042 into a validated `GraphSpecV1`, synthesizes the journal that run
8
+ * would have written, and folds it with the **real reducer** to produce the
9
+ * `ShadowRunSummary` consumed by the parity comparator (GE-044).
10
10
  *
11
- * El run legacy se ejecuta **una sola vez**: este módulo no tiene superficie de
12
- * ejecución. No importa el puerto `GraphEffectExecutor`, ni el adaptador de
13
- * sesión de opencode, ni el runtime, ni ningún origen de I/O, reloj o azar; el
14
- * único builtin alcanzable es `node:crypto` para el cómputo de digests. Por eso
15
- * el espejo no puede duplicar el trabajo que observa: no tiene con qué.
11
+ * The legacy run executes **exactly once**: this module has no execution
12
+ * surface. It imports neither the `GraphEffectExecutor` port, nor the opencode
13
+ * session adapter, nor the runtime, nor any I/O, clock, or random source; the
14
+ * only reachable builtin is `node:crypto` for digest computation. Therefore the
15
+ * mirror cannot duplicate the work it observes: it has no means to do so.
16
16
  *
17
- * **Qué prueba realmente cada dimensión de paridad** está declarado en
18
- * `SHADOW_MIRROR_PROVENANCE`, y esa distinción es deliberada: certificar
19
- * paridad sobre dimensiones que el espejo se limita a copiar del trace no
20
- * probaría nada. Solo el de fixes se **recomputa** desde el grafo compilado
21
- * (divergencia demostrable); el orden de nodos y los roles pasan por el
22
- * compilador y validador del spec —que rechaza traces irrepresentables como
23
- * `invalid-spec`— pero la compilación preserva ambos valores literalmente, así
24
- * que la comparación no puede divergir (**compiled**); el estado terminal lo
25
- * **valida** el reducer; el modelo y el outcome se **transportan** sin
26
- * inspección.
17
+ * **What each parity dimension actually proves** is declared in
18
+ * `SHADOW_MIRROR_PROVENANCE`, and that distinction is deliberate: certifying
19
+ * parity on dimensions that the mirror merely copies from the trace would prove
20
+ * nothing. Only the number of fixes is **recomputed** from the compiled graph
21
+ * (demonstrable divergence); node order and roles pass through the spec
22
+ * compiler and validator —which rejects unrepresentable traces as
23
+ * `invalid-spec`— but compilation preserves both values literally, so the
24
+ * comparison cannot diverge (**compiled**); the terminal state is **validated**
25
+ * by the reducer; the model and outcome are **carried** without inspection.
27
26
  *
28
- * Los artefactos del journal espejo son **placeholders sintéticos y
29
- * deterministas** (`shadow://<run>/<node>`): el espejo no tiene contenido que
30
- * digerir y el comparador no contrasta artefactos. El esquema `shadow://` los
31
- * hace inconfundibles con evidencia real.
27
+ * The shadow journal artifacts are **synthetic and deterministic placeholders**
28
+ * (`shadow://<run>/<node>`): the mirror has no content to digest, and the
29
+ * comparator does not compare artifacts. The `shadow://` scheme makes them
30
+ * unmistakable from real evidence.
32
31
  *
33
- * Módulo **puro y determinista**: el mismo trace produce el mismo spec, el
34
- * mismo journal y el mismo resumen.
32
+ * **Pure and deterministic** module: the same trace produces the same spec, the
33
+ * same journal, and the same summary.
35
34
  */
36
- /** Qué prueba el espejo sobre una dimensión de paridad concreta. */
35
+ /** What the mirror proves about a specific parity dimension. */
37
36
  export type ShadowParityProvenance = "recomputed" | "compiled" | "validated" | "carried";
38
37
  /**
39
- * Procedencia **demostrada** de cada dimensión que compara GE-044. Acota qué
40
- * puede afirmar la certificación de shadow (GE-046) y qué no.
38
+ * **Demonstrated** provenance of each dimension that GE-044 compares. It bounds
39
+ * what shadow certification (GE-046) can and cannot claim.
41
40
  *
42
- * - "recomputed": el espejo calcula el valor de forma independiente desde el
43
- * spec compilado. La comparación PUEDE divergirapta para conjunto crítico.
44
- * Un test de alcanzabilidad en `demonstrated-divergence-provenance.test.ts`
45
- * DEMUESTRA la divergencia atravesando el pipeline completo para cada código
46
- * así clasificado. Si no se puede producir, no es "recomputed".
47
- * - "compiled": la dimensión pasa por `GraphSpecV1Schema.parse` y
48
- * `validateGraphSpec`, que rechazan traces irrepresentables (ids duplicados,
49
- * reviewer sin implementer, ciclos → `invalid-spec`). La comparación NO
50
- * puede divergir porque la compilación preserva el valor idéntico, pero un
51
- * trace irrepresentable impide el espejo por completo. Esta es la
52
- * **representabilidad** sobre la que se apoya R6.
53
- * - "validated": el reducer valida la secuencia, pero ambos lados proyectan el
54
- * mismo campo del trace. La comparación NO puede divergir.
55
- * - "carried": ambos lados copian el mismo campo del trace sin que nadie lo
56
- * inspeccione. La comparación NO puede divergir.
41
+ * - "recomputed": the mirror calculates the value independently from the
42
+ * compiled spec. The comparison CAN divergesuitable for the critical set.
43
+ * A reachability test in `demonstrated-divergence-provenance.test.ts`
44
+ * DEMONSTRATES divergence by traversing the full pipeline for each code
45
+ * classified this way. If it cannot be produced, it is not "recomputed".
46
+ * - "compiled": the dimension passes through `GraphSpecV1Schema.parse` and
47
+ * `validateGraphSpec`, which reject unrepresentable traces (duplicate ids,
48
+ * reviewer without an implementer, cycles → `invalid-spec`). The comparison
49
+ * CANNOT diverge because compilation preserves the identical value, but an
50
+ * unrepresentable trace prevents the mirror entirely. This is the
51
+ * **representability** that R6 relies on.
52
+ * - "validated": the reducer validates the sequence, but both sides project
53
+ * the same field from the trace. The comparison CANNOT diverge.
54
+ * - "carried": both sides copy the same field from the trace without anyone
55
+ * inspecting it. The comparison CANNOT diverge.
57
56
  *
58
- * Invariante: solo los códigos con procedencia "recomputed" pueden incluirse
59
- * en `criticalDivergenceCodes` de la política soak, porque solo esos producen
60
- * una comparación independiente. Los códigos "compiled", "validated" o
61
- * "carried" no pueden divergir en la comparación; incluirlos inflaría la
62
- * cobertura declarada sin medir nada real.
57
+ * Invariant: only codes with "recomputed" provenance may be included in
58
+ * `criticalDivergenceCodes` in the soak policy, because only those produce an
59
+ * independent comparison. The "compiled", "validated", or "carried" codes
60
+ * cannot diverge in the comparison; including them would inflate the declared
61
+ * coverage without measuring anything real.
63
62
  */
64
63
  export declare const SHADOW_MIRROR_PROVENANCE: {
65
64
  readonly status: "validated";
@@ -69,15 +68,15 @@ export declare const SHADOW_MIRROR_PROVENANCE: {
69
68
  readonly fixes: "recomputed";
70
69
  readonly outcome: "carried";
71
70
  };
72
- /** Motivo tipado por el que un trace no produce espejo. */
71
+ /** Typed reason why a trace does not produce a mirror. */
73
72
  export type ShadowMirrorErrorCode = "invalid-trace" | "invalid-spec" | "illegal-sequence" | "mirror-error";
74
- /** Error tipado del espejo. Nunca escapa de la fachada (`graphFacade`). */
73
+ /** Typed mirror error. It never escapes the facade (`graphFacade`). */
75
74
  export declare class ShadowMirrorError extends Error {
76
75
  readonly code: ShadowMirrorErrorCode;
77
76
  readonly detail: string;
78
77
  constructor(code: ShadowMirrorErrorCode, detail: string);
79
78
  }
80
- /** Espejo completo: evidencia intermedia más el resumen comparable. */
79
+ /** Complete mirror: intermediate evidence plus the comparable summary. */
81
80
  export type ShadowMirror = {
82
81
  readonly spec: GraphSpecV1;
83
82
  readonly specDigest: string;
@@ -86,36 +85,38 @@ export type ShadowMirror = {
86
85
  readonly summary: ShadowRunSummary;
87
86
  };
88
87
  /**
89
- * Compila el trace a un DAG lineal: cada nodo depende del anterior y cada
90
- * reviewer revisa el implementer que le precede. Un trace que el grafo no puede
91
- * representar (reviewer sin implementer previo, ids duplicados, ciclo) es
92
- * rechazado por el validador real como `invalid-spec`, antes de reducir nada.
88
+ * Compiles the trace into a linear DAG: each node depends on the previous one,
89
+ * and each reviewer reviews the implementer that precedes it. A trace the graph
90
+ * cannot represent (reviewer without a previous implementer, duplicate ids,
91
+ * cycle) is rejected by the real validator as `invalid-spec`, before reducing
92
+ * anything.
93
93
  */
94
94
  export declare function compileShadowSpec(trace: LegacyExecutionTraceV1): GraphSpecV1;
95
95
  /**
96
- * Sintetiza el journal que el run observado habría escrito: apertura, despacho
97
- * y recibo por nodo en orden, y el evento terminal reclamado. `errorClass`
98
- * distingue el recibo: ausente es éxito, `cancelled` cancela y el resto falla.
96
+ * Synthesizes the journal that the observed run would have written: opening,
97
+ * dispatch and receipt per node in order, and the claimed terminal event.
98
+ * `errorClass` distinguishes the receipt: absent means success, `cancelled`
99
+ * cancels, and the rest fail.
99
100
  */
100
101
  export declare function mirrorJournal(spec: GraphSpecV1, trace: LegacyExecutionTraceV1): GraphEventV1[];
101
102
  /**
102
- * Pliega el journal espejo con el reducer real. Una secuencia que el reducer
103
- * rechazaun run que se dice completado con un nodo fallido, un despacho sobre
104
- * una dependencia no satisfechaes `illegal-sequence`: el grafo no pudo haber
105
- * producido esa ejecución, y esa es justamente la evidencia que aporta.
103
+ * Folds the shadow journal with the real reducer. A sequence the reducer
104
+ * rejectsa run that claims completion with a failed node, a dispatch on an
105
+ * unsatisfied dependencyis `illegal-sequence`: the graph could not have
106
+ * produced that execution, and that is exactly the evidence it contributes.
106
107
  */
107
108
  export declare function reduceMirror(spec: GraphSpecV1, journal: readonly GraphEventV1[]): GraphState;
108
109
  /**
109
- * Proyección 1:1 del **lado legacy**: lo que el run observado afirma de sí
110
- * mismo, sin pasar por el grafo. Es el término que el comparador contrasta
111
- * contra el espejo.
110
+ * 1:1 projection of the **legacy side**: what the observed run claims about
111
+ * itself, without passing through the graph. It is the term that the comparator
112
+ * contrasts against the mirror.
112
113
  */
113
114
  export declare function projectLegacySummary(trace: LegacyExecutionTraceV1): ShadowRunSummary;
114
115
  /**
115
- * Construye el espejo sin efectos de una ejecución legacy observada. Lanza
116
- * `ShadowMirrorError` cuando el grafo no puede representar o reproducir el
117
- * trace; la fachada (`graphFacade`) contiene ese fallo para que nunca alcance
118
- * al camino legacy.
116
+ * Builds the side-effect-free mirror of an observed legacy execution. Throws
117
+ * `ShadowMirrorError` when the graph cannot represent or reproduce the trace;
118
+ * the facade (`graphFacade`) contains that failure so it never reaches the
119
+ * legacy path.
119
120
  */
120
121
  export declare function mirrorLegacyExecution(trace: LegacyExecutionTraceV1): ShadowMirror;
121
122
  //# sourceMappingURL=graphShadow.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"graphShadow.d.ts","sourceRoot":"","sources":["../../src/orchestrator/graphShadow.ts"],"names":[],"mappings":"AAGA,OAAO,EACL,KAAK,YAAY,EAEjB,KAAK,WAAW,EAEjB,MAAM,iBAAiB,CAAC;AACzB,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAEjD,OAAO,KAAK,EACV,sBAAsB,EAEvB,MAAM,8BAA8B,CAAC;AACtC,OAAO,KAAK,EAEV,gBAAgB,EACjB,MAAM,oBAAoB,CAAC;AAE5B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AAEH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IAC1C,QAAQ,CAAC,KAAK,EAAE,UAAU,CAAC;IAC3B,QAAQ,CAAC,OAAO,EAAE,gBAAgB,CAAC;CACpC,CAAC;AAaF;;;;;;GAMG;AACH,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,sBAAsB,GAAG,WAAW,CAqC5E;AAkBD;;;;;GAKG;AACH,wBAAgB,aAAa,CAC3B,IAAI,EAAE,WAAW,EACjB,KAAK,EAAE,sBAAsB,GAC5B,YAAY,EAAE,CAmEhB;AAED;;;;;GAKG;AACH,wBAAgB,YAAY,CAC1B,IAAI,EAAE,WAAW,EACjB,OAAO,EAAE,SAAS,YAAY,EAAE,GAC/B,UAAU,CAeZ;AAED;;;;GAIG;AACH,wBAAgB,oBAAoB,CAClC,KAAK,EAAE,sBAAsB,GAC5B,gBAAgB,CAYlB;AA+BD;;;;;GAKG;AACH,wBAAgB,qBAAqB,CACnC,KAAK,EAAE,sBAAsB,GAC5B,YAAY,CAcd"}
@@ -1,30 +1,30 @@
1
1
  import type { ModelSelection } from "../router/types";
2
2
  /**
3
- * Adaptador tipado de sesión de opencode (GE-030).
3
+ * Typed opencode session adapter (GE-030).
4
4
  *
5
- * Estrecha la superficie de sesión de opencode a las seis operaciones de ciclo
6
- * de vida verificadas por el contrato (create, dispatch/prompt, children,
7
- * status/get, messages, abort) y normaliza cada fallo del cliente a un error
8
- * tipado {@link SessionAdapterError}. Deliberadamente **no** expone acciones
9
- * destructivas ni de resumen (delete, summarize, share/unshare, fork, command):
10
- * la autoridad del grafo nunca borra ni resume una sesión de forma automática.
5
+ * Narrows the opencode session surface to the six lifecycle operations
6
+ * verified by the contract (create, dispatch/prompt, children, status/get,
7
+ * messages, abort) and normalizes each client failure to a typed error
8
+ * {@link SessionAdapterError}. Deliberately **does not** expose destructive
9
+ * or summary actions (delete, summarize, share/unshare, fork, command):
10
+ * the graph authority never deletes or summarizes a session automatically.
11
11
  *
12
- * El adaptador no realiza I/O propio: envuelve un cliente inyectado
13
- * ({@link GraphSessionClient}) cuya forma es asignable desde el cliente real de
14
- * `@opencode-ai/sdk`. Un contract test fija esa correspondencia.
12
+ * The adapter performs no I/O of its own: it wraps an injected client
13
+ * ({@link GraphSessionClient}) whose shape is assignable from the real
14
+ * `@opencode-ai/sdk` client. A contract test pins that correspondence.
15
15
  */
16
- /** Resultado del SDK: dato tipado o error opaco, nunca ambos. */
16
+ /** SDK result: typed data or opaque error, never both. */
17
17
  type ClientResult<T> = {
18
18
  data?: T;
19
19
  error?: unknown;
20
20
  };
21
- /** Referencia mínima a una sesión (subconjunto verificado de `Session`). */
21
+ /** Minimal reference to a session (verified subset of `Session`). */
22
22
  export type SessionInfo = {
23
23
  readonly id: string;
24
24
  };
25
25
  /**
26
- * Puerto del cliente de sesión de opencode acotado a las operaciones que usa el
27
- * adaptador. Estructuralmente compatible con `client.session` del SDK real.
26
+ * opencode session client port limited to the operations the adapter uses.
27
+ * Structurally compatible with `client.session` from the real SDK.
28
28
  */
29
29
  export type GraphSessionClient = {
30
30
  session: {
@@ -75,21 +75,21 @@ export type GraphSessionClient = {
75
75
  }): Promise<ClientResult<boolean>>;
76
76
  };
77
77
  };
78
- /** Taxonomía cerrada de errores del adaptador de sesión. */
78
+ /** Closed taxonomy of session adapter errors. */
79
79
  export type SessionAdapterErrorCode = "create-failed" | "missing-session-id" | "dispatch-failed" | "children-failed" | "status-failed" | "messages-failed" | "abort-failed";
80
- /** Error tipado de una operación de sesión que falló o devolvió datos inválidos. */
80
+ /** Typed error from a session operation that failed or returned invalid data. */
81
81
  export declare class SessionAdapterError extends Error {
82
82
  readonly code: SessionAdapterErrorCode;
83
83
  readonly detail: string;
84
84
  constructor(code: SessionAdapterErrorCode, detail: string);
85
85
  }
86
- /** Datos para crear una sub-sesión hija. */
86
+ /** Data for creating a child sub-session. */
87
87
  export type CreateChildInput = {
88
88
  readonly parentSessionID?: string;
89
89
  readonly title?: string;
90
90
  readonly directory?: string;
91
91
  };
92
- /** Datos para despachar un prompt (el efecto) a una sesión existente. */
92
+ /** Data for dispatching a prompt (the effect) to an existing session. */
93
93
  export type DispatchInput = {
94
94
  readonly sessionID: string;
95
95
  readonly prompt: string;
@@ -97,19 +97,19 @@ export type DispatchInput = {
97
97
  readonly agent?: string;
98
98
  readonly system?: string;
99
99
  };
100
- /** Superficie verificada del adaptador de sesión de opencode. */
100
+ /** Verified surface of the opencode session adapter. */
101
101
  export interface OpencodeSessionAdapter {
102
- /** Crea una sub-sesión hija y devuelve su id; falla cerrado si no hay id. */
102
+ /** Creates a child sub-session and returns its id; fails closed if there is no id. */
103
103
  createChild(input: CreateChildInput): Promise<string>;
104
- /** Despacha un prompt a la sesión y devuelve la respuesta cruda del efecto. */
104
+ /** Dispatches a prompt to the session and returns the raw response from the effect. */
105
105
  dispatch(input: DispatchInput): Promise<unknown>;
106
- /** Lista los ids de las sesiones hijas. */
106
+ /** Lists the child session ids. */
107
107
  listChildren(sessionID: string): Promise<readonly string[]>;
108
- /** Devuelve el estado de la sesión (get por id). */
108
+ /** Returns the session state (get by id). */
109
109
  getStatus(sessionID: string): Promise<SessionInfo>;
110
- /** Lista los mensajes de la sesión. */
110
+ /** Lists the session messages. */
111
111
  listMessages(sessionID: string): Promise<readonly unknown[]>;
112
- /** Solicita abortar la sesión; devuelve si el runtime lo aceptó. */
112
+ /** Requests session abort; returns whether the runtime accepted it. */
113
113
  abort(sessionID: string): Promise<boolean>;
114
114
  }
115
115
  export declare function createOpencodeSessionAdapter(client: GraphSessionClient): OpencodeSessionAdapter;
@@ -1 +1 @@
1
- {"version":3,"file":"opencodeSessionAdapter.d.ts","sourceRoot":"","sources":["../../src/orchestrator/opencodeSessionAdapter.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAEtD;;;;;;;;;;;;;GAaG;AAEH,iEAAiE;AACjE,KAAK,YAAY,CAAC,CAAC,IAAI;IAAE,IAAI,CAAC,EAAE,CAAC,CAAC;IAAC,KAAK,CAAC,EAAE,OA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AS,EAAE,MAAM,GAAG,OAAO,CAAC,WAAW,CAAC,CAAC;IACnD,kCAAkC;IAClC,YAAY,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,SAAS,OAAO,EAAE,CAAC,CAAC;IAC7D,uEAAuE;IACvE,KAAK,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;CAC5C;AAiBD,wBAAgB,4BAA4B,CAC1C,MAAM,EAAE,kBAAkB,GACzB,sBAAsB,CA4GxB"}
@@ -1 +1 @@
1
- {"version":3,"file":"permissions.d.ts","sourceRoot":"","sources":["../../src/orchestrator/permissions.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAE5D,MAAM,MAAM,cAAc,GACtB,MAAM,GACN,MAAM,GACN,eAAe,GACf,aAAa,GACb,SAAS,GACT,OAAO,CAAC;AAEZ,MAAM,MAAM,iBAAiB,GAAG;IAC9B,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,cAAc,EAAE,CAAC;CAC3B,CAAC;AAEF,eAAO,MAAM,gBAAgB,EAAE,MAAM,CAAC,MAAM,EAAE,cAAc,EAAE,CAQ7D,CAAC;AASF,wBAAgB,aAAa,CAAC,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,cAAc,GAAG,OAAO,CAE3E;AAED,wBAAgB,yBAAyB,CACvC,QAAQ,EAAE,cAAc,EACxB,KAAK,EAAE,cAAc,EAAE,GACtB,cAAc,CAKhB;AAED,wBAAgB,aAAa,CAC3B,MAAM,EAAE,MAAM,EACd,IAAI,EAAE,cAAc,GACnB;IAAE,OAAO,EAAE,OAAO,CAAC;IAAC,MAAM,CAAC,EAAE,MAAM,CAAA;CAAE,CASvC"}
1
+ {"version":3,"file":"permissions.d.ts","sourceRoot":"","sources":["../../src/orchestrator/permissions.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAE5D,MAAM,MAAM,cAAc,GACtB,MAAM,GACN,MAAM,GACN,eAAe,GACf,aAAa,GACb,SAAS,GACT,OAAO,CAAC;AAEZ,MAAM,MAAM,iBAAiB,GAAG;IAC9B,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,cAAc,EAAE,CAAC;CAC3B,CAAC;AAEF,eAAO,MAAM,gBAAgB,EAAE,MAAM,CAAC,MAAM,EAAE,cAAc,EAAE,CAU7D,CAAC;AASF,wBAAgB,aAAa,CAAC,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,cAAc,GAAG,OAAO,CAE3E;AAED,wBAAgB,yBAAyB,CACvC,QAAQ,EAAE,cAAc,EACxB,KAAK,EAAE,cAAc,EAAE,GACtB,cAAc,CAKhB;AAED,wBAAgB,aAAa,CAC3B,MAAM,EAAE,MAAM,EACd,IAAI,EAAE,cAAc,GACnB;IAAE,OAAO,EAAE,OAAO,CAAC;IAAC,MAAM,CAAC,EAAE,MAAM,CAAA;CAAE,CASvC"}
@@ -0,0 +1,57 @@
1
+ import type { OpenTeamConfig } from "../config/schema";
2
+ import type { RoutingDecision, TaskSignals } from "../router/types";
3
+ import { type CoordinatorDeps, type RoleTaskResult } from "./coordinator";
4
+ /**
5
+ * W3 ralph loop (#174).
6
+ *
7
+ * Makes the guaranteed `ralph` role a real behaviour rather than an unreachable
8
+ * profile: a bounded iterate-until-done cycle. Each pass dispatches the `ralph`
9
+ * role through the real coordinator ({@link runRoleTask}), so the loop inherits
10
+ * two guarantees for free — the mandatory-local gate (#143), which refuses to run
11
+ * BEFORE the first iteration when no local runtime is reachable and never falls
12
+ * through to a frontier provider, and local-first routing, which keeps every
13
+ * iteration on a local runtime.
14
+ *
15
+ * This module is only loop CONTROL: model/runtime work is the injected coordinator
16
+ * deps, and the done-signal is an injected predicate. Deterministic given its
17
+ * ports — no clock, randomness or direct I/O.
18
+ */
19
+ /** Canonical roleID of the guaranteed ralph role. */
20
+ export declare const RALPH_ROLE_ID = "ralph";
21
+ /** Default iteration cap so the loop can never spin unbounded. */
22
+ export declare const DEFAULT_RALPH_MAX_ITERATIONS = 10;
23
+ export type RalphLoopInput = {
24
+ readonly task: TaskSignals;
25
+ readonly prompt: string;
26
+ readonly config: OpenTeamConfig;
27
+ readonly parentSessionID?: string;
28
+ /** Iteration cap; defaults to {@link DEFAULT_RALPH_MAX_ITERATIONS}. */
29
+ readonly maxIterations?: number;
30
+ };
31
+ /** Why the loop stopped: the done-signal fired, or the iteration cap was hit. */
32
+ export type RalphLoopTermination = "done" | "cap";
33
+ export type RalphLoopResult = {
34
+ readonly iterations: number;
35
+ readonly termination: RalphLoopTermination;
36
+ readonly decision: RoutingDecision | undefined;
37
+ readonly results: readonly RoleTaskResult[];
38
+ };
39
+ export type RalphLoopDeps = CoordinatorDeps & {
40
+ /**
41
+ * The done-signal predicate (#174). Reads the iteration's subsession result and
42
+ * decides whether the task is finished. Injected so the "fake runtime" that
43
+ * reports done/not-done stays outside the loop control under test.
44
+ */
45
+ readonly isDone: (result: RoleTaskResult) => boolean;
46
+ };
47
+ /**
48
+ * Runs the ralph loop (#174): dispatches the `ralph` role repeatedly until the
49
+ * injected done-signal fires or the iteration cap is reached.
50
+ *
51
+ * On the first pass, {@link runRoleTask} enforces the mandatory-local gate: when
52
+ * no local runtime is reachable it throws before any dispatch, so the loop fails
53
+ * before the first iteration and no model is contacted — the caller sees the
54
+ * thrown, actionable error.
55
+ */
56
+ export declare function runRalphLoop(input: RalphLoopInput, deps: RalphLoopDeps): Promise<RalphLoopResult>;
57
+ //# sourceMappingURL=ralphLoop.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ralphLoop.d.ts","sourceRoot":"","sources":["../../src/orchestrator/ralphLoop.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AACvD,OAAO,KAAK,EAAE,eAAe,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AACpE,OAAO,EACL,KAAK,eAAe,EAEpB,KAAK,cAAc,EAEpB,MAAM,eAAe,CAAC;AAEvB;;;;;;;;;;;;;;GAcG;AAEH,qDAAqD;AACrD,eAAO,MAAM,aAAa,UAAU,CAAC;AAErC,kEAAkE;AAClE,eAAO,MAAM,4BAA4B,KAAK,CAAC;AAE/C,MAAM,MAAM,cAAc,GAAG;IAC3B,QAAQ,CAAC,IAAI,EAAE,WAAW,CAAC;IAC3B,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,MAAM,EAAE,cAAc,CAAC;IAChC,QAAQ,CAAC,eAAe,CAAC,EAAE,MAAM,CAAC;IAClC,uEAAuE;IACvE,QAAQ,CAAC,aAAa,CAAC,EAAE,MAAM,CAAC;CACjC,CAAC;AAEF,iFAAiF;AACjF,MAAM,MAAM,oBAAoB,GAAG,MAAM,GAAG,KAAK,CAAC;AAElD,MAAM,MAAM,eAAe,GAAG;IAC5B,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,WAAW,EAAE,oBAAoB,CAAC;IAC3C,QAAQ,CAAC,QAAQ,EAAE,eAAe,GAAG,SAAS,CAAC;IAC/C,QAAQ,CAAC,OAAO,EAAE,SAAS,cAAc,EAAE,CAAC;CAC7C,CAAC;AAEF,MAAM,MAAM,aAAa,GAAG,eAAe,GAAG;IAC5C;;;;OAIG;IACH,QAAQ,CAAC,MAAM,EAAE,CAAC,MAAM,EAAE,cAAc,KAAK,OAAO,CAAC;CACtD,CAAC;AAeF;;;;;;;;GAQG;AACH,wBAAsB,YAAY,CAChC,KAAK,EAAE,cAAc,EACrB,IAAI,EAAE,aAAa,GAClB,OAAO,CAAC,eAAe,CAAC,CA+B1B"}
@@ -1,5 +1,6 @@
1
1
  import { z } from "zod";
2
2
  import type { CapabilityRequirement, ComplexityTier } from "../capabilities/types";
3
+ import type { LocalRuntimeId } from "../local/types";
3
4
  import type { ModelSelection, TaskSignals } from "../router/types";
4
5
  export type AgentRoleProfile = {
5
6
  roleID: string;
@@ -8,9 +9,34 @@ export type AgentRoleProfile = {
8
9
  minReasoningTier: 1 | 2 | 3 | 4 | 5;
9
10
  minCodeQualityTier: 1 | 2 | 3 | 4 | 5;
10
11
  needsToolCallingByDefault: boolean;
11
- preferredLocalModels: ModelSelection[];
12
12
  preferredFrontierModels: Array<ModelSelection | "auto">;
13
13
  localFirst: boolean;
14
+ /**
15
+ * Hard requirement that this role runs on a reachable LOCAL runtime (#143).
16
+ *
17
+ * This is a PROHIBITION, distinct from the `localFirst` PREFERENCE. `localFirst`
18
+ * only tilts routing toward local and still falls through to frontier when no
19
+ * local runtime is reachable (2026-08-26 ruling). `requiresLocalRuntime` refuses
20
+ * the request before dispatch when no local runtime is reachable — it never
21
+ * falls through to a frontier provider. Optional so existing roles keep today's
22
+ * behaviour; only bookkeeping/safety roles (scribe, ralph, guardian) set it `true`.
23
+ */
24
+ requiresLocalRuntime?: boolean;
25
+ /**
26
+ * Ordered preference list of LOCAL runtimes this role may draw on (#144).
27
+ *
28
+ * When set, dispatch walks the list in order and picks the FIRST runtime that
29
+ * is reachable; an unreachable runtime is skipped (failover). The chosen
30
+ * runtime is then honoured for the whole task — capacity is enforced on it and
31
+ * excess work queues rather than spilling to a less-preferred runtime. When
32
+ * `requiresLocalRuntime` is also set, the hard requirement is satisfied when
33
+ * ANY listed runtime is reachable; when none is, the role fails closed.
34
+ *
35
+ * Optional so existing roles keep today's behaviour: without a list, the role
36
+ * dispatches to whatever local model routing selected, with capacity enforced
37
+ * on that runtime.
38
+ */
39
+ localRuntimes?: LocalRuntimeId[];
14
40
  };
15
41
  export declare const AgentRoleProfileSchema: z.ZodObject<{
16
42
  roleID: z.ZodString;
@@ -24,17 +50,33 @@ export declare const AgentRoleProfileSchema: z.ZodObject<{
24
50
  minReasoningTier: z.ZodUnion<readonly [z.ZodLiteral<1>, z.ZodLiteral<2>, z.ZodLiteral<3>, z.ZodLiteral<4>, z.ZodLiteral<5>]>;
25
51
  minCodeQualityTier: z.ZodUnion<readonly [z.ZodLiteral<1>, z.ZodLiteral<2>, z.ZodLiteral<3>, z.ZodLiteral<4>, z.ZodLiteral<5>]>;
26
52
  needsToolCallingByDefault: z.ZodBoolean;
27
- preferredLocalModels: z.ZodArray<z.ZodObject<{
28
- providerID: z.ZodString;
29
- modelID: z.ZodString;
30
- }, z.core.$strip>>;
31
53
  preferredFrontierModels: z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
32
54
  providerID: z.ZodString;
33
55
  modelID: z.ZodString;
34
- }, z.core.$strip>, z.ZodLiteral<"auto">]>>;
56
+ }, z.core.$strict>, z.ZodLiteral<"auto">]>>;
35
57
  localFirst: z.ZodBoolean;
36
- }, z.core.$strip>;
58
+ requiresLocalRuntime: z.ZodOptional<z.ZodBoolean>;
59
+ localRuntimes: z.ZodOptional<z.ZodArray<z.ZodEnum<{
60
+ "foundry-local": "foundry-local";
61
+ lemonade: "lemonade";
62
+ lmstudio: "lmstudio";
63
+ ollama: "ollama";
64
+ }>>>;
65
+ }, z.core.$strict>;
37
66
  export declare const TEAM_ROLES: Record<string, AgentRoleProfile>;
38
- export declare function getRoleProfile(roleID: string): AgentRoleProfile | undefined;
67
+ export declare function getRoleProfile(roleID: string, configuredRoles?: Readonly<Record<string, AgentRoleProfile>>): AgentRoleProfile | undefined;
68
+ /**
69
+ * Synthesises a neutral, frontier-eligible fallback profile for a roleID that
70
+ * is not present in TEAM_ROLES. The roleID is passed through verbatim so the
71
+ * orchestrator dispatches the correct agent name to opencode, producing an
72
+ * accurate error ("agent Galadriel not found") rather than a misleading one
73
+ * ("agent scribe not found") when the agent does not exist in the workspace.
74
+ *
75
+ * Profile values mirror the majority of the team (yen/basher/reviewer):
76
+ * moderate tier with frontier escalation enabled and local-first routing, so
77
+ * the core local-first promise is preserved while unknown roles are never
78
+ * silently starved of frontier access.
79
+ */
80
+ export declare function synthesiseFallbackProfile(roleID: string): AgentRoleProfile;
39
81
  export declare function roleToRequirement(role: AgentRoleProfile, task: TaskSignals, tier?: ComplexityTier): CapabilityRequirement;
40
82
  //# sourceMappingURL=roles.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"roles.d.ts","sourceRoot":"","sources":["../../src/orchestrator/roles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,OAAO,KAAK,EACV,qBAAqB,EACrB,cAAc,EACf,MAAM,uBAAuB,CAAC;AAC/B,OAAO,KAAK,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAEnE,MAAM,MAAM,gBAAgB,GAAG;IAC7B,MAAM,EAAE,MAAM,CAAC;IACf,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,WAAW,EAAE,cAAc,CAAC;IAC5B,gBAAgB,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;IACpC,kBAAkB,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;IACtC,yBAAyB,EAAE,OAAO,CAAC;IACnC,oBAAoB,EAAE,cAAc,EAAE,CAAC;IACvC,uBAAuB,EAAE,KAAK,CAAC,cAAc,GAAG,MAAM,CAAC,CAAC;IACxD,UAAU,EAAE,OAAO,CAAC;CACrB,CAAC;AAeF,eAAO,MAAM,sBAAsB;;;;;;;;;;;;;;;;;;;;;iBAYjC,CAAC;AAGH,eAAO,MAAM,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,gBAAgB,CAgFvD,CAAC;AAEF,wBAAgB,cAAc,CAAC,MAAM,EAAE,MAAM,GAAG,gBAAgB,GAAG,SAAS,CAE3E;AAED,wBAAgB,iBAAiB,CAC/B,IAAI,EAAE,gBAAgB,EACtB,IAAI,EAAE,WAAW,EACjB,IAAI,CAAC,EAAE,cAAc,GACpB,qBAAqB,CAevB"}
1
+ {"version":3,"file":"roles.d.ts","sourceRoot":"","sources":["../../src/orchestrator/roles.ts"],"names":[],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C/B,IAAI,EAAE,gBAAgB,EACtB,IAAI,EAAE,WAAW,EACjB,IAAI,CAAC,EAAE,cAAc,GACpB,qBAAqB,CAevB"}
@@ -0,0 +1,103 @@
1
+ import { z } from "zod";
2
+ /**
3
+ * W3 roster model (#171, #172).
4
+ *
5
+ * The roster is a STRUCTURED artifact, never free LLM prose: a chosen `universe`
6
+ * plus a list of `roleID` → `agentName` entries. The split (decision P6(a)) keeps
7
+ * routing keyed to the stable `roleID` (which resolves to a capability profile via
8
+ * {@link getRoleProfile}) while the themed `agentName` is only the dispatch alias
9
+ * opencode sees. Validating the artifact with Zod removes the silent-no-op failure
10
+ * class of a prose parser.
11
+ *
12
+ * This module is pure: no I/O, clock, or randomness. Generation takes an injected
13
+ * {@link RosterSource} port so the model call stays outside the decision core, and
14
+ * persistence lives in `rosterPersistence.ts`.
15
+ */
16
+ /** One cast member: a stable routing `roleID` bound to a themed dispatch alias. */
17
+ export declare const RosterEntrySchema: z.ZodObject<{
18
+ roleID: z.ZodString;
19
+ agentName: z.ZodString;
20
+ }, z.core.$strict>;
21
+ /** A structured roster: one universe shared by every entry. */
22
+ export declare const RosterSchema: z.ZodObject<{
23
+ universe: z.ZodString;
24
+ entries: z.ZodArray<z.ZodObject<{
25
+ roleID: z.ZodString;
26
+ agentName: z.ZodString;
27
+ }, z.core.$strict>>;
28
+ }, z.core.$strict>;
29
+ export type RosterEntry = z.infer<typeof RosterEntrySchema>;
30
+ export type Roster = z.infer<typeof RosterSchema>;
31
+ /**
32
+ * The four roles every roster must contain (#171). `orchestrator` is the primary
33
+ * agent itself and has no TEAM_ROLES profile; `guardian`/`scribe`/`ralph` are the
34
+ * bookkeeping/safety roles that carry `requiresLocalRuntime`. Security review,
35
+ * decision capture and the ralph loop can never be silently omitted from a team.
36
+ */
37
+ export declare const GUARANTEED_ROLE_IDS: readonly ["orchestrator", "guardian", "scribe", "ralph"];
38
+ export type GuaranteedRoleID = (typeof GUARANTEED_ROLE_IDS)[number];
39
+ /** Guaranteed roleIDs absent from a roster, in canonical order. */
40
+ export declare function missingGuaranteedRoles(roster: Roster): GuaranteedRoleID[];
41
+ /** Whether every guaranteed roleID is present in the roster. */
42
+ export declare function hasAllGuaranteedRoles(roster: Roster): boolean;
43
+ /**
44
+ * Enforces the guaranteed-role invariant (#171): re-adds any missing guaranteed
45
+ * role, binding its `agentName` to the canonical roleID so it dispatches to the
46
+ * standard agent. Returns the roster unchanged when nothing is missing. Pure.
47
+ */
48
+ export declare function enforceGuaranteedRoles(roster: Roster): Roster;
49
+ /** Draft roster a generator source emits before Zod validation. */
50
+ export type RosterDraft = {
51
+ universe: string;
52
+ entries: Array<{
53
+ roleID: string;
54
+ agentName: string;
55
+ }>;
56
+ };
57
+ /**
58
+ * Injected generation port (#172). Turns an initial prompt into a draft roster.
59
+ * In production this wraps a model call; tests pass a deterministic fake, so the
60
+ * generator's decision core never contacts a live LLM.
61
+ */
62
+ export type RosterSource = (prompt: string) => RosterDraft | Promise<RosterDraft>;
63
+ /**
64
+ * Generates a roster from the initial prompt (#172): runs the injected source,
65
+ * validates the draft with Zod (fail-closed on a malformed roster), then enforces
66
+ * the guaranteed roles (#171). The result is always a valid, guaranteed roster.
67
+ */
68
+ export declare function generateRoster(prompt: string, source: RosterSource): Promise<Roster>;
69
+ /**
70
+ * The dispatch target for a roleID: the themed `agentName` opencode dispatches to.
71
+ * `undefined` when the roleID is not in the roster. This is the roleID/agentName
72
+ * split at the dispatch boundary — routing uses the roleID, opencode uses this.
73
+ */
74
+ export declare function rosterDispatchTarget(roster: Roster, roleID: string): string | undefined;
75
+ /**
76
+ * Resolves the universe an entry belongs to (#172). The universe is recorded ONCE
77
+ * for the whole roster, so every entry shares the single roster universe; this
78
+ * throws if the entry is not part of the roster, so the invariant is checked, not
79
+ * assumed. Pure.
80
+ */
81
+ export declare function resolveEntryUniverse(roster: Roster, entry: RosterEntry): string;
82
+ /**
83
+ * Actionable, English failure for a guaranteed role whose agent file was never
84
+ * written (#153, Defect B). `openteam setup` currently writes only the primary
85
+ * agent, so `scribe`/`ralph`/`guardian` have no agent file to dispatch to. Names
86
+ * the missing agent and points at `openteam setup` rather than surfacing an opaque
87
+ * "agent not found" from opencode.
88
+ */
89
+ export declare function missingAgentFileMessage(agentName: string): string;
90
+ /**
91
+ * Fails closed BEFORE dispatch when a guaranteed role's agent file is absent
92
+ * (#153, Defect B). `agentFileExists` is an injected I/O port — the filesystem
93
+ * probe lives at the composition root, so this stays pure of I/O.
94
+ */
95
+ export declare function assertAgentFileForRole(agentName: string, agentFileExists: (agentName: string) => boolean | Promise<boolean>): Promise<void>;
96
+ /**
97
+ * Dispatches a guaranteed role only after asserting its agent file exists (#153).
98
+ * The agent-file guard runs BEFORE the `dispatch` callback, so a missing file
99
+ * surfaces the actionable error without ever contacting a model. `dispatch` is the
100
+ * real coordinator call the caller supplies.
101
+ */
102
+ export declare function dispatchGuaranteedRole<T>(agentName: string, agentFileExists: (agentName: string) => boolean | Promise<boolean>, dispatch: () => Promise<T>): Promise<T>;
103
+ //# sourceMappingURL=roster.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"roster.d.ts","sourceRoot":"","sources":["../../src/orchestrator/roster.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB;;;;;;;;;;;;;GAaG;AAEH,mFAAmF;AACnF,eAAO,MAAM,iBAAiB;;;kBAKnB,CAAC;AAEZ,+DAA+D;AAC/D,eAAO,MAAM,YAAY;;;;;;kBAKd,CAAC;AAEZ,MAAM,MAAM,WAAW,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iBAAiB,CAAC,CAAC;AAC5D,MAAM,MAAM,MAAM,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,YAAY,CAAC,CAAC;AAElD;;;;;GAKG;AACH,eAAO,MAAM,mBAAmB,YAC9B,cAAc,EACd,UAAU,EACV,QAAQ,EACR,OAAO,CACC,CAAC;AAEX,MAAM,MAAM,gBAAgB,GAAG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