agentic-orchestrator 0.1.2 → 0.1.4
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 +15 -0
- package/CLAUDE.md +126 -0
- package/README.md +166 -25
- package/agentic/orchestrator/adapters.yaml +3 -0
- package/agentic/orchestrator/gates.yaml +47 -0
- package/agentic/orchestrator/policy.yaml +89 -0
- package/agentic/orchestrator/schemas/adapters.schema.json +12 -0
- package/agentic/orchestrator/schemas/gates.schema.json +6 -1
- package/agentic/orchestrator/schemas/index.schema.json +14 -0
- package/agentic/orchestrator/schemas/multi-project.schema.json +41 -0
- package/agentic/orchestrator/schemas/policy.schema.json +449 -52
- package/agentic/orchestrator/schemas/state.schema.json +16 -0
- package/agentic/orchestrator/tools/catalog.json +68 -0
- package/agentic/orchestrator/tools/schemas/input/cost.get.input.schema.json +10 -0
- package/agentic/orchestrator/tools/schemas/input/cost.record.input.schema.json +13 -0
- package/agentic/orchestrator/tools/schemas/input/feature.send_message.input.schema.json +11 -0
- package/agentic/orchestrator/tools/schemas/input/performance.get_analytics.input.schema.json +10 -0
- package/agentic/orchestrator/tools/schemas/input/performance.record_outcome.input.schema.json +18 -0
- package/agentic/orchestrator/tools/schemas/output/cost.get.output.schema.json +13 -0
- package/agentic/orchestrator/tools/schemas/output/cost.record.output.schema.json +13 -0
- package/agentic/orchestrator/tools/schemas/output/feature.ready_to_merge.output.schema.json +7 -0
- package/agentic/orchestrator/tools/schemas/output/feature.send_message.output.schema.json +23 -0
- package/agentic/orchestrator/tools/schemas/output/performance.get_analytics.output.schema.json +46 -0
- package/agentic/orchestrator/tools/schemas/output/performance.record_outcome.output.schema.json +10 -0
- package/agentic/orchestrator/tools.md +5 -0
- package/apps/control-plane/scripts/validate-architecture-rules.mjs +28 -2
- package/apps/control-plane/scripts/validate-docker-mcp-contract.mjs +12 -0
- package/apps/control-plane/scripts/validate-mcp-contracts.ts +92 -0
- package/apps/control-plane/src/application/adapters/adapter-registry.ts +169 -0
- package/apps/control-plane/src/application/multi-project-loader.ts +119 -0
- package/apps/control-plane/src/application/services/activity-monitor-service.ts +199 -0
- package/apps/control-plane/src/application/services/cost-tracking-service.ts +82 -0
- package/apps/control-plane/src/application/services/dependency-scheduler-service.ts +86 -0
- package/apps/control-plane/src/application/services/feature-deletion-service.ts +8 -7
- package/apps/control-plane/src/application/services/gate-interpolation-service.ts +15 -0
- package/apps/control-plane/src/application/services/gate-service.ts +38 -2
- package/apps/control-plane/src/application/services/instance-isolation-service.ts +18 -0
- package/apps/control-plane/src/application/services/issue-tracker-service.ts +469 -0
- package/apps/control-plane/src/application/services/merge-service.ts +67 -3
- package/apps/control-plane/src/application/services/notifier-service.ts +295 -0
- package/apps/control-plane/src/application/services/performance-analytics-service.ts +122 -0
- package/apps/control-plane/src/application/services/plan-service.ts +51 -0
- package/apps/control-plane/src/application/services/pr-monitor-service.ts +262 -0
- package/apps/control-plane/src/application/services/reactions-service.ts +175 -0
- package/apps/control-plane/src/application/services/reporting-service.ts +17 -2
- package/apps/control-plane/src/application/services/run-lease-service.ts +16 -38
- package/apps/control-plane/src/application/tools/tool-metadata.ts +4 -1
- package/apps/control-plane/src/cli/aop.ts +1 -1
- package/apps/control-plane/src/cli/attach-command-handler.ts +120 -0
- package/apps/control-plane/src/cli/cleanup-command-handler.ts +190 -0
- package/apps/control-plane/src/cli/cli-argument-parser.ts +69 -3
- package/apps/control-plane/src/cli/dashboard-command-handler.ts +57 -0
- package/apps/control-plane/src/cli/help-command-handler.ts +163 -0
- package/apps/control-plane/src/cli/init-command-handler.ts +609 -0
- package/apps/control-plane/src/cli/resume-command-handler.ts +1 -0
- package/apps/control-plane/src/cli/retry-command-handler.ts +138 -0
- package/apps/control-plane/src/cli/run-command-handler.ts +115 -3
- package/apps/control-plane/src/cli/send-command-handler.ts +65 -0
- package/apps/control-plane/src/cli/status-command-handler.ts +102 -2
- package/apps/control-plane/src/cli/types.ts +26 -1
- package/apps/control-plane/src/core/constants.ts +8 -2
- package/apps/control-plane/src/core/error-codes.ts +3 -1
- package/apps/control-plane/src/core/gates.ts +170 -50
- package/apps/control-plane/src/core/kernel.ts +280 -5
- package/apps/control-plane/src/core/path-layout.ts +12 -0
- package/apps/control-plane/src/core/tool-caller.ts +36 -0
- package/apps/control-plane/src/core/workspace-hooks.ts +87 -0
- package/apps/control-plane/src/interfaces/cli/bootstrap.ts +258 -9
- package/apps/control-plane/src/providers/providers.ts +235 -14
- package/apps/control-plane/src/supervisor/build-wave-executor.ts +129 -8
- package/apps/control-plane/src/supervisor/qa-wave-executor.ts +123 -5
- package/apps/control-plane/src/supervisor/run-coordinator.ts +143 -6
- package/apps/control-plane/src/supervisor/runtime.ts +135 -6
- package/apps/control-plane/src/supervisor/types.ts +12 -21
- package/apps/control-plane/src/supervisor/worker-decision-loop.ts +8 -0
- package/apps/control-plane/test/activity-monitor.spec.ts +294 -0
- package/apps/control-plane/test/adapter-registry.spec.ts +132 -0
- package/apps/control-plane/test/batch-operations.spec.ts +112 -0
- package/apps/control-plane/test/bootstrap-attach.spec.ts +102 -0
- package/apps/control-plane/test/bootstrap-edge-cases.spec.ts +252 -0
- package/apps/control-plane/test/bootstrap.spec.ts +560 -0
- package/apps/control-plane/test/cleanup-command.spec.ts +301 -0
- package/apps/control-plane/test/cli-helpers.spec.ts +404 -1
- package/apps/control-plane/test/cli.unit.spec.ts +182 -1
- package/apps/control-plane/test/collision-queue.spec.ts +104 -1
- package/apps/control-plane/test/core-utils.spec.ts +175 -2
- package/apps/control-plane/test/cost-tracking.spec.ts +143 -0
- package/apps/control-plane/test/dashboard-api.integration.spec.ts +247 -0
- package/apps/control-plane/test/dashboard-client.spec.ts +116 -0
- package/apps/control-plane/test/dashboard-command.spec.ts +103 -0
- package/apps/control-plane/test/dependency-scheduler.spec.ts +189 -0
- package/apps/control-plane/test/epoch-tracking.spec.ts +4 -4
- package/apps/control-plane/test/feature-deletion-service.spec.ts +422 -0
- package/apps/control-plane/test/feature-lifecycle.spec.ts +202 -0
- package/apps/control-plane/test/git-spawn-error.spec.ts +24 -0
- package/apps/control-plane/test/incremental-gates.spec.ts +137 -0
- package/apps/control-plane/test/init-wizard.spec.ts +506 -0
- package/apps/control-plane/test/instance-isolation.spec.ts +83 -0
- package/apps/control-plane/test/issue-tracker.spec.ts +890 -0
- package/apps/control-plane/test/kernel.coverage.spec.ts +3 -5
- package/apps/control-plane/test/kernel.coverage2.spec.ts +871 -0
- package/apps/control-plane/test/kernel.spec.ts +13 -11
- package/apps/control-plane/test/lock-service.spec.ts +508 -0
- package/apps/control-plane/test/mcp-helpers.spec.ts +176 -0
- package/apps/control-plane/test/mcp.spec.ts +50 -15
- package/apps/control-plane/test/merge-service.spec.ts +67 -4
- package/apps/control-plane/test/multi-project.spec.ts +372 -0
- package/apps/control-plane/test/notifier-service.spec.ts +388 -0
- package/apps/control-plane/test/parallel-gates.spec.ts +312 -0
- package/apps/control-plane/test/patch-service.spec.ts +253 -0
- package/apps/control-plane/test/performance-analytics.spec.ts +338 -0
- package/apps/control-plane/test/planning-wave-executor.spec.ts +168 -0
- package/apps/control-plane/test/pr-monitor.spec.ts +385 -0
- package/apps/control-plane/test/providers.spec.ts +344 -1
- package/apps/control-plane/test/reactions.spec.ts +392 -0
- package/apps/control-plane/test/resume-command.spec.ts +390 -0
- package/apps/control-plane/test/run-coordinator.spec.ts +481 -2
- package/apps/control-plane/test/schema-date-time.spec.ts +46 -0
- package/apps/control-plane/test/service-retry-paths.spec.ts +30 -0
- package/apps/control-plane/test/services.spec.ts +95 -2
- package/apps/control-plane/test/session-management.spec.ts +450 -0
- package/apps/control-plane/test/spec-ingestion.spec.ts +190 -0
- package/apps/control-plane/test/supervisor-collaborators.spec.ts +699 -2
- package/apps/control-plane/test/supervisor.spec.ts +36 -30
- package/apps/control-plane/test/supervisor.unit.spec.ts +405 -0
- package/apps/control-plane/test/worker-decision-loop.spec.ts +57 -0
- package/apps/control-plane/test/workspace-hooks.spec.ts +177 -0
- package/apps/control-plane/vitest.config.ts +21 -5
- package/dist/apps/control-plane/application/adapters/adapter-registry.d.ts +44 -0
- package/dist/apps/control-plane/application/adapters/adapter-registry.js +76 -0
- package/dist/apps/control-plane/application/adapters/adapter-registry.js.map +1 -0
- package/dist/apps/control-plane/application/multi-project-loader.d.ts +31 -0
- package/dist/apps/control-plane/application/multi-project-loader.js +82 -0
- package/dist/apps/control-plane/application/multi-project-loader.js.map +1 -0
- package/dist/apps/control-plane/application/services/activity-monitor-service.d.ts +43 -0
- package/dist/apps/control-plane/application/services/activity-monitor-service.js +132 -0
- package/dist/apps/control-plane/application/services/activity-monitor-service.js.map +1 -0
- package/dist/apps/control-plane/application/services/cost-tracking-service.d.ts +28 -0
- package/dist/apps/control-plane/application/services/cost-tracking-service.js +48 -0
- package/dist/apps/control-plane/application/services/cost-tracking-service.js.map +1 -0
- package/dist/apps/control-plane/application/services/dependency-scheduler-service.d.ts +26 -0
- package/dist/apps/control-plane/application/services/dependency-scheduler-service.js +75 -0
- package/dist/apps/control-plane/application/services/dependency-scheduler-service.js.map +1 -0
- package/dist/apps/control-plane/application/services/feature-deletion-service.d.ts +2 -0
- package/dist/apps/control-plane/application/services/feature-deletion-service.js +6 -7
- package/dist/apps/control-plane/application/services/feature-deletion-service.js.map +1 -1
- package/dist/apps/control-plane/application/services/gate-interpolation-service.d.ts +7 -0
- package/dist/apps/control-plane/application/services/gate-interpolation-service.js +7 -0
- package/dist/apps/control-plane/application/services/gate-interpolation-service.js.map +1 -0
- package/dist/apps/control-plane/application/services/gate-service.js +32 -2
- package/dist/apps/control-plane/application/services/gate-service.js.map +1 -1
- package/dist/apps/control-plane/application/services/instance-isolation-service.d.ts +11 -0
- package/dist/apps/control-plane/application/services/instance-isolation-service.js +17 -0
- package/dist/apps/control-plane/application/services/instance-isolation-service.js.map +1 -0
- package/dist/apps/control-plane/application/services/issue-tracker-service.d.ts +65 -0
- package/dist/apps/control-plane/application/services/issue-tracker-service.js +358 -0
- package/dist/apps/control-plane/application/services/issue-tracker-service.js.map +1 -0
- package/dist/apps/control-plane/application/services/merge-service.d.ts +4 -0
- package/dist/apps/control-plane/application/services/merge-service.js +44 -2
- package/dist/apps/control-plane/application/services/merge-service.js.map +1 -1
- package/dist/apps/control-plane/application/services/notifier-service.d.ts +74 -0
- package/dist/apps/control-plane/application/services/notifier-service.js +212 -0
- package/dist/apps/control-plane/application/services/notifier-service.js.map +1 -0
- package/dist/apps/control-plane/application/services/performance-analytics-service.d.ts +39 -0
- package/dist/apps/control-plane/application/services/performance-analytics-service.js +75 -0
- package/dist/apps/control-plane/application/services/performance-analytics-service.js.map +1 -0
- package/dist/apps/control-plane/application/services/plan-service.d.ts +1 -0
- package/dist/apps/control-plane/application/services/plan-service.js +53 -0
- package/dist/apps/control-plane/application/services/plan-service.js.map +1 -1
- package/dist/apps/control-plane/application/services/pr-monitor-service.d.ts +44 -0
- package/dist/apps/control-plane/application/services/pr-monitor-service.js +192 -0
- package/dist/apps/control-plane/application/services/pr-monitor-service.js.map +1 -0
- package/dist/apps/control-plane/application/services/reactions-service.d.ts +67 -0
- package/dist/apps/control-plane/application/services/reactions-service.js +114 -0
- package/dist/apps/control-plane/application/services/reactions-service.js.map +1 -0
- package/dist/apps/control-plane/application/services/reporting-service.d.ts +1 -0
- package/dist/apps/control-plane/application/services/reporting-service.js +13 -2
- 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 +2 -0
- package/dist/apps/control-plane/application/services/run-lease-service.js +14 -38
- package/dist/apps/control-plane/application/services/run-lease-service.js.map +1 -1
- package/dist/apps/control-plane/application/tools/tool-metadata.js +3 -1
- package/dist/apps/control-plane/application/tools/tool-metadata.js.map +1 -1
- package/dist/apps/control-plane/cli/aop.d.ts +1 -1
- package/dist/apps/control-plane/cli/aop.js +1 -1
- package/dist/apps/control-plane/cli/attach-command-handler.d.ts +12 -0
- package/dist/apps/control-plane/cli/attach-command-handler.js +98 -0
- package/dist/apps/control-plane/cli/attach-command-handler.js.map +1 -0
- package/dist/apps/control-plane/cli/cleanup-command-handler.d.ts +12 -0
- package/dist/apps/control-plane/cli/cleanup-command-handler.js +162 -0
- package/dist/apps/control-plane/cli/cleanup-command-handler.js.map +1 -0
- package/dist/apps/control-plane/cli/cli-argument-parser.js +73 -3
- package/dist/apps/control-plane/cli/cli-argument-parser.js.map +1 -1
- package/dist/apps/control-plane/cli/dashboard-command-handler.d.ts +7 -0
- package/dist/apps/control-plane/cli/dashboard-command-handler.js +45 -0
- package/dist/apps/control-plane/cli/dashboard-command-handler.js.map +1 -0
- package/dist/apps/control-plane/cli/help-command-handler.d.ts +8 -0
- package/dist/apps/control-plane/cli/help-command-handler.js +146 -0
- package/dist/apps/control-plane/cli/help-command-handler.js.map +1 -0
- package/dist/apps/control-plane/cli/init-command-handler.d.ts +26 -0
- package/dist/apps/control-plane/cli/init-command-handler.js +517 -0
- package/dist/apps/control-plane/cli/init-command-handler.js.map +1 -0
- package/dist/apps/control-plane/cli/resume-command-handler.js +1 -1
- package/dist/apps/control-plane/cli/resume-command-handler.js.map +1 -1
- package/dist/apps/control-plane/cli/retry-command-handler.d.ts +8 -0
- package/dist/apps/control-plane/cli/retry-command-handler.js +111 -0
- package/dist/apps/control-plane/cli/retry-command-handler.js.map +1 -0
- package/dist/apps/control-plane/cli/run-command-handler.d.ts +5 -0
- package/dist/apps/control-plane/cli/run-command-handler.js +82 -3
- package/dist/apps/control-plane/cli/run-command-handler.js.map +1 -1
- package/dist/apps/control-plane/cli/send-command-handler.d.ts +8 -0
- package/dist/apps/control-plane/cli/send-command-handler.js +55 -0
- package/dist/apps/control-plane/cli/send-command-handler.js.map +1 -0
- package/dist/apps/control-plane/cli/status-command-handler.d.ts +12 -1
- package/dist/apps/control-plane/cli/status-command-handler.js +55 -2
- package/dist/apps/control-plane/cli/status-command-handler.js.map +1 -1
- package/dist/apps/control-plane/cli/types.d.ts +26 -1
- package/dist/apps/control-plane/cli/types.js +15 -1
- package/dist/apps/control-plane/cli/types.js.map +1 -1
- package/dist/apps/control-plane/core/constants.d.ts +6 -0
- package/dist/apps/control-plane/core/constants.js +8 -2
- package/dist/apps/control-plane/core/constants.js.map +1 -1
- package/dist/apps/control-plane/core/error-codes.d.ts +2 -0
- package/dist/apps/control-plane/core/error-codes.js +3 -1
- package/dist/apps/control-plane/core/error-codes.js.map +1 -1
- package/dist/apps/control-plane/core/gates.d.ts +4 -0
- package/dist/apps/control-plane/core/gates.js +140 -43
- package/dist/apps/control-plane/core/gates.js.map +1 -1
- package/dist/apps/control-plane/core/kernel.d.ts +50 -1
- package/dist/apps/control-plane/core/kernel.js +220 -7
- package/dist/apps/control-plane/core/kernel.js.map +1 -1
- package/dist/apps/control-plane/core/path-layout.d.ts +3 -0
- package/dist/apps/control-plane/core/path-layout.js +9 -0
- package/dist/apps/control-plane/core/path-layout.js.map +1 -1
- package/dist/apps/control-plane/core/tool-caller.d.ts +32 -0
- package/dist/apps/control-plane/core/tool-caller.js +2 -0
- package/dist/apps/control-plane/core/tool-caller.js.map +1 -0
- package/dist/apps/control-plane/core/workspace-hooks.d.ts +20 -0
- package/dist/apps/control-plane/core/workspace-hooks.js +69 -0
- package/dist/apps/control-plane/core/workspace-hooks.js.map +1 -0
- package/dist/apps/control-plane/interfaces/cli/bootstrap.js +245 -9
- package/dist/apps/control-plane/interfaces/cli/bootstrap.js.map +1 -1
- package/dist/apps/control-plane/providers/providers.d.ts +42 -3
- package/dist/apps/control-plane/providers/providers.js +216 -5
- package/dist/apps/control-plane/providers/providers.js.map +1 -1
- package/dist/apps/control-plane/supervisor/build-wave-executor.d.ts +3 -0
- package/dist/apps/control-plane/supervisor/build-wave-executor.js +115 -6
- package/dist/apps/control-plane/supervisor/build-wave-executor.js.map +1 -1
- package/dist/apps/control-plane/supervisor/qa-wave-executor.d.ts +3 -0
- package/dist/apps/control-plane/supervisor/qa-wave-executor.js +109 -5
- package/dist/apps/control-plane/supervisor/qa-wave-executor.js.map +1 -1
- package/dist/apps/control-plane/supervisor/run-coordinator.d.ts +15 -0
- package/dist/apps/control-plane/supervisor/run-coordinator.js +132 -6
- package/dist/apps/control-plane/supervisor/run-coordinator.js.map +1 -1
- package/dist/apps/control-plane/supervisor/runtime.d.ts +3 -0
- package/dist/apps/control-plane/supervisor/runtime.js +110 -6
- package/dist/apps/control-plane/supervisor/runtime.js.map +1 -1
- package/dist/apps/control-plane/supervisor/types.d.ts +9 -16
- package/dist/apps/control-plane/supervisor/types.js.map +1 -1
- package/dist/apps/control-plane/supervisor/worker-decision-loop.d.ts +3 -0
- package/dist/apps/control-plane/supervisor/worker-decision-loop.js +5 -0
- package/dist/apps/control-plane/supervisor/worker-decision-loop.js.map +1 -1
- package/eslint.config.mjs +2 -1
- package/package.json +12 -2
- package/packages/web-dashboard/next-env.d.ts +5 -0
- package/packages/web-dashboard/next.config.js +7 -0
- package/packages/web-dashboard/package.json +26 -0
- package/packages/web-dashboard/src/app/api/actions/route.ts +64 -0
- package/packages/web-dashboard/src/app/api/events/route.ts +51 -0
- package/packages/web-dashboard/src/app/api/features/[id]/checkout/route.ts +256 -0
- package/packages/web-dashboard/src/app/api/features/[id]/diff/route.ts +10 -0
- package/packages/web-dashboard/src/app/api/features/[id]/evidence/[artifact]/route.ts +25 -0
- package/packages/web-dashboard/src/app/api/features/[id]/review/route.ts +63 -0
- package/packages/web-dashboard/src/app/api/features/[id]/route.ts +16 -0
- package/packages/web-dashboard/src/app/api/projects/route.ts +31 -0
- package/packages/web-dashboard/src/app/api/status/route.ts +15 -0
- package/packages/web-dashboard/src/app/globals.css +2 -0
- package/packages/web-dashboard/src/app/layout.tsx +15 -0
- package/packages/web-dashboard/src/app/page.tsx +393 -0
- package/packages/web-dashboard/src/lib/aop-client.ts +244 -0
- package/packages/web-dashboard/src/lib/multi-project-config.ts +116 -0
- package/packages/web-dashboard/src/lib/orchestrator-tools.ts +284 -0
- package/packages/web-dashboard/src/lib/types.ts +58 -0
- package/packages/web-dashboard/tsconfig.json +40 -0
- package/packages/web-dashboard/vitest.config.ts +6 -0
- package/spec-files/completed/agentic_orchestrator_feature_gaps_closure_spec.md +1764 -0
- package/spec-files/outstanding/agentic_orchestrator_enterprise_governance_dashboard_spec.md +348 -0
- package/spec-files/outstanding/agentic_orchestrator_knowledge_canary_spec.md +344 -0
- package/spec-files/outstanding/agentic_orchestrator_observability_integrity_diagnostics_spec.md +374 -0
- package/spec-files/outstanding/agentic_orchestrator_performance_improvements_spec.md +1059 -0
- package/spec-files/outstanding/agentic_orchestrator_planning_review_quality_spec.md +466 -0
- package/spec-files/outstanding/agentic_orchestrator_quality_adoption_execution_spec.md +198 -0
- package/spec-files/outstanding/agentic_orchestrator_validator_hardening_spec.md +365 -0
- package/spec-files/progress.md +481 -52
- /package/spec-files/{agentic_orchestrator_cli_delete_command_spec.md → completed/agentic_orchestrator_cli_delete_command_spec.md} +0 -0
- /package/spec-files/{agentic_orchestrator_dot_aop_generated_artifacts_spec.md → completed/agentic_orchestrator_dot_aop_generated_artifacts_spec.md} +0 -0
- /package/spec-files/{agentic_orchestrator_mcp_formalization_spec.md → completed/agentic_orchestrator_mcp_formalization_spec.md} +0 -0
- /package/spec-files/{agentic_orchestrator_oop_refactor_spec.md → completed/agentic_orchestrator_oop_refactor_spec.md} +0 -0
- /package/spec-files/{agentic_orchestrator_single_global_orchestrator_spec.md → completed/agentic_orchestrator_single_global_orchestrator_spec.md} +0 -0
- /package/spec-files/{agentic_orchestrator_spec.md → completed/agentic_orchestrator_spec.md} +0 -0
|
@@ -0,0 +1,358 @@
|
|
|
1
|
+
import { execFile } from 'node:child_process';
|
|
2
|
+
import { promisify } from 'node:util';
|
|
3
|
+
const execFileAsync = promisify(execFile);
|
|
4
|
+
export function createGhRunner(fn) {
|
|
5
|
+
if (fn !== undefined) {
|
|
6
|
+
return fn;
|
|
7
|
+
}
|
|
8
|
+
return async (args) => {
|
|
9
|
+
try {
|
|
10
|
+
const { stdout } = await execFileAsync('gh', args, { timeout: 15_000 });
|
|
11
|
+
return { stdout, exitCode: 0 };
|
|
12
|
+
}
|
|
13
|
+
catch (err) {
|
|
14
|
+
const e = err;
|
|
15
|
+
if (e['code'] === 'ENOENT' || e['code'] === 127) {
|
|
16
|
+
return { stdout: '', exitCode: 127 };
|
|
17
|
+
}
|
|
18
|
+
const exitCode = typeof e['code'] === 'number' ? e['code'] : 1;
|
|
19
|
+
return { stdout: '', exitCode };
|
|
20
|
+
}
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
export function createHttpRunner(fn) {
|
|
24
|
+
if (fn !== undefined) {
|
|
25
|
+
return fn;
|
|
26
|
+
}
|
|
27
|
+
return async (url, init) => {
|
|
28
|
+
try {
|
|
29
|
+
const response = await fetch(url, init);
|
|
30
|
+
return {
|
|
31
|
+
status: response.status,
|
|
32
|
+
ok: response.ok,
|
|
33
|
+
body: await response.text()
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
catch {
|
|
37
|
+
return { status: 0, ok: false, body: '' };
|
|
38
|
+
}
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
function tryParseJson(value) {
|
|
42
|
+
if (!value) {
|
|
43
|
+
return null;
|
|
44
|
+
}
|
|
45
|
+
try {
|
|
46
|
+
const parsed = JSON.parse(value);
|
|
47
|
+
if (parsed && typeof parsed === 'object') {
|
|
48
|
+
return parsed;
|
|
49
|
+
}
|
|
50
|
+
return null;
|
|
51
|
+
}
|
|
52
|
+
catch {
|
|
53
|
+
return null;
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
export class GitHubIssueTracker {
|
|
57
|
+
repo;
|
|
58
|
+
ghRunner;
|
|
59
|
+
constructor(config = {}, ghRunner) {
|
|
60
|
+
this.repo = config['repo'];
|
|
61
|
+
this.ghRunner = ghRunner ?? createGhRunner();
|
|
62
|
+
}
|
|
63
|
+
async getIssue(issueId) {
|
|
64
|
+
const repoArgs = this.repo ? ['--repo', this.repo] : [];
|
|
65
|
+
const result = await this.ghRunner([
|
|
66
|
+
'issue', 'view', issueId,
|
|
67
|
+
...repoArgs,
|
|
68
|
+
'--json', 'number,title,body,state,url'
|
|
69
|
+
]);
|
|
70
|
+
if (result.exitCode !== 0 || !result.stdout) {
|
|
71
|
+
return { id: issueId, title: '', body: '', status: 'unknown', url: '' };
|
|
72
|
+
}
|
|
73
|
+
const parsed = JSON.parse(result.stdout);
|
|
74
|
+
return {
|
|
75
|
+
id: String(parsed.number),
|
|
76
|
+
title: parsed.title,
|
|
77
|
+
body: parsed.body,
|
|
78
|
+
status: parsed.state.toLowerCase(),
|
|
79
|
+
url: parsed.url
|
|
80
|
+
};
|
|
81
|
+
}
|
|
82
|
+
async updateIssueStatus(issueId, status) {
|
|
83
|
+
const repoArgs = this.repo ? ['--repo', this.repo] : [];
|
|
84
|
+
const stateArg = status === 'closed' || status === 'merged' ? 'closed' : 'open';
|
|
85
|
+
await this.ghRunner(['issue', 'edit', issueId, ...repoArgs, '--state', stateArg]);
|
|
86
|
+
}
|
|
87
|
+
async addComment(issueId, comment) {
|
|
88
|
+
const repoArgs = this.repo ? ['--repo', this.repo] : [];
|
|
89
|
+
await this.ghRunner(['issue', 'comment', issueId, ...repoArgs, '--body', comment]);
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
function readString(value) {
|
|
93
|
+
return typeof value === 'string' ? value : '';
|
|
94
|
+
}
|
|
95
|
+
function lowerCaseStatus(value) {
|
|
96
|
+
return value ? value.toLowerCase() : 'unknown';
|
|
97
|
+
}
|
|
98
|
+
function normalizeAopStatus(status) {
|
|
99
|
+
return status.trim().toLowerCase().replace(/[^a-z0-9]+/g, '_');
|
|
100
|
+
}
|
|
101
|
+
function mapDefaultLinearStatus(status) {
|
|
102
|
+
const normalized = normalizeAopStatus(status);
|
|
103
|
+
if (normalized === 'merged' || normalized === 'closed') {
|
|
104
|
+
return 'done';
|
|
105
|
+
}
|
|
106
|
+
if (normalized === 'blocked' || normalized === 'failed') {
|
|
107
|
+
return 'blocked';
|
|
108
|
+
}
|
|
109
|
+
if (normalized === 'planning') {
|
|
110
|
+
return 'backlog';
|
|
111
|
+
}
|
|
112
|
+
if (normalized === 'qa' || normalized === 'ready_to_merge') {
|
|
113
|
+
return 'in_review';
|
|
114
|
+
}
|
|
115
|
+
if (normalized === 'building') {
|
|
116
|
+
return 'in_progress';
|
|
117
|
+
}
|
|
118
|
+
return 'in_progress';
|
|
119
|
+
}
|
|
120
|
+
function mapDefaultJiraTransition(status) {
|
|
121
|
+
const normalized = normalizeAopStatus(status);
|
|
122
|
+
if (normalized === 'merged' || normalized === 'closed') {
|
|
123
|
+
return 'done';
|
|
124
|
+
}
|
|
125
|
+
if (normalized === 'planning') {
|
|
126
|
+
return 'to do';
|
|
127
|
+
}
|
|
128
|
+
if (normalized === 'blocked' || normalized === 'failed') {
|
|
129
|
+
return 'blocked';
|
|
130
|
+
}
|
|
131
|
+
return 'in progress';
|
|
132
|
+
}
|
|
133
|
+
// --- Linear adapter (GraphQL HTTP) ---
|
|
134
|
+
export class LinearIssueTracker {
|
|
135
|
+
token;
|
|
136
|
+
baseUrl;
|
|
137
|
+
config;
|
|
138
|
+
httpRunner;
|
|
139
|
+
constructor(config = {}, httpRunner) {
|
|
140
|
+
this.token = config['token'] ?? '';
|
|
141
|
+
this.baseUrl = config['base_url'] ?? 'https://api.linear.app/graphql';
|
|
142
|
+
this.config = config;
|
|
143
|
+
this.httpRunner = createHttpRunner(httpRunner);
|
|
144
|
+
}
|
|
145
|
+
async graphQl(query, variables) {
|
|
146
|
+
const headers = {
|
|
147
|
+
'Content-Type': 'application/json'
|
|
148
|
+
};
|
|
149
|
+
if (this.token) {
|
|
150
|
+
headers['Authorization'] = `Bearer ${this.token}`;
|
|
151
|
+
}
|
|
152
|
+
const result = await this.httpRunner(this.baseUrl, {
|
|
153
|
+
method: 'POST',
|
|
154
|
+
headers,
|
|
155
|
+
body: JSON.stringify({ query, variables })
|
|
156
|
+
});
|
|
157
|
+
if (!result.ok || !result.body) {
|
|
158
|
+
return null;
|
|
159
|
+
}
|
|
160
|
+
const parsed = tryParseJson(result.body);
|
|
161
|
+
if (!parsed) {
|
|
162
|
+
return null;
|
|
163
|
+
}
|
|
164
|
+
if (Array.isArray(parsed['errors']) && parsed['errors'].length > 0) {
|
|
165
|
+
return null;
|
|
166
|
+
}
|
|
167
|
+
const data = parsed['data'];
|
|
168
|
+
if (data && typeof data === 'object') {
|
|
169
|
+
return data;
|
|
170
|
+
}
|
|
171
|
+
return null;
|
|
172
|
+
}
|
|
173
|
+
static parseIssueNode(value) {
|
|
174
|
+
if (!value || typeof value !== 'object') {
|
|
175
|
+
return null;
|
|
176
|
+
}
|
|
177
|
+
const raw = value;
|
|
178
|
+
const stateRaw = raw['state'];
|
|
179
|
+
return {
|
|
180
|
+
id: readString(raw['id']),
|
|
181
|
+
identifier: readString(raw['identifier']),
|
|
182
|
+
title: readString(raw['title']),
|
|
183
|
+
description: readString(raw['description']),
|
|
184
|
+
url: readString(raw['url']),
|
|
185
|
+
state: stateRaw && typeof stateRaw === 'object'
|
|
186
|
+
? {
|
|
187
|
+
name: readString(stateRaw['name'])
|
|
188
|
+
}
|
|
189
|
+
: null
|
|
190
|
+
};
|
|
191
|
+
}
|
|
192
|
+
async resolveIssueNode(issueId) {
|
|
193
|
+
const byIdentifier = await this.graphQl('query AopIssueByIdentifier($identifier: String!) { issueByIdentifier(identifier: $identifier) { id identifier title description url state { name } } }', { identifier: issueId });
|
|
194
|
+
const identifierIssue = LinearIssueTracker.parseIssueNode(byIdentifier?.issueByIdentifier);
|
|
195
|
+
if (identifierIssue) {
|
|
196
|
+
return identifierIssue;
|
|
197
|
+
}
|
|
198
|
+
const byId = await this.graphQl('query AopIssueById($id: String!) { issue(id: $id) { id identifier title description url state { name } } }', { id: issueId });
|
|
199
|
+
return LinearIssueTracker.parseIssueNode(byId?.issue);
|
|
200
|
+
}
|
|
201
|
+
resolveStateId(status) {
|
|
202
|
+
const normalized = normalizeAopStatus(status);
|
|
203
|
+
const explicit = this.config[`state_id_${normalized}`];
|
|
204
|
+
if (explicit && explicit.length > 0) {
|
|
205
|
+
return explicit;
|
|
206
|
+
}
|
|
207
|
+
const defaultKey = mapDefaultLinearStatus(status);
|
|
208
|
+
if (!defaultKey) {
|
|
209
|
+
return null;
|
|
210
|
+
}
|
|
211
|
+
const defaultMapped = this.config[`state_id_${defaultKey}`];
|
|
212
|
+
return defaultMapped && defaultMapped.length > 0 ? defaultMapped : null;
|
|
213
|
+
}
|
|
214
|
+
async getIssue(issueId) {
|
|
215
|
+
const issue = await this.resolveIssueNode(issueId).catch(() => null);
|
|
216
|
+
if (!issue) {
|
|
217
|
+
return { id: issueId, title: '', body: '', status: 'unknown', url: '' };
|
|
218
|
+
}
|
|
219
|
+
return {
|
|
220
|
+
id: issue.identifier || issue.id || issueId,
|
|
221
|
+
title: issue.title,
|
|
222
|
+
body: issue.description,
|
|
223
|
+
status: lowerCaseStatus(issue.state?.name ?? ''),
|
|
224
|
+
url: issue.url
|
|
225
|
+
};
|
|
226
|
+
}
|
|
227
|
+
async updateIssueStatus(issueId, status) {
|
|
228
|
+
const issue = await this.resolveIssueNode(issueId).catch(() => null);
|
|
229
|
+
if (!issue?.id) {
|
|
230
|
+
return;
|
|
231
|
+
}
|
|
232
|
+
const stateId = this.resolveStateId(status);
|
|
233
|
+
if (!stateId) {
|
|
234
|
+
return;
|
|
235
|
+
}
|
|
236
|
+
await this.graphQl('mutation AopIssueUpdate($id: String!, $stateId: String!) { issueUpdate(id: $id, input: { stateId: $stateId }) { success } }', { id: issue.id, stateId });
|
|
237
|
+
}
|
|
238
|
+
async addComment(issueId, comment) {
|
|
239
|
+
const issue = await this.resolveIssueNode(issueId).catch(() => null);
|
|
240
|
+
if (!issue?.id) {
|
|
241
|
+
return;
|
|
242
|
+
}
|
|
243
|
+
await this.graphQl('mutation AopCommentCreate($issueId: String!, $body: String!) { commentCreate(input: { issueId: $issueId, body: $body }) { success } }', { issueId: issue.id, body: comment });
|
|
244
|
+
}
|
|
245
|
+
}
|
|
246
|
+
function toJiraDescription(value) {
|
|
247
|
+
if (typeof value === 'string') {
|
|
248
|
+
return value;
|
|
249
|
+
}
|
|
250
|
+
if (!value || typeof value !== 'object') {
|
|
251
|
+
return '';
|
|
252
|
+
}
|
|
253
|
+
return JSON.stringify(value);
|
|
254
|
+
}
|
|
255
|
+
// --- Jira adapter (REST HTTP) ---
|
|
256
|
+
export class JiraIssueTracker {
|
|
257
|
+
baseUrl;
|
|
258
|
+
token;
|
|
259
|
+
email;
|
|
260
|
+
config;
|
|
261
|
+
httpRunner;
|
|
262
|
+
constructor(config = {}, httpRunner) {
|
|
263
|
+
this.baseUrl = (config['base_url'] ?? config['url'] ?? '').replace(/\/+$/, '');
|
|
264
|
+
this.token = config['token'] ?? '';
|
|
265
|
+
this.email = config['email'] ?? config['user'] ?? '';
|
|
266
|
+
this.config = config;
|
|
267
|
+
this.httpRunner = createHttpRunner(httpRunner);
|
|
268
|
+
}
|
|
269
|
+
authHeader() {
|
|
270
|
+
if (this.email && this.token) {
|
|
271
|
+
return `Basic ${Buffer.from(`${this.email}:${this.token}`, 'utf8').toString('base64')}`;
|
|
272
|
+
}
|
|
273
|
+
if (this.token) {
|
|
274
|
+
return `Bearer ${this.token}`;
|
|
275
|
+
}
|
|
276
|
+
return null;
|
|
277
|
+
}
|
|
278
|
+
async requestJson(endpoint, method, body) {
|
|
279
|
+
if (!this.baseUrl) {
|
|
280
|
+
return null;
|
|
281
|
+
}
|
|
282
|
+
const headers = {
|
|
283
|
+
Accept: 'application/json'
|
|
284
|
+
};
|
|
285
|
+
const authHeader = this.authHeader();
|
|
286
|
+
if (authHeader) {
|
|
287
|
+
headers['Authorization'] = authHeader;
|
|
288
|
+
}
|
|
289
|
+
if (body !== undefined) {
|
|
290
|
+
headers['Content-Type'] = 'application/json';
|
|
291
|
+
}
|
|
292
|
+
const result = await this.httpRunner(`${this.baseUrl}${endpoint}`, {
|
|
293
|
+
method,
|
|
294
|
+
headers,
|
|
295
|
+
body: body === undefined ? undefined : JSON.stringify(body)
|
|
296
|
+
});
|
|
297
|
+
if (!result.ok || !result.body) {
|
|
298
|
+
return null;
|
|
299
|
+
}
|
|
300
|
+
const parsed = tryParseJson(result.body);
|
|
301
|
+
return parsed;
|
|
302
|
+
}
|
|
303
|
+
resolveTransitionName(status) {
|
|
304
|
+
const normalized = normalizeAopStatus(status);
|
|
305
|
+
const explicit = this.config[`transition_${normalized}`];
|
|
306
|
+
if (explicit && explicit.length > 0) {
|
|
307
|
+
return explicit.toLowerCase();
|
|
308
|
+
}
|
|
309
|
+
return mapDefaultJiraTransition(status);
|
|
310
|
+
}
|
|
311
|
+
async getIssue(issueId) {
|
|
312
|
+
const payload = await this.requestJson(`/rest/api/2/issue/${encodeURIComponent(issueId)}?fields=summary,description,status`, 'GET');
|
|
313
|
+
if (!payload) {
|
|
314
|
+
return { id: issueId, title: '', body: '', status: 'unknown', url: '' };
|
|
315
|
+
}
|
|
316
|
+
const fields = payload.fields ?? {};
|
|
317
|
+
return {
|
|
318
|
+
id: readString(payload.key) || issueId,
|
|
319
|
+
title: readString(fields.summary),
|
|
320
|
+
body: toJiraDescription(fields.description),
|
|
321
|
+
status: lowerCaseStatus(readString(fields.status?.name)),
|
|
322
|
+
url: this.baseUrl ? `${this.baseUrl}/browse/${issueId}` : ''
|
|
323
|
+
};
|
|
324
|
+
}
|
|
325
|
+
async updateIssueStatus(issueId, status) {
|
|
326
|
+
const transitionsPayload = await this.requestJson(`/rest/api/2/issue/${encodeURIComponent(issueId)}/transitions`, 'GET');
|
|
327
|
+
const transitions = transitionsPayload?.transitions ?? [];
|
|
328
|
+
const targetName = this.resolveTransitionName(status);
|
|
329
|
+
const transition = transitions.find((item) => typeof item.name === 'string' && item.name.toLowerCase() === targetName);
|
|
330
|
+
if (!transition?.id) {
|
|
331
|
+
return;
|
|
332
|
+
}
|
|
333
|
+
await this.requestJson(`/rest/api/2/issue/${encodeURIComponent(issueId)}/transitions`, 'POST', { transition: { id: transition.id } });
|
|
334
|
+
}
|
|
335
|
+
async addComment(issueId, comment) {
|
|
336
|
+
await this.requestJson(`/rest/api/2/issue/${encodeURIComponent(issueId)}/comment`, 'POST', { body: comment });
|
|
337
|
+
}
|
|
338
|
+
}
|
|
339
|
+
// --- Factory ---
|
|
340
|
+
export function createIssueTracker(config, ghRunner, httpRunner) {
|
|
341
|
+
if (!config) {
|
|
342
|
+
return undefined;
|
|
343
|
+
}
|
|
344
|
+
if (config.enabled === false) {
|
|
345
|
+
return undefined;
|
|
346
|
+
}
|
|
347
|
+
switch (config.type) {
|
|
348
|
+
case 'github':
|
|
349
|
+
return new GitHubIssueTracker(config.config ?? {}, ghRunner);
|
|
350
|
+
case 'linear':
|
|
351
|
+
return new LinearIssueTracker(config.config ?? {}, httpRunner);
|
|
352
|
+
case 'jira':
|
|
353
|
+
return new JiraIssueTracker(config.config ?? {}, httpRunner);
|
|
354
|
+
default:
|
|
355
|
+
return undefined;
|
|
356
|
+
}
|
|
357
|
+
}
|
|
358
|
+
//# sourceMappingURL=issue-tracker-service.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"issue-tracker-service.js","sourceRoot":"","sources":["../../../../../apps/control-plane/src/application/services/issue-tracker-service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAC9C,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AAEtC,MAAM,aAAa,GAAG,SAAS,CAAC,QAAQ,CAAC,CAAC;AA2B1C,MAAM,UAAU,cAAc,CAAC,EAAa;IAC1C,IAAI,EAAE,KAAK,SAAS,EAAE,CAAC;QACrB,OAAO,EAAE,CAAC;IACZ,CAAC;IACD,OAAO,KAAK,EAAE,IAAc,EAAE,EAAE;QAC9B,IAAI,CAAC;YACH,MAAM,EAAE,MAAM,EAAE,GAAG,MAAM,aAAa,CAAC,IAAI,EAAE,IAAI,EAAE,EAAE,OAAO,EAAE,MAAM,EAAE,CAAC,CAAC;YACxE,OAAO,EAA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AAC;QACF,IAAI,CAAC,UAAU,EAAE,EAAE,EAAE,CAAC;YACpB,OAAO;QACT,CAAC;QACD,MAAM,IAAI,CAAC,WAAW,CACpB,qBAAqB,kBAAkB,CAAC,OAAO,CAAC,cAAc,EAC9D,MAAM,EACN,EAAE,UAAU,EAAE,EAAE,EAAE,EAAE,UAAU,CAAC,EAAE,EAAE,EAAE,CACtC,CAAC;IACJ,CAAC;IAED,KAAK,CAAC,UAAU,CAAC,OAAe,EAAE,OAAe;QAC/C,MAAM,IAAI,CAAC,WAAW,CACpB,qBAAqB,kBAAkB,CAAC,OAAO,CAAC,UAAU,EAC1D,MAAM,EACN,EAAE,IAAI,EAAE,OAAO,EAAE,CAClB,CAAC;IACJ,CAAC;CACF;AAED,kBAAkB;AAClB,MAAM,UAAU,kBAAkB,CAChC,MAAsC,EACtC,QAAmB,EACnB,UAAuB;IAEvB,IAAI,CAAC,MAAM,EAAE,CAAC;QAAA,OAAO,SAAS,CAAC;IAAA,CAAC;IAChC,IAAI,MAAM,CAAC,OAAO,KAAK,KAAK,EAAE,CAAC;QAAA,OAAO,SAAS,CAAC;IAAA,CAAC;IACjD,QAAQ,MAAM,CAAC,IAAI,EAAE,CAAC;QACpB,KAAK,QAAQ;YACX,OAAO,IAAI,kBAAkB,CAAC,MAAM,CAAC,MAAM,IAAI,EAAE,EAAE,QAAQ,CAAC,CAAC;QAC/D,KAAK,QAAQ;YACX,OAAO,IAAI,kBAAkB,CAAC,MAAM,CAAC,MAAM,IAAI,EAAE,EAAE,UAAU,CAAC,CAAC;QACjE,KAAK,MAAM;YACT,OAAO,IAAI,gBAAgB,CAAC,MAAM,CAAC,MAAM,IAAI,EAAE,EAAE,UAAU,CAAC,CAAC;QAC/D;YACE,OAAO,SAAS,CAAC;IACrB,CAAC;AACH,CAAC"}
|
|
@@ -21,12 +21,16 @@ export interface MergeServicePort {
|
|
|
21
21
|
export declare class MergeService {
|
|
22
22
|
private readonly port;
|
|
23
23
|
constructor(port: MergeServicePort);
|
|
24
|
+
private cleanupMergedFeatureArtifacts;
|
|
25
|
+
private scheduleFeatureCleanup;
|
|
24
26
|
featureReadyToMerge(featureId: string, commitMessage: string, mergeStrategy: string, userApprovalToken: string | null): Promise<{
|
|
25
27
|
data: {
|
|
26
28
|
feature_id: string;
|
|
27
29
|
merge_sha: string;
|
|
28
30
|
merge_strategy: string;
|
|
29
31
|
status: string;
|
|
32
|
+
retained_for_cleanup?: boolean;
|
|
33
|
+
cleanup_grace_period_seconds?: number;
|
|
30
34
|
};
|
|
31
35
|
}>;
|
|
32
36
|
}
|
|
@@ -4,6 +4,7 @@ import { runGit } from '../../core/git.js';
|
|
|
4
4
|
import { ERROR_CODES } from '../../core/error-codes.js';
|
|
5
5
|
import { fail } from '../../core/response.js';
|
|
6
6
|
import { GATE_RESULT, STATUS } from '../../core/constants.js';
|
|
7
|
+
import { resolveDepBlocked } from './dependency-scheduler-service.js';
|
|
7
8
|
function normalizeSet(array) {
|
|
8
9
|
return [...new Set(array)].sort((a, b) => a.localeCompare(b));
|
|
9
10
|
}
|
|
@@ -23,6 +24,32 @@ export class MergeService {
|
|
|
23
24
|
constructor(port) {
|
|
24
25
|
this.port = port;
|
|
25
26
|
}
|
|
27
|
+
async cleanupMergedFeatureArtifacts(featureId) {
|
|
28
|
+
const repoRoot = this.port.getRepoRoot();
|
|
29
|
+
const worktreePath = this.port.worktreePath(featureId);
|
|
30
|
+
const removeWorktreeResult = await runGit(repoRoot, ['worktree', 'remove', '--force', worktreePath]);
|
|
31
|
+
if (removeWorktreeResult.code !== 0) {
|
|
32
|
+
// Best-effort cleanup; merged state must remain intact even if git cleanup fails.
|
|
33
|
+
console.warn(`[aop] auto-cleanup worktree removal failed for ${featureId}: ${removeWorktreeResult.stderr.trim() || `exit ${removeWorktreeResult.code}`}`);
|
|
34
|
+
}
|
|
35
|
+
const removeBranchResult = await runGit(repoRoot, ['branch', '-D', featureId]);
|
|
36
|
+
if (removeBranchResult.code !== 0) {
|
|
37
|
+
// Best-effort cleanup; branch may already be removed.
|
|
38
|
+
console.warn(`[aop] auto-cleanup branch removal failed for ${featureId}: ${removeBranchResult.stderr.trim() || `exit ${removeBranchResult.code}`}`);
|
|
39
|
+
}
|
|
40
|
+
await fs.rm(this.port.featurePath(featureId), { recursive: true, force: true });
|
|
41
|
+
}
|
|
42
|
+
scheduleFeatureCleanup(featureId, gracePeriodSeconds) {
|
|
43
|
+
const delayMs = Math.max(0, Math.floor(gracePeriodSeconds * 1000));
|
|
44
|
+
const timeout = setTimeout(() => {
|
|
45
|
+
void this.cleanupMergedFeatureArtifacts(featureId).catch((error) => {
|
|
46
|
+
console.warn(`[aop] auto-cleanup failed for ${featureId}: ${error instanceof Error ? error.message : String(error)}`);
|
|
47
|
+
});
|
|
48
|
+
}, delayMs);
|
|
49
|
+
if (typeof timeout.unref === 'function') {
|
|
50
|
+
timeout.unref();
|
|
51
|
+
}
|
|
52
|
+
}
|
|
26
53
|
async featureReadyToMerge(featureId, commitMessage, mergeStrategy, userApprovalToken) {
|
|
27
54
|
const policy = this.port.getPolicySnapshot();
|
|
28
55
|
const state = await this.port.readState(featureId);
|
|
@@ -176,17 +203,32 @@ export class MergeService {
|
|
|
176
203
|
}
|
|
177
204
|
runtimeSessions.feature_sessions = featureSessions;
|
|
178
205
|
index.runtime_sessions = runtimeSessions;
|
|
206
|
+
// N4: Promote features that were blocked waiting for this feature to merge
|
|
207
|
+
resolveDepBlocked(index, featureId);
|
|
179
208
|
index.version += 1;
|
|
180
209
|
index.updated_at = nowIso();
|
|
181
210
|
await this.port.writeIndex(index);
|
|
182
211
|
});
|
|
183
|
-
|
|
212
|
+
const cleanupPolicy = asRecord(policy.cleanup);
|
|
213
|
+
const autoAfterMerge = cleanupPolicy.auto_after_merge === true;
|
|
214
|
+
const gracePeriodSeconds = typeof cleanupPolicy.grace_period_seconds === 'number' && Number.isFinite(cleanupPolicy.grace_period_seconds)
|
|
215
|
+
? cleanupPolicy.grace_period_seconds
|
|
216
|
+
: 3600;
|
|
217
|
+
const shouldCleanupNow = autoAfterMerge && gracePeriodSeconds <= 0;
|
|
218
|
+
if (shouldCleanupNow) {
|
|
219
|
+
await this.cleanupMergedFeatureArtifacts(featureId);
|
|
220
|
+
}
|
|
221
|
+
else if (autoAfterMerge) {
|
|
222
|
+
this.scheduleFeatureCleanup(featureId, gracePeriodSeconds);
|
|
223
|
+
}
|
|
184
224
|
return {
|
|
185
225
|
data: {
|
|
186
226
|
feature_id: featureId,
|
|
187
227
|
merge_sha: mergeSha,
|
|
188
228
|
merge_strategy: mergeStrategy,
|
|
189
|
-
status: STATUS.MERGED
|
|
229
|
+
status: STATUS.MERGED,
|
|
230
|
+
retained_for_cleanup: !shouldCleanupNow,
|
|
231
|
+
cleanup_grace_period_seconds: gracePeriodSeconds
|
|
190
232
|
}
|
|
191
233
|
};
|
|
192
234
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"merge-service.js","sourceRoot":"","sources":["../../../../../apps/control-plane/src/application/services/merge-service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAClC,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAC1C,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAC3C,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AACxD,OAAO,EAAE,IAAI,EAAE,MAAM,wBAAwB,CAAC;AAC9C,OAAO,EAAE,WAAW,EAAE,MAAM,EAAE,MAAM,yBAAyB,CAAC;
|
|
1
|
+
{"version":3,"file":"merge-service.js","sourceRoot":"","sources":["../../../../../apps/control-plane/src/application/services/merge-service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAClC,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAC1C,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAC3C,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,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SACF,CAAC;IACJ,CAAC;CACF"}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
export type NotificationPriority = 'critical' | 'warning' | 'info';
|
|
2
|
+
export type NotificationEvent = 'gate_failed' | 'collision_detected' | 'feature_blocked' | 'ready_to_merge' | 'feature_merged' | 'stale_lease' | 'agent_stuck' | 'changes_requested' | 'budget_exceeded' | 'budget_alert';
|
|
3
|
+
export interface NotificationPayload {
|
|
4
|
+
event: NotificationEvent;
|
|
5
|
+
priority: NotificationPriority;
|
|
6
|
+
feature_id?: string;
|
|
7
|
+
message: string;
|
|
8
|
+
details?: Record<string, unknown>;
|
|
9
|
+
timestamp: string;
|
|
10
|
+
}
|
|
11
|
+
export interface NotifierChannel {
|
|
12
|
+
name: string;
|
|
13
|
+
send(payload: NotificationPayload): Promise<void>;
|
|
14
|
+
}
|
|
15
|
+
export interface NotificationChannelConfig {
|
|
16
|
+
desktop?: {
|
|
17
|
+
enabled?: boolean;
|
|
18
|
+
};
|
|
19
|
+
slack?: {
|
|
20
|
+
enabled?: boolean;
|
|
21
|
+
webhook?: string;
|
|
22
|
+
channel?: string;
|
|
23
|
+
};
|
|
24
|
+
webhook?: {
|
|
25
|
+
enabled?: boolean;
|
|
26
|
+
url?: string;
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
export interface NotificationRoutingConfig {
|
|
30
|
+
critical?: string[];
|
|
31
|
+
warning?: string[];
|
|
32
|
+
info?: string[];
|
|
33
|
+
urgent?: string[];
|
|
34
|
+
action?: string[];
|
|
35
|
+
}
|
|
36
|
+
export interface NotificationConfig {
|
|
37
|
+
enabled: boolean;
|
|
38
|
+
channels?: NotificationChannelConfig;
|
|
39
|
+
routing?: NotificationRoutingConfig;
|
|
40
|
+
}
|
|
41
|
+
export declare class DesktopNotifierChannel implements NotifierChannel {
|
|
42
|
+
readonly name = "desktop";
|
|
43
|
+
send(payload: NotificationPayload): Promise<void>;
|
|
44
|
+
}
|
|
45
|
+
export declare class SlackNotifierChannel implements NotifierChannel {
|
|
46
|
+
readonly name = "slack";
|
|
47
|
+
private readonly webhookUrl;
|
|
48
|
+
private readonly channel;
|
|
49
|
+
constructor(webhookUrl: string, channel: string);
|
|
50
|
+
send(payload: NotificationPayload): Promise<void>;
|
|
51
|
+
}
|
|
52
|
+
export declare class WebhookNotifierChannel implements NotifierChannel {
|
|
53
|
+
readonly name = "webhook";
|
|
54
|
+
private readonly url;
|
|
55
|
+
constructor(url: string);
|
|
56
|
+
send(payload: NotificationPayload): Promise<void>;
|
|
57
|
+
}
|
|
58
|
+
export declare class NotifierService {
|
|
59
|
+
private readonly config;
|
|
60
|
+
private readonly channels;
|
|
61
|
+
private readonly routing;
|
|
62
|
+
private readonly throttleCache;
|
|
63
|
+
private readonly dashboardUrl;
|
|
64
|
+
constructor(config: NotificationConfig, dashboardUrl?: string | null);
|
|
65
|
+
private buildRouting;
|
|
66
|
+
private buildChannels;
|
|
67
|
+
private isThrottled;
|
|
68
|
+
notify(event: NotificationEvent, context: {
|
|
69
|
+
feature_id?: string;
|
|
70
|
+
message: string;
|
|
71
|
+
details?: Record<string, unknown>;
|
|
72
|
+
}): Promise<void>;
|
|
73
|
+
}
|
|
74
|
+
export declare function createNotifierService(policySnapshot: Record<string, unknown>, preferredChannel?: string | null): NotifierService;
|