@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,42 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const agent_core_1 = require("@backendkit-labs/agent-core");
|
|
4
|
+
const coding_pipeline_hooks_1 = require("../coding-pipeline-hooks");
|
|
5
|
+
const failing = { orchestrate: async () => { throw new Error('classifier down'); } };
|
|
6
|
+
const agent = {
|
|
7
|
+
id: 'test-agent', name: 'Test Agent', icon: '🤖', description: 'test',
|
|
8
|
+
systemPrompt: 'You are a test agent.', allowedTools: [], delegatesTo: [],
|
|
9
|
+
};
|
|
10
|
+
function build(mode) {
|
|
11
|
+
let chats = 0;
|
|
12
|
+
const provider = {
|
|
13
|
+
async chat(_m, _t, cb) { chats++; cb.onChunk?.('ok'); cb.onDone({ role: 'assistant', content: 'ok' }); },
|
|
14
|
+
};
|
|
15
|
+
const agents = new agent_core_1.AgentRegistry();
|
|
16
|
+
agents.upsert(agent);
|
|
17
|
+
const providers = new agent_core_1.ProviderRegistry();
|
|
18
|
+
providers.register('mock', provider);
|
|
19
|
+
const events = [];
|
|
20
|
+
const transport = { emit: (e) => { events.push(e); }, onInput: () => () => undefined, close: () => undefined };
|
|
21
|
+
const engine = new agent_core_1.AgentEngine({
|
|
22
|
+
model: { provider: 'mock', id: 'mock' }, agents, tools: new agent_core_1.ToolRegistry(), providers, defaultProvider: 'mock', transport,
|
|
23
|
+
defaultAgentId: agent.id, iterationMode: 'auto', maxIterations: 2,
|
|
24
|
+
hooks: [(0, coding_pipeline_hooks_1.codingPipelineHooks)({ orchestrator: failing, failureMode: mode })],
|
|
25
|
+
});
|
|
26
|
+
return { engine, events, chats: () => chats };
|
|
27
|
+
}
|
|
28
|
+
describe('AgentEngine + codingPipelineHooks — orchestrator failure', () => {
|
|
29
|
+
it('fails closed by default: the run does not start without the gates', async () => {
|
|
30
|
+
const { engine, chats } = build();
|
|
31
|
+
await expect(engine.run('do it')).rejects.toThrow(/refusing to run without its gates: classifier down/);
|
|
32
|
+
expect(chats()).toBe(0);
|
|
33
|
+
});
|
|
34
|
+
it("'open' warns on the transport and runs anyway", async () => {
|
|
35
|
+
const { engine, events, chats } = build('open');
|
|
36
|
+
await engine.run('do it');
|
|
37
|
+
expect(chats()).toBe(1);
|
|
38
|
+
const warn = events.find(e => e.type === 'system' && e.level === 'warn');
|
|
39
|
+
expect(JSON.stringify(warn)).toContain('classifier down');
|
|
40
|
+
});
|
|
41
|
+
});
|
|
42
|
+
//# sourceMappingURL=AgentEngine.orchestratorFailure.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AgentEngine.orchestratorFailure.test.js","sourceRoot":"","sources":["../../../src/pipeline/__tests__/AgentEngine.orchestratorFailure.test.ts"],"names":[],"mappings":";;AAAA,4DAA+K;AAE/K,oEAA+D;AAE/D,MAAM,OAAO,GAAG,EAAE,WAAW,EAAE,KAAK,IAAI,EAAE,GAAG,MAAM,IAAI,KAAK,CAAC,iBAAiB,CAAC,CAAC,CAAC,CAAC,EAA6B,CAAC;AAEhH,MAAM,KAAK,GAAiB;IACxB,EAAE,EAAE,YAAY,EAAE,IAAI,EAAE,YAAY,EAAE,IAAI,EAAE,IAAI,EAAE,WAAW,EAAE,MAAM;IACrE,YAAY,EAAE,uBAAuB,EAAE,YAAY,EAAE,EAAE,EAAE,WAAW,EAAE,EAAE;CAC3E,CAAC;AAEF,SAAS,KAAK,CAAC,IAAwB;IACnC,IAAI,KAAK,GAAG,CAAC,CAAC;IACd,MAAM,QAAQ,GAAgB;QAC1B,KAAK,CAAC,IAAI,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE,IAAI,KAAK,EAAE,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E,GAAG,EAAE;IACtE,EAAE,CAAC,mEAAmE,EAAE,KAAK,IAAI,EAAE;QAC/E,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG,KAAK,EAAE,CAAC;QAClC,MAAM,MAAM,CAAC,MAAM,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,OAAO,CAAC,OAAO,CAAC,oDAAoD,CAAC,CAAC;QACxG,MAAM,CAAC,KAAK,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAC5B,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,+CAA+C,EAAE,KAAK,IAAI,EAAE;QAC3D,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG,KAAK,CAAC,MAAM,CAAC,CAAC;QAChD,MAAM,MAAM,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;QAC1B,MAAM,CAAC,KAAK,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QACxB,MAAM,IAAI,GAAG,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,KAAK,QAAQ,IAAK,CAAwB,CAAC,KAAK,KAAK,MAAM,CAAC,CAAC;QACjG,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC,CAAC,SAAS,CAAC,iBAAiB,CAAC,CAAC;IAC9D,CAAC,CAAC,CAAC;AACP,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"coding-pipeline-hooks.test.d.ts","sourceRoot":"","sources":["../../../src/pipeline/__tests__/coding-pipeline-hooks.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const coding_pipeline_hooks_1 = require("../coding-pipeline-hooks");
|
|
4
|
+
function ctx(hasQa = true) {
|
|
5
|
+
return {
|
|
6
|
+
principal: { agentId: 'general', sessionId: 's', chain: ['general'] },
|
|
7
|
+
input: 'implement the endpoint',
|
|
8
|
+
state: new Map(),
|
|
9
|
+
signal: new AbortController().signal,
|
|
10
|
+
hasAgent: (id) => hasQa && id === 'qa-engineer',
|
|
11
|
+
emit: jest.fn(),
|
|
12
|
+
};
|
|
13
|
+
}
|
|
14
|
+
const profile = (id) => ({ id });
|
|
15
|
+
const result = () => ({
|
|
16
|
+
task: { status: 'implementation', domains: ['api'], actionType: 'implementation', riskLevel: 'high',
|
|
17
|
+
requiresQaApproval: true, requiresArchitectureReview: false, requiresSecurityReview: false, rawPrompt: 'implement the endpoint' },
|
|
18
|
+
selectedAgents: [{ agentId: 'backend', score: 90, reason: 'owns api' }],
|
|
19
|
+
appliedPolicies: [], requiredGates: ['qa'], commitAllowed: false,
|
|
20
|
+
});
|
|
21
|
+
function orchestratorWith(r) {
|
|
22
|
+
return {
|
|
23
|
+
orchestrate: jest.fn().mockResolvedValue(r),
|
|
24
|
+
transitionTask: jest.fn((task, status) => ({ allowed: true, task: { ...task, status } })),
|
|
25
|
+
getAuditReporter: () => ({ recordGate: jest.fn().mockResolvedValue(undefined), completeSprint: jest.fn().mockResolvedValue(undefined) }),
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
const code = Array.from({ length: 10 }, (_, i) => `const v${i} = ${i};`).join('\n');
|
|
29
|
+
const qaService = { countCodeLines: () => 10, extractFindings: () => [], evaluateReview: () => true, reviewResponse: async () => 'ok' };
|
|
30
|
+
describe('codingPipelineHooks', () => {
|
|
31
|
+
it('beforeRun stores the classification and the default agent gets the brief', async () => {
|
|
32
|
+
const hooks = (0, coding_pipeline_hooks_1.codingPipelineHooks)({ orchestrator: orchestratorWith(result()), defaultAgentId: 'general' });
|
|
33
|
+
const c = ctx();
|
|
34
|
+
await hooks.beforeRun(c);
|
|
35
|
+
expect(await hooks.systemPrompt(c, profile('general'))).toContain('Orchestrator Analysis');
|
|
36
|
+
expect(await hooks.systemPrompt(c, profile('backend'))).toBeUndefined();
|
|
37
|
+
});
|
|
38
|
+
it('beforeRun fails closed by default and warns in open mode', async () => {
|
|
39
|
+
const failing = { orchestrate: async () => { throw new Error('down'); } };
|
|
40
|
+
await expect((0, coding_pipeline_hooks_1.codingPipelineHooks)({ orchestrator: failing }).beforeRun(ctx())).rejects.toThrow(/refusing to run without its gates: down/);
|
|
41
|
+
const c = ctx();
|
|
42
|
+
await (0, coding_pipeline_hooks_1.codingPipelineHooks)({ orchestrator: failing, failureMode: 'open' }).beforeRun(c);
|
|
43
|
+
expect(c.emit).toHaveBeenCalledWith(expect.objectContaining({ level: 'warn' }));
|
|
44
|
+
expect(c.state.size).toBe(0);
|
|
45
|
+
});
|
|
46
|
+
it('afterTurn asks for a pass of qa-engineer once the task is in qa_review', async () => {
|
|
47
|
+
const hooks = (0, coding_pipeline_hooks_1.codingPipelineHooks)({ orchestrator: orchestratorWith(result()), qaService });
|
|
48
|
+
const c = ctx();
|
|
49
|
+
await hooks.beforeRun(c);
|
|
50
|
+
const next = await hooks.afterTurn(c, { text: code, profile: profile('general') });
|
|
51
|
+
expect(next).toEqual({ action: 'continue', agentId: 'qa-engineer', message: expect.stringContaining('Review the following') });
|
|
52
|
+
});
|
|
53
|
+
it('afterTurn without a qa-engineer reviews inline and does not continue', async () => {
|
|
54
|
+
const hooks = (0, coding_pipeline_hooks_1.codingPipelineHooks)({ orchestrator: orchestratorWith(result()), qaService });
|
|
55
|
+
const c = ctx(false);
|
|
56
|
+
await hooks.beforeRun(c);
|
|
57
|
+
await expect(hooks.afterTurn(c, { text: code, profile: profile('general') })).resolves.toBeUndefined();
|
|
58
|
+
});
|
|
59
|
+
it('afterTurn does nothing without a classification', async () => {
|
|
60
|
+
const hooks = (0, coding_pipeline_hooks_1.codingPipelineHooks)({ orchestrator: orchestratorWith(result()), qaService });
|
|
61
|
+
await expect(hooks.afterTurn(ctx(), { text: code, profile: profile('general') })).resolves.toBeUndefined();
|
|
62
|
+
});
|
|
63
|
+
});
|
|
64
|
+
//# sourceMappingURL=coding-pipeline-hooks.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"coding-pipeline-hooks.test.js","sourceRoot":"","sources":["../../../src/pipeline/__tests__/coding-pipeline-hooks.test.ts"],"names":[],"mappings":";;AAAA,oEAA+D;AAI/D,SAAS,GAAG,CAAC,KAAK,GAAG,IAAI;IACrB,OAAO;QACH,SAAS,EAAE,EAAE,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,GAAG,EAAE,KAAK,EAAE,CAAC,SAAS,CAAC,EAAE;QACrE,KAAK,EAAE,wBAAwB;QAC/B,KAAK,EAAE,IAAI,GAAG,EAAE;QAChB,MAAM,EAAE,IAAI,eAAe,EAAE,CAAC,MAAM;QACpC,QAAQ,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,KAAK,IAAI,EAAE,KAAK,aAAa;QAC/C,IAAI,EAAE,IAAI,CAAC,EAAE,EAAE;KAClB,CAAC;AACN,CAAC;AAED,MAAM,OAAO,GAAG,CAAC,EAAU,EAAE,EAAE,CAAC,CAAC,EAAE,EAAE,EAAmB,CAAA,CAAC;AAEzD,MAAM,MAAM,GAAG,GAAG,EAAE,CAAC,CAAC;IAClB,IAAI,EAAE,EAAE,MAAM,EAAE,gBAAgB,EAAE,OAAO,EAAE,CAAC,KAAK,CAAC,EAAE,UAAU,EAAE,gBAAgB,EAAE,SAAS,EAAE,MAAM;QAC/F,kBAAkB,EAAE,IAAI,EAAE,0BAA0B,EAAE,KAAK,EAAE,sBAAsB,EAAE,KAAK,EAAE,SAAS,EAAE,wBAAwB,EAAE;IACrI,cAAc,EAAE,CAAC,EAAE,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,EAAE,EAAE,MAAM,EAAE,UAAU,EAAE,CAAC;IACvE,eAAe,EAAE,EAAE,EAAE,aAAa,EAAE,CAAC,IAAI,CAAC,EAAE,aAAa,EAAE,KAAK;CACnE,CAAC,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E,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,CAAC,SAAS,CAAC,EAAE,CAAC,CAAC,CAAC,QAAQ,CAAC,aAAa,EAAE,CAAC;IAChH,CAAC,CAAC,CAAC;AACP,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"engine-brief.test.d.ts","sourceRoot":"","sources":["../../../src/pipeline/__tests__/engine-brief.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const agent_core_1 = require("@backendkit-labs/agent-core");
|
|
4
|
+
const coding_pipeline_hooks_1 = require("../coding-pipeline-hooks");
|
|
5
|
+
const testAgent = {
|
|
6
|
+
id: 'test-agent', name: 'Test Agent', icon: '🤖', description: 'test',
|
|
7
|
+
systemPrompt: 'You are a test agent.', allowedTools: [], delegatesTo: [],
|
|
8
|
+
};
|
|
9
|
+
function buildRegistries(provider) {
|
|
10
|
+
const agents = new agent_core_1.AgentRegistry();
|
|
11
|
+
agents.upsert(testAgent);
|
|
12
|
+
const providers = new agent_core_1.ProviderRegistry();
|
|
13
|
+
providers.register('mock', provider);
|
|
14
|
+
return { agents, tools: new agent_core_1.ToolRegistry(), providers };
|
|
15
|
+
}
|
|
16
|
+
function createMockTransport() {
|
|
17
|
+
return { transport: { emit: () => undefined, onInput: () => () => undefined, close: () => undefined } };
|
|
18
|
+
}
|
|
19
|
+
// ── Orchestration brief injection ─────────────────────────────────────────────
|
|
20
|
+
describe('AgentEngine — orchestration brief in system prompt', () => {
|
|
21
|
+
/**
|
|
22
|
+
* Creates a mock Orchestrator that returns a fixed OrchestrationResult.
|
|
23
|
+
* The mock is minimal — only the orchestrate() method is needed.
|
|
24
|
+
*/
|
|
25
|
+
function makeMockOrchestrator(result) {
|
|
26
|
+
return { orchestrate: async () => result };
|
|
27
|
+
}
|
|
28
|
+
/** Captures the system message content passed to the LLM on each chat() call. */
|
|
29
|
+
function captureSystemMessages() {
|
|
30
|
+
const captured = [];
|
|
31
|
+
const provider = {
|
|
32
|
+
async chat(messages, _tools, callbacks) {
|
|
33
|
+
const sys = messages.find(m => m.role === 'system');
|
|
34
|
+
if (sys?.content)
|
|
35
|
+
captured.push(sys.content);
|
|
36
|
+
callbacks.onChunk?.('done');
|
|
37
|
+
callbacks.onDone({ role: 'assistant', content: 'done' });
|
|
38
|
+
},
|
|
39
|
+
};
|
|
40
|
+
return { provider, captured };
|
|
41
|
+
}
|
|
42
|
+
it('injects the orchestration brief into the default agent system prompt', async () => {
|
|
43
|
+
const { provider, captured } = captureSystemMessages();
|
|
44
|
+
const { agents, tools, providers } = buildRegistries(provider);
|
|
45
|
+
const { transport } = createMockTransport();
|
|
46
|
+
const orchResult = {
|
|
47
|
+
task: {
|
|
48
|
+
taskId: 't1',
|
|
49
|
+
rawPrompt: 'add circuit breaker',
|
|
50
|
+
actionType: 'implementation',
|
|
51
|
+
domains: ['resilience', 'backend'],
|
|
52
|
+
riskLevel: 'high',
|
|
53
|
+
riskFactors: { breaking_change: false, security_sensitive: false, cross_service_impact: true, db_transactional: false, production_critical: false, complexity: 5 },
|
|
54
|
+
requiresQaApproval: true,
|
|
55
|
+
requiresSecurityReview: false,
|
|
56
|
+
requiresArchitectureReview: false,
|
|
57
|
+
customGates: {},
|
|
58
|
+
completedCustomGates: [],
|
|
59
|
+
assignedAgents: ['backend-agent'],
|
|
60
|
+
targetServices: [],
|
|
61
|
+
relatedPatterns: [],
|
|
62
|
+
status: 'classified',
|
|
63
|
+
createdAt: new Date(),
|
|
64
|
+
updatedAt: new Date(),
|
|
65
|
+
},
|
|
66
|
+
selectedAgents: [
|
|
67
|
+
{ agentId: 'backend-agent', score: 100, reason: 'Politica obligatoria' },
|
|
68
|
+
{ agentId: 'qa-engineer', score: 100, reason: 'riskLevel=high | critical' },
|
|
69
|
+
],
|
|
70
|
+
agentPipeline: [
|
|
71
|
+
{ phase: 'implement', agentId: 'backend-agent', purpose: 'Implement circuit breaker', optional: false },
|
|
72
|
+
{ phase: 'verify', agentId: 'qa-engineer', purpose: 'Verify implementation quality', optional: false },
|
|
73
|
+
],
|
|
74
|
+
appliedPolicies: [{ rule: 'riskLevel=high | critical', reason: 'riskLevel=high | critical' }],
|
|
75
|
+
requiredGates: ['qa'],
|
|
76
|
+
commitAllowed: false,
|
|
77
|
+
};
|
|
78
|
+
const engine = new agent_core_1.AgentEngine({
|
|
79
|
+
model: { provider: 'mock', id: 'mock' },
|
|
80
|
+
agents, tools, providers,
|
|
81
|
+
defaultProvider: 'mock',
|
|
82
|
+
transport,
|
|
83
|
+
defaultAgentId: 'test-agent',
|
|
84
|
+
maxIterations: 1,
|
|
85
|
+
hooks: [(0, coding_pipeline_hooks_1.codingPipelineHooks)({ orchestrator: makeMockOrchestrator(orchResult), defaultAgentId: 'test-agent' })],
|
|
86
|
+
});
|
|
87
|
+
await engine.run('add circuit breaker to the resilience module');
|
|
88
|
+
expect(captured.length).toBeGreaterThan(0);
|
|
89
|
+
const systemPrompt = captured[0];
|
|
90
|
+
// Brief must be present
|
|
91
|
+
expect(systemPrompt).toContain('Orchestrator Analysis');
|
|
92
|
+
// Task metadata
|
|
93
|
+
expect(systemPrompt).toContain('implementation');
|
|
94
|
+
expect(systemPrompt).toContain('high');
|
|
95
|
+
expect(systemPrompt).toContain('resilience');
|
|
96
|
+
// Recommended agents
|
|
97
|
+
expect(systemPrompt).toContain('backend-agent');
|
|
98
|
+
expect(systemPrompt).toContain('qa-engineer');
|
|
99
|
+
// Pipeline
|
|
100
|
+
expect(systemPrompt).toContain('[implement]');
|
|
101
|
+
expect(systemPrompt).toContain('[verify]');
|
|
102
|
+
// Gate
|
|
103
|
+
expect(systemPrompt).toContain('qa');
|
|
104
|
+
});
|
|
105
|
+
it('does not inject orchestration brief when orchestrator is not configured', async () => {
|
|
106
|
+
const { provider, captured } = captureSystemMessages();
|
|
107
|
+
const { agents, tools, providers } = buildRegistries(provider);
|
|
108
|
+
const { transport } = createMockTransport();
|
|
109
|
+
const engine = new agent_core_1.AgentEngine({
|
|
110
|
+
model: { provider: 'mock', id: 'mock' },
|
|
111
|
+
agents, tools, providers,
|
|
112
|
+
defaultProvider: 'mock',
|
|
113
|
+
transport,
|
|
114
|
+
defaultAgentId: 'test-agent',
|
|
115
|
+
maxIterations: 1,
|
|
116
|
+
// No orchestrator
|
|
117
|
+
});
|
|
118
|
+
await engine.run('simple question');
|
|
119
|
+
expect(captured[0]).not.toContain('Orchestrator Analysis');
|
|
120
|
+
});
|
|
121
|
+
it('does not inject orchestration brief for sole-fallback general agent selection', async () => {
|
|
122
|
+
const { provider, captured } = captureSystemMessages();
|
|
123
|
+
const { agents, tools, providers } = buildRegistries(provider);
|
|
124
|
+
const { transport } = createMockTransport();
|
|
125
|
+
const orchResult = {
|
|
126
|
+
task: {
|
|
127
|
+
taskId: 't2', rawPrompt: 'hello', actionType: 'unknown', domains: [],
|
|
128
|
+
riskLevel: 'low',
|
|
129
|
+
riskFactors: { breaking_change: false, security_sensitive: false, cross_service_impact: false, db_transactional: false, production_critical: false, complexity: 1 },
|
|
130
|
+
requiresQaApproval: false, requiresSecurityReview: false, requiresArchitectureReview: false,
|
|
131
|
+
customGates: {}, completedCustomGates: [],
|
|
132
|
+
assignedAgents: [], targetServices: [], relatedPatterns: [],
|
|
133
|
+
status: 'classified', createdAt: new Date(), updatedAt: new Date(),
|
|
134
|
+
},
|
|
135
|
+
// Only the fallback — should not appear in the brief
|
|
136
|
+
selectedAgents: [{ agentId: 'general', score: 50, reason: 'Fallback: agente general' }],
|
|
137
|
+
agentPipeline: undefined,
|
|
138
|
+
appliedPolicies: [],
|
|
139
|
+
requiredGates: [],
|
|
140
|
+
commitAllowed: true,
|
|
141
|
+
};
|
|
142
|
+
const engine = new agent_core_1.AgentEngine({
|
|
143
|
+
model: { provider: 'mock', id: 'mock' },
|
|
144
|
+
agents, tools, providers,
|
|
145
|
+
defaultProvider: 'mock',
|
|
146
|
+
transport,
|
|
147
|
+
defaultAgentId: 'test-agent',
|
|
148
|
+
maxIterations: 1,
|
|
149
|
+
hooks: [(0, coding_pipeline_hooks_1.codingPipelineHooks)({ orchestrator: makeMockOrchestrator(orchResult), defaultAgentId: 'test-agent' })],
|
|
150
|
+
});
|
|
151
|
+
await engine.run('hello');
|
|
152
|
+
// Brief header still present (it always renders task metadata),
|
|
153
|
+
// but no recommended-agents section since it's just the fallback
|
|
154
|
+
const systemPrompt = captured[0];
|
|
155
|
+
expect(systemPrompt).toContain('Orchestrator Analysis');
|
|
156
|
+
expect(systemPrompt).not.toContain('Recommended agents');
|
|
157
|
+
});
|
|
158
|
+
});
|
|
159
|
+
//# sourceMappingURL=engine-brief.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"engine-brief.test.js","sourceRoot":"","sources":["../../../src/pipeline/__tests__/engine-brief.test.ts"],"names":[],"mappings":";;AAAA,4DAA8J;AAC9J,oEAA+D;AAE/D,MAAM,SAAS,GAAiB;IAC5B,EAAE,EAAE,YAAY,EAAE,IAAI,EAAE,YAAY,EAAE,IAAI,EAAE,IAAI,EAAE,WAAW,EAAE,MAAM;IACrE,YAAY,EAAE,uBAAuB,EAAE,YAAY,EAAE,EAAE,EAAE,WAAW,EAAE,EAAE;CAC3E,CAAC;AAEF,SAAS,eAAe,CAAC,QAAqB;IAC1C,MAAM,MAAM,GAAG,IAAI,0BAAa,EAAE,CAAC;IAAC,MAAM,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC;IAC7D,MAAM,SAAS,GAAG,IAAI,6BAAgB,EAAE,CAAC;IAAC,SAAS,CAAC,QAAQ,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC;IAC/E,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,IAAI,yBAAY,EAAE,EAAE,SAAS,EAAE,CAAC;AAC5D,CAAC;AAED,SAAS,mBAAmB;IACxB,OAAO,EAAE,SAAS,E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C,OAAO,CAAC,CAAC;QAC1B,gEAAgE;QAChE,iEAAiE;QACjE,MAAM,YAAY,GAAG,QAAQ,CAAC,CAAC,CAAC,CAAC;QACjC,MAAM,CAAC,YAAY,CAAC,CAAC,SAAS,CAAC,uBAAuB,CAAC,CAAC;QACxD,MAAM,CAAC,YAAY,CAAC,CAAC,GAAG,CAAC,SAAS,CAAC,oBAAoB,CAAC,CAAC;IAC7D,CAAC,CAAC,CAAC;AACP,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"qa-orchestrator.test.d.ts","sourceRoot":"","sources":["../../../src/pipeline/__tests__/qa-orchestrator.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,276 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const qa_orchestrator_1 = require("../qa-orchestrator");
|
|
4
|
+
const fsm_1 = require("../orchestration/fsm");
|
|
5
|
+
const task_context_1 = require("../orchestration/task-context");
|
|
6
|
+
// ── Harness ─────────────────────────────────────────────────────────────────
|
|
7
|
+
/** Builds a real FSM-backed orchestrator stub plus spies for the audit reporter. */
|
|
8
|
+
function makeOrchestrator() {
|
|
9
|
+
const fsm = new fsm_1.TaskFSM();
|
|
10
|
+
const recordGate = jest.fn().mockResolvedValue('');
|
|
11
|
+
const completeSprint = jest.fn().mockResolvedValue(undefined);
|
|
12
|
+
const reporter = { recordGate, completeSprint };
|
|
13
|
+
const orchestrator = {
|
|
14
|
+
transitionTask: (task, to) => fsm.transition(task, to),
|
|
15
|
+
getAuditReporter: () => reporter,
|
|
16
|
+
};
|
|
17
|
+
return { orchestrator, recordGate, completeSprint };
|
|
18
|
+
}
|
|
19
|
+
function makeQaService(overrides = {}) {
|
|
20
|
+
return {
|
|
21
|
+
countCodeLines: jest.fn().mockReturnValue(20),
|
|
22
|
+
reviewResponse: jest.fn().mockResolvedValue('aprobado, se ve bien'),
|
|
23
|
+
evaluateReview: jest.fn().mockReturnValue(true),
|
|
24
|
+
extractFindings: jest.fn().mockReturnValue([]),
|
|
25
|
+
...overrides,
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
function makeResult(task) {
|
|
29
|
+
return {
|
|
30
|
+
task,
|
|
31
|
+
selectedAgents: [],
|
|
32
|
+
appliedPolicies: [],
|
|
33
|
+
requiredGates: [],
|
|
34
|
+
commitAllowed: false,
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
function makeCtx(opts) {
|
|
38
|
+
return {
|
|
39
|
+
clean: opts.clean ?? '```ts\nconst x = 1;\n```',
|
|
40
|
+
orchestrationResult: makeResult(opts.task),
|
|
41
|
+
orchestrator: opts.orchestrator,
|
|
42
|
+
qaService: opts.qaService,
|
|
43
|
+
hasAgent: () => false,
|
|
44
|
+
effectiveAgentId: 'backend',
|
|
45
|
+
};
|
|
46
|
+
}
|
|
47
|
+
/** A task fresh out of implementation with substantial, non-informational code. */
|
|
48
|
+
function implTask(flags = {}) {
|
|
49
|
+
const task = (0, task_context_1.createTaskContext)('Implementar el endpoint de pagos');
|
|
50
|
+
task.status = 'implementation';
|
|
51
|
+
task.requiresArchitectureReview = flags.requiresArchitectureReview ?? false;
|
|
52
|
+
task.requiresSecurityReview = flags.requiresSecurityReview ?? false;
|
|
53
|
+
task.requiresQaApproval = flags.requiresQaApproval ?? false;
|
|
54
|
+
return task;
|
|
55
|
+
}
|
|
56
|
+
const gatesRecorded = (recordGate) => recordGate.mock.calls.map(c => c[0]);
|
|
57
|
+
// ── H-003: advanceRequiredGates respeta los flags requiresX ──────────────────
|
|
58
|
+
describe('advanceRequiredGates (H-003)', () => {
|
|
59
|
+
it('no transiciona ni registra gates cuando la tarea no requiere ninguno', async () => {
|
|
60
|
+
const { orchestrator, recordGate } = makeOrchestrator();
|
|
61
|
+
const qaService = makeQaService();
|
|
62
|
+
const ctx = makeCtx({ task: implTask(), orchestrator, qaService });
|
|
63
|
+
await (0, qa_orchestrator_1.advanceRequiredGates)(ctx);
|
|
64
|
+
expect(ctx.orchestrationResult.task.status).toBe('implementation');
|
|
65
|
+
expect(recordGate).not.toHaveBeenCalled();
|
|
66
|
+
});
|
|
67
|
+
it('posiciona en qa_review SIN registrar GO de QA (lo decide el reviewer real)', async () => {
|
|
68
|
+
const { orchestrator, recordGate } = makeOrchestrator();
|
|
69
|
+
const qaService = makeQaService();
|
|
70
|
+
const ctx = makeCtx({ task: implTask({ requiresQaApproval: true }), orchestrator, qaService });
|
|
71
|
+
await (0, qa_orchestrator_1.advanceRequiredGates)(ctx);
|
|
72
|
+
// Mueve a qa_review para que corra el reviewer, pero no fabrica un GO:
|
|
73
|
+
// si el reviewer no existe, NO debe quedar un "GO sin revisiones pendientes" falso.
|
|
74
|
+
expect(ctx.orchestrationResult.task.status).toBe('qa_review');
|
|
75
|
+
expect(recordGate).not.toHaveBeenCalled();
|
|
76
|
+
});
|
|
77
|
+
it('registra architecture pero NO security/qa cuando solo requiresArchitectureReview', async () => {
|
|
78
|
+
const { orchestrator, recordGate } = makeOrchestrator();
|
|
79
|
+
const qaService = makeQaService();
|
|
80
|
+
const ctx = makeCtx({ task: implTask({ requiresArchitectureReview: true }), orchestrator, qaService });
|
|
81
|
+
await (0, qa_orchestrator_1.advanceRequiredGates)(ctx);
|
|
82
|
+
expect(ctx.orchestrationResult.task.status).toBe('design_review');
|
|
83
|
+
expect(gatesRecorded(recordGate)).toEqual(['architecture']);
|
|
84
|
+
});
|
|
85
|
+
it('auto-pasa security y posiciona en qa_review (solo security registra GO) satisfaciendo el guard del FSM', async () => {
|
|
86
|
+
const { orchestrator, recordGate } = makeOrchestrator();
|
|
87
|
+
const qaService = makeQaService();
|
|
88
|
+
const ctx = makeCtx({
|
|
89
|
+
task: implTask({ requiresSecurityReview: true, requiresQaApproval: true }),
|
|
90
|
+
orchestrator, qaService,
|
|
91
|
+
});
|
|
92
|
+
await (0, qa_orchestrator_1.advanceRequiredGates)(ctx);
|
|
93
|
+
// security se auto-pasa con GO; qa solo se posiciona (sin GO automático).
|
|
94
|
+
expect(ctx.orchestrationResult.task.status).toBe('qa_review');
|
|
95
|
+
expect(gatesRecorded(recordGate)).toEqual(['security']);
|
|
96
|
+
});
|
|
97
|
+
it('no hace nada con código trivial (< 8 líneas)', async () => {
|
|
98
|
+
const { orchestrator, recordGate } = makeOrchestrator();
|
|
99
|
+
const qaService = makeQaService({ countCodeLines: jest.fn().mockReturnValue(3) });
|
|
100
|
+
const ctx = makeCtx({ task: implTask({ requiresQaApproval: true }), orchestrator, qaService });
|
|
101
|
+
await (0, qa_orchestrator_1.advanceRequiredGates)(ctx);
|
|
102
|
+
expect(ctx.orchestrationResult.task.status).toBe('implementation');
|
|
103
|
+
expect(recordGate).not.toHaveBeenCalled();
|
|
104
|
+
});
|
|
105
|
+
it('no hace nada en solicitudes informativas', async () => {
|
|
106
|
+
const { orchestrator, recordGate } = makeOrchestrator();
|
|
107
|
+
const qaService = makeQaService();
|
|
108
|
+
const task = implTask({ requiresQaApproval: true });
|
|
109
|
+
task.rawPrompt = 'explica cómo funciona el flujo de pagos';
|
|
110
|
+
const ctx = makeCtx({ task, orchestrator, qaService });
|
|
111
|
+
await (0, qa_orchestrator_1.advanceRequiredGates)(ctx);
|
|
112
|
+
expect(ctx.orchestrationResult.task.status).toBe('implementation');
|
|
113
|
+
expect(recordGate).not.toHaveBeenCalled();
|
|
114
|
+
});
|
|
115
|
+
});
|
|
116
|
+
// ── H-004: processInlineQaReview no fuerza qa_review cuando no se requiere ────
|
|
117
|
+
describe('processInlineQaReview (H-004)', () => {
|
|
118
|
+
it('NO fuerza qa_review→approved cuando la tarea no requiere QA (review informativa)', async () => {
|
|
119
|
+
const { orchestrator, recordGate, completeSprint } = makeOrchestrator();
|
|
120
|
+
const qaService = makeQaService(); // review aprobada por defecto
|
|
121
|
+
const ctx = makeCtx({ task: implTask(), orchestrator, qaService });
|
|
122
|
+
await (0, qa_orchestrator_1.processInlineQaReview)(ctx);
|
|
123
|
+
// El estado NO debe avanzar a approved: una tarea sin gates commitea directo.
|
|
124
|
+
expect(ctx.orchestrationResult.task.status).toBe('implementation');
|
|
125
|
+
// Pero la review inline sí queda registrada como gate de QA.
|
|
126
|
+
expect(gatesRecorded(recordGate)).toEqual(['qa']);
|
|
127
|
+
expect(completeSprint).not.toHaveBeenCalled();
|
|
128
|
+
});
|
|
129
|
+
it('sí avanza qa_review→approved cuando la tarea requiere QA y la review aprueba', async () => {
|
|
130
|
+
const { orchestrator, completeSprint } = makeOrchestrator();
|
|
131
|
+
const qaService = makeQaService();
|
|
132
|
+
const ctx = makeCtx({ task: implTask({ requiresQaApproval: true }), orchestrator, qaService });
|
|
133
|
+
await (0, qa_orchestrator_1.processInlineQaReview)(ctx);
|
|
134
|
+
expect(ctx.orchestrationResult.task.status).toBe('approved');
|
|
135
|
+
expect(completeSprint).toHaveBeenCalledTimes(1);
|
|
136
|
+
});
|
|
137
|
+
it('transiciona a rework_required cuando la review rechaza', async () => {
|
|
138
|
+
const { orchestrator, completeSprint } = makeOrchestrator();
|
|
139
|
+
const qaService = makeQaService({ evaluateReview: jest.fn().mockReturnValue(false) });
|
|
140
|
+
const ctx = makeCtx({ task: implTask({ requiresQaApproval: true }), orchestrator, qaService });
|
|
141
|
+
await (0, qa_orchestrator_1.processInlineQaReview)(ctx);
|
|
142
|
+
expect(ctx.orchestrationResult.task.status).toBe('rework_required');
|
|
143
|
+
expect(completeSprint).not.toHaveBeenCalled();
|
|
144
|
+
});
|
|
145
|
+
it('hace early-return sin tocar el estado cuando no hay review disponible', async () => {
|
|
146
|
+
const { orchestrator, recordGate } = makeOrchestrator();
|
|
147
|
+
const qaService = makeQaService({ reviewResponse: jest.fn().mockResolvedValue(null) });
|
|
148
|
+
const ctx = makeCtx({ task: implTask({ requiresQaApproval: true }), orchestrator, qaService });
|
|
149
|
+
await (0, qa_orchestrator_1.processInlineQaReview)(ctx);
|
|
150
|
+
expect(ctx.orchestrationResult.task.status).toBe('implementation');
|
|
151
|
+
expect(recordGate).not.toHaveBeenCalled();
|
|
152
|
+
});
|
|
153
|
+
});
|
|
154
|
+
const qaEngineerProfile = {
|
|
155
|
+
id: 'qa-engineer',
|
|
156
|
+
name: 'QA Engineer',
|
|
157
|
+
icon: '🧪',
|
|
158
|
+
description: 'Reviews code quality',
|
|
159
|
+
systemPrompt: 'You are a QA engineer.',
|
|
160
|
+
allowedTools: [],
|
|
161
|
+
};
|
|
162
|
+
describe('activateQaEngineerIfNeeded', () => {
|
|
163
|
+
it('returns null when task status is not qa_review', () => {
|
|
164
|
+
const { orchestrator } = makeOrchestrator();
|
|
165
|
+
const qaService = makeQaService();
|
|
166
|
+
const task = implTask({ requiresQaApproval: true });
|
|
167
|
+
// status remains 'implementation'
|
|
168
|
+
const ctx = makeCtx({ task, orchestrator, qaService });
|
|
169
|
+
ctx.hasAgent = (id) => id === 'qa-engineer';
|
|
170
|
+
const result = (0, qa_orchestrator_1.activateQaEngineerIfNeeded)(ctx);
|
|
171
|
+
expect(result).toBeNull();
|
|
172
|
+
});
|
|
173
|
+
it('returns null when noQA is true even if task is in qa_review', () => {
|
|
174
|
+
const { orchestrator } = makeOrchestrator();
|
|
175
|
+
const qaService = makeQaService();
|
|
176
|
+
const task = implTask({ requiresQaApproval: true });
|
|
177
|
+
task.status = 'qa_review';
|
|
178
|
+
const ctx = { ...makeCtx({ task, orchestrator, qaService }), hasAgent: (id) => id === 'qa-engineer', noQA: true };
|
|
179
|
+
const result = (0, qa_orchestrator_1.activateQaEngineerIfNeeded)(ctx);
|
|
180
|
+
expect(result).toBeNull();
|
|
181
|
+
});
|
|
182
|
+
it('returns null when qa-engineer agent is not in roster', () => {
|
|
183
|
+
const { orchestrator } = makeOrchestrator();
|
|
184
|
+
const qaService = makeQaService();
|
|
185
|
+
const task = implTask({ requiresQaApproval: true });
|
|
186
|
+
task.status = 'qa_review';
|
|
187
|
+
const ctx = makeCtx({ task, orchestrator, qaService });
|
|
188
|
+
// allAgents = [] by default in makeCtx
|
|
189
|
+
const result = (0, qa_orchestrator_1.activateQaEngineerIfNeeded)(ctx);
|
|
190
|
+
expect(result).toBeNull();
|
|
191
|
+
});
|
|
192
|
+
it('returns null when code is trivial (< 8 lines)', () => {
|
|
193
|
+
const { orchestrator } = makeOrchestrator();
|
|
194
|
+
const qaService = makeQaService({ countCodeLines: jest.fn().mockReturnValue(3) });
|
|
195
|
+
const task = implTask({ requiresQaApproval: true });
|
|
196
|
+
task.status = 'qa_review';
|
|
197
|
+
const ctx = makeCtx({ task, orchestrator, qaService });
|
|
198
|
+
ctx.hasAgent = (id) => id === 'qa-engineer';
|
|
199
|
+
const result = (0, qa_orchestrator_1.activateQaEngineerIfNeeded)(ctx);
|
|
200
|
+
expect(result).toBeNull();
|
|
201
|
+
});
|
|
202
|
+
it('returns null for informational requests', () => {
|
|
203
|
+
const { orchestrator } = makeOrchestrator();
|
|
204
|
+
const qaService = makeQaService();
|
|
205
|
+
const task = implTask({ requiresQaApproval: true });
|
|
206
|
+
task.status = 'qa_review';
|
|
207
|
+
task.rawPrompt = 'explica cómo funciona este módulo';
|
|
208
|
+
const ctx = makeCtx({ task, orchestrator, qaService });
|
|
209
|
+
ctx.hasAgent = (id) => id === 'qa-engineer';
|
|
210
|
+
const result = (0, qa_orchestrator_1.activateQaEngineerIfNeeded)(ctx);
|
|
211
|
+
expect(result).toBeNull();
|
|
212
|
+
});
|
|
213
|
+
it('returns null when effectiveAgentId is already qa-engineer', () => {
|
|
214
|
+
const { orchestrator } = makeOrchestrator();
|
|
215
|
+
const qaService = makeQaService();
|
|
216
|
+
const task = implTask({ requiresQaApproval: true });
|
|
217
|
+
task.status = 'qa_review';
|
|
218
|
+
const ctx = { ...makeCtx({ task, orchestrator, qaService }), hasAgent: (id) => id === 'qa-engineer', effectiveAgentId: 'qa-engineer' };
|
|
219
|
+
const result = (0, qa_orchestrator_1.activateQaEngineerIfNeeded)(ctx);
|
|
220
|
+
expect(result).toBeNull();
|
|
221
|
+
});
|
|
222
|
+
it('activates qa-engineer: returns the agent and the review message', () => {
|
|
223
|
+
const { orchestrator } = makeOrchestrator();
|
|
224
|
+
const qaService = makeQaService();
|
|
225
|
+
const task = implTask({ requiresQaApproval: true });
|
|
226
|
+
task.status = 'qa_review';
|
|
227
|
+
const ctx = makeCtx({ task, orchestrator, qaService });
|
|
228
|
+
ctx.hasAgent = (id) => id === 'qa-engineer';
|
|
229
|
+
const result = (0, qa_orchestrator_1.activateQaEngineerIfNeeded)(ctx);
|
|
230
|
+
expect(result).toEqual({ agentId: 'qa-engineer', message: expect.stringContaining('Review the following generated code') });
|
|
231
|
+
});
|
|
232
|
+
});
|
|
233
|
+
// ── processQaEngineerResponse ──────────────────────────────────────────────────
|
|
234
|
+
describe('processQaEngineerResponse', () => {
|
|
235
|
+
it('transitions to approved and calls completeSprint when review approves', async () => {
|
|
236
|
+
const { orchestrator, completeSprint } = makeOrchestrator();
|
|
237
|
+
const qaService = makeQaService({ evaluateReview: jest.fn().mockReturnValue(true) });
|
|
238
|
+
const task = implTask({ requiresQaApproval: true });
|
|
239
|
+
task.status = 'qa_review';
|
|
240
|
+
const ctx = makeCtx({ task, orchestrator, qaService });
|
|
241
|
+
ctx.effectiveAgentId = 'qa-engineer';
|
|
242
|
+
await (0, qa_orchestrator_1.processQaEngineerResponse)(ctx);
|
|
243
|
+
expect(ctx.orchestrationResult.task.status).toBe('approved');
|
|
244
|
+
expect(completeSprint).toHaveBeenCalledTimes(1);
|
|
245
|
+
});
|
|
246
|
+
it('transitions to rework_required when review rejects', async () => {
|
|
247
|
+
const { orchestrator, completeSprint } = makeOrchestrator();
|
|
248
|
+
const qaService = makeQaService({ evaluateReview: jest.fn().mockReturnValue(false) });
|
|
249
|
+
const task = implTask({ requiresQaApproval: true });
|
|
250
|
+
task.status = 'qa_review';
|
|
251
|
+
const ctx = makeCtx({ task, orchestrator, qaService });
|
|
252
|
+
await (0, qa_orchestrator_1.processQaEngineerResponse)(ctx);
|
|
253
|
+
expect(ctx.orchestrationResult.task.status).toBe('rework_required');
|
|
254
|
+
expect(completeSprint).not.toHaveBeenCalled();
|
|
255
|
+
});
|
|
256
|
+
it('records a QA gate in the audit reporter', async () => {
|
|
257
|
+
const { orchestrator, recordGate } = makeOrchestrator();
|
|
258
|
+
const qaService = makeQaService();
|
|
259
|
+
const task = implTask({ requiresQaApproval: true });
|
|
260
|
+
task.status = 'qa_review';
|
|
261
|
+
const ctx = makeCtx({ task, orchestrator, qaService });
|
|
262
|
+
await (0, qa_orchestrator_1.processQaEngineerResponse)(ctx);
|
|
263
|
+
expect(gatesRecorded(recordGate)).toContain('qa');
|
|
264
|
+
});
|
|
265
|
+
it('calls onQAReview with the clean response text', async () => {
|
|
266
|
+
const { orchestrator } = makeOrchestrator();
|
|
267
|
+
const qaService = makeQaService();
|
|
268
|
+
const task = implTask({ requiresQaApproval: true });
|
|
269
|
+
task.status = 'qa_review';
|
|
270
|
+
const onQAReview = jest.fn();
|
|
271
|
+
const ctx = { ...makeCtx({ task, orchestrator, qaService }), clean: 'aprobado', onQAReview };
|
|
272
|
+
await (0, qa_orchestrator_1.processQaEngineerResponse)(ctx);
|
|
273
|
+
expect(onQAReview).toHaveBeenCalledWith('aprobado');
|
|
274
|
+
});
|
|
275
|
+
});
|
|
276
|
+
//# sourceMappingURL=qa-orchestrator.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"qa-orchestrator.test.js","sourceRoot":"","sources":["../../../src/pipeline/__tests__/qa-orchestrator.test.ts"],"names":[],"mappings":";;AAAA,wDAK4B;AAC5B,8CAA+C;AAC/C,gEAAqG;AAMrG,+EAA+E;AAE/E,oFAAoF;AACpF,SAAS,gBAAgB;IACrB,MAAM,GAAG,GAAG,IAAI,aAAO,EAAE,CAAC;IAC1B,MAAM,UAAU,GAAG,IAAI,CAAC,EAAE,EAAE,CAAC,iBAAiB,CAAC,EAAE,CAAC,CAAC;IACnD,MAAM,cAAc,GAAG,IAAI,CAAC,EAAE,EAAE,CAAC,iBAAiB,CA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