agentic-orchestrator 0.1.6 → 0.1.8

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 (438) hide show
  1. package/.prettierignore +10 -0
  2. package/.prettierrc.json +24 -0
  3. package/CLAUDE.md +3 -2
  4. package/README.md +71 -48
  5. package/agentic/orchestrator/defaults/policy.defaults.yaml +1 -1
  6. package/agentic/orchestrator/prompts/planner.system.md +1 -0
  7. package/agentic/orchestrator/schemas/agents.schema.json +5 -22
  8. package/agentic/orchestrator/schemas/gates.schema.json +4 -19
  9. package/agentic/orchestrator/schemas/index.schema.json +3 -14
  10. package/agentic/orchestrator/schemas/multi-project.schema.json +2 -8
  11. package/agentic/orchestrator/schemas/plan.schema.json +6 -26
  12. package/agentic/orchestrator/schemas/policy.schema.json +19 -81
  13. package/agentic/orchestrator/schemas/policy.user.schema.json +1 -5
  14. package/agentic/orchestrator/schemas/qa_test_index.schema.json +5 -29
  15. package/agentic/orchestrator/schemas/state.schema.json +11 -61
  16. package/agentic/orchestrator/tools/catalog.json +33 -164
  17. package/agentic/orchestrator/tools/schemas/input/evidence.latest.input.schema.json +1 -3
  18. package/agentic/orchestrator/tools/schemas/input/feature.delete.input.schema.json +1 -5
  19. package/agentic/orchestrator/tools/schemas/input/feature.get_context.input.schema.json +1 -3
  20. package/agentic/orchestrator/tools/schemas/input/feature.init.input.schema.json +1 -4
  21. package/agentic/orchestrator/tools/schemas/input/feature.log_append.input.schema.json +1 -5
  22. package/agentic/orchestrator/tools/schemas/input/feature.ready_to_merge.input.schema.json +1 -6
  23. package/agentic/orchestrator/tools/schemas/input/feature.state_get.input.schema.json +1 -3
  24. package/agentic/orchestrator/tools/schemas/input/feature.state_patch.input.schema.json +1 -5
  25. package/agentic/orchestrator/tools/schemas/input/gates.run.input.schema.json +1 -5
  26. package/agentic/orchestrator/tools/schemas/input/locks.acquire.input.schema.json +1 -5
  27. package/agentic/orchestrator/tools/schemas/input/locks.release.input.schema.json +1 -5
  28. package/agentic/orchestrator/tools/schemas/input/performance.record_outcome.input.schema.json +10 -1
  29. package/agentic/orchestrator/tools/schemas/input/plan.get.input.schema.json +1 -3
  30. package/agentic/orchestrator/tools/schemas/input/plan.submit.input.schema.json +1 -5
  31. package/agentic/orchestrator/tools/schemas/input/plan.update.input.schema.json +1 -6
  32. package/agentic/orchestrator/tools/schemas/input/qa.test_index_get.input.schema.json +1 -3
  33. package/agentic/orchestrator/tools/schemas/input/qa.test_index_update.input.schema.json +1 -6
  34. package/agentic/orchestrator/tools/schemas/input/repo.apply_patch.input.schema.json +1 -5
  35. package/agentic/orchestrator/tools/schemas/input/repo.diff.input.schema.json +1 -3
  36. package/agentic/orchestrator/tools/schemas/input/repo.diff_bundle.input.schema.json +1 -3
  37. package/agentic/orchestrator/tools/schemas/input/repo.ensure_worktree.input.schema.json +1 -4
  38. package/agentic/orchestrator/tools/schemas/input/repo.read_file.input.schema.json +1 -4
  39. package/agentic/orchestrator/tools/schemas/input/repo.search.input.schema.json +1 -4
  40. package/agentic/orchestrator/tools/schemas/input/repo.status.input.schema.json +1 -3
  41. package/agentic/orchestrator/tools/schemas/input/report.feature_summary.input.schema.json +1 -3
  42. package/agentic/orchestrator/tools/schemas/output/collisions.scan.output.schema.json +1 -3
  43. package/agentic/orchestrator/tools/schemas/output/evidence.latest.output.schema.json +1 -4
  44. package/agentic/orchestrator/tools/schemas/output/feature.delete.output.schema.json +4 -20
  45. package/agentic/orchestrator/tools/schemas/output/feature.discover_specs.output.schema.json +2 -7
  46. package/agentic/orchestrator/tools/schemas/output/feature.get_context.output.schema.json +1 -8
  47. package/agentic/orchestrator/tools/schemas/output/feature.init.output.schema.json +1 -5
  48. package/agentic/orchestrator/tools/schemas/output/feature.log_append.output.schema.json +1 -5
  49. package/agentic/orchestrator/tools/schemas/output/feature.ready_to_merge.output.schema.json +1 -6
  50. package/agentic/orchestrator/tools/schemas/output/feature.state_get.output.schema.json +1 -4
  51. package/agentic/orchestrator/tools/schemas/output/feature.state_patch.output.schema.json +1 -5
  52. package/agentic/orchestrator/tools/schemas/output/gates.list.output.schema.json +2 -7
  53. package/agentic/orchestrator/tools/schemas/output/gates.run.output.schema.json +1 -8
  54. package/agentic/orchestrator/tools/schemas/output/locks.acquire.output.schema.json +1 -7
  55. package/agentic/orchestrator/tools/schemas/output/locks.release.output.schema.json +1 -5
  56. package/agentic/orchestrator/tools/schemas/output/performance.get_analytics.output.schema.json +22 -2
  57. package/agentic/orchestrator/tools/schemas/output/plan.get.output.schema.json +1 -4
  58. package/agentic/orchestrator/tools/schemas/output/plan.submit.output.schema.json +1 -5
  59. package/agentic/orchestrator/tools/schemas/output/plan.update.output.schema.json +1 -5
  60. package/agentic/orchestrator/tools/schemas/output/qa.test_index_get.output.schema.json +1 -5
  61. package/agentic/orchestrator/tools/schemas/output/qa.test_index_update.output.schema.json +1 -4
  62. package/agentic/orchestrator/tools/schemas/output/repo.apply_patch.output.schema.json +1 -6
  63. package/agentic/orchestrator/tools/schemas/output/repo.diff.output.schema.json +1 -4
  64. package/agentic/orchestrator/tools/schemas/output/repo.diff_bundle.output.schema.json +1 -7
  65. package/agentic/orchestrator/tools/schemas/output/repo.ensure_worktree.output.schema.json +1 -6
  66. package/agentic/orchestrator/tools/schemas/output/repo.read_file.output.schema.json +1 -5
  67. package/agentic/orchestrator/tools/schemas/output/repo.search.output.schema.json +1 -5
  68. package/agentic/orchestrator/tools/schemas/output/repo.status.output.schema.json +1 -5
  69. package/agentic/orchestrator/tools/schemas/output/report.dashboard.output.schema.json +1 -4
  70. package/apps/control-plane/scripts/validate-architecture-rules.mjs +16 -5
  71. package/apps/control-plane/scripts/validate-docker-mcp-contract.mjs +30 -8
  72. package/apps/control-plane/scripts/validate-mcp-contracts.ts +13 -7
  73. package/apps/control-plane/src/application/adapters/adapter-registry.ts +35 -15
  74. package/apps/control-plane/src/application/multi-project-loader.ts +27 -10
  75. package/apps/control-plane/src/application/services/activity-monitor-service.ts +26 -14
  76. package/apps/control-plane/src/application/services/collision-queue-service.ts +31 -17
  77. package/apps/control-plane/src/application/services/cost-tracking-service.ts +23 -16
  78. package/apps/control-plane/src/application/services/dependency-scheduler-service.ts +12 -4
  79. package/apps/control-plane/src/application/services/feature-deletion-service.ts +94 -58
  80. package/apps/control-plane/src/application/services/feature-lifecycle-service.ts +19 -13
  81. package/apps/control-plane/src/application/services/feature-state-service.ts +29 -19
  82. package/apps/control-plane/src/application/services/gate-interpolation-service.ts +7 -2
  83. package/apps/control-plane/src/application/services/gate-service.ts +64 -41
  84. package/apps/control-plane/src/application/services/instance-isolation-service.ts +1 -1
  85. package/apps/control-plane/src/application/services/issue-tracker-service.ts +49 -38
  86. package/apps/control-plane/src/application/services/lock-service.ts +75 -49
  87. package/apps/control-plane/src/application/services/merge-service.ts +91 -50
  88. package/apps/control-plane/src/application/services/notifier-service.ts +42 -20
  89. package/apps/control-plane/src/application/services/patch-service.ts +73 -44
  90. package/apps/control-plane/src/application/services/performance-analytics-service.ts +8 -6
  91. package/apps/control-plane/src/application/services/plan-service.ts +148 -89
  92. package/apps/control-plane/src/application/services/policy-loader-service.ts +10 -4
  93. package/apps/control-plane/src/application/services/pr-monitor-service.ts +33 -14
  94. package/apps/control-plane/src/application/services/qa-index-service.ts +20 -16
  95. package/apps/control-plane/src/application/services/reactions-service.ts +30 -15
  96. package/apps/control-plane/src/application/services/reporting-service.ts +16 -12
  97. package/apps/control-plane/src/application/services/run-lease-service.ts +138 -81
  98. package/apps/control-plane/src/application/tools/tool-metadata.ts +5 -5
  99. package/apps/control-plane/src/application/tools/tool-router.ts +6 -3
  100. package/apps/control-plane/src/cli/aop.ts +2 -2
  101. package/apps/control-plane/src/cli/attach-command-handler.ts +9 -9
  102. package/apps/control-plane/src/cli/cleanup-command-handler.ts +16 -11
  103. package/apps/control-plane/src/cli/cli-argument-parser.ts +6 -3
  104. package/apps/control-plane/src/cli/dashboard-command-handler.ts +28 -8
  105. package/apps/control-plane/src/cli/delete-command-handler.ts +7 -7
  106. package/apps/control-plane/src/cli/env-file.ts +115 -0
  107. package/apps/control-plane/src/cli/help-command-handler.ts +61 -32
  108. package/apps/control-plane/src/cli/init-command-handler.ts +182 -56
  109. package/apps/control-plane/src/cli/io.ts +7 -3
  110. package/apps/control-plane/src/cli/resume-command-handler.ts +21 -13
  111. package/apps/control-plane/src/cli/retry-command-handler.ts +12 -11
  112. package/apps/control-plane/src/cli/run-command-handler.ts +12 -8
  113. package/apps/control-plane/src/cli/send-command-handler.ts +6 -6
  114. package/apps/control-plane/src/cli/spec-ingestion-service.ts +14 -8
  115. package/apps/control-plane/src/cli/spec-input-resolver.ts +6 -1
  116. package/apps/control-plane/src/cli/spec-utils.ts +2 -2
  117. package/apps/control-plane/src/cli/status-command-handler.ts +13 -12
  118. package/apps/control-plane/src/cli/tooling.ts +3 -3
  119. package/apps/control-plane/src/cli/types.ts +1 -1
  120. package/apps/control-plane/src/core/collisions.ts +27 -10
  121. package/apps/control-plane/src/core/constants.ts +13 -7
  122. package/apps/control-plane/src/core/error-codes.ts +1 -1
  123. package/apps/control-plane/src/core/fs.ts +11 -5
  124. package/apps/control-plane/src/core/gates.ts +53 -27
  125. package/apps/control-plane/src/core/git.ts +18 -6
  126. package/apps/control-plane/src/core/kernel.ts +513 -227
  127. package/apps/control-plane/src/core/patch.ts +7 -3
  128. package/apps/control-plane/src/core/path-layout.ts +5 -1
  129. package/apps/control-plane/src/core/path-rules.ts +19 -5
  130. package/apps/control-plane/src/core/qa-index.ts +26 -12
  131. package/apps/control-plane/src/core/response.ts +9 -6
  132. package/apps/control-plane/src/core/schemas.ts +29 -10
  133. package/apps/control-plane/src/core/tool-caller.ts +1 -1
  134. package/apps/control-plane/src/core/workspace-hooks.ts +5 -5
  135. package/apps/control-plane/src/index.ts +3 -9
  136. package/apps/control-plane/src/interfaces/cli/bootstrap.ts +79 -35
  137. package/apps/control-plane/src/mcp/kernel-tool-executor.ts +7 -3
  138. package/apps/control-plane/src/mcp/mcp-server-adapter.ts +12 -10
  139. package/apps/control-plane/src/mcp/operation-ledger.ts +18 -8
  140. package/apps/control-plane/src/mcp/protocol-contract.ts +2 -2
  141. package/apps/control-plane/src/mcp/runtime-factory.ts +15 -6
  142. package/apps/control-plane/src/mcp/token-auth-verifier.ts +3 -2
  143. package/apps/control-plane/src/mcp/token-claims-validator.ts +11 -7
  144. package/apps/control-plane/src/mcp/tool-authorizer.ts +1 -3
  145. package/apps/control-plane/src/mcp/tool-client.ts +17 -5
  146. package/apps/control-plane/src/mcp/tool-contract-validator.ts +17 -8
  147. package/apps/control-plane/src/mcp/tool-registry-loader.ts +7 -3
  148. package/apps/control-plane/src/mcp/tool-runtime.ts +66 -39
  149. package/apps/control-plane/src/mcp/tools-markdown-generator.ts +6 -1
  150. package/apps/control-plane/src/providers/providers.ts +137 -54
  151. package/apps/control-plane/src/supervisor/build-wave-executor.ts +44 -25
  152. package/apps/control-plane/src/supervisor/planning-wave-executor.ts +46 -33
  153. package/apps/control-plane/src/supervisor/prompt-bundle-loader.ts +1 -1
  154. package/apps/control-plane/src/supervisor/qa-wave-executor.ts +38 -23
  155. package/apps/control-plane/src/supervisor/run-coordinator.ts +71 -36
  156. package/apps/control-plane/src/supervisor/runtime.ts +59 -35
  157. package/apps/control-plane/src/supervisor/session-orchestrator.ts +48 -31
  158. package/apps/control-plane/src/supervisor/types.ts +22 -7
  159. package/apps/control-plane/src/supervisor/worker-decision-loop.ts +30 -20
  160. package/apps/control-plane/test/activity-monitor.spec.ts +54 -30
  161. package/apps/control-plane/test/adapter-registry.spec.ts +5 -5
  162. package/apps/control-plane/test/aop.spec.ts +4 -4
  163. package/apps/control-plane/test/batch-operations.spec.ts +20 -18
  164. package/apps/control-plane/test/bootstrap-attach.spec.ts +52 -19
  165. package/apps/control-plane/test/bootstrap-edge-cases.spec.ts +58 -27
  166. package/apps/control-plane/test/bootstrap.spec.ts +72 -40
  167. package/apps/control-plane/test/cleanup-command.spec.ts +86 -32
  168. package/apps/control-plane/test/cli-helpers.spec.ts +119 -66
  169. package/apps/control-plane/test/cli.spec.ts +1 -1
  170. package/apps/control-plane/test/cli.unit.spec.ts +226 -167
  171. package/apps/control-plane/test/collision-queue.spec.ts +49 -40
  172. package/apps/control-plane/test/collisions.spec.ts +30 -30
  173. package/apps/control-plane/test/core-utils.spec.ts +29 -15
  174. package/apps/control-plane/test/cost-tracking.spec.ts +38 -22
  175. package/apps/control-plane/test/dashboard-api.integration.spec.ts +68 -36
  176. package/apps/control-plane/test/dashboard-client.spec.ts +18 -12
  177. package/apps/control-plane/test/dashboard-command.spec.ts +11 -7
  178. package/apps/control-plane/test/delete-command-handler.spec.ts +49 -41
  179. package/apps/control-plane/test/dependency-scheduler.spec.ts +47 -20
  180. package/apps/control-plane/test/epoch-tracking.spec.ts +9 -9
  181. package/apps/control-plane/test/feature-deletion-service.spec.ts +60 -52
  182. package/apps/control-plane/test/feature-lifecycle.spec.ts +36 -17
  183. package/apps/control-plane/test/gates.spec.ts +101 -81
  184. package/apps/control-plane/test/git-spawn-error.spec.ts +1 -1
  185. package/apps/control-plane/test/helpers.ts +10 -6
  186. package/apps/control-plane/test/incremental-gates.spec.ts +59 -20
  187. package/apps/control-plane/test/init-wizard.spec.ts +328 -68
  188. package/apps/control-plane/test/instance-isolation.spec.ts +43 -10
  189. package/apps/control-plane/test/issue-tracker.spec.ts +368 -128
  190. package/apps/control-plane/test/kernel-collision-replay.spec.ts +50 -29
  191. package/apps/control-plane/test/kernel.branches.spec.ts +64 -40
  192. package/apps/control-plane/test/kernel.coverage.spec.ts +85 -49
  193. package/apps/control-plane/test/kernel.coverage2.spec.ts +109 -65
  194. package/apps/control-plane/test/kernel.spec.ts +134 -51
  195. package/apps/control-plane/test/lock-service.spec.ts +92 -68
  196. package/apps/control-plane/test/mcp-helpers.spec.ts +53 -39
  197. package/apps/control-plane/test/mcp.spec.ts +231 -115
  198. package/apps/control-plane/test/merge-service.spec.ts +142 -94
  199. package/apps/control-plane/test/multi-project.spec.ts +28 -22
  200. package/apps/control-plane/test/notifier-service.spec.ts +136 -92
  201. package/apps/control-plane/test/parallel-gates.spec.ts +51 -35
  202. package/apps/control-plane/test/patch-service.spec.ts +128 -48
  203. package/apps/control-plane/test/performance-analytics.spec.ts +99 -63
  204. package/apps/control-plane/test/plan-service.spec.ts +50 -39
  205. package/apps/control-plane/test/planning-wave-executor.spec.ts +95 -71
  206. package/apps/control-plane/test/policy-loader-service.spec.ts +41 -19
  207. package/apps/control-plane/test/pr-monitor.spec.ts +113 -64
  208. package/apps/control-plane/test/providers.spec.ts +208 -104
  209. package/apps/control-plane/test/qa-index-service.spec.ts +31 -33
  210. package/apps/control-plane/test/qa-index.spec.ts +58 -61
  211. package/apps/control-plane/test/reactions.spec.ts +88 -45
  212. package/apps/control-plane/test/response.spec.ts +5 -5
  213. package/apps/control-plane/test/resume-command.spec.ts +121 -80
  214. package/apps/control-plane/test/run-coordinator.spec.ts +205 -136
  215. package/apps/control-plane/test/schema-date-time.spec.ts +49 -41
  216. package/apps/control-plane/test/service-retry-paths.spec.ts +77 -57
  217. package/apps/control-plane/test/services.spec.ts +147 -129
  218. package/apps/control-plane/test/session-management.spec.ts +136 -74
  219. package/apps/control-plane/test/spec-ingestion.spec.ts +23 -21
  220. package/apps/control-plane/test/spec-input-resolver.spec.ts +11 -10
  221. package/apps/control-plane/test/supervisor-collaborators.spec.ts +168 -121
  222. package/apps/control-plane/test/supervisor.calltool.spec.ts +21 -18
  223. package/apps/control-plane/test/supervisor.spec.ts +67 -43
  224. package/apps/control-plane/test/supervisor.unit.spec.ts +195 -126
  225. package/apps/control-plane/test/token-auth-verifier.spec.ts +29 -14
  226. package/apps/control-plane/test/tool-registry-loader.spec.ts +51 -27
  227. package/apps/control-plane/test/tool-runtime.spec.ts +63 -46
  228. package/apps/control-plane/test/worker-decision-loop.spec.ts +143 -122
  229. package/apps/control-plane/test/workspace-hooks.spec.ts +61 -23
  230. package/apps/control-plane/tsconfig.build.json +2 -7
  231. package/apps/control-plane/tsconfig.json +1 -5
  232. package/apps/control-plane/vitest.config.ts +7 -7
  233. package/config/agentic/orchestrator/adapters.yaml +3 -0
  234. package/config/agentic/orchestrator/agents.yaml +14 -0
  235. package/config/agentic/orchestrator/gates.yaml +28 -0
  236. package/config/agentic/orchestrator/policy.yaml +22 -0
  237. package/config/agentic/orchestrator/prompts/builder.system.md +1 -0
  238. package/config/agentic/orchestrator/prompts/planner.system.md +16 -0
  239. package/config/agentic/orchestrator/prompts/qa.system.md +1 -0
  240. package/dist/apps/control-plane/application/adapters/adapter-registry.js +12 -5
  241. package/dist/apps/control-plane/application/adapters/adapter-registry.js.map +1 -1
  242. package/dist/apps/control-plane/application/multi-project-loader.js +26 -9
  243. package/dist/apps/control-plane/application/multi-project-loader.js.map +1 -1
  244. package/dist/apps/control-plane/application/services/activity-monitor-service.js +7 -7
  245. package/dist/apps/control-plane/application/services/activity-monitor-service.js.map +1 -1
  246. package/dist/apps/control-plane/application/services/collision-queue-service.js +7 -7
  247. package/dist/apps/control-plane/application/services/collision-queue-service.js.map +1 -1
  248. package/dist/apps/control-plane/application/services/cost-tracking-service.js +6 -8
  249. package/dist/apps/control-plane/application/services/cost-tracking-service.js.map +1 -1
  250. package/dist/apps/control-plane/application/services/dependency-scheduler-service.js.map +1 -1
  251. package/dist/apps/control-plane/application/services/feature-deletion-service.js +37 -29
  252. package/dist/apps/control-plane/application/services/feature-deletion-service.js.map +1 -1
  253. package/dist/apps/control-plane/application/services/feature-lifecycle-service.js +10 -10
  254. package/dist/apps/control-plane/application/services/feature-lifecycle-service.js.map +1 -1
  255. package/dist/apps/control-plane/application/services/feature-state-service.js +11 -11
  256. package/dist/apps/control-plane/application/services/feature-state-service.js.map +1 -1
  257. package/dist/apps/control-plane/application/services/gate-interpolation-service.js +3 -1
  258. package/dist/apps/control-plane/application/services/gate-interpolation-service.js.map +1 -1
  259. package/dist/apps/control-plane/application/services/gate-service.js +26 -26
  260. package/dist/apps/control-plane/application/services/gate-service.js.map +1 -1
  261. package/dist/apps/control-plane/application/services/instance-isolation-service.js +1 -1
  262. package/dist/apps/control-plane/application/services/instance-isolation-service.js.map +1 -1
  263. package/dist/apps/control-plane/application/services/issue-tracker-service.js +25 -15
  264. package/dist/apps/control-plane/application/services/issue-tracker-service.js.map +1 -1
  265. package/dist/apps/control-plane/application/services/lock-service.js +32 -32
  266. package/dist/apps/control-plane/application/services/lock-service.js.map +1 -1
  267. package/dist/apps/control-plane/application/services/merge-service.js +41 -27
  268. package/dist/apps/control-plane/application/services/merge-service.js.map +1 -1
  269. package/dist/apps/control-plane/application/services/notifier-service.js +29 -15
  270. package/dist/apps/control-plane/application/services/notifier-service.js.map +1 -1
  271. package/dist/apps/control-plane/application/services/patch-service.js +21 -19
  272. package/dist/apps/control-plane/application/services/patch-service.js.map +1 -1
  273. package/dist/apps/control-plane/application/services/performance-analytics-service.js +4 -4
  274. package/dist/apps/control-plane/application/services/performance-analytics-service.js.map +1 -1
  275. package/dist/apps/control-plane/application/services/plan-service.js +33 -33
  276. package/dist/apps/control-plane/application/services/plan-service.js.map +1 -1
  277. package/dist/apps/control-plane/application/services/policy-loader-service.js.map +1 -1
  278. package/dist/apps/control-plane/application/services/pr-monitor-service.js +23 -11
  279. package/dist/apps/control-plane/application/services/pr-monitor-service.js.map +1 -1
  280. package/dist/apps/control-plane/application/services/qa-index-service.js +11 -11
  281. package/dist/apps/control-plane/application/services/qa-index-service.js.map +1 -1
  282. package/dist/apps/control-plane/application/services/reactions-service.js +13 -9
  283. package/dist/apps/control-plane/application/services/reactions-service.js.map +1 -1
  284. package/dist/apps/control-plane/application/services/reporting-service.js +11 -9
  285. package/dist/apps/control-plane/application/services/reporting-service.js.map +1 -1
  286. package/dist/apps/control-plane/application/services/run-lease-service.js +34 -33
  287. package/dist/apps/control-plane/application/services/run-lease-service.js.map +1 -1
  288. package/dist/apps/control-plane/application/tools/tool-metadata.js +2 -2
  289. package/dist/apps/control-plane/application/tools/tool-router.js.map +1 -1
  290. package/dist/apps/control-plane/cli/attach-command-handler.js +9 -9
  291. package/dist/apps/control-plane/cli/cleanup-command-handler.js +11 -9
  292. package/dist/apps/control-plane/cli/cleanup-command-handler.js.map +1 -1
  293. package/dist/apps/control-plane/cli/cli-argument-parser.js +4 -3
  294. package/dist/apps/control-plane/cli/cli-argument-parser.js.map +1 -1
  295. package/dist/apps/control-plane/cli/dashboard-command-handler.js +23 -7
  296. package/dist/apps/control-plane/cli/dashboard-command-handler.js.map +1 -1
  297. package/dist/apps/control-plane/cli/delete-command-handler.js +7 -7
  298. package/dist/apps/control-plane/cli/env-file.d.ts +4 -0
  299. package/dist/apps/control-plane/cli/env-file.js +89 -0
  300. package/dist/apps/control-plane/cli/env-file.js.map +1 -0
  301. package/dist/apps/control-plane/cli/help-command-handler.js +58 -30
  302. package/dist/apps/control-plane/cli/help-command-handler.js.map +1 -1
  303. package/dist/apps/control-plane/cli/init-command-handler.js +97 -37
  304. package/dist/apps/control-plane/cli/init-command-handler.js.map +1 -1
  305. package/dist/apps/control-plane/cli/io.js +2 -2
  306. package/dist/apps/control-plane/cli/io.js.map +1 -1
  307. package/dist/apps/control-plane/cli/resume-command-handler.js +9 -9
  308. package/dist/apps/control-plane/cli/resume-command-handler.js.map +1 -1
  309. package/dist/apps/control-plane/cli/retry-command-handler.js +12 -11
  310. package/dist/apps/control-plane/cli/retry-command-handler.js.map +1 -1
  311. package/dist/apps/control-plane/cli/run-command-handler.js +12 -8
  312. package/dist/apps/control-plane/cli/run-command-handler.js.map +1 -1
  313. package/dist/apps/control-plane/cli/send-command-handler.js +6 -6
  314. package/dist/apps/control-plane/cli/spec-ingestion-service.js +10 -8
  315. package/dist/apps/control-plane/cli/spec-ingestion-service.js.map +1 -1
  316. package/dist/apps/control-plane/cli/spec-input-resolver.js.map +1 -1
  317. package/dist/apps/control-plane/cli/spec-utils.js.map +1 -1
  318. package/dist/apps/control-plane/cli/status-command-handler.js +8 -8
  319. package/dist/apps/control-plane/cli/status-command-handler.js.map +1 -1
  320. package/dist/apps/control-plane/cli/tooling.js +1 -1
  321. package/dist/apps/control-plane/core/collisions.js +11 -8
  322. package/dist/apps/control-plane/core/collisions.js.map +1 -1
  323. package/dist/apps/control-plane/core/constants.js +13 -7
  324. package/dist/apps/control-plane/core/constants.js.map +1 -1
  325. package/dist/apps/control-plane/core/error-codes.js +1 -1
  326. package/dist/apps/control-plane/core/fs.js.map +1 -1
  327. package/dist/apps/control-plane/core/gates.d.ts +2 -2
  328. package/dist/apps/control-plane/core/gates.js +26 -19
  329. package/dist/apps/control-plane/core/gates.js.map +1 -1
  330. package/dist/apps/control-plane/core/git.js +3 -3
  331. package/dist/apps/control-plane/core/git.js.map +1 -1
  332. package/dist/apps/control-plane/core/kernel.d.ts +1 -0
  333. package/dist/apps/control-plane/core/kernel.js +134 -81
  334. package/dist/apps/control-plane/core/kernel.js.map +1 -1
  335. package/dist/apps/control-plane/core/patch.js +7 -3
  336. package/dist/apps/control-plane/core/patch.js.map +1 -1
  337. package/dist/apps/control-plane/core/path-layout.d.ts +1 -0
  338. package/dist/apps/control-plane/core/path-layout.js +4 -1
  339. package/dist/apps/control-plane/core/path-layout.js.map +1 -1
  340. package/dist/apps/control-plane/core/path-rules.js +3 -1
  341. package/dist/apps/control-plane/core/path-rules.js.map +1 -1
  342. package/dist/apps/control-plane/core/qa-index.js +5 -5
  343. package/dist/apps/control-plane/core/qa-index.js.map +1 -1
  344. package/dist/apps/control-plane/core/response.js +3 -3
  345. package/dist/apps/control-plane/core/response.js.map +1 -1
  346. package/dist/apps/control-plane/core/schemas.js +10 -6
  347. package/dist/apps/control-plane/core/schemas.js.map +1 -1
  348. package/dist/apps/control-plane/core/workspace-hooks.js +3 -3
  349. package/dist/apps/control-plane/index.d.ts +1 -1
  350. package/dist/apps/control-plane/index.js +1 -1
  351. package/dist/apps/control-plane/index.js.map +1 -1
  352. package/dist/apps/control-plane/interfaces/cli/bootstrap.js +40 -23
  353. package/dist/apps/control-plane/interfaces/cli/bootstrap.js.map +1 -1
  354. package/dist/apps/control-plane/mcp/kernel-tool-executor.js +1 -1
  355. package/dist/apps/control-plane/mcp/kernel-tool-executor.js.map +1 -1
  356. package/dist/apps/control-plane/mcp/mcp-server-adapter.js +6 -7
  357. package/dist/apps/control-plane/mcp/mcp-server-adapter.js.map +1 -1
  358. package/dist/apps/control-plane/mcp/operation-ledger.js +5 -5
  359. package/dist/apps/control-plane/mcp/operation-ledger.js.map +1 -1
  360. package/dist/apps/control-plane/mcp/protocol-contract.js +2 -2
  361. package/dist/apps/control-plane/mcp/runtime-factory.js +2 -2
  362. package/dist/apps/control-plane/mcp/runtime-factory.js.map +1 -1
  363. package/dist/apps/control-plane/mcp/token-auth-verifier.js +1 -1
  364. package/dist/apps/control-plane/mcp/token-auth-verifier.js.map +1 -1
  365. package/dist/apps/control-plane/mcp/token-claims-validator.js +5 -5
  366. package/dist/apps/control-plane/mcp/token-claims-validator.js.map +1 -1
  367. package/dist/apps/control-plane/mcp/tool-authorizer.js +1 -3
  368. package/dist/apps/control-plane/mcp/tool-authorizer.js.map +1 -1
  369. package/dist/apps/control-plane/mcp/tool-client.js +2 -2
  370. package/dist/apps/control-plane/mcp/tool-client.js.map +1 -1
  371. package/dist/apps/control-plane/mcp/tool-contract-validator.js +3 -3
  372. package/dist/apps/control-plane/mcp/tool-contract-validator.js.map +1 -1
  373. package/dist/apps/control-plane/mcp/tool-registry-loader.js +1 -1
  374. package/dist/apps/control-plane/mcp/tool-registry-loader.js.map +1 -1
  375. package/dist/apps/control-plane/mcp/tool-runtime.js +17 -17
  376. package/dist/apps/control-plane/mcp/tool-runtime.js.map +1 -1
  377. package/dist/apps/control-plane/mcp/tools-markdown-generator.js +6 -1
  378. package/dist/apps/control-plane/mcp/tools-markdown-generator.js.map +1 -1
  379. package/dist/apps/control-plane/providers/providers.d.ts +3 -2
  380. package/dist/apps/control-plane/providers/providers.js +81 -39
  381. package/dist/apps/control-plane/providers/providers.js.map +1 -1
  382. package/dist/apps/control-plane/supervisor/build-wave-executor.js +12 -12
  383. package/dist/apps/control-plane/supervisor/build-wave-executor.js.map +1 -1
  384. package/dist/apps/control-plane/supervisor/planning-wave-executor.js +19 -16
  385. package/dist/apps/control-plane/supervisor/planning-wave-executor.js.map +1 -1
  386. package/dist/apps/control-plane/supervisor/prompt-bundle-loader.js +1 -1
  387. package/dist/apps/control-plane/supervisor/qa-wave-executor.js +13 -13
  388. package/dist/apps/control-plane/supervisor/qa-wave-executor.js.map +1 -1
  389. package/dist/apps/control-plane/supervisor/run-coordinator.js +37 -20
  390. package/dist/apps/control-plane/supervisor/run-coordinator.js.map +1 -1
  391. package/dist/apps/control-plane/supervisor/runtime.js +25 -21
  392. package/dist/apps/control-plane/supervisor/runtime.js.map +1 -1
  393. package/dist/apps/control-plane/supervisor/session-orchestrator.js +29 -23
  394. package/dist/apps/control-plane/supervisor/session-orchestrator.js.map +1 -1
  395. package/dist/apps/control-plane/supervisor/types.d.ts +3 -3
  396. package/dist/apps/control-plane/supervisor/types.js.map +1 -1
  397. package/dist/apps/control-plane/supervisor/worker-decision-loop.js +14 -16
  398. package/dist/apps/control-plane/supervisor/worker-decision-loop.js.map +1 -1
  399. package/eslint.config.mjs +20 -20
  400. package/example-configurations/README.md +1 -1
  401. package/example-configurations/java/agents.yaml +3 -3
  402. package/example-configurations/java/policy.yaml +1 -1
  403. package/example-configurations/node/agents.yaml +3 -3
  404. package/example-configurations/node/policy.yaml +1 -1
  405. package/package.json +10 -5
  406. package/packages/web-dashboard/next.config.js +2 -2
  407. package/packages/web-dashboard/src/app/api/actions/route.ts +25 -9
  408. package/packages/web-dashboard/src/app/api/events/route.ts +20 -6
  409. package/packages/web-dashboard/src/app/api/features/[id]/checkout/route.ts +88 -37
  410. package/packages/web-dashboard/src/app/api/features/[id]/evidence/[artifact]/route.ts +8 -5
  411. package/packages/web-dashboard/src/app/api/features/[id]/review/route.ts +27 -9
  412. package/packages/web-dashboard/src/app/api/features/[id]/route.ts +5 -2
  413. package/packages/web-dashboard/src/app/api/projects/route.ts +5 -5
  414. package/packages/web-dashboard/src/app/globals.css +10 -2
  415. package/packages/web-dashboard/src/app/page.tsx +100 -37
  416. package/packages/web-dashboard/src/lib/aop-client.ts +68 -37
  417. package/packages/web-dashboard/src/lib/multi-project-config.ts +28 -7
  418. package/packages/web-dashboard/src/lib/orchestrator-tools.ts +59 -36
  419. package/packages/web-dashboard/tsconfig.json +3 -11
  420. package/scripts/nx-safe.mjs +10 -10
  421. package/spec-files/completed/agentic_orchestrator_cli_delete_command_spec.md +5 -0
  422. package/spec-files/completed/agentic_orchestrator_feature_gaps_closure_spec.md +189 -90
  423. package/spec-files/completed/agentic_orchestrator_init_policy_ux_simplification_spec.md +49 -16
  424. package/spec-files/completed/agentic_orchestrator_mcp_formalization_spec.md +24 -1
  425. package/spec-files/completed/agentic_orchestrator_single_global_orchestrator_spec.md +9 -0
  426. package/spec-files/completed/agentic_orchestrator_spec.md +171 -75
  427. package/spec-files/completed/agentic_orchestrator_validator_hardening_spec.md +25 -17
  428. package/spec-files/outstanding/agentic_orchestrator_artifact_database_publishing_spec.md +40 -5
  429. package/spec-files/outstanding/agentic_orchestrator_enterprise_governance_dashboard_spec.md +23 -12
  430. package/spec-files/outstanding/agentic_orchestrator_knowledge_canary_spec.md +16 -4
  431. package/spec-files/outstanding/agentic_orchestrator_observability_integrity_diagnostics_spec.md +42 -2
  432. package/spec-files/outstanding/agentic_orchestrator_performance_improvements_spec.md +209 -130
  433. package/spec-files/outstanding/agentic_orchestrator_planning_review_quality_spec.md +56 -3
  434. package/spec-files/outstanding/agentic_orchestrator_productization_commercial_spec.md +77 -10
  435. package/spec-files/outstanding/agentic_orchestrator_provider_auth_bootstrap_spec.md +384 -0
  436. package/spec-files/outstanding/agentic_orchestrator_quality_adoption_execution_spec.md +29 -14
  437. package/spec-files/progress.md +186 -175
  438. package/tsconfig.json +2 -8
