agentic-orchestrator 0.1.27 → 0.2.0
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/.claude/settings.local.json +46 -1
- package/.cortexrc +28 -0
- package/.github/agents/copilot-instructions.md +29 -0
- package/.github/copilot-instructions.md +93 -0
- package/.vscode/settings.json +13 -0
- package/.vscode/tms.code-snippets +223 -0
- package/AGENTS.md +72 -1
- package/Agentic-Orchestrator.iml +12 -11
- package/CLAUDE.md +72 -1
- package/CONSTITUTION.md +504 -0
- package/FUTURE-ENHANCEMENTS.md +85 -0
- package/NEXT-TASKS.md +25 -0
- package/PROMPTS.md +161 -0
- package/README.md +126 -29
- package/agentic/orchestrator/agents.yaml +4 -3
- package/agentic/orchestrator/defaults/policy.defaults.yaml +39 -3
- package/agentic/orchestrator/gates.yaml +15 -3
- package/agentic/orchestrator/policy.yaml +47 -3
- package/agentic/orchestrator/prompts/builder.system.md +69 -20
- package/agentic/orchestrator/prompts/planner-intake.system.md +149 -0
- package/agentic/orchestrator/prompts/planner.system.md +113 -40
- package/agentic/orchestrator/prompts/qa.system.md +73 -18
- package/agentic/orchestrator/prompts/reconciler.system.md +119 -0
- package/agentic/orchestrator/schemas/agents.schema.json +89 -1
- package/agentic/orchestrator/schemas/execution-control.schema.json +242 -0
- package/agentic/orchestrator/schemas/index.schema.json +234 -0
- package/agentic/orchestrator/schemas/intake.review.schema.json +82 -0
- package/agentic/orchestrator/schemas/organizer-ordering-artifact.schema.json +75 -0
- package/agentic/orchestrator/schemas/plan.schema.json +44 -0
- package/agentic/orchestrator/schemas/policy.schema.json +238 -9
- package/agentic/orchestrator/schemas/policy.user.schema.json +129 -1
- package/agentic/orchestrator/schemas/spec.manifest.bootstrap.schema.json +101 -0
- package/agentic/orchestrator/schemas/spec.manifest.verified.schema.json +80 -0
- package/agentic/orchestrator/schemas/state.schema.json +298 -3
- package/agentic/orchestrator/tools/catalog.json +145 -15
- package/agentic/orchestrator/tools/schemas/input/doctor.run.input.schema.json +18 -0
- package/agentic/orchestrator/tools/schemas/input/evidence.latest.input.schema.json +4 -0
- package/agentic/orchestrator/tools/schemas/input/evidence.verify_chain.input.schema.json +13 -0
- package/agentic/orchestrator/tools/schemas/input/feature.intake_submit.input.schema.json +11 -0
- package/agentic/orchestrator/tools/schemas/input/feature.question_answer.input.schema.json +15 -0
- package/agentic/orchestrator/tools/schemas/input/feature.question_create.input.schema.json +21 -0
- package/agentic/orchestrator/tools/schemas/input/feature.question_list.input.schema.json +13 -0
- package/agentic/orchestrator/tools/schemas/input/feature.ready_to_merge.input.schema.json +5 -0
- package/agentic/orchestrator/tools/schemas/input/feature.send_message.input.schema.json +1 -1
- package/agentic/orchestrator/tools/schemas/input/replay.timeline_get.input.schema.json +32 -0
- package/agentic/orchestrator/tools/schemas/input/repo.conflict_abort.input.schema.json +16 -0
- package/agentic/orchestrator/tools/schemas/input/repo.conflict_files.input.schema.json +16 -0
- package/agentic/orchestrator/tools/schemas/input/repo.reconcile_mainline.input.schema.json +37 -0
- package/agentic/orchestrator/tools/schemas/input/repo.resolve_conflict.input.schema.json +40 -0
- package/agentic/orchestrator/tools/schemas/input/runtime.execution_request_list.input.schema.json +7 -0
- package/agentic/orchestrator/tools/schemas/input/runtime.execution_request_submit.input.schema.json +25 -0
- package/agentic/orchestrator/tools/schemas/output/doctor.run.output.schema.json +34 -0
- package/agentic/orchestrator/tools/schemas/output/evidence.verify_chain.output.schema.json +23 -0
- package/agentic/orchestrator/tools/schemas/output/feature.get_context.output.schema.json +62 -2
- package/agentic/orchestrator/tools/schemas/output/feature.intake_submit.output.schema.json +24 -0
- package/agentic/orchestrator/tools/schemas/output/feature.question_answer.output.schema.json +21 -0
- package/agentic/orchestrator/tools/schemas/output/feature.question_create.output.schema.json +12 -0
- package/agentic/orchestrator/tools/schemas/output/feature.question_list.output.schema.json +14 -0
- package/agentic/orchestrator/tools/schemas/output/feature.ready_to_merge.output.schema.json +31 -0
- package/agentic/orchestrator/tools/schemas/output/feature.send_message.output.schema.json +8 -18
- package/agentic/orchestrator/tools/schemas/output/replay.timeline_get.output.schema.json +64 -0
- package/agentic/orchestrator/tools/schemas/output/repo.conflict_abort.output.schema.json +16 -0
- package/agentic/orchestrator/tools/schemas/output/repo.conflict_files.output.schema.json +22 -0
- package/agentic/orchestrator/tools/schemas/output/repo.reconcile_mainline.output.schema.json +61 -0
- package/agentic/orchestrator/tools/schemas/output/repo.resolve_conflict.output.schema.json +19 -0
- package/agentic/orchestrator/tools/schemas/output/report.dashboard.output.schema.json +26 -0
- package/agentic/orchestrator/tools/schemas/output/runtime.execution_request_list.output.schema.json +17 -0
- package/agentic/orchestrator/tools/schemas/output/runtime.execution_request_submit.output.schema.json +24 -0
- package/agentic/orchestrator/tools.md +13 -0
- package/apps/control-plane/scripts/validate-mcp-contracts.ts +1 -1
- package/apps/control-plane/src/application/kernel-tool-wiring.ts +140 -2
- package/apps/control-plane/src/application/services/activity-monitor-service.ts +44 -1
- package/apps/control-plane/src/application/services/bootstrap-manifest-generator-service.ts +251 -0
- package/apps/control-plane/src/application/services/checkpoint-service.ts +87 -27
- package/apps/control-plane/src/application/services/collision-override-service.ts +906 -0
- package/apps/control-plane/src/application/services/collision-queue-service.ts +129 -38
- package/apps/control-plane/src/application/services/cost-tracking-service.ts +94 -0
- package/apps/control-plane/src/application/services/execution-control-service.ts +599 -0
- package/apps/control-plane/src/application/services/feature-deletion-service.ts +37 -1
- package/apps/control-plane/src/application/services/feature-lifecycle-service.ts +182 -4
- package/apps/control-plane/src/application/services/feature-send-message-service.ts +17 -8
- package/apps/control-plane/src/application/services/feature-state-service.ts +191 -6
- package/apps/control-plane/src/application/services/gate-service.ts +121 -2
- package/apps/control-plane/src/application/services/git-reconciliation-service.ts +1591 -0
- package/apps/control-plane/src/application/services/intake-service.ts +1468 -0
- package/apps/control-plane/src/application/services/merge-service.ts +308 -17
- package/apps/control-plane/src/application/services/notifier-service.ts +3 -1
- package/apps/control-plane/src/application/services/performance-analytics-service.ts +75 -0
- package/apps/control-plane/src/application/services/plan-service.ts +336 -20
- package/apps/control-plane/src/application/services/question-service.ts +693 -0
- package/apps/control-plane/src/application/services/reactions-service.ts +73 -17
- package/apps/control-plane/src/application/services/replay-timeline-service.ts +295 -0
- package/apps/control-plane/src/application/services/reporting-service.ts +194 -10
- package/apps/control-plane/src/application/services/run-lease-service.ts +121 -5
- package/apps/control-plane/src/application/services/worktree-watchdog-service.ts +95 -8
- package/apps/control-plane/src/application/tools/tool-metadata.ts +7 -0
- package/apps/control-plane/src/application/usage-types.ts +138 -0
- package/apps/control-plane/src/cli/add-command-handler.ts +162 -0
- package/apps/control-plane/src/cli/answer-command-handler.ts +113 -0
- package/apps/control-plane/src/cli/attach-command-handler.ts +12 -3
- package/apps/control-plane/src/cli/cli-argument-parser.ts +133 -11
- package/apps/control-plane/src/cli/collision-command-handler.ts +113 -0
- package/apps/control-plane/src/cli/command-catalog.ts +479 -0
- package/apps/control-plane/src/cli/complete-command-handler.ts +23 -0
- package/apps/control-plane/src/cli/completion-command-handler.ts +25 -0
- package/apps/control-plane/src/cli/completion-resolver.ts +319 -0
- package/apps/control-plane/src/cli/completion-shell-renderer.ts +58 -0
- package/apps/control-plane/src/cli/dashboard-command-handler.ts +110 -1
- package/apps/control-plane/src/cli/dashboard-runtime-runner.ts +1036 -0
- package/apps/control-plane/src/cli/dashboard-runtime.ts +31 -0
- package/apps/control-plane/src/cli/help-command-handler.ts +17 -185
- package/apps/control-plane/src/cli/init-command-handler.ts +51 -6
- package/apps/control-plane/src/cli/merge-command-handler.ts +200 -0
- package/apps/control-plane/src/cli/questions-command-handler.ts +70 -0
- package/apps/control-plane/src/cli/replay-command-handler.ts +98 -0
- package/apps/control-plane/src/cli/resume-command-handler.ts +252 -18
- package/apps/control-plane/src/cli/retry-command-handler.ts +229 -17
- package/apps/control-plane/src/cli/retry-resume-decision.ts +75 -0
- package/apps/control-plane/src/cli/rollback-command-handler.ts +4 -2
- package/apps/control-plane/src/cli/run-command-handler.ts +35 -1
- package/apps/control-plane/src/cli/spec-ingestion-service.ts +45 -55
- package/apps/control-plane/src/cli/spec-preparation.ts +114 -0
- package/apps/control-plane/src/cli/spec-utils.ts +90 -11
- package/apps/control-plane/src/cli/status-command-handler.ts +122 -0
- package/apps/control-plane/src/cli/types.ts +41 -3
- package/apps/control-plane/src/core/collisions.ts +150 -31
- package/apps/control-plane/src/core/constants.ts +18 -1
- package/apps/control-plane/src/core/error-codes.ts +39 -0
- package/apps/control-plane/src/core/execution-control.ts +56 -0
- package/apps/control-plane/src/core/feature-resume-phase.ts +118 -0
- package/apps/control-plane/src/core/gate-freshness.ts +359 -0
- package/apps/control-plane/src/core/gate-log-extractor.ts +97 -0
- package/apps/control-plane/src/core/gates.ts +90 -1
- package/apps/control-plane/src/core/intake-artifacts.ts +295 -0
- package/apps/control-plane/src/core/kernel-types.ts +11 -0
- package/apps/control-plane/src/core/kernel.ts +604 -16
- package/apps/control-plane/src/core/mainline-conflict.ts +22 -0
- package/apps/control-plane/src/core/merge-repair.ts +149 -0
- package/apps/control-plane/src/core/path-layout.ts +46 -2
- package/apps/control-plane/src/core/path-rules.ts +11 -3
- package/apps/control-plane/src/core/plan-submit-recovery.ts +130 -0
- package/apps/control-plane/src/core/questions.ts +49 -0
- package/apps/control-plane/src/core/runtime-sessions.ts +4 -0
- package/apps/control-plane/src/core/schemas.ts +40 -1
- package/apps/control-plane/src/core/tool-caller.ts +25 -1
- package/apps/control-plane/src/core/utils/index-normalizer.ts +25 -4
- package/apps/control-plane/src/core/worktree-diff.ts +66 -0
- package/apps/control-plane/src/index.ts +29 -1
- package/apps/control-plane/src/interfaces/cli/bootstrap.ts +300 -6
- package/apps/control-plane/src/mcp/kernel-tool-executor.ts +17 -0
- package/apps/control-plane/src/mcp/tool-runtime.ts +63 -4
- package/apps/control-plane/src/providers/api-worker-provider.ts +62 -15
- package/apps/control-plane/src/providers/cli-worker-provider.ts +1037 -61
- package/apps/control-plane/src/providers/output-parsers/generic-output-parser.ts +99 -1
- package/apps/control-plane/src/providers/output-parsers/types.ts +2 -0
- package/apps/control-plane/src/providers/provider-defaults.ts +116 -7
- package/apps/control-plane/src/providers/providers.ts +225 -21
- package/apps/control-plane/src/providers/worker-provider-factory.ts +26 -2
- package/apps/control-plane/src/supervisor/artifact-stager.ts +52 -0
- package/apps/control-plane/src/supervisor/build-wave-executor.ts +477 -166
- package/apps/control-plane/src/supervisor/execution-enrollment-service.ts +408 -0
- package/apps/control-plane/src/supervisor/organizer-enrollment-scheduler.ts +117 -0
- package/apps/control-plane/src/supervisor/organizer-sidecar-service.ts +394 -0
- package/apps/control-plane/src/supervisor/plan-conformance-scorer.ts +2 -5
- package/apps/control-plane/src/supervisor/planner-phase.ts +85 -0
- package/apps/control-plane/src/supervisor/planning-wave-executor.ts +993 -64
- package/apps/control-plane/src/supervisor/prompt-bundle-loader.ts +20 -1
- package/apps/control-plane/src/supervisor/qa-wave-executor.ts +384 -177
- package/apps/control-plane/src/supervisor/run-coordinator.ts +801 -43
- package/apps/control-plane/src/supervisor/runtime.ts +485 -9
- package/apps/control-plane/src/supervisor/session-orchestrator.ts +220 -1
- package/apps/control-plane/src/supervisor/types.ts +152 -1
- package/apps/control-plane/src/supervisor/worker-decision-loop.ts +1030 -92
- package/apps/control-plane/test/activity-monitor.spec.ts +76 -0
- package/apps/control-plane/test/add-command-handler.spec.ts +189 -0
- package/apps/control-plane/test/application/services/feature-state-service.spec.ts +208 -0
- package/apps/control-plane/test/artifact-stager.spec.ts +93 -0
- package/apps/control-plane/test/batch-operations.spec.ts +58 -0
- package/apps/control-plane/test/bootstrap-edge-cases.spec.ts +50 -2
- package/apps/control-plane/test/bootstrap-manifest-generator-service.spec.ts +99 -0
- package/apps/control-plane/test/bootstrap.spec.ts +177 -4
- package/apps/control-plane/test/checkpoint-service.spec.ts +977 -29
- package/apps/control-plane/test/cli-argument-parser.spec.ts +119 -0
- package/apps/control-plane/test/cli-helpers.spec.ts +1202 -12
- package/apps/control-plane/test/cli.unit.spec.ts +797 -16
- package/apps/control-plane/test/collision-command-handler.spec.ts +182 -0
- package/apps/control-plane/test/collision-override-service.spec.ts +878 -0
- package/apps/control-plane/test/collision-queue.spec.ts +430 -2
- package/apps/control-plane/test/collisions.spec.ts +209 -1
- package/apps/control-plane/test/core-utils.spec.ts +61 -0
- package/apps/control-plane/test/cost-tracking.spec.ts +224 -0
- package/apps/control-plane/test/dashboard-api.integration.spec.ts +185 -5
- package/apps/control-plane/test/dashboard-client.spec.ts +948 -0
- package/apps/control-plane/test/dashboard-command.spec.ts +138 -6
- package/apps/control-plane/test/dashboard-runtime-runner.spec.ts +1550 -0
- package/apps/control-plane/test/dashboard-runtime.spec.ts +138 -0
- package/apps/control-plane/test/dashboard-ui-utils.spec.ts +56 -12
- package/apps/control-plane/test/dependency-scheduler.spec.ts +7 -1
- package/apps/control-plane/test/env-file.spec.ts +76 -0
- package/apps/control-plane/test/execution-control-service.spec.ts +535 -0
- package/apps/control-plane/test/execution-enrollment-service.spec.ts +648 -0
- package/apps/control-plane/test/feature-lifecycle.spec.ts +126 -0
- package/apps/control-plane/test/feature-resume-phase.spec.ts +164 -0
- package/apps/control-plane/test/feature-send-message-service.spec.ts +161 -0
- package/apps/control-plane/test/feature-state-service.spec.ts +295 -0
- package/apps/control-plane/test/fs.spec.ts +80 -0
- package/apps/control-plane/test/gate-freshness.spec.ts +590 -0
- package/apps/control-plane/test/gate-log-extractor.spec.ts +170 -0
- package/apps/control-plane/test/gates.spec.ts +108 -0
- package/apps/control-plane/test/git-reconciliation-service.spec.ts +2307 -0
- package/apps/control-plane/test/helpers.ts +65 -0
- package/apps/control-plane/test/incremental-gates.spec.ts +271 -0
- package/apps/control-plane/test/index-normalizer.spec.ts +98 -0
- package/apps/control-plane/test/init-wizard.spec.ts +17 -0
- package/apps/control-plane/test/intake-artifacts.spec.ts +203 -0
- package/apps/control-plane/test/intake-service.spec.ts +3176 -0
- package/apps/control-plane/test/kernel-collision-replay.spec.ts +3 -2
- package/apps/control-plane/test/kernel-tool-executor.spec.ts +77 -0
- package/apps/control-plane/test/kernel-tool-wiring.spec.ts +279 -0
- package/apps/control-plane/test/kernel.branches.spec.ts +15 -2
- package/apps/control-plane/test/kernel.coverage.spec.ts +7 -3
- package/apps/control-plane/test/kernel.coverage2.spec.ts +731 -2
- package/apps/control-plane/test/kernel.spec.ts +464 -2
- package/apps/control-plane/test/mainline-conflict.spec.ts +66 -0
- package/apps/control-plane/test/mcp-helpers.spec.ts +79 -0
- package/apps/control-plane/test/mcp.spec.ts +177 -13
- package/apps/control-plane/test/merge-command-handler.spec.ts +531 -0
- package/apps/control-plane/test/merge-service.spec.ts +570 -4
- package/apps/control-plane/test/notifier-service.spec.ts +26 -0
- package/apps/control-plane/test/organizer-enrollment-scheduler.spec.ts +340 -0
- package/apps/control-plane/test/organizer-ordering-artifact.spec.ts +95 -0
- package/apps/control-plane/test/organizer-sidecar-service.spec.ts +468 -0
- package/apps/control-plane/test/output-loop-detector.spec.ts +6 -0
- package/apps/control-plane/test/path-layout.spec.ts +70 -0
- package/apps/control-plane/test/path-normalizers.spec.ts +41 -0
- package/apps/control-plane/test/performance-analytics.spec.ts +124 -0
- package/apps/control-plane/test/plan-conformance-scorer.spec.ts +53 -0
- package/apps/control-plane/test/plan-service.spec.ts +686 -4
- package/apps/control-plane/test/planning-wave-executor.spec.ts +3272 -86
- package/apps/control-plane/test/policy-loader-service.spec.ts +5 -0
- package/apps/control-plane/test/prompt-overlay.spec.ts +65 -0
- package/apps/control-plane/test/provider-command-runner-epipe.spec.ts +64 -0
- package/apps/control-plane/test/providers/api-worker-provider.spec.ts +129 -0
- package/apps/control-plane/test/providers/cli-worker-provider.spec.ts +148 -0
- package/apps/control-plane/test/providers/usage-types.spec.ts +98 -0
- package/apps/control-plane/test/providers.spec.ts +293 -16
- package/apps/control-plane/test/question-command-handlers.spec.ts +156 -0
- package/apps/control-plane/test/question-service.spec.ts +1119 -0
- package/apps/control-plane/test/reactions.spec.ts +114 -0
- package/apps/control-plane/test/replay-command-handler.spec.ts +144 -0
- package/apps/control-plane/test/replay-timeline-service.spec.ts +459 -0
- package/apps/control-plane/test/response.spec.ts +31 -0
- package/apps/control-plane/test/resume-command.spec.ts +786 -9
- package/apps/control-plane/test/retry-resume-decision.spec.ts +133 -0
- package/apps/control-plane/test/rollback-command-handler.spec.ts +334 -0
- package/apps/control-plane/test/rollback-command.spec.ts +120 -0
- package/apps/control-plane/test/run-coordinator.spec.ts +3141 -364
- package/apps/control-plane/test/schemas/state.schema.spec.ts +71 -0
- package/apps/control-plane/test/service-retry-paths.spec.ts +112 -0
- package/apps/control-plane/test/services.spec.ts +472 -2
- package/apps/control-plane/test/session-management.spec.ts +346 -1
- package/apps/control-plane/test/spec-ingestion.spec.ts +102 -28
- package/apps/control-plane/test/spec-preparation.spec.ts +182 -0
- package/apps/control-plane/test/supervisor-collaborators.spec.ts +191 -3
- package/apps/control-plane/test/supervisor.calltool.spec.ts +198 -0
- package/apps/control-plane/test/supervisor.spec.ts +95 -16
- package/apps/control-plane/test/supervisor.unit.spec.ts +385 -18
- package/apps/control-plane/test/tool-runtime.spec.ts +122 -0
- package/apps/control-plane/test/worker-decision-loop.spec.ts +3479 -476
- package/apps/control-plane/test/worker-execution-policy.spec.ts +1416 -6
- package/apps/control-plane/test/worker-provider-adapters.spec.ts +1894 -37
- package/apps/control-plane/test/worker-provider-factory.spec.ts +81 -0
- package/apps/control-plane/test/worktree-watchdog-service.spec.ts +125 -0
- package/apps/control-plane/vitest.config.ts +5 -0
- package/config/agentic/orchestrator/agents.yaml +23 -2
- package/config/agentic/orchestrator/gates.yaml +24 -7
- package/config/agentic/orchestrator/policy.yaml +23 -1
- package/config/agentic/orchestrator/prompts/builder.system.md +69 -20
- package/config/agentic/orchestrator/prompts/organizer.system.md +85 -0
- package/config/agentic/orchestrator/prompts/overrides/builder.claude.md +28 -0
- package/config/agentic/orchestrator/prompts/overrides/builder.codex.md +28 -0
- package/config/agentic/orchestrator/prompts/overrides/planner.claude.md +20 -0
- package/config/agentic/orchestrator/prompts/overrides/planner.codex.md +20 -0
- package/config/agentic/orchestrator/prompts/planner-intake.system.md +149 -0
- package/config/agentic/orchestrator/prompts/planner.system.md +113 -40
- package/config/agentic/orchestrator/prompts/qa.system.md +75 -18
- package/config/agentic/orchestrator/prompts/reconciler.system.md +119 -0
- package/dist/apps/control-plane/application/kernel-tool-wiring.d.ts +26 -2
- package/dist/apps/control-plane/application/kernel-tool-wiring.js +40 -2
- package/dist/apps/control-plane/application/kernel-tool-wiring.js.map +1 -1
- package/dist/apps/control-plane/application/services/activity-monitor-service.js +37 -1
- package/dist/apps/control-plane/application/services/activity-monitor-service.js.map +1 -1
- package/dist/apps/control-plane/application/services/bootstrap-manifest-generator-service.d.ts +4 -0
- package/dist/apps/control-plane/application/services/bootstrap-manifest-generator-service.js +188 -0
- package/dist/apps/control-plane/application/services/bootstrap-manifest-generator-service.js.map +1 -0
- package/dist/apps/control-plane/application/services/checkpoint-service.d.ts +5 -0
- package/dist/apps/control-plane/application/services/checkpoint-service.js +69 -24
- package/dist/apps/control-plane/application/services/checkpoint-service.js.map +1 -1
- package/dist/apps/control-plane/application/services/collision-override-service.d.ts +139 -0
- package/dist/apps/control-plane/application/services/collision-override-service.js +568 -0
- package/dist/apps/control-plane/application/services/collision-override-service.js.map +1 -0
- package/dist/apps/control-plane/application/services/collision-queue-service.d.ts +15 -0
- package/dist/apps/control-plane/application/services/collision-queue-service.js +92 -33
- package/dist/apps/control-plane/application/services/collision-queue-service.js.map +1 -1
- package/dist/apps/control-plane/application/services/cost-tracking-service.d.ts +11 -0
- package/dist/apps/control-plane/application/services/cost-tracking-service.js +75 -0
- package/dist/apps/control-plane/application/services/cost-tracking-service.js.map +1 -1
- package/dist/apps/control-plane/application/services/execution-control-service.d.ts +75 -0
- package/dist/apps/control-plane/application/services/execution-control-service.js +421 -0
- package/dist/apps/control-plane/application/services/execution-control-service.js.map +1 -0
- package/dist/apps/control-plane/application/services/feature-deletion-service.d.ts +1 -0
- package/dist/apps/control-plane/application/services/feature-deletion-service.js +23 -1
- package/dist/apps/control-plane/application/services/feature-deletion-service.js.map +1 -1
- package/dist/apps/control-plane/application/services/feature-lifecycle-service.d.ts +24 -1
- package/dist/apps/control-plane/application/services/feature-lifecycle-service.js +132 -3
- package/dist/apps/control-plane/application/services/feature-lifecycle-service.js.map +1 -1
- package/dist/apps/control-plane/application/services/feature-send-message-service.js +16 -8
- package/dist/apps/control-plane/application/services/feature-send-message-service.js.map +1 -1
- package/dist/apps/control-plane/application/services/feature-state-service.d.ts +36 -0
- package/dist/apps/control-plane/application/services/feature-state-service.js +163 -6
- package/dist/apps/control-plane/application/services/feature-state-service.js.map +1 -1
- package/dist/apps/control-plane/application/services/gate-service.d.ts +2 -1
- package/dist/apps/control-plane/application/services/gate-service.js +95 -5
- package/dist/apps/control-plane/application/services/gate-service.js.map +1 -1
- package/dist/apps/control-plane/application/services/git-reconciliation-service.d.ts +92 -0
- package/dist/apps/control-plane/application/services/git-reconciliation-service.js +1097 -0
- package/dist/apps/control-plane/application/services/git-reconciliation-service.js.map +1 -0
- package/dist/apps/control-plane/application/services/intake-service.d.ts +63 -0
- package/dist/apps/control-plane/application/services/intake-service.js +1050 -0
- package/dist/apps/control-plane/application/services/intake-service.js.map +1 -0
- package/dist/apps/control-plane/application/services/merge-service.d.ts +5 -1
- package/dist/apps/control-plane/application/services/merge-service.js +233 -18
- package/dist/apps/control-plane/application/services/merge-service.js.map +1 -1
- package/dist/apps/control-plane/application/services/notifier-service.d.ts +1 -1
- package/dist/apps/control-plane/application/services/notifier-service.js +1 -0
- package/dist/apps/control-plane/application/services/notifier-service.js.map +1 -1
- package/dist/apps/control-plane/application/services/performance-analytics-service.d.ts +11 -0
- package/dist/apps/control-plane/application/services/performance-analytics-service.js +59 -0
- package/dist/apps/control-plane/application/services/performance-analytics-service.js.map +1 -1
- package/dist/apps/control-plane/application/services/plan-service.d.ts +5 -0
- package/dist/apps/control-plane/application/services/plan-service.js +254 -15
- package/dist/apps/control-plane/application/services/plan-service.js.map +1 -1
- package/dist/apps/control-plane/application/services/question-service.d.ts +72 -0
- package/dist/apps/control-plane/application/services/question-service.js +507 -0
- package/dist/apps/control-plane/application/services/question-service.js.map +1 -0
- package/dist/apps/control-plane/application/services/reactions-service.d.ts +2 -0
- package/dist/apps/control-plane/application/services/reactions-service.js +60 -17
- package/dist/apps/control-plane/application/services/reactions-service.js.map +1 -1
- package/dist/apps/control-plane/application/services/replay-timeline-service.d.ts +39 -0
- package/dist/apps/control-plane/application/services/replay-timeline-service.js +205 -0
- package/dist/apps/control-plane/application/services/replay-timeline-service.js.map +1 -0
- package/dist/apps/control-plane/application/services/reporting-service.d.ts +59 -0
- package/dist/apps/control-plane/application/services/reporting-service.js +121 -9
- package/dist/apps/control-plane/application/services/reporting-service.js.map +1 -1
- package/dist/apps/control-plane/application/services/run-lease-service.d.ts +20 -0
- package/dist/apps/control-plane/application/services/run-lease-service.js +81 -4
- package/dist/apps/control-plane/application/services/run-lease-service.js.map +1 -1
- package/dist/apps/control-plane/application/services/worktree-watchdog-service.d.ts +10 -0
- package/dist/apps/control-plane/application/services/worktree-watchdog-service.js +65 -8
- package/dist/apps/control-plane/application/services/worktree-watchdog-service.js.map +1 -1
- package/dist/apps/control-plane/application/tools/tool-metadata.js +7 -0
- package/dist/apps/control-plane/application/tools/tool-metadata.js.map +1 -1
- package/dist/apps/control-plane/application/usage-types.d.ts +65 -0
- package/dist/apps/control-plane/application/usage-types.js +75 -0
- package/dist/apps/control-plane/application/usage-types.js.map +1 -0
- package/dist/apps/control-plane/cli/add-command-handler.d.ts +18 -0
- package/dist/apps/control-plane/cli/add-command-handler.js +110 -0
- package/dist/apps/control-plane/cli/add-command-handler.js.map +1 -0
- package/dist/apps/control-plane/cli/answer-command-handler.d.ts +8 -0
- package/dist/apps/control-plane/cli/answer-command-handler.js +96 -0
- package/dist/apps/control-plane/cli/answer-command-handler.js.map +1 -0
- package/dist/apps/control-plane/cli/attach-command-handler.js +8 -3
- package/dist/apps/control-plane/cli/attach-command-handler.js.map +1 -1
- package/dist/apps/control-plane/cli/cli-argument-parser.js +131 -11
- package/dist/apps/control-plane/cli/cli-argument-parser.js.map +1 -1
- package/dist/apps/control-plane/cli/collision-command-handler.d.ts +8 -0
- package/dist/apps/control-plane/cli/collision-command-handler.js +90 -0
- package/dist/apps/control-plane/cli/collision-command-handler.js.map +1 -0
- package/dist/apps/control-plane/cli/command-catalog.d.ts +21 -0
- package/dist/apps/control-plane/cli/command-catalog.js +416 -0
- package/dist/apps/control-plane/cli/command-catalog.js.map +1 -0
- package/dist/apps/control-plane/cli/complete-command-handler.d.ts +15 -0
- package/dist/apps/control-plane/cli/complete-command-handler.js +26 -0
- package/dist/apps/control-plane/cli/complete-command-handler.js.map +1 -0
- package/dist/apps/control-plane/cli/completion-command-handler.d.ts +8 -0
- package/dist/apps/control-plane/cli/completion-command-handler.js +20 -0
- package/dist/apps/control-plane/cli/completion-command-handler.js.map +1 -0
- package/dist/apps/control-plane/cli/completion-resolver.d.ts +1 -0
- package/dist/apps/control-plane/cli/completion-resolver.js +250 -0
- package/dist/apps/control-plane/cli/completion-resolver.js.map +1 -0
- package/dist/apps/control-plane/cli/completion-shell-renderer.d.ts +3 -0
- package/dist/apps/control-plane/cli/completion-shell-renderer.js +53 -0
- package/dist/apps/control-plane/cli/completion-shell-renderer.js.map +1 -0
- package/dist/apps/control-plane/cli/dashboard-command-handler.d.ts +1 -0
- package/dist/apps/control-plane/cli/dashboard-command-handler.js +83 -1
- package/dist/apps/control-plane/cli/dashboard-command-handler.js.map +1 -1
- package/dist/apps/control-plane/cli/dashboard-runtime-runner.d.ts +81 -0
- package/dist/apps/control-plane/cli/dashboard-runtime-runner.js +724 -0
- package/dist/apps/control-plane/cli/dashboard-runtime-runner.js.map +1 -0
- package/dist/apps/control-plane/cli/dashboard-runtime.d.ts +1 -0
- package/dist/apps/control-plane/cli/dashboard-runtime.js +26 -0
- package/dist/apps/control-plane/cli/dashboard-runtime.js.map +1 -0
- package/dist/apps/control-plane/cli/help-command-handler.js +13 -172
- package/dist/apps/control-plane/cli/help-command-handler.js.map +1 -1
- package/dist/apps/control-plane/cli/init-command-handler.js +51 -6
- package/dist/apps/control-plane/cli/init-command-handler.js.map +1 -1
- package/dist/apps/control-plane/cli/merge-command-handler.d.ts +8 -0
- package/dist/apps/control-plane/cli/merge-command-handler.js +139 -0
- package/dist/apps/control-plane/cli/merge-command-handler.js.map +1 -0
- package/dist/apps/control-plane/cli/questions-command-handler.d.ts +8 -0
- package/dist/apps/control-plane/cli/questions-command-handler.js +59 -0
- package/dist/apps/control-plane/cli/questions-command-handler.js.map +1 -0
- package/dist/apps/control-plane/cli/replay-command-handler.d.ts +15 -0
- package/dist/apps/control-plane/cli/replay-command-handler.js +55 -0
- package/dist/apps/control-plane/cli/replay-command-handler.js.map +1 -0
- package/dist/apps/control-plane/cli/resume-command-handler.d.ts +2 -0
- package/dist/apps/control-plane/cli/resume-command-handler.js +196 -19
- package/dist/apps/control-plane/cli/resume-command-handler.js.map +1 -1
- package/dist/apps/control-plane/cli/retry-command-handler.js +202 -16
- package/dist/apps/control-plane/cli/retry-command-handler.js.map +1 -1
- package/dist/apps/control-plane/cli/retry-resume-decision.d.ts +26 -0
- package/dist/apps/control-plane/cli/retry-resume-decision.js +61 -0
- package/dist/apps/control-plane/cli/retry-resume-decision.js.map +1 -0
- package/dist/apps/control-plane/cli/rollback-command-handler.js +3 -2
- package/dist/apps/control-plane/cli/rollback-command-handler.js.map +1 -1
- package/dist/apps/control-plane/cli/run-command-handler.js +26 -2
- package/dist/apps/control-plane/cli/run-command-handler.js.map +1 -1
- package/dist/apps/control-plane/cli/spec-ingestion-service.d.ts +2 -0
- package/dist/apps/control-plane/cli/spec-ingestion-service.js +37 -48
- package/dist/apps/control-plane/cli/spec-ingestion-service.js.map +1 -1
- package/dist/apps/control-plane/cli/spec-preparation.d.ts +14 -0
- package/dist/apps/control-plane/cli/spec-preparation.js +81 -0
- package/dist/apps/control-plane/cli/spec-preparation.js.map +1 -0
- package/dist/apps/control-plane/cli/spec-utils.d.ts +4 -0
- package/dist/apps/control-plane/cli/spec-utils.js +70 -11
- package/dist/apps/control-plane/cli/spec-utils.js.map +1 -1
- package/dist/apps/control-plane/cli/status-command-handler.js +69 -0
- package/dist/apps/control-plane/cli/status-command-handler.js.map +1 -1
- package/dist/apps/control-plane/cli/types.d.ts +41 -4
- package/dist/apps/control-plane/cli/types.js +9 -1
- package/dist/apps/control-plane/cli/types.js.map +1 -1
- package/dist/apps/control-plane/core/collisions.d.ts +37 -19
- package/dist/apps/control-plane/core/collisions.js +87 -12
- package/dist/apps/control-plane/core/collisions.js.map +1 -1
- package/dist/apps/control-plane/core/constants.d.ts +17 -1
- package/dist/apps/control-plane/core/constants.js +18 -1
- package/dist/apps/control-plane/core/constants.js.map +1 -1
- package/dist/apps/control-plane/core/error-codes.d.ts +39 -0
- package/dist/apps/control-plane/core/error-codes.js +39 -0
- package/dist/apps/control-plane/core/error-codes.js.map +1 -1
- package/dist/apps/control-plane/core/execution-control.d.ts +45 -0
- package/dist/apps/control-plane/core/execution-control.js +2 -0
- package/dist/apps/control-plane/core/execution-control.js.map +1 -0
- package/dist/apps/control-plane/core/feature-resume-phase.d.ts +3 -0
- package/dist/apps/control-plane/core/feature-resume-phase.js +88 -0
- package/dist/apps/control-plane/core/feature-resume-phase.js.map +1 -0
- package/dist/apps/control-plane/core/gate-freshness.d.ts +48 -0
- package/dist/apps/control-plane/core/gate-freshness.js +267 -0
- package/dist/apps/control-plane/core/gate-freshness.js.map +1 -0
- package/dist/apps/control-plane/core/gate-log-extractor.d.ts +22 -0
- package/dist/apps/control-plane/core/gate-log-extractor.js +66 -0
- package/dist/apps/control-plane/core/gate-log-extractor.js.map +1 -0
- package/dist/apps/control-plane/core/gates.d.ts +11 -2
- package/dist/apps/control-plane/core/gates.js +67 -3
- package/dist/apps/control-plane/core/gates.js.map +1 -1
- package/dist/apps/control-plane/core/intake-artifacts.d.ts +109 -0
- package/dist/apps/control-plane/core/intake-artifacts.js +143 -0
- package/dist/apps/control-plane/core/intake-artifacts.js.map +1 -0
- package/dist/apps/control-plane/core/kernel-types.d.ts +8 -0
- package/dist/apps/control-plane/core/kernel.d.ts +256 -8
- package/dist/apps/control-plane/core/kernel.js +400 -14
- package/dist/apps/control-plane/core/kernel.js.map +1 -1
- package/dist/apps/control-plane/core/mainline-conflict.d.ts +7 -0
- package/dist/apps/control-plane/core/mainline-conflict.js +20 -0
- package/dist/apps/control-plane/core/mainline-conflict.js.map +1 -0
- package/dist/apps/control-plane/core/merge-repair.d.ts +35 -0
- package/dist/apps/control-plane/core/merge-repair.js +99 -0
- package/dist/apps/control-plane/core/merge-repair.js.map +1 -0
- package/dist/apps/control-plane/core/path-layout.d.ts +10 -0
- package/dist/apps/control-plane/core/path-layout.js +32 -2
- package/dist/apps/control-plane/core/path-layout.js.map +1 -1
- package/dist/apps/control-plane/core/path-rules.js +9 -3
- package/dist/apps/control-plane/core/path-rules.js.map +1 -1
- package/dist/apps/control-plane/core/plan-submit-recovery.d.ts +22 -0
- package/dist/apps/control-plane/core/plan-submit-recovery.js +78 -0
- package/dist/apps/control-plane/core/plan-submit-recovery.js.map +1 -0
- package/dist/apps/control-plane/core/questions.d.ts +40 -0
- package/dist/apps/control-plane/core/questions.js +2 -0
- package/dist/apps/control-plane/core/questions.js.map +1 -0
- package/dist/apps/control-plane/core/runtime-sessions.d.ts +4 -0
- package/dist/apps/control-plane/core/schemas.d.ts +2 -0
- package/dist/apps/control-plane/core/schemas.js +31 -1
- package/dist/apps/control-plane/core/schemas.js.map +1 -1
- package/dist/apps/control-plane/core/tool-caller.d.ts +18 -1
- package/dist/apps/control-plane/core/utils/index-normalizer.js +17 -4
- package/dist/apps/control-plane/core/utils/index-normalizer.js.map +1 -1
- package/dist/apps/control-plane/core/worktree-diff.d.ts +4 -0
- package/dist/apps/control-plane/core/worktree-diff.js +52 -0
- package/dist/apps/control-plane/core/worktree-diff.js.map +1 -0
- package/dist/apps/control-plane/index.d.ts +10 -2
- package/dist/apps/control-plane/index.js +9 -2
- package/dist/apps/control-plane/index.js.map +1 -1
- package/dist/apps/control-plane/interfaces/cli/bootstrap.js +236 -6
- package/dist/apps/control-plane/interfaces/cli/bootstrap.js.map +1 -1
- package/dist/apps/control-plane/mcp/kernel-tool-executor.js +16 -0
- package/dist/apps/control-plane/mcp/kernel-tool-executor.js.map +1 -1
- package/dist/apps/control-plane/mcp/tool-runtime.d.ts +5 -0
- package/dist/apps/control-plane/mcp/tool-runtime.js +40 -5
- package/dist/apps/control-plane/mcp/tool-runtime.js.map +1 -1
- package/dist/apps/control-plane/providers/api-worker-provider.d.ts +2 -2
- package/dist/apps/control-plane/providers/api-worker-provider.js +40 -9
- package/dist/apps/control-plane/providers/api-worker-provider.js.map +1 -1
- package/dist/apps/control-plane/providers/cli-worker-provider.d.ts +59 -3
- package/dist/apps/control-plane/providers/cli-worker-provider.js +758 -46
- package/dist/apps/control-plane/providers/cli-worker-provider.js.map +1 -1
- package/dist/apps/control-plane/providers/output-parsers/generic-output-parser.js +91 -1
- package/dist/apps/control-plane/providers/output-parsers/generic-output-parser.js.map +1 -1
- package/dist/apps/control-plane/providers/output-parsers/types.d.ts +2 -0
- package/dist/apps/control-plane/providers/provider-defaults.d.ts +12 -0
- package/dist/apps/control-plane/providers/provider-defaults.js +103 -7
- package/dist/apps/control-plane/providers/provider-defaults.js.map +1 -1
- package/dist/apps/control-plane/providers/providers.d.ts +50 -4
- package/dist/apps/control-plane/providers/providers.js +145 -14
- package/dist/apps/control-plane/providers/providers.js.map +1 -1
- package/dist/apps/control-plane/providers/worker-provider-factory.d.ts +2 -0
- package/dist/apps/control-plane/providers/worker-provider-factory.js +8 -1
- package/dist/apps/control-plane/providers/worker-provider-factory.js.map +1 -1
- package/dist/apps/control-plane/supervisor/artifact-stager.d.ts +5 -0
- package/dist/apps/control-plane/supervisor/artifact-stager.js +45 -0
- package/dist/apps/control-plane/supervisor/artifact-stager.js.map +1 -0
- package/dist/apps/control-plane/supervisor/build-wave-executor.d.ts +24 -1
- package/dist/apps/control-plane/supervisor/build-wave-executor.js +362 -150
- package/dist/apps/control-plane/supervisor/build-wave-executor.js.map +1 -1
- package/dist/apps/control-plane/supervisor/execution-enrollment-service.d.ts +41 -0
- package/dist/apps/control-plane/supervisor/execution-enrollment-service.js +311 -0
- package/dist/apps/control-plane/supervisor/execution-enrollment-service.js.map +1 -0
- package/dist/apps/control-plane/supervisor/organizer-enrollment-scheduler.d.ts +15 -0
- package/dist/apps/control-plane/supervisor/organizer-enrollment-scheduler.js +93 -0
- package/dist/apps/control-plane/supervisor/organizer-enrollment-scheduler.js.map +1 -0
- package/dist/apps/control-plane/supervisor/organizer-sidecar-service.d.ts +44 -0
- package/dist/apps/control-plane/supervisor/organizer-sidecar-service.js +311 -0
- package/dist/apps/control-plane/supervisor/organizer-sidecar-service.js.map +1 -0
- package/dist/apps/control-plane/supervisor/plan-conformance-scorer.js +2 -5
- package/dist/apps/control-plane/supervisor/plan-conformance-scorer.js.map +1 -1
- package/dist/apps/control-plane/supervisor/planner-phase.d.ts +3 -0
- package/dist/apps/control-plane/supervisor/planner-phase.js +70 -0
- package/dist/apps/control-plane/supervisor/planner-phase.js.map +1 -0
- package/dist/apps/control-plane/supervisor/planning-wave-executor.d.ts +42 -0
- package/dist/apps/control-plane/supervisor/planning-wave-executor.js +753 -55
- package/dist/apps/control-plane/supervisor/planning-wave-executor.js.map +1 -1
- package/dist/apps/control-plane/supervisor/prompt-bundle-loader.js +19 -1
- package/dist/apps/control-plane/supervisor/prompt-bundle-loader.js.map +1 -1
- package/dist/apps/control-plane/supervisor/qa-wave-executor.d.ts +21 -0
- package/dist/apps/control-plane/supervisor/qa-wave-executor.js +287 -156
- package/dist/apps/control-plane/supervisor/qa-wave-executor.js.map +1 -1
- package/dist/apps/control-plane/supervisor/run-coordinator.d.ts +33 -1
- package/dist/apps/control-plane/supervisor/run-coordinator.js +631 -39
- package/dist/apps/control-plane/supervisor/run-coordinator.js.map +1 -1
- package/dist/apps/control-plane/supervisor/runtime.d.ts +84 -0
- package/dist/apps/control-plane/supervisor/runtime.js +393 -3
- package/dist/apps/control-plane/supervisor/runtime.js.map +1 -1
- package/dist/apps/control-plane/supervisor/session-orchestrator.d.ts +54 -0
- package/dist/apps/control-plane/supervisor/session-orchestrator.js +176 -1
- package/dist/apps/control-plane/supervisor/session-orchestrator.js.map +1 -1
- package/dist/apps/control-plane/supervisor/types.d.ts +142 -1
- package/dist/apps/control-plane/supervisor/types.js.map +1 -1
- package/dist/apps/control-plane/supervisor/worker-decision-loop.d.ts +68 -2
- package/dist/apps/control-plane/supervisor/worker-decision-loop.js +723 -89
- package/dist/apps/control-plane/supervisor/worker-decision-loop.js.map +1 -1
- package/docs/core/ARCHITECTURE.md +227 -0
- package/docs/core/DECISIONS.md +94 -0
- package/docs/core/DOMAIN-LOGIC.md +60 -0
- package/docs/core/PATTERNS.md +201 -0
- package/docs/core/TROUBLESHOOTING.md +347 -0
- package/docs/core/intentgraph-dependencies.json +39860 -0
- package/docs/core/intentgraph.index.json +46580 -0
- package/docs/plans/2026-03-10-gate-failure-targeted-repair-design.md +224 -0
- package/docs/plans/2026-03-10-gate-failure-targeted-repair.md +1032 -0
- package/docs/superpowers/plans/2026-03-16-provider-cli-config.md +743 -0
- package/docs/superpowers/plans/2026-03-23-reconcile-divergence-fix.md +777 -0
- package/docs/superpowers/plans/2026-03-28-ordering-agent-implementation.md +1754 -0
- package/docs/superpowers/plans/2026-03-29-drop-zone-and-provider-optimization.md +1108 -0
- package/docs/superpowers/plans/2026-03-29-merge-target-feature-branch.md +685 -0
- package/docs/superpowers/plans/2026-03-29-organizer-sidecar-runtime-loop.md +1289 -0
- package/docs/superpowers/specs/2026-03-23-reconcile-divergence-fix-design.md +118 -0
- package/docs/superpowers/specs/2026-03-28-ordering-agent-spec-audit-design.md +50 -0
- package/docs/superpowers/specs/2026-03-29-drop-zone-and-provider-optimization-design.md +254 -0
- package/docs/superpowers/specs/2026-03-29-merge-target-feature-branch-design.md +152 -0
- package/docs/superpowers/specs/2026-03-29-organizer-sidecar-runtime-loop-design.md +225 -0
- package/package.json +3 -2
- package/packages/web-dashboard/package.json +2 -1
- package/packages/web-dashboard/src/app/analytics/page.tsx +36 -2
- package/packages/web-dashboard/src/app/api/actions/route.ts +274 -63
- package/packages/web-dashboard/src/app/api/actions/status/route.ts +35 -0
- package/packages/web-dashboard/src/app/api/analytics/provider/route.ts +18 -0
- package/packages/web-dashboard/src/app/api/collisions/approve/route.ts +58 -0
- package/packages/web-dashboard/src/app/api/features/[id]/checkpoint-diff/route.ts +36 -0
- package/packages/web-dashboard/src/app/api/features/[id]/checkpoints/route.ts +29 -0
- package/packages/web-dashboard/src/app/api/features/[id]/conflicts/abort/route.ts +29 -0
- package/packages/web-dashboard/src/app/api/features/[id]/conflicts/files/route.ts +30 -0
- package/packages/web-dashboard/src/app/api/features/[id]/conflicts/resolve/route.ts +51 -0
- package/packages/web-dashboard/src/app/api/features/[id]/conflicts/route.ts +75 -0
- package/packages/web-dashboard/src/app/api/features/[id]/diff/route.ts +16 -2
- package/packages/web-dashboard/src/app/api/features/[id]/files/route.ts +26 -0
- package/packages/web-dashboard/src/app/api/features/[id]/gate-history/route.ts +27 -0
- package/packages/web-dashboard/src/app/api/features/[id]/genealogy/route.ts +26 -0
- package/packages/web-dashboard/src/app/api/features/[id]/history/run/[runId]/route.ts +20 -0
- package/packages/web-dashboard/src/app/api/features/[id]/history/runs/route.ts +34 -0
- package/packages/web-dashboard/src/app/api/features/[id]/intake-workspace/route.ts +20 -0
- package/packages/web-dashboard/src/app/api/features/[id]/live-output/route.ts +74 -0
- package/packages/web-dashboard/src/app/api/features/[id]/plan/amend/route.ts +21 -0
- package/packages/web-dashboard/src/app/api/features/[id]/plan-progress/route.ts +20 -0
- package/packages/web-dashboard/src/app/api/features/[id]/planner-artifacts/[artifact]/route.ts +78 -0
- package/packages/web-dashboard/src/app/api/features/[id]/planner-lifecycle/route.ts +20 -0
- package/packages/web-dashboard/src/app/api/features/[id]/planning-workspace/route.ts +20 -0
- package/packages/web-dashboard/src/app/api/features/[id]/questions/[questionId]/answer/route.ts +27 -0
- package/packages/web-dashboard/src/app/api/features/[id]/questions/route.ts +18 -0
- package/packages/web-dashboard/src/app/api/features/[id]/review/route.ts +14 -7
- package/packages/web-dashboard/src/app/api/features/[id]/route.ts +57 -2
- package/packages/web-dashboard/src/app/api/features/[id]/spec/route.ts +30 -0
- package/packages/web-dashboard/src/app/api/features/[id]/triage/route.ts +83 -0
- package/packages/web-dashboard/src/app/api/features/[id]/worker-events/route.ts +40 -0
- package/packages/web-dashboard/src/app/api/launch/preview/route.ts +86 -0
- package/packages/web-dashboard/src/app/api/launch/submit/route.ts +180 -0
- package/packages/web-dashboard/src/app/api/mainline/status/route.ts +74 -0
- package/packages/web-dashboard/src/app/api/merge-queue/route.ts +13 -0
- package/packages/web-dashboard/src/app/api/policy/budget/route.ts +14 -0
- package/packages/web-dashboard/src/app/api/projects/route.ts +11 -7
- package/packages/web-dashboard/src/app/api/reconciler/queue/route.ts +47 -0
- package/packages/web-dashboard/src/app/api/run/route.ts +26 -2
- package/packages/web-dashboard/src/app/api/runtime/events/route.ts +227 -0
- package/packages/web-dashboard/src/app/api/runtime/operations/route.ts +269 -0
- package/packages/web-dashboard/src/app/api/runtime/questions/route.ts +11 -0
- package/packages/web-dashboard/src/app/api/runtime/runs/route.ts +80 -0
- package/packages/web-dashboard/src/app/api/status/route.ts +4 -2
- package/packages/web-dashboard/src/app/feature/[id]/page.tsx +32 -42
- package/packages/web-dashboard/src/app/globals.css +34 -3
- package/packages/web-dashboard/src/app/launch/page.tsx +357 -0
- package/packages/web-dashboard/src/app/layout.tsx +23 -1
- package/packages/web-dashboard/src/app/page.tsx +263 -272
- package/packages/web-dashboard/src/components/dashboard/attention-strip.tsx +52 -0
- package/packages/web-dashboard/src/components/dashboard/collision-approval-drawer.tsx +185 -0
- package/packages/web-dashboard/src/components/dashboard/command-center-header.tsx +102 -0
- package/packages/web-dashboard/src/components/dashboard/mainline-status-banner.tsx +84 -0
- package/packages/web-dashboard/src/components/dashboard/merged-archive.tsx +36 -0
- package/packages/web-dashboard/src/components/dashboard/prioritized-queues.tsx +98 -0
- package/packages/web-dashboard/src/components/dashboard/reconciler-queue-card.tsx +115 -0
- package/packages/web-dashboard/src/components/dashboard/secondary-diagnostics-rail.tsx +48 -0
- package/packages/web-dashboard/src/components/dashboard/task-filter-bar.tsx +74 -0
- package/packages/web-dashboard/src/components/dashboard/triage-drawer.tsx +455 -0
- package/packages/web-dashboard/src/components/diff-viewer.tsx +19 -3
- package/packages/web-dashboard/src/components/evidence-viewer.tsx +65 -51
- package/packages/web-dashboard/src/components/feature-card.tsx +90 -7
- package/packages/web-dashboard/src/components/feature-cost-panel.tsx +112 -11
- package/packages/web-dashboard/src/components/feature-list-view.tsx +25 -4
- package/packages/web-dashboard/src/components/features/runtime-inspector/EventsTimelineView.tsx +260 -0
- package/packages/web-dashboard/src/components/features/runtime-inspector/OperationsListView.tsx +172 -0
- package/packages/web-dashboard/src/components/features/runtime-inspector/RuntimeInspectorPanel.tsx +896 -0
- package/packages/web-dashboard/src/components/filter-bar.tsx +7 -39
- package/packages/web-dashboard/src/components/focus/ActionableRiskList.tsx +46 -0
- package/packages/web-dashboard/src/components/focus/AgentRolePerformanceCard.tsx +200 -0
- package/packages/web-dashboard/src/components/focus/BlockedGuidanceBanner.tsx +149 -0
- package/packages/web-dashboard/src/components/focus/CheckpointInspector.tsx +123 -0
- package/packages/web-dashboard/src/components/focus/CheckpointRail.tsx +118 -0
- package/packages/web-dashboard/src/components/focus/CheckpointScrubber.tsx +249 -0
- package/packages/web-dashboard/src/components/focus/CollisionApprovalBanner.tsx +192 -0
- package/packages/web-dashboard/src/components/focus/CollisionRadar.tsx +136 -0
- package/packages/web-dashboard/src/components/focus/ConflictStatusCard.tsx +52 -0
- package/packages/web-dashboard/src/components/focus/ContextSidebar.tsx +108 -0
- package/packages/web-dashboard/src/components/focus/DiagnosisPanel.tsx +68 -0
- package/packages/web-dashboard/src/components/focus/FeatureDecisionBanner.tsx +68 -0
- package/packages/web-dashboard/src/components/focus/FeatureQuestionAnswerPanel.tsx +167 -0
- package/packages/web-dashboard/src/components/focus/FocusHeader.tsx +54 -0
- package/packages/web-dashboard/src/components/focus/FocusLayout.tsx +283 -0
- package/packages/web-dashboard/src/components/focus/GateFlakinessSummary.tsx +144 -0
- package/packages/web-dashboard/src/components/focus/GenealogyTree.tsx +34 -0
- package/packages/web-dashboard/src/components/focus/HeroBlock.tsx +67 -0
- package/packages/web-dashboard/src/components/focus/LiveAgentConsole.tsx +277 -0
- package/packages/web-dashboard/src/components/focus/MergeQueueCard.tsx +78 -0
- package/packages/web-dashboard/src/components/focus/OperationalSummaryCard.tsx +227 -0
- package/packages/web-dashboard/src/components/focus/PinnedActions.tsx +96 -0
- package/packages/web-dashboard/src/components/focus/PlanAmendmentPanel.tsx +250 -0
- package/packages/web-dashboard/src/components/focus/PlanProgressPanel.tsx +133 -0
- package/packages/web-dashboard/src/components/focus/PlannerArtifactViewer.tsx +158 -0
- package/packages/web-dashboard/src/components/focus/PlannerLifecycleHeader.tsx +141 -0
- package/packages/web-dashboard/src/components/focus/ProgressSnapshotCard.tsx +113 -0
- package/packages/web-dashboard/src/components/focus/RecentMaterialChanges.tsx +69 -0
- package/packages/web-dashboard/src/components/focus/RoleLogViewer.tsx +436 -0
- package/packages/web-dashboard/src/components/focus/RunHistoryBrowser.tsx +62 -0
- package/packages/web-dashboard/src/components/focus/SpecViewer.tsx +172 -0
- package/packages/web-dashboard/src/components/focus/TabBar.tsx +33 -0
- package/packages/web-dashboard/src/components/focus/UsageBurnChart.tsx +212 -0
- package/packages/web-dashboard/src/components/focus/VerificationSummaryCard.tsx +122 -0
- package/packages/web-dashboard/src/components/focus/tabs/ChangesTab.tsx +325 -0
- package/packages/web-dashboard/src/components/focus/tabs/ConflictsTab.tsx +395 -0
- package/packages/web-dashboard/src/components/focus/tabs/GatesQaTab.tsx +38 -0
- package/packages/web-dashboard/src/components/focus/tabs/HistoryTab.tsx +213 -0
- package/packages/web-dashboard/src/components/focus/tabs/IntakeTab.tsx +429 -0
- package/packages/web-dashboard/src/components/focus/tabs/OverviewTab.tsx +217 -0
- package/packages/web-dashboard/src/components/focus/tabs/PlanningTab.tsx +390 -0
- package/packages/web-dashboard/src/components/focus/tabs/ReviewTab.tsx +497 -0
- package/packages/web-dashboard/src/components/focus/tabs/RuntimeTab.tsx +213 -0
- package/packages/web-dashboard/src/components/focus/tabs/TranscriptTab.tsx +315 -0
- package/packages/web-dashboard/src/components/gate-results.tsx +2 -2
- package/packages/web-dashboard/src/components/human-input-panel.tsx +33 -57
- package/packages/web-dashboard/src/components/kanban-board.tsx +4 -0
- package/packages/web-dashboard/src/components/launch/launch-draft-card.tsx +131 -0
- package/packages/web-dashboard/src/components/plan-viewer.tsx +147 -69
- package/packages/web-dashboard/src/components/quick-launch-panel.tsx +20 -47
- package/packages/web-dashboard/src/components/summary-bar.tsx +30 -76
- package/packages/web-dashboard/src/lib/aop-client.ts +2484 -36
- package/packages/web-dashboard/src/lib/blocked-state-guidance.ts +475 -0
- package/packages/web-dashboard/src/lib/collision-radar.ts +136 -0
- package/packages/web-dashboard/src/lib/dashboard-action-states.ts +204 -0
- package/packages/web-dashboard/src/lib/dashboard-runtime-client.ts +439 -0
- package/packages/web-dashboard/src/lib/dashboard-utils.ts +179 -18
- package/packages/web-dashboard/src/lib/drop-zone-utils.ts +92 -0
- package/packages/web-dashboard/src/lib/focus-detail-derivations.ts +958 -0
- package/packages/web-dashboard/src/lib/focus-view.ts +300 -0
- package/packages/web-dashboard/src/lib/health-diagnosis.ts +356 -0
- package/packages/web-dashboard/src/lib/launch-contracts.ts +77 -0
- package/packages/web-dashboard/src/lib/launch-markdown.ts +107 -0
- package/packages/web-dashboard/src/lib/launch-page-preview.ts +89 -0
- package/packages/web-dashboard/src/lib/live-feed.ts +1 -1
- package/packages/web-dashboard/src/lib/multi-project-config.ts +33 -0
- package/packages/web-dashboard/src/lib/orchestrator-tools.ts +845 -59
- package/packages/web-dashboard/src/lib/planner-workspace.ts +1285 -0
- package/packages/web-dashboard/src/lib/review-contracts.ts +5 -3
- package/packages/web-dashboard/src/lib/runtime-files.ts +285 -0
- package/packages/web-dashboard/src/lib/tool-catalog.ts +51 -0
- package/packages/web-dashboard/src/lib/types.ts +731 -3
- package/packages/web-dashboard/src/lib/usage-burn.ts +175 -0
- package/packages/web-dashboard/src/lib/worktree-diff.ts +128 -0
- package/packages/web-dashboard/src/styles/dashboard.module.css +1742 -459
- package/packages/web-dashboard/test/api/actions/route.spec.ts +675 -0
- package/packages/web-dashboard/test/api/features/diff.route.spec.ts +57 -0
- package/packages/web-dashboard/test/api/features/feature.route.spec.ts +99 -0
- package/packages/web-dashboard/test/api/features/live-output.route.spec.ts +123 -0
- package/packages/web-dashboard/test/api/features/plan-amend.route.spec.ts +95 -0
- package/packages/web-dashboard/test/api/features/planner-workspaces.route.spec.ts +162 -0
- package/packages/web-dashboard/test/api/features/question-answer.route.spec.ts +99 -0
- package/packages/web-dashboard/test/api/features/triage.route.spec.ts +195 -0
- package/packages/web-dashboard/test/api/launch/preview.route.spec.ts +149 -0
- package/packages/web-dashboard/test/api/launch/submit.route.spec.ts +382 -0
- package/packages/web-dashboard/test/api/runtime/events/route.spec.ts +164 -0
- package/packages/web-dashboard/test/api/runtime/operations/route.spec.ts +156 -0
- package/packages/web-dashboard/test/api/runtime/runs/route.spec.ts +112 -0
- package/packages/web-dashboard/test/components/changes-tab.spec.tsx +76 -0
- package/packages/web-dashboard/test/components/command-center-root.spec.tsx +87 -0
- package/packages/web-dashboard/test/components/diagnosis-panel.spec.tsx +59 -0
- package/packages/web-dashboard/test/components/feature-card.spec.tsx +45 -0
- package/packages/web-dashboard/test/components/focus-layout.spec.tsx +299 -0
- package/packages/web-dashboard/test/components/gate-results.spec.tsx +39 -0
- package/packages/web-dashboard/test/components/gates-qa-tab.spec.tsx +118 -0
- package/packages/web-dashboard/test/components/human-input-panel.spec.tsx +54 -0
- package/packages/web-dashboard/test/components/intake-tab.spec.tsx +210 -0
- package/packages/web-dashboard/test/components/kanban-board.spec.tsx +35 -0
- package/packages/web-dashboard/test/components/launch-draft-card.spec.tsx +54 -0
- package/packages/web-dashboard/test/components/launch-page.spec.tsx +79 -0
- package/packages/web-dashboard/test/components/overview-tab.spec.tsx +236 -0
- package/packages/web-dashboard/test/components/planning-tab.spec.tsx +202 -0
- package/packages/web-dashboard/test/components/review-tab.spec.tsx +169 -0
- package/packages/web-dashboard/test/components/role-log-viewer.spec.ts +42 -0
- package/packages/web-dashboard/test/components/runtime-inspector.spec.tsx +22 -0
- package/packages/web-dashboard/test/components/runtime-tab.spec.tsx +133 -0
- package/packages/web-dashboard/test/components/transcript-tab.spec.tsx +46 -0
- package/packages/web-dashboard/test/components/triage-drawer.spec.tsx +159 -0
- package/packages/web-dashboard/test/lib/aop-client.spec.ts +235 -0
- package/packages/web-dashboard/test/lib/dashboard-runtime-client.spec.ts +144 -0
- package/packages/web-dashboard/test/lib/focus-detail-derivations.spec.ts +314 -0
- package/packages/web-dashboard/test/lib/focus-view.spec.ts +248 -0
- package/packages/web-dashboard/test/lib/health-diagnosis.spec.ts +277 -0
- package/packages/web-dashboard/test/lib/launch-markdown.spec.ts +36 -0
- package/packages/web-dashboard/test/lib/multi-project-config.spec.ts +54 -0
- package/packages/web-dashboard/test/lib/orchestrator-tools.spec.ts +352 -0
- package/packages/web-dashboard/test/lib/planner-workspace.spec.ts +289 -0
- package/packages/web-dashboard/test/lib/worktree-diff.spec.ts +119 -0
- package/packages/web-dashboard/vitest.config.ts +2 -0
- package/spec-files/completed/agentic_orchestrator_add_feature_to_active_execution_spec.md +557 -0
- package/spec-files/completed/agentic_orchestrator_dashboard_command_center_redesign_spec.md +1147 -0
- package/spec-files/completed/agentic_orchestrator_execution_mode_spec.md +18 -16
- package/spec-files/completed/agentic_orchestrator_feature_focus_view_track_a_spec.md +672 -0
- package/spec-files/completed/agentic_orchestrator_feature_focus_view_track_b_spec.md +794 -0
- package/spec-files/completed/agentic_orchestrator_feature_focus_view_track_c_decision_centric_remediation_spec.md +1037 -0
- package/spec-files/completed/agentic_orchestrator_feature_focus_view_ux_redesign_spec.md +1432 -0
- package/spec-files/completed/agentic_orchestrator_focus_plan_tab_intake_planning_workspace_spec.md +921 -0
- package/spec-files/completed/agentic_orchestrator_intentional_collision_override_spec.md +584 -0
- package/spec-files/completed/agentic_orchestrator_interactive_planning_intake_and_requirements_verification_spec.md +1185 -0
- package/spec-files/completed/agentic_orchestrator_reactive_execution_enrollment_spec.md +864 -0
- package/spec-files/{outstanding → completed}/agentic_orchestrator_runtime_inspection_spec.md +92 -19
- package/spec-files/completed/agentic_orchestrator_scope_aware_run_lease_spec.md +408 -0
- package/spec-files/completed/git-reconciliation-engine.md +827 -0
- package/spec-files/outstanding/agentic_orchestrator_dashboard_quick_launch_and_control_surface_spec.md +331 -0
- package/spec-files/outstanding/agentic_orchestrator_enterprise_governance_dashboard_spec.md +16 -6
- package/spec-files/outstanding/agentic_orchestrator_evidence_integrity_doctor_spec.md +60 -9
- package/spec-files/outstanding/agentic_orchestrator_focus_plan_tab_execution_contract_workspace_spec.md +616 -0
- package/spec-files/outstanding/agentic_orchestrator_headless_standby_dashboard_runtime_spec.md +310 -0
- package/spec-files/outstanding/agentic_orchestrator_human_input_interaction_protocol_spec.md +175 -72
- package/spec-files/outstanding/agentic_orchestrator_interactive_rename_cleanup_spec.md +197 -0
- package/spec-files/outstanding/agentic_orchestrator_interactive_resume_and_reconciliation_disposition_spec.md +412 -0
- package/spec-files/outstanding/agentic_orchestrator_knowledge_canary_spec.md +166 -137
- package/spec-files/outstanding/agentic_orchestrator_observability_replay_spec.md +3 -3
- package/spec-files/outstanding/agentic_orchestrator_phase_specific_agent_profiles_and_token_telemetry_spec.md +303 -0
- package/spec-files/outstanding/agentic_orchestrator_planning_review_quality_spec.md +18 -5
- package/spec-files/outstanding/agentic_orchestrator_policy_stratification_spec.md +225 -0
- package/spec-files/outstanding/agentic_orchestrator_quality_adoption_execution_spec.md +77 -50
- package/spec-files/outstanding/agentic_orchestrator_ready_to_merge_branch_handoff_spec.md +724 -0
- package/spec-files/outstanding/agentic_orchestrator_remove_deterministic_mode_spec.md +263 -0
- package/spec-files/outstanding/agentic_orchestrator_request_more_context_and_dashboard_human_input_spec.md +456 -0
- package/spec-files/outstanding/agentic_orchestrator_spec_coverage_and_reconciliation_enforcement_spec.md +1411 -0
- package/spec-files/outstanding/agentic_orchestrator_spec_ordering_agent_spec.md +370 -0
- package/spec-files/outstanding/shadow_workspace_implementation_spec.md +1 -1
- package/spec-files/progress.md +2045 -87
- package/specs/001-runtime-inspection/checklists/requirements.md +35 -0
- package/specs/001-runtime-inspection/design.md +338 -0
- package/specs/001-runtime-inspection/spec.md +95 -0
- package/specs/002-scope-aware-lease/checklists/requirements.md +35 -0
- package/specs/002-scope-aware-lease/contracts/lease-registry.schema.json +101 -0
- package/specs/002-scope-aware-lease/data-model.md +236 -0
- package/specs/002-scope-aware-lease/plan.md +766 -0
- package/specs/002-scope-aware-lease/quickstart.md +150 -0
- package/specs/002-scope-aware-lease/research.md +135 -0
- package/specs/002-scope-aware-lease/spec.md +128 -0
- package/specs/002-scope-aware-lease/tasks.md +767 -0
- package/tsconfig.json +1 -1
- package/vitest.config.ts +28 -0
- package/ARCHITECTURE_ADHERENCE_ANALYSIS.md +0 -871
- package/packages/web-dashboard/next-env.d.ts +0 -6
- package/packages/web-dashboard/src/components/detail-panel.tsx +0 -1124
- package/packages/web-dashboard/src/components/review-workspace.tsx +0 -1162
- /package/spec-files/{outstanding → completed}/agentic_orchestrator_artifact_database_publishing_spec.md +0 -0
- /package/spec-files/{outstanding → completed}/agentic_orchestrator_cli_shell_tab_completion_spec.md +0 -0
- /package/spec-files/{outstanding → completed}/agentic_orchestrator_dashboard_diff_and_agent_console_spec.md +0 -0
- /package/spec-files/{outstanding → completed}/agentic_orchestrator_performance_improvements_spec.md +0 -0
- /package/spec-files/{outstanding → completed}/agentic_orchestrator_persistent_worker_runtime_spec.md +0 -0
- /package/spec-files/{outstanding → completed}/agentic_orchestrator_provider_auth_bootstrap_spec.md +0 -0
- /package/spec-files/{outstanding → completed}/agentic_orchestrator_real_worker_provider_execution_spec.md +0 -0
|
@@ -0,0 +1,507 @@
|
|
|
1
|
+
import path from 'node:path';
|
|
2
|
+
import { atomicWriteJson, ensureDir, nowIso, readJson, stableHash } from '../../core/fs.js';
|
|
3
|
+
import { STATUS } from '../../core/constants.js';
|
|
4
|
+
import { ERROR_CODES } from '../../core/error-codes.js';
|
|
5
|
+
import { fail } from '../../core/response.js';
|
|
6
|
+
const DEFAULT_TIMEOUT_MS = 900_000;
|
|
7
|
+
const DEFAULT_HISTORY_LIMIT = 3;
|
|
8
|
+
const TERMINAL_STATUSES = new Set([
|
|
9
|
+
STATUS.MERGED,
|
|
10
|
+
STATUS.FAILED,
|
|
11
|
+
STATUS.PAUSED_BUDGET,
|
|
12
|
+
]);
|
|
13
|
+
const RESUMABLE_STATUSES = new Set([
|
|
14
|
+
STATUS.INTAKE,
|
|
15
|
+
STATUS.PLANNING,
|
|
16
|
+
STATUS.BUILDING,
|
|
17
|
+
STATUS.QA,
|
|
18
|
+
STATUS.BLOCKED,
|
|
19
|
+
STATUS.READY_TO_MERGE,
|
|
20
|
+
]);
|
|
21
|
+
const LEGAL_TRANSITIONS = new Map([
|
|
22
|
+
[STATUS.INTAKE, new Set([STATUS.INTAKE, STATUS.PLANNING, STATUS.BLOCKED, STATUS.AWAITING_INPUT])],
|
|
23
|
+
[
|
|
24
|
+
STATUS.PLANNING,
|
|
25
|
+
new Set([STATUS.BUILDING, STATUS.BLOCKED, STATUS.AWAITING_INPUT, STATUS.PLANNING]),
|
|
26
|
+
],
|
|
27
|
+
[STATUS.BUILDING, new Set([STATUS.QA, STATUS.BLOCKED, STATUS.AWAITING_INPUT, STATUS.BUILDING])],
|
|
28
|
+
[STATUS.QA, new Set([STATUS.READY_TO_MERGE, STATUS.BLOCKED, STATUS.AWAITING_INPUT, STATUS.QA])],
|
|
29
|
+
[
|
|
30
|
+
STATUS.READY_TO_MERGE,
|
|
31
|
+
new Set([STATUS.MERGED, STATUS.BLOCKED, STATUS.AWAITING_INPUT, STATUS.READY_TO_MERGE]),
|
|
32
|
+
],
|
|
33
|
+
[
|
|
34
|
+
STATUS.BLOCKED,
|
|
35
|
+
new Set([
|
|
36
|
+
STATUS.PLANNING,
|
|
37
|
+
STATUS.BUILDING,
|
|
38
|
+
STATUS.QA,
|
|
39
|
+
STATUS.READY_TO_MERGE,
|
|
40
|
+
STATUS.AWAITING_INPUT,
|
|
41
|
+
STATUS.BLOCKED,
|
|
42
|
+
]),
|
|
43
|
+
],
|
|
44
|
+
[
|
|
45
|
+
STATUS.AWAITING_INPUT,
|
|
46
|
+
new Set([
|
|
47
|
+
STATUS.INTAKE,
|
|
48
|
+
STATUS.PLANNING,
|
|
49
|
+
STATUS.BUILDING,
|
|
50
|
+
STATUS.QA,
|
|
51
|
+
STATUS.BLOCKED,
|
|
52
|
+
STATUS.READY_TO_MERGE,
|
|
53
|
+
STATUS.AWAITING_INPUT,
|
|
54
|
+
]),
|
|
55
|
+
],
|
|
56
|
+
[STATUS.MERGED, new Set([STATUS.MERGED])],
|
|
57
|
+
[STATUS.FAILED, new Set([STATUS.FAILED, STATUS.BLOCKED])],
|
|
58
|
+
]);
|
|
59
|
+
function asRecord(value) {
|
|
60
|
+
if (!value || typeof value !== 'object' || Array.isArray(value)) {
|
|
61
|
+
return null;
|
|
62
|
+
}
|
|
63
|
+
return value;
|
|
64
|
+
}
|
|
65
|
+
function asString(value) {
|
|
66
|
+
if (typeof value !== 'string') {
|
|
67
|
+
return null;
|
|
68
|
+
}
|
|
69
|
+
const trimmed = value.trim();
|
|
70
|
+
return trimmed.length > 0 ? trimmed : null;
|
|
71
|
+
}
|
|
72
|
+
function asQuestionType(value) {
|
|
73
|
+
if (value === 'clarification' ||
|
|
74
|
+
value === 'permission_override' ||
|
|
75
|
+
value === 'external_decision' ||
|
|
76
|
+
value === 'risk_ack') {
|
|
77
|
+
return value;
|
|
78
|
+
}
|
|
79
|
+
return 'clarification';
|
|
80
|
+
}
|
|
81
|
+
function asQuestionStatus(value) {
|
|
82
|
+
if (value === 'open' || value === 'answered' || value === 'expired' || value === 'withdrawn') {
|
|
83
|
+
return value;
|
|
84
|
+
}
|
|
85
|
+
return null;
|
|
86
|
+
}
|
|
87
|
+
function readStateVersion(frontMatter) {
|
|
88
|
+
const version = frontMatter.version;
|
|
89
|
+
return typeof version === 'number' && Number.isFinite(version) ? Math.floor(version) : 0;
|
|
90
|
+
}
|
|
91
|
+
function readStatus(frontMatter) {
|
|
92
|
+
return typeof frontMatter.status === 'string' ? frontMatter.status : STATUS.INTAKE;
|
|
93
|
+
}
|
|
94
|
+
function isTerminalStatus(status) {
|
|
95
|
+
return TERMINAL_STATUSES.has(status);
|
|
96
|
+
}
|
|
97
|
+
function isResumableStatus(status) {
|
|
98
|
+
return RESUMABLE_STATUSES.has(status);
|
|
99
|
+
}
|
|
100
|
+
function normalizeExpectedAnswer(value) {
|
|
101
|
+
const record = asRecord(value);
|
|
102
|
+
if (!record) {
|
|
103
|
+
return null;
|
|
104
|
+
}
|
|
105
|
+
const kind = asString(record.kind);
|
|
106
|
+
if (!kind) {
|
|
107
|
+
return null;
|
|
108
|
+
}
|
|
109
|
+
const normalized = { kind };
|
|
110
|
+
if (Array.isArray(record.choices)) {
|
|
111
|
+
normalized.choices = record.choices
|
|
112
|
+
.map((item) => asString(item))
|
|
113
|
+
.filter((item) => item !== null);
|
|
114
|
+
}
|
|
115
|
+
const schema = asRecord(record.schema);
|
|
116
|
+
if (schema) {
|
|
117
|
+
normalized.schema = schema;
|
|
118
|
+
}
|
|
119
|
+
return normalized;
|
|
120
|
+
}
|
|
121
|
+
function normalizeAnswer(value) {
|
|
122
|
+
const stringValue = asString(value);
|
|
123
|
+
if (stringValue) {
|
|
124
|
+
return stringValue;
|
|
125
|
+
}
|
|
126
|
+
const record = asRecord(value);
|
|
127
|
+
return record ? record : null;
|
|
128
|
+
}
|
|
129
|
+
function isTransitionLegal(from, to) {
|
|
130
|
+
return LEGAL_TRANSITIONS.get(from)?.has(to) ?? false;
|
|
131
|
+
}
|
|
132
|
+
function normalizeHumanInputState(value) {
|
|
133
|
+
const record = asRecord(value);
|
|
134
|
+
return {
|
|
135
|
+
open_question_id: asString(record?.open_question_id) ?? null,
|
|
136
|
+
open_question_count: typeof record?.open_question_count === 'number' && Number.isFinite(record.open_question_count)
|
|
137
|
+
? Math.max(0, Math.floor(record.open_question_count))
|
|
138
|
+
: 0,
|
|
139
|
+
awaiting_since: typeof record?.awaiting_since === 'string' ? record.awaiting_since : null,
|
|
140
|
+
requested_by_role: asString(record?.requested_by_role) ?? null,
|
|
141
|
+
prompt_summary: asString(record?.prompt_summary) ?? null,
|
|
142
|
+
resume_status: asString(record?.resume_status) ?? null,
|
|
143
|
+
};
|
|
144
|
+
}
|
|
145
|
+
function toPromptSummary(prompt) {
|
|
146
|
+
const normalized = prompt.replace(/\s+/g, ' ').trim();
|
|
147
|
+
return normalized.length > 120 ? `${normalized.slice(0, 117)}...` : normalized;
|
|
148
|
+
}
|
|
149
|
+
function normalizeQuestionRecord(value) {
|
|
150
|
+
const record = asRecord(value);
|
|
151
|
+
if (!record) {
|
|
152
|
+
return null;
|
|
153
|
+
}
|
|
154
|
+
const questionId = asString(record.question_id);
|
|
155
|
+
const status = asQuestionStatus(record.status);
|
|
156
|
+
const prompt = asString(record.prompt);
|
|
157
|
+
const role = asString(record.role);
|
|
158
|
+
const createdAt = asString(record.created_at);
|
|
159
|
+
if (!questionId || !status || !prompt || !role || !createdAt) {
|
|
160
|
+
return null;
|
|
161
|
+
}
|
|
162
|
+
return {
|
|
163
|
+
question_id: questionId,
|
|
164
|
+
status,
|
|
165
|
+
blocking: record.blocking !== false,
|
|
166
|
+
question_type: asQuestionType(record.question_type),
|
|
167
|
+
role,
|
|
168
|
+
phase: asString(record.phase) ?? readStatus(record),
|
|
169
|
+
request_action: asString(record.request_action) ?? 'ask_user_input',
|
|
170
|
+
session_id: asString(record.session_id) ?? 'unknown',
|
|
171
|
+
prompt,
|
|
172
|
+
details: asRecord(record.details) ?? {},
|
|
173
|
+
expected_answer: normalizeExpectedAnswer(record.expected_answer),
|
|
174
|
+
created_at: createdAt,
|
|
175
|
+
expires_at: typeof record.expires_at === 'string' ? record.expires_at : null,
|
|
176
|
+
answer: normalizeAnswer(record.answer),
|
|
177
|
+
answered_at: typeof record.answered_at === 'string' ? record.answered_at : null,
|
|
178
|
+
answered_by: asString(record.answered_by) ?? null,
|
|
179
|
+
resume_status: asString(record.resume_status) ?? null,
|
|
180
|
+
resume_phase: asString(record.resume_phase) ?? null,
|
|
181
|
+
};
|
|
182
|
+
}
|
|
183
|
+
function sortQuestions(items) {
|
|
184
|
+
return [...items].sort((left, right) => {
|
|
185
|
+
if (left.created_at === right.created_at) {
|
|
186
|
+
return left.question_id.localeCompare(right.question_id);
|
|
187
|
+
}
|
|
188
|
+
return left.created_at.localeCompare(right.created_at);
|
|
189
|
+
});
|
|
190
|
+
}
|
|
191
|
+
function validateAnswer(record, answer) {
|
|
192
|
+
const expected = record.expected_answer;
|
|
193
|
+
if (!expected) {
|
|
194
|
+
return true;
|
|
195
|
+
}
|
|
196
|
+
if (expected.kind === 'single_choice') {
|
|
197
|
+
if (typeof answer !== 'string') {
|
|
198
|
+
return false;
|
|
199
|
+
}
|
|
200
|
+
const choices = Array.isArray(expected.choices) ? expected.choices : [];
|
|
201
|
+
return choices.length === 0 || choices.includes(answer);
|
|
202
|
+
}
|
|
203
|
+
if (expected.kind === 'free_text' || expected.kind === 'text') {
|
|
204
|
+
return typeof answer === 'string' && answer.trim().length > 0;
|
|
205
|
+
}
|
|
206
|
+
if (expected.kind === 'json') {
|
|
207
|
+
return typeof answer === 'object';
|
|
208
|
+
}
|
|
209
|
+
return true;
|
|
210
|
+
}
|
|
211
|
+
export class QuestionService {
|
|
212
|
+
port;
|
|
213
|
+
constructor(port) {
|
|
214
|
+
this.port = port;
|
|
215
|
+
}
|
|
216
|
+
humanInputPolicy() {
|
|
217
|
+
const execution = asRecord(this.port.getPolicySnapshot().execution);
|
|
218
|
+
const humanInput = asRecord(execution?.human_input);
|
|
219
|
+
return {
|
|
220
|
+
enabled: humanInput?.enabled !== false,
|
|
221
|
+
timeoutMs: typeof humanInput?.timeout_ms === 'number' && Number.isFinite(humanInput.timeout_ms)
|
|
222
|
+
? Math.max(1, Math.floor(humanInput.timeout_ms))
|
|
223
|
+
: DEFAULT_TIMEOUT_MS,
|
|
224
|
+
maxOpenQuestionsPerFeature: typeof humanInput?.max_open_questions_per_feature === 'number' &&
|
|
225
|
+
Number.isFinite(humanInput.max_open_questions_per_feature)
|
|
226
|
+
? Math.max(1, Math.floor(humanInput.max_open_questions_per_feature))
|
|
227
|
+
: 1,
|
|
228
|
+
contextAnswerHistoryLimit: typeof humanInput?.context_answer_history_limit === 'number' &&
|
|
229
|
+
Number.isFinite(humanInput.context_answer_history_limit)
|
|
230
|
+
? Math.max(1, Math.floor(humanInput.context_answer_history_limit))
|
|
231
|
+
: DEFAULT_HISTORY_LIMIT,
|
|
232
|
+
};
|
|
233
|
+
}
|
|
234
|
+
async readQuestions(featureId) {
|
|
235
|
+
const existing = await readJson(this.port.questionsPath(featureId), null);
|
|
236
|
+
const items = Array.isArray(existing?.items)
|
|
237
|
+
? existing.items
|
|
238
|
+
.map((item) => normalizeQuestionRecord(item))
|
|
239
|
+
.filter((item) => item !== null)
|
|
240
|
+
: [];
|
|
241
|
+
return {
|
|
242
|
+
version: 1,
|
|
243
|
+
feature_id: featureId,
|
|
244
|
+
items: sortQuestions(items),
|
|
245
|
+
};
|
|
246
|
+
}
|
|
247
|
+
async writeQuestions(featureId, artifact) {
|
|
248
|
+
await ensureDir(path.dirname(this.port.questionsPath(featureId)));
|
|
249
|
+
await atomicWriteJson(this.port.questionsPath(featureId), {
|
|
250
|
+
version: 1,
|
|
251
|
+
feature_id: featureId,
|
|
252
|
+
items: sortQuestions(artifact.items),
|
|
253
|
+
});
|
|
254
|
+
}
|
|
255
|
+
buildQuestionId(featureId, role, prompt) {
|
|
256
|
+
return `q_${stableHash(`${featureId}:${role}:${prompt}:${nowIso()}`).slice(0, 16)}`;
|
|
257
|
+
}
|
|
258
|
+
normalizeStateForOpenQuestion(frontMatter, question, at) {
|
|
259
|
+
const currentStatus = readStatus(frontMatter);
|
|
260
|
+
if (!isTransitionLegal(currentStatus, STATUS.AWAITING_INPUT)) {
|
|
261
|
+
throw {
|
|
262
|
+
normalizedResponse: fail(ERROR_CODES.INVALID_STATUS_TRANSITION, `Cannot transition ${currentStatus} to ${STATUS.AWAITING_INPUT}`, {
|
|
263
|
+
from: currentStatus,
|
|
264
|
+
to: STATUS.AWAITING_INPUT,
|
|
265
|
+
retryable: false,
|
|
266
|
+
requires_human: true,
|
|
267
|
+
}),
|
|
268
|
+
};
|
|
269
|
+
}
|
|
270
|
+
return {
|
|
271
|
+
...frontMatter,
|
|
272
|
+
version: readStateVersion(frontMatter) + 1,
|
|
273
|
+
status: STATUS.AWAITING_INPUT,
|
|
274
|
+
status_reason: `${ERROR_CODES.QUESTION_AWAITING_INPUT}:${question.question_id}`,
|
|
275
|
+
phase_entered_at: at,
|
|
276
|
+
last_updated: at,
|
|
277
|
+
human_input: {
|
|
278
|
+
open_question_id: question.question_id,
|
|
279
|
+
open_question_count: 1,
|
|
280
|
+
awaiting_since: at,
|
|
281
|
+
requested_by_role: question.role,
|
|
282
|
+
prompt_summary: toPromptSummary(question.prompt),
|
|
283
|
+
resume_status: question.resume_status,
|
|
284
|
+
},
|
|
285
|
+
intake: question.resume_status === STATUS.INTAKE
|
|
286
|
+
? {
|
|
287
|
+
...(asRecord(frontMatter.intake) ?? {}),
|
|
288
|
+
status: 'awaiting_input',
|
|
289
|
+
}
|
|
290
|
+
: frontMatter.intake,
|
|
291
|
+
};
|
|
292
|
+
}
|
|
293
|
+
normalizeStateForAnsweredQuestion(frontMatter, question, at) {
|
|
294
|
+
const { activity_state: _activityState, activity_last_event_at: _activityLastEventAt, activity_detected_via: _activityDetectedVia, activity_detector: _activityDetector, ...normalizedFrontMatter } = frontMatter;
|
|
295
|
+
const currentStatus = readStatus(frontMatter);
|
|
296
|
+
const requestedResume = question.resume_status;
|
|
297
|
+
const resumeStatus = requestedResume && isResumableStatus(requestedResume) ? requestedResume : STATUS.PLANNING;
|
|
298
|
+
if (!isTransitionLegal(currentStatus, resumeStatus)) {
|
|
299
|
+
throw {
|
|
300
|
+
normalizedResponse: fail(ERROR_CODES.INVALID_STATUS_TRANSITION, `Cannot transition ${currentStatus} to ${resumeStatus}`, { from: currentStatus, to: resumeStatus, retryable: false, requires_human: true }),
|
|
301
|
+
};
|
|
302
|
+
}
|
|
303
|
+
return {
|
|
304
|
+
...normalizedFrontMatter,
|
|
305
|
+
version: readStateVersion(frontMatter) + 1,
|
|
306
|
+
status: resumeStatus,
|
|
307
|
+
status_reason: resumeStatus === question.resume_status
|
|
308
|
+
? `question_answered:${question.question_id}`
|
|
309
|
+
: `question_answered:${question.question_id}:resume_fallback_to_planning`,
|
|
310
|
+
phase_entered_at: at,
|
|
311
|
+
last_updated: at,
|
|
312
|
+
human_input: {
|
|
313
|
+
open_question_id: null,
|
|
314
|
+
open_question_count: 0,
|
|
315
|
+
awaiting_since: null,
|
|
316
|
+
requested_by_role: null,
|
|
317
|
+
prompt_summary: null,
|
|
318
|
+
resume_status: null,
|
|
319
|
+
},
|
|
320
|
+
intake: resumeStatus === STATUS.INTAKE
|
|
321
|
+
? {
|
|
322
|
+
...(asRecord(frontMatter.intake) ?? {}),
|
|
323
|
+
status: 'in_progress',
|
|
324
|
+
}
|
|
325
|
+
: frontMatter.intake,
|
|
326
|
+
};
|
|
327
|
+
}
|
|
328
|
+
async questionCreate(input) {
|
|
329
|
+
const policy = this.humanInputPolicy();
|
|
330
|
+
if (!policy.enabled) {
|
|
331
|
+
throw {
|
|
332
|
+
normalizedResponse: fail(ERROR_CODES.INVALID_ARGUMENT, 'human input is disabled by policy', {
|
|
333
|
+
retryable: false,
|
|
334
|
+
requires_human: true,
|
|
335
|
+
}),
|
|
336
|
+
};
|
|
337
|
+
}
|
|
338
|
+
return await this.port.withFeatureLock(input.feature_id, async () => {
|
|
339
|
+
const state = await this.port.readState(input.feature_id);
|
|
340
|
+
const currentStatus = readStatus(state.frontMatter);
|
|
341
|
+
if (isTerminalStatus(currentStatus)) {
|
|
342
|
+
throw {
|
|
343
|
+
normalizedResponse: fail(ERROR_CODES.QUESTION_ANSWER_NOT_ALLOWED_IN_TERMINAL_STATE, `Cannot open question for terminal feature state ${currentStatus}`, {
|
|
344
|
+
feature_id: input.feature_id,
|
|
345
|
+
status: currentStatus,
|
|
346
|
+
retryable: false,
|
|
347
|
+
requires_human: true,
|
|
348
|
+
}),
|
|
349
|
+
};
|
|
350
|
+
}
|
|
351
|
+
const artifact = await this.readQuestions(input.feature_id);
|
|
352
|
+
const openQuestions = artifact.items.filter((item) => item.status === 'open' && item.blocking);
|
|
353
|
+
if (openQuestions.length >= policy.maxOpenQuestionsPerFeature) {
|
|
354
|
+
throw {
|
|
355
|
+
normalizedResponse: fail(ERROR_CODES.QUESTION_CONFLICT_OPEN, `Feature ${input.feature_id} already has an open blocking question`, { feature_id: input.feature_id, retryable: false, requires_human: true }),
|
|
356
|
+
};
|
|
357
|
+
}
|
|
358
|
+
const at = nowIso();
|
|
359
|
+
const requestedResumeStatus = asString(input.resume_status);
|
|
360
|
+
const requestedResumePhase = asString(input.resume_phase);
|
|
361
|
+
const resumeStatus = requestedResumeStatus && isResumableStatus(requestedResumeStatus)
|
|
362
|
+
? requestedResumeStatus
|
|
363
|
+
: isResumableStatus(currentStatus)
|
|
364
|
+
? currentStatus
|
|
365
|
+
: STATUS.PLANNING;
|
|
366
|
+
const resumePhase = requestedResumePhase && isResumableStatus(requestedResumePhase)
|
|
367
|
+
? requestedResumePhase
|
|
368
|
+
: resumeStatus;
|
|
369
|
+
const question = {
|
|
370
|
+
question_id: this.buildQuestionId(input.feature_id, input.role, input.prompt),
|
|
371
|
+
status: 'open',
|
|
372
|
+
blocking: input.blocking !== false,
|
|
373
|
+
question_type: asQuestionType(input.question_type),
|
|
374
|
+
role: input.role,
|
|
375
|
+
phase: asString(input.phase) ?? currentStatus,
|
|
376
|
+
request_action: asString(input.request_action) ?? 'ask_user_input',
|
|
377
|
+
session_id: input.session_id,
|
|
378
|
+
prompt: input.prompt,
|
|
379
|
+
details: input.details ?? {},
|
|
380
|
+
expected_answer: normalizeExpectedAnswer(input.expected_answer) ?? null,
|
|
381
|
+
created_at: at,
|
|
382
|
+
expires_at: new Date(Date.parse(at) + policy.timeoutMs).toISOString(),
|
|
383
|
+
answer: null,
|
|
384
|
+
answered_at: null,
|
|
385
|
+
answered_by: null,
|
|
386
|
+
resume_status: resumeStatus,
|
|
387
|
+
resume_phase: resumePhase,
|
|
388
|
+
};
|
|
389
|
+
artifact.items.push(question);
|
|
390
|
+
await this.writeQuestions(input.feature_id, artifact);
|
|
391
|
+
await this.port.writeState(input.feature_id, this.normalizeStateForOpenQuestion(state.frontMatter, question, at), state.body);
|
|
392
|
+
return {
|
|
393
|
+
data: {
|
|
394
|
+
question_id: question.question_id,
|
|
395
|
+
status: question.status,
|
|
396
|
+
feature_status: STATUS.AWAITING_INPUT,
|
|
397
|
+
resume_status: question.resume_status,
|
|
398
|
+
},
|
|
399
|
+
};
|
|
400
|
+
});
|
|
401
|
+
}
|
|
402
|
+
async questionList(featureId, status = 'open') {
|
|
403
|
+
const artifact = await this.readQuestions(featureId);
|
|
404
|
+
const items = status === 'all' ? artifact.items : artifact.items.filter((item) => item.status === status);
|
|
405
|
+
return { data: { items } };
|
|
406
|
+
}
|
|
407
|
+
async questionAnswer(input) {
|
|
408
|
+
return await this.port.withFeatureLock(input.feature_id, async () => {
|
|
409
|
+
const state = await this.port.readState(input.feature_id);
|
|
410
|
+
const currentStatus = readStatus(state.frontMatter);
|
|
411
|
+
if (isTerminalStatus(currentStatus)) {
|
|
412
|
+
throw {
|
|
413
|
+
normalizedResponse: fail(ERROR_CODES.QUESTION_ANSWER_NOT_ALLOWED_IN_TERMINAL_STATE, `Cannot answer question for terminal feature state ${currentStatus}`, {
|
|
414
|
+
feature_id: input.feature_id,
|
|
415
|
+
status: currentStatus,
|
|
416
|
+
retryable: false,
|
|
417
|
+
requires_human: true,
|
|
418
|
+
}),
|
|
419
|
+
};
|
|
420
|
+
}
|
|
421
|
+
const artifact = await this.readQuestions(input.feature_id);
|
|
422
|
+
const answer = normalizeAnswer(input.answer);
|
|
423
|
+
if (!answer) {
|
|
424
|
+
throw {
|
|
425
|
+
normalizedResponse: fail(ERROR_CODES.QUESTION_ANSWER_INVALID, 'Question answer is required', {
|
|
426
|
+
retryable: false,
|
|
427
|
+
requires_human: true,
|
|
428
|
+
}),
|
|
429
|
+
};
|
|
430
|
+
}
|
|
431
|
+
const questionIndex = artifact.items.findIndex((item) => item.question_id === input.question_id);
|
|
432
|
+
if (questionIndex === -1) {
|
|
433
|
+
throw {
|
|
434
|
+
normalizedResponse: fail(ERROR_CODES.QUESTION_NOT_FOUND, 'Question not found', {
|
|
435
|
+
feature_id: input.feature_id,
|
|
436
|
+
question_id: input.question_id,
|
|
437
|
+
retryable: false,
|
|
438
|
+
requires_human: true,
|
|
439
|
+
}),
|
|
440
|
+
};
|
|
441
|
+
}
|
|
442
|
+
const question = artifact.items[questionIndex];
|
|
443
|
+
if (question.status !== 'open') {
|
|
444
|
+
throw {
|
|
445
|
+
normalizedResponse: fail(ERROR_CODES.QUESTION_ALREADY_CLOSED, 'Question is already closed', {
|
|
446
|
+
feature_id: input.feature_id,
|
|
447
|
+
question_id: input.question_id,
|
|
448
|
+
status: question.status,
|
|
449
|
+
retryable: false,
|
|
450
|
+
requires_human: false,
|
|
451
|
+
}),
|
|
452
|
+
};
|
|
453
|
+
}
|
|
454
|
+
if (!validateAnswer(question, answer)) {
|
|
455
|
+
throw {
|
|
456
|
+
normalizedResponse: fail(ERROR_CODES.QUESTION_ANSWER_INVALID, 'Question answer does not match the expected answer contract', {
|
|
457
|
+
feature_id: input.feature_id,
|
|
458
|
+
question_id: input.question_id,
|
|
459
|
+
expected_answer: question.expected_answer,
|
|
460
|
+
retryable: false,
|
|
461
|
+
requires_human: true,
|
|
462
|
+
}),
|
|
463
|
+
};
|
|
464
|
+
}
|
|
465
|
+
const at = nowIso();
|
|
466
|
+
const answered = {
|
|
467
|
+
...question,
|
|
468
|
+
status: 'answered',
|
|
469
|
+
answer,
|
|
470
|
+
answered_at: at,
|
|
471
|
+
answered_by: input.answered_by,
|
|
472
|
+
};
|
|
473
|
+
artifact.items[questionIndex] = answered;
|
|
474
|
+
await this.writeQuestions(input.feature_id, artifact);
|
|
475
|
+
const nextState = this.normalizeStateForAnsweredQuestion(state.frontMatter, answered, at);
|
|
476
|
+
await this.port.writeState(input.feature_id, nextState, state.body);
|
|
477
|
+
return {
|
|
478
|
+
data: {
|
|
479
|
+
feature_id: input.feature_id,
|
|
480
|
+
question_id: answered.question_id,
|
|
481
|
+
question_status: answered.status,
|
|
482
|
+
feature_status: readStatus(nextState),
|
|
483
|
+
resume_status: answered.resume_status,
|
|
484
|
+
resumed: readStatus(nextState) !== STATUS.AWAITING_INPUT,
|
|
485
|
+
},
|
|
486
|
+
};
|
|
487
|
+
});
|
|
488
|
+
}
|
|
489
|
+
async questionContext(featureId) {
|
|
490
|
+
const policy = this.humanInputPolicy();
|
|
491
|
+
const artifact = await this.readQuestions(featureId);
|
|
492
|
+
const openQuestions = artifact.items.filter((item) => item.status === 'open');
|
|
493
|
+
const answered = artifact.items
|
|
494
|
+
.filter((item) => item.status === 'answered' && item.answered_at)
|
|
495
|
+
.sort((left, right) => (right.answered_at ?? '').localeCompare(left.answered_at ?? ''))
|
|
496
|
+
.slice(0, policy.contextAnswerHistoryLimit);
|
|
497
|
+
return {
|
|
498
|
+
open_questions: openQuestions,
|
|
499
|
+
latest_answer: answered[0] ?? null,
|
|
500
|
+
};
|
|
501
|
+
}
|
|
502
|
+
async questionSummary(featureId) {
|
|
503
|
+
const state = await this.port.readState(featureId);
|
|
504
|
+
return normalizeHumanInputState(state.frontMatter.human_input);
|
|
505
|
+
}
|
|
506
|
+
}
|
|
507
|
+
//# sourceMappingURL=question-service.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"question-service.js","sourceRoot":"","sources":["../../../../../apps/control-plane/src/application/services/question-service.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,eAAe,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC5F,OAAO,EAAE,MAAM,EAAE,MAAM,yBAAyB,CAAC;AACjD,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AASxD,OAAO,EAAE,IAAI,EAAE,MAAM,wBAAwB,CAAC;AAO9C,MAAM,kBAAkB,GAAG,OAAO,CAAC;AACnC,MAAM,qBAAqB,GAAG,CAAC,CAAC;AAChC,MAAM,iBAAiB,GAAgC,IAAI,GAAG,CAAC;IAC7D,MAAM,CAAC,MAAM;IACb,MAAM,CAAC,MAAM;IACb,MAAM,CAAC,aAAa;CACrB,CAAC,CAAC;AACH,MAAM,kBAAkB,GAAiC,IAAI,GAAG,CAAC;IAC/D,MAAM,CAAC,MAAM;IACb,MAAM,CAAC,QAAQ;IACf,MAAM,CAAC,QAAQ;IACf,MAAM,CAAC,EAAE;IACT,MAAM,CAAC,OAAO;IACd,MAAM,CAAC,cAAc;CACtB,CAAC,CAAC;AACH,MAAM,iBAAiB,GAAG,IAAI,GAAG,CAAsB;IACrD,CAAC,MAAM,CAAC,MAAM,EAAE,IAAI,GAAG,CAAC,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,QAAQ,EAAE,MAAM,CAAC,OAAO,EAAE,MAAM,CAA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a,EAAE,QAAQ,CAAC,CAAC,CAAC,IAAI,IAAI;SACnC,CAAC;IACJ,CAAC;IAED,KAAK,CAAC,eAAe,CAAC,SAAiB;QACrC,MAAM,KAAK,GAAG,MAAM,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,SAAS,CAAC,CAAC;QACnD,OAAO,wBAAwB,CAAC,KAAK,CAAC,WAAW,CAAC,WAAW,CAAC,CAAC;IACjE,CAAC;CACF"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { GateLogExtraction } from '../../core/gate-log-extractor.js';
|
|
1
2
|
import type { ToolCaller as SupervisorToolCaller } from '../../core/tool-caller.js';
|
|
2
3
|
import type { NotifierService } from './notifier-service.js';
|
|
3
4
|
/**
|
|
@@ -48,6 +49,7 @@ export interface GateRepairContext {
|
|
|
48
49
|
failed_at: string;
|
|
49
50
|
retry_delay_ms?: number;
|
|
50
51
|
}>;
|
|
52
|
+
failureAnalysis?: GateLogExtraction;
|
|
51
53
|
}
|
|
52
54
|
export interface ReactionsServiceDependencies {
|
|
53
55
|
toolCaller: SupervisorToolCaller;
|
|
@@ -110,24 +110,67 @@ export class ReactionsService {
|
|
|
110
110
|
.map((item) => `- attempt=${item.attempt}; gate=${item.gate_name}; exit=${item.exit_code}; at=${item.failed_at}; evidence=${item.evidence_summary || 'n/a'}`)
|
|
111
111
|
.join('\n')
|
|
112
112
|
: '(none)';
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
113
|
+
if (!ctx.failureAnalysis) {
|
|
114
|
+
return [
|
|
115
|
+
'Gate execution failed. Review the error logs below and apply fixes.',
|
|
116
|
+
'',
|
|
117
|
+
`Gate: ${ctx.gateName}`,
|
|
118
|
+
`Exit Code: ${ctx.exitCode}`,
|
|
119
|
+
'',
|
|
120
|
+
'Logs:',
|
|
121
|
+
ctx.logs,
|
|
122
|
+
'',
|
|
123
|
+
'Evidence:',
|
|
124
|
+
ctx.evidenceSummary,
|
|
125
|
+
'',
|
|
126
|
+
`Retry: ${ctx.retryCount + 1} of ${maxRetries}`,
|
|
127
|
+
`Retry delay (ms): ${delayMs}`,
|
|
128
|
+
'',
|
|
129
|
+
'Failure history (most recent first):',
|
|
130
|
+
failureSummary,
|
|
131
|
+
].join('\n');
|
|
132
|
+
}
|
|
133
|
+
const { stepName, exitCode, affectedFiles, errorLines, summaryLines, errorCount, logTail } = ctx.failureAnalysis;
|
|
134
|
+
const lines = [
|
|
135
|
+
`Gate \`${ctx.gateName}\` step \`${stepName}\` failed (exit ${exitCode}).`,
|
|
127
136
|
'',
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
137
|
+
];
|
|
138
|
+
if (affectedFiles.length > 0) {
|
|
139
|
+
lines.push(`Affected files (${affectedFiles.length}):`);
|
|
140
|
+
for (const ref of affectedFiles) {
|
|
141
|
+
const loc = ref.col != null ? `${ref.path}:${ref.line}:${ref.col}` : `${ref.path}:${ref.line}`;
|
|
142
|
+
const msg = ref.message ? ` — ${ref.message}` : '';
|
|
143
|
+
lines.push(` ${loc}${msg}`);
|
|
144
|
+
}
|
|
145
|
+
lines.push('');
|
|
146
|
+
}
|
|
147
|
+
if (errorCount != null || summaryLines.length > 0) {
|
|
148
|
+
const countLabel = errorCount != null ? `${errorCount} total` : '';
|
|
149
|
+
lines.push(`Errors${countLabel ? ` (${countLabel})` : ''}:`);
|
|
150
|
+
for (const sl of summaryLines) {
|
|
151
|
+
lines.push(` ${sl}`);
|
|
152
|
+
}
|
|
153
|
+
lines.push('');
|
|
154
|
+
}
|
|
155
|
+
if (errorLines.length > 0) {
|
|
156
|
+
lines.push('Error output:');
|
|
157
|
+
for (const el of errorLines) {
|
|
158
|
+
lines.push(` ${el}`);
|
|
159
|
+
}
|
|
160
|
+
lines.push('');
|
|
161
|
+
}
|
|
162
|
+
lines.push('Fix all errors listed above before re-running.');
|
|
163
|
+
lines.push(`Retry: ${ctx.retryCount + 1} of ${maxRetries}`);
|
|
164
|
+
lines.push(`Retry delay (ms): ${delayMs}`);
|
|
165
|
+
lines.push('');
|
|
166
|
+
lines.push('Failure history (most recent first):');
|
|
167
|
+
lines.push(failureSummary);
|
|
168
|
+
if (logTail.trim().length > 0) {
|
|
169
|
+
lines.push('');
|
|
170
|
+
lines.push('Log tail (for reference):');
|
|
171
|
+
lines.push(logTail);
|
|
172
|
+
}
|
|
173
|
+
return lines.join('\n');
|
|
131
174
|
}
|
|
132
175
|
/**
|
|
133
176
|
* Records retry attempt in feature state.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"reactions-service.js","sourceRoot":"","sources":["../../../../../apps/control-plane/src/application/services/reactions-service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,yBAAyB,CAAC;
|
|
1
|
+
{"version":3,"file":"reactions-service.js","sourceRoot":"","sources":["../../../../../apps/control-plane/src/application/services/reactions-service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,yBAAyB,CAAC;AA0DhD,MAAM,4BAA4B,GAAuB;IACvD,OAAO,EAAE,KAAK;IACd,WAAW,EAAE,CAAC;IACd,MAAM,EAAE,aAAa;IACrB,cAAc,EAAE,CAAC;IACjB,cAAc,EAAE,KAAK;CACtB,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwCG;AACH,MAAM,OAAO,gBAAgB;IACV,UAAU,CAAuB;IACjC,QAAQ,CAA8B;IACtC,MAAM,CAAkB;IAEzC,YAAY,YAA0C;QACpD,IAAI,CAAC,UAAU,GAAG,YAAY,CAAC,UAAU,CAAC;QAC1C,IAAI,CAAC,QAAQ,GAAG,YAAY,CAAC,QAAQ,CAAC;QACtC,IAAI,CAAC,MAAM,GAAG,YAAY,CAAC,MAAM,IAAI,EAAE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