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
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import { describe, expect, it, vi } from 'vitest';
|
|
2
2
|
import { TOOLS } from '../src/core/constants.js';
|
|
3
|
-
import {
|
|
3
|
+
import {
|
|
4
|
+
NOOP_WORKER_DECISION_RUNNER,
|
|
5
|
+
WorkerDecisionLoop,
|
|
6
|
+
} from '../src/supervisor/worker-decision-loop.js';
|
|
4
7
|
|
|
5
8
|
describe('WorkerDecisionLoop', () => {
|
|
6
9
|
function makeProvider(runWorkerResult: Record<string, unknown>) {
|
|
@@ -8,9 +11,9 @@ describe('WorkerDecisionLoop', () => {
|
|
|
8
11
|
selection: {
|
|
9
12
|
provider: 'custom',
|
|
10
13
|
model: 'model-test',
|
|
11
|
-
provider_config_ref: null
|
|
14
|
+
provider_config_ref: null,
|
|
12
15
|
},
|
|
13
|
-
runWorker: vi.fn(async () => runWorkerResult)
|
|
16
|
+
runWorker: vi.fn(async () => runWorkerResult),
|
|
14
17
|
};
|
|
15
18
|
}
|
|
16
19
|
|
|
@@ -21,7 +24,7 @@ describe('WorkerDecisionLoop', () => {
|
|
|
21
24
|
return { ok: true, data: { refreshed: true } };
|
|
22
25
|
}
|
|
23
26
|
return { ok: true, data: { accepted: true } };
|
|
24
|
-
})
|
|
27
|
+
}),
|
|
25
28
|
};
|
|
26
29
|
}
|
|
27
30
|
|
|
@@ -30,7 +33,7 @@ describe('WorkerDecisionLoop', () => {
|
|
|
30
33
|
role: 'planner',
|
|
31
34
|
featureId: 'feature_a',
|
|
32
35
|
contextBundle: {},
|
|
33
|
-
instructions: 'noop'
|
|
36
|
+
instructions: 'noop',
|
|
34
37
|
});
|
|
35
38
|
|
|
36
39
|
expect(result).toEqual({
|
|
@@ -39,7 +42,7 @@ describe('WorkerDecisionLoop', () => {
|
|
|
39
42
|
noteLogged: false,
|
|
40
43
|
requestHandled: false,
|
|
41
44
|
priorityOrder: [],
|
|
42
|
-
toolResults: []
|
|
45
|
+
toolResults: [],
|
|
43
46
|
});
|
|
44
47
|
});
|
|
45
48
|
|
|
@@ -48,20 +51,20 @@ describe('WorkerDecisionLoop', () => {
|
|
|
48
51
|
selection: {
|
|
49
52
|
provider: 'custom',
|
|
50
53
|
model: 'model-test',
|
|
51
|
-
provider_config_ref: null
|
|
52
|
-
}
|
|
54
|
+
provider_config_ref: null,
|
|
55
|
+
},
|
|
53
56
|
};
|
|
54
57
|
const toolCaller = makeToolCaller();
|
|
55
58
|
const loop = new WorkerDecisionLoop({
|
|
56
59
|
provider: provider as never,
|
|
57
|
-
toolCaller: toolCaller as never
|
|
60
|
+
toolCaller: toolCaller as never,
|
|
58
61
|
});
|
|
59
62
|
|
|
60
63
|
const result = await loop.execute({
|
|
61
64
|
role: 'builder',
|
|
62
65
|
featureId: 'feature_a',
|
|
63
66
|
contextBundle: {},
|
|
64
|
-
instructions: 'build'
|
|
67
|
+
instructions: 'build',
|
|
65
68
|
});
|
|
66
69
|
|
|
67
70
|
expect(result.patchApplied).toBe(false);
|
|
@@ -75,20 +78,20 @@ describe('WorkerDecisionLoop', () => {
|
|
|
75
78
|
plan_json: {
|
|
76
79
|
feature_id: 'feature_a',
|
|
77
80
|
plan_version: 1,
|
|
78
|
-
summary: 'Initial plan'
|
|
79
|
-
}
|
|
81
|
+
summary: 'Initial plan',
|
|
82
|
+
},
|
|
80
83
|
});
|
|
81
84
|
const toolCaller = makeToolCaller();
|
|
82
85
|
const loop = new WorkerDecisionLoop({
|
|
83
86
|
provider: provider as never,
|
|
84
|
-
toolCaller: toolCaller as never
|
|
87
|
+
toolCaller: toolCaller as never,
|
|
85
88
|
});
|
|
86
89
|
|
|
87
90
|
const result = await loop.execute({
|
|
88
91
|
role: 'planner',
|
|
89
92
|
featureId: 'feature_a',
|
|
90
93
|
contextBundle: { plan: null },
|
|
91
|
-
instructions: 'plan'
|
|
94
|
+
instructions: 'plan',
|
|
92
95
|
});
|
|
93
96
|
|
|
94
97
|
expect(result.planSubmission).toBe(true);
|
|
@@ -98,16 +101,16 @@ describe('WorkerDecisionLoop', () => {
|
|
|
98
101
|
runtime_selection: {
|
|
99
102
|
provider: 'custom',
|
|
100
103
|
model: 'model-test',
|
|
101
|
-
provider_config_ref: null
|
|
102
|
-
}
|
|
103
|
-
})
|
|
104
|
+
provider_config_ref: null,
|
|
105
|
+
},
|
|
106
|
+
}),
|
|
104
107
|
);
|
|
105
108
|
expect(toolCaller.callTool).toHaveBeenCalledWith(
|
|
106
109
|
'planner',
|
|
107
110
|
TOOLS.PLAN_SUBMIT,
|
|
108
111
|
expect.objectContaining({
|
|
109
|
-
feature_id: 'feature_a'
|
|
110
|
-
})
|
|
112
|
+
feature_id: 'feature_a',
|
|
113
|
+
}),
|
|
111
114
|
);
|
|
112
115
|
});
|
|
113
116
|
|
|
@@ -117,14 +120,14 @@ describe('WorkerDecisionLoop', () => {
|
|
|
117
120
|
plan_json: {
|
|
118
121
|
feature_id: 'feature_a',
|
|
119
122
|
plan_version: 3,
|
|
120
|
-
summary: 'Revised plan'
|
|
123
|
+
summary: 'Revised plan',
|
|
121
124
|
},
|
|
122
|
-
expected_plan_version: 2
|
|
125
|
+
expected_plan_version: 2,
|
|
123
126
|
});
|
|
124
127
|
const toolCaller = makeToolCaller();
|
|
125
128
|
const loop = new WorkerDecisionLoop({
|
|
126
129
|
provider: provider as never,
|
|
127
|
-
toolCaller: toolCaller as never
|
|
130
|
+
toolCaller: toolCaller as never,
|
|
128
131
|
});
|
|
129
132
|
|
|
130
133
|
const result = await loop.execute({
|
|
@@ -132,7 +135,7 @@ describe('WorkerDecisionLoop', () => {
|
|
|
132
135
|
featureId: 'feature_a',
|
|
133
136
|
contextBundle: { plan: { plan_version: 2 } },
|
|
134
137
|
instructions: 'plan',
|
|
135
|
-
lastToolResults: [{ tool: 'x' }]
|
|
138
|
+
lastToolResults: [{ tool: 'x' }],
|
|
136
139
|
});
|
|
137
140
|
|
|
138
141
|
expect(result.planSubmission).toBe(true);
|
|
@@ -141,8 +144,8 @@ describe('WorkerDecisionLoop', () => {
|
|
|
141
144
|
TOOLS.PLAN_UPDATE,
|
|
142
145
|
expect.objectContaining({
|
|
143
146
|
feature_id: 'feature_a',
|
|
144
|
-
expected_plan_version: 2
|
|
145
|
-
})
|
|
147
|
+
expected_plan_version: 2,
|
|
148
|
+
}),
|
|
146
149
|
);
|
|
147
150
|
});
|
|
148
151
|
|
|
@@ -151,32 +154,36 @@ describe('WorkerDecisionLoop', () => {
|
|
|
151
154
|
outputs: [
|
|
152
155
|
{
|
|
153
156
|
type: 'PLAN_SUBMISSION',
|
|
154
|
-
plan_json: {}
|
|
157
|
+
plan_json: {},
|
|
155
158
|
},
|
|
156
159
|
{
|
|
157
160
|
type: 'PLAN_SUBMISSION',
|
|
158
161
|
plan_json: {
|
|
159
162
|
feature_id: 'feature_a',
|
|
160
|
-
plan_version: 1
|
|
161
|
-
}
|
|
162
|
-
}
|
|
163
|
-
]
|
|
163
|
+
plan_version: 1,
|
|
164
|
+
},
|
|
165
|
+
},
|
|
166
|
+
],
|
|
164
167
|
});
|
|
165
168
|
const toolCaller = makeToolCaller();
|
|
166
169
|
const loop = new WorkerDecisionLoop({
|
|
167
170
|
provider: provider as never,
|
|
168
|
-
toolCaller: toolCaller as never
|
|
171
|
+
toolCaller: toolCaller as never,
|
|
169
172
|
});
|
|
170
173
|
|
|
171
174
|
const result = await loop.execute({
|
|
172
175
|
role: 'builder',
|
|
173
176
|
featureId: 'feature_a',
|
|
174
177
|
contextBundle: {},
|
|
175
|
-
instructions: 'build'
|
|
178
|
+
instructions: 'build',
|
|
176
179
|
});
|
|
177
180
|
|
|
178
181
|
expect(result.planSubmission).toBe(false);
|
|
179
|
-
expect(toolCaller.callTool).not.toHaveBeenCalledWith(
|
|
182
|
+
expect(toolCaller.callTool).not.toHaveBeenCalledWith(
|
|
183
|
+
'planner',
|
|
184
|
+
TOOLS.PLAN_SUBMIT,
|
|
185
|
+
expect.any(Object),
|
|
186
|
+
);
|
|
180
187
|
});
|
|
181
188
|
|
|
182
189
|
it('GIVEN_builder_patch_output_WHEN_executed_THEN_routes_to_repo_apply_patch', async () => {
|
|
@@ -184,21 +191,21 @@ describe('WorkerDecisionLoop', () => {
|
|
|
184
191
|
outputs: [
|
|
185
192
|
{
|
|
186
193
|
type: 'PATCH',
|
|
187
|
-
diff: 'diff --git a/src/a.ts b/src/a.ts\n--- a/src/a.ts\n+++ b/src/a.ts\n@@ -1 +1 @@\n-a\n+b\n'
|
|
188
|
-
}
|
|
189
|
-
]
|
|
194
|
+
diff: 'diff --git a/src/a.ts b/src/a.ts\n--- a/src/a.ts\n+++ b/src/a.ts\n@@ -1 +1 @@\n-a\n+b\n',
|
|
195
|
+
},
|
|
196
|
+
],
|
|
190
197
|
});
|
|
191
198
|
const toolCaller = makeToolCaller();
|
|
192
199
|
const loop = new WorkerDecisionLoop({
|
|
193
200
|
provider: provider as never,
|
|
194
|
-
toolCaller: toolCaller as never
|
|
201
|
+
toolCaller: toolCaller as never,
|
|
195
202
|
});
|
|
196
203
|
|
|
197
204
|
const result = await loop.execute({
|
|
198
205
|
role: 'qa',
|
|
199
206
|
featureId: 'feature_a',
|
|
200
207
|
contextBundle: {},
|
|
201
|
-
instructions: 'qa'
|
|
208
|
+
instructions: 'qa',
|
|
202
209
|
});
|
|
203
210
|
|
|
204
211
|
expect(result.patchApplied).toBe(true);
|
|
@@ -206,8 +213,8 @@ describe('WorkerDecisionLoop', () => {
|
|
|
206
213
|
'qa',
|
|
207
214
|
TOOLS.REPO_APPLY_PATCH,
|
|
208
215
|
expect.objectContaining({
|
|
209
|
-
feature_id: 'feature_a'
|
|
210
|
-
})
|
|
216
|
+
feature_id: 'feature_a',
|
|
217
|
+
}),
|
|
211
218
|
);
|
|
212
219
|
});
|
|
213
220
|
|
|
@@ -216,43 +223,47 @@ describe('WorkerDecisionLoop', () => {
|
|
|
216
223
|
outputs: [
|
|
217
224
|
{
|
|
218
225
|
type: 'PATCH',
|
|
219
|
-
unified_diff: ' '
|
|
220
|
-
}
|
|
221
|
-
]
|
|
226
|
+
unified_diff: ' ',
|
|
227
|
+
},
|
|
228
|
+
],
|
|
222
229
|
});
|
|
223
230
|
const toolCaller = makeToolCaller();
|
|
224
231
|
const loop = new WorkerDecisionLoop({
|
|
225
232
|
provider: provider as never,
|
|
226
|
-
toolCaller: toolCaller as never
|
|
233
|
+
toolCaller: toolCaller as never,
|
|
227
234
|
});
|
|
228
235
|
|
|
229
236
|
const result = await loop.execute({
|
|
230
237
|
role: 'planner',
|
|
231
238
|
featureId: 'feature_a',
|
|
232
239
|
contextBundle: {},
|
|
233
|
-
instructions: 'plan'
|
|
240
|
+
instructions: 'plan',
|
|
234
241
|
});
|
|
235
242
|
|
|
236
243
|
expect(result.patchApplied).toBe(false);
|
|
237
|
-
expect(toolCaller.callTool).not.toHaveBeenCalledWith(
|
|
244
|
+
expect(toolCaller.callTool).not.toHaveBeenCalledWith(
|
|
245
|
+
'planner',
|
|
246
|
+
TOOLS.REPO_APPLY_PATCH,
|
|
247
|
+
expect.any(Object),
|
|
248
|
+
);
|
|
238
249
|
});
|
|
239
250
|
|
|
240
251
|
it('GIVEN_note_output_WHEN_log_append_succeeds_THEN_marks_note_logged', async () => {
|
|
241
252
|
const provider = makeProvider({
|
|
242
253
|
type: 'NOTE',
|
|
243
|
-
content: 'worker note'
|
|
254
|
+
content: 'worker note',
|
|
244
255
|
});
|
|
245
256
|
const toolCaller = makeToolCaller();
|
|
246
257
|
const loop = new WorkerDecisionLoop({
|
|
247
258
|
provider: provider as never,
|
|
248
|
-
toolCaller: toolCaller as never
|
|
259
|
+
toolCaller: toolCaller as never,
|
|
249
260
|
});
|
|
250
261
|
|
|
251
262
|
const result = await loop.execute({
|
|
252
263
|
role: 'builder',
|
|
253
264
|
featureId: 'feature_a',
|
|
254
265
|
contextBundle: {},
|
|
255
|
-
instructions: 'note'
|
|
266
|
+
instructions: 'note',
|
|
256
267
|
});
|
|
257
268
|
|
|
258
269
|
expect(result.noteLogged).toBe(true);
|
|
@@ -261,15 +272,15 @@ describe('WorkerDecisionLoop', () => {
|
|
|
261
272
|
TOOLS.FEATURE_LOG_APPEND,
|
|
262
273
|
expect.objectContaining({
|
|
263
274
|
feature_id: 'feature_a',
|
|
264
|
-
note: 'worker note'
|
|
265
|
-
})
|
|
275
|
+
note: 'worker note',
|
|
276
|
+
}),
|
|
266
277
|
);
|
|
267
278
|
});
|
|
268
279
|
|
|
269
280
|
it('GIVEN_note_output_WHEN_log_append_fails_THEN_swallows_error_and_keeps_note_unset', async () => {
|
|
270
281
|
const provider = makeProvider({
|
|
271
282
|
type: 'NOTE',
|
|
272
|
-
metadata: { info: 'fallback-json' }
|
|
283
|
+
metadata: { info: 'fallback-json' },
|
|
273
284
|
});
|
|
274
285
|
const toolCaller = {
|
|
275
286
|
callTool: vi.fn(async (role: string, toolName: string) => {
|
|
@@ -277,18 +288,18 @@ describe('WorkerDecisionLoop', () => {
|
|
|
277
288
|
throw new Error('append_failed');
|
|
278
289
|
}
|
|
279
290
|
return { ok: true, data: {} };
|
|
280
|
-
})
|
|
291
|
+
}),
|
|
281
292
|
};
|
|
282
293
|
const loop = new WorkerDecisionLoop({
|
|
283
294
|
provider: provider as never,
|
|
284
|
-
toolCaller: toolCaller as never
|
|
295
|
+
toolCaller: toolCaller as never,
|
|
285
296
|
});
|
|
286
297
|
|
|
287
298
|
const result = await loop.execute({
|
|
288
299
|
role: 'qa',
|
|
289
300
|
featureId: 'feature_a',
|
|
290
301
|
contextBundle: {},
|
|
291
|
-
instructions: 'note'
|
|
302
|
+
instructions: 'note',
|
|
292
303
|
});
|
|
293
304
|
|
|
294
305
|
expect(result.noteLogged).toBe(false);
|
|
@@ -300,20 +311,20 @@ describe('WorkerDecisionLoop', () => {
|
|
|
300
311
|
type: 'REQUEST',
|
|
301
312
|
request: {
|
|
302
313
|
action: 'prioritize',
|
|
303
|
-
feature_order: [null, ' ']
|
|
304
|
-
}
|
|
314
|
+
feature_order: [null, ' '],
|
|
315
|
+
},
|
|
305
316
|
});
|
|
306
317
|
const toolCaller = makeToolCaller();
|
|
307
318
|
const loop = new WorkerDecisionLoop({
|
|
308
319
|
provider: provider as never,
|
|
309
|
-
toolCaller: toolCaller as never
|
|
320
|
+
toolCaller: toolCaller as never,
|
|
310
321
|
});
|
|
311
322
|
|
|
312
323
|
const result = await loop.execute({
|
|
313
324
|
role: 'orchestrator',
|
|
314
325
|
featureId: 'global',
|
|
315
326
|
contextBundle: {},
|
|
316
|
-
instructions: 'prioritize'
|
|
327
|
+
instructions: 'prioritize',
|
|
317
328
|
});
|
|
318
329
|
|
|
319
330
|
expect(result.requestHandled).toBe(false);
|
|
@@ -325,37 +336,37 @@ describe('WorkerDecisionLoop', () => {
|
|
|
325
336
|
outputs: [
|
|
326
337
|
{
|
|
327
338
|
type: 'REQUEST',
|
|
328
|
-
request: { action: 'lock_acquire', resources: ['openapi'] }
|
|
339
|
+
request: { action: 'lock_acquire', resources: ['openapi'] },
|
|
329
340
|
},
|
|
330
341
|
{
|
|
331
342
|
type: 'REQUEST',
|
|
332
|
-
request: { action: 'lock_release', resources: ['openapi'] }
|
|
333
|
-
}
|
|
334
|
-
]
|
|
343
|
+
request: { action: 'lock_release', resources: ['openapi'] },
|
|
344
|
+
},
|
|
345
|
+
],
|
|
335
346
|
});
|
|
336
347
|
const toolCaller = makeToolCaller();
|
|
337
348
|
const loop = new WorkerDecisionLoop({
|
|
338
349
|
provider: provider as never,
|
|
339
|
-
toolCaller: toolCaller as never
|
|
350
|
+
toolCaller: toolCaller as never,
|
|
340
351
|
});
|
|
341
352
|
|
|
342
353
|
const result = await loop.execute({
|
|
343
354
|
role: 'builder',
|
|
344
355
|
featureId: 'feature_a',
|
|
345
356
|
contextBundle: {},
|
|
346
|
-
instructions: 'locks'
|
|
357
|
+
instructions: 'locks',
|
|
347
358
|
});
|
|
348
359
|
|
|
349
360
|
expect(result.requestHandled).toBe(true);
|
|
350
361
|
expect(toolCaller.callTool).toHaveBeenCalledWith(
|
|
351
362
|
'orchestrator',
|
|
352
363
|
TOOLS.LOCKS_ACQUIRE,
|
|
353
|
-
expect.objectContaining({ feature_id: 'feature_a', resources: ['openapi'] })
|
|
364
|
+
expect.objectContaining({ feature_id: 'feature_a', resources: ['openapi'] }),
|
|
354
365
|
);
|
|
355
366
|
expect(toolCaller.callTool).toHaveBeenCalledWith(
|
|
356
367
|
'orchestrator',
|
|
357
368
|
TOOLS.LOCKS_RELEASE,
|
|
358
|
-
expect.objectContaining({ feature_id: 'feature_a', resources: ['openapi'] })
|
|
369
|
+
expect.objectContaining({ feature_id: 'feature_a', resources: ['openapi'] }),
|
|
359
370
|
);
|
|
360
371
|
});
|
|
361
372
|
|
|
@@ -364,30 +375,38 @@ describe('WorkerDecisionLoop', () => {
|
|
|
364
375
|
outputs: [
|
|
365
376
|
{
|
|
366
377
|
type: 'REQUEST',
|
|
367
|
-
request: { action: 'lock_acquire', resources: [] }
|
|
378
|
+
request: { action: 'lock_acquire', resources: [] },
|
|
368
379
|
},
|
|
369
380
|
{
|
|
370
381
|
type: 'REQUEST',
|
|
371
|
-
request: { action: 'lock_release', resources: [null] }
|
|
372
|
-
}
|
|
373
|
-
]
|
|
382
|
+
request: { action: 'lock_release', resources: [null] },
|
|
383
|
+
},
|
|
384
|
+
],
|
|
374
385
|
});
|
|
375
386
|
const toolCaller = makeToolCaller();
|
|
376
387
|
const loop = new WorkerDecisionLoop({
|
|
377
388
|
provider: provider as never,
|
|
378
|
-
toolCaller: toolCaller as never
|
|
389
|
+
toolCaller: toolCaller as never,
|
|
379
390
|
});
|
|
380
391
|
|
|
381
392
|
const result = await loop.execute({
|
|
382
393
|
role: 'planner',
|
|
383
394
|
featureId: 'feature_a',
|
|
384
395
|
contextBundle: {},
|
|
385
|
-
instructions: 'locks'
|
|
396
|
+
instructions: 'locks',
|
|
386
397
|
});
|
|
387
398
|
|
|
388
399
|
expect(result.requestHandled).toBe(false);
|
|
389
|
-
expect(toolCaller.callTool).not.toHaveBeenCalledWith(
|
|
390
|
-
|
|
400
|
+
expect(toolCaller.callTool).not.toHaveBeenCalledWith(
|
|
401
|
+
'orchestrator',
|
|
402
|
+
TOOLS.LOCKS_ACQUIRE,
|
|
403
|
+
expect.any(Object),
|
|
404
|
+
);
|
|
405
|
+
expect(toolCaller.callTool).not.toHaveBeenCalledWith(
|
|
406
|
+
'orchestrator',
|
|
407
|
+
TOOLS.LOCKS_RELEASE,
|
|
408
|
+
expect.any(Object),
|
|
409
|
+
);
|
|
391
410
|
});
|
|
392
411
|
|
|
393
412
|
it('GIVEN_context_refresh_requests_WHEN_executed_THEN_requests_feature_context', async () => {
|
|
@@ -395,29 +414,31 @@ describe('WorkerDecisionLoop', () => {
|
|
|
395
414
|
outputs: [
|
|
396
415
|
{
|
|
397
416
|
type: 'REQUEST',
|
|
398
|
-
request: { action: 'more_context' }
|
|
417
|
+
request: { action: 'more_context' },
|
|
399
418
|
},
|
|
400
419
|
{
|
|
401
420
|
type: 'REQUEST',
|
|
402
|
-
request: { request_type: 'context_refresh' }
|
|
403
|
-
}
|
|
404
|
-
]
|
|
421
|
+
request: { request_type: 'context_refresh' },
|
|
422
|
+
},
|
|
423
|
+
],
|
|
405
424
|
});
|
|
406
425
|
const toolCaller = makeToolCaller();
|
|
407
426
|
const loop = new WorkerDecisionLoop({
|
|
408
427
|
provider: provider as never,
|
|
409
|
-
toolCaller: toolCaller as never
|
|
428
|
+
toolCaller: toolCaller as never,
|
|
410
429
|
});
|
|
411
430
|
|
|
412
431
|
const result = await loop.execute({
|
|
413
432
|
role: 'qa',
|
|
414
433
|
featureId: 'feature_a',
|
|
415
434
|
contextBundle: {},
|
|
416
|
-
instructions: 'context'
|
|
435
|
+
instructions: 'context',
|
|
417
436
|
});
|
|
418
437
|
|
|
419
438
|
expect(result.requestHandled).toBe(true);
|
|
420
|
-
const contextCalls = toolCaller.callTool.mock.calls.filter(
|
|
439
|
+
const contextCalls = toolCaller.callTool.mock.calls.filter(
|
|
440
|
+
(call) => call[1] === TOOLS.FEATURE_GET_CONTEXT,
|
|
441
|
+
);
|
|
421
442
|
expect(contextCalls).toHaveLength(2);
|
|
422
443
|
});
|
|
423
444
|
|
|
@@ -428,21 +449,21 @@ describe('WorkerDecisionLoop', () => {
|
|
|
428
449
|
action: 'amend_plan',
|
|
429
450
|
plan_json: {
|
|
430
451
|
feature_id: 'feature_a',
|
|
431
|
-
plan_version: 1
|
|
432
|
-
}
|
|
433
|
-
}
|
|
452
|
+
plan_version: 1,
|
|
453
|
+
},
|
|
454
|
+
},
|
|
434
455
|
});
|
|
435
456
|
const toolCaller = makeToolCaller();
|
|
436
457
|
const loop = new WorkerDecisionLoop({
|
|
437
458
|
provider: provider as never,
|
|
438
|
-
toolCaller: toolCaller as never
|
|
459
|
+
toolCaller: toolCaller as never,
|
|
439
460
|
});
|
|
440
461
|
|
|
441
462
|
const result = await loop.execute({
|
|
442
463
|
role: 'planner',
|
|
443
464
|
featureId: 'feature_a',
|
|
444
465
|
contextBundle: { plan: null },
|
|
445
|
-
instructions: 'amend'
|
|
466
|
+
instructions: 'amend',
|
|
446
467
|
});
|
|
447
468
|
|
|
448
469
|
expect(result.requestHandled).toBe(true);
|
|
@@ -450,7 +471,7 @@ describe('WorkerDecisionLoop', () => {
|
|
|
450
471
|
expect(toolCaller.callTool).toHaveBeenCalledWith(
|
|
451
472
|
'planner',
|
|
452
473
|
TOOLS.PLAN_SUBMIT,
|
|
453
|
-
expect.objectContaining({ feature_id: 'feature_a' })
|
|
474
|
+
expect.objectContaining({ feature_id: 'feature_a' }),
|
|
454
475
|
);
|
|
455
476
|
});
|
|
456
477
|
|
|
@@ -462,21 +483,21 @@ describe('WorkerDecisionLoop', () => {
|
|
|
462
483
|
expected_plan_version: 3,
|
|
463
484
|
plan_json: {
|
|
464
485
|
feature_id: 'feature_a',
|
|
465
|
-
plan_version: 4
|
|
466
|
-
}
|
|
467
|
-
}
|
|
486
|
+
plan_version: 4,
|
|
487
|
+
},
|
|
488
|
+
},
|
|
468
489
|
});
|
|
469
490
|
const toolCaller = makeToolCaller();
|
|
470
491
|
const loop = new WorkerDecisionLoop({
|
|
471
492
|
provider: provider as never,
|
|
472
|
-
toolCaller: toolCaller as never
|
|
493
|
+
toolCaller: toolCaller as never,
|
|
473
494
|
});
|
|
474
495
|
|
|
475
496
|
const result = await loop.execute({
|
|
476
497
|
role: 'planner',
|
|
477
498
|
featureId: 'feature_a',
|
|
478
499
|
contextBundle: { plan: { plan_version: 2 } },
|
|
479
|
-
instructions: 'amend'
|
|
500
|
+
instructions: 'amend',
|
|
480
501
|
});
|
|
481
502
|
|
|
482
503
|
expect(result.requestHandled).toBe(true);
|
|
@@ -486,8 +507,8 @@ describe('WorkerDecisionLoop', () => {
|
|
|
486
507
|
TOOLS.PLAN_UPDATE,
|
|
487
508
|
expect.objectContaining({
|
|
488
509
|
feature_id: 'feature_a',
|
|
489
|
-
expected_plan_version: 3
|
|
490
|
-
})
|
|
510
|
+
expected_plan_version: 3,
|
|
511
|
+
}),
|
|
491
512
|
);
|
|
492
513
|
});
|
|
493
514
|
|
|
@@ -498,31 +519,31 @@ describe('WorkerDecisionLoop', () => {
|
|
|
498
519
|
type: 'REQUEST',
|
|
499
520
|
request: {
|
|
500
521
|
action: 'amend_plan',
|
|
501
|
-
plan_json: {}
|
|
502
|
-
}
|
|
522
|
+
plan_json: {},
|
|
523
|
+
},
|
|
503
524
|
},
|
|
504
525
|
{
|
|
505
526
|
type: 'REQUEST',
|
|
506
527
|
request: {
|
|
507
528
|
action: 'amend_plan',
|
|
508
529
|
plan_json: {
|
|
509
|
-
feature_id: 'feature_a'
|
|
510
|
-
}
|
|
511
|
-
}
|
|
512
|
-
}
|
|
513
|
-
]
|
|
530
|
+
feature_id: 'feature_a',
|
|
531
|
+
},
|
|
532
|
+
},
|
|
533
|
+
},
|
|
534
|
+
],
|
|
514
535
|
});
|
|
515
536
|
const toolCaller = makeToolCaller();
|
|
516
537
|
const loop = new WorkerDecisionLoop({
|
|
517
538
|
provider: provider as never,
|
|
518
|
-
toolCaller: toolCaller as never
|
|
539
|
+
toolCaller: toolCaller as never,
|
|
519
540
|
});
|
|
520
541
|
|
|
521
542
|
const result = await loop.execute({
|
|
522
543
|
role: 'builder',
|
|
523
544
|
featureId: 'feature_a',
|
|
524
545
|
contextBundle: {},
|
|
525
|
-
instructions: 'amend'
|
|
546
|
+
instructions: 'amend',
|
|
526
547
|
});
|
|
527
548
|
|
|
528
549
|
expect(result.planSubmission).toBe(false);
|
|
@@ -536,20 +557,20 @@ describe('WorkerDecisionLoop', () => {
|
|
|
536
557
|
{},
|
|
537
558
|
{ type: 'UNSUPPORTED' },
|
|
538
559
|
{ type: 'REQUEST', request: {} },
|
|
539
|
-
{ type: 'NOTE', content: 'x' }
|
|
540
|
-
]
|
|
560
|
+
{ type: 'NOTE', content: 'x' },
|
|
561
|
+
],
|
|
541
562
|
});
|
|
542
563
|
const toolCaller = makeToolCaller();
|
|
543
564
|
const loop = new WorkerDecisionLoop({
|
|
544
565
|
provider: provider as never,
|
|
545
|
-
toolCaller: toolCaller as never
|
|
566
|
+
toolCaller: toolCaller as never,
|
|
546
567
|
});
|
|
547
568
|
|
|
548
569
|
const result = await loop.execute({
|
|
549
570
|
role: 'orchestrator',
|
|
550
571
|
featureId: 'global',
|
|
551
572
|
contextBundle: {},
|
|
552
|
-
instructions: 'noop'
|
|
573
|
+
instructions: 'noop',
|
|
553
574
|
});
|
|
554
575
|
|
|
555
576
|
expect(result.noteLogged).toBe(true);
|
|
@@ -562,23 +583,23 @@ describe('WorkerDecisionLoop', () => {
|
|
|
562
583
|
type: 'REQUEST',
|
|
563
584
|
request: {
|
|
564
585
|
action: 'prioritize',
|
|
565
|
-
feature_order: ['feature_c', 'feature_a']
|
|
566
|
-
}
|
|
586
|
+
feature_order: ['feature_c', 'feature_a'],
|
|
587
|
+
},
|
|
567
588
|
});
|
|
568
589
|
|
|
569
590
|
const toolCaller = makeToolCaller();
|
|
570
591
|
const loop = new WorkerDecisionLoop({
|
|
571
592
|
provider: provider as never,
|
|
572
|
-
toolCaller: toolCaller as never
|
|
593
|
+
toolCaller: toolCaller as never,
|
|
573
594
|
});
|
|
574
595
|
|
|
575
596
|
const result = await loop.execute({
|
|
576
597
|
role: 'orchestrator',
|
|
577
598
|
featureId: 'global',
|
|
578
599
|
contextBundle: {
|
|
579
|
-
active_feature_ids: ['feature_a', 'feature_b', 'feature_c']
|
|
600
|
+
active_feature_ids: ['feature_a', 'feature_b', 'feature_c'],
|
|
580
601
|
},
|
|
581
|
-
instructions: 'prioritize'
|
|
602
|
+
instructions: 'prioritize',
|
|
582
603
|
});
|
|
583
604
|
|
|
584
605
|
expect(result.requestHandled).toBe(true);
|
|
@@ -590,7 +611,7 @@ describe('WorkerDecisionLoop amend_plan revision_of branches', () => {
|
|
|
590
611
|
function makeProvider(runWorkerResult: Record<string, unknown>) {
|
|
591
612
|
return {
|
|
592
613
|
selection: { provider: 'custom', model: 'model-test', provider_config_ref: null },
|
|
593
|
-
runWorker: vi.fn(async () => runWorkerResult)
|
|
614
|
+
runWorker: vi.fn(async () => runWorkerResult),
|
|
594
615
|
};
|
|
595
616
|
}
|
|
596
617
|
|
|
@@ -601,7 +622,7 @@ describe('WorkerDecisionLoop amend_plan revision_of branches', () => {
|
|
|
601
622
|
return { ok: true, data: { refreshed: true } };
|
|
602
623
|
}
|
|
603
624
|
return { ok: true, data: { accepted: true } };
|
|
604
|
-
})
|
|
625
|
+
}),
|
|
605
626
|
};
|
|
606
627
|
}
|
|
607
628
|
|
|
@@ -613,21 +634,21 @@ describe('WorkerDecisionLoop amend_plan revision_of branches', () => {
|
|
|
613
634
|
expected_plan_version: 'not-a-number',
|
|
614
635
|
plan_json: {
|
|
615
636
|
feature_id: 'feature_a',
|
|
616
|
-
plan_version: 3
|
|
617
|
-
}
|
|
618
|
-
}
|
|
637
|
+
plan_version: 3,
|
|
638
|
+
},
|
|
639
|
+
},
|
|
619
640
|
});
|
|
620
641
|
const toolCaller = makeToolCaller();
|
|
621
642
|
const loop = new WorkerDecisionLoop({
|
|
622
643
|
provider: provider as never,
|
|
623
|
-
toolCaller: toolCaller as never
|
|
644
|
+
toolCaller: toolCaller as never,
|
|
624
645
|
});
|
|
625
646
|
|
|
626
647
|
const result = await loop.execute({
|
|
627
648
|
role: 'planner',
|
|
628
649
|
featureId: 'feature_a',
|
|
629
650
|
contextBundle: { plan: { plan_version: 2 } },
|
|
630
|
-
instructions: 'amend'
|
|
651
|
+
instructions: 'amend',
|
|
631
652
|
});
|
|
632
653
|
|
|
633
654
|
expect(result.requestHandled).toBe(true);
|
|
@@ -637,8 +658,8 @@ describe('WorkerDecisionLoop amend_plan revision_of branches', () => {
|
|
|
637
658
|
TOOLS.PLAN_UPDATE,
|
|
638
659
|
expect.objectContaining({
|
|
639
660
|
feature_id: 'feature_a',
|
|
640
|
-
expected_plan_version: 2
|
|
641
|
-
})
|
|
661
|
+
expected_plan_version: 2,
|
|
662
|
+
}),
|
|
642
663
|
);
|
|
643
664
|
});
|
|
644
665
|
});
|