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,7 +4,11 @@ import { sortResourcesDeterministically } from '../../core/path-rules.js';
|
|
|
4
4
|
import { ERROR_CODES } from '../../core/error-codes.js';
|
|
5
5
|
import { fail } from '../../core/response.js';
|
|
6
6
|
import { GATE_RESULT, STATUS } from '../../core/constants.js';
|
|
7
|
-
import {
|
|
7
|
+
import {
|
|
8
|
+
getUnresolvedDeps,
|
|
9
|
+
detectCircularDependency,
|
|
10
|
+
addToDepBlocked,
|
|
11
|
+
} from './dependency-scheduler-service.js';
|
|
8
12
|
|
|
9
13
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
10
14
|
type AnyRecord = Record<string, any>;
|
|
@@ -15,7 +19,7 @@ type StateReadResult = {
|
|
|
15
19
|
|
|
16
20
|
type StateUpdater = (
|
|
17
21
|
frontMatter: AnyRecord,
|
|
18
|
-
body: string
|
|
22
|
+
body: string,
|
|
19
23
|
) => Promise<{ frontMatter?: AnyRecord; body?: string }>;
|
|
20
24
|
|
|
21
25
|
function asArray<T = unknown>(value: unknown): T[] {
|
|
@@ -46,7 +50,11 @@ export interface PlanServicePort {
|
|
|
46
50
|
withIndexLock<T>(operation: () => Promise<T>): Promise<T>;
|
|
47
51
|
readIndex(): Promise<AnyRecord>;
|
|
48
52
|
writeIndex(index: AnyRecord): Promise<void>;
|
|
49
|
-
updateState(
|
|
53
|
+
updateState(
|
|
54
|
+
featureId: string,
|
|
55
|
+
expectedVersion: number | null,
|
|
56
|
+
updater: StateUpdater,
|
|
57
|
+
): Promise<AnyRecord>;
|
|
50
58
|
}
|
|
51
59
|
|
|
52
60
|
export class PlanService {
|
|
@@ -61,8 +69,8 @@ export class PlanService {
|
|
|
61
69
|
return {
|
|
62
70
|
data: {
|
|
63
71
|
feature_id: featureId,
|
|
64
|
-
plan
|
|
65
|
-
}
|
|
72
|
+
plan,
|
|
73
|
+
},
|
|
66
74
|
};
|
|
67
75
|
}
|
|
68
76
|
|
|
@@ -103,25 +111,37 @@ export class PlanService {
|
|
|
103
111
|
const missing = required.filter((resource) => !held.has(resource));
|
|
104
112
|
if (missing.length > 0) {
|
|
105
113
|
throw {
|
|
106
|
-
normalizedResponse: fail(
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
114
|
+
normalizedResponse: fail(
|
|
115
|
+
ERROR_CODES.LOCK_NOT_HELD,
|
|
116
|
+
'Plan requires lock(s) that are not held',
|
|
117
|
+
{
|
|
118
|
+
feature_id: featureId,
|
|
119
|
+
missing_resources: missing,
|
|
120
|
+
retryable: true,
|
|
121
|
+
requires_human: false,
|
|
122
|
+
suggested_next_actions: ['Acquire required locks before submitting plan'],
|
|
123
|
+
},
|
|
124
|
+
),
|
|
113
125
|
};
|
|
114
126
|
}
|
|
115
127
|
}
|
|
116
128
|
|
|
117
|
-
validatePlanRevisionRules(
|
|
129
|
+
validatePlanRevisionRules(
|
|
130
|
+
existingPlan: AnyRecord | null,
|
|
131
|
+
plan: AnyRecord,
|
|
132
|
+
expectedPlanVersion: number | null = null,
|
|
133
|
+
): void {
|
|
118
134
|
if (!existingPlan) {
|
|
119
135
|
if (plan.plan_version !== 1 || plan.revision_of != null) {
|
|
120
136
|
throw {
|
|
121
|
-
normalizedResponse: fail(
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
137
|
+
normalizedResponse: fail(
|
|
138
|
+
ERROR_CODES.PLAN_VALIDATION_FAILED,
|
|
139
|
+
'Initial plan must be version 1 without revision_of',
|
|
140
|
+
{
|
|
141
|
+
retryable: false,
|
|
142
|
+
requires_human: true,
|
|
143
|
+
},
|
|
144
|
+
),
|
|
125
145
|
};
|
|
126
146
|
}
|
|
127
147
|
return;
|
|
@@ -133,17 +153,21 @@ export class PlanService {
|
|
|
133
153
|
expected_plan_version: expectedPlanVersion,
|
|
134
154
|
actual_plan_version: existingPlan.plan_version,
|
|
135
155
|
retryable: true,
|
|
136
|
-
requires_human: false
|
|
137
|
-
})
|
|
156
|
+
requires_human: false,
|
|
157
|
+
}),
|
|
138
158
|
};
|
|
139
159
|
}
|
|
140
160
|
|
|
141
161
|
if (plan.plan_version !== expectedPlanVersion + 1 || plan.revision_of !== expectedPlanVersion) {
|
|
142
162
|
throw {
|
|
143
|
-
normalizedResponse: fail(
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
163
|
+
normalizedResponse: fail(
|
|
164
|
+
ERROR_CODES.PLAN_VALIDATION_FAILED,
|
|
165
|
+
'Invalid plan revision metadata',
|
|
166
|
+
{
|
|
167
|
+
retryable: false,
|
|
168
|
+
requires_human: true,
|
|
169
|
+
},
|
|
170
|
+
),
|
|
147
171
|
};
|
|
148
172
|
}
|
|
149
173
|
}
|
|
@@ -152,11 +176,15 @@ export class PlanService {
|
|
|
152
176
|
const validation = await this.port.validateSchema('plan.schema.json', plan);
|
|
153
177
|
if (!validation.valid) {
|
|
154
178
|
throw {
|
|
155
|
-
normalizedResponse: fail(
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
179
|
+
normalizedResponse: fail(
|
|
180
|
+
ERROR_CODES.PLAN_VALIDATION_FAILED,
|
|
181
|
+
'plan.json failed schema validation',
|
|
182
|
+
{
|
|
183
|
+
errors: validation.errors,
|
|
184
|
+
retryable: false,
|
|
185
|
+
requires_human: true,
|
|
186
|
+
},
|
|
187
|
+
),
|
|
160
188
|
};
|
|
161
189
|
}
|
|
162
190
|
}
|
|
@@ -167,7 +195,7 @@ export class PlanService {
|
|
|
167
195
|
const collisionResult = detectPlanCollisions(
|
|
168
196
|
plan as Parameters<typeof detectPlanCollisions>[0],
|
|
169
197
|
acceptedPlans as Parameters<typeof detectPlanCollisions>[1],
|
|
170
|
-
policy as Parameters<typeof detectPlanCollisions>[2]
|
|
198
|
+
policy as Parameters<typeof detectPlanCollisions>[2],
|
|
171
199
|
);
|
|
172
200
|
|
|
173
201
|
if (!collisionResult.hasCollisions) {
|
|
@@ -176,26 +204,30 @@ export class PlanService {
|
|
|
176
204
|
|
|
177
205
|
if (policy.collision_policy === 'reject') {
|
|
178
206
|
throw {
|
|
179
|
-
normalizedResponse: fail(
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
collisionResult.collisions
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
207
|
+
normalizedResponse: fail(
|
|
208
|
+
ERROR_CODES.COLLISION_DETECTED,
|
|
209
|
+
'Plan collides with accepted plans',
|
|
210
|
+
{
|
|
211
|
+
feature_id: featureId,
|
|
212
|
+
collisions: collisionResult.collisions,
|
|
213
|
+
collision_fingerprint: collisionResult.fingerprint,
|
|
214
|
+
conflicting_feature_ids: normalizeSet(
|
|
215
|
+
collisionResult.collisions.files
|
|
216
|
+
.map((x) => x.with_feature_id)
|
|
217
|
+
.concat(
|
|
218
|
+
collisionResult.collisions.areas.map((x) => x.with_feature_id),
|
|
219
|
+
collisionResult.collisions.contracts.map((x) => x.with_feature_id),
|
|
220
|
+
),
|
|
221
|
+
),
|
|
222
|
+
retryable: false,
|
|
223
|
+
requires_human: true,
|
|
224
|
+
suggested_next_actions: [
|
|
225
|
+
'Acquire relevant lock and resubmit',
|
|
226
|
+
'Revise plan scope to avoid overlap',
|
|
227
|
+
'Create shared prerequisite feature',
|
|
228
|
+
],
|
|
229
|
+
},
|
|
230
|
+
),
|
|
199
231
|
};
|
|
200
232
|
}
|
|
201
233
|
|
|
@@ -207,10 +239,11 @@ export class PlanService {
|
|
|
207
239
|
detected_at: nowIso(),
|
|
208
240
|
collision_fingerprint: collisionResult.fingerprint,
|
|
209
241
|
required_resources: await this.requiredResourcesForPlan(plan),
|
|
210
|
-
plan_snapshot: plan
|
|
242
|
+
plan_snapshot: plan,
|
|
211
243
|
});
|
|
212
244
|
index.blocked_queue.sort(
|
|
213
|
-
(a: AnyRecord, b: AnyRecord) =>
|
|
245
|
+
(a: AnyRecord, b: AnyRecord) =>
|
|
246
|
+
a.detected_at.localeCompare(b.detected_at) || a.feature_id.localeCompare(b.feature_id),
|
|
214
247
|
);
|
|
215
248
|
index.version += 1;
|
|
216
249
|
index.updated_at = nowIso();
|
|
@@ -218,39 +251,53 @@ export class PlanService {
|
|
|
218
251
|
});
|
|
219
252
|
|
|
220
253
|
throw {
|
|
221
|
-
normalizedResponse: fail(
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
254
|
+
normalizedResponse: fail(
|
|
255
|
+
ERROR_CODES.BLOCKED_BY_COLLISION_POLICY,
|
|
256
|
+
'Plan queued due to collision policy=block',
|
|
257
|
+
{
|
|
258
|
+
feature_id: featureId,
|
|
259
|
+
collision_fingerprint: collisionResult.fingerprint,
|
|
260
|
+
collisions: collisionResult.collisions,
|
|
261
|
+
retryable: true,
|
|
262
|
+
requires_human: false,
|
|
263
|
+
},
|
|
264
|
+
),
|
|
228
265
|
};
|
|
229
266
|
}
|
|
230
267
|
|
|
231
268
|
async checkDependencies(featureId: string | null): Promise<void> {
|
|
232
|
-
if (!featureId) {
|
|
269
|
+
if (!featureId) {
|
|
270
|
+
return;
|
|
271
|
+
}
|
|
233
272
|
const state = await this.port.readState(featureId);
|
|
234
273
|
const dependsOn: string[] = Array.isArray(state.frontMatter.depends_on)
|
|
235
274
|
? (state.frontMatter.depends_on as string[]).filter((d): d is string => typeof d === 'string')
|
|
236
275
|
: [];
|
|
237
|
-
if (dependsOn.length === 0) {
|
|
276
|
+
if (dependsOn.length === 0) {
|
|
277
|
+
return;
|
|
278
|
+
}
|
|
238
279
|
|
|
239
280
|
// Circular detection: traverse the dependency chain
|
|
240
281
|
const depsCache = new Map<string, string[]>([[featureId, dependsOn]]);
|
|
241
282
|
const getDirectDeps = (id: string): string[] => {
|
|
242
|
-
if (depsCache.has(id)) {
|
|
283
|
+
if (depsCache.has(id)) {
|
|
284
|
+
return depsCache.get(id);
|
|
285
|
+
}
|
|
243
286
|
return [];
|
|
244
287
|
};
|
|
245
288
|
const cycle = detectCircularDependency(featureId, getDirectDeps);
|
|
246
289
|
if (cycle) {
|
|
247
290
|
throw {
|
|
248
|
-
normalizedResponse: fail(
|
|
249
|
-
|
|
250
|
-
cycle
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
291
|
+
normalizedResponse: fail(
|
|
292
|
+
ERROR_CODES.DEPENDENCY_CIRCULAR,
|
|
293
|
+
`Circular dependency detected: ${cycle}`,
|
|
294
|
+
{
|
|
295
|
+
feature_id: featureId,
|
|
296
|
+
cycle,
|
|
297
|
+
retryable: false,
|
|
298
|
+
requires_human: true,
|
|
299
|
+
},
|
|
300
|
+
),
|
|
254
301
|
};
|
|
255
302
|
}
|
|
256
303
|
|
|
@@ -265,12 +312,16 @@ export class PlanService {
|
|
|
265
312
|
await this.port.writeIndex(idx);
|
|
266
313
|
});
|
|
267
314
|
throw {
|
|
268
|
-
normalizedResponse: fail(
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
315
|
+
normalizedResponse: fail(
|
|
316
|
+
ERROR_CODES.DEPENDENCY_UNRESOLVED,
|
|
317
|
+
'Plan deferred: dependencies not yet merged',
|
|
318
|
+
{
|
|
319
|
+
feature_id: featureId,
|
|
320
|
+
depends_on_unresolved: unresolved,
|
|
321
|
+
retryable: true,
|
|
322
|
+
requires_human: false,
|
|
323
|
+
},
|
|
324
|
+
),
|
|
274
325
|
};
|
|
275
326
|
}
|
|
276
327
|
}
|
|
@@ -278,25 +329,29 @@ export class PlanService {
|
|
|
278
329
|
async planSubmit(
|
|
279
330
|
featureId: string | null,
|
|
280
331
|
plan: AnyRecord | null,
|
|
281
|
-
expectedVersion: number | null = null
|
|
332
|
+
expectedVersion: number | null = null,
|
|
282
333
|
): Promise<{ data: { feature_id: string | null; accepted: boolean; plan_version: number } }> {
|
|
283
334
|
if (!plan || typeof plan !== 'object') {
|
|
284
335
|
throw {
|
|
285
336
|
normalizedResponse: fail(ERROR_CODES.INVALID_ARGUMENT, 'plan_json is required', {
|
|
286
337
|
retryable: false,
|
|
287
|
-
requires_human: true
|
|
288
|
-
})
|
|
338
|
+
requires_human: true,
|
|
339
|
+
}),
|
|
289
340
|
};
|
|
290
341
|
}
|
|
291
342
|
|
|
292
343
|
if (plan.feature_id !== featureId) {
|
|
293
344
|
throw {
|
|
294
|
-
normalizedResponse: fail(
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
345
|
+
normalizedResponse: fail(
|
|
346
|
+
ERROR_CODES.INVALID_ARGUMENT,
|
|
347
|
+
'plan.feature_id must match feature_id',
|
|
348
|
+
{
|
|
349
|
+
feature_id: featureId,
|
|
350
|
+
plan_feature_id: plan.feature_id,
|
|
351
|
+
retryable: false,
|
|
352
|
+
requires_human: true,
|
|
353
|
+
},
|
|
354
|
+
),
|
|
300
355
|
};
|
|
301
356
|
}
|
|
302
357
|
|
|
@@ -325,16 +380,16 @@ export class PlanService {
|
|
|
325
380
|
gate_profile: plan.gate_profile,
|
|
326
381
|
gates: {
|
|
327
382
|
...frontMatter.gates,
|
|
328
|
-
plan: GATE_RESULT.PASS
|
|
383
|
+
plan: GATE_RESULT.PASS,
|
|
329
384
|
},
|
|
330
385
|
status: nextStatus,
|
|
331
386
|
collisions: {
|
|
332
387
|
files: [],
|
|
333
388
|
areas: [],
|
|
334
|
-
contracts: []
|
|
335
|
-
}
|
|
389
|
+
contracts: [],
|
|
390
|
+
},
|
|
336
391
|
},
|
|
337
|
-
body
|
|
392
|
+
body,
|
|
338
393
|
});
|
|
339
394
|
});
|
|
340
395
|
|
|
@@ -342,12 +397,16 @@ export class PlanService {
|
|
|
342
397
|
data: {
|
|
343
398
|
feature_id: featureId,
|
|
344
399
|
accepted: true,
|
|
345
|
-
plan_version: plan.plan_version
|
|
346
|
-
}
|
|
400
|
+
plan_version: plan.plan_version,
|
|
401
|
+
},
|
|
347
402
|
};
|
|
348
403
|
}
|
|
349
404
|
|
|
350
|
-
async planUpdate(
|
|
405
|
+
async planUpdate(
|
|
406
|
+
featureId: string | null,
|
|
407
|
+
expectedPlanVersion: number | null,
|
|
408
|
+
plan: AnyRecord | null,
|
|
409
|
+
) {
|
|
351
410
|
return await this.planSubmit(featureId, plan, expectedPlanVersion);
|
|
352
411
|
}
|
|
353
412
|
}
|
|
@@ -15,7 +15,13 @@ export interface LoadPolicyResult {
|
|
|
15
15
|
function resolveBundledDefaultsPath(startDir: string): string | null {
|
|
16
16
|
let current = path.resolve(startDir);
|
|
17
17
|
while (true) {
|
|
18
|
-
const candidate = path.join(
|
|
18
|
+
const candidate = path.join(
|
|
19
|
+
current,
|
|
20
|
+
'agentic',
|
|
21
|
+
'orchestrator',
|
|
22
|
+
'defaults',
|
|
23
|
+
'policy.defaults.yaml',
|
|
24
|
+
);
|
|
19
25
|
if (fsSync.existsSync(candidate)) {
|
|
20
26
|
return candidate;
|
|
21
27
|
}
|
|
@@ -85,12 +91,12 @@ export function mergePolicy(defaults: unknown, user: unknown): unknown {
|
|
|
85
91
|
export async function loadComposedPolicy(
|
|
86
92
|
_repoRoot: string,
|
|
87
93
|
policyPath: string,
|
|
88
|
-
schemaRegistry: SchemaValidator
|
|
94
|
+
schemaRegistry: SchemaValidator,
|
|
89
95
|
): Promise<LoadPolicyResult> {
|
|
90
96
|
if (!BUNDLED_DEFAULTS_PATH) {
|
|
91
97
|
throw new Error(
|
|
92
98
|
'policy_defaults_not_found: bundled defaults artifact could not be located; ' +
|
|
93
|
-
'ensure agentic/orchestrator/defaults/policy.defaults.yaml exists in the AOP installation'
|
|
99
|
+
'ensure agentic/orchestrator/defaults/policy.defaults.yaml exists in the AOP installation',
|
|
94
100
|
);
|
|
95
101
|
}
|
|
96
102
|
|
|
@@ -107,7 +113,7 @@ export async function loadComposedPolicy(
|
|
|
107
113
|
const messages = validation.errors.map((e) => e.message ?? String(e)).join('; ');
|
|
108
114
|
throw new Error(
|
|
109
115
|
`invalid_policy_yaml: ${messages} ` +
|
|
110
|
-
`(merged from ${policyPath} over bundled defaults; check policy.yaml for invalid overrides)
|
|
116
|
+
`(merged from ${policyPath} over bundled defaults; check policy.yaml for invalid overrides)`,
|
|
111
117
|
);
|
|
112
118
|
}
|
|
113
119
|
|
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
import { execFile } from 'node:child_process';
|
|
2
2
|
import { promisify } from 'node:util';
|
|
3
3
|
import { TOOLS } from '../../core/constants.js';
|
|
4
|
-
import type {
|
|
4
|
+
import type {
|
|
5
|
+
FeatureStatePayload,
|
|
6
|
+
ToolCaller as SupervisorToolCaller,
|
|
7
|
+
} from '../../core/tool-caller.js';
|
|
5
8
|
import type { NotifierService } from './notifier-service.js';
|
|
6
9
|
|
|
7
10
|
const execFileAsync = promisify(execFile);
|
|
@@ -75,7 +78,9 @@ function mapCiStatus(checks: Array<{ state: string }> | null | undefined): CiSta
|
|
|
75
78
|
if (upper.some((s) => s === 'FAILURE' || s === 'ERROR')) {
|
|
76
79
|
return 'failing';
|
|
77
80
|
}
|
|
78
|
-
if (
|
|
81
|
+
if (
|
|
82
|
+
upper.some((s) => s === 'PENDING' || s === 'IN_PROGRESS' || s === 'EXPECTED' || s === 'WAITING')
|
|
83
|
+
) {
|
|
79
84
|
return 'pending';
|
|
80
85
|
}
|
|
81
86
|
return 'passing';
|
|
@@ -111,12 +116,20 @@ export class PrMonitorService {
|
|
|
111
116
|
}
|
|
112
117
|
|
|
113
118
|
async detectPr(featureId: string, branch: string): Promise<PrInfo | null> {
|
|
114
|
-
const candidates = [
|
|
119
|
+
const candidates = [
|
|
120
|
+
...new Set(
|
|
121
|
+
[branch, featureId, `feature/${featureId}`].map((value) => value.trim()).filter(Boolean),
|
|
122
|
+
),
|
|
123
|
+
];
|
|
115
124
|
let parsed: GhPrViewResult | null = null;
|
|
116
125
|
for (const candidate of candidates) {
|
|
117
126
|
const result = await this.ghRunner([
|
|
118
|
-
'pr',
|
|
119
|
-
'
|
|
127
|
+
'pr',
|
|
128
|
+
'view',
|
|
129
|
+
'--head',
|
|
130
|
+
candidate,
|
|
131
|
+
'--json',
|
|
132
|
+
'number,url,statusCheckRollup,reviewDecision,mergeable,reviewThreads',
|
|
120
133
|
]);
|
|
121
134
|
|
|
122
135
|
if (result.exitCode !== 0 || !result.stdout.trim()) {
|
|
@@ -152,7 +165,7 @@ export class PrMonitorService {
|
|
|
152
165
|
review_decision,
|
|
153
166
|
merge_ready,
|
|
154
167
|
pending_review_threads,
|
|
155
|
-
has_conflicts
|
|
168
|
+
has_conflicts,
|
|
156
169
|
};
|
|
157
170
|
const merge_score = this.computeMergeScore({ ...partial, merge_score: 0 });
|
|
158
171
|
return { ...partial, merge_score };
|
|
@@ -162,7 +175,7 @@ export class PrMonitorService {
|
|
|
162
175
|
const current = await this.toolCaller.callTool<FeatureStatePayload>(
|
|
163
176
|
'orchestrator',
|
|
164
177
|
TOOLS.FEATURE_STATE_GET,
|
|
165
|
-
{ feature_id: featureId }
|
|
178
|
+
{ feature_id: featureId },
|
|
166
179
|
);
|
|
167
180
|
|
|
168
181
|
await this.toolCaller.callTool('orchestrator', TOOLS.FEATURE_STATE_PATCH, {
|
|
@@ -178,10 +191,10 @@ export class PrMonitorService {
|
|
|
178
191
|
merge_ready: prInfo.merge_ready,
|
|
179
192
|
pending_review_threads: prInfo.pending_review_threads,
|
|
180
193
|
has_conflicts: prInfo.has_conflicts,
|
|
181
|
-
merge_score: prInfo.merge_score
|
|
182
|
-
}
|
|
183
|
-
}
|
|
184
|
-
}
|
|
194
|
+
merge_score: prInfo.merge_score,
|
|
195
|
+
},
|
|
196
|
+
},
|
|
197
|
+
},
|
|
185
198
|
});
|
|
186
199
|
}
|
|
187
200
|
|
|
@@ -211,7 +224,13 @@ export class PrMonitorService {
|
|
|
211
224
|
return;
|
|
212
225
|
}
|
|
213
226
|
|
|
214
|
-
const reviewResult = await this.ghRunner([
|
|
227
|
+
const reviewResult = await this.ghRunner([
|
|
228
|
+
'pr',
|
|
229
|
+
'view',
|
|
230
|
+
String(prInfo.number),
|
|
231
|
+
'--json',
|
|
232
|
+
'reviews',
|
|
233
|
+
]);
|
|
215
234
|
|
|
216
235
|
let reviewBody = '';
|
|
217
236
|
if (reviewResult.exitCode === 0 && reviewResult.stdout.trim()) {
|
|
@@ -226,7 +245,7 @@ export class PrMonitorService {
|
|
|
226
245
|
|
|
227
246
|
await this.toolCaller.callTool('orchestrator', TOOLS.FEATURE_LOG_APPEND, {
|
|
228
247
|
feature_id: featureId,
|
|
229
|
-
note: `PR #${prInfo.number} changes requested. Review context:\n${reviewBody}
|
|
248
|
+
note: `PR #${prInfo.number} changes requested. Review context:\n${reviewBody}`,
|
|
230
249
|
});
|
|
231
250
|
|
|
232
251
|
await this.toolCaller
|
|
@@ -240,7 +259,7 @@ export class PrMonitorService {
|
|
|
240
259
|
await this.notifier.notify('changes_requested', {
|
|
241
260
|
feature_id: featureId,
|
|
242
261
|
message: `PR #${prInfo.number} has changes requested for feature '${featureId}'.`,
|
|
243
|
-
details: { pr_number: prInfo.number, pr_url: prInfo.url }
|
|
262
|
+
details: { pr_number: prInfo.number, pr_url: prInfo.url },
|
|
244
263
|
});
|
|
245
264
|
}
|
|
246
265
|
}
|
|
@@ -29,7 +29,7 @@ export class QaIndexService {
|
|
|
29
29
|
feature_id: featureId,
|
|
30
30
|
version: 1,
|
|
31
31
|
source_diff_ref: stableHash('empty'),
|
|
32
|
-
items: []
|
|
32
|
+
items: [],
|
|
33
33
|
});
|
|
34
34
|
|
|
35
35
|
const validation = await this.port.validateSchema('qa_test_index.schema.json', index);
|
|
@@ -38,8 +38,8 @@ export class QaIndexService {
|
|
|
38
38
|
normalizedResponse: fail(ERROR_CODES.INTERNAL_ERROR, 'qa_test_index file is invalid', {
|
|
39
39
|
errors: validation.errors,
|
|
40
40
|
retryable: false,
|
|
41
|
-
requires_human: true
|
|
42
|
-
})
|
|
41
|
+
requires_human: true,
|
|
42
|
+
}),
|
|
43
43
|
};
|
|
44
44
|
}
|
|
45
45
|
|
|
@@ -48,8 +48,8 @@ export class QaIndexService {
|
|
|
48
48
|
data: {
|
|
49
49
|
index,
|
|
50
50
|
summary: summary.summary,
|
|
51
|
-
pending_required_tests: summary.pending_by_file
|
|
52
|
-
}
|
|
51
|
+
pending_required_tests: summary.pending_by_file,
|
|
52
|
+
},
|
|
53
53
|
};
|
|
54
54
|
}
|
|
55
55
|
|
|
@@ -57,15 +57,15 @@ export class QaIndexService {
|
|
|
57
57
|
featureId: string,
|
|
58
58
|
expectedVersion: number | null,
|
|
59
59
|
updates: unknown,
|
|
60
|
-
evidenceRefs: unknown[]
|
|
60
|
+
evidenceRefs: unknown[],
|
|
61
61
|
): Promise<{ data: { feature_id: string; version: number } }> {
|
|
62
62
|
const current = await readJson(this.port.qaIndexPath(featureId), null);
|
|
63
63
|
if (!current) {
|
|
64
64
|
throw {
|
|
65
65
|
normalizedResponse: fail(ERROR_CODES.FILE_NOT_FOUND, 'qa_test_index.json not found', {
|
|
66
66
|
retryable: false,
|
|
67
|
-
requires_human: true
|
|
68
|
-
})
|
|
67
|
+
requires_human: true,
|
|
68
|
+
}),
|
|
69
69
|
};
|
|
70
70
|
}
|
|
71
71
|
|
|
@@ -73,16 +73,20 @@ export class QaIndexService {
|
|
|
73
73
|
current,
|
|
74
74
|
expectedVersion,
|
|
75
75
|
updates as Parameters<typeof applyQaUpdates>[2],
|
|
76
|
-
evidenceRefs as Parameters<typeof applyQaUpdates>[3]
|
|
76
|
+
evidenceRefs as Parameters<typeof applyQaUpdates>[3],
|
|
77
77
|
);
|
|
78
78
|
const validation = await this.port.validateSchema('qa_test_index.schema.json', next);
|
|
79
79
|
if (!validation.valid) {
|
|
80
80
|
throw {
|
|
81
|
-
normalizedResponse: fail(
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
81
|
+
normalizedResponse: fail(
|
|
82
|
+
ERROR_CODES.INTERNAL_ERROR,
|
|
83
|
+
'qa_test_index update failed validation',
|
|
84
|
+
{
|
|
85
|
+
errors: validation.errors,
|
|
86
|
+
retryable: false,
|
|
87
|
+
requires_human: true,
|
|
88
|
+
},
|
|
89
|
+
),
|
|
86
90
|
};
|
|
87
91
|
}
|
|
88
92
|
|
|
@@ -91,8 +95,8 @@ export class QaIndexService {
|
|
|
91
95
|
return {
|
|
92
96
|
data: {
|
|
93
97
|
feature_id: featureId,
|
|
94
|
-
version: next.version
|
|
95
|
-
}
|
|
98
|
+
version: next.version,
|
|
99
|
+
},
|
|
96
100
|
};
|
|
97
101
|
}
|
|
98
102
|
}
|