@@ -12,9 +12,11 @@
12
12
  ### 0.1 Testing Standards
13
13
 
14
14
  All new code MUST follow the testing standards defined in:
15
+
15
16
  - **`prompts/vitest-testing-standards.instructions.md`**
16
17
 
17
18
  Key requirements:
19
+
18
20
  - Use Vitest (`describe/it/expect`, `vi` mocks/spies)
19
21
  - Match existing repo conventions (test files in `apps/control-plane/test/*.spec.ts`)
20
22
  - Use **Given / When / Then** naming: `GIVEN_<context>_WHEN_<action>_THEN_<expected>`
@@ -25,6 +27,7 @@ Key requirements:
25
27
  ### 0.2 Reference Implementation Repository
26
28
 
27
29
  The ComposioHQ Agent Orchestrator implementation serves as the reference for feature implementations:
30
+
28
31
  - **Repository:** https://github.com/ComposioHQ/agent-orchestrator
29
32
  - **Tech stack:** TypeScript ESM, pnpm workspaces, Commander.js CLI, Next.js 15 + React 19 dashboard, Zod validation, Vitest + Playwright tests, tmux-based agent runtime
30
33
  - **Key directories to study:**
@@ -43,6 +46,7 @@ The ComposioHQ Agent Orchestrator implementation serves as the reference for fea
43
46
  ### 0.3 Package Dependencies (Required Additions)
