@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
@@ -1,10 +1,14 @@
1
+ import { z } from "zod";
1
2
  import type { BudgetState } from "../capabilities/budget";
2
3
  import type { ModelCapabilityProfile } from "../capabilities/types";
3
4
  import type { OpenTeamConfig } from "../config/schema";
5
+ import type { RuntimeConcurrencyLimiter } from "../local/concurrency";
6
+ import type { LocalRuntimeId } from "../local/types";
4
7
  import type { AvailableModel, RoutingDecision, TaskSignals } from "../router/types";
5
8
  import { type EventSink } from "../telemetry/eventLog";
6
9
  import { type MeetingEvent, type RouteEvent } from "../telemetry/events";
7
10
  import type { CostRecord } from "../telemetry/types";
11
+ import { type AgentRoleProfile } from "./roles";
8
12
  import { type OpencodeSessionClient, type SubsessionResult } from "./subsessions";
9
13
  export type RoleTaskInput = {
10
14
  roleID: string;
@@ -18,8 +22,18 @@ export type RoleTaskInput = {
18
22
  title?: string;
19
23
  systemPrompt?: string;
20
24
  directory?: string;
25
+ /**
26
+ * Dispatch alias override for the roleID/agentName split (#172, W3-S02). When a
27
+ * roster themes a role (e.g. roleID `scribe` → agentName `gandalf`), routing
28
+ * still keys on `roleID` but opencode must dispatch to the themed `agentName`.
29
+ * When set, it wins over the role profile's `opencodeAgent`; when absent, the
30
+ * profile's `opencodeAgent` is used exactly as before.
31
+ */
32
+ agentOverride?: string;
21
33
  /** Correlación opcional con una tarea del loop SDD/backlog (Fase D). */
22
34
  taskID?: string;
35
+ /** Role IDs this task depends on. Dependents only run after dependencies succeed. */
36
+ dependsOn?: readonly string[];
23
37
  };
24
38
  export type CoordinatorDeps = {
25
39
  client: OpencodeSessionClient;
@@ -27,6 +41,58 @@ export type CoordinatorDeps = {
27
41
  now: () => number;
28
42
  newDecisionID: () => string;
29
43
  timeoutMs?: number;
44
+ /** Optional warn sink; defaults to `console.warn`. Injectable for tests. */
45
+ warn?: (message?: unknown) => void;
46
+ /**
47
+ * Caller-owned Set for once-per-roleID dedup of `warnUnknownRole`. Production
48
+ * callers pass a long-lived Set (one per plugin instance) so the warning is
49
+ * emitted at most once per session. Test callers pass `new Set()` per case
50
+ * for full isolation. When absent, every call to `warnUnknownRole` emits.
51
+ */
52
+ warnedRoles?: Set<string>;
53
+ /**
54
+ * Reachability probe for local runtimes (#143). A REQUIRED injected I/O port —
55
+ * probing lives in `src/local/**`; the coordinator receives only the boolean
56
+ * result, so this module stays I/O-free. Consulted ONLY for roles that carry
57
+ * `requiresLocalRuntime === true`; returns true when at least one local runtime
58
+ * is reachable, treating a configured-but-unreachable runtime as absent.
59
+ *
60
+ * Deliberately required, with NO fallback. A prohibition must never fail open:
61
+ * an enabled-but-unreachable runtime (e.g. a stopped daemon) is the very case
62
+ * #143 exists to catch, and an `enabled`-flag fallback would pass the gate for
63
+ * it. Making the port mandatory also turns a missing composition-root wiring
64
+ * into a compile error, so the gate cannot be silently bypassed by dropping the
65
+ * injection.
66
+ */
67
+ localRuntimeReachable: () => boolean | Promise<boolean>;
68
+ /**
69
+ * Optional per-runtime reachability probe (#144). Returns the set of local
70
+ * runtime ids currently reachable, so the dispatcher can fail over across the
71
+ * ordered list a role declares (`localRuntimes`): an unreachable runtime is
72
+ * absent from the set and is skipped in favour of the next listed one.
73
+ *
74
+ * Injected I/O port, like `localRuntimeReachable` — probing lives in
75
+ * `src/local/**`. Optional so existing callers (and the many test construction
76
+ * sites) need no change and keep the pre-#144 boolean-only behaviour; when it
77
+ * is absent the coordinator falls back to `localRuntimeReachable` and roles
78
+ * without a list are unaffected. When present alongside a role that declares a
79
+ * list, it is the single probe consulted for the batch, and `any reachable` is
80
+ * derived from it — the two ports are never both probed for one batch.
81
+ */
82
+ reachableRuntimeIds?: () => ReadonlySet<LocalRuntimeId> | Promise<ReadonlySet<LocalRuntimeId>>;
83
+ /**
84
+ * Optional per-runtime concurrency limiter (#144). Caps concurrent generations
85
+ * per runtime to its configured slot count and QUEUES excess work rather than
86
+ * dropping it or spilling it to another runtime. Optional so existing callers
87
+ * need no change; when absent, no cap is enforced (pre-#144 behaviour).
88
+ *
89
+ * The coordinator takes a slot with the synchronous `tryAcquire` on the happy
90
+ * path — adding no `await` before dispatch, so concurrent telemetry emission
91
+ * order within a wave is unperturbed — and only awaits `acquire` when the
92
+ * runtime is saturated. A task holds its slot for the whole subsession and is
93
+ * released in a `finally`, so it stays pinned to its runtime for its duration.
94
+ */
95
+ runtimeLimiter?: RuntimeConcurrencyLimiter;
30
96
  };
31
97
  export type CorrelatedCostRecord = CostRecord & {
32
98
  decisionID: string;
@@ -42,10 +108,118 @@ export type RoleTaskResult = {
42
108
  subsession: SubsessionResult;
43
109
  record: CorrelatedCostRecord;
44
110
  };
111
+ /**
112
+ * Emits an observable warning the first time an unknown roleID is encountered
113
+ * within a given `warnedRoles` Set. Callers own the Set and its lifetime:
114
+ * production callers pass a long-lived Set (no repeat logs); test callers pass
115
+ * a fresh `new Set()` per case (full isolation). When `warnedRoles` is not
116
+ * provided the warning is emitted unconditionally on every call.
117
+ *
118
+ * Follows the `warn*` convention used throughout the codebase
119
+ * (see `warnInertPrivacySetting`, `warnCostRecordRejections`).
120
+ */
121
+ export declare function warnUnknownRole(roleID: string, warn?: (message?: unknown) => void, warnedRoles?: Set<string>): void;
122
+ /**
123
+ * Actionable, English pre-dispatch failure for a role that requires a local
124
+ * runtime when none is reachable (#143). Names the role, states the hard
125
+ * requirement, lists the three supported local runtimes a user typically forgot
126
+ * to start, and points at `openteam doctor`. Deliberately not a generic provider
127
+ * error: a forgotten daemon is the overwhelmingly likely cause.
128
+ */
129
+ export declare function mandatoryLocalRuntimeMessage(roleID: string): string;
130
+ /**
131
+ * Enforces the mandatory-local requirement (#143) BEFORE any model dispatch.
132
+ * For a role with `requiresLocalRuntime === true`, refuses the request when no
133
+ * local runtime is reachable — it never falls through to frontier. This does not
134
+ * overturn the 2026-08-26 fallback ruling: that ruling preserves explicit
135
+ * prohibitions, and this is one such prohibition, carried per role.
136
+ *
137
+ * Reachability is resolved ONCE per batch by `resolveLocalRuntimeReachable` and
138
+ * passed in as data, so this check is synchronous and adds no `await` inside a
139
+ * concurrent wave (telemetry emission order is unperturbed). There is
140
+ * deliberately no fallback: a prohibition must fail closed, so anything other
141
+ * than an explicit `true` refuses the request.
142
+ */
143
+ export declare function assertLocalRuntimeForRole(role: AgentRoleProfile, roleID: string, reachable: boolean | undefined): void;
144
+ /**
145
+ * Reachability resolved once for a batch (#143/#144). `any` is whether at least
146
+ * one local runtime is reachable (the #143 boolean signal); `set`, when present,
147
+ * is the per-runtime reachability used to fail over across a role's ordered list
148
+ * and to select which runtime a task pins to. `set` is `undefined` when the
149
+ * per-runtime port is not wired or the batch has no role that declares a list —
150
+ * in which case only the boolean path is used, preserving pre-#144 behaviour.
151
+ */
152
+ export type BatchReachability = {
153
+ readonly any: boolean | undefined;
154
+ readonly set: ReadonlySet<LocalRuntimeId> | undefined;
155
+ };
156
+ /**
157
+ * Classifies a raw failure reason into a bounded, non-free-form code for
158
+ * persisted telemetry. The raw `failureReason` from `errorReason()` in
159
+ * `subsessions.ts` can contain SDK error messages that echo request content
160
+ * (provider content-filter rejections, validation errors quoting the payload).
161
+ * Persisting those verbatim violates the project's telemetry policy: "auditable
162
+ * JSONL with a hashed prompt by default; do not store sensitive prompts."
163
+ *
164
+ * The classified code preserves the debugging signal that actually gets
165
+ * aggregated (timeout vs. rejection vs. missing session) while carrying no
166
+ * payload. The raw string remains available in-memory via
167
+ * `CorrelatedCostRecord.failureReason` for the tool response.
168
+ *
169
+ * Pure: no I/O, clock, random, or env.
170
+ */
171
+ /**
172
+ * Classifies a raw failure reason into a bounded, non-free-form code for
173
+ * persisted telemetry AND the console failure viewer (P11c, see #195). The raw
174
+ * `failureReason` from `errorReason()` in `subsessions.ts` can contain SDK error
175
+ * messages that echo request content (provider content-filter rejections,
176
+ * validation errors quoting the payload). Persisting or rendering those verbatim
177
+ * violates the project's telemetry policy: "auditable JSONL with a hashed prompt
178
+ * by default; do not store sensitive prompts."
179
+ *
180
+ * The classified code preserves the debugging signal that actually gets
181
+ * aggregated (timeout vs. auth vs. rate-limit vs. rejection vs. missing session)
182
+ * while carrying no payload. The raw string remains available in-memory via
183
+ * `CorrelatedCostRecord.failureReason` for the tool response.
184
+ *
185
+ * Pure: no I/O, clock, random, or env.
186
+ */
187
+ export declare const TelemetryFailureClassSchema: z.ZodEnum<{
188
+ "create-no-id": "create-no-id";
189
+ "create-rejected": "create-rejected";
190
+ "prompt-auth": "prompt-auth";
191
+ "prompt-connection": "prompt-connection";
192
+ "prompt-content-filter": "prompt-content-filter";
193
+ "prompt-context-length": "prompt-context-length";
194
+ "prompt-rate-limited": "prompt-rate-limited";
195
+ "prompt-rejected": "prompt-rejected";
196
+ "prompt-server": "prompt-server";
197
+ "prompt-timeout": "prompt-timeout";
198
+ "prompt-validation": "prompt-validation";
199
+ unknown: "unknown";
200
+ }>;
201
+ export type TelemetryFailureClass = z.infer<typeof TelemetryFailureClassSchema>;
202
+ export declare function classifyFailureForTelemetry(failureReason: string, failureStage: string | undefined): TelemetryFailureClass;
203
+ /**
204
+ * Console-facing classifier for an opencode `session.error` frame (P11c, see
205
+ * #195). The console failure viewer currently renders `error.message` verbatim;
206
+ * this maps the frame to a bounded {@link TelemetryFailureClass} so the viewer can
207
+ * render a class instead of a free-form provider string. Total and content-free:
208
+ * a frame with no recognised cause — or no message at all — maps to `unknown`, and
209
+ * the raw message is never returned.
210
+ */
211
+ export declare function classifyOpencodeSessionError(error: {
212
+ readonly name?: string | undefined;
213
+ readonly message?: string | undefined;
214
+ } | undefined): TelemetryFailureClass;
45
215
  /**
46
216
  * Mapea un `CorrelatedCostRecord` a un `route` event preservando la correlación
47
- * (decisionID/agent/success/batchID/failureReason/failureStage) que el sink de
217
+ * (decisionID/agent/success/batchID/failureStage) que el sink de
48
218
  * `CostRecord` legacy descartaba. Puro.
219
+ *
220
+ * `failureReason` is classified into a bounded code via
221
+ * `classifyFailureForTelemetry` rather than copied raw — the raw string may
222
+ * contain SDK error messages that echo request content.
49
223
  */
50
224
  export declare function correlatedCostRecordToRouteEvent(record: CorrelatedCostRecord): RouteEvent;
51
225
  /**
@@ -54,5 +228,17 @@ export declare function correlatedCostRecordToRouteEvent(record: CorrelatedCostR
54
228
  */
55
229
  export declare function buildMeetingEvent(inputs: readonly RoleTaskInput[], batchID: string, decisionIDs: readonly string[], ts: number): MeetingEvent | undefined;
56
230
  export declare function runRoleTask(input: RoleTaskInput, deps: CoordinatorDeps): Promise<RoleTaskResult>;
57
- export declare function runRoleTasks(inputs: readonly RoleTaskInput[], deps: CoordinatorDeps): Promise<RoleTaskResult[]>;
231
+ export type RoleBatchResult = {
232
+ readonly batchID: string;
233
+ readonly results: RoleTaskResult[];
234
+ /** Role IDs that were not executed because a dependency failed or was cancelled. */
235
+ readonly cancelled: readonly string[];
236
+ };
237
+ /**
238
+ * Computes topological waves from inputs: each wave contains roles whose
239
+ * dependencies all appear in earlier waves. Roles with no `dependsOn` are in
240
+ * wave 0. Pure and deterministic: same inputs produce the same waves.
241
+ */
242
+ export declare function topologicalWaves(inputs: readonly RoleTaskInput[]): RoleTaskInput[][];
243
+ export declare function runRoleTasks(inputs: readonly RoleTaskInput[], deps: CoordinatorDeps): Promise<RoleBatchResult>;
58
244
  //# sourceMappingURL=coordinator.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"coordinator.d.ts","sourceRoot":"","sources":["../../src/orchestrator/coordinator.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAE1D,OAAO,KAAK,EAEV,sBAAsB,EACvB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAEvD,OAAO,KAAK,EACV,cAAc,EACd,eAAe,EAEf,WAAW,EACZ,MAAM,iBAAiB,CAAC;AAEzB,OAAO,EAA0B,KAAK,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAC/E,OAAO,EAEL,KAAK,YAAY,EAEjB,KAAK,UAAU,EAChB,MAAM,qBAAqB,CAAC;AAE7B,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAQrD,OAAO,EACL,KAAK,qBAAqB,EAG1B,KAAK,gBAAgB,EACtB,MAAM,eAAe,CAAC;AAEvB,MAAM,MAAM,aAAa,GAAG;IAC1B,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,WAAW,CAAC;IAClB,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,sBAAsB,EAAE,CAAC;IACpC,eAAe,CAAC,EAAE,cAAc,EAAE,CAAC;IACnC,WAAW,CAAC,EAAE,WAAW,CAAC;IAC1B,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,MAAM,EAAE,cAAc,CAAC;IACvB,KAAK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C,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;CACvC,GACD,SAAS,GACZ,qBAAqB,CASvB;AAED;;;;;;;;GAQG;AACH,wBAAgB,gCAAgC,CAC9C,MAAM,EAAE,oBAAoB,GAC3B,UAAU,CA4BZ;AAED;;;GAGG;AACH,wBAAgB,iBAAiB,CAC/B,MAAM,EAAE,SAAS,aAAa,EAAE,EAChC,OAAO,EAAE,MAAM,EACf,WAAW,EAAE,SAAS,MAAM,EAAE,EAC9B,EAAE,EAAE,MAAM,GACT,YAAY,GAAG,SAAS,CAkB1B;AAkHD,wBAAsB,WAAW,CAC/B,KAAK,EAAE,aAAa,EACpB,IAAI,EAAE,eAAe,GACpB,OAAO,CAAC,cAAc,CAAC,CAUzB;AAED,MAAM,MAAM,eAAe,GAAG;IAC5B,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,OAAO,EAAE,cAAc,EAAE,CAAC;IACnC,oFAAoF;IACpF,QAAQ,CAAC,SAAS,EAAE,SAAS,MAAM,EAAE,CAAC;CACvC,CAAC;AAEF;;;;GAIG;AACH,wBAAgB,gBAAgB,CAC9B,MAAM,EAAE,SAAS,aAAa,EAAE,GAC/B,aAAa,EAAE,EAAE,CA2BnB;AAED,wBAAsB,YAAY,CAChC,MAAM,EAAE,SAAS,aAAa,EAAE,EAChC,IAAI,EAAE,eAAe,GACpB,OAAO,CAAC,eAAe,CAAC,CAiE1B"}
@@ -1,71 +1,74 @@
1
1
  import type { GraphState, NodeStatus, RunStatus } from "../graph/types";
2
2
  /**
3
- * Políticas puras de cancelación, timeout y compleción tardía (GE-034).
3
+ * Pure policies for cancellation, timeout, and late completion (GE-034).
4
4
  *
5
- * Deciden, sin I/O ni reloj, qué hacer ante tres situaciones del runtime de
6
- * Graph. El runtime les inyecta la evidencia ya observada (estado del nodo, si
7
- * ya se pidió el abort, si expiró la ventana de gracia) y aplica el resultado:
5
+ * They decide, without I/O or a clock, what to do in three Graph runtime
6
+ * situations. The runtime injects the already observed evidence (node state,
7
+ * whether the abort was already requested, whether the grace window expired)
8
+ * and applies the result:
8
9
  *
9
- * - `timeoutAction`: en un timeout se pide **primero** el abort y solo se
10
- * reconcilia tras agotar una ventana de gracia acotada; un nodo no `running`
11
- * no tiene nada que expirar.
12
- * - `planCancellation`: cancelar un run en curso cancela sus nodos `pending` y
13
- * `running` (así los `pending` no llegan a despacharse) y pide abort de los
14
- * `running`; cancelar un run ya terminal es un no-op idempotente.
15
- * - `classifyLateCompletion`: un resultado que llega tarde se **audita** pero no
16
- * puede revivir un intento cancelado, superado (otro `attemptID`/`operationID`)
17
- * ni de un run ya terminal.
10
+ * - `timeoutAction`: on a timeout, request abort **first** and only reconcile
11
+ * after exhausting a bounded grace window; a non-`running` node has nothing to
12
+ * expire.
13
+ * - `planCancellation`: cancelling an in-progress run cancels its `pending` and
14
+ * `running` nodes (so `pending` ones are never dispatched) and requests abort
15
+ * for the `running` ones; cancelling an already terminal run is an idempotent
16
+ * no-op.
17
+ * - `classifyLateCompletion`: a result that arrives late is **audited** but
18
+ * cannot revive an attempt that was cancelled, superseded (another
19
+ * `attemptID`/`operationID`), or belongs to an already terminal run.
18
20
  *
19
- * Todo es determinista: la misma evidencia produce la misma decisión, de modo
20
- * que se reproduce igual tras un reinicio.
21
+ * Everything is deterministic: the same evidence produces the same decision, so
22
+ * it is reproduced the same way after a restart.
21
23
  */
22
- /** Acción de timeout sobre el nodo en vuelo. */
24
+ /** Timeout action for the in-flight node. */
23
25
  export type TimeoutAction = "noop" | "request-abort" | "awaiting-grace" | "reconcile";
24
- /** Evidencia inyectada para decidir el timeout de un nodo. */
26
+ /** Injected evidence for deciding a node timeout. */
25
27
  export type TimeoutInput = {
26
28
  readonly nodeStatus: NodeStatus;
27
- /** `true` si el runtime ya solicitó el abort de este intento. */
29
+ /** `true` if the runtime has already requested the abort for this attempt. */
28
30
  readonly abortRequested: boolean;
29
- /** `true` si la ventana de gracia acotada ya expiró. */
31
+ /** `true` if the bounded grace window has already expired. */
30
32
  readonly graceExceeded: boolean;
31
33
  };
32
34
  /**
33
- * Decide la acción de timeout. Solo un nodo `running` puede expirar: si aún no
34
- * se pidió el abort, se pide; si ya se pidió, se espera hasta agotar la gracia y
35
- * entonces se reconcilia. Un nodo no `running` es un no-op.
35
+ * Decides the timeout action. Only a `running` node can expire: if abort has not
36
+ * been requested yet, request it; if it has already been requested, wait until
37
+ * grace is exhausted and then reconcile. A non-`running` node is a no-op.
36
38
  */
37
39
  export declare function timeoutAction(input: TimeoutInput): TimeoutAction;
38
- /** Plan determinista de cancelación de un run. */
40
+ /** Deterministic plan for cancelling a run. */
39
41
  export type CancellationPlan = {
40
- /** `true` si el run sigue en curso y debe marcarse `cancelled`. */
42
+ /** `true` if the run is still in progress and should be marked `cancelled`. */
41
43
  readonly cancelRun: boolean;
42
- /** Nodos a marcar `cancelled` (los `pending` y `running`), en orden estable. */
44
+ /** Nodes to mark `cancelled` (the `pending` and `running` ones), in stable order. */
43
45
  readonly cancelNodeIDs: readonly string[];
44
- /** Nodos `running` cuyo efecto debe abortarse, en orden estable. */
46
+ /** `running` nodes whose effect should be aborted, in stable order. */
45
47
  readonly abortNodeIDs: readonly string[];
46
48
  };
47
49
  /**
48
- * Planifica la cancelación del run. Cancela los nodos `pending` (para que no
49
- * lleguen a despacharse) y `running`, y pide abort de los `running`. Un run ya
50
- * terminal no vuelve a cancelarse y no deja nodos por cancelar (idempotente).
50
+ * Plans cancellation of the run. Cancels `pending` nodes (so they never get
51
+ * dispatched) and `running` nodes, and requests abort for the `running` ones. An
52
+ * already terminal run is not cancelled again and leaves no nodes to cancel
53
+ * (idempotent).
51
54
  */
52
55
  export declare function planCancellation(state: GraphState): CancellationPlan;
53
- /** Motivo por el que una compleción tardía se descarta. */
56
+ /** Reason why a late completion is discarded. */
54
57
  export type LateCompletionReason = "run-terminal" | "unknown-node" | "not-running" | "superseded";
55
- /** Veredicto sobre un recibo que llega tarde. */
58
+ /** Verdict for a receipt that arrives late. */
56
59
  export type LateCompletionVerdict = {
57
60
  readonly kind: "apply";
58
61
  } | {
59
62
  readonly kind: "stale";
60
63
  readonly reason: LateCompletionReason;
61
64
  };
62
- /** Estado mínimo del nodo destino del recibo tardío. */
65
+ /** Minimum state of the target node for the late receipt. */
63
66
  export type LateCompletionNode = {
64
67
  readonly status: NodeStatus;
65
68
  readonly operationID?: string;
66
69
  readonly attemptID?: string;
67
70
  };
68
- /** Entrada para clasificar una compleción tardía. */
71
+ /** Input for classifying a late completion. */
69
72
  export type LateCompletionInput = {
70
73
  readonly runStatus: RunStatus;
71
74
  readonly node: LateCompletionNode | undefined;
@@ -75,10 +78,10 @@ export type LateCompletionInput = {
75
78
  };
76
79
  };
77
80
  /**
78
- * Clasifica un recibo tardío. Solo se aplica al intento `running` vigente con
79
- * `operationID`/`attemptID` coincidentes; en cualquier otro caso (run terminal,
80
- * nodo desconocido, nodo no `running`, intento superado) se marca `stale` para
81
- * auditarlo sin mutar el estado.
81
+ * Classifies a late receipt. It applies only to the current `running` attempt
82
+ * with matching `operationID`/`attemptID`; in any other case (terminal run,
83
+ * unknown node, non-`running` node, superseded attempt) it is marked `stale` so
84
+ * it can be audited without mutating state.
82
85
  */
83
86
  export declare function classifyLateCompletion(input: LateCompletionInput): LateCompletionVerdict;
84
87
  //# sourceMappingURL=graphCancellation.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"graphCancellation.d.ts","sourceRoot":"","sources":["../../src/orchestrator/graphCancellation.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAExE;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,gDAAgD;AAChD,MAAM,MAAM,aAAa,GACrB,MAAM,GACN,eAAe,GACf,gBAAgB,GAChB,WAAW,CAAC;AAEhB,8DAA8D;AAC9D,MAAM,MAAM,YAAY,GAAG;IACzB,QAAQ,CAAC,UAAU,EAAE,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AAa,GACb,YAAY,CAAC;AAEjB,+CAA+C;AAC/C,MAAM,MAAM,qBAAqB,GAC7B;IAAE,QAAQ,CAAC,IAAI,EAAE,OAAO,CAAA;CAAE,GAC1B;IAAE,QAAQ,CAAC,IAAI,EAAE,OAAO,CAAC;IAAC,QAAQ,CAAC,MAAM,EAAE,oBAAoB,CAAA;CAAE,CAAC;AAEtE,6DAA6D;AAC7D,MAAM,MAAM,kBAAkB,GAAG;IAC/B,QAAQ,CAAC,MAAM,EAAE,UAAU,CAAC;IAC5B,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAAC;IAC9B,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;CAC7B,CAAC;AAEF,+CAA+C;AAC/C,MAAM,MAAM,mBAAmB,GAAG;IAChC,QAAQ,CAAC,SAAS,EAAE,SAAS,CAAC;IAC9B,QAAQ,CAAC,IAAI,EAAE,kBAAkB,GAAG,SAAS,CAAC;IAC9C,QAAQ,CAAC,OAAO,EAAE;QAChB,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;QAC7B,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;KAC5B,CAAC;CACH,CAAC;AAEF;;;;;GAKG;AACH,wBAAgB,sBAAsB,CACpC,KAAK,EAAE,mBAAmB,GACzB,qBAAqB,CAkBvB"}
@@ -2,24 +2,25 @@ import type { ContextRef, PrivacyClass } from "../context/schema";
2
2
  import { type PrivacyMode, type RouteKind } from "../graph/privacyPolicy";
3
3
  import type { ErrorClass, GraphNode } from "../graph/schema";
4
4
  /**
5
- * `GraphEffectExecutor` — puerto del único efecto que el runtime de Graph
6
- * (GE-031) ejecuta por nodo. El runtime commitea la intención (`node.dispatched`)
7
- * en el journal **antes** de invocar `execute`, y el recibo (`node.succeeded` o
8
- * `node.failed`) **después**; el executor solo produce el resultado del efecto.
5
+ * `GraphEffectExecutor` — port for the only effect that the Graph runtime
6
+ * (GE-031) executes per node. The runtime commits the intention
7
+ * (`node.dispatched`) to the journal **before** invoking `execute`, and the
8
+ * receipt (`node.succeeded` or `node.failed`) **after**; the executor only
9
+ * produces the effect result.
9
10
  *
10
- * Este módulo es solo tipos: sin I/O, SDK, storage ni estado global. El runtime
11
- * recibe un executor inyectado; en producción lo implementará el adaptador de
12
- * sesión de opencode (GE-030), y en tests un doble determinista. Mantener el
13
- * seam como puerto permite probar el runtime sin red ni SDK reales.
11
+ * This module is types only: no I/O, SDK, storage, or global state. The runtime
12
+ * receives an injected executor; in production the opencode session adapter
13
+ * (GE-030) will implement it, and in tests a deterministic double. Keeping the
14
+ * seam as a port allows testing the runtime without real network or SDK.
14
15
  */
15
- /** Solicitud de ejecución de un efecto para un nodo e intento concretos. */
16
+ /** Request to execute an effect for a specific node and attempt. */
16
17
  export type EffectRequest = {
17
18
  readonly runID: string;
18
19
  readonly node: GraphNode;
19
20
  readonly operationID: string;
20
21
  readonly attemptID: string;
21
22
  };
22
- /** Recibo de un efecto: éxito con artefacto referenciado, o fallo clasificado. */
23
+ /** Effect receipt: success with a referenced artifact, or classified failure. */
23
24
  export type EffectReceipt = {
24
25
  readonly outcome: "succeeded";
25
26
  readonly artifact: ContextRef;
@@ -27,14 +28,14 @@ export type EffectReceipt = {
27
28
  readonly outcome: "failed";
28
29
  readonly errorClass: ErrorClass;
29
30
  };
30
- /** Ejecutor inyectable del efecto de un nodo. Determinista dado el request. */
31
+ /** Injectable executor for a node effect. Deterministic for a given request. */
31
32
  export interface GraphEffectExecutor {
32
33
  execute(request: EffectRequest): Promise<EffectReceipt>;
33
34
  }
34
35
  /**
35
- * Contexto de privacidad de un despacho: clase de privacidad del nodo, modo
36
- * efectivo de la config y ruta preferida por el router. Deja al seam de efectos
37
- * la decisión reference-only/frontier antes y después de invocar al executor.
36
+ * Privacy context for a dispatch: node privacy class, effective config mode,
37
+ * and the route preferred by the router. Leaves the reference-only/frontier
38
+ * decision to the effects seam before and after invoking the executor.
38
39
  */
39
40
  export type EffectDispatchContext = {
40
41
  readonly privacyClass: PrivacyClass;
@@ -42,22 +43,21 @@ export type EffectDispatchContext = {
42
43
  readonly routeKind: RouteKind;
43
44
  };
44
45
  /**
45
- * Resuelve la ruta **efectiva** de un despacho (GE-037). Si la política prohíbe
46
- * frontier para la clase de privacidad bajo el modo activo, degrada a `local`
47
- * en vez de lanzar: un nodo `sensitive` con `forceLocalOnSensitive` produce
48
- * **cero** despachos a frontier. Puro y determinista.
46
+ * Resolves the **effective** route for a dispatch (GE-037). If policy forbids
47
+ * frontier for the privacy class under the active mode, degrades to `local`
48
+ * instead of throwing: a `sensitive` node with `forceLocalOnSensitive` produces
49
+ * **zero** frontier dispatches. Pure and deterministic.
49
50
  */
50
51
  export declare function resolveDispatchRoute(privacyClass: PrivacyClass, mode: PrivacyMode, preferred: RouteKind): RouteKind;
51
52
  /**
52
- * Gate de privacidad **antes** de invocar al executor: lanza
53
- * `PrivacyPolicyError` si un nodo `sensitive` bajo `forceLocalOnSensitive`
54
- * intenta una ruta frontier.
53
+ * Privacy gate **before** invoking the executor: throws `PrivacyPolicyError` if
54
+ * a `sensitive` node under `forceLocalOnSensitive` attempts a frontier route.
55
55
  */
56
56
  export declare function assertDispatchAllowed(ctx: EffectDispatchContext): void;
57
57
  /**
58
- * Gate reference-only **después** del executor: el recibo solo puede llevar una
59
- * `ContextRef` (éxito) o una clase de error (fallo); lanza `RedactionError` si
60
- * alguna estructura transporta un campo de contenido crudo.
58
+ * Reference-only gate **after** the executor: the receipt may only carry a
59
+ * `ContextRef` (success) or an error class (failure); throws `RedactionError` if
60
+ * any structure carries a raw content field.
61
61
  */
62
62
  export declare function assertReceiptReferenceOnly(receipt: EffectReceipt): void;
63
63
  //# sourceMappingURL=graphEffects.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"graphEffects.d.ts","sourceRoot":"","sources":["../../src/orchestrator/graphEffects.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAClE,OAAO,EAGL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AIX;AAED;;;GAGG;AACH,wBAAgB,qBAAqB,CAAC,GAAG,EAAE,qBAAqB,GAAG,IAAI,CAEtE;AAED;;;;GAIG;AACH,wBAAgB,0BAA0B,CAAC,OAAO,EAAE,aAAa,GAAG,IAAI,CAEvE"}
@@ -1,16 +1,16 @@
1
1
  import { type ShadowMirror, type ShadowMirrorErrorCode } from "./graphShadow";
2
2
  /**
3
- * **Fachada de contención del espejo shadow** (GE-043).
3
+ * **Shadow mirror containment facade** (GE-043).
4
4
  *
5
- * El espejo observa al camino legacy; nunca lo gobierna. Esta frontera hace esa
6
- * garantía estructural en vez de disciplinaria: `mirrorLegacyTrace` es
7
- * **total** —no lanza para ningún valor de entrada, ni siquiera para objetos
8
- * hostiles cuyos accesores exploteny `mirrorAlongsideLegacy` devuelve el
9
- * resultado legacy **por identidad**, sin copiarlo ni inspeccionarlo. Un fallo
10
- * del espejo degrada a un resultado tipado que el llamante puede ignorar; no
11
- * hay camino por el que altere el desenlace productivo.
5
+ * The mirror observes the legacy path; it never governs it. This boundary makes
6
+ * that guarantee structural rather than disciplinary: `mirrorLegacyTrace` is
7
+ * **total** —it does not throw for any input value, not even hostile objects
8
+ * whose accessors explodeand `mirrorAlongsideLegacy` returns the legacy result
9
+ * **by identity**, without copying or inspecting it. A mirror failure degrades
10
+ * to a typed result that the caller can ignore; there is no path by which it
11
+ * alters the production outcome.
12
12
  */
13
- /** Resultado contenido del espejo: éxito con evidencia, o fallo tipado. */
13
+ /** Contained mirror result: success with evidence, or typed failure. */
14
14
  export type ShadowMirrorResult = {
15
15
  readonly ok: true;
16
16
  readonly mirror: ShadowMirror;
@@ -19,21 +19,21 @@ export type ShadowMirrorResult = {
19
19
  readonly code: ShadowMirrorErrorCode;
20
20
  readonly detail: string;
21
21
  };
22
- /** Resultado productivo con su espejo adjunto, nunca fusionados. */
22
+ /** Production result with its mirror attached, never merged. */
23
23
  export type LegacyWithShadow<T> = {
24
24
  readonly legacy: T;
25
25
  readonly shadow: ShadowMirrorResult;
26
26
  };
27
27
  /**
28
- * Construye el espejo de un trace de procedencia no confiable. Cualquier fallo
29
- * —trace inválido, grafo irrepresentable, secuencia ilegal o error inesperado
30
- * se devuelve como valor.
28
+ * Builds the mirror from an untrusted trace. Any failure invalid trace,
29
+ * unrepresentable graph, illegal sequence, or unexpected error — is returned as
30
+ * a value.
31
31
  */
32
32
  export declare function mirrorLegacyTrace(trace: unknown): ShadowMirrorResult;
33
33
  /**
34
- * Adjunta el espejo a un desenlace legacy ya calculado. El valor legacy se
35
- * devuelve tal cual llegó: la identidad referencial es la prueba de que el
36
- * espejo no lo pudo tocar.
34
+ * Attaches the mirror to an already computed legacy outcome. The legacy value is
35
+ * returned exactly as it arrived: referential identity is the proof that the
36
+ * mirror could not touch it.
37
37
  */
38
38
  export declare function mirrorAlongsideLegacy<T>(legacy: T, trace: unknown): LegacyWithShadow<T>;
39
39
  //# sourceMappingURL=graphFacade.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"graphFacade.d.ts","sourceRoot":"","sources":["../../src/orchestrator/graphFacade.ts"],"names":[],"mappings":"AAIA,OAAO,EAEL,KAAK,YAAY,EAEjB,KAAK,qBAAqB,EAC3B,MAAM,eAAe,CAAC;AAEvB;;;;;;;;;;GAUG;AAEH,2EAA2E;AAC3E,MAAM,MAAM,kBAAkB,GAC1B;IAAE,QAAQ,CAAC,EAAE,EAAE,IAAI,CAAC;IAAC,QAAQ,CAAC,MAAM,EAAE,YAAY,CAAA;CAAE,GACpD;IACE,QAAQ,CAAC,EAAE,EAAE,KAAK,CAAC;IACnB,QAAQ,CAAC,IAAI,EAAE,qBAAqB,CAAC;IACrC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;CACzB,CAAC;AAEN,oEAAoE;AACpE,MAAM,MAAM,gBAAgB,CAAC,CAAC,IAAI;IAChC,QAAQ,CAAC,MAAM,EAAE,CAAC,CAAC;IACnB,QAAQ,CAAC,MAAM,EAAE,kBAAkB,CAAC;CACrC,CAAC;AAE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