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.
- package/.prettierignore +10 -0
- package/.prettierrc.json +24 -0
- package/CLAUDE.md +3 -2
- package/README.md +71 -48
- package/agentic/orchestrator/defaults/policy.defaults.yaml +1 -1
- package/agentic/orchestrator/prompts/planner.system.md +1 -0
- package/agentic/orchestrator/schemas/agents.schema.json +5 -22
- package/agentic/orchestrator/schemas/gates.schema.json +4 -19
- package/agentic/orchestrator/schemas/index.schema.json +3 -14
- package/agentic/orchestrator/schemas/multi-project.schema.json +2 -8
- package/agentic/orchestrator/schemas/plan.schema.json +6 -26
- package/agentic/orchestrator/schemas/policy.schema.json +19 -81
- package/agentic/orchestrator/schemas/policy.user.schema.json +1 -5
- package/agentic/orchestrator/schemas/qa_test_index.schema.json +5 -29
- package/agentic/orchestrator/schemas/state.schema.json +11 -61
- package/agentic/orchestrator/tools/catalog.json +33 -164
- package/agentic/orchestrator/tools/schemas/input/evidence.latest.input.schema.json +1 -3
- package/agentic/orchestrator/tools/schemas/input/feature.delete.input.schema.json +1 -5
- package/agentic/orchestrator/tools/schemas/input/feature.get_context.input.schema.json +1 -3
- package/agentic/orchestrator/tools/schemas/input/feature.init.input.schema.json +1 -4
- package/agentic/orchestrator/tools/schemas/input/feature.log_append.input.schema.json +1 -5
- package/agentic/orchestrator/tools/schemas/input/feature.ready_to_merge.input.schema.json +1 -6
- package/agentic/orchestrator/tools/schemas/input/feature.state_get.input.schema.json +1 -3
- package/agentic/orchestrator/tools/schemas/input/feature.state_patch.input.schema.json +1 -5
- package/agentic/orchestrator/tools/schemas/input/gates.run.input.schema.json +1 -5
- package/agentic/orchestrator/tools/schemas/input/locks.acquire.input.schema.json +1 -5
- package/agentic/orchestrator/tools/schemas/input/locks.release.input.schema.json +1 -5
- package/agentic/orchestrator/tools/schemas/input/performance.record_outcome.input.schema.json +10 -1
- package/agentic/orchestrator/tools/schemas/input/plan.get.input.schema.json +1 -3
- package/agentic/orchestrator/tools/schemas/input/plan.submit.input.schema.json +1 -5
- package/agentic/orchestrator/tools/schemas/input/plan.update.input.schema.json +1 -6
- package/agentic/orchestrator/tools/schemas/input/qa.test_index_get.input.schema.json +1 -3
- package/agentic/orchestrator/tools/schemas/input/qa.test_index_update.input.schema.json +1 -6
- package/agentic/orchestrator/tools/schemas/input/repo.apply_patch.input.schema.json +1 -5
- package/agentic/orchestrator/tools/schemas/input/repo.diff.input.schema.json +1 -3
- package/agentic/orchestrator/tools/schemas/input/repo.diff_bundle.input.schema.json +1 -3
- package/agentic/orchestrator/tools/schemas/input/repo.ensure_worktree.input.schema.json +1 -4
- package/agentic/orchestrator/tools/schemas/input/repo.read_file.input.schema.json +1 -4
- package/agentic/orchestrator/tools/schemas/input/repo.search.input.schema.json +1 -4
- package/agentic/orchestrator/tools/schemas/input/repo.status.input.schema.json +1 -3
- package/agentic/orchestrator/tools/schemas/input/report.feature_summary.input.schema.json +1 -3
- package/agentic/orchestrator/tools/schemas/output/collisions.scan.output.schema.json +1 -3
- package/agentic/orchestrator/tools/schemas/output/evidence.latest.output.schema.json +1 -4
- package/agentic/orchestrator/tools/schemas/output/feature.delete.output.schema.json +4 -20
- package/agentic/orchestrator/tools/schemas/output/feature.discover_specs.output.schema.json +2 -7
- package/agentic/orchestrator/tools/schemas/output/feature.get_context.output.schema.json +1 -8
- package/agentic/orchestrator/tools/schemas/output/feature.init.output.schema.json +1 -5
- package/agentic/orchestrator/tools/schemas/output/feature.log_append.output.schema.json +1 -5
- package/agentic/orchestrator/tools/schemas/output/feature.ready_to_merge.output.schema.json +1 -6
- package/agentic/orchestrator/tools/schemas/output/feature.state_get.output.schema.json +1 -4
- package/agentic/orchestrator/tools/schemas/output/feature.state_patch.output.schema.json +1 -5
- package/agentic/orchestrator/tools/schemas/output/gates.list.output.schema.json +2 -7
- package/agentic/orchestrator/tools/schemas/output/gates.run.output.schema.json +1 -8
- package/agentic/orchestrator/tools/schemas/output/locks.acquire.output.schema.json +1 -7
- package/agentic/orchestrator/tools/schemas/output/locks.release.output.schema.json +1 -5
- package/agentic/orchestrator/tools/schemas/output/performance.get_analytics.output.schema.json +22 -2
- package/agentic/orchestrator/tools/schemas/output/plan.get.output.schema.json +1 -4
- package/agentic/orchestrator/tools/schemas/output/plan.submit.output.schema.json +1 -5
- package/agentic/orchestrator/tools/schemas/output/plan.update.output.schema.json +1 -5
- package/agentic/orchestrator/tools/schemas/output/qa.test_index_get.output.schema.json +1 -5
- package/agentic/orchestrator/tools/schemas/output/qa.test_index_update.output.schema.json +1 -4
- package/agentic/orchestrator/tools/schemas/output/repo.apply_patch.output.schema.json +1 -6
- package/agentic/orchestrator/tools/schemas/output/repo.diff.output.schema.json +1 -4
- package/agentic/orchestrator/tools/schemas/output/repo.diff_bundle.output.schema.json +1 -7
- package/agentic/orchestrator/tools/schemas/output/repo.ensure_worktree.output.schema.json +1 -6
- package/agentic/orchestrator/tools/schemas/output/repo.read_file.output.schema.json +1 -5
- package/agentic/orchestrator/tools/schemas/output/repo.search.output.schema.json +1 -5
- package/agentic/orchestrator/tools/schemas/output/repo.status.output.schema.json +1 -5
- package/agentic/orchestrator/tools/schemas/output/report.dashboard.output.schema.json +1 -4
- package/apps/control-plane/scripts/validate-architecture-rules.mjs +16 -5
- package/apps/control-plane/scripts/validate-docker-mcp-contract.mjs +30 -8
- package/apps/control-plane/scripts/validate-mcp-contracts.ts +13 -7
- package/apps/control-plane/src/application/adapters/adapter-registry.ts +35 -15
- package/apps/control-plane/src/application/multi-project-loader.ts +27 -10
- package/apps/control-plane/src/application/services/activity-monitor-service.ts +26 -14
- package/apps/control-plane/src/application/services/collision-queue-service.ts +31 -17
- package/apps/control-plane/src/application/services/cost-tracking-service.ts +23 -16
- package/apps/control-plane/src/application/services/dependency-scheduler-service.ts +12 -4
- package/apps/control-plane/src/application/services/feature-deletion-service.ts +94 -58
- package/apps/control-plane/src/application/services/feature-lifecycle-service.ts +19 -13
- package/apps/control-plane/src/application/services/feature-state-service.ts +29 -19
- package/apps/control-plane/src/application/services/gate-interpolation-service.ts +7 -2
- package/apps/control-plane/src/application/services/gate-service.ts +64 -41
- package/apps/control-plane/src/application/services/instance-isolation-service.ts +1 -1
- package/apps/control-plane/src/application/services/issue-tracker-service.ts +49 -38
- package/apps/control-plane/src/application/services/lock-service.ts +75 -49
- package/apps/control-plane/src/application/services/merge-service.ts +91 -50
- package/apps/control-plane/src/application/services/notifier-service.ts +42 -20
- package/apps/control-plane/src/application/services/patch-service.ts +73 -44
- package/apps/control-plane/src/application/services/performance-analytics-service.ts +8 -6
- package/apps/control-plane/src/application/services/plan-service.ts +148 -89
- package/apps/control-plane/src/application/services/policy-loader-service.ts +10 -4
- package/apps/control-plane/src/application/services/pr-monitor-service.ts +33 -14
- package/apps/control-plane/src/application/services/qa-index-service.ts +20 -16
- package/apps/control-plane/src/application/services/reactions-service.ts +30 -15
- package/apps/control-plane/src/application/services/reporting-service.ts +16 -12
- package/apps/control-plane/src/application/services/run-lease-service.ts +138 -81
- package/apps/control-plane/src/application/tools/tool-metadata.ts +5 -5
- package/apps/control-plane/src/application/tools/tool-router.ts +6 -3
- package/apps/control-plane/src/cli/aop.ts +2 -2
- package/apps/control-plane/src/cli/attach-command-handler.ts +9 -9
- package/apps/control-plane/src/cli/cleanup-command-handler.ts +16 -11
- package/apps/control-plane/src/cli/cli-argument-parser.ts +6 -3
- package/apps/control-plane/src/cli/dashboard-command-handler.ts +28 -8
- package/apps/control-plane/src/cli/delete-command-handler.ts +7 -7
- package/apps/control-plane/src/cli/env-file.ts +115 -0
- package/apps/control-plane/src/cli/help-command-handler.ts +61 -32
- package/apps/control-plane/src/cli/init-command-handler.ts +182 -56
- package/apps/control-plane/src/cli/io.ts +7 -3
- package/apps/control-plane/src/cli/resume-command-handler.ts +21 -13
- package/apps/control-plane/src/cli/retry-command-handler.ts +12 -11
- package/apps/control-plane/src/cli/run-command-handler.ts +12 -8
- package/apps/control-plane/src/cli/send-command-handler.ts +6 -6
- package/apps/control-plane/src/cli/spec-ingestion-service.ts +14 -8
- package/apps/control-plane/src/cli/spec-input-resolver.ts +6 -1
- package/apps/control-plane/src/cli/spec-utils.ts +2 -2
- package/apps/control-plane/src/cli/status-command-handler.ts +13 -12
- package/apps/control-plane/src/cli/tooling.ts +3 -3
- package/apps/control-plane/src/cli/types.ts +1 -1
- package/apps/control-plane/src/core/collisions.ts +27 -10
- package/apps/control-plane/src/core/constants.ts +13 -7
- package/apps/control-plane/src/core/error-codes.ts +1 -1
- package/apps/control-plane/src/core/fs.ts +11 -5
- package/apps/control-plane/src/core/gates.ts +53 -27
- package/apps/control-plane/src/core/git.ts +18 -6
- package/apps/control-plane/src/core/kernel.ts +513 -227
- package/apps/control-plane/src/core/patch.ts +7 -3
- package/apps/control-plane/src/core/path-layout.ts +5 -1
- package/apps/control-plane/src/core/path-rules.ts +19 -5
- package/apps/control-plane/src/core/qa-index.ts +26 -12
- package/apps/control-plane/src/core/response.ts +9 -6
- package/apps/control-plane/src/core/schemas.ts +29 -10
- package/apps/control-plane/src/core/tool-caller.ts +1 -1
- package/apps/control-plane/src/core/workspace-hooks.ts +5 -5
- package/apps/control-plane/src/index.ts +3 -9
- package/apps/control-plane/src/interfaces/cli/bootstrap.ts +79 -35
- package/apps/control-plane/src/mcp/kernel-tool-executor.ts +7 -3
- package/apps/control-plane/src/mcp/mcp-server-adapter.ts +12 -10
- package/apps/control-plane/src/mcp/operation-ledger.ts +18 -8
- package/apps/control-plane/src/mcp/protocol-contract.ts +2 -2
- package/apps/control-plane/src/mcp/runtime-factory.ts +15 -6
- package/apps/control-plane/src/mcp/token-auth-verifier.ts +3 -2
- package/apps/control-plane/src/mcp/token-claims-validator.ts +11 -7
- package/apps/control-plane/src/mcp/tool-authorizer.ts +1 -3
- package/apps/control-plane/src/mcp/tool-client.ts +17 -5
- package/apps/control-plane/src/mcp/tool-contract-validator.ts +17 -8
- package/apps/control-plane/src/mcp/tool-registry-loader.ts +7 -3
- package/apps/control-plane/src/mcp/tool-runtime.ts +66 -39
- package/apps/control-plane/src/mcp/tools-markdown-generator.ts +6 -1
- package/apps/control-plane/src/providers/providers.ts +137 -54
- package/apps/control-plane/src/supervisor/build-wave-executor.ts +44 -25
- package/apps/control-plane/src/supervisor/planning-wave-executor.ts +46 -33
- package/apps/control-plane/src/supervisor/prompt-bundle-loader.ts +1 -1
- package/apps/control-plane/src/supervisor/qa-wave-executor.ts +38 -23
- package/apps/control-plane/src/supervisor/run-coordinator.ts +71 -36
- package/apps/control-plane/src/supervisor/runtime.ts +59 -35
- package/apps/control-plane/src/supervisor/session-orchestrator.ts +48 -31
- package/apps/control-plane/src/supervisor/types.ts +22 -7
- package/apps/control-plane/src/supervisor/worker-decision-loop.ts +30 -20
- package/apps/control-plane/test/activity-monitor.spec.ts +54 -30
- package/apps/control-plane/test/adapter-registry.spec.ts +5 -5
- package/apps/control-plane/test/aop.spec.ts +4 -4
- package/apps/control-plane/test/batch-operations.spec.ts +20 -18
- package/apps/control-plane/test/bootstrap-attach.spec.ts +52 -19
- package/apps/control-plane/test/bootstrap-edge-cases.spec.ts +58 -27
- package/apps/control-plane/test/bootstrap.spec.ts +72 -40
- package/apps/control-plane/test/cleanup-command.spec.ts +86 -32
- package/apps/control-plane/test/cli-helpers.spec.ts +119 -66
- package/apps/control-plane/test/cli.spec.ts +1 -1
- package/apps/control-plane/test/cli.unit.spec.ts +226 -167
- package/apps/control-plane/test/collision-queue.spec.ts +49 -40
- package/apps/control-plane/test/collisions.spec.ts +30 -30
- package/apps/control-plane/test/core-utils.spec.ts +29 -15
- package/apps/control-plane/test/cost-tracking.spec.ts +38 -22
- package/apps/control-plane/test/dashboard-api.integration.spec.ts +68 -36
- package/apps/control-plane/test/dashboard-client.spec.ts +18 -12
- package/apps/control-plane/test/dashboard-command.spec.ts +11 -7
- package/apps/control-plane/test/delete-command-handler.spec.ts +49 -41
- package/apps/control-plane/test/dependency-scheduler.spec.ts +47 -20
- package/apps/control-plane/test/epoch-tracking.spec.ts +9 -9
- package/apps/control-plane/test/feature-deletion-service.spec.ts +60 -52
- package/apps/control-plane/test/feature-lifecycle.spec.ts +36 -17
- package/apps/control-plane/test/gates.spec.ts +101 -81
- package/apps/control-plane/test/git-spawn-error.spec.ts +1 -1
- package/apps/control-plane/test/helpers.ts +10 -6
- package/apps/control-plane/test/incremental-gates.spec.ts +59 -20
- package/apps/control-plane/test/init-wizard.spec.ts +328 -68
- package/apps/control-plane/test/instance-isolation.spec.ts +43 -10
- package/apps/control-plane/test/issue-tracker.spec.ts +368 -128
- package/apps/control-plane/test/kernel-collision-replay.spec.ts +50 -29
- package/apps/control-plane/test/kernel.branches.spec.ts +64 -40
- package/apps/control-plane/test/kernel.coverage.spec.ts +85 -49
- package/apps/control-plane/test/kernel.coverage2.spec.ts +109 -65
- package/apps/control-plane/test/kernel.spec.ts +134 -51
- package/apps/control-plane/test/lock-service.spec.ts +92 -68
- package/apps/control-plane/test/mcp-helpers.spec.ts +53 -39
- package/apps/control-plane/test/mcp.spec.ts +231 -115
- package/apps/control-plane/test/merge-service.spec.ts +142 -94
- package/apps/control-plane/test/multi-project.spec.ts +28 -22
- package/apps/control-plane/test/notifier-service.spec.ts +136 -92
- package/apps/control-plane/test/parallel-gates.spec.ts +51 -35
- package/apps/control-plane/test/patch-service.spec.ts +128 -48
- package/apps/control-plane/test/performance-analytics.spec.ts +99 -63
- package/apps/control-plane/test/plan-service.spec.ts +50 -39
- package/apps/control-plane/test/planning-wave-executor.spec.ts +95 -71
- package/apps/control-plane/test/policy-loader-service.spec.ts +41 -19
- package/apps/control-plane/test/pr-monitor.spec.ts +113 -64
- package/apps/control-plane/test/providers.spec.ts +208 -104
- package/apps/control-plane/test/qa-index-service.spec.ts +31 -33
- package/apps/control-plane/test/qa-index.spec.ts +58 -61
- package/apps/control-plane/test/reactions.spec.ts +88 -45
- package/apps/control-plane/test/response.spec.ts +5 -5
- package/apps/control-plane/test/resume-command.spec.ts +121 -80
- package/apps/control-plane/test/run-coordinator.spec.ts +205 -136
- package/apps/control-plane/test/schema-date-time.spec.ts +49 -41
- package/apps/control-plane/test/service-retry-paths.spec.ts +77 -57
- package/apps/control-plane/test/services.spec.ts +147 -129
- package/apps/control-plane/test/session-management.spec.ts +136 -74
- package/apps/control-plane/test/spec-ingestion.spec.ts +23 -21
- package/apps/control-plane/test/spec-input-resolver.spec.ts +11 -10
- package/apps/control-plane/test/supervisor-collaborators.spec.ts +168 -121
- package/apps/control-plane/test/supervisor.calltool.spec.ts +21 -18
- package/apps/control-plane/test/supervisor.spec.ts +67 -43
- package/apps/control-plane/test/supervisor.unit.spec.ts +195 -126
- package/apps/control-plane/test/token-auth-verifier.spec.ts +29 -14
- package/apps/control-plane/test/tool-registry-loader.spec.ts +51 -27
- package/apps/control-plane/test/tool-runtime.spec.ts +63 -46
- package/apps/control-plane/test/worker-decision-loop.spec.ts +143 -122
- package/apps/control-plane/test/workspace-hooks.spec.ts +61 -23
- package/apps/control-plane/tsconfig.build.json +2 -7
- package/apps/control-plane/tsconfig.json +1 -5
- package/apps/control-plane/vitest.config.ts +7 -7
- package/config/agentic/orchestrator/adapters.yaml +3 -0
- package/config/agentic/orchestrator/agents.yaml +14 -0
- package/config/agentic/orchestrator/gates.yaml +28 -0
- package/config/agentic/orchestrator/policy.yaml +22 -0
- package/config/agentic/orchestrator/prompts/builder.system.md +1 -0
- package/config/agentic/orchestrator/prompts/planner.system.md +16 -0
- package/config/agentic/orchestrator/prompts/qa.system.md +1 -0
- package/dist/apps/control-plane/application/adapters/adapter-registry.js +12 -5
- package/dist/apps/control-plane/application/adapters/adapter-registry.js.map +1 -1
- package/dist/apps/control-plane/application/multi-project-loader.js +26 -9
- package/dist/apps/control-plane/application/multi-project-loader.js.map +1 -1
- package/dist/apps/control-plane/application/services/activity-monitor-service.js +7 -7
- package/dist/apps/control-plane/application/services/activity-monitor-service.js.map +1 -1
- package/dist/apps/control-plane/application/services/collision-queue-service.js +7 -7
- package/dist/apps/control-plane/application/services/collision-queue-service.js.map +1 -1
- package/dist/apps/control-plane/application/services/cost-tracking-service.js +6 -8
- package/dist/apps/control-plane/application/services/cost-tracking-service.js.map +1 -1
- package/dist/apps/control-plane/application/services/dependency-scheduler-service.js.map +1 -1
- package/dist/apps/control-plane/application/services/feature-deletion-service.js +37 -29
- package/dist/apps/control-plane/application/services/feature-deletion-service.js.map +1 -1
- package/dist/apps/control-plane/application/services/feature-lifecycle-service.js +10 -10
- package/dist/apps/control-plane/application/services/feature-lifecycle-service.js.map +1 -1
- package/dist/apps/control-plane/application/services/feature-state-service.js +11 -11
- package/dist/apps/control-plane/application/services/feature-state-service.js.map +1 -1
- package/dist/apps/control-plane/application/services/gate-interpolation-service.js +3 -1
- package/dist/apps/control-plane/application/services/gate-interpolation-service.js.map +1 -1
- package/dist/apps/control-plane/application/services/gate-service.js +26 -26
- package/dist/apps/control-plane/application/services/gate-service.js.map +1 -1
- package/dist/apps/control-plane/application/services/instance-isolation-service.js +1 -1
- package/dist/apps/control-plane/application/services/instance-isolation-service.js.map +1 -1
- package/dist/apps/control-plane/application/services/issue-tracker-service.js +25 -15
- package/dist/apps/control-plane/application/services/issue-tracker-service.js.map +1 -1
- package/dist/apps/control-plane/application/services/lock-service.js +32 -32
- package/dist/apps/control-plane/application/services/lock-service.js.map +1 -1
- package/dist/apps/control-plane/application/services/merge-service.js +41 -27
- package/dist/apps/control-plane/application/services/merge-service.js.map +1 -1
- package/dist/apps/control-plane/application/services/notifier-service.js +29 -15
- package/dist/apps/control-plane/application/services/notifier-service.js.map +1 -1
- package/dist/apps/control-plane/application/services/patch-service.js +21 -19
- package/dist/apps/control-plane/application/services/patch-service.js.map +1 -1
- package/dist/apps/control-plane/application/services/performance-analytics-service.js +4 -4
- package/dist/apps/control-plane/application/services/performance-analytics-service.js.map +1 -1
- package/dist/apps/control-plane/application/services/plan-service.js +33 -33
- package/dist/apps/control-plane/application/services/plan-service.js.map +1 -1
- package/dist/apps/control-plane/application/services/policy-loader-service.js.map +1 -1
- package/dist/apps/control-plane/application/services/pr-monitor-service.js +23 -11
- package/dist/apps/control-plane/application/services/pr-monitor-service.js.map +1 -1
- package/dist/apps/control-plane/application/services/qa-index-service.js +11 -11
- package/dist/apps/control-plane/application/services/qa-index-service.js.map +1 -1
- package/dist/apps/control-plane/application/services/reactions-service.js +13 -9
- package/dist/apps/control-plane/application/services/reactions-service.js.map +1 -1
- package/dist/apps/control-plane/application/services/reporting-service.js +11 -9
- package/dist/apps/control-plane/application/services/reporting-service.js.map +1 -1
- package/dist/apps/control-plane/application/services/run-lease-service.js +34 -33
- package/dist/apps/control-plane/application/services/run-lease-service.js.map +1 -1
- package/dist/apps/control-plane/application/tools/tool-metadata.js +2 -2
- package/dist/apps/control-plane/application/tools/tool-router.js.map +1 -1
- package/dist/apps/control-plane/cli/attach-command-handler.js +9 -9
- package/dist/apps/control-plane/cli/cleanup-command-handler.js +11 -9
- package/dist/apps/control-plane/cli/cleanup-command-handler.js.map +1 -1
- package/dist/apps/control-plane/cli/cli-argument-parser.js +4 -3
- package/dist/apps/control-plane/cli/cli-argument-parser.js.map +1 -1
- package/dist/apps/control-plane/cli/dashboard-command-handler.js +23 -7
- package/dist/apps/control-plane/cli/dashboard-command-handler.js.map +1 -1
- package/dist/apps/control-plane/cli/delete-command-handler.js +7 -7
- package/dist/apps/control-plane/cli/env-file.d.ts +4 -0
- package/dist/apps/control-plane/cli/env-file.js +89 -0
- package/dist/apps/control-plane/cli/env-file.js.map +1 -0
- package/dist/apps/control-plane/cli/help-command-handler.js +58 -30
- package/dist/apps/control-plane/cli/help-command-handler.js.map +1 -1
- package/dist/apps/control-plane/cli/init-command-handler.js +97 -37
- package/dist/apps/control-plane/cli/init-command-handler.js.map +1 -1
- package/dist/apps/control-plane/cli/io.js +2 -2
- package/dist/apps/control-plane/cli/io.js.map +1 -1
- package/dist/apps/control-plane/cli/resume-command-handler.js +9 -9
- package/dist/apps/control-plane/cli/resume-command-handler.js.map +1 -1
- package/dist/apps/control-plane/cli/retry-command-handler.js +12 -11
- package/dist/apps/control-plane/cli/retry-command-handler.js.map +1 -1
- package/dist/apps/control-plane/cli/run-command-handler.js +12 -8
- package/dist/apps/control-plane/cli/run-command-handler.js.map +1 -1
- package/dist/apps/control-plane/cli/send-command-handler.js +6 -6
- package/dist/apps/control-plane/cli/spec-ingestion-service.js +10 -8
- package/dist/apps/control-plane/cli/spec-ingestion-service.js.map +1 -1
- package/dist/apps/control-plane/cli/spec-input-resolver.js.map +1 -1
- package/dist/apps/control-plane/cli/spec-utils.js.map +1 -1
- package/dist/apps/control-plane/cli/status-command-handler.js +8 -8
- package/dist/apps/control-plane/cli/status-command-handler.js.map +1 -1
- package/dist/apps/control-plane/cli/tooling.js +1 -1
- package/dist/apps/control-plane/core/collisions.js +11 -8
- package/dist/apps/control-plane/core/collisions.js.map +1 -1
- package/dist/apps/control-plane/core/constants.js +13 -7
- package/dist/apps/control-plane/core/constants.js.map +1 -1
- package/dist/apps/control-plane/core/error-codes.js +1 -1
- package/dist/apps/control-plane/core/fs.js.map +1 -1
- package/dist/apps/control-plane/core/gates.d.ts +2 -2
- package/dist/apps/control-plane/core/gates.js +26 -19
- package/dist/apps/control-plane/core/gates.js.map +1 -1
- package/dist/apps/control-plane/core/git.js +3 -3
- package/dist/apps/control-plane/core/git.js.map +1 -1
- package/dist/apps/control-plane/core/kernel.d.ts +1 -0
- package/dist/apps/control-plane/core/kernel.js +134 -81
- package/dist/apps/control-plane/core/kernel.js.map +1 -1
- package/dist/apps/control-plane/core/patch.js +7 -3
- package/dist/apps/control-plane/core/patch.js.map +1 -1
- package/dist/apps/control-plane/core/path-layout.d.ts +1 -0
- package/dist/apps/control-plane/core/path-layout.js +4 -1
- package/dist/apps/control-plane/core/path-layout.js.map +1 -1
- package/dist/apps/control-plane/core/path-rules.js +3 -1
- package/dist/apps/control-plane/core/path-rules.js.map +1 -1
- package/dist/apps/control-plane/core/qa-index.js +5 -5
- package/dist/apps/control-plane/core/qa-index.js.map +1 -1
- package/dist/apps/control-plane/core/response.js +3 -3
- package/dist/apps/control-plane/core/response.js.map +1 -1
- package/dist/apps/control-plane/core/schemas.js +10 -6
- package/dist/apps/control-plane/core/schemas.js.map +1 -1
- package/dist/apps/control-plane/core/workspace-hooks.js +3 -3
- package/dist/apps/control-plane/index.d.ts +1 -1
- package/dist/apps/control-plane/index.js +1 -1
- package/dist/apps/control-plane/index.js.map +1 -1
- package/dist/apps/control-plane/interfaces/cli/bootstrap.js +40 -23
- package/dist/apps/control-plane/interfaces/cli/bootstrap.js.map +1 -1
- package/dist/apps/control-plane/mcp/kernel-tool-executor.js +1 -1
- package/dist/apps/control-plane/mcp/kernel-tool-executor.js.map +1 -1
- package/dist/apps/control-plane/mcp/mcp-server-adapter.js +6 -7
- package/dist/apps/control-plane/mcp/mcp-server-adapter.js.map +1 -1
- package/dist/apps/control-plane/mcp/operation-ledger.js +5 -5
- package/dist/apps/control-plane/mcp/operation-ledger.js.map +1 -1
- package/dist/apps/control-plane/mcp/protocol-contract.js +2 -2
- package/dist/apps/control-plane/mcp/runtime-factory.js +2 -2
- package/dist/apps/control-plane/mcp/runtime-factory.js.map +1 -1
- package/dist/apps/control-plane/mcp/token-auth-verifier.js +1 -1
- package/dist/apps/control-plane/mcp/token-auth-verifier.js.map +1 -1
- package/dist/apps/control-plane/mcp/token-claims-validator.js +5 -5
- package/dist/apps/control-plane/mcp/token-claims-validator.js.map +1 -1
- package/dist/apps/control-plane/mcp/tool-authorizer.js +1 -3
- package/dist/apps/control-plane/mcp/tool-authorizer.js.map +1 -1
- package/dist/apps/control-plane/mcp/tool-client.js +2 -2
- package/dist/apps/control-plane/mcp/tool-client.js.map +1 -1
- package/dist/apps/control-plane/mcp/tool-contract-validator.js +3 -3
- package/dist/apps/control-plane/mcp/tool-contract-validator.js.map +1 -1
- package/dist/apps/control-plane/mcp/tool-registry-loader.js +1 -1
- package/dist/apps/control-plane/mcp/tool-registry-loader.js.map +1 -1
- package/dist/apps/control-plane/mcp/tool-runtime.js +17 -17
- package/dist/apps/control-plane/mcp/tool-runtime.js.map +1 -1
- package/dist/apps/control-plane/mcp/tools-markdown-generator.js +6 -1
- package/dist/apps/control-plane/mcp/tools-markdown-generator.js.map +1 -1
- package/dist/apps/control-plane/providers/providers.d.ts +3 -2
- package/dist/apps/control-plane/providers/providers.js +81 -39
- package/dist/apps/control-plane/providers/providers.js.map +1 -1
- package/dist/apps/control-plane/supervisor/build-wave-executor.js +12 -12
- package/dist/apps/control-plane/supervisor/build-wave-executor.js.map +1 -1
- package/dist/apps/control-plane/supervisor/planning-wave-executor.js +19 -16
- package/dist/apps/control-plane/supervisor/planning-wave-executor.js.map +1 -1
- package/dist/apps/control-plane/supervisor/prompt-bundle-loader.js +1 -1
- package/dist/apps/control-plane/supervisor/qa-wave-executor.js +13 -13
- package/dist/apps/control-plane/supervisor/qa-wave-executor.js.map +1 -1
- package/dist/apps/control-plane/supervisor/run-coordinator.js +37 -20
- package/dist/apps/control-plane/supervisor/run-coordinator.js.map +1 -1
- package/dist/apps/control-plane/supervisor/runtime.js +25 -21
- package/dist/apps/control-plane/supervisor/runtime.js.map +1 -1
- package/dist/apps/control-plane/supervisor/session-orchestrator.js +29 -23
- package/dist/apps/control-plane/supervisor/session-orchestrator.js.map +1 -1
- package/dist/apps/control-plane/supervisor/types.d.ts +3 -3
- package/dist/apps/control-plane/supervisor/types.js.map +1 -1
- package/dist/apps/control-plane/supervisor/worker-decision-loop.js +14 -16
- package/dist/apps/control-plane/supervisor/worker-decision-loop.js.map +1 -1
- package/eslint.config.mjs +20 -20
- package/example-configurations/README.md +1 -1
- package/example-configurations/java/agents.yaml +3 -3
- package/example-configurations/java/policy.yaml +1 -1
- package/example-configurations/node/agents.yaml +3 -3
- package/example-configurations/node/policy.yaml +1 -1
- package/package.json +10 -5
- package/packages/web-dashboard/next.config.js +2 -2
- package/packages/web-dashboard/src/app/api/actions/route.ts +25 -9
- package/packages/web-dashboard/src/app/api/events/route.ts +20 -6
- package/packages/web-dashboard/src/app/api/features/[id]/checkout/route.ts +88 -37
- package/packages/web-dashboard/src/app/api/features/[id]/evidence/[artifact]/route.ts +8 -5
- package/packages/web-dashboard/src/app/api/features/[id]/review/route.ts +27 -9
- package/packages/web-dashboard/src/app/api/features/[id]/route.ts +5 -2
- package/packages/web-dashboard/src/app/api/projects/route.ts +5 -5
- package/packages/web-dashboard/src/app/globals.css +10 -2
- package/packages/web-dashboard/src/app/page.tsx +100 -37
- package/packages/web-dashboard/src/lib/aop-client.ts +68 -37
- package/packages/web-dashboard/src/lib/multi-project-config.ts +28 -7
- package/packages/web-dashboard/src/lib/orchestrator-tools.ts +59 -36
- package/packages/web-dashboard/tsconfig.json +3 -11
- package/scripts/nx-safe.mjs +10 -10
- package/spec-files/completed/agentic_orchestrator_cli_delete_command_spec.md +5 -0
- package/spec-files/completed/agentic_orchestrator_feature_gaps_closure_spec.md +189 -90
- package/spec-files/completed/agentic_orchestrator_init_policy_ux_simplification_spec.md +49 -16
- package/spec-files/completed/agentic_orchestrator_mcp_formalization_spec.md +24 -1
- package/spec-files/completed/agentic_orchestrator_single_global_orchestrator_spec.md +9 -0
- package/spec-files/completed/agentic_orchestrator_spec.md +171 -75
- package/spec-files/completed/agentic_orchestrator_validator_hardening_spec.md +25 -17
- package/spec-files/outstanding/agentic_orchestrator_artifact_database_publishing_spec.md +40 -5
- package/spec-files/outstanding/agentic_orchestrator_enterprise_governance_dashboard_spec.md +23 -12
- package/spec-files/outstanding/agentic_orchestrator_knowledge_canary_spec.md +16 -4
- package/spec-files/outstanding/agentic_orchestrator_observability_integrity_diagnostics_spec.md +42 -2
- package/spec-files/outstanding/agentic_orchestrator_performance_improvements_spec.md +209 -130
- package/spec-files/outstanding/agentic_orchestrator_planning_review_quality_spec.md +56 -3
- package/spec-files/outstanding/agentic_orchestrator_productization_commercial_spec.md +77 -10
- package/spec-files/outstanding/agentic_orchestrator_provider_auth_bootstrap_spec.md +384 -0
- package/spec-files/outstanding/agentic_orchestrator_quality_adoption_execution_spec.md +29 -14
- package/spec-files/progress.md +186 -175
- package/tsconfig.json +2 -8
|
@@ -30,21 +30,26 @@ async function writeFeatureSession(root: string, featureId: string): Promise<voi
|
|
|
30
30
|
[featureId]: {
|
|
31
31
|
planner_session_id: 'planner:1',
|
|
32
32
|
builder_session_id: 'builder:1',
|
|
33
|
-
qa_session_id: 'qa:1'
|
|
34
|
-
}
|
|
33
|
+
qa_session_id: 'qa:1',
|
|
34
|
+
},
|
|
35
35
|
};
|
|
36
36
|
await fs.writeFile(leasePath, `${JSON.stringify(lease, null, 2)}\n`, 'utf8');
|
|
37
37
|
}
|
|
38
38
|
|
|
39
39
|
function makeProvider(overrides: Partial<WorkerProvider> = {}): WorkerProvider {
|
|
40
40
|
return {
|
|
41
|
-
selection: {
|
|
41
|
+
selection: {
|
|
42
|
+
provider: 'null',
|
|
43
|
+
model: 'null-default',
|
|
44
|
+
provider_config_env: null,
|
|
45
|
+
provider_config_ref: null,
|
|
46
|
+
},
|
|
42
47
|
createSession: vi.fn(),
|
|
43
48
|
reattachSession: vi.fn(),
|
|
44
49
|
closeSession: vi.fn(),
|
|
45
50
|
runWorker: vi.fn(),
|
|
46
51
|
sendMessage: vi.fn(async () => undefined),
|
|
47
|
-
...overrides
|
|
52
|
+
...overrides,
|
|
48
53
|
} as unknown as WorkerProvider;
|
|
49
54
|
}
|
|
50
55
|
|
|
@@ -53,7 +58,11 @@ describe('feature.send_message kernel handler', () => {
|
|
|
53
58
|
const kernel = new AopKernel(repoRoot);
|
|
54
59
|
await kernel.ensureLoaded();
|
|
55
60
|
await writeFeatureSpec(repoRoot, 'feature_send_1');
|
|
56
|
-
await kernel.invoke(
|
|
61
|
+
await kernel.invoke(
|
|
62
|
+
'feature.init',
|
|
63
|
+
{ feature_id: 'feature_send_1' },
|
|
64
|
+
{ actor_type: 'orchestrator', actor_id: 'test' },
|
|
65
|
+
);
|
|
57
66
|
await writeFeatureSession(repoRoot, 'feature_send_1');
|
|
58
67
|
|
|
59
68
|
const sendMessageMock = vi.fn(async () => undefined);
|
|
@@ -63,7 +72,7 @@ describe('feature.send_message kernel handler', () => {
|
|
|
63
72
|
const result = await kernel.invoke(
|
|
64
73
|
'feature.send_message',
|
|
65
74
|
{ feature_id: 'feature_send_1', message: 'Hello agent!', operation_id: 'op:send:1' },
|
|
66
|
-
{ actor_type: 'orchestrator', actor_id: 'test' }
|
|
75
|
+
{ actor_type: 'orchestrator', actor_id: 'test' },
|
|
67
76
|
);
|
|
68
77
|
|
|
69
78
|
expect(result.ok).toBe(true);
|
|
@@ -71,7 +80,7 @@ describe('feature.send_message kernel handler', () => {
|
|
|
71
80
|
feature_id: 'feature_send_1',
|
|
72
81
|
session_id: 'planner:1',
|
|
73
82
|
target_role: 'planner',
|
|
74
|
-
delivered: true
|
|
83
|
+
delivered: true,
|
|
75
84
|
});
|
|
76
85
|
expect(sendMessageMock).toHaveBeenCalledWith('planner:1', 'Hello agent!');
|
|
77
86
|
});
|
|
@@ -80,7 +89,11 @@ describe('feature.send_message kernel handler', () => {
|
|
|
80
89
|
const kernel = new AopKernel(repoRoot);
|
|
81
90
|
await kernel.ensureLoaded();
|
|
82
91
|
await writeFeatureSpec(repoRoot, 'feature_send_wait');
|
|
83
|
-
await kernel.invoke(
|
|
92
|
+
await kernel.invoke(
|
|
93
|
+
'feature.init',
|
|
94
|
+
{ feature_id: 'feature_send_wait' },
|
|
95
|
+
{ actor_type: 'orchestrator', actor_id: 'test' },
|
|
96
|
+
);
|
|
84
97
|
await writeFeatureSession(repoRoot, 'feature_send_wait');
|
|
85
98
|
|
|
86
99
|
const getSessionInfo = vi
|
|
@@ -93,8 +106,12 @@ describe('feature.send_message kernel handler', () => {
|
|
|
93
106
|
|
|
94
107
|
const result = await kernel.invoke(
|
|
95
108
|
'feature.send_message',
|
|
96
|
-
{
|
|
97
|
-
|
|
109
|
+
{
|
|
110
|
+
feature_id: 'feature_send_wait',
|
|
111
|
+
message: 'Wait for ready session',
|
|
112
|
+
operation_id: 'op:send:wait',
|
|
113
|
+
},
|
|
114
|
+
{ actor_type: 'orchestrator', actor_id: 'test' },
|
|
98
115
|
);
|
|
99
116
|
|
|
100
117
|
expect(result.ok).toBe(true);
|
|
@@ -106,7 +123,11 @@ describe('feature.send_message kernel handler', () => {
|
|
|
106
123
|
const kernel = new AopKernel(repoRoot);
|
|
107
124
|
await kernel.ensureLoaded();
|
|
108
125
|
await writeFeatureSpec(repoRoot, 'feature_send_nosession');
|
|
109
|
-
await kernel.invoke(
|
|
126
|
+
await kernel.invoke(
|
|
127
|
+
'feature.init',
|
|
128
|
+
{ feature_id: 'feature_send_nosession' },
|
|
129
|
+
{ actor_type: 'orchestrator', actor_id: 'test' },
|
|
130
|
+
);
|
|
110
131
|
|
|
111
132
|
const provider = makeProvider();
|
|
112
133
|
kernel.setProvider(provider);
|
|
@@ -114,13 +135,13 @@ describe('feature.send_message kernel handler', () => {
|
|
|
114
135
|
const result = await kernel.invoke(
|
|
115
136
|
'feature.send_message',
|
|
116
137
|
{ feature_id: 'feature_send_nosession', message: 'Hello agent!', operation_id: 'op:send:2' },
|
|
117
|
-
{ actor_type: 'orchestrator', actor_id: 'test' }
|
|
138
|
+
{ actor_type: 'orchestrator', actor_id: 'test' },
|
|
118
139
|
);
|
|
119
140
|
|
|
120
141
|
expect(result.ok).toBe(false);
|
|
121
142
|
expect(result.error).toMatchObject({
|
|
122
143
|
code: 'session_not_found',
|
|
123
|
-
message: 'No active session cluster for feature'
|
|
144
|
+
message: 'No active session cluster for feature',
|
|
124
145
|
});
|
|
125
146
|
});
|
|
126
147
|
|
|
@@ -128,7 +149,11 @@ describe('feature.send_message kernel handler', () => {
|
|
|
128
149
|
const kernel = new AopKernel(repoRoot);
|
|
129
150
|
await kernel.ensureLoaded();
|
|
130
151
|
await writeFeatureSpec(repoRoot, 'feature_send_noprovider');
|
|
131
|
-
await kernel.invoke(
|
|
152
|
+
await kernel.invoke(
|
|
153
|
+
'feature.init',
|
|
154
|
+
{ feature_id: 'feature_send_noprovider' },
|
|
155
|
+
{ actor_type: 'orchestrator', actor_id: 'test' },
|
|
156
|
+
);
|
|
132
157
|
await writeFeatureSession(repoRoot, 'feature_send_noprovider');
|
|
133
158
|
|
|
134
159
|
// Provider without sendMessage
|
|
@@ -138,13 +163,13 @@ describe('feature.send_message kernel handler', () => {
|
|
|
138
163
|
const result = await kernel.invoke(
|
|
139
164
|
'feature.send_message',
|
|
140
165
|
{ feature_id: 'feature_send_noprovider', message: 'Hello agent!', operation_id: 'op:send:3' },
|
|
141
|
-
{ actor_type: 'orchestrator', actor_id: 'test' }
|
|
166
|
+
{ actor_type: 'orchestrator', actor_id: 'test' },
|
|
142
167
|
);
|
|
143
168
|
|
|
144
169
|
expect(result.ok).toBe(false);
|
|
145
170
|
expect(result.error).toMatchObject({
|
|
146
171
|
code: 'provider_unsupported',
|
|
147
|
-
message: 'Provider does not support sendMessage'
|
|
172
|
+
message: 'Provider does not support sendMessage',
|
|
148
173
|
});
|
|
149
174
|
});
|
|
150
175
|
|
|
@@ -152,7 +177,11 @@ describe('feature.send_message kernel handler', () => {
|
|
|
152
177
|
const kernel = new AopKernel(repoRoot);
|
|
153
178
|
await kernel.ensureLoaded();
|
|
154
179
|
await writeFeatureSpec(repoRoot, 'feature_send_empty_msg');
|
|
155
|
-
await kernel.invoke(
|
|
180
|
+
await kernel.invoke(
|
|
181
|
+
'feature.init',
|
|
182
|
+
{ feature_id: 'feature_send_empty_msg' },
|
|
183
|
+
{ actor_type: 'orchestrator', actor_id: 'test' },
|
|
184
|
+
);
|
|
156
185
|
await writeFeatureSession(repoRoot, 'feature_send_empty_msg');
|
|
157
186
|
|
|
158
187
|
const provider = makeProvider();
|
|
@@ -161,7 +190,7 @@ describe('feature.send_message kernel handler', () => {
|
|
|
161
190
|
const result = await kernel.invoke(
|
|
162
191
|
'feature.send_message',
|
|
163
192
|
{ feature_id: 'feature_send_empty_msg', message: '', operation_id: 'op:send:4' },
|
|
164
|
-
{ actor_type: 'orchestrator', actor_id: 'test' }
|
|
193
|
+
{ actor_type: 'orchestrator', actor_id: 'test' },
|
|
165
194
|
);
|
|
166
195
|
|
|
167
196
|
expect(result.ok).toBe(false);
|
|
@@ -171,7 +200,11 @@ describe('feature.send_message kernel handler', () => {
|
|
|
171
200
|
const kernel = new AopKernel(repoRoot);
|
|
172
201
|
await kernel.ensureLoaded();
|
|
173
202
|
await writeFeatureSpec(repoRoot, 'feature_send_idem');
|
|
174
|
-
await kernel.invoke(
|
|
203
|
+
await kernel.invoke(
|
|
204
|
+
'feature.init',
|
|
205
|
+
{ feature_id: 'feature_send_idem' },
|
|
206
|
+
{ actor_type: 'orchestrator', actor_id: 'test' },
|
|
207
|
+
);
|
|
175
208
|
await writeFeatureSession(repoRoot, 'feature_send_idem');
|
|
176
209
|
|
|
177
210
|
const sendMessageMock = vi.fn(async () => undefined);
|
|
@@ -182,12 +215,12 @@ describe('feature.send_message kernel handler', () => {
|
|
|
182
215
|
const result1 = await kernel.invoke(
|
|
183
216
|
'feature.send_message',
|
|
184
217
|
{ feature_id: 'feature_send_idem', message: 'idem message', operation_id: operationId },
|
|
185
|
-
{ actor_type: 'orchestrator', actor_id: 'test' }
|
|
218
|
+
{ actor_type: 'orchestrator', actor_id: 'test' },
|
|
186
219
|
);
|
|
187
220
|
const result2 = await kernel.invoke(
|
|
188
221
|
'feature.send_message',
|
|
189
222
|
{ feature_id: 'feature_send_idem', message: 'idem message', operation_id: operationId },
|
|
190
|
-
{ actor_type: 'orchestrator', actor_id: 'test' }
|
|
223
|
+
{ actor_type: 'orchestrator', actor_id: 'test' },
|
|
191
224
|
);
|
|
192
225
|
|
|
193
226
|
expect(result1.ok).toBe(true);
|
|
@@ -201,7 +234,7 @@ describe('SendCommandHandler', () => {
|
|
|
201
234
|
it('GIVEN send CLI command WHEN executed THEN tool client called with correct params', async () => {
|
|
202
235
|
const call = vi.fn(async () => ({
|
|
203
236
|
ok: true,
|
|
204
|
-
data: { feature_id: 'feature_a', session_id: 'orch:1', delivered: true }
|
|
237
|
+
data: { feature_id: 'feature_a', session_id: 'orch:1', delivered: true },
|
|
205
238
|
}));
|
|
206
239
|
const toolClient = { call };
|
|
207
240
|
const handler = new SendCommandHandler(toolClient as never, 'run:test');
|
|
@@ -209,7 +242,7 @@ describe('SendCommandHandler', () => {
|
|
|
209
242
|
const result = await handler.execute({
|
|
210
243
|
command: 'send',
|
|
211
244
|
feature_id: 'feature_a',
|
|
212
|
-
message: 'Do something'
|
|
245
|
+
message: 'Do something',
|
|
213
246
|
});
|
|
214
247
|
|
|
215
248
|
expect(call).toHaveBeenCalledWith(
|
|
@@ -217,33 +250,31 @@ describe('SendCommandHandler', () => {
|
|
|
217
250
|
expect.objectContaining({
|
|
218
251
|
feature_id: 'feature_a',
|
|
219
252
|
message: 'Do something',
|
|
220
|
-
operation_id: expect.any(String)
|
|
253
|
+
operation_id: expect.any(String),
|
|
221
254
|
}),
|
|
222
255
|
expect.objectContaining({
|
|
223
256
|
run_id: 'run:test',
|
|
224
|
-
actor_type: 'system'
|
|
225
|
-
})
|
|
257
|
+
actor_type: 'system',
|
|
258
|
+
}),
|
|
226
259
|
);
|
|
227
260
|
expect(result).toMatchObject({
|
|
228
261
|
ok: true,
|
|
229
262
|
data: {
|
|
230
263
|
command: 'send',
|
|
231
264
|
feature_id: 'feature_a',
|
|
232
|
-
delivered: true
|
|
233
|
-
}
|
|
265
|
+
delivered: true,
|
|
266
|
+
},
|
|
234
267
|
});
|
|
235
268
|
});
|
|
236
269
|
|
|
237
270
|
it('GIVEN feature_id missing WHEN send CLI called THEN validation error thrown', async () => {
|
|
238
271
|
const handler = new SendCommandHandler({ call: vi.fn() } as never, 'run:test');
|
|
239
272
|
|
|
240
|
-
await expect(
|
|
241
|
-
handler.execute({ command: 'send', message: 'Hello' })
|
|
242
|
-
).rejects.toMatchObject({
|
|
273
|
+
await expect(handler.execute({ command: 'send', message: 'Hello' })).rejects.toMatchObject({
|
|
243
274
|
code: ERROR_CODES.INVALID_CLI_ARGS,
|
|
244
275
|
details: expect.objectContaining({
|
|
245
|
-
reason: '--feature-id is required for send'
|
|
246
|
-
})
|
|
276
|
+
reason: '--feature-id is required for send',
|
|
277
|
+
}),
|
|
247
278
|
});
|
|
248
279
|
});
|
|
249
280
|
|
|
@@ -251,12 +282,12 @@ describe('SendCommandHandler', () => {
|
|
|
251
282
|
const handler = new SendCommandHandler({ call: vi.fn() } as never, 'run:test');
|
|
252
283
|
|
|
253
284
|
await expect(
|
|
254
|
-
handler.execute({ command: 'send', feature_id: 'feature_a' })
|
|
285
|
+
handler.execute({ command: 'send', feature_id: 'feature_a' }),
|
|
255
286
|
).rejects.toMatchObject({
|
|
256
287
|
code: ERROR_CODES.INVALID_CLI_ARGS,
|
|
257
288
|
details: expect.objectContaining({
|
|
258
|
-
reason: '--message is required for send'
|
|
259
|
-
})
|
|
289
|
+
reason: '--message is required for send',
|
|
290
|
+
}),
|
|
260
291
|
});
|
|
261
292
|
});
|
|
262
293
|
});
|
|
@@ -269,18 +300,21 @@ describe('AttachCommandHandler', () => {
|
|
|
269
300
|
await kernel.invoke(
|
|
270
301
|
'feature.init',
|
|
271
302
|
{ feature_id: 'feature_attach_planning' },
|
|
272
|
-
{ actor_type: 'orchestrator', actor_id: 'test' }
|
|
303
|
+
{ actor_type: 'orchestrator', actor_id: 'test' },
|
|
273
304
|
);
|
|
274
305
|
await writeFeatureSession(repoRoot, 'feature_attach_planning');
|
|
275
306
|
|
|
276
307
|
const attachToSession = vi.fn(async () => undefined);
|
|
277
308
|
const provider = makeProvider({ attachToSession, reattachSession: undefined });
|
|
278
309
|
const toolClient = {
|
|
279
|
-
call: vi.fn(async () => ({ ok: true, data: { front_matter: { status: 'planning' } } }))
|
|
310
|
+
call: vi.fn(async () => ({ ok: true, data: { front_matter: { status: 'planning' } } })),
|
|
280
311
|
};
|
|
281
312
|
|
|
282
313
|
const handler = new AttachCommandHandler(toolClient as never, 'run:test', kernel, provider);
|
|
283
|
-
const result = await handler.execute({
|
|
314
|
+
const result = await handler.execute({
|
|
315
|
+
command: 'attach',
|
|
316
|
+
feature_id: 'feature_attach_planning',
|
|
317
|
+
});
|
|
284
318
|
|
|
285
319
|
expect(attachToSession).toHaveBeenCalledWith('planner:1');
|
|
286
320
|
expect(result).toMatchObject({
|
|
@@ -290,8 +324,8 @@ describe('AttachCommandHandler', () => {
|
|
|
290
324
|
feature_id: 'feature_attach_planning',
|
|
291
325
|
role: 'planner',
|
|
292
326
|
session_id: 'planner:1',
|
|
293
|
-
attached: true
|
|
294
|
-
}
|
|
327
|
+
attached: true,
|
|
328
|
+
},
|
|
295
329
|
});
|
|
296
330
|
});
|
|
297
331
|
|
|
@@ -302,7 +336,7 @@ describe('AttachCommandHandler', () => {
|
|
|
302
336
|
await kernel.invoke(
|
|
303
337
|
'feature.init',
|
|
304
338
|
{ feature_id: 'feature_attach_builder' },
|
|
305
|
-
{ actor_type: 'orchestrator', actor_id: 'test' }
|
|
339
|
+
{ actor_type: 'orchestrator', actor_id: 'test' },
|
|
306
340
|
);
|
|
307
341
|
await writeFeatureSession(repoRoot, 'feature_attach_builder');
|
|
308
342
|
|
|
@@ -311,21 +345,23 @@ describe('AttachCommandHandler', () => {
|
|
|
311
345
|
provider: 'custom',
|
|
312
346
|
model: 'custom-default',
|
|
313
347
|
provider_config_env: null,
|
|
314
|
-
provider_config_ref: null
|
|
348
|
+
provider_config_ref: null,
|
|
315
349
|
},
|
|
316
|
-
attachToSession: undefined
|
|
350
|
+
attachToSession: undefined,
|
|
317
351
|
});
|
|
318
352
|
const toolClient = {
|
|
319
|
-
call: vi.fn(async () => ({ ok: true, data: { front_matter: { status: 'building' } } }))
|
|
353
|
+
call: vi.fn(async () => ({ ok: true, data: { front_matter: { status: 'building' } } })),
|
|
320
354
|
};
|
|
321
355
|
|
|
322
356
|
const handler = new AttachCommandHandler(toolClient as never, 'run:test', kernel, provider);
|
|
323
|
-
await expect(
|
|
357
|
+
await expect(
|
|
358
|
+
handler.execute({ command: 'attach', feature_id: 'feature_attach_builder' }),
|
|
359
|
+
).rejects.toMatchObject({
|
|
324
360
|
code: ERROR_CODES.INVALID_CLI_ARGS,
|
|
325
361
|
details: expect.objectContaining({
|
|
326
362
|
reason: expect.stringContaining('does not support interactive attach'),
|
|
327
|
-
provider: 'custom'
|
|
328
|
-
})
|
|
363
|
+
provider: 'custom',
|
|
364
|
+
}),
|
|
329
365
|
});
|
|
330
366
|
});
|
|
331
367
|
|
|
@@ -336,20 +372,22 @@ describe('AttachCommandHandler', () => {
|
|
|
336
372
|
await kernel.invoke(
|
|
337
373
|
'feature.init',
|
|
338
374
|
{ feature_id: 'feature_attach_missing' },
|
|
339
|
-
{ actor_type: 'orchestrator', actor_id: 'test' }
|
|
375
|
+
{ actor_type: 'orchestrator', actor_id: 'test' },
|
|
340
376
|
);
|
|
341
377
|
|
|
342
378
|
const provider = makeProvider();
|
|
343
379
|
const toolClient = {
|
|
344
|
-
call: vi.fn(async () => ({ ok: true, data: { front_matter: { status: 'planning' } } }))
|
|
380
|
+
call: vi.fn(async () => ({ ok: true, data: { front_matter: { status: 'planning' } } })),
|
|
345
381
|
};
|
|
346
382
|
|
|
347
383
|
const handler = new AttachCommandHandler(toolClient as never, 'run:test', kernel, provider);
|
|
348
|
-
await expect(
|
|
384
|
+
await expect(
|
|
385
|
+
handler.execute({ command: 'attach', feature_id: 'feature_attach_missing' }),
|
|
386
|
+
).rejects.toMatchObject({
|
|
349
387
|
code: ERROR_CODES.INVALID_CLI_ARGS,
|
|
350
388
|
details: expect.objectContaining({
|
|
351
|
-
reason: expect.stringContaining('No active session cluster found')
|
|
352
|
-
})
|
|
389
|
+
reason: expect.stringContaining('No active session cluster found'),
|
|
390
|
+
}),
|
|
353
391
|
});
|
|
354
392
|
});
|
|
355
393
|
});
|
|
@@ -361,7 +399,7 @@ describe('AttachCommandHandler branch coverage', () => {
|
|
|
361
399
|
const toolClient = { call: vi.fn() };
|
|
362
400
|
const handler = new AttachCommandHandler(toolClient as never, 'run:test', kernel, provider);
|
|
363
401
|
await expect(handler.execute({ command: 'attach' })).rejects.toMatchObject({
|
|
364
|
-
code: ERROR_CODES.INVALID_CLI_ARGS
|
|
402
|
+
code: ERROR_CODES.INVALID_CLI_ARGS,
|
|
365
403
|
});
|
|
366
404
|
});
|
|
367
405
|
|
|
@@ -370,8 +408,10 @@ describe('AttachCommandHandler branch coverage', () => {
|
|
|
370
408
|
const provider = makeProvider();
|
|
371
409
|
const toolClient = { call: vi.fn() };
|
|
372
410
|
const handler = new AttachCommandHandler(toolClient as never, 'run:test', kernel, provider);
|
|
373
|
-
await expect(
|
|
374
|
-
|
|
411
|
+
await expect(
|
|
412
|
+
handler.execute({ command: 'attach', feature_id: 'INVALID Feature ID' }),
|
|
413
|
+
).rejects.toMatchObject({
|
|
414
|
+
code: ERROR_CODES.INVALID_CLI_ARGS,
|
|
375
415
|
});
|
|
376
416
|
});
|
|
377
417
|
|
|
@@ -379,13 +419,17 @@ describe('AttachCommandHandler branch coverage', () => {
|
|
|
379
419
|
const kernel = new AopKernel(repoRoot);
|
|
380
420
|
await kernel.ensureLoaded();
|
|
381
421
|
await writeFeatureSpec(repoRoot, 'feature_attach_qa');
|
|
382
|
-
await kernel.invoke(
|
|
422
|
+
await kernel.invoke(
|
|
423
|
+
'feature.init',
|
|
424
|
+
{ feature_id: 'feature_attach_qa' },
|
|
425
|
+
{ actor_type: 'orchestrator', actor_id: 'test' },
|
|
426
|
+
);
|
|
383
427
|
await writeFeatureSession(repoRoot, 'feature_attach_qa');
|
|
384
428
|
|
|
385
429
|
const attachToSession = vi.fn(async () => undefined);
|
|
386
430
|
const provider = makeProvider({ attachToSession });
|
|
387
431
|
const toolClient = {
|
|
388
|
-
call: vi.fn(async () => ({ ok: true, data: { front_matter: { status: 'qa' } } }))
|
|
432
|
+
call: vi.fn(async () => ({ ok: true, data: { front_matter: { status: 'qa' } } })),
|
|
389
433
|
};
|
|
390
434
|
|
|
391
435
|
const handler = new AttachCommandHandler(toolClient as never, 'run:test', kernel, provider);
|
|
@@ -399,17 +443,24 @@ describe('AttachCommandHandler branch coverage', () => {
|
|
|
399
443
|
const kernel = new AopKernel(repoRoot);
|
|
400
444
|
await kernel.ensureLoaded();
|
|
401
445
|
await writeFeatureSpec(repoRoot, 'feature_attach_building');
|
|
402
|
-
await kernel.invoke(
|
|
446
|
+
await kernel.invoke(
|
|
447
|
+
'feature.init',
|
|
448
|
+
{ feature_id: 'feature_attach_building' },
|
|
449
|
+
{ actor_type: 'orchestrator', actor_id: 'test' },
|
|
450
|
+
);
|
|
403
451
|
await writeFeatureSession(repoRoot, 'feature_attach_building');
|
|
404
452
|
|
|
405
453
|
const attachToSession = vi.fn(async () => undefined);
|
|
406
454
|
const provider = makeProvider({ attachToSession });
|
|
407
455
|
const toolClient = {
|
|
408
|
-
call: vi.fn(async () => ({ ok: true, data: { front_matter: { status: 'building' } } }))
|
|
456
|
+
call: vi.fn(async () => ({ ok: true, data: { front_matter: { status: 'building' } } })),
|
|
409
457
|
};
|
|
410
458
|
|
|
411
459
|
const handler = new AttachCommandHandler(toolClient as never, 'run:test', kernel, provider);
|
|
412
|
-
const result = await handler.execute({
|
|
460
|
+
const result = await handler.execute({
|
|
461
|
+
command: 'attach',
|
|
462
|
+
feature_id: 'feature_attach_building',
|
|
463
|
+
});
|
|
413
464
|
const data = (result as Record<string, unknown>).data as Record<string, unknown>;
|
|
414
465
|
expect(data.role).toBe('builder');
|
|
415
466
|
expect(attachToSession).toHaveBeenCalledWith('builder:1');
|
|
@@ -419,30 +470,41 @@ describe('AttachCommandHandler branch coverage', () => {
|
|
|
419
470
|
const kernel = new AopKernel(repoRoot);
|
|
420
471
|
await kernel.ensureLoaded();
|
|
421
472
|
await writeFeatureSpec(repoRoot, 'feature_attach_fallback');
|
|
422
|
-
await kernel.invoke(
|
|
473
|
+
await kernel.invoke(
|
|
474
|
+
'feature.init',
|
|
475
|
+
{ feature_id: 'feature_attach_fallback' },
|
|
476
|
+
{ actor_type: 'orchestrator', actor_id: 'test' },
|
|
477
|
+
);
|
|
423
478
|
|
|
424
479
|
// Write session with unassigned planner_session_id but valid orchestrator session
|
|
425
480
|
const leasePath = path.join(repoRoot, '.aop', 'runtime', 'default', 'run-lease.json');
|
|
426
481
|
await fs.mkdir(path.dirname(leasePath), { recursive: true });
|
|
427
|
-
await fs.writeFile(
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
482
|
+
await fs.writeFile(
|
|
483
|
+
leasePath,
|
|
484
|
+
JSON.stringify({
|
|
485
|
+
orchestrator_session_id: 'orch:fallback-1',
|
|
486
|
+
feature_sessions: {
|
|
487
|
+
feature_attach_fallback: {
|
|
488
|
+
planner_session_id: 'unassigned',
|
|
489
|
+
builder_session_id: 'unassigned',
|
|
490
|
+
qa_session_id: 'unassigned',
|
|
491
|
+
},
|
|
492
|
+
},
|
|
493
|
+
}),
|
|
494
|
+
'utf8',
|
|
495
|
+
);
|
|
437
496
|
|
|
438
497
|
const attachToSession = vi.fn(async () => undefined);
|
|
439
498
|
const provider = makeProvider({ attachToSession });
|
|
440
499
|
const toolClient = {
|
|
441
|
-
call: vi.fn(async () => ({ ok: true, data: { front_matter: { status: 'planning' } } }))
|
|
500
|
+
call: vi.fn(async () => ({ ok: true, data: { front_matter: { status: 'planning' } } })),
|
|
442
501
|
};
|
|
443
502
|
|
|
444
503
|
const handler = new AttachCommandHandler(toolClient as never, 'run:test', kernel, provider);
|
|
445
|
-
const result = await handler.execute({
|
|
504
|
+
const result = await handler.execute({
|
|
505
|
+
command: 'attach',
|
|
506
|
+
feature_id: 'feature_attach_fallback',
|
|
507
|
+
});
|
|
446
508
|
const data = (result as Record<string, unknown>).data as Record<string, unknown>;
|
|
447
509
|
expect(data.session_id).toBe('orch:fallback-1');
|
|
448
510
|
expect(attachToSession).toHaveBeenCalledWith('orch:fallback-1');
|
|
@@ -13,29 +13,29 @@ const mocks = vi.hoisted(() => ({
|
|
|
13
13
|
writeFile: vi.fn(async () => {}),
|
|
14
14
|
canonicalFeatureIdFromPath: vi.fn(() => 'derived-feature'),
|
|
15
15
|
isCanonicalSpecPath: vi.fn((): string | null => null),
|
|
16
|
-
isLegacyCanonicalSpecPath: vi.fn((): string | null => null)
|
|
16
|
+
isLegacyCanonicalSpecPath: vi.fn((): string | null => null),
|
|
17
17
|
}));
|
|
18
18
|
|
|
19
19
|
vi.mock('../src/core/fs.js', () => ({
|
|
20
20
|
stableHash: mocks.stableHash,
|
|
21
|
-
ensureDir: mocks.ensureDir
|
|
21
|
+
ensureDir: mocks.ensureDir,
|
|
22
22
|
}));
|
|
23
23
|
|
|
24
24
|
vi.mock('../src/cli/tooling.js', () => ({
|
|
25
|
-
callCliTool: mocks.callCliTool
|
|
25
|
+
callCliTool: mocks.callCliTool,
|
|
26
26
|
}));
|
|
27
27
|
|
|
28
28
|
vi.mock('node:fs/promises', () => ({
|
|
29
29
|
default: {
|
|
30
30
|
readFile: mocks.readFile,
|
|
31
|
-
writeFile: mocks.writeFile
|
|
32
|
-
}
|
|
31
|
+
writeFile: mocks.writeFile,
|
|
32
|
+
},
|
|
33
33
|
}));
|
|
34
34
|
|
|
35
35
|
vi.mock('../src/cli/spec-utils.js', () => ({
|
|
36
36
|
canonicalFeatureIdFromPath: mocks.canonicalFeatureIdFromPath,
|
|
37
37
|
isCanonicalSpecPath: mocks.isCanonicalSpecPath,
|
|
38
|
-
isLegacyCanonicalSpecPath: mocks.isLegacyCanonicalSpecPath
|
|
38
|
+
isLegacyCanonicalSpecPath: mocks.isLegacyCanonicalSpecPath,
|
|
39
39
|
}));
|
|
40
40
|
|
|
41
41
|
import { SpecIngestionService } from '../src/cli/spec-ingestion-service.js';
|
|
@@ -51,12 +51,14 @@ function makeService() {
|
|
|
51
51
|
describe('SpecIngestionService', () => {
|
|
52
52
|
beforeEach(() => {
|
|
53
53
|
vi.clearAllMocks();
|
|
54
|
-
mocks.callCliTool.mockImplementation(
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
54
|
+
mocks.callCliTool.mockImplementation(
|
|
55
|
+
async (_client: unknown, _runId: string, toolName: string) => {
|
|
56
|
+
if (toolName === 'feature.state_get') {
|
|
57
|
+
return { data: { front_matter: { version: 1 } } };
|
|
58
|
+
}
|
|
59
|
+
return { data: {} };
|
|
60
|
+
},
|
|
61
|
+
);
|
|
60
62
|
mocks.isCanonicalSpecPath.mockReturnValue(null);
|
|
61
63
|
mocks.isLegacyCanonicalSpecPath.mockReturnValue(null);
|
|
62
64
|
mocks.canonicalFeatureIdFromPath.mockReturnValue('derived-feature');
|
|
@@ -130,7 +132,9 @@ describe('SpecIngestionService', () => {
|
|
|
130
132
|
|
|
131
133
|
expect(result).toHaveLength(1);
|
|
132
134
|
expect(result[0].feature_id).toBe('derived-feature');
|
|
133
|
-
expect(mocks.canonicalFeatureIdFromPath).toHaveBeenCalledWith(
|
|
135
|
+
expect(mocks.canonicalFeatureIdFromPath).toHaveBeenCalledWith(
|
|
136
|
+
'/somewhere/derived-feature.md',
|
|
137
|
+
);
|
|
134
138
|
expect(mocks.ensureDir).toHaveBeenCalled();
|
|
135
139
|
expect(mocks.writeFile).toHaveBeenCalled();
|
|
136
140
|
});
|
|
@@ -144,8 +148,8 @@ describe('SpecIngestionService', () => {
|
|
|
144
148
|
await expect(
|
|
145
149
|
service.ingest([
|
|
146
150
|
'/repo/.aop/features/my-feature/spec.md',
|
|
147
|
-
'/repo/.aop/features/my-feature/spec.md'
|
|
148
|
-
])
|
|
151
|
+
'/repo/.aop/features/my-feature/spec.md',
|
|
152
|
+
]),
|
|
149
153
|
).rejects.toMatchObject({ code: 'feature_slug_collision' });
|
|
150
154
|
});
|
|
151
155
|
|
|
@@ -156,22 +160,20 @@ describe('SpecIngestionService', () => {
|
|
|
156
160
|
await expect(
|
|
157
161
|
service.ingest([
|
|
158
162
|
'/repo/.aop/features/colliding-feature/spec.md',
|
|
159
|
-
'/repo/.aop/features/colliding-feature/spec.md'
|
|
160
|
-
])
|
|
163
|
+
'/repo/.aop/features/colliding-feature/spec.md',
|
|
164
|
+
]),
|
|
161
165
|
).rejects.toMatchObject({ details: { feature_id: 'colliding-feature' } });
|
|
162
166
|
});
|
|
163
167
|
});
|
|
164
168
|
|
|
165
169
|
describe('ingest - multiple paths', () => {
|
|
166
170
|
it('GIVEN_multiple_distinct_canonical_paths_WHEN_ingest_called_THEN_returns_item_for_each', async () => {
|
|
167
|
-
mocks.isCanonicalSpecPath
|
|
168
|
-
.mockReturnValueOnce('feature-a')
|
|
169
|
-
.mockReturnValueOnce('feature-b');
|
|
171
|
+
mocks.isCanonicalSpecPath.mockReturnValueOnce('feature-a').mockReturnValueOnce('feature-b');
|
|
170
172
|
const service = makeService();
|
|
171
173
|
|
|
172
174
|
const result = await service.ingest([
|
|
173
175
|
'/repo/.aop/features/feature-a/spec.md',
|
|
174
|
-
'/repo/.aop/features/feature-b/spec.md'
|
|
176
|
+
'/repo/.aop/features/feature-b/spec.md',
|
|
175
177
|
]);
|
|
176
178
|
|
|
177
179
|
expect(result).toHaveLength(2);
|
|
@@ -7,7 +7,7 @@ import { ERROR_CODES } from '../src/core/error-codes.js';
|
|
|
7
7
|
const callCliToolMock = vi.hoisted(() => vi.fn());
|
|
8
8
|
|
|
9
9
|
vi.mock('../src/cli/tooling.js', () => ({
|
|
10
|
-
callCliTool: callCliToolMock
|
|
10
|
+
callCliTool: callCliToolMock,
|
|
11
11
|
}));
|
|
12
12
|
|
|
13
13
|
import { SpecInputResolver } from '../src/cli/spec-input-resolver.js';
|
|
@@ -36,18 +36,19 @@ describe('SpecInputResolver', () => {
|
|
|
36
36
|
const resolver = new SpecInputResolver(repoRoot, {} as any, 'run:resolver');
|
|
37
37
|
const files = await resolver.resolve({ command: 'run', folder_input: 'incoming' });
|
|
38
38
|
|
|
39
|
-
expect(files).toEqual(
|
|
40
|
-
path.join(incoming, 'b.md'),
|
|
41
|
-
|
|
42
|
-
].sort((a, b) => a.localeCompare(b)));
|
|
39
|
+
expect(files).toEqual(
|
|
40
|
+
[path.join(incoming, 'b.md'), path.join(nested, 'a.md')].sort((a, b) => a.localeCompare(b)),
|
|
41
|
+
);
|
|
43
42
|
});
|
|
44
43
|
|
|
45
44
|
it('GIVEN_folder_input_pointing_to_file_WHEN_resolving_THEN_returns_input_path_not_found', async () => {
|
|
46
45
|
await fs.writeFile(path.join(repoRoot, 'not-a-folder.md'), '# spec\n', 'utf8');
|
|
47
46
|
const resolver = new SpecInputResolver(repoRoot, {} as any, 'run:resolver');
|
|
48
47
|
|
|
49
|
-
await expect(
|
|
50
|
-
|
|
48
|
+
await expect(
|
|
49
|
+
resolver.resolve({ command: 'run', folder_input: 'not-a-folder.md' }),
|
|
50
|
+
).rejects.toMatchObject({
|
|
51
|
+
code: ERROR_CODES.INPUT_PATH_NOT_FOUND,
|
|
51
52
|
});
|
|
52
53
|
});
|
|
53
54
|
|
|
@@ -56,7 +57,7 @@ describe('SpecInputResolver', () => {
|
|
|
56
57
|
const resolver = new SpecInputResolver(repoRoot, {} as any, 'run:resolver');
|
|
57
58
|
|
|
58
59
|
await expect(resolver.resolve({ command: 'run' })).rejects.toMatchObject({
|
|
59
|
-
code: ERROR_CODES.NO_SPECS_FOUND
|
|
60
|
+
code: ERROR_CODES.NO_SPECS_FOUND,
|
|
60
61
|
});
|
|
61
62
|
});
|
|
62
63
|
|
|
@@ -64,8 +65,8 @@ describe('SpecInputResolver', () => {
|
|
|
64
65
|
callCliToolMock.mockResolvedValue({
|
|
65
66
|
ok: true,
|
|
66
67
|
data: {
|
|
67
|
-
specs: [{ spec_path: '.aop/features/alpha/spec.md' }]
|
|
68
|
-
}
|
|
68
|
+
specs: [{ spec_path: '.aop/features/alpha/spec.md' }],
|
|
69
|
+
},
|
|
69
70
|
});
|
|
70
71
|
|
|
71
72
|
const resolver = new SpecInputResolver(repoRoot, {} as any, 'run:resolver');
|