44
47
 
45
48
  New dependencies to add to `apps/control-plane/package.json`:
49
+
46
50
  ```json
47
51
  {
48
52
  "dependencies": {
@@ -57,6 +61,7 @@ New dependencies to add to `apps/control-plane/package.json`:
57
61
  ```
58
62
 
59
63
  New package for dashboard (`packages/web-dashboard/package.json`):
64
+
60
65
  ```json
61
66
  {
62
67
  "name": "@aop/web-dashboard",
@@ -87,21 +92,25 @@ This specification defines a roadmap to close identified functionality gaps betw
87
92
  ### 2.1 Priority Tiers
88
93
 
89
94
  **P0 (Critical - Implement First):**
95
+
90
96
  - Features that eliminate major UX friction
91
97
  - Features that enable production deployment
92
98
  - Features required for multi-project workflows
93
99
 
94
100
  **P1 (High Value - Implement Soon):**
101
+
95
102
  - Features that significantly improve observability
96
103
  - Features that reduce manual configuration burden
97
104
  - Features that enable common use cases
98
105
 
99
106
  **P2 (Nice to Have - Future Consideration):**
107
+
100
108
  - Features that improve edge cases
101
109
  - Features with viable workarounds
102
110
  - Features with unclear ROI
103
111
 
104
112
  **P3 (Low Priority - Deferred):**
113
+
105
114
  - Features that conflict with core architecture
106
115
  - Features with marginal benefit
107
116
  - Features that require major redesigns
@@ -121,6 +130,7 @@ This specification defines a roadmap to close identified functionality gaps betw
121
130
  **AOP Design Alignment:** HIGH - Monitoring does not conflict with deterministic model.
122
131
 
123
132
  **Reference Implementation (ComposioHQ):**
133
+
124
134
  - SSE endpoint: `packages/web/src/app/api/events/route.ts`
125
135
  - Dashboard components: `packages/web/src/components/Dashboard.tsx`, `SessionCard.tsx`, `SessionDetail.tsx`
126
136
  - Hooks: `packages/web/src/hooks/` (real-time state management)
@@ -128,6 +138,7 @@ This specification defines a roadmap to close identified functionality gaps betw
128
138
  **Specification:**
129
139
 
130
140
  **Directory Structure:**
141
+
131
142
  ```
