agentic-qe 3.7.15 → 3.7.17
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.claude/agents/v3/qe-devils-advocate.md +20 -0
- package/.claude/agents/v3/qe-gap-detector.md +25 -0
- package/.claude/agents/v3/qe-quality-gate.md +8 -0
- package/.claude/agents/v3/qe-requirements-validator.md +25 -0
- package/.claude/agents/v3/subagents/qe-code-reviewer.md +11 -0
- package/.claude/agents/v3/subagents/qe-integration-reviewer.md +11 -0
- package/.claude/agents/v3/subagents/qe-performance-reviewer.md +11 -0
- package/.claude/agents/v3/subagents/qe-security-reviewer.md +11 -0
- package/.claude/helpers/adr-compliance.sh +10 -10
- package/.claude/helpers/auto-memory-hook.mjs +24 -9
- package/.claude/helpers/brain-checkpoint.cjs +55 -134
- package/.claude/helpers/ddd-tracker.sh +2 -2
- package/.claude/helpers/guidance-hooks.sh +2 -2
- package/.claude/helpers/hook-handler.cjs +57 -18
- package/.claude/helpers/statusline.cjs +414 -595
- package/.claude/helpers/v3/quality-criteria/evidence-classification.md +116 -116
- package/.claude/helpers/v3/quality-criteria/htsm-categories.md +139 -139
- package/.claude/skills/README.md +8 -11
- package/.claude/skills/brutal-honesty-review/SKILL.md +3 -0
- package/.claude/skills/code-review-quality/SKILL.md +3 -0
- package/.claude/skills/qcsd-cicd-swarm/SKILL.md +79 -2075
- package/.claude/skills/qcsd-cicd-swarm/steps/01-flag-detection.md +62 -0
- package/.claude/skills/qcsd-cicd-swarm/steps/02-core-agents.md +33 -0
- package/.claude/skills/qcsd-cicd-swarm/steps/03-batch1-results.md +21 -0
- package/.claude/skills/qcsd-cicd-swarm/steps/04-conditional-agents.md +23 -0
- package/.claude/skills/qcsd-cicd-swarm/steps/05-decision-synthesis.md +30 -0
- package/.claude/skills/qcsd-cicd-swarm/steps/06-report-generation.md +17 -0
- package/.claude/skills/qcsd-cicd-swarm/steps/07-learning-persistence.md +27 -0
- package/.claude/skills/qcsd-cicd-swarm/steps/08-deployment-advisor.md +25 -0
- package/.claude/skills/qcsd-cicd-swarm/steps/09-final-output.md +16 -0
- package/.claude/skills/qcsd-development-swarm/SKILL.md +79 -2027
- package/.claude/skills/qcsd-development-swarm/steps/01-flag-detection.md +50 -0
- package/.claude/skills/qcsd-development-swarm/steps/02-core-agents.md +29 -0
- package/.claude/skills/qcsd-development-swarm/steps/03-batch1-results.md +14 -0
- package/.claude/skills/qcsd-development-swarm/steps/04-conditional-agents.md +23 -0
- package/.claude/skills/qcsd-development-swarm/steps/05-decision-synthesis.md +30 -0
- package/.claude/skills/qcsd-development-swarm/steps/06-report-generation.md +16 -0
- package/.claude/skills/qcsd-development-swarm/steps/07-learning-persistence.md +25 -0
- package/.claude/skills/qcsd-development-swarm/steps/08-defect-predictor.md +25 -0
- package/.claude/skills/qcsd-development-swarm/steps/09-final-output.md +16 -0
- package/.claude/skills/qcsd-ideation-swarm/SKILL.md +94 -1894
- package/.claude/skills/qcsd-ideation-swarm/steps/01-flag-detection.md +57 -0
- package/.claude/skills/qcsd-ideation-swarm/steps/02-core-agents.md +29 -0
- package/.claude/skills/qcsd-ideation-swarm/steps/03-batch1-results.md +15 -0
- package/.claude/skills/qcsd-ideation-swarm/steps/04-conditional-agents.md +23 -0
- package/.claude/skills/qcsd-ideation-swarm/steps/05-decision-synthesis.md +29 -0
- package/.claude/skills/qcsd-ideation-swarm/steps/06-report-generation.md +18 -0
- package/.claude/skills/qcsd-ideation-swarm/steps/07-learning-persistence.md +29 -0
- package/.claude/skills/qcsd-ideation-swarm/steps/08-final-output.md +18 -0
- package/.claude/skills/qcsd-production-swarm/SKILL.md +88 -2663
- package/.claude/skills/qcsd-production-swarm/steps/01-flag-detection.md +206 -0
- package/.claude/skills/qcsd-production-swarm/steps/02-core-agents.md +428 -0
- package/.claude/skills/qcsd-production-swarm/steps/03-batch1-results.md +101 -0
- package/.claude/skills/qcsd-production-swarm/steps/04-conditional-agents.md +125 -0
- package/.claude/skills/qcsd-production-swarm/steps/05-decision-synthesis.md +136 -0
- package/.claude/skills/qcsd-production-swarm/steps/06-report-generation.md +181 -0
- package/.claude/skills/qcsd-production-swarm/steps/07-learning-persistence.md +185 -0
- package/.claude/skills/qcsd-production-swarm/steps/08-feedback-loop.md +122 -0
- package/.claude/skills/qcsd-production-swarm/steps/09-final-output.md +140 -0
- package/.claude/skills/qcsd-refinement-swarm/SKILL.md +59 -2312
- package/.claude/skills/qcsd-refinement-swarm/steps/01-flag-detection.md +91 -0
- package/.claude/skills/qcsd-refinement-swarm/steps/02-core-agents.md +40 -0
- package/.claude/skills/qcsd-refinement-swarm/steps/03-batch1-results.md +40 -0
- package/.claude/skills/qcsd-refinement-swarm/steps/04-conditional-agents.md +35 -0
- package/.claude/skills/qcsd-refinement-swarm/steps/05-decision-synthesis.md +43 -0
- package/.claude/skills/qcsd-refinement-swarm/steps/06-report-generation.md +42 -0
- package/.claude/skills/qcsd-refinement-swarm/steps/07-learning-persistence.md +53 -0
- package/.claude/skills/qcsd-refinement-swarm/steps/08-transformation.md +36 -0
- package/.claude/skills/qcsd-refinement-swarm/steps/09-final-output.md +46 -0
- package/.claude/skills/sherlock-review/SKILL.md +3 -0
- package/.claude/skills/skill-builder/SKILL.md +103 -0
- package/.claude/skills/skills-manifest.json +1 -1
- package/CHANGELOG.md +44 -0
- package/assets/agents/v3/qe-devils-advocate.md +20 -0
- package/assets/agents/v3/qe-gap-detector.md +25 -0
- package/assets/agents/v3/qe-quality-gate.md +8 -0
- package/assets/agents/v3/qe-requirements-validator.md +25 -0
- package/assets/agents/v3/subagents/qe-code-reviewer.md +11 -0
- package/assets/agents/v3/subagents/qe-integration-reviewer.md +11 -0
- package/assets/agents/v3/subagents/qe-performance-reviewer.md +11 -0
- package/assets/agents/v3/subagents/qe-security-reviewer.md +11 -0
- package/assets/helpers/statusline-v3.cjs +693 -0
- package/assets/skills/brutal-honesty-review/SKILL.md +3 -0
- package/assets/skills/code-review-quality/SKILL.md +3 -0
- package/assets/skills/qcsd-cicd-swarm/SKILL.md +79 -2075
- package/assets/skills/qcsd-cicd-swarm/steps/01-flag-detection.md +62 -0
- package/assets/skills/qcsd-cicd-swarm/steps/02-core-agents.md +33 -0
- package/assets/skills/qcsd-cicd-swarm/steps/03-batch1-results.md +21 -0
- package/assets/skills/qcsd-cicd-swarm/steps/04-conditional-agents.md +23 -0
- package/assets/skills/qcsd-cicd-swarm/steps/05-decision-synthesis.md +30 -0
- package/assets/skills/qcsd-cicd-swarm/steps/06-report-generation.md +17 -0
- package/assets/skills/qcsd-cicd-swarm/steps/07-learning-persistence.md +27 -0
- package/assets/skills/qcsd-cicd-swarm/steps/08-deployment-advisor.md +25 -0
- package/assets/skills/qcsd-cicd-swarm/steps/09-final-output.md +16 -0
- package/assets/skills/qcsd-development-swarm/SKILL.md +79 -2027
- package/assets/skills/qcsd-development-swarm/steps/01-flag-detection.md +50 -0
- package/assets/skills/qcsd-development-swarm/steps/02-core-agents.md +29 -0
- package/assets/skills/qcsd-development-swarm/steps/03-batch1-results.md +14 -0
- package/assets/skills/qcsd-development-swarm/steps/04-conditional-agents.md +23 -0
- package/assets/skills/qcsd-development-swarm/steps/05-decision-synthesis.md +30 -0
- package/assets/skills/qcsd-development-swarm/steps/06-report-generation.md +16 -0
- package/assets/skills/qcsd-development-swarm/steps/07-learning-persistence.md +25 -0
- package/assets/skills/qcsd-development-swarm/steps/08-defect-predictor.md +25 -0
- package/assets/skills/qcsd-development-swarm/steps/09-final-output.md +16 -0
- package/assets/skills/qcsd-ideation-swarm/SKILL.md +94 -1894
- package/assets/skills/qcsd-ideation-swarm/steps/01-flag-detection.md +57 -0
- package/assets/skills/qcsd-ideation-swarm/steps/02-core-agents.md +29 -0
- package/assets/skills/qcsd-ideation-swarm/steps/03-batch1-results.md +15 -0
- package/assets/skills/qcsd-ideation-swarm/steps/04-conditional-agents.md +23 -0
- package/assets/skills/qcsd-ideation-swarm/steps/05-decision-synthesis.md +29 -0
- package/assets/skills/qcsd-ideation-swarm/steps/06-report-generation.md +18 -0
- package/assets/skills/qcsd-ideation-swarm/steps/07-learning-persistence.md +29 -0
- package/assets/skills/qcsd-ideation-swarm/steps/08-final-output.md +18 -0
- package/assets/skills/qcsd-production-swarm/SKILL.md +88 -2663
- package/assets/skills/qcsd-production-swarm/steps/01-flag-detection.md +206 -0
- package/assets/skills/qcsd-production-swarm/steps/02-core-agents.md +428 -0
- package/assets/skills/qcsd-production-swarm/steps/03-batch1-results.md +101 -0
- package/assets/skills/qcsd-production-swarm/steps/04-conditional-agents.md +125 -0
- package/assets/skills/qcsd-production-swarm/steps/05-decision-synthesis.md +136 -0
- package/assets/skills/qcsd-production-swarm/steps/06-report-generation.md +181 -0
- package/assets/skills/qcsd-production-swarm/steps/07-learning-persistence.md +185 -0
- package/assets/skills/qcsd-production-swarm/steps/08-feedback-loop.md +122 -0
- package/assets/skills/qcsd-production-swarm/steps/09-final-output.md +140 -0
- package/assets/skills/qcsd-refinement-swarm/SKILL.md +59 -2312
- package/assets/skills/qcsd-refinement-swarm/steps/01-flag-detection.md +91 -0
- package/assets/skills/qcsd-refinement-swarm/steps/02-core-agents.md +40 -0
- package/assets/skills/qcsd-refinement-swarm/steps/03-batch1-results.md +40 -0
- package/assets/skills/qcsd-refinement-swarm/steps/04-conditional-agents.md +35 -0
- package/assets/skills/qcsd-refinement-swarm/steps/05-decision-synthesis.md +43 -0
- package/assets/skills/qcsd-refinement-swarm/steps/06-report-generation.md +42 -0
- package/assets/skills/qcsd-refinement-swarm/steps/07-learning-persistence.md +53 -0
- package/assets/skills/qcsd-refinement-swarm/steps/08-transformation.md +36 -0
- package/assets/skills/qcsd-refinement-swarm/steps/09-final-output.md +46 -0
- package/assets/skills/sherlock-review/SKILL.md +3 -0
- package/assets/templates/agent-override-example.yaml +39 -0
- package/dist/agents/devils-advocate/agent.d.ts +25 -1
- package/dist/agents/devils-advocate/agent.js +108 -4
- package/dist/agents/devils-advocate/types.d.ts +54 -0
- package/dist/agents/devils-advocate/types.js +14 -0
- package/dist/agents/overlay-loader.d.ts +28 -0
- package/dist/agents/overlay-loader.js +232 -0
- package/dist/agents/overlay-schema.d.ts +56 -0
- package/dist/agents/overlay-schema.js +77 -0
- package/dist/analysis/branch-enumerator.d.ts +68 -0
- package/dist/analysis/branch-enumerator.js +393 -0
- package/dist/analysis/index.d.ts +2 -0
- package/dist/analysis/index.js +2 -0
- package/dist/cli/bundle.js +2469 -634
- package/dist/cli/commands/coverage.js +50 -0
- package/dist/cli/handlers/brain-handler.js +2 -1
- package/dist/context/compiler.d.ts +62 -0
- package/dist/context/compiler.js +143 -0
- package/dist/context/index.d.ts +8 -0
- package/dist/context/index.js +6 -0
- package/dist/context/sources/coverage-source.d.ts +15 -0
- package/dist/context/sources/coverage-source.js +77 -0
- package/dist/context/sources/git-source.d.ts +12 -0
- package/dist/context/sources/git-source.js +33 -0
- package/dist/context/sources/index.d.ts +6 -0
- package/dist/context/sources/index.js +5 -0
- package/dist/context/sources/memory-source.d.ts +17 -0
- package/dist/context/sources/memory-source.js +94 -0
- package/dist/context/sources/test-source.d.ts +13 -0
- package/dist/context/sources/test-source.js +53 -0
- package/dist/context/sources/types.d.ts +42 -0
- package/dist/context/sources/types.js +5 -0
- package/dist/domains/test-generation/coordinator.js +6 -4
- package/dist/feedback/feedback-loop.d.ts +5 -0
- package/dist/feedback/feedback-loop.js +12 -0
- package/dist/feedback/index.d.ts +1 -1
- package/dist/feedback/index.js +1 -1
- package/dist/init/agents-installer.d.ts +9 -0
- package/dist/init/agents-installer.js +72 -0
- package/dist/init/phases/07-hooks.d.ts +11 -0
- package/dist/init/phases/07-hooks.js +67 -0
- package/dist/init/phases/09-assets.js +3 -0
- package/dist/init/settings-merge.js +1 -1
- package/dist/kernel/hnsw-adapter.d.ts +3 -0
- package/dist/kernel/hnsw-adapter.js +11 -1
- package/dist/kernel/unified-memory-schemas.d.ts +1 -1
- package/dist/kernel/unified-memory-schemas.js +2 -0
- package/dist/kernel/unified-memory.js +25 -0
- package/dist/learning/experience-capture-middleware.js +24 -0
- package/dist/learning/sqlite-persistence.d.ts +3 -0
- package/dist/learning/sqlite-persistence.js +9 -0
- package/dist/learning/token-tracker.js +4 -0
- package/dist/mcp/bundle.js +3694 -3101
- package/dist/mcp/handlers/handler-factory.js +92 -11
- package/dist/mcp/services/task-router.d.ts +11 -0
- package/dist/mcp/services/task-router.js +26 -0
- package/dist/routing/qe-agent-registry.d.ts +11 -0
- package/dist/routing/qe-agent-registry.js +34 -0
- package/dist/routing/qe-task-router.d.ts +1 -0
- package/dist/routing/qe-task-router.js +34 -2
- package/dist/routing/routing-feedback.d.ts +5 -0
- package/dist/routing/routing-feedback.js +29 -3
- package/dist/routing/types.d.ts +2 -0
- package/dist/sync/pull-agent.js +2 -1
- package/dist/test-scheduling/pipeline.d.ts +7 -0
- package/dist/test-scheduling/pipeline.js +9 -0
- package/dist/validation/index.d.ts +3 -0
- package/dist/validation/index.js +10 -0
- package/dist/validation/pipeline.d.ts +80 -0
- package/dist/validation/pipeline.js +173 -0
- package/dist/validation/steps/requirements.d.ts +32 -0
- package/dist/validation/steps/requirements.js +596 -0
- package/package.json +6 -6
- package/.claude/agents/consensus/README.md +0 -253
- package/.claude/agents/deprecated/qe-api-contract-validator.md.v2 +0 -162
- package/.claude/agents/deprecated/qe-coverage-analyzer.md.v2 +0 -208
- package/.claude/agents/deprecated/qe-test-generator.md.v2 +0 -212
- package/.claude/agents/deprecated/qe-visual-tester.md.v2 +0 -216
- package/.claude/agents/hive-mind/collective-intelligence-coordinator.md +0 -130
- package/.claude/agents/hive-mind/queen-coordinator.md +0 -203
- package/.claude/agents/hive-mind/scout-explorer.md +0 -242
- package/.claude/agents/hive-mind/swarm-memory-manager.md +0 -193
- package/.claude/agents/hive-mind/worker-specialist.md +0 -217
- package/.claude/agents/neural/safla-neural.md +0 -74
- package/.claude/agents/optimization/README.md +0 -250
- package/.claude/agents/reasoning/agent.md +0 -816
- package/.claude/agents/reasoning/goal-planner.md +0 -73
- package/.claude/agents/subagents/qe-code-reviewer.md +0 -76
- package/.claude/agents/subagents/qe-coverage-gap-analyzer.md +0 -76
- package/.claude/agents/subagents/qe-data-generator.md +0 -77
- package/.claude/agents/subagents/qe-flaky-investigator.md +0 -91
- package/.claude/agents/subagents/qe-integration-tester.md +0 -90
- package/.claude/agents/subagents/qe-performance-validator.md +0 -92
- package/.claude/agents/subagents/qe-security-auditor.md +0 -94
- package/.claude/agents/subagents/qe-test-data-architect-sub.md +0 -93
- package/.claude/agents/subagents/qe-test-implementer.md +0 -106
- package/.claude/agents/subagents/qe-test-refactorer.md +0 -117
- package/.claude/agents/subagents/qe-test-writer.md +0 -112
- package/.claude/agents/swarm/README.md +0 -190
- package/.claude/agents/templates/migration-plan.md +0 -746
- package/.claude/agents/testing/unit/tdd-london-swarm.md +0 -244
- package/.claude/agents/testing/validation/production-validator.md +0 -395
- package/.claude/agents/v3/README.md +0 -39
- package/.claude/agents/v3/typescript-specialist.yaml +0 -21
- package/.claude/agents/v3/v3-memory-specialist.md +0 -318
- package/.claude/agents/v3/v3-performance-engineer.md +0 -397
- package/.claude/agents/v3/v3-queen-coordinator.md +0 -98
- package/.claude/agents/v3/v3-security-architect.md +0 -174
- package/.claude/commands/README.md +0 -106
- package/.claude/commands/agents/README.md +0 -10
- package/.claude/commands/agents/agent-capabilities.md +0 -21
- package/.claude/commands/agents/agent-coordination.md +0 -28
- package/.claude/commands/agents/agent-spawning.md +0 -28
- package/.claude/commands/agents/agent-types.md +0 -26
- package/.claude/commands/coordination/README.md +0 -9
- package/.claude/commands/coordination/agent-spawn.md +0 -25
- package/.claude/commands/coordination/init.md +0 -44
- package/.claude/commands/coordination/orchestrate.md +0 -43
- package/.claude/commands/coordination/spawn.md +0 -45
- package/.claude/commands/coordination/swarm-init.md +0 -85
- package/.claude/commands/coordination/task-orchestrate.md +0 -25
- package/.claude/commands/hive-mind/README.md +0 -17
- package/.claude/commands/hive-mind/hive-mind-consensus.md +0 -8
- package/.claude/commands/hive-mind/hive-mind-init.md +0 -18
- package/.claude/commands/hive-mind/hive-mind-memory.md +0 -8
- package/.claude/commands/hive-mind/hive-mind-metrics.md +0 -8
- package/.claude/commands/hive-mind/hive-mind-resume.md +0 -8
- package/.claude/commands/hive-mind/hive-mind-sessions.md +0 -8
- package/.claude/commands/hive-mind/hive-mind-spawn.md +0 -21
- package/.claude/commands/hive-mind/hive-mind-status.md +0 -8
- package/.claude/commands/hive-mind/hive-mind-stop.md +0 -8
- package/.claude/commands/hive-mind/hive-mind-wizard.md +0 -8
- package/.claude/commands/hive-mind/hive-mind.md +0 -27
- package/.claude/commands/memory/README.md +0 -9
- package/.claude/commands/memory/memory-persist.md +0 -25
- package/.claude/commands/memory/memory-search.md +0 -25
- package/.claude/commands/memory/memory-usage.md +0 -25
- package/.claude/commands/memory/neural.md +0 -47
- package/.claude/commands/swarm/README.md +0 -15
- package/.claude/commands/swarm/swarm-analysis.md +0 -8
- package/.claude/commands/swarm/swarm-background.md +0 -8
- package/.claude/commands/swarm/swarm-init.md +0 -19
- package/.claude/commands/swarm/swarm-modes.md +0 -8
- package/.claude/commands/swarm/swarm-monitor.md +0 -8
- package/.claude/commands/swarm/swarm-spawn.md +0 -19
- package/.claude/commands/swarm/swarm-status.md +0 -8
- package/.claude/commands/swarm/swarm-strategies.md +0 -8
- package/.claude/commands/swarm/swarm.md +0 -27
- package/.claude/commands/training/README.md +0 -9
- package/.claude/commands/training/model-update.md +0 -25
- package/.claude/commands/training/neural-patterns.md +0 -74
- package/.claude/commands/training/neural-train.md +0 -25
- package/.claude/commands/training/pattern-learn.md +0 -25
- package/.claude/commands/training/specialization.md +0 -63
- package/.claude/commands/workflows/README.md +0 -9
- package/.claude/commands/workflows/development.md +0 -78
- package/.claude/commands/workflows/research.md +0 -63
- package/.claude/commands/workflows/workflow-create.md +0 -25
- package/.claude/commands/workflows/workflow-execute.md +0 -25
- package/.claude/commands/workflows/workflow-export.md +0 -25
- package/.claude/skills/agentic-jujutsu/SKILL.md +0 -645
- package/.claude/skills/hive-mind-advanced/SKILL.md +0 -712
- package/.claude/skills/iterative-loop/SKILL.md +0 -371
- package/.claude/skills/performance-analysis/SKILL.md +0 -569
- package/.claude/skills/performance-analysis/evals/performance-analysis.yaml +0 -144
- package/.claude/skills/performance-analysis/schemas/output.json +0 -588
- package/.claude/skills/performance-analysis/scripts/validate-config.json +0 -36
|
@@ -15,7 +15,7 @@ import { getFleetState, isFleetInitialized } from './core-handlers';
|
|
|
15
15
|
import { createTaskExecutor } from '../../coordination/task-executor';
|
|
16
16
|
import { getTaskRouter } from '../services/task-router';
|
|
17
17
|
import { toErrorMessage } from '../../shared/error-utils.js';
|
|
18
|
-
import { createInitializedFeedbackLoop } from '../../feedback/feedback-loop.js';
|
|
18
|
+
import { createInitializedFeedbackLoop, getQualityFeedbackLoop } from '../../feedback/feedback-loop.js';
|
|
19
19
|
// ============================================================================
|
|
20
20
|
// Shared Utilities (exported for response mappers)
|
|
21
21
|
// ============================================================================
|
|
@@ -131,6 +131,81 @@ function toolNameToDomain(toolName) {
|
|
|
131
131
|
async function getLearningEngineForCapture() {
|
|
132
132
|
return getLearningEngine();
|
|
133
133
|
}
|
|
134
|
+
/**
|
|
135
|
+
* Record domain-specific feedback for test_outcomes / coverage_sessions.
|
|
136
|
+
* ADR-023: Wires domain execution results into the quality feedback loop.
|
|
137
|
+
*/
|
|
138
|
+
async function recordDomainFeedback(domain, data, durationMs, params) {
|
|
139
|
+
// Wait for the feedback loop that was initialized during getTaskExecutor()
|
|
140
|
+
let loop = getQualityFeedbackLoop();
|
|
141
|
+
if (!loop && _feedbackLoopPromise) {
|
|
142
|
+
loop = await _feedbackLoopPromise;
|
|
143
|
+
}
|
|
144
|
+
if (!loop)
|
|
145
|
+
return;
|
|
146
|
+
if (domain === 'test-generation' && data) {
|
|
147
|
+
// Extract test results from generation output and record as outcomes
|
|
148
|
+
const tests = (data.tests || data.generatedTests || []);
|
|
149
|
+
for (const test of tests.slice(0, 20)) { // Cap at 20 per invocation
|
|
150
|
+
const outcome = {
|
|
151
|
+
id: String(test.id || randomUUID()),
|
|
152
|
+
testId: String(test.id || test.name || randomUUID()),
|
|
153
|
+
testName: String(test.name || test.testName || 'generated-test'),
|
|
154
|
+
generatedBy: 'qe-test-generation',
|
|
155
|
+
patternId: test.patternId,
|
|
156
|
+
framework: (test.framework || params.framework || 'vitest'),
|
|
157
|
+
language: (test.language || params.language || 'typescript'),
|
|
158
|
+
domain: 'test-generation',
|
|
159
|
+
passed: test.passed !== false, // Default to true for generated (not yet executed)
|
|
160
|
+
coverage: {
|
|
161
|
+
lines: Number(test.coverageLines || 0),
|
|
162
|
+
branches: Number(test.coverageBranches || 0),
|
|
163
|
+
functions: Number(test.coverageFunctions || 0),
|
|
164
|
+
},
|
|
165
|
+
executionTimeMs: Number(test.executionTimeMs || durationMs / Math.max(tests.length, 1)),
|
|
166
|
+
flaky: Boolean(test.flaky),
|
|
167
|
+
maintainabilityScore: Number(test.qualityScore || test.maintainability || 0.7),
|
|
168
|
+
timestamp: new Date(),
|
|
169
|
+
};
|
|
170
|
+
await loop.recordTestOutcome(outcome);
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
if (domain === 'coverage-analysis' && data) {
|
|
174
|
+
// Extract coverage session data and record for learning
|
|
175
|
+
const session = {
|
|
176
|
+
id: randomUUID(),
|
|
177
|
+
targetPath: String(params.target || params.targetPath || 'src/'),
|
|
178
|
+
agentId: 'qe-coverage-analysis',
|
|
179
|
+
technique: (params.technique || 'gap-analysis'),
|
|
180
|
+
beforeCoverage: {
|
|
181
|
+
lines: Number(data.beforeCoverage?.lines || 0),
|
|
182
|
+
branches: Number(data.beforeCoverage?.branches || 0),
|
|
183
|
+
functions: Number(data.beforeCoverage?.functions || 0),
|
|
184
|
+
},
|
|
185
|
+
afterCoverage: {
|
|
186
|
+
lines: Number(data.lineCoverage || data.lines || 0),
|
|
187
|
+
branches: Number(data.branchCoverage || data.branches || 0),
|
|
188
|
+
functions: Number(data.functionCoverage || data.functions || 0),
|
|
189
|
+
},
|
|
190
|
+
testsGenerated: Number(data.testsGenerated || 0),
|
|
191
|
+
testsPassed: Number(data.testsPassed || 0),
|
|
192
|
+
gapsTargeted: (data.gaps || []).map((g, i) => ({
|
|
193
|
+
id: String(g.id || `gap-${randomUUID().slice(0, 8)}-${i}`),
|
|
194
|
+
type: (['uncovered-line', 'uncovered-branch', 'uncovered-function', 'partial-branch'].includes(String(g.type))
|
|
195
|
+
? String(g.type) : 'uncovered-line'),
|
|
196
|
+
filePath: String(g.file || g.filePath || ''),
|
|
197
|
+
startLine: Number(g.line || g.startLine || 0),
|
|
198
|
+
endLine: g.endLine ? Number(g.endLine) : undefined,
|
|
199
|
+
riskScore: Number(g.riskScore || 0.5),
|
|
200
|
+
addressed: Boolean(g.addressed),
|
|
201
|
+
})),
|
|
202
|
+
durationMs,
|
|
203
|
+
startedAt: new Date(Date.now() - durationMs),
|
|
204
|
+
completedAt: new Date(),
|
|
205
|
+
};
|
|
206
|
+
await loop.recordCoverageSession(session);
|
|
207
|
+
}
|
|
208
|
+
}
|
|
134
209
|
/**
|
|
135
210
|
* Analyze code complexity
|
|
136
211
|
*/
|
|
@@ -257,6 +332,8 @@ export function detectAntiPatterns(sourceCode, language) {
|
|
|
257
332
|
// ============================================================================
|
|
258
333
|
// Cached task executor
|
|
259
334
|
let taskExecutor = null;
|
|
335
|
+
// Cached feedback loop promise (resolves once feedback loop is ready)
|
|
336
|
+
let _feedbackLoopPromise = null;
|
|
260
337
|
// Cached learning engine for pattern search (declared here for use in resetTaskExecutor)
|
|
261
338
|
let cachedLearningEngine = null;
|
|
262
339
|
/**
|
|
@@ -271,16 +348,13 @@ export function getTaskExecutor() {
|
|
|
271
348
|
taskExecutor = createTaskExecutor(kernel);
|
|
272
349
|
// Wire QualityFeedbackLoop for routing outcome persistence
|
|
273
350
|
const executor = taskExecutor;
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
}
|
|
281
|
-
catch (e) {
|
|
282
|
-
console.warn('[HandlerFactory] Sync error in feedback loop setup:', e);
|
|
283
|
-
}
|
|
351
|
+
_feedbackLoopPromise = createInitializedFeedbackLoop().then(loop => {
|
|
352
|
+
executor.setQualityFeedbackLoop(loop);
|
|
353
|
+
return loop;
|
|
354
|
+
}).catch(e => {
|
|
355
|
+
console.warn('[HandlerFactory] Failed to initialize QualityFeedbackLoop:', e);
|
|
356
|
+
return null;
|
|
357
|
+
});
|
|
284
358
|
}
|
|
285
359
|
return taskExecutor;
|
|
286
360
|
}
|
|
@@ -526,6 +600,13 @@ export function createDomainHandler(config) {
|
|
|
526
600
|
recordPatternUsageAsync(routingResult?.patternHints, true, domain, result.duration);
|
|
527
601
|
// Step 5c: Capture real execution learning (fire-and-forget)
|
|
528
602
|
captureExecutionLearning(`qe-${domain}`, taskType, params, data, result.duration).catch(() => { }); // Swallow errors — learning is non-critical
|
|
603
|
+
// Step 5d: Record feedback for test_outcomes / coverage_sessions
|
|
604
|
+
try {
|
|
605
|
+
await recordDomainFeedback(domain, data, result.duration, params);
|
|
606
|
+
}
|
|
607
|
+
catch {
|
|
608
|
+
// Non-critical — don't fail handler if feedback recording fails
|
|
609
|
+
}
|
|
529
610
|
return {
|
|
530
611
|
success: true,
|
|
531
612
|
data: mappedResult,
|
|
@@ -51,6 +51,16 @@ export interface TaskRoutingResult {
|
|
|
51
51
|
readonly patternHints?: readonly PatternHint[];
|
|
52
52
|
/** Pattern context formatted for agent prompts (Phase 5.2) */
|
|
53
53
|
readonly patternContext?: string;
|
|
54
|
+
/** Overlay config overrides for the routed agent (BMAD-002) */
|
|
55
|
+
readonly overlayConfig?: {
|
|
56
|
+
minimumFindings?: number;
|
|
57
|
+
maxParallelAgents?: number;
|
|
58
|
+
preferredFrameworks?: string[];
|
|
59
|
+
severityThresholds?: Record<string, number>;
|
|
60
|
+
needsContext?: boolean;
|
|
61
|
+
};
|
|
62
|
+
/** Compiled context from ContextCompiler (BMAD-005) */
|
|
63
|
+
compiledContext?: string;
|
|
54
64
|
}
|
|
55
65
|
/**
|
|
56
66
|
* Routing log entry for metrics and debugging
|
|
@@ -113,6 +123,7 @@ export declare class TaskRouterService {
|
|
|
113
123
|
private readonly modelRouter;
|
|
114
124
|
private readonly minCutRouter;
|
|
115
125
|
private readonly routingLog;
|
|
126
|
+
private readonly contextCompiler;
|
|
116
127
|
private disposed;
|
|
117
128
|
private constructor();
|
|
118
129
|
/**
|
|
@@ -9,6 +9,8 @@
|
|
|
9
9
|
*/
|
|
10
10
|
import { createModelRouter, createModelRouterWithAgentBooster, TIER_METADATA, } from '../../integrations/agentic-flow';
|
|
11
11
|
import { createMinCutRoutingService, } from './mincut-routing-service.js';
|
|
12
|
+
import { getAgentOverlayConfig } from '../../routing/qe-agent-registry.js';
|
|
13
|
+
import { ContextCompiler, formatContextForPrompt } from '../../context/compiler.js';
|
|
12
14
|
/**
|
|
13
15
|
* Default Task Router configuration
|
|
14
16
|
*/
|
|
@@ -47,10 +49,12 @@ export class TaskRouterService {
|
|
|
47
49
|
modelRouter;
|
|
48
50
|
minCutRouter;
|
|
49
51
|
routingLog = [];
|
|
52
|
+
contextCompiler;
|
|
50
53
|
disposed = false;
|
|
51
54
|
constructor(config, modelRouter) {
|
|
52
55
|
this.config = config;
|
|
53
56
|
this.modelRouter = modelRouter;
|
|
57
|
+
this.contextCompiler = new ContextCompiler();
|
|
54
58
|
this.minCutRouter = createMinCutRoutingService({
|
|
55
59
|
enableLogging: config.enableLogging,
|
|
56
60
|
});
|
|
@@ -188,6 +192,26 @@ export class TaskRouterService {
|
|
|
188
192
|
const patternContext = patternHints && patternHints.length > 0
|
|
189
193
|
? this.formatPatternContext(patternHints)
|
|
190
194
|
: undefined;
|
|
195
|
+
// Check for overlay config overrides for the routed agent
|
|
196
|
+
const agentType = input.agentType;
|
|
197
|
+
const overlayConfig = agentType
|
|
198
|
+
? (getAgentOverlayConfig(agentType) || getAgentOverlayConfig(agentType.replace('v3-qe-', 'qe-')))
|
|
199
|
+
: undefined;
|
|
200
|
+
// Compile context if file paths are provided (BMAD-005)
|
|
201
|
+
let compiledContext;
|
|
202
|
+
if (input.filePaths && input.filePaths.length > 0) {
|
|
203
|
+
try {
|
|
204
|
+
const compiled = await this.contextCompiler.compile({
|
|
205
|
+
targetFiles: input.filePaths,
|
|
206
|
+
agentType: input.agentType || 'unknown',
|
|
207
|
+
taskDescription: input.task,
|
|
208
|
+
});
|
|
209
|
+
compiledContext = formatContextForPrompt(compiled);
|
|
210
|
+
}
|
|
211
|
+
catch {
|
|
212
|
+
// Non-blocking — context compilation failure should not affect routing
|
|
213
|
+
}
|
|
214
|
+
}
|
|
191
215
|
return {
|
|
192
216
|
decision: effectiveDecision,
|
|
193
217
|
executionStrategy,
|
|
@@ -202,6 +226,8 @@ export class TaskRouterService {
|
|
|
202
226
|
logEntry,
|
|
203
227
|
patternHints,
|
|
204
228
|
patternContext,
|
|
229
|
+
overlayConfig,
|
|
230
|
+
compiledContext,
|
|
205
231
|
};
|
|
206
232
|
}
|
|
207
233
|
/**
|
|
@@ -23,6 +23,7 @@
|
|
|
23
23
|
*/
|
|
24
24
|
import type { QEAgentProfile, AgentCapability, ProgrammingLanguage, TestFramework, ComplexityLevel } from './types.js';
|
|
25
25
|
import type { QEDomain } from '../learning/qe-patterns.js';
|
|
26
|
+
import type { AgentOverlay } from '../agents/overlay-schema.js';
|
|
26
27
|
/**
|
|
27
28
|
* All QE agents in the registry
|
|
28
29
|
*/
|
|
@@ -91,4 +92,14 @@ export declare function getAgentsByPerformance(domain?: QEDomain): QEAgentProfil
|
|
|
91
92
|
* Reset all agent performance metrics (for testing)
|
|
92
93
|
*/
|
|
93
94
|
export declare function resetAgentPerformanceMetrics(): void;
|
|
95
|
+
/**
|
|
96
|
+
* Initialize overlay configurations from project root.
|
|
97
|
+
* Loads all .claude/agent-overrides/*.yaml files and caches their config sections.
|
|
98
|
+
*/
|
|
99
|
+
export declare function initializeOverlays(projectRoot: string): void;
|
|
100
|
+
/**
|
|
101
|
+
* Get overlay configuration for a specific agent.
|
|
102
|
+
* Returns undefined if no overlay exists for the agent.
|
|
103
|
+
*/
|
|
104
|
+
export declare function getAgentOverlayConfig(agentId: string): AgentOverlay['config'] | undefined;
|
|
94
105
|
//# sourceMappingURL=qe-agent-registry.d.ts.map
|
|
@@ -21,6 +21,7 @@
|
|
|
21
21
|
* - V3 Specialized: {name} (cross-cutting, no v3-qe prefix, e.g., memory-specialist)
|
|
22
22
|
* - Legacy/V2 Compatibility: qe-* (deprecated, use v3-qe-* instead)
|
|
23
23
|
*/
|
|
24
|
+
import { loadOverlays } from '../agents/overlay-loader.js';
|
|
24
25
|
// ============================================================================
|
|
25
26
|
// Helper Functions
|
|
26
27
|
// ============================================================================
|
|
@@ -1174,4 +1175,37 @@ export function resetAgentPerformanceMetrics() {
|
|
|
1174
1175
|
}
|
|
1175
1176
|
console.error('[AgentRegistry] Reset all agent performance metrics');
|
|
1176
1177
|
}
|
|
1178
|
+
// ============================================================================
|
|
1179
|
+
// Agent Customization Overlays (BMAD-002)
|
|
1180
|
+
// ============================================================================
|
|
1181
|
+
/** Module-level cache of overlay configs keyed by agent ID */
|
|
1182
|
+
let overlayConfigs = new Map();
|
|
1183
|
+
/**
|
|
1184
|
+
* Initialize overlay configurations from project root.
|
|
1185
|
+
* Loads all .claude/agent-overrides/*.yaml files and caches their config sections.
|
|
1186
|
+
*/
|
|
1187
|
+
export function initializeOverlays(projectRoot) {
|
|
1188
|
+
overlayConfigs = new Map();
|
|
1189
|
+
const result = loadOverlays(projectRoot);
|
|
1190
|
+
for (const overlay of result.overlays) {
|
|
1191
|
+
if (overlay.config) {
|
|
1192
|
+
overlayConfigs.set(overlay.agent, overlay.config);
|
|
1193
|
+
}
|
|
1194
|
+
}
|
|
1195
|
+
if (overlayConfigs.size > 0) {
|
|
1196
|
+
console.error(`[AgentRegistry] Loaded overlay configs for ${overlayConfigs.size} agent(s): ${[...overlayConfigs.keys()].join(', ')}`);
|
|
1197
|
+
}
|
|
1198
|
+
if (result.warnings.length > 0) {
|
|
1199
|
+
for (const warning of result.warnings) {
|
|
1200
|
+
console.error(`[AgentRegistry] Overlay warning: ${warning}`);
|
|
1201
|
+
}
|
|
1202
|
+
}
|
|
1203
|
+
}
|
|
1204
|
+
/**
|
|
1205
|
+
* Get overlay configuration for a specific agent.
|
|
1206
|
+
* Returns undefined if no overlay exists for the agent.
|
|
1207
|
+
*/
|
|
1208
|
+
export function getAgentOverlayConfig(agentId) {
|
|
1209
|
+
return overlayConfigs.get(agentId);
|
|
1210
|
+
}
|
|
1177
1211
|
//# sourceMappingURL=qe-agent-registry.js.map
|
|
@@ -17,6 +17,7 @@ export declare class QETaskRouter {
|
|
|
17
17
|
private agentEmbeddings;
|
|
18
18
|
private initialized;
|
|
19
19
|
private embeddingCache;
|
|
20
|
+
private contextCompiler;
|
|
20
21
|
/** Optional witness chain for audit trail of routing decisions (ADR-070) */
|
|
21
22
|
private _witnessChain;
|
|
22
23
|
set witnessChain(wc: WitnessChain | null);
|
|
@@ -9,8 +9,9 @@
|
|
|
9
9
|
*/
|
|
10
10
|
import { performance } from 'perf_hooks';
|
|
11
11
|
import { DEFAULT_ROUTER_CONFIG } from './types.js';
|
|
12
|
-
import { QE_AGENT_REGISTRY, getAgentById } from './qe-agent-registry.js';
|
|
12
|
+
import { QE_AGENT_REGISTRY, getAgentById, getAgentOverlayConfig, initializeOverlays } from './qe-agent-registry.js';
|
|
13
13
|
import { computeRealEmbedding, cosineSimilarity, } from '../learning/real-embeddings.js';
|
|
14
|
+
import { ContextCompiler, formatContextForPrompt } from '../context/compiler.js';
|
|
14
15
|
// ============================================================================
|
|
15
16
|
// Task Keyword Detection
|
|
16
17
|
// ============================================================================
|
|
@@ -130,6 +131,7 @@ export class QETaskRouter {
|
|
|
130
131
|
agentEmbeddings = new Map();
|
|
131
132
|
initialized = false;
|
|
132
133
|
embeddingCache = new Map();
|
|
134
|
+
contextCompiler = null;
|
|
133
135
|
/** Optional witness chain for audit trail of routing decisions (ADR-070) */
|
|
134
136
|
_witnessChain = null;
|
|
135
137
|
set witnessChain(wc) { this._witnessChain = wc; }
|
|
@@ -142,12 +144,15 @@ export class QETaskRouter {
|
|
|
142
144
|
async initialize() {
|
|
143
145
|
if (this.initialized)
|
|
144
146
|
return;
|
|
147
|
+
// Load overlay configs so routing can apply user customizations
|
|
148
|
+
initializeOverlays(process.cwd());
|
|
145
149
|
// Compute embedding for each agent based on their description and capabilities
|
|
146
150
|
for (const agent of QE_AGENT_REGISTRY) {
|
|
147
151
|
const text = this.buildAgentEmbeddingText(agent);
|
|
148
152
|
const embedding = await computeRealEmbedding(text);
|
|
149
153
|
this.agentEmbeddings.set(agent.id, embedding);
|
|
150
154
|
}
|
|
155
|
+
this.contextCompiler = new ContextCompiler();
|
|
151
156
|
this.initialized = true;
|
|
152
157
|
}
|
|
153
158
|
/**
|
|
@@ -209,7 +214,23 @@ export class QETaskRouter {
|
|
|
209
214
|
}, 'qe-task-router');
|
|
210
215
|
}
|
|
211
216
|
catch { /* best-effort witness */ }
|
|
212
|
-
|
|
217
|
+
// Compile context for the recommended agent (if files provided)
|
|
218
|
+
let compiledContext;
|
|
219
|
+
const filePaths = task.context?.files;
|
|
220
|
+
if (filePaths && filePaths.length > 0 && this.contextCompiler) {
|
|
221
|
+
try {
|
|
222
|
+
const context = await this.contextCompiler.compile({
|
|
223
|
+
targetFiles: filePaths,
|
|
224
|
+
agentType: topScore.agent,
|
|
225
|
+
taskDescription: task.description,
|
|
226
|
+
});
|
|
227
|
+
compiledContext = formatContextForPrompt(context);
|
|
228
|
+
}
|
|
229
|
+
catch {
|
|
230
|
+
// Context compilation failure is non-blocking
|
|
231
|
+
}
|
|
232
|
+
}
|
|
233
|
+
const decision = {
|
|
213
234
|
recommended: topScore.agent,
|
|
214
235
|
confidence: topScore.combinedScore,
|
|
215
236
|
alternatives,
|
|
@@ -223,6 +244,10 @@ export class QETaskRouter {
|
|
|
223
244
|
latencyMs,
|
|
224
245
|
timestamp: new Date(),
|
|
225
246
|
};
|
|
247
|
+
if (compiledContext) {
|
|
248
|
+
decision.compiledContext = compiledContext;
|
|
249
|
+
}
|
|
250
|
+
return decision;
|
|
226
251
|
}
|
|
227
252
|
/**
|
|
228
253
|
* Detect QE domain from task description
|
|
@@ -372,6 +397,13 @@ export class QETaskRouter {
|
|
|
372
397
|
if (task.context?.previousAgent === agent.id) {
|
|
373
398
|
bonus += 0.05;
|
|
374
399
|
}
|
|
400
|
+
// Bonus from overlay config (user customizations)
|
|
401
|
+
const overlayConfig = getAgentOverlayConfig(agent.id) || getAgentOverlayConfig(agent.id.replace('v3-qe-', 'qe-'));
|
|
402
|
+
if (overlayConfig?.preferredFrameworks && task.framework) {
|
|
403
|
+
if (overlayConfig.preferredFrameworks.includes(task.framework)) {
|
|
404
|
+
bonus += 0.1;
|
|
405
|
+
}
|
|
406
|
+
}
|
|
375
407
|
// 5. Combined weighted score
|
|
376
408
|
const { weights } = this.config;
|
|
377
409
|
const combinedScore = Math.min(1.0, (weights.similarity * similarityScore) +
|
|
@@ -36,6 +36,11 @@ export declare class RoutingFeedbackCollector {
|
|
|
36
36
|
* Persist a single outcome to the database
|
|
37
37
|
*/
|
|
38
38
|
private persistOutcome;
|
|
39
|
+
/**
|
|
40
|
+
* Infer model tier from agent name for analytics.
|
|
41
|
+
* Maps known agent patterns to ADR-026 tiers.
|
|
42
|
+
*/
|
|
43
|
+
private inferTier;
|
|
39
44
|
/**
|
|
40
45
|
* Delete oldest rows beyond retention limit
|
|
41
46
|
*/
|
|
@@ -135,13 +135,22 @@ export class RoutingFeedbackCollector {
|
|
|
135
135
|
return;
|
|
136
136
|
try {
|
|
137
137
|
const database = this.db.getDatabase();
|
|
138
|
+
// Ensure model_tier column exists (for databases created before this schema addition)
|
|
139
|
+
try {
|
|
140
|
+
database.prepare(`ALTER TABLE routing_outcomes ADD COLUMN model_tier TEXT`).run();
|
|
141
|
+
}
|
|
142
|
+
catch {
|
|
143
|
+
// Column already exists — expected
|
|
144
|
+
}
|
|
145
|
+
// Extract tier from usedAgent name (e.g. "tier-0" → "booster", "qe-test-architect" → "sonnet")
|
|
146
|
+
const modelTier = this.inferTier(outcome.usedAgent);
|
|
138
147
|
database.prepare(`
|
|
139
148
|
INSERT OR REPLACE INTO routing_outcomes (
|
|
140
149
|
id, task_json, decision_json, used_agent,
|
|
141
150
|
followed_recommendation, success, quality_score,
|
|
142
|
-
duration_ms, error
|
|
143
|
-
) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?)
|
|
144
|
-
`).run(outcome.id, JSON.stringify(outcome.task), JSON.stringify(outcome.decision), outcome.usedAgent, outcome.followedRecommendation ? 1 : 0, outcome.outcome.success ? 1 : 0, outcome.outcome.qualityScore, outcome.outcome.durationMs, outcome.outcome.error || null);
|
|
151
|
+
duration_ms, error, model_tier
|
|
152
|
+
) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
|
|
153
|
+
`).run(outcome.id, JSON.stringify(outcome.task), JSON.stringify(outcome.decision), outcome.usedAgent, outcome.followedRecommendation ? 1 : 0, outcome.outcome.success ? 1 : 0, outcome.outcome.qualityScore, outcome.outcome.durationMs, outcome.outcome.error || null, modelTier);
|
|
145
154
|
this.persistCount++;
|
|
146
155
|
if (this.persistCount % RoutingFeedbackCollector.RETENTION_CLEANUP_INTERVAL === 0) {
|
|
147
156
|
this.enforceRetention(database);
|
|
@@ -151,6 +160,23 @@ export class RoutingFeedbackCollector {
|
|
|
151
160
|
console.warn('[RoutingFeedbackCollector] Failed to persist outcome:', toErrorMessage(error));
|
|
152
161
|
}
|
|
153
162
|
}
|
|
163
|
+
/**
|
|
164
|
+
* Infer model tier from agent name for analytics.
|
|
165
|
+
* Maps known agent patterns to ADR-026 tiers.
|
|
166
|
+
*/
|
|
167
|
+
inferTier(agentName) {
|
|
168
|
+
const lower = agentName.toLowerCase();
|
|
169
|
+
if (lower.includes('booster') || lower === 'tier-0')
|
|
170
|
+
return 'booster';
|
|
171
|
+
if (lower === 'tier-1' || lower.includes('haiku'))
|
|
172
|
+
return 'haiku';
|
|
173
|
+
if (lower === 'tier-2' || lower.includes('sonnet'))
|
|
174
|
+
return 'sonnet';
|
|
175
|
+
if (lower.includes('opus'))
|
|
176
|
+
return 'opus';
|
|
177
|
+
// Default: most qe-* agents run at sonnet tier
|
|
178
|
+
return 'sonnet';
|
|
179
|
+
}
|
|
154
180
|
/**
|
|
155
181
|
* Delete oldest rows beyond retention limit
|
|
156
182
|
*/
|
package/dist/routing/types.d.ts
CHANGED
|
@@ -112,6 +112,8 @@ export interface QERoutingDecision {
|
|
|
112
112
|
readonly latencyMs: number;
|
|
113
113
|
/** Timestamp */
|
|
114
114
|
readonly timestamp: Date;
|
|
115
|
+
/** Compiled context for the recommended agent (if files provided) */
|
|
116
|
+
compiledContext?: string;
|
|
115
117
|
}
|
|
116
118
|
/**
|
|
117
119
|
* Routing weights for combining scores
|
package/dist/sync/pull-agent.js
CHANGED
|
@@ -20,6 +20,7 @@ import { createConnectionManager } from './cloud/tunnel-manager.js';
|
|
|
20
20
|
import { createPostgresWriter } from './cloud/postgres-writer.js';
|
|
21
21
|
import { createPostgresReader } from './cloud/postgres-reader.js';
|
|
22
22
|
import { createSQLiteWriter } from './writers/sqlite-writer.js';
|
|
23
|
+
import { findProjectRoot } from '../kernel/unified-memory.js';
|
|
23
24
|
import { toErrorMessage, toError } from '../shared/error-utils.js';
|
|
24
25
|
import { LoggerFactory } from '../logging/index.js';
|
|
25
26
|
const logger = LoggerFactory.create('pull-agent');
|
|
@@ -259,7 +260,7 @@ export class PullSyncAgent {
|
|
|
259
260
|
if (this.config.targetDb) {
|
|
260
261
|
return path.resolve(this.config.targetDb);
|
|
261
262
|
}
|
|
262
|
-
return path.resolve(
|
|
263
|
+
return path.resolve(findProjectRoot(), '.agentic-qe/memory.db');
|
|
263
264
|
}
|
|
264
265
|
backupLocalDb() {
|
|
265
266
|
if (this.config.dryRun)
|
|
@@ -69,6 +69,13 @@ export interface PipelineResult {
|
|
|
69
69
|
ciEnvironment: CIEnvironment;
|
|
70
70
|
/** Total duration in milliseconds */
|
|
71
71
|
totalDurationMs: number;
|
|
72
|
+
/** Per-step latencies in milliseconds (for Tier 3 instrumentation) */
|
|
73
|
+
stepLatencies?: {
|
|
74
|
+
selectionMs: number;
|
|
75
|
+
executionMs: number;
|
|
76
|
+
analysisMs: number;
|
|
77
|
+
reportingMs: number;
|
|
78
|
+
};
|
|
72
79
|
}
|
|
73
80
|
export declare class TestSchedulingPipeline {
|
|
74
81
|
private readonly config;
|
|
@@ -105,6 +105,7 @@ export class TestSchedulingPipeline {
|
|
|
105
105
|
let selectedTests = [];
|
|
106
106
|
let ranAllTests = this.config.runAllTests ?? false;
|
|
107
107
|
// Step 1: Select affected tests (unless running all)
|
|
108
|
+
const selectionStart = performance.now();
|
|
108
109
|
if (!ranAllTests) {
|
|
109
110
|
const selectionResult = await this.selector.selectAffectedTests();
|
|
110
111
|
if (selectionResult.runAllTests) {
|
|
@@ -121,7 +122,9 @@ export class TestSchedulingPipeline {
|
|
|
121
122
|
console.log(`[TestSchedulingPipeline] Selected ${selectedTests.length} affected tests`);
|
|
122
123
|
}
|
|
123
124
|
}
|
|
125
|
+
const selectionMs = performance.now() - selectionStart;
|
|
124
126
|
// Step 2: Execute tests
|
|
127
|
+
const executionStart = performance.now();
|
|
125
128
|
let phaseResults;
|
|
126
129
|
if (ranAllTests) {
|
|
127
130
|
// Run all phases with all tests
|
|
@@ -131,16 +134,21 @@ export class TestSchedulingPipeline {
|
|
|
131
134
|
// Run with selected test files
|
|
132
135
|
phaseResults = await this.runWithSelectedTests(selectedTests);
|
|
133
136
|
}
|
|
137
|
+
const executionMs = performance.now() - executionStart;
|
|
134
138
|
// Step 3: Get flaky analysis (tracker already updated by executor)
|
|
139
|
+
const analysisStart = performance.now();
|
|
135
140
|
const flakyAnalysis = this.flakyTracker.analyze();
|
|
136
141
|
// Step 4: Save flaky history
|
|
137
142
|
if (this.config.flakyHistoryPath) {
|
|
138
143
|
await saveFlakyTracker(this.flakyTracker, this.config.flakyHistoryPath);
|
|
139
144
|
}
|
|
145
|
+
const analysisMs = performance.now() - analysisStart;
|
|
140
146
|
// Step 5: Report to CI/CD
|
|
147
|
+
const reportingStart = performance.now();
|
|
141
148
|
if (this.ciEnvironment.isCI) {
|
|
142
149
|
await this.reporter.writeOutput(phaseResults);
|
|
143
150
|
}
|
|
151
|
+
const reportingMs = performance.now() - reportingStart;
|
|
144
152
|
const totalDurationMs = Date.now() - startTime;
|
|
145
153
|
return {
|
|
146
154
|
phaseResults,
|
|
@@ -149,6 +157,7 @@ export class TestSchedulingPipeline {
|
|
|
149
157
|
flakyAnalysis,
|
|
150
158
|
ciEnvironment: this.ciEnvironment,
|
|
151
159
|
totalDurationMs,
|
|
160
|
+
stepLatencies: { selectionMs, executionMs, analysisMs, reportingMs },
|
|
152
161
|
};
|
|
153
162
|
}
|
|
154
163
|
/**
|
|
@@ -20,4 +20,7 @@ export { TriggerOptimizer, createTriggerOptimizer, parseSkillFrontmatter, } from
|
|
|
20
20
|
export type { SkillMetadata, TriggerAnalysisConfig, TriggerAnalysisResult, TriggerSuggestion, TriggerOptimizationReport, } from './trigger-optimizer.js';
|
|
21
21
|
export { VersionComparator, createVersionComparator, } from './version-comparator.js';
|
|
22
22
|
export type { VersionComparisonConfig, SkillVersion, VersionComparisonResult, VersionResult, ComparisonStats, TestCaseComparison, } from './version-comparator.js';
|
|
23
|
+
export { runPipeline, formatPipelineReport, } from './pipeline.js';
|
|
24
|
+
export type { StepCategory, StepSeverity, StepStatus, Finding, ValidationContext, ValidationStep, StepResult, PipelineConfig, PipelineResult, } from './pipeline.js';
|
|
25
|
+
export { REQUIREMENTS_VALIDATION_STEPS, createRequirementsPipeline, formatCheckStep, completenessCheckStep, investCriteriaStep, smartAcceptanceStep, testabilityScoreStep, vagueTermStep, informationDensityStep, traceabilityCheckStep, implementationLeakageStep, domainComplianceStep, dependencyAnalysisStep, bddScenarioStep, holisticQualityStep, } from './steps/requirements.js';
|
|
23
26
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/validation/index.js
CHANGED
|
@@ -36,4 +36,14 @@ export { TriggerOptimizer, createTriggerOptimizer, parseSkillFrontmatter, } from
|
|
|
36
36
|
// Version Comparator (ADR-056: A/B testing between skill versions)
|
|
37
37
|
// ============================================================================
|
|
38
38
|
export { VersionComparator, createVersionComparator, } from './version-comparator.js';
|
|
39
|
+
// ============================================================================
|
|
40
|
+
// Structured Validation Pipeline (BMAD-003)
|
|
41
|
+
// ============================================================================
|
|
42
|
+
export { runPipeline, formatPipelineReport, } from './pipeline.js';
|
|
43
|
+
// ============================================================================
|
|
44
|
+
// Requirements Validation Steps (BMAD-003)
|
|
45
|
+
// ============================================================================
|
|
46
|
+
export { REQUIREMENTS_VALIDATION_STEPS, createRequirementsPipeline,
|
|
47
|
+
// Individual steps
|
|
48
|
+
formatCheckStep, completenessCheckStep, investCriteriaStep, smartAcceptanceStep, testabilityScoreStep, vagueTermStep, informationDensityStep, traceabilityCheckStep, implementationLeakageStep, domainComplianceStep, dependencyAnalysisStep, bddScenarioStep, holisticQualityStep, } from './steps/requirements.js';
|
|
39
49
|
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Structured Validation Pipeline Framework (BMAD-003)
|
|
3
|
+
*
|
|
4
|
+
* Generic pipeline runner that executes validation steps sequentially,
|
|
5
|
+
* enforcing gates and producing structured reports.
|
|
6
|
+
*/
|
|
7
|
+
export type StepCategory = 'format' | 'content' | 'quality' | 'traceability' | 'compliance';
|
|
8
|
+
export type StepSeverity = 'blocking' | 'warning' | 'info';
|
|
9
|
+
export type StepStatus = 'pass' | 'fail' | 'warn' | 'skip';
|
|
10
|
+
export interface Finding {
|
|
11
|
+
id: string;
|
|
12
|
+
stepId: string;
|
|
13
|
+
severity: 'critical' | 'high' | 'medium' | 'low' | 'info';
|
|
14
|
+
title: string;
|
|
15
|
+
description: string;
|
|
16
|
+
location?: string;
|
|
17
|
+
suggestion?: string;
|
|
18
|
+
}
|
|
19
|
+
export interface ValidationContext {
|
|
20
|
+
/** The content being validated (requirements doc, code, etc.) */
|
|
21
|
+
content: string;
|
|
22
|
+
/** File path if applicable */
|
|
23
|
+
filePath?: string;
|
|
24
|
+
/** Additional metadata */
|
|
25
|
+
metadata?: Record<string, unknown>;
|
|
26
|
+
/** Results from previous steps (accumulated) */
|
|
27
|
+
previousResults: StepResult[];
|
|
28
|
+
}
|
|
29
|
+
export interface ValidationStep {
|
|
30
|
+
id: string;
|
|
31
|
+
name: string;
|
|
32
|
+
category: StepCategory;
|
|
33
|
+
severity: StepSeverity;
|
|
34
|
+
description?: string;
|
|
35
|
+
execute(context: ValidationContext): Promise<StepResult>;
|
|
36
|
+
}
|
|
37
|
+
export interface StepResult {
|
|
38
|
+
stepId: string;
|
|
39
|
+
stepName: string;
|
|
40
|
+
status: StepStatus;
|
|
41
|
+
score: number;
|
|
42
|
+
findings: Finding[];
|
|
43
|
+
evidence: string[];
|
|
44
|
+
duration: number;
|
|
45
|
+
}
|
|
46
|
+
export interface PipelineConfig {
|
|
47
|
+
/** Pipeline identifier */
|
|
48
|
+
id: string;
|
|
49
|
+
/** Human-readable name */
|
|
50
|
+
name: string;
|
|
51
|
+
/** Steps to execute */
|
|
52
|
+
steps: ValidationStep[];
|
|
53
|
+
/** Continue past blocking failures */
|
|
54
|
+
continueOnFailure?: boolean;
|
|
55
|
+
/** Only run specific steps (by id) */
|
|
56
|
+
stepFilter?: string[];
|
|
57
|
+
/** Weights for score calculation (step category -> weight) */
|
|
58
|
+
categoryWeights?: Record<StepCategory, number>;
|
|
59
|
+
}
|
|
60
|
+
export interface PipelineResult {
|
|
61
|
+
pipelineId: string;
|
|
62
|
+
pipelineName: string;
|
|
63
|
+
overall: 'pass' | 'fail' | 'warn';
|
|
64
|
+
score: number;
|
|
65
|
+
steps: StepResult[];
|
|
66
|
+
blockers: Finding[];
|
|
67
|
+
halted: boolean;
|
|
68
|
+
haltedAt?: string;
|
|
69
|
+
totalDuration: number;
|
|
70
|
+
timestamp: string;
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* Execute a validation pipeline.
|
|
74
|
+
*/
|
|
75
|
+
export declare function runPipeline(config: PipelineConfig, content: string, filePath?: string, metadata?: Record<string, unknown>): Promise<PipelineResult>;
|
|
76
|
+
/**
|
|
77
|
+
* Format pipeline result as markdown report.
|
|
78
|
+
*/
|
|
79
|
+
export declare function formatPipelineReport(result: PipelineResult): string;
|
|
80
|
+
//# sourceMappingURL=pipeline.d.ts.map
|