@backendkit-labs/agent-coding 0.28.5 → 0.30.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/README.md +4 -0
- package/dist/__tests__/cli-baseline.test.d.ts +2 -0
- package/dist/__tests__/cli-baseline.test.d.ts.map +1 -0
- package/dist/__tests__/cli-baseline.test.js +114 -0
- package/dist/__tests__/cli-baseline.test.js.map +1 -0
- package/dist/__tests__/context-hooks.test.d.ts +2 -0
- package/dist/__tests__/context-hooks.test.d.ts.map +1 -0
- package/dist/__tests__/context-hooks.test.js +21 -0
- package/dist/__tests__/context-hooks.test.js.map +1 -0
- package/dist/__tests__/createCodingEngine.forwarding.test.js +2 -1
- package/dist/__tests__/createCodingEngine.forwarding.test.js.map +1 -1
- package/dist/__tests__/sandbox.test.js +1 -1
- package/dist/__tests__/sandbox.test.js.map +1 -1
- package/dist/__tests__/workspace-trust.test.js +7 -5
- package/dist/__tests__/workspace-trust.test.js.map +1 -1
- package/dist/agents/AgentLoader.d.ts.map +1 -1
- package/dist/agents/AgentLoader.js +2 -1
- package/dist/agents/AgentLoader.js.map +1 -1
- package/dist/cli/agent-discovery/AgentPackageLoader.d.ts +22 -0
- package/dist/cli/agent-discovery/AgentPackageLoader.d.ts.map +1 -0
- package/dist/cli/agent-discovery/AgentPackageLoader.js +100 -0
- package/dist/cli/agent-discovery/AgentPackageLoader.js.map +1 -0
- package/dist/cli/agent-discovery/RemoteAgentRegistry.d.ts +31 -0
- package/dist/cli/agent-discovery/RemoteAgentRegistry.d.ts.map +1 -0
- package/dist/cli/agent-discovery/RemoteAgentRegistry.js +106 -0
- package/dist/cli/agent-discovery/RemoteAgentRegistry.js.map +1 -0
- package/dist/cli/agent-discovery/__tests__/RemoteAgentRegistry.ssrf.test.d.ts +2 -0
- package/dist/cli/agent-discovery/__tests__/RemoteAgentRegistry.ssrf.test.d.ts.map +1 -0
- package/dist/cli/agent-discovery/__tests__/RemoteAgentRegistry.ssrf.test.js +34 -0
- package/dist/cli/agent-discovery/__tests__/RemoteAgentRegistry.ssrf.test.js.map +1 -0
- package/dist/cli/agent-discovery/__tests__/discoverAgents.test.d.ts +2 -0
- package/dist/cli/agent-discovery/__tests__/discoverAgents.test.d.ts.map +1 -0
- package/dist/cli/agent-discovery/__tests__/discoverAgents.test.js +147 -0
- package/dist/cli/agent-discovery/__tests__/discoverAgents.test.js.map +1 -0
- package/dist/cli/agent-discovery/__tests__/download-guard.test.d.ts +2 -0
- package/dist/cli/agent-discovery/__tests__/download-guard.test.d.ts.map +1 -0
- package/dist/cli/agent-discovery/__tests__/download-guard.test.js +47 -0
- package/dist/cli/agent-discovery/__tests__/download-guard.test.js.map +1 -0
- package/dist/cli/agent-discovery/discoverAgents.d.ts +21 -0
- package/dist/cli/agent-discovery/discoverAgents.d.ts.map +1 -0
- package/dist/cli/agent-discovery/discoverAgents.js +74 -0
- package/dist/cli/agent-discovery/discoverAgents.js.map +1 -0
- package/dist/cli/agent-discovery/download-guard.d.ts +20 -0
- package/dist/cli/agent-discovery/download-guard.d.ts.map +1 -0
- package/dist/cli/agent-discovery/download-guard.js +84 -0
- package/dist/cli/agent-discovery/download-guard.js.map +1 -0
- package/dist/cli/agent-discovery/index.d.ts +5 -0
- package/dist/cli/agent-discovery/index.d.ts.map +1 -0
- package/dist/cli/agent-discovery/index.js +12 -0
- package/dist/cli/agent-discovery/index.js.map +1 -0
- package/dist/cli/agent-discovery/types.d.ts +48 -0
- package/dist/cli/agent-discovery/types.d.ts.map +1 -0
- package/dist/cli/agent-discovery/types.js +3 -0
- package/dist/cli/agent-discovery/types.js.map +1 -0
- package/dist/cli/bootstrap/GlobalSeed.d.ts +46 -0
- package/dist/cli/bootstrap/GlobalSeed.d.ts.map +1 -0
- package/dist/cli/bootstrap/GlobalSeed.js +285 -0
- package/dist/cli/bootstrap/GlobalSeed.js.map +1 -0
- package/dist/cli/bootstrap/config.d.ts +24 -0
- package/dist/cli/bootstrap/config.d.ts.map +1 -0
- package/dist/cli/bootstrap/config.js +71 -0
- package/dist/cli/bootstrap/config.js.map +1 -0
- package/dist/cli/checkpoint/index.d.ts +17 -0
- package/dist/cli/checkpoint/index.d.ts.map +1 -0
- package/dist/cli/checkpoint/index.js +207 -0
- package/dist/cli/checkpoint/index.js.map +1 -0
- package/dist/cli/commands/builtin.d.ts +7 -0
- package/dist/cli/commands/builtin.d.ts.map +1 -0
- package/dist/cli/commands/builtin.js +962 -0
- package/dist/cli/commands/builtin.js.map +1 -0
- package/dist/cli/context/__tests__/formatPipeline.test.d.ts +2 -0
- package/dist/cli/context/__tests__/formatPipeline.test.d.ts.map +1 -0
- package/dist/cli/context/__tests__/formatPipeline.test.js +25 -0
- package/dist/cli/context/__tests__/formatPipeline.test.js.map +1 -0
- package/dist/cli/context/index.d.ts +8 -0
- package/dist/cli/context/index.d.ts.map +1 -0
- package/dist/cli/context/index.js +8 -0
- package/dist/cli/context/index.js.map +1 -0
- package/dist/cli/context/pipeline.d.ts +46 -0
- package/dist/cli/context/pipeline.d.ts.map +1 -0
- package/dist/cli/context/pipeline.js +112 -0
- package/dist/cli/context/pipeline.js.map +1 -0
- package/dist/cli/context/stages/stage-instructions.d.ts +12 -0
- package/dist/cli/context/stages/stage-instructions.d.ts.map +1 -0
- package/dist/cli/context/stages/stage-instructions.js +76 -0
- package/dist/cli/context/stages/stage-instructions.js.map +1 -0
- package/dist/cli/context/stages/stage-lessons.d.ts +13 -0
- package/dist/cli/context/stages/stage-lessons.d.ts.map +1 -0
- package/dist/cli/context/stages/stage-lessons.js +83 -0
- package/dist/cli/context/stages/stage-lessons.js.map +1 -0
- package/dist/cli/context/stages/stage-manifest.d.ts +11 -0
- package/dist/cli/context/stages/stage-manifest.d.ts.map +1 -0
- package/dist/cli/context/stages/stage-manifest.js +62 -0
- package/dist/cli/context/stages/stage-manifest.js.map +1 -0
- package/dist/cli/context/stages/stage-project.d.ts +10 -0
- package/dist/cli/context/stages/stage-project.d.ts.map +1 -0
- package/dist/cli/context/stages/stage-project.js +55 -0
- package/dist/cli/context/stages/stage-project.js.map +1 -0
- package/dist/cli/context/stages/stage-session.d.ts +12 -0
- package/dist/cli/context/stages/stage-session.d.ts.map +1 -0
- package/dist/cli/context/stages/stage-session.js +69 -0
- package/dist/cli/context/stages/stage-session.js.map +1 -0
- package/dist/cli/file-sources.d.ts +17 -0
- package/dist/cli/file-sources.d.ts.map +1 -0
- package/dist/cli/file-sources.js +42 -0
- package/dist/cli/file-sources.js.map +1 -0
- package/dist/cli/index.d.ts +26 -0
- package/dist/cli/index.d.ts.map +1 -0
- package/dist/cli/index.js +55 -0
- package/dist/cli/index.js.map +1 -0
- package/dist/cli/skills/__tests__/SkillLoader.test.d.ts +2 -0
- package/dist/cli/skills/__tests__/SkillLoader.test.d.ts.map +1 -0
- package/dist/cli/skills/__tests__/SkillLoader.test.js +285 -0
- package/dist/cli/skills/__tests__/SkillLoader.test.js.map +1 -0
- package/dist/cli/skills/__tests__/SkillManager.safety.test.d.ts +2 -0
- package/dist/cli/skills/__tests__/SkillManager.safety.test.d.ts.map +1 -0
- package/dist/cli/skills/__tests__/SkillManager.safety.test.js +87 -0
- package/dist/cli/skills/__tests__/SkillManager.safety.test.js.map +1 -0
- package/dist/cli/skills/__tests__/stack.test.d.ts +2 -0
- package/dist/cli/skills/__tests__/stack.test.d.ts.map +1 -0
- package/dist/cli/skills/__tests__/stack.test.js +81 -0
- package/dist/cli/skills/__tests__/stack.test.js.map +1 -0
- package/dist/cli/skills/loader.d.ts +42 -0
- package/dist/cli/skills/loader.d.ts.map +1 -0
- package/dist/cli/skills/loader.js +158 -0
- package/dist/cli/skills/loader.js.map +1 -0
- package/dist/cli/skills/manager.d.ts +97 -0
- package/dist/cli/skills/manager.d.ts.map +1 -0
- package/dist/cli/skills/manager.js +304 -0
- package/dist/cli/skills/manager.js.map +1 -0
- package/dist/cli/skills/parse-md-skill.d.ts +14 -0
- package/dist/cli/skills/parse-md-skill.d.ts.map +1 -0
- package/dist/cli/skills/parse-md-skill.js +86 -0
- package/dist/cli/skills/parse-md-skill.js.map +1 -0
- package/dist/cli/skills/providers/github.d.ts +21 -0
- package/dist/cli/skills/providers/github.d.ts.map +1 -0
- package/dist/cli/skills/providers/github.js +146 -0
- package/dist/cli/skills/providers/github.js.map +1 -0
- package/dist/cli/skills/providers/index.d.ts +6 -0
- package/dist/cli/skills/providers/index.d.ts.map +1 -0
- package/dist/cli/skills/providers/index.js +12 -0
- package/dist/cli/skills/providers/index.js.map +1 -0
- package/dist/cli/skills/providers/local.d.ts +16 -0
- package/dist/cli/skills/providers/local.d.ts.map +1 -0
- package/dist/cli/skills/providers/local.js +91 -0
- package/dist/cli/skills/providers/local.js.map +1 -0
- package/dist/cli/skills/providers/obsidian.d.ts +31 -0
- package/dist/cli/skills/providers/obsidian.d.ts.map +1 -0
- package/dist/cli/skills/providers/obsidian.js +141 -0
- package/dist/cli/skills/providers/obsidian.js.map +1 -0
- package/dist/cli/skills/providers/skills-sh.d.ts +32 -0
- package/dist/cli/skills/providers/skills-sh.d.ts.map +1 -0
- package/dist/cli/skills/providers/skills-sh.js +53 -0
- package/dist/cli/skills/providers/skills-sh.js.map +1 -0
- package/dist/cli/skills/providers/types.d.ts +25 -0
- package/dist/cli/skills/providers/types.d.ts.map +1 -0
- package/dist/cli/skills/providers/types.js +3 -0
- package/dist/cli/skills/providers/types.js.map +1 -0
- package/dist/cli/skills/safe-name.d.ts +2 -0
- package/dist/cli/skills/safe-name.d.ts.map +1 -0
- package/dist/cli/skills/safe-name.js +22 -0
- package/dist/cli/skills/safe-name.js.map +1 -0
- package/dist/cli/skills/stack.d.ts +3 -0
- package/dist/cli/skills/stack.d.ts.map +1 -0
- package/dist/cli/skills/stack.js +64 -0
- package/dist/cli/skills/stack.js.map +1 -0
- package/dist/cli/skills/types.d.ts +28 -0
- package/dist/cli/skills/types.d.ts.map +1 -0
- package/dist/cli/skills/types.js +3 -0
- package/dist/cli/skills/types.js.map +1 -0
- package/dist/cli/trust/__tests__/workspace-trust.test.d.ts +2 -0
- package/dist/cli/trust/__tests__/workspace-trust.test.d.ts.map +1 -0
- package/dist/cli/trust/__tests__/workspace-trust.test.js +252 -0
- package/dist/cli/trust/__tests__/workspace-trust.test.js.map +1 -0
- package/dist/cli/trust/workspace-trust.d.ts +49 -0
- package/dist/cli/trust/workspace-trust.d.ts.map +1 -0
- package/dist/cli/trust/workspace-trust.js +163 -0
- package/dist/cli/trust/workspace-trust.js.map +1 -0
- package/dist/cli/workspace/index.d.ts +68 -0
- package/dist/cli/workspace/index.d.ts.map +1 -0
- package/dist/cli/workspace/index.js +231 -0
- package/dist/cli/workspace/index.js.map +1 -0
- package/dist/context-hooks.d.ts +11 -0
- package/dist/context-hooks.d.ts.map +1 -0
- package/dist/context-hooks.js +23 -0
- package/dist/context-hooks.js.map +1 -0
- package/dist/context-services.d.ts +12 -0
- package/dist/context-services.d.ts.map +1 -0
- package/dist/context-services.js +20 -0
- package/dist/context-services.js.map +1 -0
- package/dist/index.d.ts +5 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +26 -12
- package/dist/index.js.map +1 -1
- package/dist/orchestration/capability-matrix.d.ts +1 -1
- package/dist/orchestration/capability-matrix.d.ts.map +1 -1
- package/dist/pipeline/__tests__/AgentEngine.orchestratorFailure.test.d.ts +2 -0
- package/dist/pipeline/__tests__/AgentEngine.orchestratorFailure.test.d.ts.map +1 -0
- package/dist/pipeline/__tests__/AgentEngine.orchestratorFailure.test.js +42 -0
- package/dist/pipeline/__tests__/AgentEngine.orchestratorFailure.test.js.map +1 -0
- package/dist/pipeline/__tests__/coding-pipeline-hooks.test.d.ts +2 -0
- package/dist/pipeline/__tests__/coding-pipeline-hooks.test.d.ts.map +1 -0
- package/dist/pipeline/__tests__/coding-pipeline-hooks.test.js +64 -0
- package/dist/pipeline/__tests__/coding-pipeline-hooks.test.js.map +1 -0
- package/dist/pipeline/__tests__/engine-brief.test.d.ts +2 -0
- package/dist/pipeline/__tests__/engine-brief.test.d.ts.map +1 -0
- package/dist/pipeline/__tests__/engine-brief.test.js +159 -0
- package/dist/pipeline/__tests__/engine-brief.test.js.map +1 -0
- package/dist/pipeline/__tests__/qa-orchestrator.test.d.ts +2 -0
- package/dist/pipeline/__tests__/qa-orchestrator.test.d.ts.map +1 -0
- package/dist/pipeline/__tests__/qa-orchestrator.test.js +276 -0
- package/dist/pipeline/__tests__/qa-orchestrator.test.js.map +1 -0
- package/dist/pipeline/coding-pipeline-hooks.d.ts +28 -0
- package/dist/pipeline/coding-pipeline-hooks.d.ts.map +1 -0
- package/dist/pipeline/coding-pipeline-hooks.js +91 -0
- package/dist/pipeline/coding-pipeline-hooks.js.map +1 -0
- package/dist/pipeline/index.d.ts +13 -0
- package/dist/pipeline/index.d.ts.map +1 -0
- package/dist/pipeline/index.js +44 -0
- package/dist/pipeline/index.js.map +1 -0
- package/dist/pipeline/orchestration/__tests__/agent-id-consistency.test.d.ts +11 -0
- package/dist/pipeline/orchestration/__tests__/agent-id-consistency.test.d.ts.map +1 -0
- package/dist/pipeline/orchestration/__tests__/agent-id-consistency.test.js +105 -0
- package/dist/pipeline/orchestration/__tests__/agent-id-consistency.test.js.map +1 -0
- package/dist/pipeline/orchestration/__tests__/fsm-commit-skipped.test.d.ts +2 -0
- package/dist/pipeline/orchestration/__tests__/fsm-commit-skipped.test.d.ts.map +1 -0
- package/dist/pipeline/orchestration/__tests__/fsm-commit-skipped.test.js +21 -0
- package/dist/pipeline/orchestration/__tests__/fsm-commit-skipped.test.js.map +1 -0
- package/dist/pipeline/orchestration/__tests__/fsm-critical-path.test.d.ts +9 -0
- package/dist/pipeline/orchestration/__tests__/fsm-critical-path.test.d.ts.map +1 -0
- package/dist/pipeline/orchestration/__tests__/fsm-critical-path.test.js +101 -0
- package/dist/pipeline/orchestration/__tests__/fsm-critical-path.test.js.map +1 -0
- package/dist/pipeline/orchestration/__tests__/fsm-rework-and-regression.test.d.ts +2 -0
- package/dist/pipeline/orchestration/__tests__/fsm-rework-and-regression.test.d.ts.map +1 -0
- package/dist/pipeline/orchestration/__tests__/fsm-rework-and-regression.test.js +54 -0
- package/dist/pipeline/orchestration/__tests__/fsm-rework-and-regression.test.js.map +1 -0
- package/dist/pipeline/orchestration/__tests__/intent-detector-llm.test.d.ts +2 -0
- package/dist/pipeline/orchestration/__tests__/intent-detector-llm.test.d.ts.map +1 -0
- package/dist/pipeline/orchestration/__tests__/intent-detector-llm.test.js +57 -0
- package/dist/pipeline/orchestration/__tests__/intent-detector-llm.test.js.map +1 -0
- package/dist/pipeline/orchestration/__tests__/intent-detector-scores.test.d.ts +9 -0
- package/dist/pipeline/orchestration/__tests__/intent-detector-scores.test.d.ts.map +1 -0
- package/dist/pipeline/orchestration/__tests__/intent-detector-scores.test.js +43 -0
- package/dist/pipeline/orchestration/__tests__/intent-detector-scores.test.js.map +1 -0
- package/dist/pipeline/orchestration/__tests__/reflection-cycle.test.d.ts +10 -0
- package/dist/pipeline/orchestration/__tests__/reflection-cycle.test.d.ts.map +1 -0
- package/dist/pipeline/orchestration/__tests__/reflection-cycle.test.js +264 -0
- package/dist/pipeline/orchestration/__tests__/reflection-cycle.test.js.map +1 -0
- package/dist/pipeline/orchestration/audit/audit-ci-blocker.d.ts +31 -0
- package/dist/pipeline/orchestration/audit/audit-ci-blocker.d.ts.map +1 -0
- package/dist/pipeline/orchestration/audit/audit-ci-blocker.js +120 -0
- package/dist/pipeline/orchestration/audit/audit-ci-blocker.js.map +1 -0
- package/dist/pipeline/orchestration/audit/audit-finding-tracer.d.ts +33 -0
- package/dist/pipeline/orchestration/audit/audit-finding-tracer.d.ts.map +1 -0
- package/dist/pipeline/orchestration/audit/audit-finding-tracer.js +126 -0
- package/dist/pipeline/orchestration/audit/audit-finding-tracer.js.map +1 -0
- package/dist/pipeline/orchestration/audit/audit-lessons-learned.d.ts +27 -0
- package/dist/pipeline/orchestration/audit/audit-lessons-learned.d.ts.map +1 -0
- package/dist/pipeline/orchestration/audit/audit-lessons-learned.js +155 -0
- package/dist/pipeline/orchestration/audit/audit-lessons-learned.js.map +1 -0
- package/dist/pipeline/orchestration/audit/audit-pending-issues.d.ts +21 -0
- package/dist/pipeline/orchestration/audit/audit-pending-issues.d.ts.map +1 -0
- package/dist/pipeline/orchestration/audit/audit-pending-issues.js +110 -0
- package/dist/pipeline/orchestration/audit/audit-pending-issues.js.map +1 -0
- package/dist/pipeline/orchestration/audit/audit-reflection-bridge.d.ts +39 -0
- package/dist/pipeline/orchestration/audit/audit-reflection-bridge.d.ts.map +1 -0
- package/dist/pipeline/orchestration/audit/audit-reflection-bridge.js +65 -0
- package/dist/pipeline/orchestration/audit/audit-reflection-bridge.js.map +1 -0
- package/dist/pipeline/orchestration/audit/audit-report-renderer.d.ts +30 -0
- package/dist/pipeline/orchestration/audit/audit-report-renderer.d.ts.map +1 -0
- package/dist/pipeline/orchestration/audit/audit-report-renderer.js +249 -0
- package/dist/pipeline/orchestration/audit/audit-report-renderer.js.map +1 -0
- package/dist/pipeline/orchestration/audit/audit-report-version-manager.d.ts +52 -0
- package/dist/pipeline/orchestration/audit/audit-report-version-manager.d.ts.map +1 -0
- package/dist/pipeline/orchestration/audit/audit-report-version-manager.js +144 -0
- package/dist/pipeline/orchestration/audit/audit-report-version-manager.js.map +1 -0
- package/dist/pipeline/orchestration/audit/audit-silent-gates-buffer.d.ts +37 -0
- package/dist/pipeline/orchestration/audit/audit-silent-gates-buffer.d.ts.map +1 -0
- package/dist/pipeline/orchestration/audit/audit-silent-gates-buffer.js +129 -0
- package/dist/pipeline/orchestration/audit/audit-silent-gates-buffer.js.map +1 -0
- package/dist/pipeline/orchestration/audit/index.d.ts +17 -0
- package/dist/pipeline/orchestration/audit/index.d.ts.map +1 -0
- package/dist/pipeline/orchestration/audit/index.js +26 -0
- package/dist/pipeline/orchestration/audit/index.js.map +1 -0
- package/dist/pipeline/orchestration/audit/types.d.ts +79 -0
- package/dist/pipeline/orchestration/audit/types.d.ts.map +1 -0
- package/dist/pipeline/orchestration/audit/types.js +10 -0
- package/dist/pipeline/orchestration/audit/types.js.map +1 -0
- package/dist/pipeline/orchestration/audit-reporter.d.ts +133 -0
- package/dist/pipeline/orchestration/audit-reporter.d.ts.map +1 -0
- package/dist/pipeline/orchestration/audit-reporter.js +322 -0
- package/dist/pipeline/orchestration/audit-reporter.js.map +1 -0
- package/dist/pipeline/orchestration/config-loader.d.ts +51 -0
- package/dist/pipeline/orchestration/config-loader.d.ts.map +1 -0
- package/dist/pipeline/orchestration/config-loader.js +215 -0
- package/dist/pipeline/orchestration/config-loader.js.map +1 -0
- package/dist/pipeline/orchestration/domain-detector.d.ts +36 -0
- package/dist/pipeline/orchestration/domain-detector.d.ts.map +1 -0
- package/dist/pipeline/orchestration/domain-detector.js +157 -0
- package/dist/pipeline/orchestration/domain-detector.js.map +1 -0
- package/dist/pipeline/orchestration/fsm.d.ts +92 -0
- package/dist/pipeline/orchestration/fsm.d.ts.map +1 -0
- package/dist/pipeline/orchestration/fsm.js +243 -0
- package/dist/pipeline/orchestration/fsm.js.map +1 -0
- package/dist/pipeline/orchestration/gate-resolver.d.ts +52 -0
- package/dist/pipeline/orchestration/gate-resolver.d.ts.map +1 -0
- package/dist/pipeline/orchestration/gate-resolver.js +120 -0
- package/dist/pipeline/orchestration/gate-resolver.js.map +1 -0
- package/dist/pipeline/orchestration/index.d.ts +16 -0
- package/dist/pipeline/orchestration/index.d.ts.map +1 -0
- package/dist/pipeline/orchestration/index.js +32 -0
- package/dist/pipeline/orchestration/index.js.map +1 -0
- package/dist/pipeline/orchestration/intent-detector.d.ts +37 -0
- package/dist/pipeline/orchestration/intent-detector.d.ts.map +1 -0
- package/dist/pipeline/orchestration/intent-detector.js +248 -0
- package/dist/pipeline/orchestration/intent-detector.js.map +1 -0
- package/dist/pipeline/orchestration/keyword-match.d.ts +17 -0
- package/dist/pipeline/orchestration/keyword-match.d.ts.map +1 -0
- package/dist/pipeline/orchestration/keyword-match.js +26 -0
- package/dist/pipeline/orchestration/keyword-match.js.map +1 -0
- package/dist/pipeline/orchestration/orchestrator.d.ts +158 -0
- package/dist/pipeline/orchestration/orchestrator.d.ts.map +1 -0
- package/dist/pipeline/orchestration/orchestrator.js +414 -0
- package/dist/pipeline/orchestration/orchestrator.js.map +1 -0
- package/dist/pipeline/orchestration/policy-engine.d.ts +54 -0
- package/dist/pipeline/orchestration/policy-engine.d.ts.map +1 -0
- package/dist/pipeline/orchestration/policy-engine.js +278 -0
- package/dist/pipeline/orchestration/policy-engine.js.map +1 -0
- package/dist/pipeline/orchestration/risk-scorer.d.ts +38 -0
- package/dist/pipeline/orchestration/risk-scorer.d.ts.map +1 -0
- package/dist/pipeline/orchestration/risk-scorer.js +145 -0
- package/dist/pipeline/orchestration/risk-scorer.js.map +1 -0
- package/dist/pipeline/orchestration/task-context.d.ts +205 -0
- package/dist/pipeline/orchestration/task-context.d.ts.map +1 -0
- package/dist/pipeline/orchestration/task-context.js +162 -0
- package/dist/pipeline/orchestration/task-context.js.map +1 -0
- package/dist/pipeline/orchestration/types.d.ts +111 -0
- package/dist/pipeline/orchestration/types.d.ts.map +1 -0
- package/dist/pipeline/orchestration/types.js +37 -0
- package/dist/pipeline/orchestration/types.js.map +1 -0
- package/dist/pipeline/qa/__tests__/QAService.test.d.ts +2 -0
- package/dist/pipeline/qa/__tests__/QAService.test.d.ts.map +1 -0
- package/dist/pipeline/qa/__tests__/QAService.test.js +170 -0
- package/dist/pipeline/qa/__tests__/QAService.test.js.map +1 -0
- package/dist/pipeline/qa/__tests__/QAService.verdict.test.d.ts +2 -0
- package/dist/pipeline/qa/__tests__/QAService.verdict.test.d.ts.map +1 -0
- package/dist/pipeline/qa/__tests__/QAService.verdict.test.js +39 -0
- package/dist/pipeline/qa/__tests__/QAService.verdict.test.js.map +1 -0
- package/dist/pipeline/qa/index.d.ts +3 -0
- package/dist/pipeline/qa/index.d.ts.map +1 -0
- package/dist/pipeline/qa/index.js +6 -0
- package/dist/pipeline/qa/index.js.map +1 -0
- package/dist/pipeline/qa/qa-service.d.ts +33 -0
- package/dist/pipeline/qa/qa-service.d.ts.map +1 -0
- package/dist/pipeline/qa/qa-service.js +239 -0
- package/dist/pipeline/qa/qa-service.js.map +1 -0
- package/dist/pipeline/qa-orchestrator.d.ts +60 -0
- package/dist/pipeline/qa-orchestrator.d.ts.map +1 -0
- package/dist/pipeline/qa-orchestrator.js +177 -0
- package/dist/pipeline/qa-orchestrator.js.map +1 -0
- package/dist/pipeline/reflection/domains/agent-domain.d.ts +40 -0
- package/dist/pipeline/reflection/domains/agent-domain.d.ts.map +1 -0
- package/dist/pipeline/reflection/domains/agent-domain.js +161 -0
- package/dist/pipeline/reflection/domains/agent-domain.js.map +1 -0
- package/dist/pipeline/reflection/domains/audit-domain.d.ts +46 -0
- package/dist/pipeline/reflection/domains/audit-domain.d.ts.map +1 -0
- package/dist/pipeline/reflection/domains/audit-domain.js +241 -0
- package/dist/pipeline/reflection/domains/audit-domain.js.map +1 -0
- package/dist/pipeline/reflection/domains/bootstrap-domain.d.ts +40 -0
- package/dist/pipeline/reflection/domains/bootstrap-domain.d.ts.map +1 -0
- package/dist/pipeline/reflection/domains/bootstrap-domain.js +156 -0
- package/dist/pipeline/reflection/domains/bootstrap-domain.js.map +1 -0
- package/dist/pipeline/reflection/domains/commit-domain.d.ts +40 -0
- package/dist/pipeline/reflection/domains/commit-domain.d.ts.map +1 -0
- package/dist/pipeline/reflection/domains/commit-domain.js +174 -0
- package/dist/pipeline/reflection/domains/commit-domain.js.map +1 -0
- package/dist/pipeline/reflection/domains/test-domain.d.ts +40 -0
- package/dist/pipeline/reflection/domains/test-domain.d.ts.map +1 -0
- package/dist/pipeline/reflection/domains/test-domain.js +194 -0
- package/dist/pipeline/reflection/domains/test-domain.js.map +1 -0
- package/dist/pipeline/reflection/historical-loader.d.ts +105 -0
- package/dist/pipeline/reflection/historical-loader.d.ts.map +1 -0
- package/dist/pipeline/reflection/historical-loader.js +462 -0
- package/dist/pipeline/reflection/historical-loader.js.map +1 -0
- package/dist/pipeline/reflection/hooks/agent-hook.d.ts +72 -0
- package/dist/pipeline/reflection/hooks/agent-hook.d.ts.map +1 -0
- package/dist/pipeline/reflection/hooks/agent-hook.js +98 -0
- package/dist/pipeline/reflection/hooks/agent-hook.js.map +1 -0
- package/dist/pipeline/reflection/hooks/audit-hook.d.ts +72 -0
- package/dist/pipeline/reflection/hooks/audit-hook.d.ts.map +1 -0
- package/dist/pipeline/reflection/hooks/audit-hook.js +112 -0
- package/dist/pipeline/reflection/hooks/audit-hook.js.map +1 -0
- package/dist/pipeline/reflection/hooks/bootstrap-hook.d.ts +71 -0
- package/dist/pipeline/reflection/hooks/bootstrap-hook.d.ts.map +1 -0
- package/dist/pipeline/reflection/hooks/bootstrap-hook.js +97 -0
- package/dist/pipeline/reflection/hooks/bootstrap-hook.js.map +1 -0
- package/dist/pipeline/reflection/hooks/commit-hook.d.ts +63 -0
- package/dist/pipeline/reflection/hooks/commit-hook.d.ts.map +1 -0
- package/dist/pipeline/reflection/hooks/commit-hook.js +90 -0
- package/dist/pipeline/reflection/hooks/commit-hook.js.map +1 -0
- package/dist/pipeline/reflection/hooks/test-hook.d.ts +65 -0
- package/dist/pipeline/reflection/hooks/test-hook.d.ts.map +1 -0
- package/dist/pipeline/reflection/hooks/test-hook.js +99 -0
- package/dist/pipeline/reflection/hooks/test-hook.js.map +1 -0
- package/dist/pipeline/reflection/lessons-memo-generator.d.ts +60 -0
- package/dist/pipeline/reflection/lessons-memo-generator.d.ts.map +1 -0
- package/dist/pipeline/reflection/lessons-memo-generator.js +286 -0
- package/dist/pipeline/reflection/lessons-memo-generator.js.map +1 -0
- package/dist/store/ProjectStore.d.ts +1 -1
- package/dist/store/ProjectStore.d.ts.map +1 -1
- package/dist/store/ProjectStore.js +2 -1
- package/dist/store/ProjectStore.js.map +1 -1
- package/dist/store/types.d.ts +28 -0
- package/dist/store/types.d.ts.map +1 -0
- package/dist/store/types.js +3 -0
- package/dist/store/types.js.map +1 -0
- package/dist/tools/__tests__/command-parser.test.js +1 -1
- package/dist/tools/__tests__/command-parser.test.js.map +1 -1
- package/dist/tools/__tests__/declared-facts.test.d.ts +2 -0
- package/dist/tools/__tests__/declared-facts.test.d.ts.map +1 -0
- package/dist/tools/__tests__/declared-facts.test.js +21 -0
- package/dist/tools/__tests__/declared-facts.test.js.map +1 -0
- package/dist/tools/__tests__/package-install.test.d.ts +2 -0
- package/dist/tools/__tests__/package-install.test.d.ts.map +1 -0
- package/dist/tools/__tests__/package-install.test.js +56 -0
- package/dist/tools/__tests__/package-install.test.js.map +1 -0
- package/dist/tools/__tests__/save-tools.secrets.test.js +1 -1
- package/dist/tools/__tests__/save-tools.secrets.test.js.map +1 -1
- package/dist/tools/edit-file.d.ts.map +1 -1
- package/dist/tools/edit-file.js +1 -0
- package/dist/tools/edit-file.js.map +1 -1
- package/dist/tools/list-directory.d.ts.map +1 -1
- package/dist/tools/list-directory.js +1 -0
- package/dist/tools/list-directory.js.map +1 -1
- package/dist/tools/package-install.d.ts +11 -0
- package/dist/tools/package-install.d.ts.map +1 -0
- package/dist/tools/package-install.js +112 -0
- package/dist/tools/package-install.js.map +1 -0
- package/dist/tools/read-file.d.ts.map +1 -1
- package/dist/tools/read-file.js +1 -0
- package/dist/tools/read-file.js.map +1 -1
- package/dist/tools/run-command.d.ts.map +1 -1
- package/dist/tools/run-command.js +5 -1
- package/dist/tools/run-command.js.map +1 -1
- package/dist/tools/save-audit.d.ts.map +1 -1
- package/dist/tools/save-audit.js +7 -6
- package/dist/tools/save-audit.js.map +1 -1
- package/dist/tools/save-context.d.ts.map +1 -1
- package/dist/tools/save-context.js +3 -2
- package/dist/tools/save-context.js.map +1 -1
- package/dist/tools/save-learning.d.ts.map +1 -1
- package/dist/tools/save-learning.js +4 -3
- package/dist/tools/save-learning.js.map +1 -1
- package/dist/tools/save-user-preference.d.ts.map +1 -1
- package/dist/tools/save-user-preference.js +3 -2
- package/dist/tools/save-user-preference.js.map +1 -1
- package/dist/tools/search-files.d.ts.map +1 -1
- package/dist/tools/search-files.js +1 -0
- package/dist/tools/search-files.js.map +1 -1
- package/dist/tools/update-session.d.ts.map +1 -1
- package/dist/tools/update-session.js +3 -2
- package/dist/tools/update-session.js.map +1 -1
- package/dist/tools/write-file.d.ts.map +1 -1
- package/dist/tools/write-file.js +1 -0
- package/dist/tools/write-file.js.map +1 -1
- package/package.json +71 -44
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import type { EngineHooks } from '@backendkit-labs/agent-core';
|
|
2
|
+
import type { Orchestrator } from './orchestration/orchestrator';
|
|
3
|
+
import type { OrchestrationResult } from './orchestration/types';
|
|
4
|
+
import type { QAService } from './qa/qa-service';
|
|
5
|
+
export interface CodingPipelineHooksOptions {
|
|
6
|
+
/** Classifies the task before the run (intent, risk, gates, agent pipeline) and drives the FSM. */
|
|
7
|
+
orchestrator: Orchestrator;
|
|
8
|
+
/** Reviews the final answer and records the QA gate. Without it only the brief and the classification apply. */
|
|
9
|
+
qaService?: QAService;
|
|
10
|
+
/** What `beforeRun` does when the orchestrator throws. 'closed' (default) fails the run; 'open' warns and runs without gates. */
|
|
11
|
+
failureMode?: 'closed' | 'open';
|
|
12
|
+
/** Skips the automatic QA review even when `qaService` is set. */
|
|
13
|
+
noQA?: boolean;
|
|
14
|
+
/** Called with every QA review. */
|
|
15
|
+
onQAReview?: (review: string) => void;
|
|
16
|
+
/** Agent that receives the orchestration brief. Default: the agent that starts the turn. */
|
|
17
|
+
defaultAgentId?: string;
|
|
18
|
+
}
|
|
19
|
+
/** The orchestration brief for the default agent: which specialists to use, in what order, and which gates apply. */
|
|
20
|
+
export declare function buildOrchestrationBrief(result: OrchestrationResult): string;
|
|
21
|
+
/**
|
|
22
|
+
* The coding pipeline (orchestrator + QA gates) as engine hooks (SPEC-0015 F1):
|
|
23
|
+
* - `beforeRun` classifies the task; the result lives in the turn's state.
|
|
24
|
+
* - `systemPrompt` gives the default agent the brief.
|
|
25
|
+
* - `afterTurn` advances the required gates and asks for a pass of the `qa-engineer` agent (or reviews inline).
|
|
26
|
+
*/
|
|
27
|
+
export declare function codingPipelineHooks(opts: CodingPipelineHooksOptions): EngineHooks;
|
|
28
|
+
//# sourceMappingURL=coding-pipeline-hooks.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"coding-pipeline-hooks.d.ts","sourceRoot":"","sources":["../../src/pipeline/coding-pipeline-hooks.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAc,MAAM,6BAA6B,CAAC;AAC3E,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAC;AACjE,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AACjE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAWjD,MAAM,WAAW,0BAA0B;IACvC,mGAAmG;IACnG,YAAY,EAAE,YAAY,CAAC;IAC3B,gHAAgH;IAChH,SAAS,CAAC,EAAE,SAAS,CAAC;IACtB,iIAAiI;IACjI,WAAW,CAAC,EAAE,QAAQ,GAAG,MAAM,CAAC;IAChC,kEAAkE;IAClE,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,mCAAmC;IACnC,UAAU,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,IAAI,CAAC;IACtC,4FAA4F;IAC5F,cAAc,CAAC,EAAE,MAAM,CAAC;CAC3B;AAED,qHAAqH;AACrH,wBAAgB,uBAAuB,CAAC,MAAM,EAAE,mBAAmB,GAAG,MAAM,CAkC3E;AAED;;;;;GAKG;AACH,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,0BAA0B,GAAG,WAAW,CAiDjF"}
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.buildOrchestrationBrief = buildOrchestrationBrief;
|
|
4
|
+
exports.codingPipelineHooks = codingPipelineHooks;
|
|
5
|
+
const qa_orchestrator_1 = require("./qa-orchestrator");
|
|
6
|
+
const STATE_KEY = 'coding-pipeline.orchestration';
|
|
7
|
+
/** The orchestration brief for the default agent: which specialists to use, in what order, and which gates apply. */
|
|
8
|
+
function buildOrchestrationBrief(result) {
|
|
9
|
+
const { task, selectedAgents, agentPipeline, requiredGates } = result;
|
|
10
|
+
const lines = ['## Orchestrator Analysis — Current Task'];
|
|
11
|
+
const domains = task.domains.length > 0 ? task.domains.join(', ') : 'general';
|
|
12
|
+
lines.push(`**Intent:** ${task.actionType} | **Risk:** ${task.riskLevel} | **Domains:** ${domains}`);
|
|
13
|
+
// Only surface non-trivial agent selections (skip sole-fallback case)
|
|
14
|
+
const nonFallback = selectedAgents.filter(a => !(a.agentId === 'general' && a.score <= 50));
|
|
15
|
+
if (nonFallback.length > 0) {
|
|
16
|
+
lines.push('\n**Recommended agents for this task (highest priority first):**');
|
|
17
|
+
for (const a of nonFallback) {
|
|
18
|
+
lines.push(`- ${a.agentId} — ${a.reason}`);
|
|
19
|
+
}
|
|
20
|
+
lines.push('\nWhen delegating via ask_agent, prioritize the agents listed above. ' +
|
|
21
|
+
'Do not delegate to unlisted agents unless the task explicitly requires it.');
|
|
22
|
+
}
|
|
23
|
+
if (agentPipeline && agentPipeline.length > 0) {
|
|
24
|
+
lines.push('\n**Suggested execution pipeline (respect this order):**');
|
|
25
|
+
agentPipeline.forEach((phase, i) => {
|
|
26
|
+
lines.push(`${i + 1}. [${phase.phase}] ${phase.agentId} — ${phase.purpose}`);
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
if (requiredGates.length > 0) {
|
|
30
|
+
lines.push(`\n**Required gates before commit:** ${requiredGates.join(', ')}`);
|
|
31
|
+
lines.push('Ensure each gate is satisfied before considering the task complete.');
|
|
32
|
+
}
|
|
33
|
+
return lines.join('\n');
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* The coding pipeline (orchestrator + QA gates) as engine hooks (SPEC-0015 F1):
|
|
37
|
+
* - `beforeRun` classifies the task; the result lives in the turn's state.
|
|
38
|
+
* - `systemPrompt` gives the default agent the brief.
|
|
39
|
+
* - `afterTurn` advances the required gates and asks for a pass of the `qa-engineer` agent (or reviews inline).
|
|
40
|
+
*/
|
|
41
|
+
function codingPipelineHooks(opts) {
|
|
42
|
+
const get = (ctx) => ctx.state.get(STATE_KEY);
|
|
43
|
+
return {
|
|
44
|
+
name: 'coding-pipeline',
|
|
45
|
+
async beforeRun(ctx) {
|
|
46
|
+
try {
|
|
47
|
+
ctx.state.set(STATE_KEY, await opts.orchestrator.orchestrate(ctx.input));
|
|
48
|
+
}
|
|
49
|
+
catch (err) {
|
|
50
|
+
const reason = err instanceof Error ? err.message : String(err);
|
|
51
|
+
if ((opts.failureMode ?? 'closed') === 'closed') {
|
|
52
|
+
throw new Error(`Orchestrator failed; refusing to run without its gates: ${reason}`);
|
|
53
|
+
}
|
|
54
|
+
ctx.emit({ type: 'system', level: 'warn', text: `[Orchestrator] failed (${reason}); running without classification or gates` });
|
|
55
|
+
}
|
|
56
|
+
},
|
|
57
|
+
systemPrompt(ctx, profile) {
|
|
58
|
+
const result = get(ctx);
|
|
59
|
+
if (!result || profile.id !== (opts.defaultAgentId ?? ctx.principal.agentId))
|
|
60
|
+
return undefined;
|
|
61
|
+
return buildOrchestrationBrief(result);
|
|
62
|
+
},
|
|
63
|
+
async afterTurn(ctx, turn) {
|
|
64
|
+
const result = get(ctx);
|
|
65
|
+
if (!result || !opts.qaService)
|
|
66
|
+
return undefined;
|
|
67
|
+
const qaAgentId = ctx.hasAgent('qa-engineer') ? 'qa-engineer' : undefined;
|
|
68
|
+
const qaCtx = {
|
|
69
|
+
clean: turn.text,
|
|
70
|
+
orchestrationResult: result,
|
|
71
|
+
orchestrator: opts.orchestrator,
|
|
72
|
+
qaService: opts.qaService,
|
|
73
|
+
effectiveAgentId: turn.profile.id,
|
|
74
|
+
hasAgent: ctx.hasAgent,
|
|
75
|
+
qaAgentId,
|
|
76
|
+
noQA: opts.noQA,
|
|
77
|
+
onQAReview: opts.onQAReview,
|
|
78
|
+
};
|
|
79
|
+
await (0, qa_orchestrator_1.advanceRequiredGates)(qaCtx);
|
|
80
|
+
const qa = (0, qa_orchestrator_1.activateQaEngineerIfNeeded)(qaCtx);
|
|
81
|
+
if (qa)
|
|
82
|
+
return { action: 'continue', agentId: qa.agentId, message: qa.message };
|
|
83
|
+
if (qaAgentId && turn.profile.id === qaAgentId)
|
|
84
|
+
await (0, qa_orchestrator_1.processQaEngineerResponse)(qaCtx);
|
|
85
|
+
else
|
|
86
|
+
await (0, qa_orchestrator_1.processInlineQaReview)(qaCtx);
|
|
87
|
+
return undefined;
|
|
88
|
+
},
|
|
89
|
+
};
|
|
90
|
+
}
|
|
91
|
+
//# sourceMappingURL=coding-pipeline-hooks.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"coding-pipeline-hooks.js","sourceRoot":"","sources":["../../src/pipeline/coding-pipeline-hooks.ts"],"names":[],"mappings":";;AA8BA,0DAkCC;AAQD,kDAiDC;AArHD,uDAM2B;AAE3B,MAAM,SAAS,GAAG,+BAA+B,CAAC;AAiBlD,qHAAqH;AACrH,SAAgB,uBAAuB,CAAC,MAA2B;IAC/D,MAAM,EAAE,IAAI,EAAE,cAAc,EAAE,aAAa,EAAE,aAAa,EAAE,GAAG,MAAM,CAAC;IAEtE,MAAM,KAAK,GAAa,CAAC,yCAAyC,CAAC,CAAC;IAEpE,MAAM,OAAO,GAAG,IAAI,CAAC,OAAO,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;IAC9E,KAAK,CAAC,IAAI,CAAC,eAAe,IAAI,CAAC,UAAU,gBAAgB,IAAI,CAAC,SAAS,mBAAmB,OAAO,EAAE,CAAC,CAAC;IAErG,sEAAsE;IACtE,MAAM,WAAW,GAAG,cAAc,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC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AAQ,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,SAAS,CAAC;YAC1E,MAAM,KAAK,GAAc;gBACrB,KAAK,EAAE,IAAI,CAAC,IAAI;gBAChB,mBAAmB,EAAE,MAAM;gBAC3B,YAAY,EAAE,IAAI,CAAC,YAAY;gBAC/B,SAAS,EAAE,IAAI,CAAC,SAAS;gBACzB,gBAAgB,EAAE,IAAI,CAAC,OAAO,CAAC,EAAE;gBACjC,QAAQ,EAAE,GAAG,CAAC,QAAQ;gBACtB,SAAS;gBACT,IAAI,EAAE,IAAI,CAAC,IAAI;gBACf,UAAU,EAAE,IAAI,CAAC,UAAU;aAC9B,CAAC;YAEF,MAAM,IAAA,sCAAoB,EAAC,KAAK,CAAC,CAAC;YAElC,MAAM,EAAE,GAAG,IAAA,4CAA0B,EAAC,KAAK,CAAC,CAAC;YAC7C,IAAI,EAAE;gBAAE,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,OAAO,EAAE,EAAE,CAAC,OAAO,EAAE,OAAO,EAAE,EAAE,CAAC,OAAO,EAAE,CAAC;YAEhF,IAAI,SAAS,IAAI,IAAI,CAAC,OAAO,CAAC,EAAE,KAAK,SAAS;gBAAE,MAAM,IAAA,2CAAyB,EAAC,KAAK,CAAC,CAAC;;gBAClF,MAAM,IAAA,uCAAqB,EAAC,KAAK,CAAC,CAAC;YACxC,OAAO,SAAS,CAAC;QACrB,CAAC;KACJ,CAAC;AACN,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export { codingPipelineHooks, buildOrchestrationBrief } from './coding-pipeline-hooks';
|
|
2
|
+
export type { CodingPipelineHooksOptions } from './coding-pipeline-hooks';
|
|
3
|
+
export * from './orchestration';
|
|
4
|
+
export { QAService } from './qa/qa-service';
|
|
5
|
+
export type { QAServiceOptions, QAReviewResult } from './qa/qa-service';
|
|
6
|
+
export { AuditHook } from './reflection/hooks/audit-hook';
|
|
7
|
+
export { AgentHook } from './reflection/hooks/agent-hook';
|
|
8
|
+
export { TestHook } from './reflection/hooks/test-hook';
|
|
9
|
+
export { CommitHook } from './reflection/hooks/commit-hook';
|
|
10
|
+
export { BootstrapHook } from './reflection/hooks/bootstrap-hook';
|
|
11
|
+
export { HistoricalLoader } from './reflection/historical-loader';
|
|
12
|
+
export { LessonsMemoGenerator } from './reflection/lessons-memo-generator';
|
|
13
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/pipeline/index.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,mBAAmB,EAAE,uBAAuB,EAAE,MAAM,yBAAyB,CAAC;AACvF,YAAY,EAAE,0BAA0B,EAAE,MAAM,yBAAyB,CAAC;AAG1E,cAAc,iBAAiB,CAAC;AAGhC,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC5C,YAAY,EAAE,gBAAgB,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAGxE,OAAO,EAAE,SAAS,EAAE,MAAM,+BAA+B,CAAC;AAC1D,OAAO,EAAE,SAAS,EAAE,MAAM,+BAA+B,CAAC;AAC1D,OAAO,EAAE,QAAQ,EAAE,MAAM,8BAA8B,CAAC;AACxD,OAAO,EAAE,UAAU,EAAE,MAAM,gCAAgC,CAAC;AAC5D,OAAO,EAAE,aAAa,EAAE,MAAM,mCAAmC,CAAC;AAClE,OAAO,EAAE,gBAAgB,EAAE,MAAM,gCAAgC,CAAC;AAClE,OAAO,EAAE,oBAAoB,EAAE,MAAM,qCAAqC,CAAC"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// The coding pipeline: task classification (intent, domains, risk, policies, FSM), QA gates and the engine
|
|
3
|
+
// hooks that apply them (SPEC-0015). Import from '@backendkit-labs/agent-coding/pipeline'.
|
|
4
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
5
|
+
if (k2 === undefined) k2 = k;
|
|
6
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
7
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
8
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
9
|
+
}
|
|
10
|
+
Object.defineProperty(o, k2, desc);
|
|
11
|
+
}) : (function(o, m, k, k2) {
|
|
12
|
+
if (k2 === undefined) k2 = k;
|
|
13
|
+
o[k2] = m[k];
|
|
14
|
+
}));
|
|
15
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
16
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
17
|
+
};
|
|
18
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
19
|
+
exports.LessonsMemoGenerator = exports.HistoricalLoader = exports.BootstrapHook = exports.CommitHook = exports.TestHook = exports.AgentHook = exports.AuditHook = exports.QAService = exports.buildOrchestrationBrief = exports.codingPipelineHooks = void 0;
|
|
20
|
+
// Engine hooks
|
|
21
|
+
var coding_pipeline_hooks_1 = require("./coding-pipeline-hooks");
|
|
22
|
+
Object.defineProperty(exports, "codingPipelineHooks", { enumerable: true, get: function () { return coding_pipeline_hooks_1.codingPipelineHooks; } });
|
|
23
|
+
Object.defineProperty(exports, "buildOrchestrationBrief", { enumerable: true, get: function () { return coding_pipeline_hooks_1.buildOrchestrationBrief; } });
|
|
24
|
+
// Orchestrator, FSM, audit
|
|
25
|
+
__exportStar(require("./orchestration"), exports);
|
|
26
|
+
// QA
|
|
27
|
+
var qa_service_1 = require("./qa/qa-service");
|
|
28
|
+
Object.defineProperty(exports, "QAService", { enumerable: true, get: function () { return qa_service_1.QAService; } });
|
|
29
|
+
// Learning hooks tied to the pipeline's audit trail
|
|
30
|
+
var audit_hook_1 = require("./reflection/hooks/audit-hook");
|
|
31
|
+
Object.defineProperty(exports, "AuditHook", { enumerable: true, get: function () { return audit_hook_1.AuditHook; } });
|
|
32
|
+
var agent_hook_1 = require("./reflection/hooks/agent-hook");
|
|
33
|
+
Object.defineProperty(exports, "AgentHook", { enumerable: true, get: function () { return agent_hook_1.AgentHook; } });
|
|
34
|
+
var test_hook_1 = require("./reflection/hooks/test-hook");
|
|
35
|
+
Object.defineProperty(exports, "TestHook", { enumerable: true, get: function () { return test_hook_1.TestHook; } });
|
|
36
|
+
var commit_hook_1 = require("./reflection/hooks/commit-hook");
|
|
37
|
+
Object.defineProperty(exports, "CommitHook", { enumerable: true, get: function () { return commit_hook_1.CommitHook; } });
|
|
38
|
+
var bootstrap_hook_1 = require("./reflection/hooks/bootstrap-hook");
|
|
39
|
+
Object.defineProperty(exports, "BootstrapHook", { enumerable: true, get: function () { return bootstrap_hook_1.BootstrapHook; } });
|
|
40
|
+
var historical_loader_1 = require("./reflection/historical-loader");
|
|
41
|
+
Object.defineProperty(exports, "HistoricalLoader", { enumerable: true, get: function () { return historical_loader_1.HistoricalLoader; } });
|
|
42
|
+
var lessons_memo_generator_1 = require("./reflection/lessons-memo-generator");
|
|
43
|
+
Object.defineProperty(exports, "LessonsMemoGenerator", { enumerable: true, get: function () { return lessons_memo_generator_1.LessonsMemoGenerator; } });
|
|
44
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/pipeline/index.ts"],"names":[],"mappings":";AAAA,2GAA2G;AAC3G,2FAA2F;;;;;;;;;;;;;;;;;AAE3F,eAAe;AACf,iEAAuF;AAA9E,4HAAA,mBAAmB,OAAA;AAAE,gIAAA,uBAAuB,OAAA;AAGrD,2BAA2B;AAC3B,kDAAgC;AAEhC,KAAK;AACL,8CAA4C;AAAnC,uGAAA,SAAS,OAAA;AAGlB,oDAAoD;AACpD,4DAA0D;AAAjD,uGAAA,SAAS,OAAA;AAClB,4DAA0D;AAAjD,uGAAA,SAAS,OAAA;AAClB,0DAAwD;AAA/C,qGAAA,QAAQ,OAAA;AACjB,8DAA4D;AAAnD,yGAAA,UAAU,OAAA;AACnB,oEAAkE;AAAzD,+GAAA,aAAa,OAAA;AACtB,oEAAkE;AAAzD,qHAAA,gBAAgB,OAAA;AACzB,8EAA2E;AAAlE,8HAAA,oBAAoB,OAAA"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Regression test: agent IDs emitted by policy-engine and gate-resolver must
|
|
3
|
+
* match the canonical IDs registered in profiles (no "-agent" suffix).
|
|
4
|
+
*
|
|
5
|
+
* Background: policy-engine and gate-resolver previously used 'architecture-agent'
|
|
6
|
+
* and 'security-agent' while profiles register 'architecture' and 'security'.
|
|
7
|
+
* That mismatch caused duplicate entries in selectAgents() and potential
|
|
8
|
+
* "Agent not found" errors on LLM delegation (AgentEngine.ts:657).
|
|
9
|
+
*/
|
|
10
|
+
export {};
|
|
11
|
+
//# sourceMappingURL=agent-id-consistency.test.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"agent-id-consistency.test.d.ts","sourceRoot":"","sources":["../../../../src/pipeline/orchestration/__tests__/agent-id-consistency.test.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG"}
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Regression test: agent IDs emitted by policy-engine and gate-resolver must
|
|
4
|
+
* match the canonical IDs registered in profiles (no "-agent" suffix).
|
|
5
|
+
*
|
|
6
|
+
* Background: policy-engine and gate-resolver previously used 'architecture-agent'
|
|
7
|
+
* and 'security-agent' while profiles register 'architecture' and 'security'.
|
|
8
|
+
* That mismatch caused duplicate entries in selectAgents() and potential
|
|
9
|
+
* "Agent not found" errors on LLM delegation (AgentEngine.ts:657).
|
|
10
|
+
*/
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
const policy_engine_1 = require("../policy-engine");
|
|
13
|
+
const gate_resolver_1 = require("../gate-resolver");
|
|
14
|
+
const task_context_1 = require("../task-context");
|
|
15
|
+
const types_1 = require("../types");
|
|
16
|
+
// ── Canonical IDs registered by coding profiles ──────────────────────────────
|
|
17
|
+
const CANONICAL_IDS = new Set([
|
|
18
|
+
'general', 'coder', 'backend', 'frontend',
|
|
19
|
+
'qa-engineer', 'security', 'architecture',
|
|
20
|
+
'infrastructure', 'data', 'project-manager',
|
|
21
|
+
]);
|
|
22
|
+
function hasAgentSuffix(id) {
|
|
23
|
+
return id.endsWith('-agent');
|
|
24
|
+
}
|
|
25
|
+
// ── Helpers ───────────────────────────────────────────────────────────────────
|
|
26
|
+
function taskWith(overrides) {
|
|
27
|
+
return { ...(0, task_context_1.createTaskContext)('test'), status: 'classified', ...overrides };
|
|
28
|
+
}
|
|
29
|
+
function emptyPolicy() {
|
|
30
|
+
return { mustInclude: [], requiredGates: [], mustExecute: [], customGates: [], appliedRules: [] };
|
|
31
|
+
}
|
|
32
|
+
// ── Tests ─────────────────────────────────────────────────────────────────────
|
|
33
|
+
describe('agent ID consistency — no -agent suffix', () => {
|
|
34
|
+
describe('evaluatePolicies DEFAULT_RULES', () => {
|
|
35
|
+
const cases = [
|
|
36
|
+
{ label: 'actionType=design', task: { actionType: 'design' } },
|
|
37
|
+
{ label: 'actionType=security_audit', task: { actionType: 'security_audit' } },
|
|
38
|
+
{ label: 'riskLevel=high', task: { riskLevel: 'high' } },
|
|
39
|
+
{ label: 'riskLevel=critical', task: { riskLevel: 'critical' } },
|
|
40
|
+
{ label: 'domain=security', task: { domains: ['security'] } },
|
|
41
|
+
{
|
|
42
|
+
label: 'breaking_change=true',
|
|
43
|
+
task: { riskFactors: { breaking_change: true, security_sensitive: false, cross_service_impact: false, db_transactional: false, production_critical: false, complexity: 5 } },
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
label: 'security_sensitive=true',
|
|
47
|
+
task: { riskFactors: { breaking_change: false, security_sensitive: true, cross_service_impact: false, db_transactional: false, production_critical: false, complexity: 5 } },
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
label: 'cross_service_impact=true',
|
|
51
|
+
task: { riskFactors: { breaking_change: false, security_sensitive: false, cross_service_impact: true, db_transactional: false, production_critical: false, complexity: 5 } },
|
|
52
|
+
},
|
|
53
|
+
];
|
|
54
|
+
test.each(cases)('$label: mustInclude uses canonical IDs', ({ task }) => {
|
|
55
|
+
const result = (0, policy_engine_1.evaluatePolicies)(taskWith(task));
|
|
56
|
+
for (const id of result.mustInclude) {
|
|
57
|
+
expect(hasAgentSuffix(id)).toBe(false);
|
|
58
|
+
expect(CANONICAL_IDS.has(id)).toBe(true);
|
|
59
|
+
}
|
|
60
|
+
});
|
|
61
|
+
});
|
|
62
|
+
describe('resolveGates pipeline agentIds', () => {
|
|
63
|
+
it('security review phase uses canonical id', () => {
|
|
64
|
+
const task = taskWith({ requiresSecurityReview: true });
|
|
65
|
+
const { pipeline } = (0, gate_resolver_1.resolveGates)(task, emptyPolicy(), (0, types_1.defaultOrchestratorConfig)(), [
|
|
66
|
+
{ agentId: 'backend', score: 80, reason: 'domain' },
|
|
67
|
+
]);
|
|
68
|
+
const ids = pipeline.map(p => p.agentId);
|
|
69
|
+
expect(ids).not.toContain('security-agent');
|
|
70
|
+
expect(ids).toContain('security');
|
|
71
|
+
});
|
|
72
|
+
it('architecture review phase uses canonical id', () => {
|
|
73
|
+
const task = taskWith({ requiresArchitectureReview: true });
|
|
74
|
+
const { pipeline } = (0, gate_resolver_1.resolveGates)(task, emptyPolicy(), (0, types_1.defaultOrchestratorConfig)(), [
|
|
75
|
+
{ agentId: 'backend', score: 80, reason: 'domain' },
|
|
76
|
+
]);
|
|
77
|
+
const ids = pipeline.map(p => p.agentId);
|
|
78
|
+
expect(ids).not.toContain('architecture-agent');
|
|
79
|
+
expect(ids).toContain('architecture');
|
|
80
|
+
});
|
|
81
|
+
it('qa verify phase uses canonical id', () => {
|
|
82
|
+
const task = taskWith({ requiresQaApproval: true });
|
|
83
|
+
const { pipeline } = (0, gate_resolver_1.resolveGates)(task, emptyPolicy(), (0, types_1.defaultOrchestratorConfig)(), [
|
|
84
|
+
{ agentId: 'backend', score: 80, reason: 'domain' },
|
|
85
|
+
]);
|
|
86
|
+
const ids = pipeline.map(p => p.agentId);
|
|
87
|
+
expect(ids).not.toContain('qa-agent');
|
|
88
|
+
expect(ids).toContain('qa-engineer');
|
|
89
|
+
});
|
|
90
|
+
it('no pipeline entry uses a -agent suffix', () => {
|
|
91
|
+
const task = taskWith({
|
|
92
|
+
requiresSecurityReview: true,
|
|
93
|
+
requiresArchitectureReview: true,
|
|
94
|
+
requiresQaApproval: true,
|
|
95
|
+
});
|
|
96
|
+
const { pipeline } = (0, gate_resolver_1.resolveGates)(task, emptyPolicy(), (0, types_1.defaultOrchestratorConfig)(), [
|
|
97
|
+
{ agentId: 'backend', score: 80, reason: 'domain' },
|
|
98
|
+
]);
|
|
99
|
+
for (const phase of pipeline) {
|
|
100
|
+
expect(hasAgentSuffix(phase.agentId)).toBe(false);
|
|
101
|
+
}
|
|
102
|
+
});
|
|
103
|
+
});
|
|
104
|
+
});
|
|
105
|
+
//# sourceMappingURL=agent-id-consistency.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"agent-id-consistency.test.js","sourceRoot":"","sources":["../../../../src/pipeline/orchestration/__tests__/agent-id-consistency.test.ts"],"names":[],"mappings":";AAAA;;;;;;;;GAQG;;AAEH,oDAAoD;AACpD,oDAAgD;AAChD,kDAAsE;AACtE,oCAAqD;AAGrD,gFAAgF;AAChF,MAAM,aAAa,GAAG,IAAI,GAAG,CAAC;IAC1B,SAAS,EAAE,OAAO,EAAE,SAAS,EAAE,UAAU;IACzC,aAAa,EAAE,UAAU,EAAE,cAAc;IACzC,gBAAgB,EAAE,MAAM,EAAE,iBAAiB;CAC9C,CAAC,CAAC;AAEH,SAAS,cAAc,CAAC,EAAU;IAC9B,OAAO,EAAE,CAAC,QAAQ,CAAC,QAAQ,C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AE;gBAChF,EAAE,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,EAAE,EAAE,MAAM,EAAE,QAAQ,EAAE;aACtD,CAAC,CAAC;YACH,MAAM,GAAG,GAAG,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC;YACzC,MAAM,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,SAAS,CAAC,UAAU,CAAC,CAAC;YACtC,MAAM,CAAC,GAAG,CAAC,CAAC,SAAS,CAAC,aAAa,CAAC,CAAC;QACzC,CAAC,CAAC,CAAC;QAEH,EAAE,CAAC,wCAAwC,EAAE,GAAG,EAAE;YAC9C,MAAM,IAAI,GAAG,QAAQ,CAAC;gBAClB,sBAAsB,EAAE,IAAI;gBAC5B,0BAA0B,EAAE,IAAI;gBAChC,kBAAkB,EAAE,IAAI;aAC3B,CAAC,CAAC;YACH,MAAM,EAAE,QAAQ,EAAE,GAAG,IAAA,4BAAY,EAAC,IAAI,EAAE,WAAW,EAAE,EAAE,IAAA,iCAAyB,GAAE,EAAE;gBAChF,EAAE,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,EAAE,EAAE,MAAM,EAAE,QAAQ,EAAE;aACtD,CAAC,CAAC;YACH,KAAK,MAAM,KAAK,IAAI,QAAQ,EAAE,CAAC;gBAC3B,MAAM,CAAC,cAAc,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;YACtD,CAAC;QACL,CAAC,CAAC,CAAC;IACP,CAAC,CAAC,CAAC;AACP,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fsm-commit-skipped.test.d.ts","sourceRoot":"","sources":["../../../../src/pipeline/orchestration/__tests__/fsm-commit-skipped.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const fsm_1 = require("../fsm");
|
|
4
|
+
const task_context_1 = require("../task-context");
|
|
5
|
+
describe('TaskFSM — commit_skipped → commit_allowed', () => {
|
|
6
|
+
it('is reachable: the transition is listed and no guard blocks it', () => {
|
|
7
|
+
const fsm = new fsm_1.TaskFSM();
|
|
8
|
+
let task = (0, task_context_1.createTaskContext)('commit sin cambios');
|
|
9
|
+
task = (0, task_context_1.transitionTask)(task, 'commit_planning');
|
|
10
|
+
task = (0, task_context_1.transitionTask)(task, 'commit_skipped');
|
|
11
|
+
const result = fsm.transition(task, 'commit_allowed');
|
|
12
|
+
expect(result.allowed).toBe(true);
|
|
13
|
+
expect(result.task?.status).toBe('commit_allowed');
|
|
14
|
+
});
|
|
15
|
+
it('still refuses commit_allowed from states that never earned it', () => {
|
|
16
|
+
const fsm = new fsm_1.TaskFSM();
|
|
17
|
+
const task = (0, task_context_1.transitionTask)((0, task_context_1.createTaskContext)('x'), 'classified');
|
|
18
|
+
expect(fsm.transition(task, 'commit_allowed').allowed).toBe(false);
|
|
19
|
+
});
|
|
20
|
+
});
|
|
21
|
+
//# sourceMappingURL=fsm-commit-skipped.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fsm-commit-skipped.test.js","sourceRoot":"","sources":["../../../../src/pipeline/orchestration/__tests__/fsm-commit-skipped.test.ts"],"names":[],"mappings":";;AAAA,gCAAiC;AACjC,kDAAoE;AAEpE,QAAQ,CAAC,2CAA2C,EAAE,GAAG,EAAE;IACvD,EAAE,CAAC,+DAA+D,EAAE,GAAG,EAAE;QACrE,MAAM,GAAG,GAAG,IAAI,aAAO,EAAE,CAAC;QAC1B,IAAI,IAAI,GAAG,IAAA,gCAAiB,EAAC,oBAAoB,CAAC,CAAC;QACnD,IAAI,GAAG,IAAA,6BAAc,EAAC,IAAI,EAAE,iBAAiB,CAAC,CAAC;QAC/C,IAAI,GAAG,IAAA,6BAAc,EAAC,IAAI,EAAE,gBAAgB,CAAC,CAAC;QAC9C,MAAM,MAAM,GAAG,GAAG,CAAC,UAAU,CAAC,IAAI,EAAE,gBAAgB,CAAC,CAAC;QACtD,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAClC,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC,IAAI,CAAC,gBAAgB,CAAC,CAAC;IACvD,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,+DAA+D,EAAE,GAAG,EAAE;QACrE,MAAM,GAAG,GAAG,IAAI,aAAO,EAAE,CAAC;QAC1B,MAAM,IAAI,GAAG,IAAA,6BAAc,EAAC,IAAA,gCAAiB,EAAC,GAAG,CAAC,EAAE,YAAY,CAAC,CAAC;QAClE,MAAM,CAAC,GAAG,CAAC,UAAU,CAAC,IAAI,EAAE,gBAAgB,CAAC,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IACvE,CAAC,CAAC,CAAC;AACP,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Tests for getCriticalPath / hasPassedGate (H-002).
|
|
3
|
+
*
|
|
4
|
+
* The previous implementation used linear index comparison which gave false
|
|
5
|
+
* positives: a task at 'implementation' that went classified→implementation
|
|
6
|
+
* (skipping design_review) was incorrectly reported as having passed design_review.
|
|
7
|
+
*/
|
|
8
|
+
export {};
|
|
9
|
+
//# sourceMappingURL=fsm-critical-path.test.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fsm-critical-path.test.d.ts","sourceRoot":"","sources":["../../../../src/pipeline/orchestration/__tests__/fsm-critical-path.test.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG"}
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Tests for getCriticalPath / hasPassedGate (H-002).
|
|
4
|
+
*
|
|
5
|
+
* The previous implementation used linear index comparison which gave false
|
|
6
|
+
* positives: a task at 'implementation' that went classified→implementation
|
|
7
|
+
* (skipping design_review) was incorrectly reported as having passed design_review.
|
|
8
|
+
*/
|
|
9
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
+
const fsm_1 = require("../fsm");
|
|
11
|
+
const task_context_1 = require("../task-context");
|
|
12
|
+
function task(status, flags = {}) {
|
|
13
|
+
return {
|
|
14
|
+
...(0, task_context_1.createTaskContext)('test'),
|
|
15
|
+
status,
|
|
16
|
+
requiresArchitectureReview: flags.requiresArchitectureReview ?? false,
|
|
17
|
+
requiresSecurityReview: flags.requiresSecurityReview ?? false,
|
|
18
|
+
requiresQaApproval: flags.requiresQaApproval ?? false,
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
describe('getCriticalPath (H-002)', () => {
|
|
22
|
+
const fsm = new fsm_1.TaskFSM();
|
|
23
|
+
it('returns only current status when already at commit_allowed', () => {
|
|
24
|
+
expect(fsm.getCriticalPath(task('commit_allowed'))).toEqual(['commit_allowed']);
|
|
25
|
+
});
|
|
26
|
+
it('returns only current status when rejected', () => {
|
|
27
|
+
expect(fsm.getCriticalPath(task('rejected'))).toEqual(['rejected']);
|
|
28
|
+
});
|
|
29
|
+
it('task with no gates: new → classified → implementation → approved → commit_allowed', () => {
|
|
30
|
+
const path = fsm.getCriticalPath(task('new'));
|
|
31
|
+
expect(path).toContain('classified');
|
|
32
|
+
expect(path).toContain('approved');
|
|
33
|
+
expect(path).toContain('commit_allowed');
|
|
34
|
+
expect(path).not.toContain('design_review');
|
|
35
|
+
expect(path).not.toContain('security_review');
|
|
36
|
+
expect(path).not.toContain('qa_review');
|
|
37
|
+
});
|
|
38
|
+
// ── The core H-002 bug: false positive on hasPassedGate ──────────────────
|
|
39
|
+
it('task at implementation with requiresArchitectureReview still needs design_review in path', () => {
|
|
40
|
+
// classified → implementation is allowed by FSM (guard only blocks
|
|
41
|
+
// non-classified/non-design_review sources), so implementation does NOT
|
|
42
|
+
// guarantee design_review was visited.
|
|
43
|
+
const t = task('implementation', { requiresArchitectureReview: true });
|
|
44
|
+
const path = fsm.getCriticalPath(t);
|
|
45
|
+
expect(path).toContain('design_review');
|
|
46
|
+
});
|
|
47
|
+
it('task at security_review with requiresArchitectureReview still needs design_review in path', () => {
|
|
48
|
+
const t = task('security_review', { requiresArchitectureReview: true });
|
|
49
|
+
const path = fsm.getCriticalPath(t);
|
|
50
|
+
expect(path).toContain('design_review');
|
|
51
|
+
});
|
|
52
|
+
it('task at implementation with requiresSecurityReview still needs security_review in path', () => {
|
|
53
|
+
const t = task('implementation', { requiresSecurityReview: true });
|
|
54
|
+
const path = fsm.getCriticalPath(t);
|
|
55
|
+
expect(path).toContain('security_review');
|
|
56
|
+
});
|
|
57
|
+
it('task at implementation with requiresQaApproval still needs qa_review in path', () => {
|
|
58
|
+
const t = task('implementation', { requiresQaApproval: true });
|
|
59
|
+
const path = fsm.getCriticalPath(t);
|
|
60
|
+
expect(path).toContain('qa_review');
|
|
61
|
+
});
|
|
62
|
+
// ── Correct true positives: post-approval guarantees all gates done ───────
|
|
63
|
+
it('task at approved no longer needs qa_review in path', () => {
|
|
64
|
+
const t = task('approved', { requiresQaApproval: true });
|
|
65
|
+
const path = fsm.getCriticalPath(t);
|
|
66
|
+
expect(path).not.toContain('qa_review');
|
|
67
|
+
});
|
|
68
|
+
it('task at commit_planning no longer needs any gate in path', () => {
|
|
69
|
+
const t = task('commit_planning', {
|
|
70
|
+
requiresArchitectureReview: true,
|
|
71
|
+
requiresSecurityReview: true,
|
|
72
|
+
requiresQaApproval: true,
|
|
73
|
+
});
|
|
74
|
+
const path = fsm.getCriticalPath(t);
|
|
75
|
+
expect(path).not.toContain('design_review');
|
|
76
|
+
expect(path).not.toContain('security_review');
|
|
77
|
+
expect(path).not.toContain('qa_review');
|
|
78
|
+
});
|
|
79
|
+
// ── FSM guard: security_review guarantees when requiresSecurityReview ─────
|
|
80
|
+
it('task at qa_review with requiresSecurityReview no longer needs security_review in path', () => {
|
|
81
|
+
// FSM guard: requiresSecurityReview && to=qa_review && status≠security_review → blocked
|
|
82
|
+
// So if task is at qa_review AND requiresSecurityReview, security_review was visited.
|
|
83
|
+
const t = task('qa_review', { requiresSecurityReview: true });
|
|
84
|
+
const path = fsm.getCriticalPath(t);
|
|
85
|
+
expect(path).not.toContain('security_review');
|
|
86
|
+
});
|
|
87
|
+
it('task at qa_review WITHOUT requiresSecurityReview: security_review correctly absent from path', () => {
|
|
88
|
+
const t = task('qa_review', { requiresSecurityReview: false });
|
|
89
|
+
const path = fsm.getCriticalPath(t);
|
|
90
|
+
expect(path).not.toContain('security_review');
|
|
91
|
+
});
|
|
92
|
+
it('path always ends with approved and commit_allowed for in-progress tasks', () => {
|
|
93
|
+
const t = task('classified', { requiresQaApproval: true });
|
|
94
|
+
const path = fsm.getCriticalPath(t);
|
|
95
|
+
const last = path[path.length - 1];
|
|
96
|
+
const secondLast = path[path.length - 2];
|
|
97
|
+
expect(last).toBe('commit_allowed');
|
|
98
|
+
expect(secondLast).toBe('approved');
|
|
99
|
+
});
|
|
100
|
+
});
|
|
101
|
+
//# sourceMappingURL=fsm-critical-path.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fsm-critical-path.test.js","sourceRoot":"","sources":["../../../../src/pipeline/orchestration/__tests__/fsm-critical-path.test.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;AAEH,gCAAiC;AACjC,kDAAsF;AAEtF,SAAS,IAAI,CAAC,MAA6B,EAAE,QAC0C,EAAE;IAErF,OAAO;QACH,GAAG,IAAA,gCAAiB,EAAC,MAAM,CAAC;QAC5B,MAAM;QACN,0BAA0B,EAAE,KAAK,CAAC,0BAA0B,IAAI,KAAK;QACrE,sBAAsB,EAAE,KAAK,CAAC,sBAAsB,IAAI,KAAK;QAC7D,kBAAkB,EAAE,KAAK,CAAC,kBAAkB,IAAI,KAAK;KACxD,CAAC;AACN,C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AAI,GAAG,GAAG,CAAC,eAAe,CAAC,CAAC,CAAC,CAAC;QACpC,MAAM,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,SAAS,CAAC,iBAAiB,CAAC,CAAC;IAClD,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,yEAAyE,EAAE,GAAG,EAAE;QAC/E,MAAM,CAAC,GAAG,IAAI,CAAC,YAAY,EAAE,EAAE,kBAAkB,EAAE,IAAI,EAAE,CAAC,CAAC;QAC3D,MAAM,IAAI,GAAG,GAAG,CAAC,eAAe,CAAC,CAAC,CAAC,CAAC;QACpC,MAAM,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;QACnC,MAAM,UAAU,GAAG,IAAI,CAAC,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;QACzC,MAAM,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,gBAAgB,CAAC,CAAC;QACpC,MAAM,CAAC,UAAU,CAAC,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;IACxC,CAAC,CAAC,CAAC;AACP,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fsm-rework-and-regression.test.d.ts","sourceRoot":"","sources":["../../../../src/pipeline/orchestration/__tests__/fsm-rework-and-regression.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const fsm_1 = require("../fsm");
|
|
4
|
+
const task_context_1 = require("../task-context");
|
|
5
|
+
const inQaReview = () => {
|
|
6
|
+
let t = (0, task_context_1.createTaskContext)('x');
|
|
7
|
+
for (const s of ['classified', 'implementation', 'qa_review'])
|
|
8
|
+
t = (0, task_context_1.transitionTask)(t, s);
|
|
9
|
+
return t;
|
|
10
|
+
};
|
|
11
|
+
describe('TaskFSM — approved no longer regresses to implementation', () => {
|
|
12
|
+
it('refuses approved → implementation but still allows rework_required', () => {
|
|
13
|
+
const fsm = new fsm_1.TaskFSM();
|
|
14
|
+
const approved = (0, task_context_1.transitionTask)(inQaReview(), 'approved');
|
|
15
|
+
expect(fsm.transition(approved, 'implementation').allowed).toBe(false);
|
|
16
|
+
expect(fsm.getAvailableTransitions('approved')).not.toContain('implementation');
|
|
17
|
+
});
|
|
18
|
+
});
|
|
19
|
+
describe('TaskFSM — rework cap', () => {
|
|
20
|
+
const cycle = (fsm, task) => {
|
|
21
|
+
const back = fsm.transition(task, 'rework_required');
|
|
22
|
+
if (!back.allowed)
|
|
23
|
+
return back;
|
|
24
|
+
return fsm.transition((0, task_context_1.transitionTask)(back.task, 'qa_review'), 'rework_required');
|
|
25
|
+
};
|
|
26
|
+
it('counts each entry into rework_required', () => {
|
|
27
|
+
const fsm = new fsm_1.TaskFSM();
|
|
28
|
+
const r = fsm.transition(inQaReview(), 'rework_required');
|
|
29
|
+
expect(r.task?.reworkCount).toBe(1);
|
|
30
|
+
});
|
|
31
|
+
it('refuses the transition once the default limit is reached, with a clear error', () => {
|
|
32
|
+
const fsm = new fsm_1.TaskFSM();
|
|
33
|
+
let task = inQaReview();
|
|
34
|
+
for (let i = 0; i < fsm_1.DEFAULT_MAX_REWORK; i++) {
|
|
35
|
+
const r = fsm.transition(task, 'rework_required');
|
|
36
|
+
expect(r.allowed).toBe(true);
|
|
37
|
+
task = (0, task_context_1.transitionTask)(r.task, 'qa_review');
|
|
38
|
+
}
|
|
39
|
+
const over = fsm.transition(task, 'rework_required');
|
|
40
|
+
expect(over.allowed).toBe(false);
|
|
41
|
+
expect(over.error).toMatch(/Límite de rework alcanzado \(5\)/);
|
|
42
|
+
expect(fsm.transition(task, 'rejected').allowed).toBe(true);
|
|
43
|
+
});
|
|
44
|
+
it('the limit is configurable', () => {
|
|
45
|
+
const fsm = new fsm_1.TaskFSM({ maxRework: 1 });
|
|
46
|
+
const first = fsm.transition(inQaReview(), 'rework_required');
|
|
47
|
+
expect(first.allowed).toBe(true);
|
|
48
|
+
expect(cycle(fsm, first.task).allowed).toBe(false);
|
|
49
|
+
});
|
|
50
|
+
it('a task never reworked starts at zero (field is optional for existing callers)', () => {
|
|
51
|
+
expect(inQaReview().reworkCount).toBeUndefined();
|
|
52
|
+
});
|
|
53
|
+
});
|
|
54
|
+
//# sourceMappingURL=fsm-rework-and-regression.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fsm-rework-and-regression.test.js","sourceRoot":"","sources":["../../../../src/pipeline/orchestration/__tests__/fsm-rework-and-regression.test.ts"],"names":[],"mappings":";;AAAA,gCAAqD;AACrD,kDAAoE;AAGpE,MAAM,UAAU,GAAG,GAAgB,EAAE;IACjC,IAAI,CAAC,GAAG,IAAA,gCAAiB,EAAC,GAAG,CAAC,CAAC;IAC/B,KAAK,MAAM,CAAC,IAAI,CAAC,YAAY,EAAE,gBAAgB,EAAE,WAAW,CAAU;QAAE,CAAC,GAAG,IAAA,6BAAc,EAAC,CAAC,EAAE,CAAC,CAAC,CAAC;IACjG,OAAO,CAAC,CAAC;AACb,CAAC,CAAC;AAEF,QAAQ,CAAC,0DAA0D,EAAE,GAAG,EAAE;IACtE,EAAE,CAAC,oEAAoE,EAAE,GAAG,EAAE;QAC1E,MAAM,GAAG,GAAG,IAAI,aAAO,EAAE,CAAC;QAC1B,MAAM,QAAQ,GAAG,IAAA,6BAAc,EAAC,UAAU,EAAE,EAAE,UAAU,CAAC,CAAC;QAC1D,MAAM,CAAC,GAAG,CAAC,UAAU,CAAC,QAAQ,EAAE,gBAAgB,CAAC,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;QACvE,MAAM,CAAC,GAAG,CAAC,uBAAuB,CAAC,UAAU,CAAC,CAAC,CAAC,GAAG,CAAC,SAAS,CAAC,gBAAgB,CAAC,CAAC;IACpF,CAAC,CAAC,CAAC;AACP,CAAC,CAAC,CAAC;AAEH,QAAQ,CAAC,sBAAs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AAC,IAAI,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;QACjC,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,OAAO,CAAC,kCAAkC,CAAC,CAAC;QAC/D,MAAM,CAAC,GAAG,CAAC,UAAU,CAAC,IAAI,EAAE,UAAU,CAAC,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAChE,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,2BAA2B,EAAE,GAAG,EAAE;QACjC,MAAM,GAAG,GAAG,IAAI,aAAO,CAAC,EAAE,SAAS,EAAE,CAAC,EAAE,CAAC,CAAC;QAC1C,MAAM,KAAK,GAAG,GAAG,CAAC,UAAU,CAAC,UAAU,EAAE,EAAE,iBAAiB,CAAC,CAAC;QAC9D,MAAM,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QACjC,MAAM,CAAC,KAAK,CAAC,GAAG,EAAE,KAAK,CAAC,IAAK,CAAC,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IACxD,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,+EAA+E,EAAE,GAAG,EAAE;QACrF,MAAM,CAAC,UAAU,EAAE,CAAC,WAAW,CAAC,CAAC,aAAa,EAAE,CAAC;IACrD,CAAC,CAAC,CAAC;AACP,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"intent-detector-llm.test.d.ts","sourceRoot":"","sources":["../../../../src/pipeline/orchestration/__tests__/intent-detector-llm.test.ts"],"names":[],"mappings":""}
|