agentic-orchestrator 0.1.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/.dockerignore +24 -0
- package/.github/workflows/mcp-contract-validation.yml +38 -0
- package/Agentic-Orchestrator.iml +9 -0
- package/LICENSE +21 -0
- package/README.md +679 -0
- package/agentic/orchestrator/agents.yaml +14 -0
- package/agentic/orchestrator/gates.yaml +31 -0
- package/agentic/orchestrator/policy.yaml +145 -0
- package/agentic/orchestrator/prompts/builder.system.md +1 -0
- package/agentic/orchestrator/prompts/planner.system.md +15 -0
- package/agentic/orchestrator/prompts/qa.system.md +1 -0
- package/agentic/orchestrator/schemas/agents.schema.json +49 -0
- package/agentic/orchestrator/schemas/gates.schema.json +65 -0
- package/agentic/orchestrator/schemas/index.schema.json +108 -0
- package/agentic/orchestrator/schemas/plan.schema.json +127 -0
- package/agentic/orchestrator/schemas/policy.schema.json +227 -0
- package/agentic/orchestrator/schemas/qa_test_index.schema.json +53 -0
- package/agentic/orchestrator/schemas/state.schema.json +92 -0
- package/agentic/orchestrator/tools/catalog.json +399 -0
- package/agentic/orchestrator/tools/errors.schema.json +21 -0
- package/agentic/orchestrator/tools/protocol.json +8 -0
- package/agentic/orchestrator/tools/schemas/input/collisions.scan.input.schema.json +7 -0
- package/agentic/orchestrator/tools/schemas/input/evidence.latest.input.schema.json +15 -0
- package/agentic/orchestrator/tools/schemas/input/feature.delete.input.schema.json +42 -0
- package/agentic/orchestrator/tools/schemas/input/feature.discover_specs.input.schema.json +7 -0
- package/agentic/orchestrator/tools/schemas/input/feature.get_context.input.schema.json +15 -0
- package/agentic/orchestrator/tools/schemas/input/feature.init.input.schema.json +21 -0
- package/agentic/orchestrator/tools/schemas/input/feature.log_append.input.schema.json +26 -0
- package/agentic/orchestrator/tools/schemas/input/feature.ready_to_merge.input.schema.json +34 -0
- package/agentic/orchestrator/tools/schemas/input/feature.state_get.input.schema.json +15 -0
- package/agentic/orchestrator/tools/schemas/input/feature.state_patch.input.schema.json +28 -0
- package/agentic/orchestrator/tools/schemas/input/gates.list.input.schema.json +11 -0
- package/agentic/orchestrator/tools/schemas/input/gates.run.input.schema.json +29 -0
- package/agentic/orchestrator/tools/schemas/input/locks.acquire.input.schema.json +29 -0
- package/agentic/orchestrator/tools/schemas/input/locks.release.input.schema.json +26 -0
- package/agentic/orchestrator/tools/schemas/input/mutating.schema.json +14 -0
- package/agentic/orchestrator/tools/schemas/input/plan.get.input.schema.json +15 -0
- package/agentic/orchestrator/tools/schemas/input/plan.submit.input.schema.json +28 -0
- package/agentic/orchestrator/tools/schemas/input/plan.update.input.schema.json +29 -0
- package/agentic/orchestrator/tools/schemas/input/qa.test_index_get.input.schema.json +15 -0
- package/agentic/orchestrator/tools/schemas/input/qa.test_index_update.input.schema.json +38 -0
- package/agentic/orchestrator/tools/schemas/input/read.schema.json +6 -0
- package/agentic/orchestrator/tools/schemas/input/repo.apply_patch.input.schema.json +25 -0
- package/agentic/orchestrator/tools/schemas/input/repo.diff.input.schema.json +21 -0
- package/agentic/orchestrator/tools/schemas/input/repo.diff_bundle.input.schema.json +15 -0
- package/agentic/orchestrator/tools/schemas/input/repo.ensure_worktree.input.schema.json +21 -0
- package/agentic/orchestrator/tools/schemas/input/repo.read_file.input.schema.json +20 -0
- package/agentic/orchestrator/tools/schemas/input/repo.search.input.schema.json +20 -0
- package/agentic/orchestrator/tools/schemas/input/repo.status.input.schema.json +15 -0
- package/agentic/orchestrator/tools/schemas/input/report.dashboard.input.schema.json +7 -0
- package/agentic/orchestrator/tools/schemas/input/report.feature_summary.input.schema.json +15 -0
- package/agentic/orchestrator/tools/schemas/output/collisions.scan.output.schema.json +17 -0
- package/agentic/orchestrator/tools/schemas/output/evidence.latest.output.schema.json +20 -0
- package/agentic/orchestrator/tools/schemas/output/feature.delete.output.schema.json +224 -0
- package/agentic/orchestrator/tools/schemas/output/feature.discover_specs.output.schema.json +32 -0
- package/agentic/orchestrator/tools/schemas/output/feature.get_context.output.schema.json +40 -0
- package/agentic/orchestrator/tools/schemas/output/feature.init.output.schema.json +24 -0
- package/agentic/orchestrator/tools/schemas/output/feature.log_append.output.schema.json +24 -0
- package/agentic/orchestrator/tools/schemas/output/feature.ready_to_merge.output.schema.json +30 -0
- package/agentic/orchestrator/tools/schemas/output/feature.state_get.output.schema.json +18 -0
- package/agentic/orchestrator/tools/schemas/output/feature.state_patch.output.schema.json +24 -0
- package/agentic/orchestrator/tools/schemas/output/gates.list.output.schema.json +42 -0
- package/agentic/orchestrator/tools/schemas/output/gates.run.output.schema.json +37 -0
- package/agentic/orchestrator/tools/schemas/output/locks.acquire.output.schema.json +34 -0
- package/agentic/orchestrator/tools/schemas/output/locks.release.output.schema.json +24 -0
- package/agentic/orchestrator/tools/schemas/output/plan.get.output.schema.json +26 -0
- package/agentic/orchestrator/tools/schemas/output/plan.submit.output.schema.json +23 -0
- package/agentic/orchestrator/tools/schemas/output/plan.update.output.schema.json +23 -0
- package/agentic/orchestrator/tools/schemas/output/qa.test_index_get.output.schema.json +22 -0
- package/agentic/orchestrator/tools/schemas/output/qa.test_index_update.output.schema.json +19 -0
- package/agentic/orchestrator/tools/schemas/output/repo.apply_patch.output.schema.json +33 -0
- package/agentic/orchestrator/tools/schemas/output/repo.diff.output.schema.json +19 -0
- package/agentic/orchestrator/tools/schemas/output/repo.diff_bundle.output.schema.json +32 -0
- package/agentic/orchestrator/tools/schemas/output/repo.ensure_worktree.output.schema.json +29 -0
- package/agentic/orchestrator/tools/schemas/output/repo.read_file.output.schema.json +24 -0
- package/agentic/orchestrator/tools/schemas/output/repo.search.output.schema.json +26 -0
- package/agentic/orchestrator/tools/schemas/output/repo.status.output.schema.json +27 -0
- package/agentic/orchestrator/tools/schemas/output/report.dashboard.output.schema.json +21 -0
- package/agentic/orchestrator/tools/schemas/output/report.feature_summary.output.schema.json +36 -0
- package/agentic/orchestrator/tools/schemas/output/standard_success.schema.json +6 -0
- package/agentic/orchestrator/tools.md +32 -0
- package/apps/control-plane/project.json +39 -0
- package/apps/control-plane/scripts/validate-architecture-rules.mjs +170 -0
- package/apps/control-plane/scripts/validate-docker-mcp-contract.mjs +84 -0
- package/apps/control-plane/scripts/validate-mcp-contracts.ts +61 -0
- package/apps/control-plane/src/application/services/collision-queue-service.ts +227 -0
- package/apps/control-plane/src/application/services/feature-deletion-service.ts +459 -0
- package/apps/control-plane/src/application/services/feature-lifecycle-service.ts +177 -0
- package/apps/control-plane/src/application/services/feature-state-service.ts +125 -0
- package/apps/control-plane/src/application/services/gate-service.ts +232 -0
- package/apps/control-plane/src/application/services/lock-service.ts +298 -0
- package/apps/control-plane/src/application/services/merge-service.ts +246 -0
- package/apps/control-plane/src/application/services/patch-service.ts +259 -0
- package/apps/control-plane/src/application/services/plan-service.ts +302 -0
- package/apps/control-plane/src/application/services/qa-index-service.ts +98 -0
- package/apps/control-plane/src/application/services/reporting-service.ts +120 -0
- package/apps/control-plane/src/application/services/run-lease-service.ts +340 -0
- package/apps/control-plane/src/application/tools/tool-metadata.ts +56 -0
- package/apps/control-plane/src/application/tools/tool-router.ts +43 -0
- package/apps/control-plane/src/cli/aop.ts +31 -0
- package/apps/control-plane/src/cli/cli-argument-parser.ts +116 -0
- package/apps/control-plane/src/cli/delete-command-handler.ts +90 -0
- package/apps/control-plane/src/cli/io.ts +14 -0
- package/apps/control-plane/src/cli/resume-command-handler.ts +228 -0
- package/apps/control-plane/src/cli/run-command-handler.ts +57 -0
- package/apps/control-plane/src/cli/spec-ingestion-service.ts +88 -0
- package/apps/control-plane/src/cli/spec-input-resolver.ts +95 -0
- package/apps/control-plane/src/cli/spec-utils.ts +40 -0
- package/apps/control-plane/src/cli/status-command-handler.ts +17 -0
- package/apps/control-plane/src/cli/stop-command-handler.ts +5 -0
- package/apps/control-plane/src/cli/tooling.ts +36 -0
- package/apps/control-plane/src/cli/types.ts +34 -0
- package/apps/control-plane/src/core/collisions.ts +121 -0
- package/apps/control-plane/src/core/constants.ts +72 -0
- package/apps/control-plane/src/core/error-codes.ts +54 -0
- package/apps/control-plane/src/core/frontmatter.ts +42 -0
- package/apps/control-plane/src/core/fs.ts +173 -0
- package/apps/control-plane/src/core/gates.ts +361 -0
- package/apps/control-plane/src/core/git.ts +115 -0
- package/apps/control-plane/src/core/kernel.ts +1077 -0
- package/apps/control-plane/src/core/patch.ts +152 -0
- package/apps/control-plane/src/core/path-layout.ts +113 -0
- package/apps/control-plane/src/core/path-rules.ts +71 -0
- package/apps/control-plane/src/core/qa-index.ts +179 -0
- package/apps/control-plane/src/core/response.ts +62 -0
- package/apps/control-plane/src/core/runtime-sessions.ts +20 -0
- package/apps/control-plane/src/core/schemas.ts +125 -0
- package/apps/control-plane/src/index.ts +21 -0
- package/apps/control-plane/src/interfaces/cli/bootstrap.ts +100 -0
- package/apps/control-plane/src/mcp/kernel-tool-executor.ts +39 -0
- package/apps/control-plane/src/mcp/mcp-server-adapter.ts +74 -0
- package/apps/control-plane/src/mcp/operation-ledger.ts +108 -0
- package/apps/control-plane/src/mcp/protocol-contract.ts +9 -0
- package/apps/control-plane/src/mcp/runtime-factory.ts +105 -0
- package/apps/control-plane/src/mcp/runtime-types.ts +44 -0
- package/apps/control-plane/src/mcp/token-auth-verifier.ts +63 -0
- package/apps/control-plane/src/mcp/token-claims-validator.ts +72 -0
- package/apps/control-plane/src/mcp/token-codec.ts +62 -0
- package/apps/control-plane/src/mcp/tool-authorizer.ts +43 -0
- package/apps/control-plane/src/mcp/tool-client.ts +78 -0
- package/apps/control-plane/src/mcp/tool-contract-validator.ts +83 -0
- package/apps/control-plane/src/mcp/tool-registry-loader.ts +135 -0
- package/apps/control-plane/src/mcp/tool-runtime.ts +336 -0
- package/apps/control-plane/src/mcp/tools-markdown-generator.ts +26 -0
- package/apps/control-plane/src/mcp/transport-types.ts +16 -0
- package/apps/control-plane/src/mcp/types.ts +2 -0
- package/apps/control-plane/src/providers/providers.ts +177 -0
- package/apps/control-plane/src/supervisor/build-wave-executor.ts +55 -0
- package/apps/control-plane/src/supervisor/lease-heartbeat-service.ts +22 -0
- package/apps/control-plane/src/supervisor/planning-wave-executor.ts +316 -0
- package/apps/control-plane/src/supervisor/prompt-bundle-loader.ts +62 -0
- package/apps/control-plane/src/supervisor/qa-wave-executor.ts +99 -0
- package/apps/control-plane/src/supervisor/run-coordinator.ts +224 -0
- package/apps/control-plane/src/supervisor/runtime.ts +347 -0
- package/apps/control-plane/src/supervisor/session-orchestrator.ts +268 -0
- package/apps/control-plane/src/supervisor/types.ts +149 -0
- package/apps/control-plane/src/supervisor/worker-decision-loop.ts +299 -0
- package/apps/control-plane/test/aop.spec.ts +101 -0
- package/apps/control-plane/test/cli-helpers.spec.ts +102 -0
- package/apps/control-plane/test/cli.spec.ts +12 -0
- package/apps/control-plane/test/cli.unit.spec.ts +609 -0
- package/apps/control-plane/test/collision-queue.spec.ts +158 -0
- package/apps/control-plane/test/collisions.spec.ts +138 -0
- package/apps/control-plane/test/core-utils.spec.ts +102 -0
- package/apps/control-plane/test/delete-command-handler.spec.ts +202 -0
- package/apps/control-plane/test/epoch-tracking.spec.ts +121 -0
- package/apps/control-plane/test/gates.spec.ts +452 -0
- package/apps/control-plane/test/helpers.ts +68 -0
- package/apps/control-plane/test/index.spec.ts +18 -0
- package/apps/control-plane/test/kernel-collision-replay.spec.ts +222 -0
- package/apps/control-plane/test/kernel.branches.spec.ts +321 -0
- package/apps/control-plane/test/kernel.coverage.spec.ts +408 -0
- package/apps/control-plane/test/kernel.spec.ts +369 -0
- package/apps/control-plane/test/mcp-helpers.spec.ts +195 -0
- package/apps/control-plane/test/mcp.spec.ts +776 -0
- package/apps/control-plane/test/merge-service.spec.ts +357 -0
- package/apps/control-plane/test/plan-service.spec.ts +195 -0
- package/apps/control-plane/test/planning-wave-executor.spec.ts +229 -0
- package/apps/control-plane/test/providers.spec.ts +168 -0
- package/apps/control-plane/test/qa-index-service.spec.ts +187 -0
- package/apps/control-plane/test/qa-index.spec.ts +317 -0
- package/apps/control-plane/test/response.spec.ts +55 -0
- package/apps/control-plane/test/run-coordinator.spec.ts +334 -0
- package/apps/control-plane/test/schema-date-time.spec.ts +170 -0
- package/apps/control-plane/test/service-retry-paths.spec.ts +305 -0
- package/apps/control-plane/test/services.spec.ts +693 -0
- package/apps/control-plane/test/spec-input-resolver.spec.ts +76 -0
- package/apps/control-plane/test/supervisor-collaborators.spec.ts +201 -0
- package/apps/control-plane/test/supervisor.calltool.spec.ts +120 -0
- package/apps/control-plane/test/supervisor.spec.ts +415 -0
- package/apps/control-plane/test/supervisor.unit.spec.ts +522 -0
- package/apps/control-plane/test/token-auth-verifier.spec.ts +111 -0
- package/apps/control-plane/test/tool-registry-loader.spec.ts +268 -0
- package/apps/control-plane/test/tool-runtime.spec.ts +294 -0
- package/apps/control-plane/test/worker-decision-loop.spec.ts +587 -0
- package/apps/control-plane/tsconfig.build.json +17 -0
- package/apps/control-plane/tsconfig.json +11 -0
- package/apps/control-plane/vitest.config.ts +28 -0
- package/dist/apps/control-plane/application/services/collision-queue-service.d.ts +69 -0
- package/dist/apps/control-plane/application/services/collision-queue-service.js +158 -0
- package/dist/apps/control-plane/application/services/collision-queue-service.js.map +1 -0
- package/dist/apps/control-plane/application/services/feature-deletion-service.d.ts +79 -0
- package/dist/apps/control-plane/application/services/feature-deletion-service.js +336 -0
- package/dist/apps/control-plane/application/services/feature-deletion-service.js.map +1 -0
- package/dist/apps/control-plane/application/services/feature-lifecycle-service.d.ts +81 -0
- package/dist/apps/control-plane/application/services/feature-lifecycle-service.js +117 -0
- package/dist/apps/control-plane/application/services/feature-lifecycle-service.js.map +1 -0
- package/dist/apps/control-plane/application/services/feature-state-service.d.ts +34 -0
- package/dist/apps/control-plane/application/services/feature-state-service.js +90 -0
- package/dist/apps/control-plane/application/services/feature-state-service.js.map +1 -0
- package/dist/apps/control-plane/application/services/gate-service.d.ts +46 -0
- package/dist/apps/control-plane/application/services/gate-service.js +160 -0
- package/dist/apps/control-plane/application/services/gate-service.js.map +1 -0
- package/dist/apps/control-plane/application/services/lock-service.d.ts +56 -0
- package/dist/apps/control-plane/application/services/lock-service.js +242 -0
- package/dist/apps/control-plane/application/services/lock-service.js.map +1 -0
- package/dist/apps/control-plane/application/services/merge-service.d.ts +33 -0
- package/dist/apps/control-plane/application/services/merge-service.js +194 -0
- package/dist/apps/control-plane/application/services/merge-service.js.map +1 -0
- package/dist/apps/control-plane/application/services/patch-service.d.ts +39 -0
- package/dist/apps/control-plane/application/services/patch-service.js +189 -0
- package/dist/apps/control-plane/application/services/patch-service.js.map +1 -0
- package/dist/apps/control-plane/application/services/plan-service.d.ts +60 -0
- package/dist/apps/control-plane/application/services/plan-service.js +234 -0
- package/dist/apps/control-plane/application/services/plan-service.js.map +1 -0
- package/dist/apps/control-plane/application/services/qa-index-service.d.ts +26 -0
- package/dist/apps/control-plane/application/services/qa-index-service.js +66 -0
- package/dist/apps/control-plane/application/services/qa-index-service.js.map +1 -0
- package/dist/apps/control-plane/application/services/reporting-service.d.ts +47 -0
- package/dist/apps/control-plane/application/services/reporting-service.js +90 -0
- package/dist/apps/control-plane/application/services/reporting-service.js.map +1 -0
- package/dist/apps/control-plane/application/services/run-lease-service.d.ts +74 -0
- package/dist/apps/control-plane/application/services/run-lease-service.js +263 -0
- package/dist/apps/control-plane/application/services/run-lease-service.js.map +1 -0
- package/dist/apps/control-plane/application/tools/tool-metadata.d.ts +8 -0
- package/dist/apps/control-plane/application/tools/tool-metadata.js +37 -0
- package/dist/apps/control-plane/application/tools/tool-metadata.js.map +1 -0
- package/dist/apps/control-plane/application/tools/tool-router.d.ts +16 -0
- package/dist/apps/control-plane/application/tools/tool-router.js +25 -0
- package/dist/apps/control-plane/application/tools/tool-router.js.map +1 -0
- package/dist/apps/control-plane/cli/aop.d.ts +5 -0
- package/dist/apps/control-plane/cli/aop.js +19 -0
- package/dist/apps/control-plane/cli/aop.js.map +1 -0
- package/dist/apps/control-plane/cli/cli-argument-parser.d.ts +5 -0
- package/dist/apps/control-plane/cli/cli-argument-parser.js +109 -0
- package/dist/apps/control-plane/cli/cli-argument-parser.js.map +1 -0
- package/dist/apps/control-plane/cli/delete-command-handler.d.ts +8 -0
- package/dist/apps/control-plane/cli/delete-command-handler.js +77 -0
- package/dist/apps/control-plane/cli/delete-command-handler.js.map +1 -0
- package/dist/apps/control-plane/cli/io.d.ts +2 -0
- package/dist/apps/control-plane/cli/io.js +14 -0
- package/dist/apps/control-plane/cli/io.js.map +1 -0
- package/dist/apps/control-plane/cli/resume-command-handler.d.ts +17 -0
- package/dist/apps/control-plane/cli/resume-command-handler.js +178 -0
- package/dist/apps/control-plane/cli/resume-command-handler.js.map +1 -0
- package/dist/apps/control-plane/cli/run-command-handler.d.ts +15 -0
- package/dist/apps/control-plane/cli/run-command-handler.js +39 -0
- package/dist/apps/control-plane/cli/run-command-handler.js.map +1 -0
- package/dist/apps/control-plane/cli/spec-ingestion-service.d.ts +8 -0
- package/dist/apps/control-plane/cli/spec-ingestion-service.js +77 -0
- package/dist/apps/control-plane/cli/spec-ingestion-service.js.map +1 -0
- package/dist/apps/control-plane/cli/spec-input-resolver.d.ts +9 -0
- package/dist/apps/control-plane/cli/spec-input-resolver.js +81 -0
- package/dist/apps/control-plane/cli/spec-input-resolver.js.map +1 -0
- package/dist/apps/control-plane/cli/spec-utils.d.ts +3 -0
- package/dist/apps/control-plane/cli/spec-utils.js +36 -0
- package/dist/apps/control-plane/cli/spec-utils.js.map +1 -0
- package/dist/apps/control-plane/cli/status-command-handler.d.ts +7 -0
- package/dist/apps/control-plane/cli/status-command-handler.js +14 -0
- package/dist/apps/control-plane/cli/status-command-handler.js.map +1 -0
- package/dist/apps/control-plane/cli/stop-command-handler.d.ts +3 -0
- package/dist/apps/control-plane/cli/stop-command-handler.js +6 -0
- package/dist/apps/control-plane/cli/stop-command-handler.js.map +1 -0
- package/dist/apps/control-plane/cli/tooling.d.ts +4 -0
- package/dist/apps/control-plane/cli/tooling.js +24 -0
- package/dist/apps/control-plane/cli/tooling.js.map +1 -0
- package/dist/apps/control-plane/cli/types.d.ts +31 -0
- package/dist/apps/control-plane/cli/types.js +2 -0
- package/dist/apps/control-plane/cli/types.js.map +1 -0
- package/dist/apps/control-plane/core/collisions.d.ts +39 -0
- package/dist/apps/control-plane/core/collisions.js +78 -0
- package/dist/apps/control-plane/core/collisions.js.map +1 -0
- package/dist/apps/control-plane/core/constants.d.ts +64 -0
- package/dist/apps/control-plane/core/constants.js +64 -0
- package/dist/apps/control-plane/core/constants.js.map +1 -0
- package/dist/apps/control-plane/core/error-codes.d.ts +50 -0
- package/dist/apps/control-plane/core/error-codes.js +52 -0
- package/dist/apps/control-plane/core/error-codes.js.map +1 -0
- package/dist/apps/control-plane/core/frontmatter.d.ts +11 -0
- package/dist/apps/control-plane/core/frontmatter.js +30 -0
- package/dist/apps/control-plane/core/frontmatter.js.map +1 -0
- package/dist/apps/control-plane/core/fs.d.ts +33 -0
- package/dist/apps/control-plane/core/fs.js +134 -0
- package/dist/apps/control-plane/core/fs.js.map +1 -0
- package/dist/apps/control-plane/core/gates.d.ts +88 -0
- package/dist/apps/control-plane/core/gates.js +229 -0
- package/dist/apps/control-plane/core/gates.js.map +1 -0
- package/dist/apps/control-plane/core/git.d.ts +31 -0
- package/dist/apps/control-plane/core/git.js +79 -0
- package/dist/apps/control-plane/core/git.js.map +1 -0
- package/dist/apps/control-plane/core/kernel.d.ts +445 -0
- package/dist/apps/control-plane/core/kernel.js +805 -0
- package/dist/apps/control-plane/core/kernel.js.map +1 -0
- package/dist/apps/control-plane/core/patch.d.ts +23 -0
- package/dist/apps/control-plane/core/patch.js +118 -0
- package/dist/apps/control-plane/core/patch.js.map +1 -0
- package/dist/apps/control-plane/core/path-layout.d.ts +23 -0
- package/dist/apps/control-plane/core/path-layout.js +90 -0
- package/dist/apps/control-plane/core/path-layout.js.map +1 -0
- package/dist/apps/control-plane/core/path-rules.d.ts +13 -0
- package/dist/apps/control-plane/core/path-rules.js +52 -0
- package/dist/apps/control-plane/core/path-rules.js.map +1 -0
- package/dist/apps/control-plane/core/qa-index.d.ts +53 -0
- package/dist/apps/control-plane/core/qa-index.js +112 -0
- package/dist/apps/control-plane/core/qa-index.js.map +1 -0
- package/dist/apps/control-plane/core/response.d.ts +19 -0
- package/dist/apps/control-plane/core/response.js +34 -0
- package/dist/apps/control-plane/core/response.js.map +1 -0
- package/dist/apps/control-plane/core/runtime-sessions.d.ts +19 -0
- package/dist/apps/control-plane/core/runtime-sessions.js +2 -0
- package/dist/apps/control-plane/core/runtime-sessions.js.map +1 -0
- package/dist/apps/control-plane/core/schemas.d.ts +23 -0
- package/dist/apps/control-plane/core/schemas.js +80 -0
- package/dist/apps/control-plane/core/schemas.js.map +1 -0
- package/dist/apps/control-plane/index.d.ts +11 -0
- package/dist/apps/control-plane/index.js +9 -0
- package/dist/apps/control-plane/index.js.map +1 -0
- package/dist/apps/control-plane/interfaces/cli/bootstrap.d.ts +2 -0
- package/dist/apps/control-plane/interfaces/cli/bootstrap.js +86 -0
- package/dist/apps/control-plane/interfaces/cli/bootstrap.js.map +1 -0
- package/dist/apps/control-plane/mcp/kernel-tool-executor.d.ts +14 -0
- package/dist/apps/control-plane/mcp/kernel-tool-executor.js +26 -0
- package/dist/apps/control-plane/mcp/kernel-tool-executor.js.map +1 -0
- package/dist/apps/control-plane/mcp/mcp-server-adapter.d.ts +19 -0
- package/dist/apps/control-plane/mcp/mcp-server-adapter.js +55 -0
- package/dist/apps/control-plane/mcp/mcp-server-adapter.js.map +1 -0
- package/dist/apps/control-plane/mcp/operation-ledger.d.ts +21 -0
- package/dist/apps/control-plane/mcp/operation-ledger.js +75 -0
- package/dist/apps/control-plane/mcp/operation-ledger.js.map +1 -0
- package/dist/apps/control-plane/mcp/protocol-contract.d.ts +8 -0
- package/dist/apps/control-plane/mcp/protocol-contract.js +9 -0
- package/dist/apps/control-plane/mcp/protocol-contract.js.map +1 -0
- package/dist/apps/control-plane/mcp/runtime-factory.d.ts +38 -0
- package/dist/apps/control-plane/mcp/runtime-factory.js +71 -0
- package/dist/apps/control-plane/mcp/runtime-factory.js.map +1 -0
- package/dist/apps/control-plane/mcp/runtime-types.d.ts +40 -0
- package/dist/apps/control-plane/mcp/runtime-types.js +2 -0
- package/dist/apps/control-plane/mcp/runtime-types.js.map +1 -0
- package/dist/apps/control-plane/mcp/token-auth-verifier.d.ts +24 -0
- package/dist/apps/control-plane/mcp/token-auth-verifier.js +45 -0
- package/dist/apps/control-plane/mcp/token-auth-verifier.js.map +1 -0
- package/dist/apps/control-plane/mcp/token-claims-validator.d.ts +9 -0
- package/dist/apps/control-plane/mcp/token-claims-validator.js +62 -0
- package/dist/apps/control-plane/mcp/token-claims-validator.js.map +1 -0
- package/dist/apps/control-plane/mcp/token-codec.d.ts +11 -0
- package/dist/apps/control-plane/mcp/token-codec.js +46 -0
- package/dist/apps/control-plane/mcp/token-codec.js.map +1 -0
- package/dist/apps/control-plane/mcp/tool-authorizer.d.ts +8 -0
- package/dist/apps/control-plane/mcp/tool-authorizer.js +36 -0
- package/dist/apps/control-plane/mcp/tool-authorizer.js.map +1 -0
- package/dist/apps/control-plane/mcp/tool-client.d.ts +30 -0
- package/dist/apps/control-plane/mcp/tool-client.js +50 -0
- package/dist/apps/control-plane/mcp/tool-client.js.map +1 -0
- package/dist/apps/control-plane/mcp/tool-contract-validator.d.ts +29 -0
- package/dist/apps/control-plane/mcp/tool-contract-validator.js +61 -0
- package/dist/apps/control-plane/mcp/tool-contract-validator.js.map +1 -0
- package/dist/apps/control-plane/mcp/tool-registry-loader.d.ts +15 -0
- package/dist/apps/control-plane/mcp/tool-registry-loader.js +109 -0
- package/dist/apps/control-plane/mcp/tool-registry-loader.js.map +1 -0
- package/dist/apps/control-plane/mcp/tool-runtime.d.ts +34 -0
- package/dist/apps/control-plane/mcp/tool-runtime.js +252 -0
- package/dist/apps/control-plane/mcp/tool-runtime.js.map +1 -0
- package/dist/apps/control-plane/mcp/tools-markdown-generator.d.ts +7 -0
- package/dist/apps/control-plane/mcp/tools-markdown-generator.js +22 -0
- package/dist/apps/control-plane/mcp/tools-markdown-generator.js.map +1 -0
- package/dist/apps/control-plane/mcp/transport-types.d.ts +14 -0
- package/dist/apps/control-plane/mcp/transport-types.js +2 -0
- package/dist/apps/control-plane/mcp/transport-types.js.map +1 -0
- package/dist/apps/control-plane/mcp/types.d.ts +2 -0
- package/dist/apps/control-plane/mcp/types.js +3 -0
- package/dist/apps/control-plane/mcp/types.js.map +1 -0
- package/dist/apps/control-plane/providers/providers.d.ts +72 -0
- package/dist/apps/control-plane/providers/providers.js +94 -0
- package/dist/apps/control-plane/providers/providers.js.map +1 -0
- package/dist/apps/control-plane/supervisor/build-wave-executor.d.ts +13 -0
- package/dist/apps/control-plane/supervisor/build-wave-executor.js +40 -0
- package/dist/apps/control-plane/supervisor/build-wave-executor.js.map +1 -0
- package/dist/apps/control-plane/supervisor/lease-heartbeat-service.d.ts +12 -0
- package/dist/apps/control-plane/supervisor/lease-heartbeat-service.js +14 -0
- package/dist/apps/control-plane/supervisor/lease-heartbeat-service.js.map +1 -0
- package/dist/apps/control-plane/supervisor/planning-wave-executor.d.ts +19 -0
- package/dist/apps/control-plane/supervisor/planning-wave-executor.js +249 -0
- package/dist/apps/control-plane/supervisor/planning-wave-executor.js.map +1 -0
- package/dist/apps/control-plane/supervisor/prompt-bundle-loader.d.ts +9 -0
- package/dist/apps/control-plane/supervisor/prompt-bundle-loader.js +53 -0
- package/dist/apps/control-plane/supervisor/prompt-bundle-loader.js.map +1 -0
- package/dist/apps/control-plane/supervisor/qa-wave-executor.d.ts +24 -0
- package/dist/apps/control-plane/supervisor/qa-wave-executor.js +70 -0
- package/dist/apps/control-plane/supervisor/qa-wave-executor.js.map +1 -0
- package/dist/apps/control-plane/supervisor/run-coordinator.d.ts +49 -0
- package/dist/apps/control-plane/supervisor/run-coordinator.js +162 -0
- package/dist/apps/control-plane/supervisor/run-coordinator.js.map +1 -0
- package/dist/apps/control-plane/supervisor/runtime.d.ts +58 -0
- package/dist/apps/control-plane/supervisor/runtime.js +270 -0
- package/dist/apps/control-plane/supervisor/runtime.js.map +1 -0
- package/dist/apps/control-plane/supervisor/session-orchestrator.d.ts +29 -0
- package/dist/apps/control-plane/supervisor/session-orchestrator.js +211 -0
- package/dist/apps/control-plane/supervisor/session-orchestrator.js.map +1 -0
- package/dist/apps/control-plane/supervisor/types.d.ts +148 -0
- package/dist/apps/control-plane/supervisor/types.js +2 -0
- package/dist/apps/control-plane/supervisor/types.js.map +1 -0
- package/dist/apps/control-plane/supervisor/worker-decision-loop.d.ts +37 -0
- package/dist/apps/control-plane/supervisor/worker-decision-loop.js +236 -0
- package/dist/apps/control-plane/supervisor/worker-decision-loop.js.map +1 -0
- package/docker/mcp.Dockerfile +14 -0
- package/docker/mcp.compose.yaml +15 -0
- package/docker/mcp.entrypoint.sh +17 -0
- package/eslint.config.mjs +93 -0
- package/example-configurations/README.md +26 -0
- package/example-configurations/java/agents.yaml +14 -0
- package/example-configurations/java/gates.yaml +29 -0
- package/example-configurations/java/policy.yaml +148 -0
- package/example-configurations/node/agents.yaml +14 -0
- package/example-configurations/node/gates.yaml +32 -0
- package/example-configurations/node/policy.yaml +143 -0
- package/nx.json +16 -0
- package/package.json +39 -0
- package/prompts/vitest-testing-standards.instructions.md +204 -0
- package/scripts/dev-shell-env.sh +7 -0
- package/scripts/nx-safe.mjs +33 -0
- package/spec-files/agentic_orchestrator_cli_delete_command_spec.md +310 -0
- package/spec-files/agentic_orchestrator_dot_aop_generated_artifacts_spec.md +211 -0
- package/spec-files/agentic_orchestrator_mcp_formalization_spec.md +379 -0
- package/spec-files/agentic_orchestrator_oop_refactor_spec.md +415 -0
- package/spec-files/agentic_orchestrator_single_global_orchestrator_spec.md +265 -0
- package/spec-files/agentic_orchestrator_spec.md +1334 -0
- package/spec-files/progress.md +452 -0
- package/tsconfig.base.json +15 -0
- package/tsconfig.json +11 -0
|
@@ -0,0 +1,211 @@
|
|
|
1
|
+
# Feature Spec: Relocate Generated Runtime Artifacts to `.aop/` (AOP)
|
|
2
|
+
|
|
3
|
+
> **Purpose of this document**: Define an implementation-ready migration plan that moves runtime-generated AOP files out of `agentic/` and into a dedicated hidden runtime directory `.aop/`, while preserving deterministic MCP/Supervisor behavior and existing CLI/tool semantics.
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## 1. Objectives
|
|
8
|
+
|
|
9
|
+
### 1.1 Must-Have Outcomes
|
|
10
|
+
|
|
11
|
+
- Runtime-generated artifacts MUST be written under `.aop/` instead of `agentic/`.
|
|
12
|
+
- Deterministic orchestration guarantees MUST remain unchanged:
|
|
13
|
+
- schema validation
|
|
14
|
+
- optimistic concurrency/version checks
|
|
15
|
+
- lock/collision behavior
|
|
16
|
+
- gate/evidence behavior
|
|
17
|
+
- explicit merge control
|
|
18
|
+
- CLI workflows (`run`, `status`, `resume`, `stop`) MUST keep existing behavior and error envelopes.
|
|
19
|
+
- Existing repositories with generated files under `agentic/` MUST be supported through a deterministic migration/compatibility path.
|
|
20
|
+
- Path ownership MUST be explicit:
|
|
21
|
+
- source-managed orchestrator config stays in `agentic/orchestrator/`
|
|
22
|
+
- runtime-generated feature/runtime state moves to `.aop/`
|
|
23
|
+
|
|
24
|
+
### 1.2 Non-Goals
|
|
25
|
+
|
|
26
|
+
- No changes to tool names, role permissions, or gate policy semantics.
|
|
27
|
+
- No replacement of file-backed state with DB-backed persistence.
|
|
28
|
+
- No provider/session model changes.
|
|
29
|
+
|
|
30
|
+
---
|
|
31
|
+
|
|
32
|
+
## 2. Canonical Path Contract
|
|
33
|
+
|
|
34
|
+
### 2.1 Source-Managed (unchanged)
|
|
35
|
+
|
|
36
|
+
- `agentic/orchestrator/**` remains source-managed:
|
|
37
|
+
- `gates.yaml`, `policy.yaml`, `agents.yaml`
|
|
38
|
+
- `schemas/**`
|
|
39
|
+
- `tools/catalog.json`, `tools/protocol.json`, `tools/errors.schema.json`, `tools/schemas/**`
|
|
40
|
+
|
|
41
|
+
### 2.2 Runtime-Generated (new location)
|
|
42
|
+
|
|
43
|
+
- `.aop/features/index.json`
|
|
44
|
+
- `.aop/features/<feature_id>/spec.md` (canonical ingested spec copy)
|
|
45
|
+
- `.aop/features/<feature_id>/state.md`
|
|
46
|
+
- `.aop/features/<feature_id>/plan.json`
|
|
47
|
+
- `.aop/features/<feature_id>/qa_test_index.json`
|
|
48
|
+
- `.aop/features/<feature_id>/decisions.md`
|
|
49
|
+
- `.aop/features/<feature_id>/logs/**`
|
|
50
|
+
- `.aop/features/<feature_id>/evidence/**`
|
|
51
|
+
- `.aop/runtime/operation-ledger/<run_id>.json`
|
|
52
|
+
|
|
53
|
+
### 2.3 Discovery/Canonicalization Rules
|
|
54
|
+
|
|
55
|
+
- `feature.discover_specs` MUST discover canonical specs under `.aop/features/*/spec.md`.
|
|
56
|
+
- `aop run -fi/-fl` MUST ingest non-canonical input into `.aop/features/<feature_id>/spec.md`.
|
|
57
|
+
- Feature ID derivation rules (`.spec`, `-spec`, slug regex) MUST remain unchanged.
|
|
58
|
+
|
|
59
|
+
---
|
|
60
|
+
|
|
61
|
+
## 3. Architecture Decisions
|
|
62
|
+
|
|
63
|
+
### 3.1 Introduce a Single Runtime Path Authority
|
|
64
|
+
|
|
65
|
+
- Add a typed path-layout abstraction (for example `AopPathLayout`) used by CLI, kernel, services, and MCP runtime helpers.
|
|
66
|
+
- The abstraction MUST provide explicit getters for:
|
|
67
|
+
- source config roots (`agentic/orchestrator`)
|
|
68
|
+
- runtime data roots (`.aop/features`, `.aop/runtime`)
|
|
69
|
+
- per-feature generated files (`state.md`, `plan.json`, etc.)
|
|
70
|
+
|
|
71
|
+
### 3.2 Keep Schema/Policy Roots Stable
|
|
72
|
+
|
|
73
|
+
- Schema/policy/catalog load paths remain under `agentic/orchestrator/**`.
|
|
74
|
+
- Only generated runtime paths move to `.aop/**`.
|
|
75
|
+
|
|
76
|
+
### 3.3 Deterministic Compatibility Window
|
|
77
|
+
|
|
78
|
+
- Startup/runtime access MUST support deterministic migration from legacy `agentic/features/**` and `agentic/runtime/**`:
|
|
79
|
+
- if `.aop/**` exists, it is authoritative
|
|
80
|
+
- if `.aop/**` is absent and legacy exists, migrate/copy forward
|
|
81
|
+
- no destructive deletion during migration step
|
|
82
|
+
|
|
83
|
+
---
|
|
84
|
+
|
|
85
|
+
## 4. Required Code Changes
|
|
86
|
+
|
|
87
|
+
### 4.1 Core and Services
|
|
88
|
+
|
|
89
|
+
- Update runtime path ownership in:
|
|
90
|
+
- `apps/control-plane/src/core/kernel.ts`
|
|
91
|
+
- `apps/control-plane/src/application/services/feature-lifecycle-service.ts`
|
|
92
|
+
- `apps/control-plane/src/application/services/feature-state-service.ts`
|
|
93
|
+
- `apps/control-plane/src/application/services/plan-service.ts`
|
|
94
|
+
- `apps/control-plane/src/application/services/qa-index-service.ts`
|
|
95
|
+
- `apps/control-plane/src/application/services/gate-service.ts`
|
|
96
|
+
- `apps/control-plane/src/application/services/reporting-service.ts`
|
|
97
|
+
- `apps/control-plane/src/application/services/merge-service.ts`
|
|
98
|
+
- Ensure lock/index/state atomic-write paths now target `.aop/features/**`.
|
|
99
|
+
|
|
100
|
+
### 4.2 CLI and Spec Ingestion
|
|
101
|
+
|
|
102
|
+
- Update canonical spec detection/ingestion:
|
|
103
|
+
- `apps/control-plane/src/cli/spec-utils.ts`
|
|
104
|
+
- `apps/control-plane/src/cli/spec-input-resolver.ts`
|
|
105
|
+
- `apps/control-plane/src/cli/spec-ingestion-service.ts`
|
|
106
|
+
- CLI outputs and status payload paths MUST reference `.aop/**` canonical locations.
|
|
107
|
+
|
|
108
|
+
### 4.3 MCP Runtime Helpers
|
|
109
|
+
|
|
110
|
+
- Move operation ledger storage root from `agentic/runtime/operation-ledger` to `.aop/runtime/operation-ledger` in:
|
|
111
|
+
- `apps/control-plane/src/mcp/operation-ledger.ts`
|
|
112
|
+
|
|
113
|
+
### 4.4 Documentation and Ignore Rules
|
|
114
|
+
|
|
115
|
+
- Update `README.md` runtime path references from `agentic/features/**` to `.aop/features/**` where describing generated artifacts.
|
|
116
|
+
- Add `.aop/` to `.gitignore` (except intentional tracked placeholders if any).
|
|
117
|
+
|
|
118
|
+
---
|
|
119
|
+
|
|
120
|
+
## 5. Test Plan (Normative)
|
|
121
|
+
|
|
122
|
+
### 5.1 Unit/Integration Coverage Additions
|
|
123
|
+
|
|
124
|
+
- Add/adjust tests for:
|
|
125
|
+
- canonical path detection for `.aop/features/<id>/spec.md`
|
|
126
|
+
- non-canonical ingestion target path under `.aop/features/<id>/spec.md`
|
|
127
|
+
- `feature.discover_specs` returning `.aop/**` paths
|
|
128
|
+
- operation-ledger writes to `.aop/runtime/operation-ledger/**`
|
|
129
|
+
- state/index/QA/evidence paths under `.aop/features/**`
|
|
130
|
+
- legacy-to-`.aop` migration behavior and precedence
|
|
131
|
+
|
|
132
|
+
### 5.2 Regression Requirements
|
|
133
|
+
|
|
134
|
+
- Existing CLI contract tests for `run/status/resume/stop` MUST pass unchanged at envelope/exit-code level.
|
|
135
|
+
- Existing MCP transport parity tests MUST pass unchanged for success/failure semantics.
|
|
136
|
+
|
|
137
|
+
---
|
|
138
|
+
|
|
139
|
+
## 6. Implementation Milestones
|
|
140
|
+
|
|
141
|
+
### M19: Path Layout Foundation
|
|
142
|
+
|
|
143
|
+
- Introduce centralized path abstraction and wire kernel/service/CLI callsites to it.
|
|
144
|
+
|
|
145
|
+
### M20: Generated Artifact Relocation
|
|
146
|
+
|
|
147
|
+
- Move runtime-generated write paths to `.aop/features/**` and `.aop/runtime/**`.
|
|
148
|
+
- Keep orchestrator config/schema/tool contracts in `agentic/orchestrator/**`.
|
|
149
|
+
|
|
150
|
+
### M21: Compatibility + Migration
|
|
151
|
+
|
|
152
|
+
- Implement deterministic legacy detection and forward migration from `agentic/**` generated roots.
|
|
153
|
+
- Add explicit tests for precedence and no-data-loss behavior.
|
|
154
|
+
|
|
155
|
+
### M22: Contract/Docs/CI Hardening
|
|
156
|
+
|
|
157
|
+
- Update README/runtime docs and command examples.
|
|
158
|
+
- Ensure lint/typecheck/test/contract validation gates remain green.
|
|
159
|
+
|
|
160
|
+
---
|
|
161
|
+
|
|
162
|
+
## 7. File-Level Target List
|
|
163
|
+
|
|
164
|
+
- `apps/control-plane/src/core/kernel.ts`
|
|
165
|
+
- `apps/control-plane/src/core/schemas.ts` (no root move expected; verify unchanged orchestrator schema root)
|
|
166
|
+
- `apps/control-plane/src/cli/spec-utils.ts`
|
|
167
|
+
- `apps/control-plane/src/cli/spec-input-resolver.ts`
|
|
168
|
+
- `apps/control-plane/src/cli/spec-ingestion-service.ts`
|
|
169
|
+
- `apps/control-plane/src/application/services/feature-lifecycle-service.ts`
|
|
170
|
+
- `apps/control-plane/src/application/services/feature-state-service.ts`
|
|
171
|
+
- `apps/control-plane/src/application/services/plan-service.ts`
|
|
172
|
+
- `apps/control-plane/src/application/services/qa-index-service.ts`
|
|
173
|
+
- `apps/control-plane/src/application/services/gate-service.ts`
|
|
174
|
+
- `apps/control-plane/src/application/services/reporting-service.ts`
|
|
175
|
+
- `apps/control-plane/src/application/services/merge-service.ts`
|
|
176
|
+
- `apps/control-plane/src/mcp/operation-ledger.ts`
|
|
177
|
+
- `apps/control-plane/test/**/*.spec.ts` (path assertions and migration coverage)
|
|
178
|
+
- `README.md`
|
|
179
|
+
- `.gitignore`
|
|
180
|
+
|
|
181
|
+
---
|
|
182
|
+
|
|
183
|
+
## 8. Acceptance Criteria
|
|
184
|
+
|
|
185
|
+
1. New runs create/update runtime artifacts under `.aop/**` only.
|
|
186
|
+
2. No new runtime-generated files are written under `agentic/features/**` or `agentic/runtime/**`.
|
|
187
|
+
3. `feature.discover_specs` and CLI ingestion canonicalize to `.aop/features/<feature_id>/spec.md`.
|
|
188
|
+
4. Legacy repositories with prior `agentic/**` generated artifacts continue to run via deterministic migration/compatibility behavior.
|
|
189
|
+
5. CLI/MCP tool contracts, error envelopes, and deterministic orchestration semantics remain intact.
|
|
190
|
+
6. `npm run lint`, `npm run typecheck`, `npm test`, and `npm run validate:mcp-contracts` pass after migration changes.
|
|
191
|
+
|
|
192
|
+
---
|
|
193
|
+
|
|
194
|
+
## 9. Risks and Mitigations
|
|
195
|
+
|
|
196
|
+
- Risk: Partial path migration causes split state across `agentic/**` and `.aop/**`.
|
|
197
|
+
- Mitigation: single path authority abstraction + explicit precedence rules + migration tests.
|
|
198
|
+
- Risk: Existing automation/scripts rely on `agentic/features/**`.
|
|
199
|
+
- Mitigation: compatibility window, README migration notes, and deterministic fallback logic.
|
|
200
|
+
- Risk: Review workflows lose visibility if users are unaware of `.aop/**`.
|
|
201
|
+
- Mitigation: update README review instructions and CLI output paths.
|
|
202
|
+
|
|
203
|
+
---
|
|
204
|
+
|
|
205
|
+
## 10. Dependency Notes
|
|
206
|
+
|
|
207
|
+
- This spec extends and narrows file-layout behavior from:
|
|
208
|
+
- `spec-files/agentic_orchestrator_spec.md` (canonical state/runtime contracts)
|
|
209
|
+
- `spec-files/agentic_orchestrator_mcp_formalization_spec.md` (formal tool/runtime boundary)
|
|
210
|
+
- `spec-files/agentic_orchestrator_oop_refactor_spec.md` (path abstraction and layered responsibility discipline)
|
|
211
|
+
- Must also updatea progress.md filed `spec-files/progress.md` to reflect this new spec and its milestones as it is completed.
|
|
@@ -0,0 +1,379 @@
|
|
|
1
|
+
# Feature Spec: Formal MCP Tool Contracts and Transport Boundary Refactor (AOP)
|
|
2
|
+
|
|
3
|
+
> **Purpose of this document**: Define an implementation-ready refactor that converts the current code-first tool surface into formally declared MCP tools with enforced contracts, authenticated role identity, deterministic retries, and transport parity guarantees.
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## 1. Objectives
|
|
8
|
+
|
|
9
|
+
### 1.1 Must-Have Capabilities
|
|
10
|
+
|
|
11
|
+
- Define a single source of truth for each tool:
|
|
12
|
+
- `name`
|
|
13
|
+
- `description`
|
|
14
|
+
- `input_schema`
|
|
15
|
+
- `output_schema`
|
|
16
|
+
- supported roles
|
|
17
|
+
- bound handler
|
|
18
|
+
- Expose a real MCP server adapter that serves:
|
|
19
|
+
- `tools/list`
|
|
20
|
+
- `tools/call`
|
|
21
|
+
- Enforce authenticated role identity on every tool call.
|
|
22
|
+
- Preserve deterministic kernel guarantees:
|
|
23
|
+
- schema validation
|
|
24
|
+
- optimistic concurrency
|
|
25
|
+
- lock/collision enforcement
|
|
26
|
+
- gate/evidence behavior
|
|
27
|
+
- atomic state writes
|
|
28
|
+
- Enforce idempotency for mutating tool calls using operation keys.
|
|
29
|
+
- Provide transport-agnostic clients for CLI/Supervisor with parity tests.
|
|
30
|
+
- Eliminate documentation drift by generating `tools.md` from tool registry artifacts.
|
|
31
|
+
|
|
32
|
+
### 1.2 Non-Goals
|
|
33
|
+
|
|
34
|
+
- No rewrite of core domain behavior in `AopKernel` methods.
|
|
35
|
+
- No change to feature workflow semantics.
|
|
36
|
+
- No provider-specific logic embedded into MCP deterministic handlers.
|
|
37
|
+
|
|
38
|
+
---
|
|
39
|
+
|
|
40
|
+
## 2. Current Risks to Resolve
|
|
41
|
+
|
|
42
|
+
1. Tool contracts are implicit in code and docs, not formal runtime artifacts.
|
|
43
|
+
2. Role authorization is policy-based but caller identity trust model is unspecified for transport calls.
|
|
44
|
+
3. Retry safety is not formally defined at MCP boundary.
|
|
45
|
+
4. RBAC ownership is split (policy and code/docs), enabling drift.
|
|
46
|
+
5. Protocol compatibility is not pinned to an MCP SDK/protocol version.
|
|
47
|
+
|
|
48
|
+
---
|
|
49
|
+
|
|
50
|
+
## 3. Architecture Decisions
|
|
51
|
+
|
|
52
|
+
### 3.1 Tool Registry as Contract Source
|
|
53
|
+
|
|
54
|
+
All MCP tool metadata MUST be loaded from a registry artifact and not from handwritten switch statements.
|
|
55
|
+
|
|
56
|
+
### 3.2 Authenticated Identity Model
|
|
57
|
+
|
|
58
|
+
`actor_type` and `actor_id` are claims, not trusted caller inputs.
|
|
59
|
+
|
|
60
|
+
- MCP MUST accept a signed session token per tool call.
|
|
61
|
+
- MCP MUST derive actor claims from the token payload.
|
|
62
|
+
- Any supplied actor fields that conflict with token claims MUST fail.
|
|
63
|
+
- `system` role tokens MUST be bootstrap-only and unavailable to worker sessions.
|
|
64
|
+
|
|
65
|
+
### 3.3 RBAC Precedence Model
|
|
66
|
+
|
|
67
|
+
RBAC authority is two-level:
|
|
68
|
+
|
|
69
|
+
1. Tool registry declares `supported_roles` (maximum allowed by implementation).
|
|
70
|
+
2. `policy.yaml.rbac` declares runtime allowlist.
|
|
71
|
+
|
|
72
|
+
Effective permissions are the intersection. Startup MUST fail if policy grants a role not in `supported_roles`.
|
|
73
|
+
|
|
74
|
+
### 3.4 Idempotency Model for Mutations
|
|
75
|
+
|
|
76
|
+
All mutating tools MUST require `operation_id`.
|
|
77
|
+
|
|
78
|
+
- If an operation with same `operation_id` and same canonical input repeats, MCP returns cached prior result.
|
|
79
|
+
- If `operation_id` is reused with different input, MCP returns `operation_id_reuse_mismatch`.
|
|
80
|
+
- Operation result ledger MUST be durable.
|
|
81
|
+
|
|
82
|
+
### 3.5 Hybrid Transport Rollout
|
|
83
|
+
|
|
84
|
+
`ToolClient` abstraction is mandatory:
|
|
85
|
+
- `InProcessToolClient` for tests/fallback.
|
|
86
|
+
- `McpToolClient` for production path.
|
|
87
|
+
|
|
88
|
+
Production default switches to MCP transport only after parity acceptance gates pass.
|
|
89
|
+
|
|
90
|
+
---
|
|
91
|
+
|
|
92
|
+
## 4. Canonical Artifacts
|
|
93
|
+
|
|
94
|
+
```text
|
|
95
|
+
agentic/
|
|
96
|
+
orchestrator/
|
|
97
|
+
tools/
|
|
98
|
+
catalog.json
|
|
99
|
+
schemas/
|
|
100
|
+
input/
|
|
101
|
+
output/
|
|
102
|
+
errors.schema.json
|
|
103
|
+
protocol.json
|
|
104
|
+
runtime/
|
|
105
|
+
operation-ledger/
|
|
106
|
+
<run_id>.json
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
### 4.1 `catalog.json` Contract
|
|
110
|
+
|
|
111
|
+
Each tool entry MUST contain:
|
|
112
|
+
- `name`
|
|
113
|
+
- `description`
|
|
114
|
+
- `input_schema_ref`
|
|
115
|
+
- `output_schema_ref`
|
|
116
|
+
- `supported_roles`
|
|
117
|
+
- `handler_id`
|
|
118
|
+
- `mutating` (boolean)
|
|
119
|
+
- `requires_operation_id` (boolean; true when `mutating=true`)
|
|
120
|
+
|
|
121
|
+
### 4.2 `protocol.json` Contract
|
|
122
|
+
|
|
123
|
+
Must pin:
|
|
124
|
+
- MCP protocol version supported
|
|
125
|
+
- SDK package + version
|
|
126
|
+
- enabled transport modes (`stdio` required; others optional)
|
|
127
|
+
|
|
128
|
+
### 4.3 Error Envelope
|
|
129
|
+
|
|
130
|
+
All failures MUST return:
|
|
131
|
+
- `ok: false`
|
|
132
|
+
- `error.code`
|
|
133
|
+
- `error.message`
|
|
134
|
+
- `error.details`
|
|
135
|
+
- optional `evidence`
|
|
136
|
+
|
|
137
|
+
---
|
|
138
|
+
|
|
139
|
+
## 5. Runtime Components
|
|
140
|
+
|
|
141
|
+
1. `ToolRegistryLoader`
|
|
142
|
+
- loads registry
|
|
143
|
+
- validates uniqueness and schema refs
|
|
144
|
+
|
|
145
|
+
2. `ToolContractValidator`
|
|
146
|
+
- validates input pre-handler
|
|
147
|
+
- validates output post-handler
|
|
148
|
+
|
|
149
|
+
3. `TokenAuthVerifier`
|
|
150
|
+
- verifies signature and expiry
|
|
151
|
+
- extracts trusted actor claims
|
|
152
|
+
|
|
153
|
+
4. `ToolAuthorizer`
|
|
154
|
+
- applies intersection of registry roles and policy roles
|
|
155
|
+
|
|
156
|
+
5. `OperationLedger`
|
|
157
|
+
- writes and resolves idempotent operation outcomes for mutating calls
|
|
158
|
+
|
|
159
|
+
6. `KernelToolExecutor`
|
|
160
|
+
- maps `handler_id` to domain method call
|
|
161
|
+
- normalizes errors
|
|
162
|
+
|
|
163
|
+
7. `McpServerAdapter`
|
|
164
|
+
- implements protocol endpoints via registry/executor
|
|
165
|
+
|
|
166
|
+
---
|
|
167
|
+
|
|
168
|
+
## 6. Security and Identity Contract
|
|
169
|
+
|
|
170
|
+
### 6.1 Token Claims
|
|
171
|
+
|
|
172
|
+
Required claims:
|
|
173
|
+
- `run_id`
|
|
174
|
+
- `session_id`
|
|
175
|
+
- `actor_type`
|
|
176
|
+
- `actor_id`
|
|
177
|
+
- `issued_at`
|
|
178
|
+
- `expires_at`
|
|
179
|
+
|
|
180
|
+
Optional claims:
|
|
181
|
+
- `feature_scope` (for feature-limited workers)
|
|
182
|
+
|
|
183
|
+
### 6.2 Validation Rules
|
|
184
|
+
|
|
185
|
+
- expired token -> `unauthenticated`
|
|
186
|
+
- invalid signature -> `unauthenticated`
|
|
187
|
+
- actor claim mismatch -> `invalid_actor_claim`
|
|
188
|
+
- unauthorized role/tool -> `forbidden_tool_for_role`
|
|
189
|
+
|
|
190
|
+
### 6.3 Token Issuance
|
|
191
|
+
|
|
192
|
+
- Supervisor receives a run bootstrap credential at start.
|
|
193
|
+
- Supervisor issues/requests role-scoped session tokens for orchestrator/planner/builder/qa.
|
|
194
|
+
- Worker tokens MUST NOT carry `system` role.
|
|
195
|
+
|
|
196
|
+
---
|
|
197
|
+
|
|
198
|
+
## 7. Idempotency and Retry Contract
|
|
199
|
+
|
|
200
|
+
### 7.1 Mutating Tools
|
|
201
|
+
|
|
202
|
+
Mutating tools include at least:
|
|
203
|
+
- `feature.init`
|
|
204
|
+
- `feature.state_patch`
|
|
205
|
+
- `feature.log_append`
|
|
206
|
+
- `plan.submit`
|
|
207
|
+
- `plan.update`
|
|
208
|
+
- `repo.ensure_worktree`
|
|
209
|
+
- `repo.apply_patch`
|
|
210
|
+
- `gates.run`
|
|
211
|
+
- `qa.test_index_update`
|
|
212
|
+
- `locks.acquire`
|
|
213
|
+
- `locks.release`
|
|
214
|
+
- `feature.ready_to_merge`
|
|
215
|
+
|
|
216
|
+
### 7.2 Required Behavior
|
|
217
|
+
|
|
218
|
+
- all mutating requests include `operation_id`
|
|
219
|
+
- canonical request hash recorded with result
|
|
220
|
+
- duplicate identical request returns previous response
|
|
221
|
+
- duplicate mismatched request fails with stable error code
|
|
222
|
+
|
|
223
|
+
---
|
|
224
|
+
|
|
225
|
+
## 8. Protocol Compatibility and Versioning
|
|
226
|
+
|
|
227
|
+
### 8.1 Pinning Requirement
|
|
228
|
+
|
|
229
|
+
Implementation MUST pin and document:
|
|
230
|
+
- MCP protocol version
|
|
231
|
+
- SDK package/version
|
|
232
|
+
- transport implementation details
|
|
233
|
+
|
|
234
|
+
### 8.2 Compatibility Policy
|
|
235
|
+
|
|
236
|
+
- breaking contract/schema changes require version bump
|
|
237
|
+
- migration notes required for each breaking change
|
|
238
|
+
- previous minor version accepted during one deprecation window where feasible
|
|
239
|
+
|
|
240
|
+
---
|
|
241
|
+
|
|
242
|
+
## 9. Observability Contract
|
|
243
|
+
|
|
244
|
+
Every tool call MUST emit structured logs with:
|
|
245
|
+
- `run_id`
|
|
246
|
+
- `operation_id` (if mutating)
|
|
247
|
+
- `feature_id` (if applicable)
|
|
248
|
+
- `tool_name`
|
|
249
|
+
- `actor_type`
|
|
250
|
+
- `latency_ms`
|
|
251
|
+
- `result` (`ok|error`)
|
|
252
|
+
- `error_code` (if any)
|
|
253
|
+
|
|
254
|
+
Metrics MUST include:
|
|
255
|
+
- calls by tool/role
|
|
256
|
+
- failure rates by error code
|
|
257
|
+
- retry and idempotency hit rates
|
|
258
|
+
|
|
259
|
+
---
|
|
260
|
+
|
|
261
|
+
## 10. CLI and Supervisor Migration
|
|
262
|
+
|
|
263
|
+
### 10.1 CLI
|
|
264
|
+
|
|
265
|
+
- replace direct kernel calls with `ToolClient`
|
|
266
|
+
- add `--transport inprocess|mcp`
|
|
267
|
+
- default transition:
|
|
268
|
+
- early phases: `inprocess`
|
|
269
|
+
- post-parity: `mcp`
|
|
270
|
+
|
|
271
|
+
### 10.2 Supervisor
|
|
272
|
+
|
|
273
|
+
- replace direct `kernel.invoke(...)` with `ToolClient`
|
|
274
|
+
- preserve role firewall
|
|
275
|
+
- pass signed role token in MCP mode
|
|
276
|
+
|
|
277
|
+
---
|
|
278
|
+
|
|
279
|
+
## 11. Integrated Delivery Plan (Cross-Spec)
|
|
280
|
+
|
|
281
|
+
This plan coordinates this spec and `agentic_orchestrator_single_global_orchestrator_spec.md`.
|
|
282
|
+
|
|
283
|
+
### M10: Registry Foundation
|
|
284
|
+
|
|
285
|
+
- implement catalog + schemas + loader + generator
|
|
286
|
+
- bind existing handlers via `handler_id`
|
|
287
|
+
|
|
288
|
+
Exit gate:
|
|
289
|
+
- registry validates
|
|
290
|
+
- generated tools doc matches registry
|
|
291
|
+
|
|
292
|
+
### M11: Auth + Idempotency Core
|
|
293
|
+
|
|
294
|
+
- token verifier and role-claim enforcement
|
|
295
|
+
- operation ledger and mutating call idempotency
|
|
296
|
+
|
|
297
|
+
Exit gate:
|
|
298
|
+
- auth failure paths tested
|
|
299
|
+
- duplicate mutation calls are safe
|
|
300
|
+
|
|
301
|
+
### M12: MCP Adapter + Protocol Pin
|
|
302
|
+
|
|
303
|
+
- implement MCP adapter (`tools/list`, `tools/call`)
|
|
304
|
+
- pin protocol and sdk versions
|
|
305
|
+
|
|
306
|
+
Exit gate:
|
|
307
|
+
- protocol conformance tests pass
|
|
308
|
+
|
|
309
|
+
### M13: ToolClient Migration
|
|
310
|
+
|
|
311
|
+
- add in-process and MCP clients
|
|
312
|
+
- migrate CLI/Supervisor call paths
|
|
313
|
+
|
|
314
|
+
Exit gate:
|
|
315
|
+
- end-to-end runs on both transports
|
|
316
|
+
|
|
317
|
+
### M14-M17: Global Orchestrator Topology Refactor
|
|
318
|
+
|
|
319
|
+
- executed per global-orchestrator spec milestones
|
|
320
|
+
|
|
321
|
+
Exit gate:
|
|
322
|
+
- session topology invariants pass (`1 + 3N`)
|
|
323
|
+
|
|
324
|
+
### M18: Production Promotion
|
|
325
|
+
|
|
326
|
+
- default transport `mcp`
|
|
327
|
+
- maintain in-process fallback for tests/recovery only
|
|
328
|
+
|
|
329
|
+
Exit gate:
|
|
330
|
+
- parity suite green
|
|
331
|
+
- rollout checklist signed off
|
|
332
|
+
|
|
333
|
+
---
|
|
334
|
+
|
|
335
|
+
## 12. Testing and Verification
|
|
336
|
+
|
|
337
|
+
### 12.1 Contract Tests
|
|
338
|
+
|
|
339
|
+
- all tools have valid input/output schema
|
|
340
|
+
- no duplicate names/handler ids
|
|
341
|
+
- `tools/list` equals registry contents
|
|
342
|
+
|
|
343
|
+
### 12.2 Conformance Suite
|
|
344
|
+
|
|
345
|
+
Same scenario must pass via both transports for critical paths:
|
|
346
|
+
- init -> plan -> patch -> gates -> merge
|
|
347
|
+
- lock conflict and collision outcomes
|
|
348
|
+
- retried mutation calls
|
|
349
|
+
- crash/recovery flows
|
|
350
|
+
|
|
351
|
+
### 12.3 Security Tests
|
|
352
|
+
|
|
353
|
+
- token expiry/signature rejection
|
|
354
|
+
- role spoofing rejection
|
|
355
|
+
- system-role misuse rejection
|
|
356
|
+
|
|
357
|
+
---
|
|
358
|
+
|
|
359
|
+
## 13. Acceptance Criteria
|
|
360
|
+
|
|
361
|
+
1. Tool contracts are runtime-loaded from registry artifacts.
|
|
362
|
+
2. Every tool call is authenticated and role-derived from verified token claims.
|
|
363
|
+
3. Mutating tool calls are idempotent by `operation_id`.
|
|
364
|
+
4. MCP transport behavior is parity-verified against in-process transport.
|
|
365
|
+
5. RBAC enforcement follows defined intersection model without drift.
|
|
366
|
+
6. Protocol version and SDK version are pinned and validated in CI.
|
|
367
|
+
7. `tools.md` is generated from registry and no longer manually authored.
|
|
368
|
+
|
|
369
|
+
---
|
|
370
|
+
|
|
371
|
+
## 14. Risks and Mitigations
|
|
372
|
+
|
|
373
|
+
- Risk: added complexity from auth and idempotency layers.
|
|
374
|
+
- Mitigation: isolate into dedicated components and exhaustively unit test.
|
|
375
|
+
- Risk: rollout instability from transport migration.
|
|
376
|
+
- Mitigation: keep in-process fallback until M18 exit gate.
|
|
377
|
+
- Risk: schema churn causing breakages.
|
|
378
|
+
- Mitigation: strict versioning and migration policy.
|
|
379
|
+
|