132
143
  packages/web-dashboard/
133
144
  ├── package.json
@@ -173,9 +184,10 @@ packages/web-dashboard/
173
184
  ```
174
185
 
175
186
  **SSE Implementation (Reference: ComposioHQ `packages/web/src/app/api/events/route.ts`):**
187
+
176
188
  ```typescript
177
189
  // packages/web-dashboard/src/app/api/events/route.ts
178
- export const dynamic = "force-dynamic";
190
+ export const dynamic = 'force-dynamic';
179
191
 
180
192
  export async function GET(): Promise<Response> {
181
193
  const encoder = new TextEncoder();
@@ -187,7 +199,7 @@ export async function GET(): Promise<Response> {
187
199
  // Send initial snapshot
188
200
  void (async () => {
189
201
  const features = await readFeaturesIndex();
190
- const event = { type: "snapshot", features };
202
+ const event = { type: 'snapshot', features };
191
203
  controller.enqueue(encoder.encode(`data: ${JSON.stringify(event)}\n\n`));
192
204
  })();
193
205
 
@@ -205,7 +217,7 @@ export async function GET(): Promise<Response> {
205
217
  updates = setInterval(() => {
206
218
  void (async () => {
207
219
  const features = await readFeaturesIndex();
208
- const event = { type: "snapshot", features };
220
+ const event = { type: 'snapshot', features };
209
221
  controller.enqueue(encoder.encode(`data: ${JSON.stringify(event)}\n\n`));
210
222
  })();
211
223
  }, 2000);
@@ -218,16 +230,17 @@ export async function GET(): Promise<Response> {
218
230
 
219
231
  return new Response(stream, {
220
232
  headers: {
221
- "Content-Type": "text/event-stream",
222
- "Cache-Control": "no-cache",
223
- Connection: "keep-alive",
224
- "X-Accel-Buffering": "no",
233
+ 'Content-Type': 'text/event-stream',
234
+ 'Cache-Control': 'no-cache',
235
+ Connection: 'keep-alive',
236
+ 'X-Accel-Buffering': 'no',
225
237
  },
226
238
  });
227
239
  }
228
240
  ```
229
241
 
230
242
  **useSSE Hook Implementation:**
243
+
231
244
  ```typescript
232
245
  // packages/web-dashboard/src/hooks/useSSE.ts
233
246
  import { useState, useEffect, useCallback } from 'react';
@@ -248,12 +261,12 @@ export function useSSE({ url, onMessage, reconnectInterval = 5000 }: SSEOptions)
248
261
 
249
262
  const connect = () => {
250
263
  eventSource = new EventSource(url);
251
-
264
+
252
265
  eventSource.onopen = () => {
253
266
  setConnected(true);
254
267
  setError(null);
255
268
  };
256
-
269
+
257
270
  eventSource.onmessage = (event) => {
258
271
  try {
259
272
  const data = JSON.parse(event.data);
@@ -262,7 +275,7 @@ export function useSSE({ url, onMessage, reconnectInterval = 5000 }: SSEOptions)
262
275
  console.error('SSE parse error:', e);
263
276
  }
264
277
  };
265
-
278
+
266
279
  eventSource.onerror = () => {
267
280
  setConnected(false);
268
281
  eventSource?.close();
@@ -283,6 +296,7 @@ export function useSSE({ url, onMessage, reconnectInterval = 5000 }: SSEOptions)
283
296
  ```
284
297
 
285
298
  **CLI Integration:**
299
+
286
300
  ```typescript
287
301
  // apps/control-plane/src/cli/dashboard-command-handler.ts
288
302
  import { spawn } from 'node:child_process';
@@ -292,13 +306,13 @@ export class DashboardCommandHandler {
292
306
  async execute(options: { port?: number; foreground?: boolean }): Promise<void> {
293
307
  const port = options.port ?? 3000;
294
308
  const dashboardPath = resolve(__dirname, '../../../../packages/web-dashboard');
295
-
309
+
296
310
  const env = {
297
311
  ...process.env,
298
312
  PORT: String(port),
299
313
  AOP_ROOT: process.cwd(),
300
314
  };
301
-
315
+
302
316
  if (options.foreground) {
303
317
  // Run in foreground
304
318
  const child = spawn('npm', ['run', 'dev'], {
@@ -323,6 +337,7 @@ export class DashboardCommandHandler {
323
337
  ```
324
338
 
325
339
  **Testing Requirements (per `prompts/vitest-testing-standards.instructions.md`):**
340
+
326
341
  ```typescript
327
342
  // packages/web-dashboard/src/__tests__/api-status.test.ts
328
343
  import { describe, it, expect, vi, beforeEach } from 'vitest';
@@ -336,16 +351,18 @@ describe('GET /api/status', () => {
336
351
  it('GIVEN_valid_aop_directory_WHEN_status_requested_THEN_returns_features_list', async () => {
337
352
  // Mock file reading
338
353
  vi.mock('node:fs/promises', () => ({
339
- readFile: vi.fn().mockResolvedValue(JSON.stringify({
340
- active: ['feature_a'],
341
- blocked: [],
342
- merged: ['feature_b'],
343
- })),
354
+ readFile: vi.fn().mockResolvedValue(
355
+ JSON.stringify({
356
+ active: ['feature_a'],
357
+ blocked: [],
358
+ merged: ['feature_b'],
359
+ }),
360
+ ),
344
361
  }));
345
-
362
+
346
363
  const response = await GET();
347
364
  const data = await response.json();
348
-
365
+
349
366
  expect(response.status).toBe(200);
350
367
  expect(data.active).toContain('feature_a');
351
368
  });
@@ -354,10 +371,10 @@ describe('GET /api/status', () => {
354
371
  vi.mock('node:fs/promises', () => ({
355
372
  readFile: vi.fn().mockRejectedValue(new Error('ENOENT')),
356
373
  }));
357
-
374
+
358
375
  const response = await GET();
359
376
  const data = await response.json();
360
-
377
+
361
378
  expect(response.status).toBe(200);
362
379
  expect(data.active).toEqual([]);
363
380
  });
@@ -365,6 +382,7 @@ describe('GET /api/status', () => {
365
382
  ```
366
383
 
367
384
  **Dashboard Routes:**
385
+
368
386
  - `GET /` — Dashboard UI
369
387
  - `GET /api/status` — Global status snapshot (same as `aop status` JSON)
370
388
  - `GET /api/events` — SSE stream
@@ -392,15 +410,17 @@ The dashboard serves as the primary human review interface. When a feature reach
392
410
  - `{ decision: "request_changes", message: "..." }` — Sends the reviewer's feedback as a corrective prompt to the builder agent (via the reaction system) and keeps the feature in its current phase for another build/QA cycle
393
411
 
394
412
  4. **API Implementation:**
413
+
395
414
  ```typescript
396
415
  // POST /api/features/:id/review
397
416
  interface ReviewRequest {
398
417
  decision: 'approve' | 'deny' | 'request_changes';
399
- approval_token?: string; // required for approve
400
- reason?: string; // required for deny
401
- message?: string; // required for request_changes
418
+ approval_token?: string; // required for approve
419
+ reason?: string; // required for deny
420
+ message?: string; // required for request_changes
402
421
  }
403
422
  ```
423
+
404
424
  - `approve` → calls `ToolClient.call('feature.ready_to_merge', { feature_id, approval_token })`
405
425
  - `deny` → calls `ToolClient.call('feature.state_patch', { feature_id, patch: { status: 'blocked' } })` + `ToolClient.call('feature.log_append', { feature_id, entry: reason })`
406
426
  - `request_changes` → calls `ToolClient.call('feature.log_append', { feature_id, entry: message })` + triggers `changes_requested` reaction to inject feedback into agent
@@ -417,20 +437,21 @@ The dashboard provides a one-click checkout so the reviewer can spin up a local
417
437
  - On confirm, calls `POST /api/features/:id/checkout`
418
438
 
419
439
  3. **API Implementation:**
440
+
420
441
  ```typescript
421
442
  // POST /api/features/:id/checkout
422
443
  interface CheckoutRequest {
423
- stash_changes?: boolean; // default: true — auto-stash uncommitted work
424
- restore_after?: boolean; // default: false — if true, remember original branch for later restore
444
+ stash_changes?: boolean; // default: true — auto-stash uncommitted work
445
+ restore_after?: boolean; // default: false — if true, remember original branch for later restore
425
446
  }
426
447
 
427
448
  interface CheckoutResponse {
428
449
  ok: boolean;
429
450
  data?: {
430
- branch: string; // the branch checked out
451
+ branch: string; // the branch checked out
431
452
  previous_branch: string; // the branch before checkout (for restore)
432
- stashed: boolean; // whether changes were stashed
433
- stash_ref?: string; // stash reference if stashed
453
+ stashed: boolean; // whether changes were stashed
454
+ stash_ref?: string; // stash reference if stashed
434
455
  };
435
456
  error?: { code: string; message: string };
436
457
  }
@@ -455,11 +476,13 @@ The dashboard provides a one-click checkout so the reviewer can spin up a local
455
476
  - Only one checkout active at a time (tracked in `.aop/runtime/checkout-restore.json`)
456
477
 
457
478
  **Launch Integration:**
479
+
458
480
  - New CLI command: `aop dashboard [--port 3000] [--foreground]`
459
481
  - Starts dashboard server in background or foreground
460
482
  - Dashboard reads config from `agentic/orchestrator/policy.yaml` for port, auth settings
461
483
 
462
484
  **Acceptance Criteria:**
485
+
463
486
  - [ ] Dashboard displays all active/blocked/merged features with live updates
464
487
  - [ ] Clicking feature shows state, plan, diff, evidence
465
488
  - [ ] SSE updates within 2s of state file changes
@@ -487,9 +510,11 @@ The dashboard provides a one-click checkout so the reviewer can spin up a local
487
510
  **Specification:**
488
511
 
489
512
  **Architecture:**
513
+
490
514
  1. **Notifier Service** (`apps/control-plane/src/application/services/notifier-service.ts`)
491
515
  - Abstract `NotifierChannel` interface (desktop, slack, webhook, email)
492
516
  - Config in `agentic/orchestrator/policy.yaml`:
517
+
493
518
  ```yaml
494
519
  notifications:
495
520
  enabled: true
@@ -499,17 +524,17 @@ The dashboard provides a one-click checkout so the reviewer can spin up a local
499
524
  slack:
500
525
  enabled: true
501
526
  webhook: ${SLACK_WEBHOOK_URL}
502
- channel: "#aop-alerts"
527
+ channel: '#aop-alerts'
503
528
  webhook:
504
529
  enabled: false
505
530
  url: ${CUSTOM_WEBHOOK_URL}
506
531
  method: POST
507
532
  headers:
508
- Authorization: "Bearer ${WEBHOOK_TOKEN}"
533
+ Authorization: 'Bearer ${WEBHOOK_TOKEN}'
509
534
  routing:
510
- critical: [desktop, slack] # Gate failures, collisions
511
- warning: [slack] # Stale leases, retry exhaustion
512
- info: [slack] # Feature merged, gates passed
535
+ critical: [desktop, slack] # Gate failures, collisions
536
+ warning: [slack] # Stale leases, retry exhaustion
537
+ info: [slack] # Feature merged, gates passed
513
538
  ```
514
539
 
515
540
  2. **Notification Events:**
@@ -532,6 +557,7 @@ The dashboard provides a one-click checkout so the reviewer can spin up a local
532
557
  - Failures logged but do not block orchestration
533
558
 
534
559
  **Acceptance Criteria:**
560
+
535
561
  - [ ] Desktop notification on gate failure with feature ID + error summary
536
562
  - [ ] Slack notification includes clickable link to dashboard (if running)
537
563
  - [ ] Webhook payload includes full event context (feature_id, status, evidence summary)
@@ -553,6 +579,7 @@ The dashboard provides a one-click checkout so the reviewer can spin up a local
553
579
  **Specification:**
554
580
 
555
581
  **Wizard Flow:**
582
+
556
583
  1. **Detect repository context:**
557
584
  - Check for `.git/` in current directory
558
585
  - Parse git remote URL → derive repo owner/name
@@ -580,9 +607,10 @@ The dashboard provides a one-click checkout so the reviewer can spin up a local
580
607
 
581
608
  5. **Post-init instructions:**
582
609
  - Print next steps:
610
+
583
611
  ```
584
612
  ✅ Configuration created successfully!
585
-
613
+
586
614
  Next steps:
587
615
  1. Review config files in agentic/orchestrator/
588
616
  2. Add feature specs to .aop/features/<feature_id>/spec.md
@@ -591,6 +619,7 @@ The dashboard provides a one-click checkout so the reviewer can spin up a local
591
619
  ```
592
620
 
593
621
  **Acceptance Criteria:**
622
+
594
623
  - [ ] Wizard detects git repo and parses remote URL
595
624
  - [ ] Generated config files pass schema validation
596
625
  - [ ] Wizard handles non-git directories gracefully (prompts for manual values)
@@ -612,9 +641,10 @@ The dashboard provides a one-click checkout so the reviewer can spin up a local
612
641
  **Specification:**
613
642
 
614
643
  **Config Schema Extension:**
644
+
615
645
  ```yaml
616
646
  # agentic/orchestrator/multi-project.yaml (new file)
617
- version: "1.0"
647
+ version: '1.0'
618
648
 
619
649
  defaults:
620
650
  max_active_features: 5
@@ -625,17 +655,17 @@ defaults:
625
655
  channels: [desktop, slack]
626
656
 
627
657
  projects:
628
- - name: "backend"
658
+ - name: 'backend'
629
659
  path: ~/repos/backend
630
- repo: "myorg/backend"
660
+ repo: 'myorg/backend'
631
661
  branch: main
632
- policy: agentic/orchestrator/policy.yaml # per-project override
662
+ policy: agentic/orchestrator/policy.yaml # per-project override
633
663
  gates: agentic/orchestrator/gates-backend.yaml
634
- dashboard_port: 3001 # override default
635
-
636
- - name: "frontend"
664
+ dashboard_port: 3001 # override default
665
+
666
+ - name: 'frontend'
637
667
  path: ~/repos/frontend
638
- repo: "myorg/frontend"
668
+ repo: 'myorg/frontend'
639
669
  branch: main
640
670
  policy: agentic/orchestrator/policy.yaml
641
671
  gates: agentic/orchestrator/gates-frontend.yaml
@@ -643,6 +673,7 @@ projects:
643
673
  ```
644
674
 
645
675
  **Implementation:**
676
+
646
677
  1. **Multi-Project Loader** (`src/application/multi-project-loader.ts`)
647
678
  - Parses `multi-project.yaml` (optional; single-project mode remains default)
648
679
  - Validates each project config against schema
@@ -665,6 +696,7 @@ projects:
665
696
  - Global view showing status across all projects
666
697
 
667
698
  **Acceptance Criteria:**
699
+
668
700
  - [ ] Multi-project config validated against schema
669
701
  - [ ] Can run orchestrator for specific project via `--project` flag
670
702
  - [ ] Run leases isolated per project (parallel orchestration safe)
@@ -688,54 +720,60 @@ projects:
688
720
  **Specification:**
689
721
 
690
722
  **Reaction Policy Config:**
723
+
691
724
  ```yaml
692
725
  # agentic/orchestrator/policy.yaml
693
726
  reactions:
694
727
  gate_failed:
695
728
  enabled: true
696
729
  max_retries: 2
697
- action: retry_with_agent_repair # or 'notify_only'
698
- escalate_after: 2 # escalate to human after N failures
730
+ action: retry_with_agent_repair # or 'notify_only'
731
+ escalate_after: 2 # escalate to human after N failures
699
732
  retry_delay: 30s
700
-
733
+
701
734
  collision_detected:
702
735
  enabled: true
703
- action: notify_only # no auto-resolution
704
-
736
+ action: notify_only # no auto-resolution
737
+
705
738
  ready_to_merge:
706
739
  enabled: true
707
- action: notify_only # never auto-merge
740
+ action: notify_only # never auto-merge
708
741
  ```
709
742
 
710
743
  **Retry Flow:**
744
+
711
745
  1. **Gate failure detected** (QA wave or build wave)
712
746
  2. **Check reaction policy:** If `reactions.gate_failed.enabled` and retry count < max_retries
713
747
  3. **Agent repair loop:**
714
748
  - Load gate failure evidence + logs
715
749
  - Inject repair prompt to builder/QA agent:
750
+
716
751
  ```
717
752
  Gate execution failed. Review the error logs below and apply fixes.
718
-
753
+
719
754
  Gate: {gate_name}
720
755
  Exit Code: {exit_code}
721
-
756
+
722
757
  Logs:
723
758
  {logs}
724
-
759
+
725
760
  Evidence:
726
761
  {evidence_summary}
727
762
  ```
763
+
728
764
  4. **Agent generates repair patches** → apply via `repo.apply_patch`
729
765
  5. **Re-run gate** → capture new evidence
730
766
  6. **Success:** Advance to next phase
731
767
  7. **Failure:** Increment retry count, repeat or escalate
732
768
 
733
769
  **Escalation:**
770
+
734
771
  - After `escalate_after` failures → notification to all critical channels
735
772
  - Feature remains in current phase (does not auto-advance)
736
773
  - User can manually intervene via dashboard or `aop send <feature_id> <instruction>`
737
774
 
738
775
  **Acceptance Criteria:**
776
+
739
777
  - [ ] Gate failure triggers retry if policy enabled
740
778
  - [ ] Retry count tracked in feature state (`gate_retry_count`)
741
779
  - [ ] Agent receives failure context in prompt
@@ -770,7 +808,9 @@ reactions:
770
808
  - Exit with `Ctrl-D` or type `/exit`
771
809
 
772
810
  **Implementation:**
811
+
773
812
  1. **Provider Interface Extension:**
813
+
774
814
  ```typescript
775
815
  interface WorkerProvider {
776
816
  sendMessage(sessionId: string, message: string): Promise<void>;
@@ -791,6 +831,7 @@ reactions:
791
831
  - Terminal streams stdin/stdout until exit
792
832
 
793
833
  **Acceptance Criteria:**
834
+
794
835
  - [ ] `aop send` delivers message to active orchestrator session
795
836
  - [ ] `aop attach` launches interactive session for supported providers
796
837
  - [ ] Error handling: feature not found, session not active, provider unsupported
@@ -830,12 +871,13 @@ reactions:
830
871
  reactions:
831
872
  agent_stuck:
832
873
  enabled: true
833
- action: notify_and_restart # or: notify_only
874
+ action: notify_and_restart # or: notify_only
834
875
  idle_threshold: 300s
835
876
  escalate_after: 2
836
877
  ```
837
878
 
838
879
  **Acceptance Criteria:**
880
+
839
881
  - [ ] Activity state detected for at least Claude Code and generic providers
840
882
  - [ ] `aop status` displays activity state per feature
841
883
  - [ ] Agent stuck beyond threshold triggers notification
@@ -869,6 +911,7 @@ reactions:
869
911
  - Configurable in policy: `cleanup.auto_after_merge: true`, `cleanup.grace_period: 3600s`
870
912
 
871
913
  **Acceptance Criteria:**
914
+
872
915
  - [ ] `aop cleanup --dry-run` lists features eligible for cleanup
873
916
  - [ ] `aop cleanup --yes` removes terminal features + orphan worktrees
874
917
  - [ ] Auto-cleanup triggers after merge when enabled
@@ -899,6 +942,7 @@ reactions:
899
942
  - `aop status --summary` — One-line-per-feature compact view
900
943
 
901
944
  **Acceptance Criteria:**
945
+
902
946
  - [ ] Batch run deduplicates against existing features
903
947
  - [ ] Failed spawns don't block remaining features
904
948
  - [ ] Summary output reports counts
@@ -918,13 +962,14 @@ reactions:
918
962
  **Specification:**
919
963
 
920
964
  1. **Policy Extension:**
965
+
921
966
  ```yaml
922
967
  # agentic/orchestrator/policy.yaml
923
968
  worktree:
924
969
  base_branch: main
925
970
  post_create:
926
- - "npm ci"
927
- - "cp .env.example .env"
971
+ - 'npm ci'
972
+ - 'cp .env.example .env'
928
973
  symlinks:
929
974
  - .env
930
975
  - .claude
@@ -937,6 +982,7 @@ reactions:
937
982
  - Schema extension in `policy.schema.json`
938
983
 
939
984
  **Acceptance Criteria:**
985
+
940
986
  - [ ] `post_create` commands execute in new worktree directory
941
987
  - [ ] Symlinks created before post_create commands run
942
988
  - [ ] Command failures logged but don't block initialization
@@ -969,12 +1015,13 @@ reactions:
969
1015
  - PR info stored in feature state: `pr_number`, `pr_url`, `ci_status`, `review_decision`
970
1016
 
971
1017
  2. **Feature State Extension:**
1018
+
972
1019
  ```yaml
973
1020
  pr:
974
1021
  number: 42
975
- url: "https://github.com/org/repo/pull/42"
976
- ci_status: passing # passing | failing | pending | none
977
- review_decision: approved # approved | changes_requested | pending | none
1022
+ url: 'https://github.com/org/repo/pull/42'
1023
+ ci_status: passing # passing | failing | pending | none
1024
+ review_decision: approved # approved | changes_requested | pending | none
978
1025
  merge_ready: true
979
1026
  ```
980
1027
 
@@ -988,7 +1035,7 @@ reactions:
988
1035
  reactions:
989
1036
  ci_failed_upstream:
990
1037
  enabled: true
991
- action: notify_only # or: retry_with_agent_repair
1038
+ action: notify_only # or: retry_with_agent_repair
992
1039
  changes_requested:
993
1040
  enabled: true
994
1041
  action: send_review_context_to_agent
@@ -996,6 +1043,7 @@ reactions:
996
1043
  ```
997
1044
 
998
1045
  **Acceptance Criteria:**
1046
+
999
1047
  - [ ] PR detected automatically after feature creates a branch with open PR
1000
1048
  - [ ] CI status and review decisions reflected in feature state
1001
1049
  - [ ] Dashboard shows PR info with merge score
@@ -1044,6 +1092,7 @@ reactions:
1044
1092
  **Specification:**
1045
1093
 
1046
1094
  **Tracker Abstraction:**
1095
+
1047
1096
  ```typescript
1048
1097
  interface IssueTracker {
1049
1098
  getIssue(issueId: string): Promise<Issue>;
@@ -1053,16 +1102,18 @@ interface IssueTracker {
1053
1102
  ```
1054
1103
 
1055
1104
  **Config Extension:**
1105
+
1056
1106
  ```yaml
1057
1107
  # agentic/orchestrator/policy.yaml
1058
1108
  issue_tracker:
1059
- type: github # or linear, jira
1109
+ type: github # or linear, jira
1060
1110
  config:
1061
1111
  token: ${GITHUB_TOKEN}
1062
1112
  repo: myorg/myrepo
1063
1113
  ```
1064
1114
 
1065
1115
  **Integration Points:**
1116
+
1066
1117
  1. **Spec enrichment:** Fetch issue details, inject into planner context
1067
1118
  2. **Status sync:** Update issue status when feature advances (planning → building → merged)
1068
1119
  3. **Comment posting:** Post gate results, evidence links as issue comments
@@ -1096,6 +1147,7 @@ issue_tracker:
1096
1147
  **Specification:**
1097
1148
 
1098
1149
  **Instance Isolation Strategy:**
1150
+
1099
1151
  1. Derive instance ID from config path hash (SHA256)
1100
1152
  2. Namespace run lease file: `.aop/runtime/<instance_id>/run-lease.json`
1101
1153
  3. Each instance has independent dashboard port, worktree paths
@@ -1124,6 +1176,7 @@ issue_tracker:
1124
1176
  #### G13-G18: Deferred Gaps
1125
1177
 
1126
1178
  **Deferred due to low ROI or architectural misalignment:**
1179
+
1127
1180
  - **G13: Plugin System** - Conflicts with deterministic kernel design; provider abstraction sufficient
1128
1181
  - **G14: Alternative Workspace Modes** - Worktrees optimal; clone/copy add complexity
1129
1182
  - **G15: K8s/SSH Runtimes** - MCP transport abstraction sufficient
@@ -1142,6 +1195,7 @@ These features emerged from analyzing both codebases and represent opportunities
1142
1195
  **Problem:** Both AOP and Composio run full test suites on every gate pass. For large codebases, this wastes minutes re-running unaffected tests.
1143
1196
 
1144
1197
  **Specification:**
1198
+
1145
1199
  - After `repo.apply_patch`, compute affected file set from diff
1146
1200
  - Use test dependency graph (vitest `--changed`, jest `--changedSince`, pytest `--lf`) to select affected tests
1147
1201
  - Gate config extension:
@@ -1152,10 +1206,10 @@ These features emerged from analyzing both codebases and represent opportunities
1152
1206
  modes:
1153
1207
  fast:
1154
1208
  commands:
1155
- - "npx vitest run --changed {base_branch}" # incremental
1209
+ - 'npx vitest run --changed {base_branch}' # incremental
1156
1210
  full:
1157
1211
  commands:
1158
- - "npx vitest run" # full suite
1212
+ - 'npx vitest run' # full suite
1159
1213
  ```
1160
1214
  - `fast` mode uses incremental; `full` and `merge` modes run complete suite
1161
1215
  - Evidence captures which tests were skipped and why
@@ -1171,6 +1225,7 @@ These features emerged from analyzing both codebases and represent opportunities
1171
1225
  **Problem:** Gates run sequentially. Independent gates (lint, type-check, unit tests) could run concurrently.
1172
1226
 
1173
1227
  **Specification:**
1228
+
1174
1229
  - Gate config supports `parallel: true` flag per command group
1175
1230
  - Commands within a parallel group execute concurrently via `Promise.allSettled`
1176
1231
  - Evidence captured per-command; overall gate fails if any parallel command fails
@@ -1185,13 +1240,14 @@ These features emerged from analyzing both codebases and represent opportunities
1185
1240
  **Problem:** Neither system tracks or limits LLM API costs per feature. Runaway agent loops can burn tokens.
1186
1241
 
1187
1242
  **Specification:**
1243
+
1188
1244
  - Track token usage per feature via operation ledger metadata
1189
1245
  - Budget config:
1190
1246
  ```yaml
1191
1247
  budget:
1192
- per_feature_limit: 50.00 # USD
1248
+ per_feature_limit: 50.00 # USD
1193
1249
  per_phase_limit: 20.00
1194
- alert_threshold: 0.8 # notify at 80% of budget
1250
+ alert_threshold: 0.8 # notify at 80% of budget
1195
1251
  ```
1196
1252
  - Supervisor checks budget before each worker decision loop iteration
1197
1253
  - Over-budget triggers notification + feature pause (not kill)
@@ -1206,6 +1262,7 @@ These features emerged from analyzing both codebases and represent opportunities
1206
1262
  **Problem:** Neither system supports declaring that Feature B depends on Feature A. AOP's collision detection is file-path based, not semantic.
1207
1263
 
1208
1264
  **Specification:**
1265
+
1209
1266
  - Spec metadata supports `depends_on: [feature_a]`
1210
1267
  - Scheduler defers dependent features to blocked queue until dependencies reach `merged` status
1211
1268
  - Automatic promotion when dependency chain resolves
@@ -1220,6 +1277,7 @@ These features emerged from analyzing both codebases and represent opportunities
1220
1277
  **Problem:** Neither system tracks which provider/model combinations succeed more often at which task types.
1221
1278
 
1222
1279
  **Specification:**
1280
+
1223
1281
  - Record per-feature outcome metrics: gate pass rate, retry count, time-to-merge, cost
1224
1282
  - Aggregate by provider + model over time
1225
1283
  - Optional: feed analytics into provider selection heuristics
@@ -1232,28 +1290,33 @@ These features emerged from analyzing both codebases and represent opportunities
1232
1290
 
1233
1291
  **Problem:** AOP currently defines extension interfaces ad-hoc per feature (G2 introduces `NotifierChannel`, G6 extends `WorkerProvider`, G9 defines `IssueTracker`, G6a adds `ActivityMonitor`, G6e adds `PrMonitor`). Each is a standalone interface with its own discovery, configuration, and error handling. This leads to duplicated patterns, inconsistent adapter lifecycle, and a codebase that gets harder to extend with every new concern axis. Meanwhile the existing `ProviderSelection` in `providers.ts` uses a hardcoded union type (`'codex' | 'claude' | ... | 'copilot'`) — adding a new provider means editing the union, the resolution logic, and every switch that touches it.
1234
1292
 
1235
- **Relationship to Plugin Systems:** This is *not* a plugin system. Plugins imply runtime discovery, dynamic loading, and third-party code running inside the process boundary — all of which undermine AOP's deterministic guarantees. An adapter registry is a **compile-time contract** with **config-driven selection**: the kernel knows every adapter that exists at build time, validates adapter configuration against schemas, and routes through the same deterministic pipeline (RBAC, validation, audit) as everything else. Adapters don't own state — the kernel does. Adapters don't make decisions — the kernel does. Adapters just answer "how do I talk to Slack" or "how do I parse Claude Code's session files."
1293
+ **Relationship to Plugin Systems:** This is _not_ a plugin system. Plugins imply runtime discovery, dynamic loading, and third-party code running inside the process boundary — all of which undermine AOP's deterministic guarantees. An adapter registry is a **compile-time contract** with **config-driven selection**: the kernel knows every adapter that exists at build time, validates adapter configuration against schemas, and routes through the same deterministic pipeline (RBAC, validation, audit) as everything else. Adapters don't own state — the kernel does. Adapters don't make decisions — the kernel does. Adapters just answer "how do I talk to Slack" or "how do I parse Claude Code's session files."
1236
1294
 
1237
1295
  **Specification:**
1238
1296
 
1239
1297
  1. **Core Abstraction** (`apps/control-plane/src/application/adapters/adapter-registry.ts`):
1298
+
1240
1299
  ```typescript
1241
1300
  /** A typed slot that adapters can fill. */
1242
1301
  interface AdapterSlot<TContract> {
1243
- readonly name: string; // e.g. 'notification-channel', 'agent-provider'
1244
- readonly contract: TContract; // the interface adapters must implement
1302
+ readonly name: string; // e.g. 'notification-channel', 'agent-provider'
1303
+ readonly contract: TContract; // the interface adapters must implement
1245
1304
  }
1246
1305
 
1247
1306
  /** Metadata every adapter must declare. */
1248
1307
  interface AdapterManifest {
1249
- readonly slot: string; // which slot this fills
1250
- readonly name: string; // unique adapter name within slot (e.g. 'slack', 'claude')
1251
- readonly configSchema?: JsonSchema; // AJV schema for adapter-specific config
1308
+ readonly slot: string; // which slot this fills
1309
+ readonly name: string; // unique adapter name within slot (e.g. 'slack', 'claude')
1310
+ readonly configSchema?: JsonSchema; // AJV schema for adapter-specific config
1252
1311
  }
1253
1312
 
1254
1313
  /** The registry: slot → (name → adapter instance). */
1255
1314
  interface AdapterRegistry {
1256
- register<T>(slot: AdapterSlot<T>, manifest: AdapterManifest, factory: (config: unknown) => T): void;
1315
+ register<T>(
1316
+ slot: AdapterSlot<T>,
1317
+ manifest: AdapterManifest,
1318
+ factory: (config: unknown) => T,
1319
+ ): void;
1257
1320
  resolve<T>(slot: AdapterSlot<T>, name: string, config: unknown): T;
1258
1321
  list(slot: string): ReadonlyArray<AdapterManifest>;
1259
1322
  has(slot: string, name: string): boolean;
@@ -1262,13 +1325,13 @@ These features emerged from analyzing both codebases and represent opportunities
1262
1325
 
1263
1326
  2. **Adapter Slots** (formalized concern axes):
1264
1327
 
1265
- | Slot | Contract Interface | Built-in Adapters | Used By |
1266
- |------|-------------------|-------------------|---------|
1267
- | `agent-provider` | `WorkerProvider` | codex, claude, gemini, kiro-cli, copilot, custom | Supervisor runtime, G6 send/attach |
1268
- | `notification-channel` | `NotifierChannel` | desktop, slack, webhook | G2 NotifierService |
1269
- | `scm-provider` | `ScmProvider` | github (via `gh` CLI) | G6e PR lifecycle |
1270
- | `issue-tracker` | `IssueTracker` | github, linear, jira | G9 tracker support |
1271
- | `activity-detector` | `ActivityDetector` | claude-jsonl, codex-rpc, process-heuristic | G6a activity monitoring |
1328
+ | Slot | Contract Interface | Built-in Adapters | Used By |
1329
+ | ---------------------- | ------------------ | ------------------------------------------------ | ---------------------------------- |
1330
+ | `agent-provider` | `WorkerProvider` | codex, claude, gemini, kiro-cli, copilot, custom | Supervisor runtime, G6 send/attach |
1331
+ | `notification-channel` | `NotifierChannel` | desktop, slack, webhook | G2 NotifierService |
1332
+ | `scm-provider` | `ScmProvider` | github (via `gh` CLI) | G6e PR lifecycle |
1333
+ | `issue-tracker` | `IssueTracker` | github, linear, jira | G9 tracker support |
1334
+ | `activity-detector` | `ActivityDetector` | claude-jsonl, codex-rpc, process-heuristic | G6a activity monitoring |
1272
1335
 
1273
1336
  3. **Registration & Resolution:**
1274
1337
  - All built-in adapters are registered at kernel boot time in a deterministic order
@@ -1278,17 +1341,18 @@ These features emerged from analyzing both codebases and represent opportunities
1278
1341
  - No dynamic imports, no runtime discovery, no third-party code — every adapter is a known import at build time
1279
1342
 
1280
1343
  4. **Config Integration:**
1344
+
1281
1345
  ```yaml
1282
1346
  # agentic/orchestrator/policy.yaml
1283
1347
  adapters:
1284
- notification-channel: slack # selects the 'slack' adapter for this slot
1285
- scm-provider: github # selects 'github' for SCM
1286
- issue-tracker: github # selects 'github' for issue tracking
1287
- activity-detector: claude-jsonl # selects Claude Code JSONL parser
1348
+ notification-channel: slack # selects the 'slack' adapter for this slot
1349
+ scm-provider: github # selects 'github' for SCM
1350
+ issue-tracker: github # selects 'github' for issue tracking
1351
+ activity-detector: claude-jsonl # selects Claude Code JSONL parser
1288
1352
 
1289
1353
  # agentic/orchestrator/agents.yaml (existing, unchanged)
1290
1354
  runtime:
1291
- default_provider: claude # selects 'claude' for agent-provider slot
1355
+ default_provider: claude # selects 'claude' for agent-provider slot
1292
1356
  ```
1293
1357
 
1294
1358
  5. **Schema Validation:**
@@ -1309,6 +1373,7 @@ These features emerged from analyzing both codebases and represent opportunities
1309
1373
  - The kernel retains full authority over state, validation, RBAC, and audit. Adapters are leaf-node implementations behind the kernel's deterministic pipeline.
1310
1374
 
1311
1375
  **Acceptance Criteria:**
1376
+
1312
1377
  - [ ] `AdapterRegistry` supports register/resolve/list/has operations with type safety
1313
1378
  - [ ] `agent-provider` slot migrated from hardcoded union to registry (no config changes required)
1314
1379
  - [ ] Adapter config validated against adapter-declared `configSchema` at boot
@@ -1323,9 +1388,11 @@ These features emerged from analyzing both codebases and represent opportunities
1323
1388
  ## 4. Implementation Roadmap
1324
1389
 
1325
1390
  ### Phase 1: Critical UX Improvements (M29)
1391
+
1326
1392
  **Duration:** 5-6 weeks
1327
1393
 
1328
1394
  **Deliverables:**
1395
+
1329
1396
  1. **G1: Web Dashboard** (2 weeks)
1330
1397
  - Next.js dashboard with SSE updates
1331
1398
  - Feature cards, diff viewer, evidence viewer
@@ -1367,6 +1434,7 @@ These features emerged from analyzing both codebases and represent opportunities
1367
1434
  - No config changes required — existing `agents.yaml` `default_provider` resolves through registry
1368
1435
 
1369
1436
  **Milestone Acceptance:**
1437
+
1370
1438
  - [ ] Dashboard displays live feature status with SSE updates + Kanban view
1371
1439
  - [ ] Dashboard review panel: approve/deny/request-changes with merge control
1372
1440
  - [ ] Dashboard checkout: one-click switch to feature branch for local testing with stash/restore
@@ -1381,9 +1449,11 @@ These features emerged from analyzing both codebases and represent opportunities
1381
1449
  ---
1382
1450
 
1383
1451
  ### Phase 2: Autonomous Operations & Observability (M30)
1452
+
1384
1453
  **Duration:** 4-5 weeks
1385
1454
 
1386
1455
  **Deliverables:**
1456
+
1387
1457
  1. **G5: CI Failure Auto-Remediation** (2 weeks)
1388
1458
  - Reaction policy config
1389
1459
  - Retry loop with agent repair
@@ -1413,6 +1483,7 @@ These features emerged from analyzing both codebases and represent opportunities
1413
1483
  - Fast mode uses incremental, full/merge modes run complete suite
1414
1484
 
1415
1485
  **Milestone Acceptance:**
1486
+
1416
1487
  - [ ] Gate failures trigger automatic retry with agent repair + time-based escalation
1417
1488
  - [ ] Agent activity state visible in `aop status` and dashboard
1418
1489
  - [ ] `aop send` delivers messages to active agents with idle-wait
@@ -1422,9 +1493,11 @@ These features emerged from analyzing both codebases and represent opportunities
1422
1493
  ---
1423
1494
 
1424
1495
  ### Phase 3: Ecosystem Integration (M31)
1496
+
1425
1497
  **Duration:** 3-4 weeks
1426
1498
 
1427
1499
  **Deliverables:**
1500
+
1428
1501
  1. **G9: Multi-Tracker Support** (2 weeks)
1429
1502
  - Register `issue-tracker` adapter slot (N6): github, linear, jira adapters
1430
1503
  - Issue context enrichment
@@ -1446,6 +1519,7 @@ These features emerged from analyzing both codebases and represent opportunities
1446
1519
  - Circular dependency detection
1447
1520
 
1448
1521
  **Milestone Acceptance:**
1522
+
1449
1523
  - [ ] Planner receives issue context from GitHub/Linear
1450
1524
  - [ ] Feature status updates sync to issue tracker
1451
1525
  - [ ] Multiple orchestrator instances run safely with isolated leases
@@ -1457,6 +1531,7 @@ These features emerged from analyzing both codebases and represent opportunities
1457
1531
  ## 5. Testing Strategy
1458
1532
 
1459
1533
  ### 5.1 Unit Tests
1534
+
1460
1535
  - **Dashboard:** SSE event emission, API route handlers, file polling, Kanban column assignment, review decision dispatch (approve/deny/request_changes → tool client calls), checkout flow (stash detection, branch switch, restore state tracking)
1461
1536
  - **Notifications:** Channel routing (4-tier), message formatting, failure handling, throttle/batch
1462
1537
  - **Init Wizard:** Git detection, template generation, schema validation, `--auto` mode
@@ -1470,6 +1545,7 @@ These features emerged from analyzing both codebases and represent opportunities
1470
1545
  - **Cost Tracking:** Token accumulation, budget threshold detection, pause logic
1471
1546
 
1472
1547
  ### 5.2 Integration Tests
1548
+
1473
1549
  - **Dashboard E2E:** Feature status updates → SSE events → UI refresh
1474
1550
  - **Dashboard Review E2E:** Feature reaches ready_to_merge → reviewer approves via dashboard → merge executes → feature moves to merged
1475
1551
  - **Dashboard Checkout E2E:** Reviewer clicks checkout → stash created → branch switched → restore returns to original branch + stash pop
@@ -1480,6 +1556,7 @@ These features emerged from analyzing both codebases and represent opportunities
1480
1556
  - **PR Lifecycle E2E:** Branch push → PR detected → CI status tracked → review feedback → agent fix
1481
1557
 
1482
1558
  ### 5.3 Manual Acceptance Tests
1559
+
1483
1560
  - Dashboard visual inspection (UI polish, responsiveness)
1484
1561
  - `aop init` wizard flow (user-friendly prompts, error messages)
1485
1562
  - `aop send` / `aop attach` interactive sessions (terminal streaming)
@@ -1503,7 +1580,7 @@ notifications:
1503
1580
  slack:
1504
1581
  enabled: true
1505
1582
  webhook: ${SLACK_WEBHOOK_URL}
1506
- channel: "#aop-alerts"
1583
+ channel: '#aop-alerts'
1507
1584
  webhook:
1508
1585
  enabled: false
1509
1586
  url: ${CUSTOM_WEBHOOK_URL}
@@ -1532,12 +1609,12 @@ dashboard:
1532
1609
  enabled: true
1533
1610
  port: 3000
1534
1611
  auth:
1535
- enabled: false # future: API key auth
1612
+ enabled: false # future: API key auth
1536
1613
 
1537
1614
  # NEW: Issue Tracker (optional)
1538
1615
  issue_tracker:
1539
1616
  enabled: false
1540
- type: github # or linear, jira
1617
+ type: github # or linear, jira
1541
1618
  config:
1542
1619
  token: ${GITHUB_TOKEN}
1543
1620
  repo: myorg/myrepo
@@ -1547,7 +1624,7 @@ issue_tracker:
1547
1624
 
1548
1625
  ```yaml
1549
1626
  # agentic/orchestrator/multi-project.yaml (NEW FILE)
1550
- version: "1.0"
1627
+ version: '1.0'
1551
1628
 
1552
1629
  defaults:
1553
1630
  max_active_features: 5
@@ -1557,13 +1634,13 @@ defaults:
1557
1634
  enabled: true
1558
1635
 
1559
1636
  projects:
1560
- - name: "project_a"
1637
+ - name: 'project_a'
1561
1638
  path: ~/repos/project_a
1562
- repo: "org/project_a"
1639
+ repo: 'org/project_a'
1563
1640
  branch: main
1564
1641
  policy: agentic/orchestrator/policy.yaml
1565
1642
  gates: agentic/orchestrator/gates-project-a.yaml
1566
- dashboard_port: 3001 # override
1643
+ dashboard_port: 3001 # override
1567
1644
  ```
1568
1645
 
1569
1646
  ---
@@ -1571,6 +1648,7 @@ projects:
1571
1648
  ## 7. Acceptance Criteria (Phase 1 - M29)
1572
1649
 
1573
1650
  ### Dashboard (G1)
1651
+
1574
1652
  - [ ] Dashboard displays features in real-time via SSE
1575
1653
  - [ ] Feature detail page shows state, plan, diff, evidence
1576
1654
  - [ ] Diff viewer renders syntax-highlighted diffs
@@ -1581,18 +1659,21 @@ projects:
1581
1659
  - [ ] Checkout safety: blocked when no worktree/branch or repo has conflicts
1582
1660
 
1583
1661
  ### Notifications (G2)
1662
+
1584
1663
  - [ ] Desktop notification on gate failure (macOS/Linux)
1585
1664
  - [ ] Slack webhook receives formatted messages with links
1586
1665
  - [ ] Notification config validated on startup
1587
1666
  - [ ] Notification failures logged but do not crash orchestrator
1588
1667
 
1589
1668
  ### Init Wizard (G3)
1669
+
1590
1670
  - [ ] Wizard detects git repo and parses remote URL
1591
1671
  - [ ] Generated config files pass schema validation
1592
1672
  - [ ] Template selection generates correct gates.yaml for test framework
1593
1673
  - [ ] Wizard handles non-git directories gracefully
1594
1674
 
1595
1675
  ### Multi-Project (G4)
1676
+
1596
1677
  - [ ] Multi-project config validates against schema
1597
1678
  - [ ] `--project` flag selects correct project
1598
1679
  - [ ] Run leases isolated per project (parallel safe)
@@ -1603,6 +1684,7 @@ projects:
1603
1684
  ## 8. Non-Goals
1604
1685
 
1605
1686
  **Features explicitly excluded from this spec:**
1687
+
1606
1688
  1. **Auto-merge on green CI** — Conflicts with explicit merge control. AOP requires human approval before merge.
1607
1689
  2. **Plugin system** — Conflicts with deterministic kernel design. Provider abstraction + MCP tool registry provide sufficient extensibility.
1608
1690
  3. **K8s/SSH runtimes** — MCP transport abstraction already supports remote MCP servers for distributed execution.
@@ -1611,6 +1693,7 @@ projects:
1611
1693
  6. **Meta-agent orchestration pattern** — Composio's approach (AI agent as orchestrator using CLI) is innovative but trades determinism for flexibility. AOP's code-driven supervisor provides stronger guarantees. Noted as architectural divergence, not a gap.
1612
1694
 
1613
1695
  **Revised from v1.1:**
1696
+
1614
1697
  - **Review comment auto-handling (G7)** — PROMOTED from Non-Goal to P1. Pragmatic implementation (forward review comments to agent) is compatible with AOP's review model. Subsumed into G6e (PR Lifecycle Integration).
1615
1698
 
1616
1699
  ---
@@ -1620,12 +1703,14 @@ projects:
1620
1703
  ### 9.1 Backward Compatibility
1621
1704
 
1622
1705
  **Existing Features Unaffected:**
1706
+
1623
1707
  - All core MCP tools remain unchanged
1624
1708
  - Existing CLI commands (`run`, `status`, `resume`, `delete`) backward compatible
1625
1709
  - Existing config files work without changes (new fields optional)
1626
1710
  - Feature state/plan/index schemas unchanged
1627
1711
 
1628
1712
  **New Features Opt-In:**
1713
+
1629
1714
  - Dashboard: Launch via `aop dashboard` (opt-in)
1630
1715
  - Notifications: Disabled by default; enable in policy.yaml
1631
1716
  - Reactions: Disabled by default; enable in policy.yaml
@@ -1636,6 +1721,7 @@ projects:
1636
1721
  **No deprecations in M29-M31.**
1637
1722
 
1638
1723
  Future consideration (M32+):
1724
+
1639
1725
  - Deprecate `--transport mcp` in favor of remote MCP server URLs
1640
1726
  - Deprecate in-process transport in favor of local MCP server
1641
1727
 
@@ -1646,17 +1732,20 @@ Future consideration (M32+):
1646
1732
  ### 10.1 Quantitative Metrics
1647
1733
 
1648
1734
  **M29 (Phase 1):**
1735
+
1649
1736
  - Dashboard page load < 2s
1650
1737
  - SSE event latency < 2s (file change → UI update)
1651
1738
  - `aop init` completion time < 60s
1652
1739
  - Notification delivery latency < 5s
1653
1740
 
1654
1741
  **M30 (Phase 2):**
1742
+
1655
1743
  - Retry success rate > 60% (gate failures auto-resolved)
1656
1744
  - Escalation rate < 20% (most failures resolved before human intervention)
1657
1745
  - `aop send` message delivery < 1s
1658
1746
 
1659
1747
  **M31 (Phase 3):**
1748
+
1660
1749
  - Multi-project config validation time < 5s
1661
1750
  - Issue tracker sync latency < 10s
1662
1751
  - Multi-instance run lease acquisition < 1s
@@ -1664,11 +1753,13 @@ Future consideration (M32+):
1664
1753
  ### 10.2 Qualitative Metrics
1665
1754
 
1666
1755
  **User Experience:**
1756
+
1667
1757
  - Dashboard intuitive for first-time users (user testing)
1668
1758
  - Init wizard reduces setup time from 30min → 5min
1669
1759
  - Notifications reduce "poll for status" behavior
1670
1760
 
1671
1761
  **Operational Excellence:**
1762
+
1672
1763
  - Auto-remediation reduces manual intervention by 50%
1673
1764
  - Multi-project support enables single-dashboard management
1674
1765
  - Session commands reduce workflow restarts by 70%
@@ -1680,32 +1771,39 @@ Future consideration (M32+):
1680
1771
  ### 11.1 Technical Risks
1681
1772
 
1682
1773
  **Risk 1: SSE Scalability**
1774
+
1683
1775
  - **Impact:** Dashboard becomes unresponsive with >10 features
1684
1776
  - **Mitigation:** Implement event batching, debounce updates, connection pooling
1685
1777
 
1686
1778
  **Risk 2: Provider API Changes**
1779
+
1687
1780
  - **Impact:** `aop send` / `aop attach` break when Claude/Codex updates
1688
1781
  - **Mitigation:** Version provider interface, graceful fallback, release notes monitoring
1689
1782
 
1690
1783
  **Risk 3: Notification Delivery Failures**
1784
+
1691
1785
  - **Impact:** Critical alerts lost (gate failures, collisions)
1692
1786
  - **Mitigation:** Log all notification attempts, retry failed deliveries, fallback to desktop
1693
1787
 
1694
1788
  **Risk 4: Multi-Project Config Complexity**
1789
+
1695
1790
  - **Impact:** Users misconfigure run leases → orchestrator conflicts
1696
1791
  - **Mitigation:** Schema validation, init wizard guidance, clear error messages
1697
1792
 
1698
1793
  ### 11.2 Operational Risks
1699
1794
 
1700
1795
  **Risk 1: Dashboard Security**
1796
+
1701
1797
  - **Impact:** Unauthorized access to feature diffs, evidence
1702
1798
  - **Mitigation:** Add API key auth (P2), limit to localhost by default
1703
1799
 
1704
1800
  **Risk 2: Retry Loop Abuse**
1801
+
1705
1802
  - **Impact:** Infinite retry loops consume resources
1706
1803
  - **Mitigation:** Hard cap on retries (max 5), exponential backoff, manual override required
1707
1804
 
1708
1805
  **Risk 3: Slack Webhook Rate Limits**
1806
+
1709
1807
  - **Impact:** Notifications dropped during high activity
1710
1808
  - **Mitigation:** Implement rate limiting, batch notifications, queue overflow alerts
1711
1809
 
@@ -1753,6 +1851,7 @@ This specification (v2.0) significantly expands the gap analysis based on a deep
1753
1851
  **Phase 3 (M31)** integrates with external ecosystems (issue trackers, multi-instance isolation, cost tracking, dependency scheduling) for enterprise workflows.
1754
1852
 
1755
1853
  **Key Principles:**
1854
+
1756
1855
  1. Every new feature is opt-in, backward compatible, and does not compromise deterministic guarantees or explicit merge control.
1757
1856
  2. AOP's code-driven supervisor is an intentional architectural choice, not a gap. Meta-agent orchestration (Composio's pattern) trades determinism for flexibility — AOP chooses determinism.
1758
1857
  3. Novel features (N1-N5) represent competitive differentiation opportunities that neither package currently offers.