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
|
@@ -14,31 +14,31 @@ describe('QaWaveExecutor collaborator branches', () => {
|
|
|
14
14
|
runId: 'run-qa',
|
|
15
15
|
ownerInstanceId: 'owner-qa',
|
|
16
16
|
orchestratorSessionId: null,
|
|
17
|
-
sessionsByFeature: new Map<string, { planner: string; builder: string; qa: string }>()
|
|
17
|
+
sessionsByFeature: new Map<string, { planner: string; builder: string; qa: string }>(),
|
|
18
18
|
};
|
|
19
19
|
const toolCaller = {
|
|
20
20
|
callTool: vi.fn(async (_role: string, toolName: string) => {
|
|
21
21
|
if (toolName === TOOLS.FEATURE_STATE_GET) {
|
|
22
22
|
return {
|
|
23
23
|
ok: true,
|
|
24
|
-
data: { front_matter: { status: STATUS.QA } }
|
|
24
|
+
data: { front_matter: { status: STATUS.QA } },
|
|
25
25
|
};
|
|
26
26
|
}
|
|
27
27
|
return { ok: true, data: {} };
|
|
28
|
-
})
|
|
28
|
+
}),
|
|
29
29
|
};
|
|
30
30
|
const provider = {
|
|
31
31
|
closeSession: vi.fn(async () => ({ closed: true })),
|
|
32
|
-
createSession: vi.fn(async () => ({ session_id: 'qa-new' }))
|
|
32
|
+
createSession: vi.fn(async () => ({ session_id: 'qa-new' })),
|
|
33
33
|
};
|
|
34
34
|
const kernel = {
|
|
35
|
-
updateFeatureSessionAssignment: vi.fn(async () => ({ data: { updated: true } }))
|
|
35
|
+
updateFeatureSessionAssignment: vi.fn(async () => ({ data: { updated: true } })),
|
|
36
36
|
};
|
|
37
37
|
const promptProvider = {
|
|
38
|
-
loadRolePrompts: vi.fn(async () => ({ planner: null, builder: null, qa: 'qa prompt' }))
|
|
38
|
+
loadRolePrompts: vi.fn(async () => ({ planner: null, builder: null, qa: 'qa prompt' })),
|
|
39
39
|
};
|
|
40
40
|
const featureClusterPatcher = {
|
|
41
|
-
patchFeatureCluster: vi.fn(async () => undefined)
|
|
41
|
+
patchFeatureCluster: vi.fn(async () => undefined),
|
|
42
42
|
};
|
|
43
43
|
const executor = new QaWaveExecutor({
|
|
44
44
|
kernel: kernel as any,
|
|
@@ -46,7 +46,7 @@ describe('QaWaveExecutor collaborator branches', () => {
|
|
|
46
46
|
toolCaller: toolCaller as any,
|
|
47
47
|
promptProvider: promptProvider as any,
|
|
48
48
|
featureClusterPatcher: featureClusterPatcher as any,
|
|
49
|
-
state: state as any
|
|
49
|
+
state: state as any,
|
|
50
50
|
});
|
|
51
51
|
|
|
52
52
|
await executor.run(['feature_a'], 1);
|
|
@@ -57,17 +57,19 @@ describe('QaWaveExecutor collaborator branches', () => {
|
|
|
57
57
|
feature_id: 'feature_a',
|
|
58
58
|
planner_session_id: UNASSIGNED_SESSION_ID,
|
|
59
59
|
builder_session_id: UNASSIGNED_SESSION_ID,
|
|
60
|
-
qa_session_id: 'qa-new'
|
|
61
|
-
})
|
|
60
|
+
qa_session_id: 'qa-new',
|
|
61
|
+
}),
|
|
62
62
|
);
|
|
63
63
|
expect(featureClusterPatcher.patchFeatureCluster).toHaveBeenCalledWith('feature_a', {
|
|
64
64
|
orchestrator_session_id: 'unknown',
|
|
65
|
-
qa_session_id: 'qa-new'
|
|
65
|
+
qa_session_id: 'qa-new',
|
|
66
66
|
});
|
|
67
67
|
});
|
|
68
68
|
|
|
69
69
|
describe('QaWaveExecutor catch and reactions branches', () => {
|
|
70
|
-
beforeEach(() => {
|
|
70
|
+
beforeEach(() => {
|
|
71
|
+
vi.clearAllMocks();
|
|
72
|
+
});
|
|
71
73
|
|
|
72
74
|
function makeBaseDeps() {
|
|
73
75
|
const state = {
|
|
@@ -75,21 +77,21 @@ describe('QaWaveExecutor collaborator branches', () => {
|
|
|
75
77
|
ownerInstanceId: 'owner-qa',
|
|
76
78
|
orchestratorSessionId: 'orch-qa',
|
|
77
79
|
sessionsByFeature: new Map<string, { planner: string; builder: string; qa: string }>([
|
|
78
|
-
['feature_x', { planner: 'p-1', builder: 'b-1', qa: 'q-old' }]
|
|
79
|
-
])
|
|
80
|
+
['feature_x', { planner: 'p-1', builder: 'b-1', qa: 'q-old' }],
|
|
81
|
+
]),
|
|
80
82
|
};
|
|
81
83
|
const provider = {
|
|
82
84
|
closeSession: vi.fn(async () => ({ closed: true })),
|
|
83
|
-
createSession: vi.fn(async () => ({ session_id: 'qa-new' }))
|
|
85
|
+
createSession: vi.fn(async () => ({ session_id: 'qa-new' })),
|
|
84
86
|
};
|
|
85
87
|
const kernel = {
|
|
86
|
-
updateFeatureSessionAssignment: vi.fn(async () => ({ data: {} }))
|
|
88
|
+
updateFeatureSessionAssignment: vi.fn(async () => ({ data: {} })),
|
|
87
89
|
};
|
|
88
90
|
const promptProvider = {
|
|
89
|
-
loadRolePrompts: vi.fn(async () => ({ planner: null, builder: null, qa: 'qa-prompt' }))
|
|
91
|
+
loadRolePrompts: vi.fn(async () => ({ planner: null, builder: null, qa: 'qa-prompt' })),
|
|
90
92
|
};
|
|
91
93
|
const featureClusterPatcher = {
|
|
92
|
-
patchFeatureCluster: vi.fn(async () => undefined)
|
|
94
|
+
patchFeatureCluster: vi.fn(async () => undefined),
|
|
93
95
|
};
|
|
94
96
|
return { state, provider, kernel, promptProvider, featureClusterPatcher };
|
|
95
97
|
}
|
|
@@ -105,7 +107,7 @@ describe('QaWaveExecutor collaborator branches', () => {
|
|
|
105
107
|
throw new Error('gates failed unexpectedly');
|
|
106
108
|
}
|
|
107
109
|
return { ok: true, data: {} };
|
|
108
|
-
})
|
|
110
|
+
}),
|
|
109
111
|
};
|
|
110
112
|
|
|
111
113
|
const executor = new QaWaveExecutor({
|
|
@@ -114,7 +116,7 @@ describe('QaWaveExecutor collaborator branches', () => {
|
|
|
114
116
|
toolCaller: toolCaller as never,
|
|
115
117
|
promptProvider: promptProvider as never,
|
|
116
118
|
featureClusterPatcher: featureClusterPatcher as never,
|
|
117
|
-
state: state as never
|
|
119
|
+
state: state as never,
|
|
118
120
|
});
|
|
119
121
|
|
|
120
122
|
await executor.run(['feature_x'], 1);
|
|
@@ -132,10 +134,13 @@ describe('QaWaveExecutor collaborator branches', () => {
|
|
|
132
134
|
}
|
|
133
135
|
if (toolName === TOOLS.GATES_RUN) {
|
|
134
136
|
gateCallCount += 1;
|
|
135
|
-
return {
|
|
137
|
+
return {
|
|
138
|
+
ok: true,
|
|
139
|
+
data: { overall: gateCallCount === 1 ? GATE_RESULT.FAIL : GATE_RESULT.PASS },
|
|
140
|
+
};
|
|
136
141
|
}
|
|
137
142
|
return { ok: true, data: {} };
|
|
138
|
-
})
|
|
143
|
+
}),
|
|
139
144
|
};
|
|
140
145
|
const reactionsService = {
|
|
141
146
|
retryDelayMs: vi.fn(() => 5),
|
|
@@ -143,7 +148,7 @@ describe('QaWaveExecutor collaborator branches', () => {
|
|
|
143
148
|
buildRepairPrompt: vi.fn(() => 'repair prompt'),
|
|
144
149
|
recordRetry: vi.fn(async () => undefined),
|
|
145
150
|
shouldEscalate: vi.fn(() => false),
|
|
146
|
-
notifyEscalation: vi.fn(async () => undefined)
|
|
151
|
+
notifyEscalation: vi.fn(async () => undefined),
|
|
147
152
|
};
|
|
148
153
|
|
|
149
154
|
const executor = new QaWaveExecutor({
|
|
@@ -153,7 +158,7 @@ describe('QaWaveExecutor collaborator branches', () => {
|
|
|
153
158
|
promptProvider: promptProvider as never,
|
|
154
159
|
featureClusterPatcher: featureClusterPatcher as never,
|
|
155
160
|
state: state as never,
|
|
156
|
-
reactionsService: reactionsService as never
|
|
161
|
+
reactionsService: reactionsService as never,
|
|
157
162
|
});
|
|
158
163
|
|
|
159
164
|
await executor.run(['feature_x'], 1);
|
|
@@ -173,7 +178,7 @@ describe('QaWaveExecutor collaborator branches', () => {
|
|
|
173
178
|
return { ok: true, data: { overall: GATE_RESULT.FAIL } };
|
|
174
179
|
}
|
|
175
180
|
return { ok: true, data: {} };
|
|
176
|
-
})
|
|
181
|
+
}),
|
|
177
182
|
};
|
|
178
183
|
const reactionsService = {
|
|
179
184
|
retryDelayMs: vi.fn(() => 5),
|
|
@@ -181,7 +186,7 @@ describe('QaWaveExecutor collaborator branches', () => {
|
|
|
181
186
|
buildRepairPrompt: vi.fn(() => 'repair prompt'),
|
|
182
187
|
recordRetry: vi.fn(async () => undefined),
|
|
183
188
|
shouldEscalate: vi.fn(() => true),
|
|
184
|
-
notifyEscalation: vi.fn(async () => undefined)
|
|
189
|
+
notifyEscalation: vi.fn(async () => undefined),
|
|
185
190
|
};
|
|
186
191
|
|
|
187
192
|
const executor = new QaWaveExecutor({
|
|
@@ -191,14 +196,14 @@ describe('QaWaveExecutor collaborator branches', () => {
|
|
|
191
196
|
promptProvider: promptProvider as never,
|
|
192
197
|
featureClusterPatcher: featureClusterPatcher as never,
|
|
193
198
|
state: state as never,
|
|
194
|
-
reactionsService: reactionsService as never
|
|
199
|
+
reactionsService: reactionsService as never,
|
|
195
200
|
});
|
|
196
201
|
|
|
197
202
|
await executor.run(['feature_x'], 1);
|
|
198
203
|
|
|
199
204
|
expect(reactionsService.notifyEscalation).toHaveBeenCalledWith(
|
|
200
205
|
'feature_x',
|
|
201
|
-
expect.objectContaining({ featureId: 'feature_x', gateName: 'full' })
|
|
206
|
+
expect.objectContaining({ featureId: 'feature_x', gateName: 'full' }),
|
|
202
207
|
);
|
|
203
208
|
});
|
|
204
209
|
|
|
@@ -213,7 +218,7 @@ describe('QaWaveExecutor collaborator branches', () => {
|
|
|
213
218
|
return { ok: true, data: { overall: GATE_RESULT.PASS } };
|
|
214
219
|
}
|
|
215
220
|
return { ok: true, data: {} };
|
|
216
|
-
})
|
|
221
|
+
}),
|
|
217
222
|
};
|
|
218
223
|
const reactionsService = {
|
|
219
224
|
retryDelayMs: vi.fn(() => 5),
|
|
@@ -221,7 +226,7 @@ describe('QaWaveExecutor collaborator branches', () => {
|
|
|
221
226
|
buildRepairPrompt: vi.fn(() => 'repair prompt'),
|
|
222
227
|
recordRetry: vi.fn(async () => undefined),
|
|
223
228
|
shouldEscalate: vi.fn(() => false),
|
|
224
|
-
notifyEscalation: vi.fn(async () => undefined)
|
|
229
|
+
notifyEscalation: vi.fn(async () => undefined),
|
|
225
230
|
};
|
|
226
231
|
|
|
227
232
|
const executor = new QaWaveExecutor({
|
|
@@ -231,7 +236,7 @@ describe('QaWaveExecutor collaborator branches', () => {
|
|
|
231
236
|
promptProvider: promptProvider as never,
|
|
232
237
|
featureClusterPatcher: featureClusterPatcher as never,
|
|
233
238
|
state: state as never,
|
|
234
|
-
reactionsService: reactionsService as never
|
|
239
|
+
reactionsService: reactionsService as never,
|
|
235
240
|
});
|
|
236
241
|
|
|
237
242
|
await executor.run(['feature_x'], 1);
|
|
@@ -247,13 +252,17 @@ describe('QaWaveExecutor collaborator branches', () => {
|
|
|
247
252
|
return { ok: true, data: { front_matter: { status: STATUS.PLANNING } } };
|
|
248
253
|
}
|
|
249
254
|
return { ok: true, data: {} };
|
|
250
|
-
})
|
|
255
|
+
}),
|
|
251
256
|
};
|
|
252
257
|
const workerDecisionRunner = {
|
|
253
258
|
execute: vi.fn(async () => ({
|
|
254
|
-
planSubmission: false,
|
|
255
|
-
|
|
256
|
-
|
|
259
|
+
planSubmission: false,
|
|
260
|
+
patchApplied: false,
|
|
261
|
+
noteLogged: false,
|
|
262
|
+
requestHandled: false,
|
|
263
|
+
priorityOrder: [] as string[],
|
|
264
|
+
toolResults: [],
|
|
265
|
+
})),
|
|
257
266
|
};
|
|
258
267
|
|
|
259
268
|
const executor = new QaWaveExecutor({
|
|
@@ -263,7 +272,7 @@ describe('QaWaveExecutor collaborator branches', () => {
|
|
|
263
272
|
promptProvider: promptProvider as never,
|
|
264
273
|
featureClusterPatcher: featureClusterPatcher as never,
|
|
265
274
|
state: state as never,
|
|
266
|
-
workerDecisionRunner: workerDecisionRunner as never
|
|
275
|
+
workerDecisionRunner: workerDecisionRunner as never,
|
|
267
276
|
});
|
|
268
277
|
|
|
269
278
|
await executor.run(['feature_x'], 1);
|
|
@@ -280,8 +289,8 @@ describe('SessionOrchestrator collaborator branches', () => {
|
|
|
280
289
|
getRuntimeSessions: vi.fn(async () => ({
|
|
281
290
|
run_id: 'run-session',
|
|
282
291
|
owner_instance_id: 'owner-session',
|
|
283
|
-
orchestrator_session_id: 'orch-session'
|
|
284
|
-
}))
|
|
292
|
+
orchestrator_session_id: 'orch-session',
|
|
293
|
+
})),
|
|
285
294
|
};
|
|
286
295
|
const provider = {
|
|
287
296
|
createSession: vi
|
|
@@ -290,14 +299,14 @@ describe('SessionOrchestrator collaborator branches', () => {
|
|
|
290
299
|
.mockResolvedValueOnce({ session_id: 'builder-1' })
|
|
291
300
|
.mockResolvedValueOnce({ session_id: 'qa-1' })
|
|
292
301
|
.mockResolvedValue({ session_id: 'generic-1' }),
|
|
293
|
-
closeSession: vi.fn(async () => ({ closed: true }))
|
|
302
|
+
closeSession: vi.fn(async () => ({ closed: true })),
|
|
294
303
|
};
|
|
295
304
|
const kernel = {
|
|
296
305
|
updateOrchestratorSession: vi.fn(async () => ({ data: {} })),
|
|
297
|
-
updateFeatureSessionAssignment: vi.fn(async () => ({ data: {} }))
|
|
306
|
+
updateFeatureSessionAssignment: vi.fn(async () => ({ data: {} })),
|
|
298
307
|
};
|
|
299
308
|
const promptProvider = {
|
|
300
|
-
loadRolePrompts: vi.fn(async () => ({ planner: 'p', builder: 'b', qa: 'q' }))
|
|
309
|
+
loadRolePrompts: vi.fn(async () => ({ planner: 'p', builder: 'b', qa: 'q' })),
|
|
301
310
|
};
|
|
302
311
|
const toolCaller = {
|
|
303
312
|
callTool: vi.fn(async (_role: string, toolName: string, args: any) => {
|
|
@@ -307,14 +316,16 @@ describe('SessionOrchestrator collaborator branches', () => {
|
|
|
307
316
|
if (toolName === TOOLS.FEATURE_STATE_GET && args.feature_id === 'feature_b') {
|
|
308
317
|
return {
|
|
309
318
|
ok: true,
|
|
310
|
-
data: {
|
|
319
|
+
data: {
|
|
320
|
+
front_matter: { version: 3, cluster: { orchestrator_session_id: 'orch-main' } },
|
|
321
|
+
},
|
|
311
322
|
};
|
|
312
323
|
}
|
|
313
324
|
if (toolName === TOOLS.FEATURE_STATE_GET && args.feature_id === 'feature_patch') {
|
|
314
325
|
return { ok: true, data: { front_matter: { version: 7 } } };
|
|
315
326
|
}
|
|
316
327
|
return { ok: true, data: {} };
|
|
317
|
-
})
|
|
328
|
+
}),
|
|
318
329
|
};
|
|
319
330
|
const state = {
|
|
320
331
|
runId: 'run-session',
|
|
@@ -322,7 +333,7 @@ describe('SessionOrchestrator collaborator branches', () => {
|
|
|
322
333
|
orchestratorSessionId: null as string | null,
|
|
323
334
|
runMetadata: {},
|
|
324
335
|
queue: [{ feature_id: 'feature_q' }],
|
|
325
|
-
sessionsByFeature: new Map<string, { planner: string; builder: string; qa: string }>()
|
|
336
|
+
sessionsByFeature: new Map<string, { planner: string; builder: string; qa: string }>(),
|
|
326
337
|
};
|
|
327
338
|
|
|
328
339
|
return {
|
|
@@ -338,8 +349,8 @@ describe('SessionOrchestrator collaborator branches', () => {
|
|
|
338
349
|
kernel: kernel as any,
|
|
339
350
|
promptProvider: promptProvider as any,
|
|
340
351
|
toolCaller: toolCaller as any,
|
|
341
|
-
state: state as any
|
|
342
|
-
})
|
|
352
|
+
state: state as any,
|
|
353
|
+
}),
|
|
343
354
|
};
|
|
344
355
|
}
|
|
345
356
|
|
|
@@ -359,11 +370,11 @@ describe('SessionOrchestrator collaborator branches', () => {
|
|
|
359
370
|
|
|
360
371
|
expect(patchSpy).toHaveBeenCalledWith(
|
|
361
372
|
'feature_init',
|
|
362
|
-
expect.objectContaining({ orchestrator_session_id: 'unknown' })
|
|
373
|
+
expect.objectContaining({ orchestrator_session_id: 'unknown' }),
|
|
363
374
|
);
|
|
364
375
|
expect(patchSpy).toHaveBeenCalledWith(
|
|
365
376
|
'feature_q',
|
|
366
|
-
expect.objectContaining({ orchestrator_session_id: 'unknown' })
|
|
377
|
+
expect.objectContaining({ orchestrator_session_id: 'unknown' }),
|
|
367
378
|
);
|
|
368
379
|
});
|
|
369
380
|
|
|
@@ -374,7 +385,7 @@ describe('SessionOrchestrator collaborator branches', () => {
|
|
|
374
385
|
await orchestrator.enforceActiveFeatureInvariant(['feature_a', 'feature_b']);
|
|
375
386
|
|
|
376
387
|
const patchCalls = toolCaller.callTool.mock.calls.filter(
|
|
377
|
-
(call: any[]) => call[1] === TOOLS.FEATURE_STATE_PATCH
|
|
388
|
+
(call: any[]) => call[1] === TOOLS.FEATURE_STATE_PATCH,
|
|
378
389
|
);
|
|
379
390
|
expect(patchCalls).toHaveLength(1);
|
|
380
391
|
expect(patchCalls[0][2]).toMatchObject({
|
|
@@ -382,10 +393,10 @@ describe('SessionOrchestrator collaborator branches', () => {
|
|
|
382
393
|
patch: {
|
|
383
394
|
front_matter: {
|
|
384
395
|
cluster: {
|
|
385
|
-
orchestrator_session_id: 'orch-main'
|
|
386
|
-
}
|
|
387
|
-
}
|
|
388
|
-
}
|
|
396
|
+
orchestrator_session_id: 'orch-main',
|
|
397
|
+
},
|
|
398
|
+
},
|
|
399
|
+
},
|
|
389
400
|
});
|
|
390
401
|
});
|
|
391
402
|
|
|
@@ -402,11 +413,11 @@ describe('SessionOrchestrator collaborator branches', () => {
|
|
|
402
413
|
patch: {
|
|
403
414
|
front_matter: {
|
|
404
415
|
cluster: {
|
|
405
|
-
qa_session_id: 'qa-new'
|
|
406
|
-
}
|
|
407
|
-
}
|
|
408
|
-
}
|
|
409
|
-
})
|
|
416
|
+
qa_session_id: 'qa-new',
|
|
417
|
+
},
|
|
418
|
+
},
|
|
419
|
+
},
|
|
420
|
+
}),
|
|
410
421
|
);
|
|
411
422
|
});
|
|
412
423
|
|
|
@@ -415,7 +426,7 @@ describe('SessionOrchestrator collaborator branches', () => {
|
|
|
415
426
|
state.sessionsByFeature.set('feature_close', {
|
|
416
427
|
planner: 'planner-c',
|
|
417
428
|
builder: UNASSIGNED_SESSION_ID,
|
|
418
|
-
qa: 'qa-c'
|
|
429
|
+
qa: 'qa-c',
|
|
419
430
|
});
|
|
420
431
|
|
|
421
432
|
await orchestrator.closeFeatureCluster('feature_close');
|
|
@@ -444,8 +455,8 @@ describe('BuildWaveExecutor catch and reactions branches', () => {
|
|
|
444
455
|
noteLogged: false,
|
|
445
456
|
requestHandled: false,
|
|
446
457
|
priorityOrder: [] as string[],
|
|
447
|
-
toolResults: []
|
|
448
|
-
}))
|
|
458
|
+
toolResults: [],
|
|
459
|
+
})),
|
|
449
460
|
};
|
|
450
461
|
return { workerDecisionRunner };
|
|
451
462
|
}
|
|
@@ -456,7 +467,10 @@ describe('BuildWaveExecutor catch and reactions branches', () => {
|
|
|
456
467
|
const toolCaller = {
|
|
457
468
|
callTool: vi.fn(async (_role: string, toolName: string) => {
|
|
458
469
|
if (toolName === TOOLS.FEATURE_STATE_GET) {
|
|
459
|
-
return {
|
|
470
|
+
return {
|
|
471
|
+
ok: true,
|
|
472
|
+
data: { front_matter: { status: STATUS.BUILDING, gate_retry_count: 0 } },
|
|
473
|
+
};
|
|
460
474
|
}
|
|
461
475
|
if (toolName === TOOLS.FEATURE_GET_CONTEXT) {
|
|
462
476
|
return { ok: true, data: {} };
|
|
@@ -469,7 +483,7 @@ describe('BuildWaveExecutor catch and reactions branches', () => {
|
|
|
469
483
|
throw new Error('retry gate exploded');
|
|
470
484
|
}
|
|
471
485
|
return { ok: true, data: {} };
|
|
472
|
-
})
|
|
486
|
+
}),
|
|
473
487
|
};
|
|
474
488
|
const reactionsService = {
|
|
475
489
|
retryDelayMs: vi.fn(() => 5),
|
|
@@ -477,13 +491,13 @@ describe('BuildWaveExecutor catch and reactions branches', () => {
|
|
|
477
491
|
buildRepairPrompt: vi.fn(() => 'repair prompt'),
|
|
478
492
|
recordRetry: vi.fn(async () => undefined),
|
|
479
493
|
shouldEscalate: vi.fn(() => false),
|
|
480
|
-
notifyEscalation: vi.fn(async () => undefined)
|
|
494
|
+
notifyEscalation: vi.fn(async () => undefined),
|
|
481
495
|
};
|
|
482
496
|
|
|
483
497
|
const executor = new BuildWaveExecutor({
|
|
484
498
|
toolCaller: toolCaller as never,
|
|
485
499
|
workerDecisionRunner: workerDecisionRunner as never,
|
|
486
|
-
reactionsService: reactionsService as never
|
|
500
|
+
reactionsService: reactionsService as never,
|
|
487
501
|
});
|
|
488
502
|
|
|
489
503
|
await executor.run(['feature_build'], 1);
|
|
@@ -498,17 +512,23 @@ describe('BuildWaveExecutor catch and reactions branches', () => {
|
|
|
498
512
|
const toolCaller = {
|
|
499
513
|
callTool: vi.fn(async (_role: string, toolName: string) => {
|
|
500
514
|
if (toolName === TOOLS.FEATURE_STATE_GET) {
|
|
501
|
-
return {
|
|
515
|
+
return {
|
|
516
|
+
ok: true,
|
|
517
|
+
data: { front_matter: { status: STATUS.BUILDING, gate_retry_count: 0 } },
|
|
518
|
+
};
|
|
502
519
|
}
|
|
503
520
|
if (toolName === TOOLS.FEATURE_GET_CONTEXT) {
|
|
504
521
|
return { ok: true, data: {} };
|
|
505
522
|
}
|
|
506
523
|
if (toolName === TOOLS.GATES_RUN) {
|
|
507
524
|
gatesCallCount += 1;
|
|
508
|
-
return {
|
|
525
|
+
return {
|
|
526
|
+
ok: true,
|
|
527
|
+
data: { overall: gatesCallCount === 1 ? GATE_RESULT.FAIL : GATE_RESULT.PASS },
|
|
528
|
+
};
|
|
509
529
|
}
|
|
510
530
|
return { ok: true, data: {} };
|
|
511
|
-
})
|
|
531
|
+
}),
|
|
512
532
|
};
|
|
513
533
|
const reactionsService = {
|
|
514
534
|
retryDelayMs: vi.fn(() => 5),
|
|
@@ -516,13 +536,13 @@ describe('BuildWaveExecutor catch and reactions branches', () => {
|
|
|
516
536
|
buildRepairPrompt: vi.fn(() => 'repair prompt'),
|
|
517
537
|
recordRetry: vi.fn(async () => undefined),
|
|
518
538
|
shouldEscalate: vi.fn(() => false),
|
|
519
|
-
notifyEscalation: vi.fn(async () => undefined)
|
|
539
|
+
notifyEscalation: vi.fn(async () => undefined),
|
|
520
540
|
};
|
|
521
541
|
|
|
522
542
|
const executor = new BuildWaveExecutor({
|
|
523
543
|
toolCaller: toolCaller as never,
|
|
524
544
|
workerDecisionRunner: workerDecisionRunner as never,
|
|
525
|
-
reactionsService: reactionsService as never
|
|
545
|
+
reactionsService: reactionsService as never,
|
|
526
546
|
});
|
|
527
547
|
|
|
528
548
|
await executor.run(['feature_build'], 1);
|
|
@@ -536,18 +556,20 @@ describe('BuildWaveExecutor catch and reactions branches', () => {
|
|
|
536
556
|
|
|
537
557
|
describe('PromptBundleLoader behavior', () => {
|
|
538
558
|
it('GIVEN_missing_prompt_behavior_error_WHEN_file_not_found_THEN_throws_missing_role_prompt', async () => {
|
|
539
|
-
const readFileSpy = vi
|
|
559
|
+
const readFileSpy = vi
|
|
560
|
+
.spyOn(fs, 'readFile')
|
|
561
|
+
.mockRejectedValue(new Error('ENOENT: no such file') as never);
|
|
540
562
|
const runtimeStateReader = {
|
|
541
563
|
getRepoRoot: vi.fn(() => '/fake/repo'),
|
|
542
564
|
getAgentsConfig: vi.fn(() => ({
|
|
543
565
|
roles: { planner: { system_prompt_path: 'prompts/planner.md' } },
|
|
544
|
-
missing_prompt_behavior: 'error'
|
|
545
|
-
}))
|
|
566
|
+
missing_prompt_behavior: 'error',
|
|
567
|
+
})),
|
|
546
568
|
};
|
|
547
569
|
const loader = new PromptBundleLoader(runtimeStateReader as never);
|
|
548
570
|
|
|
549
571
|
await expect(loader.loadRolePrompts()).rejects.toMatchObject({
|
|
550
|
-
code: ERROR_CODES.MISSING_ROLE_PROMPT
|
|
572
|
+
code: ERROR_CODES.MISSING_ROLE_PROMPT,
|
|
551
573
|
});
|
|
552
574
|
|
|
553
575
|
readFileSpy.mockRestore();
|
|
@@ -556,7 +578,7 @@ describe('PromptBundleLoader behavior', () => {
|
|
|
556
578
|
it('GIVEN_cache_set_WHEN_peek_cache_called_THEN_returns_cached_value', () => {
|
|
557
579
|
const runtimeStateReader = {
|
|
558
580
|
getRepoRoot: vi.fn(() => '/fake/repo'),
|
|
559
|
-
getAgentsConfig: vi.fn(() => ({ roles: {}, missing_prompt_behavior: 'ignore' }))
|
|
581
|
+
getAgentsConfig: vi.fn(() => ({ roles: {}, missing_prompt_behavior: 'ignore' })),
|
|
560
582
|
};
|
|
561
583
|
const loader = new PromptBundleLoader(runtimeStateReader as never);
|
|
562
584
|
const bundle = { planner: 'planner prompt', builder: null, qa: 'qa prompt' };
|
|
@@ -569,7 +591,7 @@ describe('PromptBundleLoader behavior', () => {
|
|
|
569
591
|
it('GIVEN_cache_set_to_null_WHEN_peek_cache_called_THEN_returns_null', () => {
|
|
570
592
|
const runtimeStateReader = {
|
|
571
593
|
getRepoRoot: vi.fn(() => '/fake/repo'),
|
|
572
|
-
getAgentsConfig: vi.fn(() => ({ roles: {}, missing_prompt_behavior: 'ignore' }))
|
|
594
|
+
getAgentsConfig: vi.fn(() => ({ roles: {}, missing_prompt_behavior: 'ignore' })),
|
|
573
595
|
};
|
|
574
596
|
const loader = new PromptBundleLoader(runtimeStateReader as never);
|
|
575
597
|
|
|
@@ -581,7 +603,7 @@ describe('PromptBundleLoader behavior', () => {
|
|
|
581
603
|
it('GIVEN_agentsConfig_without_roles_or_behavior_WHEN_loadRolePrompts_THEN_uses_defaults', async () => {
|
|
582
604
|
const runtimeStateReader = {
|
|
583
605
|
getRepoRoot: vi.fn(() => '/fake/repo'),
|
|
584
|
-
getAgentsConfig: vi.fn(() => ({}))
|
|
606
|
+
getAgentsConfig: vi.fn(() => ({})),
|
|
585
607
|
};
|
|
586
608
|
const loader = new PromptBundleLoader(runtimeStateReader as never);
|
|
587
609
|
const bundle = await loader.loadRolePrompts();
|
|
@@ -600,8 +622,8 @@ describe('BuildWaveExecutor waitBeforeRetry branch', () => {
|
|
|
600
622
|
noteLogged: false,
|
|
601
623
|
requestHandled: false,
|
|
602
624
|
priorityOrder: [] as string[],
|
|
603
|
-
toolResults: []
|
|
604
|
-
}))
|
|
625
|
+
toolResults: [],
|
|
626
|
+
})),
|
|
605
627
|
};
|
|
606
628
|
return { workerDecisionRunner };
|
|
607
629
|
}
|
|
@@ -612,17 +634,23 @@ describe('BuildWaveExecutor waitBeforeRetry branch', () => {
|
|
|
612
634
|
const toolCaller = {
|
|
613
635
|
callTool: vi.fn(async (_role: string, toolName: string) => {
|
|
614
636
|
if (toolName === TOOLS.FEATURE_STATE_GET) {
|
|
615
|
-
return {
|
|
637
|
+
return {
|
|
638
|
+
ok: true,
|
|
639
|
+
data: { front_matter: { status: STATUS.BUILDING, gate_retry_count: 0 } },
|
|
640
|
+
};
|
|
616
641
|
}
|
|
617
642
|
if (toolName === TOOLS.FEATURE_GET_CONTEXT) {
|
|
618
643
|
return { ok: true, data: {} };
|
|
619
644
|
}
|
|
620
645
|
if (toolName === TOOLS.GATES_RUN) {
|
|
621
646
|
gatesCallCount += 1;
|
|
622
|
-
return {
|
|
647
|
+
return {
|
|
648
|
+
ok: true,
|
|
649
|
+
data: { overall: gatesCallCount === 1 ? GATE_RESULT.FAIL : GATE_RESULT.PASS },
|
|
650
|
+
};
|
|
623
651
|
}
|
|
624
652
|
return { ok: true, data: {} };
|
|
625
|
-
})
|
|
653
|
+
}),
|
|
626
654
|
};
|
|
627
655
|
const waitBeforeRetry = vi.fn(async () => undefined);
|
|
628
656
|
const reactionsService = {
|
|
@@ -632,13 +660,13 @@ describe('BuildWaveExecutor waitBeforeRetry branch', () => {
|
|
|
632
660
|
buildRepairPrompt: vi.fn(() => 'repair prompt'),
|
|
633
661
|
recordRetry: vi.fn(async () => undefined),
|
|
634
662
|
shouldEscalate: vi.fn(() => false),
|
|
635
|
-
notifyEscalation: vi.fn(async () => undefined)
|
|
663
|
+
notifyEscalation: vi.fn(async () => undefined),
|
|
636
664
|
};
|
|
637
665
|
|
|
638
666
|
const executor = new BuildWaveExecutor({
|
|
639
667
|
toolCaller: toolCaller as never,
|
|
640
668
|
workerDecisionRunner: workerDecisionRunner as never,
|
|
641
|
-
reactionsService: reactionsService as never
|
|
669
|
+
reactionsService: reactionsService as never,
|
|
642
670
|
});
|
|
643
671
|
|
|
644
672
|
await executor.run(['feature_wait'], 1);
|
|
@@ -656,14 +684,14 @@ describe('QaWaveExecutor waitBeforeRetry branch', () => {
|
|
|
656
684
|
noteLogged: false,
|
|
657
685
|
requestHandled: false,
|
|
658
686
|
priorityOrder: [] as string[],
|
|
659
|
-
toolResults: []
|
|
660
|
-
}))
|
|
687
|
+
toolResults: [],
|
|
688
|
+
})),
|
|
661
689
|
};
|
|
662
690
|
const state = {
|
|
663
691
|
runId: 'run-qa-retry',
|
|
664
692
|
ownerInstanceId: 'owner-qa-retry',
|
|
665
693
|
orchestratorSessionId: null,
|
|
666
|
-
sessionsByFeature: new Map<string, { planner: string; builder: string; qa: string }>()
|
|
694
|
+
sessionsByFeature: new Map<string, { planner: string; builder: string; qa: string }>(),
|
|
667
695
|
};
|
|
668
696
|
let gatesCallCount = 0;
|
|
669
697
|
const toolCaller = {
|
|
@@ -676,10 +704,13 @@ describe('QaWaveExecutor waitBeforeRetry branch', () => {
|
|
|
676
704
|
}
|
|
677
705
|
if (toolName === TOOLS.GATES_RUN) {
|
|
678
706
|
gatesCallCount += 1;
|
|
679
|
-
return {
|
|
707
|
+
return {
|
|
708
|
+
ok: true,
|
|
709
|
+
data: { overall: gatesCallCount === 1 ? GATE_RESULT.FAIL : GATE_RESULT.PASS },
|
|
710
|
+
};
|
|
680
711
|
}
|
|
681
712
|
return { ok: true, data: {} };
|
|
682
|
-
})
|
|
713
|
+
}),
|
|
683
714
|
};
|
|
684
715
|
const waitBeforeRetry = vi.fn(async () => undefined);
|
|
685
716
|
const reactionsService = {
|
|
@@ -689,20 +720,20 @@ describe('QaWaveExecutor waitBeforeRetry branch', () => {
|
|
|
689
720
|
buildRepairPrompt: vi.fn(() => 'repair prompt'),
|
|
690
721
|
recordRetry: vi.fn(async () => undefined),
|
|
691
722
|
shouldEscalate: vi.fn(() => false),
|
|
692
|
-
notifyEscalation: vi.fn(async () => undefined)
|
|
723
|
+
notifyEscalation: vi.fn(async () => undefined),
|
|
693
724
|
};
|
|
694
725
|
const provider = {
|
|
695
726
|
closeSession: vi.fn(async () => ({ closed: true })),
|
|
696
|
-
createSession: vi.fn(async () => ({ session_id: 'qa-retry-session' }))
|
|
727
|
+
createSession: vi.fn(async () => ({ session_id: 'qa-retry-session' })),
|
|
697
728
|
};
|
|
698
729
|
const kernel = {
|
|
699
|
-
updateFeatureSessionAssignment: vi.fn(async () => ({ data: { updated: true } }))
|
|
730
|
+
updateFeatureSessionAssignment: vi.fn(async () => ({ data: { updated: true } })),
|
|
700
731
|
};
|
|
701
732
|
const promptProvider = {
|
|
702
|
-
loadRolePrompts: vi.fn(async () => ({ planner: null, builder: null, qa: null }))
|
|
733
|
+
loadRolePrompts: vi.fn(async () => ({ planner: null, builder: null, qa: null })),
|
|
703
734
|
};
|
|
704
735
|
const featureClusterPatcher = {
|
|
705
|
-
patchFeatureCluster: vi.fn(async () => undefined)
|
|
736
|
+
patchFeatureCluster: vi.fn(async () => undefined),
|
|
706
737
|
};
|
|
707
738
|
const executor = new QaWaveExecutor({
|
|
708
739
|
kernel: kernel as never,
|
|
@@ -712,7 +743,7 @@ describe('QaWaveExecutor waitBeforeRetry branch', () => {
|
|
|
712
743
|
featureClusterPatcher: featureClusterPatcher as never,
|
|
713
744
|
state: state as never,
|
|
714
745
|
workerDecisionRunner: workerDecisionRunner as never,
|
|
715
|
-
reactionsService: reactionsService as never
|
|
746
|
+
reactionsService: reactionsService as never,
|
|
716
747
|
});
|
|
717
748
|
|
|
718
749
|
await executor.run(['feature_qa_wait'], 1);
|
|
@@ -726,7 +757,10 @@ describe('BuildWaveExecutor error message fallback', () => {
|
|
|
726
757
|
const toolCaller = {
|
|
727
758
|
callTool: vi.fn(async (_role: string, toolName: string) => {
|
|
728
759
|
if (toolName === TOOLS.FEATURE_STATE_GET) {
|
|
729
|
-
return {
|
|
760
|
+
return {
|
|
761
|
+
ok: true,
|
|
762
|
+
data: { front_matter: { status: STATUS.BUILDING, gate_retry_count: 0 } },
|
|
763
|
+
};
|
|
730
764
|
}
|
|
731
765
|
if (toolName === TOOLS.FEATURE_GET_CONTEXT) {
|
|
732
766
|
return { ok: true, data: {} };
|
|
@@ -735,7 +769,7 @@ describe('BuildWaveExecutor error message fallback', () => {
|
|
|
735
769
|
throw {}; // no message property → typed.message ?? '' = ''
|
|
736
770
|
}
|
|
737
771
|
return { ok: true, data: {} };
|
|
738
|
-
})
|
|
772
|
+
}),
|
|
739
773
|
};
|
|
740
774
|
const workerDecisionRunner = {
|
|
741
775
|
execute: vi.fn(async () => ({
|
|
@@ -744,8 +778,8 @@ describe('BuildWaveExecutor error message fallback', () => {
|
|
|
744
778
|
noteLogged: false,
|
|
745
779
|
requestHandled: false,
|
|
746
780
|
priorityOrder: [] as string[],
|
|
747
|
-
toolResults: []
|
|
748
|
-
}))
|
|
781
|
+
toolResults: [],
|
|
782
|
+
})),
|
|
749
783
|
};
|
|
750
784
|
const reactionsService = {
|
|
751
785
|
retryDelayMs: vi.fn(() => 0),
|
|
@@ -753,12 +787,12 @@ describe('BuildWaveExecutor error message fallback', () => {
|
|
|
753
787
|
buildRepairPrompt: vi.fn(() => 'prompt'),
|
|
754
788
|
recordRetry: vi.fn(async () => undefined),
|
|
755
789
|
shouldEscalate: vi.fn(() => false),
|
|
756
|
-
notifyEscalation: vi.fn(async () => undefined)
|
|
790
|
+
notifyEscalation: vi.fn(async () => undefined),
|
|
757
791
|
};
|
|
758
792
|
const executor = new BuildWaveExecutor({
|
|
759
793
|
toolCaller: toolCaller as never,
|
|
760
794
|
workerDecisionRunner: workerDecisionRunner as never,
|
|
761
|
-
reactionsService: reactionsService as never
|
|
795
|
+
reactionsService: reactionsService as never,
|
|
762
796
|
});
|
|
763
797
|
await executor.run(['feature_x'], 1);
|
|
764
798
|
});
|
|
@@ -768,18 +802,23 @@ describe('BuildWaveExecutor error message fallback', () => {
|
|
|
768
802
|
const toolCaller = {
|
|
769
803
|
callTool: vi.fn(async (_role: string, toolName: string) => {
|
|
770
804
|
if (toolName === TOOLS.FEATURE_STATE_GET) {
|
|
771
|
-
return {
|
|
805
|
+
return {
|
|
806
|
+
ok: true,
|
|
807
|
+
data: { front_matter: { status: STATUS.BUILDING, gate_retry_count: 0 } },
|
|
808
|
+
};
|
|
772
809
|
}
|
|
773
810
|
if (toolName === TOOLS.FEATURE_GET_CONTEXT) {
|
|
774
811
|
return { ok: true, data: {} };
|
|
775
812
|
}
|
|
776
813
|
if (toolName === TOOLS.GATES_RUN) {
|
|
777
814
|
gatesCallCount++;
|
|
778
|
-
if (gatesCallCount === 1) {
|
|
815
|
+
if (gatesCallCount === 1) {
|
|
816
|
+
return { ok: true, data: { overall: GATE_RESULT.FAIL } };
|
|
817
|
+
}
|
|
779
818
|
return { ok: true, data: {} };
|
|
780
819
|
}
|
|
781
820
|
return { ok: true, data: {} };
|
|
782
|
-
})
|
|
821
|
+
}),
|
|
783
822
|
};
|
|
784
823
|
const workerDecisionRunner = {
|
|
785
824
|
execute: vi.fn(async () => ({
|
|
@@ -788,8 +827,8 @@ describe('BuildWaveExecutor error message fallback', () => {
|
|
|
788
827
|
noteLogged: false,
|
|
789
828
|
requestHandled: false,
|
|
790
829
|
priorityOrder: [] as string[],
|
|
791
|
-
toolResults: []
|
|
792
|
-
}))
|
|
830
|
+
toolResults: [],
|
|
831
|
+
})),
|
|
793
832
|
};
|
|
794
833
|
const reactionsService = {
|
|
795
834
|
retryDelayMs: vi.fn(() => 0),
|
|
@@ -797,12 +836,12 @@ describe('BuildWaveExecutor error message fallback', () => {
|
|
|
797
836
|
buildRepairPrompt: vi.fn(() => 'repair'),
|
|
798
837
|
recordRetry: vi.fn(async () => undefined),
|
|
799
838
|
shouldEscalate: vi.fn(() => false),
|
|
800
|
-
notifyEscalation: vi.fn(async () => undefined)
|
|
839
|
+
notifyEscalation: vi.fn(async () => undefined),
|
|
801
840
|
};
|
|
802
841
|
const executor = new BuildWaveExecutor({
|
|
803
842
|
toolCaller: toolCaller as never,
|
|
804
843
|
workerDecisionRunner: workerDecisionRunner as never,
|
|
805
|
-
reactionsService: reactionsService as never
|
|
844
|
+
reactionsService: reactionsService as never,
|
|
806
845
|
});
|
|
807
846
|
await executor.run(['feature_x'], 1);
|
|
808
847
|
// retry returned no overall → defaults to PASS → gateOverall = PASS → shouldEscalate not called
|
|
@@ -813,7 +852,10 @@ describe('BuildWaveExecutor error message fallback', () => {
|
|
|
813
852
|
const toolCaller = {
|
|
814
853
|
callTool: vi.fn(async (_role: string, toolName: string) => {
|
|
815
854
|
if (toolName === TOOLS.FEATURE_STATE_GET) {
|
|
816
|
-
return {
|
|
855
|
+
return {
|
|
856
|
+
ok: true,
|
|
857
|
+
data: { front_matter: { status: STATUS.BUILDING, gate_retry_count: 0 } },
|
|
858
|
+
};
|
|
817
859
|
}
|
|
818
860
|
if (toolName === TOOLS.FEATURE_GET_CONTEXT) {
|
|
819
861
|
return { ok: true, data: {} };
|
|
@@ -822,7 +864,7 @@ describe('BuildWaveExecutor error message fallback', () => {
|
|
|
822
864
|
return { ok: true, data: { overall: GATE_RESULT.FAIL } };
|
|
823
865
|
}
|
|
824
866
|
return { ok: true, data: {} };
|
|
825
|
-
})
|
|
867
|
+
}),
|
|
826
868
|
};
|
|
827
869
|
const workerDecisionRunner = {
|
|
828
870
|
execute: vi.fn(async () => ({
|
|
@@ -831,8 +873,8 @@ describe('BuildWaveExecutor error message fallback', () => {
|
|
|
831
873
|
noteLogged: false,
|
|
832
874
|
requestHandled: false,
|
|
833
875
|
priorityOrder: [] as string[],
|
|
834
|
-
toolResults: []
|
|
835
|
-
}))
|
|
876
|
+
toolResults: [],
|
|
877
|
+
})),
|
|
836
878
|
};
|
|
837
879
|
const reactionsService = {
|
|
838
880
|
retryDelayMs: vi.fn(() => 0),
|
|
@@ -840,12 +882,12 @@ describe('BuildWaveExecutor error message fallback', () => {
|
|
|
840
882
|
buildRepairPrompt: vi.fn(() => 'repair'),
|
|
841
883
|
recordRetry: vi.fn(async () => undefined),
|
|
842
884
|
shouldEscalate: vi.fn(() => false),
|
|
843
|
-
notifyEscalation: vi.fn(async () => undefined)
|
|
885
|
+
notifyEscalation: vi.fn(async () => undefined),
|
|
844
886
|
};
|
|
845
887
|
const executor = new BuildWaveExecutor({
|
|
846
888
|
toolCaller: toolCaller as never,
|
|
847
889
|
workerDecisionRunner: workerDecisionRunner as never,
|
|
848
|
-
reactionsService: reactionsService as never
|
|
890
|
+
reactionsService: reactionsService as never,
|
|
849
891
|
});
|
|
850
892
|
await executor.run(['feature_x'], 1);
|
|
851
893
|
// retry still fails (FAIL) → shouldEscalate should be checked
|
|
@@ -857,18 +899,23 @@ describe('BuildWaveExecutor error message fallback', () => {
|
|
|
857
899
|
const toolCaller = {
|
|
858
900
|
callTool: vi.fn(async (_role: string, toolName: string) => {
|
|
859
901
|
if (toolName === TOOLS.FEATURE_STATE_GET) {
|
|
860
|
-
return {
|
|
902
|
+
return {
|
|
903
|
+
ok: true,
|
|
904
|
+
data: { front_matter: { status: STATUS.BUILDING, gate_retry_count: 0 } },
|
|
905
|
+
};
|
|
861
906
|
}
|
|
862
907
|
if (toolName === TOOLS.FEATURE_GET_CONTEXT) {
|
|
863
908
|
return { ok: true, data: {} };
|
|
864
909
|
}
|
|
865
910
|
if (toolName === TOOLS.GATES_RUN) {
|
|
866
911
|
gatesCallCount++;
|
|
867
|
-
if (gatesCallCount === 1) {
|
|
912
|
+
if (gatesCallCount === 1) {
|
|
913
|
+
return { ok: true, data: { overall: GATE_RESULT.FAIL } };
|
|
914
|
+
}
|
|
868
915
|
throw {}; // retry throws without message → typed.message ?? '' = ''
|
|
869
916
|
}
|
|
870
917
|
return { ok: true, data: {} };
|
|
871
|
-
})
|
|
918
|
+
}),
|
|
872
919
|
};
|
|
873
920
|
const workerDecisionRunner = {
|
|
874
921
|
execute: vi.fn(async () => ({
|
|
@@ -877,8 +924,8 @@ describe('BuildWaveExecutor error message fallback', () => {
|
|
|
877
924
|
noteLogged: false,
|
|
878
925
|
requestHandled: false,
|
|
879
926
|
priorityOrder: [] as string[],
|
|
880
|
-
toolResults: []
|
|
881
|
-
}))
|
|
927
|
+
toolResults: [],
|
|
928
|
+
})),
|
|
882
929
|
};
|
|
883
930
|
const reactionsService = {
|
|
884
931
|
retryDelayMs: vi.fn(() => 0),
|
|
@@ -886,12 +933,12 @@ describe('BuildWaveExecutor error message fallback', () => {
|
|
|
886
933
|
buildRepairPrompt: vi.fn(() => 'repair'),
|
|
887
934
|
recordRetry: vi.fn(async () => undefined),
|
|
888
935
|
shouldEscalate: vi.fn(() => false),
|
|
889
|
-
notifyEscalation: vi.fn(async () => undefined)
|
|
936
|
+
notifyEscalation: vi.fn(async () => undefined),
|
|
890
937
|
};
|
|
891
938
|
const executor = new BuildWaveExecutor({
|
|
892
939
|
toolCaller: toolCaller as never,
|
|
893
940
|
workerDecisionRunner: workerDecisionRunner as never,
|
|
894
|
-
reactionsService: reactionsService as never
|
|
941
|
+
reactionsService: reactionsService as never,
|
|
895
942
|
});
|
|
896
943
|
await executor.run(['feature_x'], 1);
|
|
897
944
|
});
|