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
|
@@ -4,12 +4,12 @@ const rmMock = vi.hoisted(() => vi.fn(async () => undefined));
|
|
|
4
4
|
|
|
5
5
|
vi.mock('node:fs/promises', () => ({
|
|
6
6
|
default: {
|
|
7
|
-
rm: rmMock
|
|
8
|
-
}
|
|
7
|
+
rm: rmMock,
|
|
8
|
+
},
|
|
9
9
|
}));
|
|
10
10
|
|
|
11
11
|
vi.mock('../src/core/git.js', () => ({
|
|
12
|
-
runGit: vi.fn()
|
|
12
|
+
runGit: vi.fn(),
|
|
13
13
|
}));
|
|
14
14
|
|
|
15
15
|
import { MergeService } from '../src/application/services/merge-service.js';
|
|
@@ -26,7 +26,7 @@ function commandResult(overrides: Partial<Awaited<ReturnType<typeof runGit>>> =
|
|
|
26
26
|
stdout: '',
|
|
27
27
|
stderr: '',
|
|
28
28
|
timeout: false,
|
|
29
|
-
...overrides
|
|
29
|
+
...overrides,
|
|
30
30
|
};
|
|
31
31
|
}
|
|
32
32
|
|
|
@@ -34,10 +34,12 @@ function clone<T>(value: T): T {
|
|
|
34
34
|
return JSON.parse(JSON.stringify(value)) as T;
|
|
35
35
|
}
|
|
36
36
|
|
|
37
|
-
function makeHarness(
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
37
|
+
function makeHarness(
|
|
38
|
+
options: {
|
|
39
|
+
stateOverrides?: AnyRecord;
|
|
40
|
+
policyOverrides?: AnyRecord;
|
|
41
|
+
} = {},
|
|
42
|
+
) {
|
|
41
43
|
const state = {
|
|
42
44
|
frontMatter: {
|
|
43
45
|
feature_id: 'feature_merge',
|
|
@@ -45,28 +47,28 @@ function makeHarness(options: {
|
|
|
45
47
|
status: STATUS.READY_TO_MERGE,
|
|
46
48
|
gates: {
|
|
47
49
|
fast: GATE_RESULT.PASS,
|
|
48
|
-
full: GATE_RESULT.PASS
|
|
50
|
+
full: GATE_RESULT.PASS,
|
|
49
51
|
},
|
|
50
52
|
locks: {
|
|
51
|
-
held: ['openapi', 'db_migrations']
|
|
53
|
+
held: ['openapi', 'db_migrations'],
|
|
52
54
|
},
|
|
53
55
|
evidence: {},
|
|
54
|
-
...(options.stateOverrides ?? {})
|
|
56
|
+
...(options.stateOverrides ?? {}),
|
|
55
57
|
},
|
|
56
|
-
body: '# State\n'
|
|
58
|
+
body: '# State\n',
|
|
57
59
|
};
|
|
58
60
|
|
|
59
61
|
const policy = {
|
|
60
62
|
merge_policy: {
|
|
61
63
|
allowed_strategies: ['merge_commit', 'squash', 'rebase'],
|
|
62
|
-
require_user_approval: false
|
|
64
|
+
require_user_approval: false,
|
|
63
65
|
},
|
|
64
66
|
required_modes: ['fast'],
|
|
65
67
|
required_merge_mode: 'full',
|
|
66
68
|
worktree: {
|
|
67
|
-
base_branch: 'main'
|
|
69
|
+
base_branch: 'main',
|
|
68
70
|
},
|
|
69
|
-
...(options.policyOverrides ?? {})
|
|
71
|
+
...(options.policyOverrides ?? {}),
|
|
70
72
|
};
|
|
71
73
|
|
|
72
74
|
let index: AnyRecord = {
|
|
@@ -80,15 +82,15 @@ function makeHarness(options: {
|
|
|
80
82
|
feature_merge: {
|
|
81
83
|
planner_session_id: 'planner-a',
|
|
82
84
|
builder_session_id: 'builder-a',
|
|
83
|
-
qa_session_id: 'qa-a'
|
|
85
|
+
qa_session_id: 'qa-a',
|
|
84
86
|
},
|
|
85
87
|
other: {
|
|
86
88
|
planner_session_id: 'planner-b',
|
|
87
89
|
builder_session_id: 'builder-b',
|
|
88
|
-
qa_session_id: 'qa-b'
|
|
89
|
-
}
|
|
90
|
-
}
|
|
91
|
-
}
|
|
90
|
+
qa_session_id: 'qa-b',
|
|
91
|
+
},
|
|
92
|
+
},
|
|
93
|
+
},
|
|
92
94
|
};
|
|
93
95
|
|
|
94
96
|
const locksRelease = vi.fn(async () => ({ data: { released: true } }));
|
|
@@ -107,7 +109,7 @@ function makeHarness(options: {
|
|
|
107
109
|
state.frontMatter = {
|
|
108
110
|
...state.frontMatter,
|
|
109
111
|
...(next.frontMatter ?? {}),
|
|
110
|
-
version: state.frontMatter.version + 1
|
|
112
|
+
version: state.frontMatter.version + 1,
|
|
111
113
|
};
|
|
112
114
|
state.body = next.body ?? state.body;
|
|
113
115
|
return clone(state.frontMatter);
|
|
@@ -117,14 +119,14 @@ function makeHarness(options: {
|
|
|
117
119
|
readIndex: async () => clone(index),
|
|
118
120
|
writeIndex: async (nextIndex: AnyRecord) => {
|
|
119
121
|
index = clone(nextIndex);
|
|
120
|
-
}
|
|
122
|
+
},
|
|
121
123
|
});
|
|
122
124
|
|
|
123
125
|
return {
|
|
124
126
|
service,
|
|
125
127
|
state,
|
|
126
128
|
locksRelease,
|
|
127
|
-
getIndex: () => clone(index)
|
|
129
|
+
getIndex: () => clone(index),
|
|
128
130
|
};
|
|
129
131
|
}
|
|
130
132
|
|
|
@@ -139,19 +141,19 @@ describe('MergeService', () => {
|
|
|
139
141
|
policyOverrides: {
|
|
140
142
|
merge_policy: {
|
|
141
143
|
allowed_strategies: ['merge_commit'],
|
|
142
|
-
require_user_approval: false
|
|
143
|
-
}
|
|
144
|
-
}
|
|
144
|
+
require_user_approval: false,
|
|
145
|
+
},
|
|
146
|
+
},
|
|
145
147
|
});
|
|
146
148
|
|
|
147
149
|
await expect(
|
|
148
|
-
harness.service.featureReadyToMerge('feature_merge', 'merge', 'squash', null)
|
|
150
|
+
harness.service.featureReadyToMerge('feature_merge', 'merge', 'squash', null),
|
|
149
151
|
).rejects.toMatchObject({
|
|
150
152
|
normalizedResponse: {
|
|
151
153
|
error: {
|
|
152
|
-
code: ERROR_CODES.MERGE_DISABLED
|
|
153
|
-
}
|
|
154
|
-
}
|
|
154
|
+
code: ERROR_CODES.MERGE_DISABLED,
|
|
155
|
+
},
|
|
156
|
+
},
|
|
155
157
|
});
|
|
156
158
|
expect(runGit).not.toHaveBeenCalled();
|
|
157
159
|
});
|
|
@@ -161,19 +163,19 @@ describe('MergeService', () => {
|
|
|
161
163
|
policyOverrides: {
|
|
162
164
|
merge_policy: {
|
|
163
165
|
allowed_strategies: ['merge_commit', 'squash', 'rebase'],
|
|
164
|
-
require_user_approval: true
|
|
165
|
-
}
|
|
166
|
-
}
|
|
166
|
+
require_user_approval: true,
|
|
167
|
+
},
|
|
168
|
+
},
|
|
167
169
|
});
|
|
168
170
|
|
|
169
171
|
await expect(
|
|
170
|
-
harness.service.featureReadyToMerge('feature_merge', 'merge', 'merge_commit', null)
|
|
172
|
+
harness.service.featureReadyToMerge('feature_merge', 'merge', 'merge_commit', null),
|
|
171
173
|
).rejects.toMatchObject({
|
|
172
174
|
normalizedResponse: {
|
|
173
175
|
error: {
|
|
174
|
-
code: ERROR_CODES.USER_APPROVAL_REQUIRED
|
|
175
|
-
}
|
|
176
|
-
}
|
|
176
|
+
code: ERROR_CODES.USER_APPROVAL_REQUIRED,
|
|
177
|
+
},
|
|
178
|
+
},
|
|
177
179
|
});
|
|
178
180
|
expect(runGit).not.toHaveBeenCalled();
|
|
179
181
|
});
|
|
@@ -181,38 +183,43 @@ describe('MergeService', () => {
|
|
|
181
183
|
it('GIVEN_feature_not_ready_or_required_gates_missing_WHEN_feature_ready_to_merge_THEN_returns_precondition_errors', async () => {
|
|
182
184
|
const invalidStatus = makeHarness({
|
|
183
185
|
stateOverrides: {
|
|
184
|
-
status: STATUS.BUILDING
|
|
185
|
-
}
|
|
186
|
+
status: STATUS.BUILDING,
|
|
187
|
+
},
|
|
186
188
|
});
|
|
187
189
|
await expect(
|
|
188
|
-
invalidStatus.service.featureReadyToMerge(
|
|
190
|
+
invalidStatus.service.featureReadyToMerge(
|
|
191
|
+
'feature_merge',
|
|
192
|
+
'merge',
|
|
193
|
+
'merge_commit',
|
|
194
|
+
'approved',
|
|
195
|
+
),
|
|
189
196
|
).rejects.toMatchObject({
|
|
190
197
|
normalizedResponse: {
|
|
191
198
|
error: {
|
|
192
|
-
code: ERROR_CODES.INVALID_STATUS_TRANSITION
|
|
193
|
-
}
|
|
194
|
-
}
|
|
199
|
+
code: ERROR_CODES.INVALID_STATUS_TRANSITION,
|
|
200
|
+
},
|
|
201
|
+
},
|
|
195
202
|
});
|
|
196
203
|
|
|
197
204
|
const missingGate = makeHarness({
|
|
198
205
|
stateOverrides: {
|
|
199
206
|
gates: {
|
|
200
207
|
fast: GATE_RESULT.PASS,
|
|
201
|
-
full: GATE_RESULT.FAIL
|
|
202
|
-
}
|
|
203
|
-
}
|
|
208
|
+
full: GATE_RESULT.FAIL,
|
|
209
|
+
},
|
|
210
|
+
},
|
|
204
211
|
});
|
|
205
212
|
await expect(
|
|
206
|
-
missingGate.service.featureReadyToMerge('feature_merge', 'merge', 'merge_commit', 'approved')
|
|
213
|
+
missingGate.service.featureReadyToMerge('feature_merge', 'merge', 'merge_commit', 'approved'),
|
|
207
214
|
).rejects.toMatchObject({
|
|
208
215
|
normalizedResponse: {
|
|
209
216
|
error: {
|
|
210
217
|
code: ERROR_CODES.MERGE_DISABLED,
|
|
211
218
|
details: {
|
|
212
|
-
mode: 'full'
|
|
213
|
-
}
|
|
214
|
-
}
|
|
215
|
-
}
|
|
219
|
+
mode: 'full',
|
|
220
|
+
},
|
|
221
|
+
},
|
|
222
|
+
},
|
|
216
223
|
});
|
|
217
224
|
});
|
|
218
225
|
|
|
@@ -221,13 +228,13 @@ describe('MergeService', () => {
|
|
|
221
228
|
vi.mocked(runGit).mockResolvedValueOnce(commandResult({ code: 1, stderr: 'add failed' }));
|
|
222
229
|
|
|
223
230
|
await expect(
|
|
224
|
-
addFailure.service.featureReadyToMerge('feature_merge', 'merge', 'merge_commit', 'approved')
|
|
231
|
+
addFailure.service.featureReadyToMerge('feature_merge', 'merge', 'merge_commit', 'approved'),
|
|
225
232
|
).rejects.toMatchObject({
|
|
226
233
|
normalizedResponse: {
|
|
227
234
|
error: {
|
|
228
|
-
code: ERROR_CODES.GIT_FAILURE
|
|
229
|
-
}
|
|
230
|
-
}
|
|
235
|
+
code: ERROR_CODES.GIT_FAILURE,
|
|
236
|
+
},
|
|
237
|
+
},
|
|
231
238
|
});
|
|
232
239
|
|
|
233
240
|
const commitFailure = makeHarness();
|
|
@@ -236,13 +243,18 @@ describe('MergeService', () => {
|
|
|
236
243
|
.mockResolvedValueOnce(commandResult({ code: 1, stderr: 'commit failed' }));
|
|
237
244
|
|
|
238
245
|
await expect(
|
|
239
|
-
commitFailure.service.featureReadyToMerge(
|
|
246
|
+
commitFailure.service.featureReadyToMerge(
|
|
247
|
+
'feature_merge',
|
|
248
|
+
'merge',
|
|
249
|
+
'merge_commit',
|
|
250
|
+
'approved',
|
|
251
|
+
),
|
|
240
252
|
).rejects.toMatchObject({
|
|
241
253
|
normalizedResponse: {
|
|
242
254
|
error: {
|
|
243
|
-
code: ERROR_CODES.GIT_FAILURE
|
|
244
|
-
}
|
|
245
|
-
}
|
|
255
|
+
code: ERROR_CODES.GIT_FAILURE,
|
|
256
|
+
},
|
|
257
|
+
},
|
|
246
258
|
});
|
|
247
259
|
});
|
|
248
260
|
|
|
@@ -254,16 +266,21 @@ describe('MergeService', () => {
|
|
|
254
266
|
.mockResolvedValueOnce(commandResult({ code: 1, stderr: 'checkout failed' }));
|
|
255
267
|
|
|
256
268
|
await expect(
|
|
257
|
-
checkoutFailure.service.featureReadyToMerge(
|
|
269
|
+
checkoutFailure.service.featureReadyToMerge(
|
|
270
|
+
'feature_merge',
|
|
271
|
+
'merge',
|
|
272
|
+
'merge_commit',
|
|
273
|
+
'approved',
|
|
274
|
+
),
|
|
258
275
|
).rejects.toMatchObject({
|
|
259
276
|
normalizedResponse: {
|
|
260
277
|
error: {
|
|
261
278
|
code: ERROR_CODES.GIT_FAILURE,
|
|
262
279
|
details: {
|
|
263
|
-
requires_human: true
|
|
264
|
-
}
|
|
265
|
-
}
|
|
266
|
-
}
|
|
280
|
+
requires_human: true,
|
|
281
|
+
},
|
|
282
|
+
},
|
|
283
|
+
},
|
|
267
284
|
});
|
|
268
285
|
|
|
269
286
|
const rebaseFailure = makeHarness();
|
|
@@ -274,16 +291,16 @@ describe('MergeService', () => {
|
|
|
274
291
|
.mockResolvedValueOnce(commandResult({ code: 1, stderr: 'rebase failed' }));
|
|
275
292
|
|
|
276
293
|
await expect(
|
|
277
|
-
rebaseFailure.service.featureReadyToMerge('feature_merge', 'merge', 'rebase', 'approved')
|
|
294
|
+
rebaseFailure.service.featureReadyToMerge('feature_merge', 'merge', 'rebase', 'approved'),
|
|
278
295
|
).rejects.toMatchObject({
|
|
279
296
|
normalizedResponse: {
|
|
280
297
|
error: {
|
|
281
298
|
code: ERROR_CODES.GIT_FAILURE,
|
|
282
299
|
details: {
|
|
283
|
-
requires_human: true
|
|
284
|
-
}
|
|
285
|
-
}
|
|
286
|
-
}
|
|
300
|
+
requires_human: true,
|
|
301
|
+
},
|
|
302
|
+
},
|
|
303
|
+
},
|
|
287
304
|
});
|
|
288
305
|
});
|
|
289
306
|
|
|
@@ -297,16 +314,16 @@ describe('MergeService', () => {
|
|
|
297
314
|
.mockResolvedValueOnce(commandResult({ code: 1, stderr: 'squash commit failed' }));
|
|
298
315
|
|
|
299
316
|
await expect(
|
|
300
|
-
harness.service.featureReadyToMerge('feature_merge', 'merge', 'squash', 'approved')
|
|
317
|
+
harness.service.featureReadyToMerge('feature_merge', 'merge', 'squash', 'approved'),
|
|
301
318
|
).rejects.toMatchObject({
|
|
302
319
|
normalizedResponse: {
|
|
303
320
|
error: {
|
|
304
321
|
code: ERROR_CODES.GIT_FAILURE,
|
|
305
322
|
details: {
|
|
306
|
-
requires_human: true
|
|
307
|
-
}
|
|
308
|
-
}
|
|
309
|
-
}
|
|
323
|
+
requires_human: true,
|
|
324
|
+
},
|
|
325
|
+
},
|
|
326
|
+
},
|
|
310
327
|
});
|
|
311
328
|
});
|
|
312
329
|
|
|
@@ -314,9 +331,9 @@ describe('MergeService', () => {
|
|
|
314
331
|
const harness = makeHarness({
|
|
315
332
|
stateOverrides: {
|
|
316
333
|
locks: {
|
|
317
|
-
held: ['openapi', 42]
|
|
318
|
-
}
|
|
319
|
-
}
|
|
334
|
+
held: ['openapi', 42],
|
|
335
|
+
},
|
|
336
|
+
},
|
|
320
337
|
});
|
|
321
338
|
|
|
322
339
|
vi.mocked(runGit)
|
|
@@ -327,14 +344,19 @@ describe('MergeService', () => {
|
|
|
327
344
|
.mockResolvedValueOnce(commandResult())
|
|
328
345
|
.mockResolvedValueOnce(commandResult({ stdout: 'abc123\n' }));
|
|
329
346
|
|
|
330
|
-
const result = await harness.service.featureReadyToMerge(
|
|
347
|
+
const result = await harness.service.featureReadyToMerge(
|
|
348
|
+
'feature_merge',
|
|
349
|
+
'merge',
|
|
350
|
+
'rebase',
|
|
351
|
+
'approved',
|
|
352
|
+
);
|
|
331
353
|
|
|
332
354
|
expect(result.data).toMatchObject({
|
|
333
355
|
feature_id: 'feature_merge',
|
|
334
356
|
merge_sha: 'abc123',
|
|
335
357
|
merge_strategy: 'rebase',
|
|
336
358
|
status: STATUS.MERGED,
|
|
337
|
-
retained_for_cleanup: true
|
|
359
|
+
retained_for_cleanup: true,
|
|
338
360
|
});
|
|
339
361
|
expect(harness.state.frontMatter.status).toBe(STATUS.MERGED);
|
|
340
362
|
expect((harness.state.frontMatter.evidence as AnyRecord).merge_strategy).toBe('rebase');
|
|
@@ -348,7 +370,7 @@ describe('MergeService', () => {
|
|
|
348
370
|
expect(index.blocked_queue).toEqual([{ feature_id: 'other' }]);
|
|
349
371
|
expect(index.runtime_sessions.feature_sessions).not.toHaveProperty('feature_merge');
|
|
350
372
|
expect(index.runtime_sessions.feature_sessions.other).toMatchObject({
|
|
351
|
-
planner_session_id: 'planner-b'
|
|
373
|
+
planner_session_id: 'planner-b',
|
|
352
374
|
});
|
|
353
375
|
expect(rmMock).not.toHaveBeenCalled();
|
|
354
376
|
});
|
|
@@ -358,9 +380,9 @@ describe('MergeService', () => {
|
|
|
358
380
|
policyOverrides: {
|
|
359
381
|
cleanup: {
|
|
360
382
|
auto_after_merge: true,
|
|
361
|
-
grace_period_seconds: 0
|
|
362
|
-
}
|
|
363
|
-
}
|
|
383
|
+
grace_period_seconds: 0,
|
|
384
|
+
},
|
|
385
|
+
},
|
|
364
386
|
});
|
|
365
387
|
|
|
366
388
|
vi.mocked(runGit).mockImplementation(async (_repoRoot, args) => {
|
|
@@ -370,15 +392,28 @@ describe('MergeService', () => {
|
|
|
370
392
|
return commandResult();
|
|
371
393
|
});
|
|
372
394
|
|
|
373
|
-
const result = await harness.service.featureReadyToMerge(
|
|
395
|
+
const result = await harness.service.featureReadyToMerge(
|
|
396
|
+
'feature_merge',
|
|
397
|
+
'merge',
|
|
398
|
+
'merge_commit',
|
|
399
|
+
'approved',
|
|
400
|
+
);
|
|
374
401
|
|
|
375
402
|
expect(result.data).toMatchObject({
|
|
376
403
|
retained_for_cleanup: false,
|
|
377
|
-
cleanup_grace_period_seconds: 0
|
|
404
|
+
cleanup_grace_period_seconds: 0,
|
|
378
405
|
});
|
|
379
|
-
expect(runGit).toHaveBeenCalledWith('/repo', [
|
|
406
|
+
expect(runGit).toHaveBeenCalledWith('/repo', [
|
|
407
|
+
'worktree',
|
|
408
|
+
'remove',
|
|
409
|
+
'--force',
|
|
410
|
+
'/repo/.worktrees/feature_merge',
|
|
411
|
+
]);
|
|
380
412
|
expect(runGit).toHaveBeenCalledWith('/repo', ['branch', '-D', 'feature_merge']);
|
|
381
|
-
expect(rmMock).toHaveBeenCalledWith('/repo/.aop/features/feature_merge', {
|
|
413
|
+
expect(rmMock).toHaveBeenCalledWith('/repo/.aop/features/feature_merge', {
|
|
414
|
+
recursive: true,
|
|
415
|
+
force: true,
|
|
416
|
+
});
|
|
382
417
|
});
|
|
383
418
|
|
|
384
419
|
it('GIVEN_auto_cleanup_enabled_with_grace_WHEN_merge_succeeds_THEN_schedules_cleanup_after_delay', async () => {
|
|
@@ -388,9 +423,9 @@ describe('MergeService', () => {
|
|
|
388
423
|
policyOverrides: {
|
|
389
424
|
cleanup: {
|
|
390
425
|
auto_after_merge: true,
|
|
391
|
-
grace_period_seconds: 1
|
|
392
|
-
}
|
|
393
|
-
}
|
|
426
|
+
grace_period_seconds: 1,
|
|
427
|
+
},
|
|
428
|
+
},
|
|
394
429
|
});
|
|
395
430
|
|
|
396
431
|
vi.mocked(runGit).mockImplementation(async (_repoRoot, args) => {
|
|
@@ -400,19 +435,32 @@ describe('MergeService', () => {
|
|
|
400
435
|
return commandResult();
|
|
401
436
|
});
|
|
402
437
|
|
|
403
|
-
const result = await harness.service.featureReadyToMerge(
|
|
438
|
+
const result = await harness.service.featureReadyToMerge(
|
|
439
|
+
'feature_merge',
|
|
440
|
+
'merge',
|
|
441
|
+
'merge_commit',
|
|
442
|
+
'approved',
|
|
443
|
+
);
|
|
404
444
|
|
|
405
445
|
expect(result.data).toMatchObject({
|
|
406
446
|
retained_for_cleanup: true,
|
|
407
|
-
cleanup_grace_period_seconds: 1
|
|
447
|
+
cleanup_grace_period_seconds: 1,
|
|
408
448
|
});
|
|
409
449
|
expect(rmMock).not.toHaveBeenCalled();
|
|
410
450
|
|
|
411
451
|
await vi.advanceTimersByTimeAsync(1000);
|
|
412
452
|
|
|
413
|
-
expect(runGit).toHaveBeenCalledWith('/repo', [
|
|
453
|
+
expect(runGit).toHaveBeenCalledWith('/repo', [
|
|
454
|
+
'worktree',
|
|
455
|
+
'remove',
|
|
456
|
+
'--force',
|
|
457
|
+
'/repo/.worktrees/feature_merge',
|
|
458
|
+
]);
|
|
414
459
|
expect(runGit).toHaveBeenCalledWith('/repo', ['branch', '-D', 'feature_merge']);
|
|
415
|
-
expect(rmMock).toHaveBeenCalledWith('/repo/.aop/features/feature_merge', {
|
|
460
|
+
expect(rmMock).toHaveBeenCalledWith('/repo/.aop/features/feature_merge', {
|
|
461
|
+
recursive: true,
|
|
462
|
+
force: true,
|
|
463
|
+
});
|
|
416
464
|
} finally {
|
|
417
465
|
vi.useRealTimers();
|
|
418
466
|
}
|
|
@@ -12,8 +12,8 @@ const kernelCtorMock = vi.hoisted(() => vi.fn());
|
|
|
12
12
|
const toolCallMock = vi.hoisted(() =>
|
|
13
13
|
vi.fn(async () => ({
|
|
14
14
|
ok: true,
|
|
15
|
-
data: { features: [{ feature_id: 'feat-a', status: 'planning' }] }
|
|
16
|
-
}))
|
|
15
|
+
data: { features: [{ feature_id: 'feat-a', status: 'planning' }] },
|
|
16
|
+
})),
|
|
17
17
|
);
|
|
18
18
|
|
|
19
19
|
vi.mock('../src/core/kernel.js', () => {
|
|
@@ -51,23 +51,29 @@ vi.mock('../src/core/kernel.js', () => {
|
|
|
51
51
|
|
|
52
52
|
vi.mock('../src/mcp/runtime-factory.js', () => ({
|
|
53
53
|
createToolingRuntime: createToolingRuntimeMock,
|
|
54
|
-
resolveToolClient: resolveToolClientMock
|
|
54
|
+
resolveToolClient: resolveToolClientMock,
|
|
55
55
|
}));
|
|
56
56
|
|
|
57
57
|
// ── helpers ───────────────────────────────────────────────────────────────────
|
|
58
58
|
|
|
59
59
|
async function writeMultiProjectYaml(dir: string, content: string): Promise<void> {
|
|
60
|
-
const configDir = path.join(dir, 'agentic', 'orchestrator');
|
|
60
|
+
const configDir = path.join(dir, 'config', 'agentic', 'orchestrator');
|
|
61
61
|
await fs.mkdir(configDir, { recursive: true });
|
|
62
62
|
await fs.writeFile(path.join(configDir, 'multi-project.yaml'), content, 'utf8');
|
|
63
63
|
}
|
|
64
64
|
|
|
65
65
|
async function writeSchemaFile(dir: string): Promise<void> {
|
|
66
|
-
const schemasDir = path.join(dir, 'agentic', 'orchestrator', 'schemas');
|
|
66
|
+
const schemasDir = path.join(dir, 'config', 'agentic', 'orchestrator', 'schemas');
|
|
67
67
|
await fs.mkdir(schemasDir, { recursive: true });
|
|
68
68
|
// Resolve repo root: test/ -> control-plane/ -> apps/ -> repo root
|
|
69
69
|
const repoRoot = path.resolve(import.meta.dirname, '../../../');
|
|
70
|
-
const srcSchema = path.join(
|
|
70
|
+
const srcSchema = path.join(
|
|
71
|
+
repoRoot,
|
|
72
|
+
'agentic',
|
|
73
|
+
'orchestrator',
|
|
74
|
+
'schemas',
|
|
75
|
+
'multi-project.schema.json',
|
|
76
|
+
);
|
|
71
77
|
const destSchema = path.join(schemasDir, 'multi-project.schema.json');
|
|
72
78
|
await fs.copyFile(srcSchema, destSchema);
|
|
73
79
|
}
|
|
@@ -111,7 +117,7 @@ projects:
|
|
|
111
117
|
- name: beta
|
|
112
118
|
path: ~/projects/beta
|
|
113
119
|
repo: https://github.com/org/beta
|
|
114
|
-
|
|
120
|
+
`,
|
|
115
121
|
);
|
|
116
122
|
|
|
117
123
|
const { MultiProjectLoader } = await import('../src/application/multi-project-loader.js');
|
|
@@ -141,7 +147,7 @@ projects:
|
|
|
141
147
|
`
|
|
142
148
|
version: "1.0"
|
|
143
149
|
projects: []
|
|
144
|
-
|
|
150
|
+
`,
|
|
145
151
|
);
|
|
146
152
|
|
|
147
153
|
const { MultiProjectLoader } = await import('../src/application/multi-project-loader.js');
|
|
@@ -159,7 +165,7 @@ projects:
|
|
|
159
165
|
path: /tmp/alpha
|
|
160
166
|
- name: beta
|
|
161
167
|
path: /tmp/beta
|
|
162
|
-
|
|
168
|
+
`,
|
|
163
169
|
);
|
|
164
170
|
const { MultiProjectLoader } = await import('../src/application/multi-project-loader.js');
|
|
165
171
|
const loader = new MultiProjectLoader();
|
|
@@ -204,20 +210,20 @@ version: "1.0"
|
|
|
204
210
|
projects:
|
|
205
211
|
- name: alpha
|
|
206
212
|
path: /tmp/alpha
|
|
207
|
-
|
|
213
|
+
`,
|
|
208
214
|
);
|
|
209
215
|
|
|
210
216
|
const { runCli } = await import('../src/interfaces/cli/bootstrap.js');
|
|
211
217
|
const code = await runCli(['status', '--project', 'nonexistent'], {
|
|
212
218
|
cwd: tmpDir,
|
|
213
|
-
env: process.env
|
|
219
|
+
env: process.env,
|
|
214
220
|
});
|
|
215
221
|
|
|
216
222
|
const writes = asJsonWrites(stdoutSpy);
|
|
217
223
|
expect(code).toBe(1);
|
|
218
224
|
expect(writes[0]).toMatchObject({
|
|
219
225
|
ok: false,
|
|
220
|
-
error: expect.objectContaining({ message: expect.stringContaining('nonexistent') })
|
|
226
|
+
error: expect.objectContaining({ message: expect.stringContaining('nonexistent') }),
|
|
221
227
|
});
|
|
222
228
|
});
|
|
223
229
|
|
|
@@ -233,7 +239,7 @@ version: "1.0"
|
|
|
233
239
|
projects:
|
|
234
240
|
- name: alpha
|
|
235
241
|
path: ${projectPath}
|
|
236
|
-
|
|
242
|
+
`,
|
|
237
243
|
);
|
|
238
244
|
|
|
239
245
|
const capturedRoots: string[] = [];
|
|
@@ -265,7 +271,7 @@ projects:
|
|
|
265
271
|
path: ${projectAlpha}
|
|
266
272
|
- name: beta
|
|
267
273
|
path: ${projectBeta}
|
|
268
|
-
|
|
274
|
+
`,
|
|
269
275
|
);
|
|
270
276
|
|
|
271
277
|
const capturedRoots: string[] = [];
|
|
@@ -300,7 +306,7 @@ projects:
|
|
|
300
306
|
path: ${projectAlpha}
|
|
301
307
|
- name: beta
|
|
302
308
|
path: ${projectBeta}
|
|
303
|
-
|
|
309
|
+
`,
|
|
304
310
|
);
|
|
305
311
|
|
|
306
312
|
const capturedRoots: string[] = [];
|
|
@@ -337,27 +343,27 @@ projects:
|
|
|
337
343
|
`
|
|
338
344
|
version: "1.0"
|
|
339
345
|
defaults:
|
|
340
|
-
policy: agentic/orchestrator/policy.yaml
|
|
341
|
-
gates: agentic/orchestrator/gates.yaml
|
|
346
|
+
policy: config/agentic/orchestrator/policy.yaml
|
|
347
|
+
gates: config/agentic/orchestrator/gates.yaml
|
|
342
348
|
projects:
|
|
343
349
|
- name: alpha
|
|
344
350
|
path: ${projectAlpha}
|
|
345
|
-
|
|
351
|
+
`,
|
|
346
352
|
);
|
|
347
353
|
|
|
348
354
|
const { runCli } = await import('../src/interfaces/cli/bootstrap.js');
|
|
349
355
|
const code = await runCli(['status', '--project', 'alpha'], {
|
|
350
356
|
cwd: tmpDir,
|
|
351
|
-
env: process.env
|
|
357
|
+
env: process.env,
|
|
352
358
|
});
|
|
353
359
|
|
|
354
360
|
expect(code).toBe(0);
|
|
355
361
|
expect(kernelCtorMock).toHaveBeenCalledWith(
|
|
356
362
|
projectAlpha,
|
|
357
363
|
expect.objectContaining({
|
|
358
|
-
policyPath: path.join(projectAlpha, 'agentic', 'orchestrator', 'policy.yaml'),
|
|
359
|
-
gatesPath: path.join(projectAlpha, 'agentic', 'orchestrator', 'gates.yaml')
|
|
360
|
-
})
|
|
364
|
+
policyPath: path.join(projectAlpha, 'config', 'agentic', 'orchestrator', 'policy.yaml'),
|
|
365
|
+
gatesPath: path.join(projectAlpha, 'config', 'agentic', 'orchestrator', 'gates.yaml'),
|
|
366
|
+
}),
|
|
361
367
|
);
|
|
362
368
|
});
|
|
363
369
|
});
|