agentic-qe 3.7.20 → 3.7.22

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.
Files changed (115) hide show
  1. package/.claude/agents/v3/qe-deployment-advisor.md +14 -0
  2. package/.claude/agents/v3/qe-gap-detector.md +8 -0
  3. package/.claude/agents/v3/qe-impact-analyzer.md +11 -0
  4. package/.claude/agents/v3/qe-queen-coordinator.md +45 -0
  5. package/.claude/agents/v3/qe-root-cause-analyzer.md +11 -0
  6. package/.claude/agents/v3/qe-security-scanner.md +25 -16
  7. package/.claude/helpers/brain-checkpoint.cjs +7 -4
  8. package/.claude/helpers/statusline-v3.cjs +7 -4
  9. package/.claude/skills/skills-manifest.json +1 -1
  10. package/CHANGELOG.md +34 -0
  11. package/README.md +0 -12
  12. package/assets/agents/v3/qe-deployment-advisor.md +14 -0
  13. package/assets/agents/v3/qe-gap-detector.md +8 -0
  14. package/assets/agents/v3/qe-impact-analyzer.md +11 -0
  15. package/assets/agents/v3/qe-queen-coordinator.md +45 -0
  16. package/assets/agents/v3/qe-root-cause-analyzer.md +11 -0
  17. package/assets/agents/v3/qe-security-scanner.md +25 -16
  18. package/assets/helpers/statusline-v3.cjs +7 -4
  19. package/dist/adapters/claude-flow/model-router-bridge.d.ts +0 -6
  20. package/dist/adapters/claude-flow/model-router-bridge.js +4 -17
  21. package/dist/adapters/claude-flow/pretrain-bridge.d.ts +0 -6
  22. package/dist/adapters/claude-flow/pretrain-bridge.js +6 -19
  23. package/dist/adapters/claude-flow/trajectory-bridge.d.ts +0 -6
  24. package/dist/adapters/claude-flow/trajectory-bridge.js +21 -23
  25. package/dist/cli/brain-commands.js +6 -10
  26. package/dist/cli/bundle.js +3124 -3622
  27. package/dist/cli/commands/hooks.js +29 -6
  28. package/dist/cli/commands/init.js +1 -73
  29. package/dist/cli/commands/learning.js +164 -12
  30. package/dist/cli/handlers/init-handler.d.ts +0 -1
  31. package/dist/cli/handlers/init-handler.js +0 -6
  32. package/dist/cli/index.js +0 -2
  33. package/dist/context/sources/defect-source.js +2 -2
  34. package/dist/context/sources/memory-source.js +2 -2
  35. package/dist/context/sources/requirements-source.js +2 -2
  36. package/dist/coordination/protocols/security-audit.d.ts +3 -6
  37. package/dist/coordination/protocols/security-audit.js +8 -88
  38. package/dist/coordination/queen-coordinator.d.ts +13 -0
  39. package/dist/coordination/queen-coordinator.js +76 -0
  40. package/dist/coordination/queen-task-management.d.ts +2 -0
  41. package/dist/coordination/queen-task-management.js +10 -0
  42. package/dist/coordination/queen-types.d.ts +3 -0
  43. package/dist/coordination/task-executor.js +7 -5
  44. package/dist/domains/security-compliance/services/scanners/sast-scanner.d.ts +25 -1
  45. package/dist/domains/security-compliance/services/scanners/sast-scanner.js +140 -11
  46. package/dist/domains/security-compliance/services/scanners/scanner-types.d.ts +2 -0
  47. package/dist/domains/security-compliance/services/scanners/scanner-types.js +1 -0
  48. package/dist/domains/test-execution/services/mincut-test-optimizer.js +2 -0
  49. package/dist/init/agents-installer.d.ts +2 -0
  50. package/dist/init/agents-installer.js +13 -0
  51. package/dist/init/enhancements/claude-flow-adapter.js +51 -24
  52. package/dist/init/index.d.ts +0 -2
  53. package/dist/init/index.js +0 -1
  54. package/dist/init/init-wizard-steps.d.ts +10 -0
  55. package/dist/init/init-wizard-steps.js +87 -1
  56. package/dist/init/init-wizard.d.ts +1 -9
  57. package/dist/init/init-wizard.js +3 -69
  58. package/dist/init/orchestrator.js +0 -1
  59. package/dist/init/phases/01-detection.js +0 -27
  60. package/dist/init/phases/07-hooks.js +12 -10
  61. package/dist/init/phases/phase-interface.d.ts +0 -1
  62. package/dist/init/settings-merge.js +1 -1
  63. package/dist/integrations/ruvector/brain-rvf-exporter.js +14 -2
  64. package/dist/kernel/unified-memory.js +5 -6
  65. package/dist/learning/experience-capture-middleware.js +23 -1
  66. package/dist/learning/index.d.ts +0 -2
  67. package/dist/learning/index.js +0 -4
  68. package/dist/learning/metrics-tracker.js +15 -13
  69. package/dist/learning/pattern-lifecycle.d.ts +1 -1
  70. package/dist/learning/pattern-lifecycle.js +18 -20
  71. package/dist/learning/qe-reasoning-bank.js +3 -3
  72. package/dist/learning/qe-unified-memory.js +1 -28
  73. package/dist/learning/sqlite-persistence.js +16 -0
  74. package/dist/learning/token-tracker.js +4 -2
  75. package/dist/mcp/bundle.js +1162 -478
  76. package/dist/routing/agent-dependency-graph.d.ts +77 -0
  77. package/dist/routing/agent-dependency-graph.js +359 -0
  78. package/dist/routing/co-execution-repository.d.ts +68 -0
  79. package/dist/routing/co-execution-repository.js +184 -0
  80. package/dist/routing/index.d.ts +6 -0
  81. package/dist/routing/index.js +6 -0
  82. package/dist/routing/qe-task-router.d.ts +7 -0
  83. package/dist/routing/qe-task-router.js +63 -1
  84. package/dist/routing/signal-merger.d.ts +81 -0
  85. package/dist/routing/signal-merger.js +136 -0
  86. package/dist/routing/types.d.ts +1 -0
  87. package/dist/shared/llm/providers/azure-openai.js +3 -2
  88. package/dist/shared/llm/providers/bedrock.js +3 -2
  89. package/dist/shared/llm/providers/claude.js +3 -2
  90. package/dist/shared/llm/providers/gemini.js +3 -2
  91. package/dist/shared/llm/providers/openai.js +3 -2
  92. package/dist/shared/llm/providers/openrouter.js +3 -2
  93. package/dist/shared/llm/retry.d.ts +10 -0
  94. package/dist/shared/llm/retry.js +16 -0
  95. package/dist/shared/llm/router/agent-router-config.d.ts +2 -1
  96. package/dist/shared/llm/router/agent-router-config.js +38 -88
  97. package/dist/validation/index.d.ts +2 -0
  98. package/dist/validation/index.js +4 -0
  99. package/dist/validation/steps/agent-mcp-validator.d.ts +88 -0
  100. package/dist/validation/steps/agent-mcp-validator.js +254 -0
  101. package/package.json +1 -1
  102. package/dist/cli/commands/migrate.d.ts +0 -9
  103. package/dist/cli/commands/migrate.js +0 -566
  104. package/dist/init/init-wizard-migration.d.ts +0 -52
  105. package/dist/init/init-wizard-migration.js +0 -345
  106. package/dist/init/migration/config-migrator.d.ts +0 -31
  107. package/dist/init/migration/config-migrator.js +0 -149
  108. package/dist/init/migration/data-migrator.d.ts +0 -72
  109. package/dist/init/migration/data-migrator.js +0 -232
  110. package/dist/init/migration/detector.d.ts +0 -44
  111. package/dist/init/migration/detector.js +0 -105
  112. package/dist/init/migration/index.d.ts +0 -8
  113. package/dist/init/migration/index.js +0 -8
  114. package/dist/learning/v2-to-v3-migration.d.ts +0 -86
  115. package/dist/learning/v2-to-v3-migration.js +0 -529
@@ -5,6 +5,20 @@ updated: "2026-01-10"
5
5
  description: Deployment readiness assessment with go/no-go decisions, risk aggregation, and rollback planning
6
6
  v2_compat: qe-deployment-readiness
7
7
  domain: quality-assessment
8
+ dependencies:
9
+ agents:
10
+ - name: qe-quality-gate
11
+ type: hard
12
+ reason: "Provides quality gate results for deployment decision"
13
+ - name: qe-risk-assessor
14
+ type: soft
15
+ reason: "Provides risk assessment context"
16
+ - name: qe-security-scanner
17
+ type: soft
18
+ reason: "Provides security scan results"
19
+ mcp_servers:
20
+ - name: agentic-qe
21
+ required: true
8
22
  ---
9
23
 
10
24
  <qe_agent_definition>
@@ -5,6 +5,14 @@ updated: "2026-01-10"
5
5
  description: Coverage gap detection with risk scoring, semantic analysis, and targeted test recommendations
6
6
  v2_compat: null # New in v3
7
7
  domain: coverage-analysis
8
+ dependencies:
9
+ agents:
10
+ - name: qe-coverage-specialist
11
+ type: hard
12
+ reason: "Provides coverage data for gap detection"
13
+ mcp_servers:
14
+ - name: agentic-qe
15
+ required: true
8
16
  ---
9
17
 
10
18
  <qe_agent_definition>
@@ -5,6 +5,17 @@ updated: "2026-01-10"
5
5
  description: Change impact analysis with blast radius calculation, test selection, and risk assessment
6
6
  domain: code-intelligence
7
7
  v3_new: true
8
+ dependencies:
9
+ agents:
10
+ - name: qe-dependency-mapper
11
+ type: hard
12
+ reason: "Provides dependency graph data for impact analysis"
13
+ - name: qe-kg-builder
14
+ type: soft
15
+ reason: "Enriches analysis with knowledge graph context"
16
+ mcp_servers:
17
+ - name: agentic-qe
18
+ required: true
8
19
  ---
9
20
 
10
21
  <qe_agent_definition>
@@ -5,6 +5,12 @@ updated: "2026-01-30"
5
5
  description: V3 QE Queen Coordinator - MCP-powered swarm orchestration with real fleet coordination
6
6
  v2_compat: null # New in v3
7
7
  domain: coordination
8
+ dependencies:
9
+ mcp_servers:
10
+ - name: agentic-qe
11
+ required: true
12
+ - name: claude-flow
13
+ required: false
8
14
  ---
9
15
 
10
16
  <qe_agent_definition>
@@ -162,6 +168,45 @@ Output a summary table:
162
168
  ```
163
169
  </mandatory_execution_protocol>
164
170
 
171
+ <dependency_aware_orchestration>
172
+ ## Dependency-Aware Agent Orchestration (Issue #342)
173
+
174
+ When spawning multiple agents, ALWAYS check and respect agent dependencies:
175
+
176
+ ### Dependency Types
177
+ | Type | Meaning | Action |
178
+ |------|---------|--------|
179
+ | **hard** | Agent requires data from dependency | Spawn dependency FIRST, wait for completion |
180
+ | **soft** | Agent benefits from dependency data | Spawn dependency first if available, proceed without if not |
181
+ | **peer** | Agents work alongside each other | Spawn in parallel |
182
+
183
+ ### Known Agent Dependencies (spawn order matters)
184
+ | Agent | Hard Dependencies | Soft Dependencies |
185
+ |-------|-------------------|-------------------|
186
+ | qe-impact-analyzer | qe-dependency-mapper | qe-kg-builder |
187
+ | qe-security-scanner | qe-dependency-mapper | — |
188
+ | qe-gap-detector | qe-coverage-specialist | — |
189
+ | qe-deployment-advisor | qe-quality-gate | qe-risk-assessor, qe-security-scanner |
190
+ | qe-root-cause-analyzer | — | qe-regression-analyzer, qe-defect-predictor |
191
+
192
+ ### Orchestration Rules
193
+ 1. **Before spawning agents**: Check dependencies for all requested agents
194
+ 2. **Phase spawning**: Group agents into spawn phases:
195
+ - Phase 1: Agents with no unsatisfied hard deps (e.g., qe-dependency-mapper, qe-coverage-specialist)
196
+ - Phase 2: Agents whose hard deps completed in Phase 1 (e.g., qe-impact-analyzer, qe-gap-detector)
197
+ - Phase 3+: Continue until all agents spawned
198
+ 3. **Soft deps**: Spawn soft dependencies in an earlier phase when possible, but never delay for them
199
+ 4. **Missing deps**: If a hard dependency agent is not in the task scope, log an advisory warning and proceed
200
+ 5. **Parallel within phases**: All agents in the same phase can be spawned in parallel
201
+
202
+ ### Example: Full Release Validation
203
+ ```
204
+ Phase 1 (parallel): qe-dependency-mapper, qe-coverage-specialist, qe-quality-gate, qe-risk-assessor
205
+ Phase 2 (parallel): qe-impact-analyzer, qe-security-scanner, qe-gap-detector
206
+ Phase 3 (parallel): qe-deployment-advisor, qe-root-cause-analyzer
207
+ ```
208
+ </dependency_aware_orchestration>
209
+
165
210
  <task_type_routing>
166
211
  ## Automatic Task-to-Domain Routing
167
212
 
@@ -5,6 +5,17 @@ updated: "2026-01-10"
5
5
  description: Systematic root cause analysis for test failures and incidents with prevention recommendations
6
6
  domain: defect-intelligence
7
7
  v3_new: true
8
+ dependencies:
9
+ agents:
10
+ - name: qe-regression-analyzer
11
+ type: soft
12
+ reason: "Provides regression context for root cause investigation"
13
+ - name: qe-defect-predictor
14
+ type: soft
15
+ reason: "Provides defect prediction data"
16
+ mcp_servers:
17
+ - name: agentic-qe
18
+ required: true
8
19
  ---
9
20
 
10
21
  <qe_agent_definition>
@@ -5,6 +5,14 @@ updated: "2026-01-10"
5
5
  description: Comprehensive security scanning with SAST, DAST, dependency scanning, and secrets detection
6
6
  v2_compat: qe-security-scanner
7
7
  domain: security-compliance
8
+ dependencies:
9
+ agents:
10
+ - name: qe-dependency-mapper
11
+ type: hard
12
+ reason: "Provides dependency data for vulnerability correlation"
13
+ mcp_servers:
14
+ - name: agentic-qe
15
+ required: true
8
16
  ---
9
17
 
10
18
  <qe_agent_definition>
@@ -17,17 +25,18 @@ V2 Compatibility: Maps to qe-security-scanner for backward compatibility.
17
25
 
18
26
  <implementation_status>
19
27
  Working:
20
- - SAST scanning with OWASP Top 10 and CWE SANS 25 rules
21
- - Dependency vulnerability scanning (npm audit, Snyk, NVD)
22
- - Secrets detection with entropy analysis and git history scan
28
+ - SAST scanning with OWASP Top 10 and CWE SANS 25 regex pattern rules
29
+ - Semgrep integration: runs alongside pattern scanning when semgrep is installed (pip install semgrep)
30
+ - Dependency vulnerability scanning via OSV API (real HTTP calls to osv.dev)
31
+ - AI-powered remediation suggestions via LLM router (ADR-051)
23
32
  - SARIF output format for IDE and CI/CD integration
24
- - AI-powered remediation suggestions
25
33
 
26
34
  Partial:
27
- - DAST scanning with authenticated crawling
28
- - Container image vulnerability scanning
35
+ - DAST scanning: custom fetch-based scanner for security headers, cookies, CORS, XSS/SQLi reflection testing (GET params only, no JS execution, no OWASP ZAP)
36
+ - Secrets detection: regex pattern-based (no TruffleHog/Gitleaks integration)
29
37
 
30
- Planned:
38
+ Not Implemented:
39
+ - Container image vulnerability scanning
31
40
  - Runtime application security testing (RAST)
32
41
  - Supply chain security analysis (SLSA)
33
42
  </implementation_status>
@@ -49,12 +58,12 @@ Use up to 8 concurrent scanners for large codebases.
49
58
  </parallel_execution>
50
59
 
51
60
  <capabilities>
52
- - **SAST Scanning**: Static analysis with ESLint Security, Semgrep, custom rules
53
- - **Dependency Scanning**: Check npm, pip, maven dependencies against NVD, GitHub Advisories, Snyk
54
- - **Secrets Detection**: Find API keys, passwords, tokens using TruffleHog, Gitleaks with entropy analysis
55
- - **DAST Scanning**: Dynamic testing with OWASP ZAP for XSS, SQLi, CSRF, SSRF
61
+ - **SAST Scanning**: Regex pattern rules (OWASP Top 10, CWE SANS 25) + Semgrep when installed
62
+ - **Dependency Scanning**: npm dependency checks via OSV API (osv.dev)
63
+ - **Secrets Detection**: Regex pattern-based detection of API keys, passwords, tokens in source
64
+ - **DAST Scanning**: Custom fetch-based scanner security headers, cookies, CORS, XSS/SQLi reflection (GET params only, no browser/JS execution)
56
65
  - **SARIF Output**: Generate standardized SARIF reports for GitHub Code Scanning
57
- - **AI Remediation**: Provide intelligent fix suggestions with code examples
66
+ - **AI Remediation**: LLM-powered fix suggestions with code examples (ADR-051)
58
67
  </capabilities>
59
68
 
60
69
  <memory_namespace>
@@ -225,10 +234,10 @@ Use via Claude Code: `Skill("compliance-testing")`
225
234
  **Scan Types**:
226
235
  | Scan | Target | Tools | Frequency |
227
236
  |------|--------|-------|-----------|
228
- | SAST | Source code | ESLint Security, Semgrep | Per-commit |
229
- | Dependency | Dependencies | npm audit, Snyk | Per-build |
230
- | Secrets | Repo history | TruffleHog, Gitleaks | Per-commit |
231
- | DAST | Running app | OWASP ZAP | Per-release |
237
+ | SAST | Source code | Regex patterns + Semgrep (when installed) | Per-commit |
238
+ | Dependency | Dependencies | OSV API (osv.dev) | Per-build |
239
+ | Secrets | Source files | Regex pattern detection | Per-commit |
240
+ | DAST | Running app | Custom fetch-based scanner | Per-release |
232
241
 
233
242
  **Cross-Domain Communication**:
234
243
  - Reports vulnerabilities to qe-quality-gate for gate evaluation
@@ -6,11 +6,14 @@
6
6
  * node brain-checkpoint.cjs export # Export brain to aqe.rvf (session-end)
7
7
  * node brain-checkpoint.cjs verify # Verify aqe.rvf exists (session-start)
8
8
  */
9
- const { execSync } = require('child_process');
9
+ const { execFileSync } = require('child_process');
10
10
  const fs = require('fs');
11
11
  const path = require('path');
12
12
 
13
- const AQE_DIR = path.join(process.cwd(), '.agentic-qe');
13
+ // Resolve project root from __dirname (this file lives at <project>/.claude/helpers/)
14
+ // This works regardless of the current working directory
15
+ const PROJECT_ROOT = path.resolve(__dirname, '..', '..');
16
+ const AQE_DIR = path.join(PROJECT_ROOT, '.agentic-qe');
14
17
  const RVF_PATH = path.join(AQE_DIR, 'aqe.rvf');
15
18
  const DB_PATH = path.join(AQE_DIR, 'memory.db');
16
19
  const MAX_AGE_HOURS = 24;
@@ -23,8 +26,8 @@ function exportBrain() {
23
26
  if (fs.existsSync(RVF_PATH)) fs.unlinkSync(RVF_PATH);
24
27
  const idmap = RVF_PATH + '.idmap.json';
25
28
  if (fs.existsSync(idmap)) fs.unlinkSync(idmap);
26
- const result = execSync(
27
- 'npx agentic-qe brain export -o "' + RVF_PATH + '" --format rvf 2>&1',
29
+ const result = execFileSync(
30
+ 'npx', ['agentic-qe', 'brain', 'export', '-o', RVF_PATH, '--format', 'rvf'],
28
31
  { timeout: 60000, encoding: 'utf-8' }
29
32
  );
30
33
  const m = result.match(/Patterns:\s+(\d+)/);
@@ -16,7 +16,7 @@
16
16
 
17
17
  const fs = require('fs');
18
18
  const path = require('path');
19
- const { execSync, spawnSync } = require('child_process');
19
+ const { execSync, execFileSync, spawnSync } = require('child_process');
20
20
 
21
21
  // Use better-sqlite3 for reliable database access (no CLI dependency)
22
22
  let Database;
@@ -171,9 +171,10 @@ function sqlite3Query(dbPath, query, defaultValue = '0') {
171
171
 
172
172
  // Fallback to CLI if better-sqlite3 not available
173
173
  try {
174
- const result = execSync(`sqlite3 "${dbPath}" "${query}" 2>/dev/null`, {
174
+ const result = execFileSync('sqlite3', [dbPath, query], {
175
175
  encoding: 'utf-8',
176
- timeout: 3000
176
+ timeout: 3000,
177
+ stdio: ['pipe', 'pipe', 'pipe'],
177
178
  }).trim();
178
179
  return result || defaultValue;
179
180
  } catch {
@@ -664,7 +665,9 @@ function generateJSON(data) {
664
665
  // ═══════════════════════════════════════════════════════════════
665
666
 
666
667
  function main() {
667
- const projectDir = process.cwd();
668
+ // Resolve project root from __dirname (this file lives at <project>/.claude/helpers/)
669
+ // This works regardless of the current working directory
670
+ const projectDir = path.resolve(__dirname, '..', '..');
668
671
  const claudeInput = getClaudeCodeInput();
669
672
 
670
673
  // Collect all data
@@ -932,7 +932,7 @@
932
932
  },
933
933
  "metadata": {
934
934
  "generatedBy": "Agentic QE Fleet",
935
- "fleetVersion": "3.7.20",
935
+ "fleetVersion": "3.7.22",
936
936
  "manifestVersion": "1.3.0",
937
937
  "lastUpdated": "2026-02-04T00:00:00.000Z",
938
938
  "contributors": [
package/CHANGELOG.md CHANGED
@@ -5,6 +5,40 @@ All notable changes to the Agentic QE project will be documented in this file.
5
5
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6
6
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
7
 
8
+ ## [3.7.22] - 2026-03-14
9
+
10
+ ### Fixed
11
+
12
+ - **Hook path resolution** — Helper scripts (`brain-checkpoint.cjs`, `statusline-v3.cjs`) used `process.cwd()` to find the project root, which broke when Claude Code ran hooks from a different working directory. Now uses `path.resolve(__dirname, '..', '..')` for reliable resolution regardless of `cwd`. (#352)
13
+ - **Invalid JSON in settings.json** — Hook commands for `SessionStart`, `Stop`, and `UserPromptSubmit` had unescaped double quotes around `$(git rev-parse ...)` subshells, producing invalid JSON that Claude Code could not parse.
14
+ - **Pattern growth pipeline unblocked** — Pattern promotion and metrics queries referenced the removed `learning_experiences` table. Updated to use `captured_experiences` with correct column mappings (`quality` instead of `reward`, `agent` instead of `action_type`).
15
+ - **SQLite corruption prevention** — All database open calls now use the safe wrapper (`openSafeDatabase`) which sets WAL mode, `busy_timeout=5000`, and `foreign_keys=ON` consistently. (#348)
16
+
17
+ ### Changed
18
+
19
+ - **V2 migration code removed** — The `aqe migrate` CLI command, V2-to-V3 migration wizard, and all supporting code (~2,400 lines) have been removed. No v2 installations exist in the wild.
20
+ - **README updated** — Removed the V2 to V3 migration section.
21
+
22
+ ## [3.7.21] - 2026-03-13
23
+
24
+ ### Added
25
+
26
+ - **Agent dependency intelligence** — Pre-spawn MCP validation scans agent definitions for tool references and validates availability. Agent dependency graph with YAML frontmatter parsing, topological sort, and phased spawn plans for multi-agent orchestration. Co-execution repository tracks agent pair success rates, feeding behavioral signals into the routing signal merger. (#342)
27
+
28
+ ### Fixed
29
+
30
+ - **Shell injection prevention across all CLI bridges** — Converted 21 `execSync` template-literal calls to `execFileSync` with argument arrays, eliminating shell metacharacter injection vectors in claude-flow-adapter, trajectory-bridge, pretrain-bridge, model-router-bridge, brain-checkpoint, and statusline helpers.
31
+ - **Semgrep wired into SAST pipeline** — Semgrep integration was only used as a fallback when the regex scanner failed. Now SASTScanner runs pattern scanning and semgrep in parallel when semgrep is installed, merging and deduplicating results.
32
+ - **Security scanner agent overclaims corrected** — Agent documentation that falsely claimed OWASP ZAP, TruffleHog, Gitleaks, ESLint Security, and Snyk integrations updated to reflect actual implementations: regex patterns + semgrep (SAST), OSV API (deps), custom fetch-based scanner (DAST), and regex patterns (secrets).
33
+ - **Swallowed promise handlers replaced with structured logging** — 12 `.catch(() => {})` handlers across task-executor, experience-capture-middleware, token-tracker, qe-reasoning-bank, and init-wizard now log errors via the project's LoggerFactory with structured context (taskId, domain, error message).
34
+ - **Non-null assertion guard in mincut-test-optimizer** — `testMap.get(promotedId)!` replaced with guard clause to prevent potential runtime TypeError.
35
+ - **JSON.parse error clarity in brain-rvf-exporter** — Inner try-catch added around kernel data parsing for clearer error messages when data is malformed.
36
+
37
+ ### Changed
38
+
39
+ - **LLM provider retry backoff extracted** — 12 duplicate `Math.min(1000 * Math.pow(2, attempt), 30000)` expressions across 6 providers replaced with shared `backoffDelay()` utility in `src/shared/llm/retry.ts`.
40
+ - **Agent router capability presets** — 100-line boolean capability matrix collapsed into 4 named presets (heavyweight, standard, lightweight, minimal) for maintainability.
41
+
8
42
  ## [3.7.20] - 2026-03-12
9
43
 
10
44
  ### Fixed
package/README.md CHANGED
@@ -261,18 +261,6 @@ aqe init --auto
261
261
 
262
262
  ---
263
263
 
264
- ## V2 to V3 Migration
265
-
266
- ```bash
267
- aqe migrate status # check migration status
268
- aqe migrate run --backup # migrate with backup
269
- aqe migrate verify # verify migration
270
- ```
271
-
272
- All V2 agents map to V3 equivalents automatically. Memory, configuration, and learned patterns are migrated.
273
-
274
- ---
275
-
276
264
  ## Documentation
277
265
 
278
266
  | Guide | Description |
@@ -5,6 +5,20 @@ updated: "2026-01-10"
5
5
  description: Deployment readiness assessment with go/no-go decisions, risk aggregation, and rollback planning
6
6
  v2_compat: qe-deployment-readiness
7
7
  domain: quality-assessment
8
+ dependencies:
9
+ agents:
10
+ - name: qe-quality-gate
11
+ type: hard
12
+ reason: "Provides quality gate results for deployment decision"
13
+ - name: qe-risk-assessor
14
+ type: soft
15
+ reason: "Provides risk assessment context"
16
+ - name: qe-security-scanner
17
+ type: soft
18
+ reason: "Provides security scan results"
19
+ mcp_servers:
20
+ - name: agentic-qe
21
+ required: true
8
22
  ---
9
23
 
10
24
  <qe_agent_definition>
@@ -5,6 +5,14 @@ updated: "2026-01-10"
5
5
  description: Coverage gap detection with risk scoring, semantic analysis, and targeted test recommendations
6
6
  v2_compat: null # New in v3
7
7
  domain: coverage-analysis
8
+ dependencies:
9
+ agents:
10
+ - name: qe-coverage-specialist
11
+ type: hard
12
+ reason: "Provides coverage data for gap detection"
13
+ mcp_servers:
14
+ - name: agentic-qe
15
+ required: true
8
16
  ---
9
17
 
10
18
  <qe_agent_definition>
@@ -5,6 +5,17 @@ updated: "2026-01-10"
5
5
  description: Change impact analysis with blast radius calculation, test selection, and risk assessment
6
6
  domain: code-intelligence
7
7
  v3_new: true
8
+ dependencies:
9
+ agents:
10
+ - name: qe-dependency-mapper
11
+ type: hard
12
+ reason: "Provides dependency graph data for impact analysis"
13
+ - name: qe-kg-builder
14
+ type: soft
15
+ reason: "Enriches analysis with knowledge graph context"
16
+ mcp_servers:
17
+ - name: agentic-qe
18
+ required: true
8
19
  ---
9
20
 
10
21
  <qe_agent_definition>
@@ -5,6 +5,12 @@ updated: "2026-01-30"
5
5
  description: V3 QE Queen Coordinator - MCP-powered swarm orchestration with real fleet coordination
6
6
  v2_compat: null # New in v3
7
7
  domain: coordination
8
+ dependencies:
9
+ mcp_servers:
10
+ - name: agentic-qe
11
+ required: true
12
+ - name: claude-flow
13
+ required: false
8
14
  ---
9
15
 
10
16
  <qe_agent_definition>
@@ -162,6 +168,45 @@ Output a summary table:
162
168
  ```
163
169
  </mandatory_execution_protocol>
164
170
 
171
+ <dependency_aware_orchestration>
172
+ ## Dependency-Aware Agent Orchestration (Issue #342)
173
+
174
+ When spawning multiple agents, ALWAYS check and respect agent dependencies:
175
+
176
+ ### Dependency Types
177
+ | Type | Meaning | Action |
178
+ |------|---------|--------|
179
+ | **hard** | Agent requires data from dependency | Spawn dependency FIRST, wait for completion |
180
+ | **soft** | Agent benefits from dependency data | Spawn dependency first if available, proceed without if not |
181
+ | **peer** | Agents work alongside each other | Spawn in parallel |
182
+
183
+ ### Known Agent Dependencies (spawn order matters)
184
+ | Agent | Hard Dependencies | Soft Dependencies |
185
+ |-------|-------------------|-------------------|
186
+ | qe-impact-analyzer | qe-dependency-mapper | qe-kg-builder |
187
+ | qe-security-scanner | qe-dependency-mapper | — |
188
+ | qe-gap-detector | qe-coverage-specialist | — |
189
+ | qe-deployment-advisor | qe-quality-gate | qe-risk-assessor, qe-security-scanner |
190
+ | qe-root-cause-analyzer | — | qe-regression-analyzer, qe-defect-predictor |
191
+
192
+ ### Orchestration Rules
193
+ 1. **Before spawning agents**: Check dependencies for all requested agents
194
+ 2. **Phase spawning**: Group agents into spawn phases:
195
+ - Phase 1: Agents with no unsatisfied hard deps (e.g., qe-dependency-mapper, qe-coverage-specialist)
196
+ - Phase 2: Agents whose hard deps completed in Phase 1 (e.g., qe-impact-analyzer, qe-gap-detector)
197
+ - Phase 3+: Continue until all agents spawned
198
+ 3. **Soft deps**: Spawn soft dependencies in an earlier phase when possible, but never delay for them
199
+ 4. **Missing deps**: If a hard dependency agent is not in the task scope, log an advisory warning and proceed
200
+ 5. **Parallel within phases**: All agents in the same phase can be spawned in parallel
201
+
202
+ ### Example: Full Release Validation
203
+ ```
204
+ Phase 1 (parallel): qe-dependency-mapper, qe-coverage-specialist, qe-quality-gate, qe-risk-assessor
205
+ Phase 2 (parallel): qe-impact-analyzer, qe-security-scanner, qe-gap-detector
206
+ Phase 3 (parallel): qe-deployment-advisor, qe-root-cause-analyzer
207
+ ```
208
+ </dependency_aware_orchestration>
209
+
165
210
  <task_type_routing>
166
211
  ## Automatic Task-to-Domain Routing
167
212
 
@@ -5,6 +5,17 @@ updated: "2026-01-10"
5
5
  description: Systematic root cause analysis for test failures and incidents with prevention recommendations
6
6
  domain: defect-intelligence
7
7
  v3_new: true
8
+ dependencies:
9
+ agents:
10
+ - name: qe-regression-analyzer
11
+ type: soft
12
+ reason: "Provides regression context for root cause investigation"
13
+ - name: qe-defect-predictor
14
+ type: soft
15
+ reason: "Provides defect prediction data"
16
+ mcp_servers:
17
+ - name: agentic-qe
18
+ required: true
8
19
  ---
9
20
 
10
21
  <qe_agent_definition>
@@ -5,6 +5,14 @@ updated: "2026-01-10"
5
5
  description: Comprehensive security scanning with SAST, DAST, dependency scanning, and secrets detection
6
6
  v2_compat: qe-security-scanner
7
7
  domain: security-compliance
8
+ dependencies:
9
+ agents:
10
+ - name: qe-dependency-mapper
11
+ type: hard
12
+ reason: "Provides dependency data for vulnerability correlation"
13
+ mcp_servers:
14
+ - name: agentic-qe
15
+ required: true
8
16
  ---
9
17
 
10
18
  <qe_agent_definition>
@@ -17,17 +25,18 @@ V2 Compatibility: Maps to qe-security-scanner for backward compatibility.
17
25
 
18
26
  <implementation_status>
19
27
  Working:
20
- - SAST scanning with OWASP Top 10 and CWE SANS 25 rules
21
- - Dependency vulnerability scanning (npm audit, Snyk, NVD)
22
- - Secrets detection with entropy analysis and git history scan
28
+ - SAST scanning with OWASP Top 10 and CWE SANS 25 regex pattern rules
29
+ - Semgrep integration: runs alongside pattern scanning when semgrep is installed (pip install semgrep)
30
+ - Dependency vulnerability scanning via OSV API (real HTTP calls to osv.dev)
31
+ - AI-powered remediation suggestions via LLM router (ADR-051)
23
32
  - SARIF output format for IDE and CI/CD integration
24
- - AI-powered remediation suggestions
25
33
 
26
34
  Partial:
27
- - DAST scanning with authenticated crawling
28
- - Container image vulnerability scanning
35
+ - DAST scanning: custom fetch-based scanner for security headers, cookies, CORS, XSS/SQLi reflection testing (GET params only, no JS execution, no OWASP ZAP)
36
+ - Secrets detection: regex pattern-based (no TruffleHog/Gitleaks integration)
29
37
 
30
- Planned:
38
+ Not Implemented:
39
+ - Container image vulnerability scanning
31
40
  - Runtime application security testing (RAST)
32
41
  - Supply chain security analysis (SLSA)
33
42
  </implementation_status>
@@ -49,12 +58,12 @@ Use up to 8 concurrent scanners for large codebases.
49
58
  </parallel_execution>
50
59
 
51
60
  <capabilities>
52
- - **SAST Scanning**: Static analysis with ESLint Security, Semgrep, custom rules
53
- - **Dependency Scanning**: Check npm, pip, maven dependencies against NVD, GitHub Advisories, Snyk
54
- - **Secrets Detection**: Find API keys, passwords, tokens using TruffleHog, Gitleaks with entropy analysis
55
- - **DAST Scanning**: Dynamic testing with OWASP ZAP for XSS, SQLi, CSRF, SSRF
61
+ - **SAST Scanning**: Regex pattern rules (OWASP Top 10, CWE SANS 25) + Semgrep when installed
62
+ - **Dependency Scanning**: npm dependency checks via OSV API (osv.dev)
63
+ - **Secrets Detection**: Regex pattern-based detection of API keys, passwords, tokens in source
64
+ - **DAST Scanning**: Custom fetch-based scanner security headers, cookies, CORS, XSS/SQLi reflection (GET params only, no browser/JS execution)
56
65
  - **SARIF Output**: Generate standardized SARIF reports for GitHub Code Scanning
57
- - **AI Remediation**: Provide intelligent fix suggestions with code examples
66
+ - **AI Remediation**: LLM-powered fix suggestions with code examples (ADR-051)
58
67
  </capabilities>
59
68
 
60
69
  <memory_namespace>
@@ -225,10 +234,10 @@ Use via Claude Code: `Skill("compliance-testing")`
225
234
  **Scan Types**:
226
235
  | Scan | Target | Tools | Frequency |
227
236
  |------|--------|-------|-----------|
228
- | SAST | Source code | ESLint Security, Semgrep | Per-commit |
229
- | Dependency | Dependencies | npm audit, Snyk | Per-build |
230
- | Secrets | Repo history | TruffleHog, Gitleaks | Per-commit |
231
- | DAST | Running app | OWASP ZAP | Per-release |
237
+ | SAST | Source code | Regex patterns + Semgrep (when installed) | Per-commit |
238
+ | Dependency | Dependencies | OSV API (osv.dev) | Per-build |
239
+ | Secrets | Source files | Regex pattern detection | Per-commit |
240
+ | DAST | Running app | Custom fetch-based scanner | Per-release |
232
241
 
233
242
  **Cross-Domain Communication**:
234
243
  - Reports vulnerabilities to qe-quality-gate for gate evaluation
@@ -16,7 +16,7 @@
16
16
 
17
17
  const fs = require('fs');
18
18
  const path = require('path');
19
- const { execSync, spawnSync } = require('child_process');
19
+ const { execSync, execFileSync, spawnSync } = require('child_process');
20
20
 
21
21
  // Use better-sqlite3 for reliable database access (no CLI dependency)
22
22
  let Database;
@@ -171,9 +171,10 @@ function sqlite3Query(dbPath, query, defaultValue = '0') {
171
171
 
172
172
  // Fallback to CLI if better-sqlite3 not available
173
173
  try {
174
- const result = execSync(`sqlite3 "${dbPath}" "${query}" 2>/dev/null`, {
174
+ const result = execFileSync('sqlite3', [dbPath, query], {
175
175
  encoding: 'utf-8',
176
- timeout: 3000
176
+ timeout: 3000,
177
+ stdio: ['pipe', 'pipe', 'pipe'],
177
178
  }).trim();
178
179
  return result || defaultValue;
179
180
  } catch {
@@ -664,7 +665,9 @@ function generateJSON(data) {
664
665
  // ═══════════════════════════════════════════════════════════════
665
666
 
666
667
  function main() {
667
- const projectDir = process.cwd();
668
+ // Resolve project root from __dirname (this file lives at <project>/.claude/helpers/)
669
+ // This works regardless of the current working directory
670
+ const projectDir = path.resolve(__dirname, '..', '..');
668
671
  const claudeInput = getClaudeCodeInput();
669
672
 
670
673
  // Collect all data
@@ -54,12 +54,6 @@ export declare class ModelRouterBridge {
54
54
  * Local rule-based routing
55
55
  */
56
56
  private localRoute;
57
- /**
58
- * Escape shell argument using $'...' syntax for complete safety
59
- * This ANSI-C quoting handles ALL special characters including backslashes
60
- * CodeQL: js/incomplete-sanitization - Fixed by escaping backslashes AND quotes
61
- */
62
- private escapeArg;
63
57
  }
64
58
  /**
65
59
  * Create model router bridge
@@ -54,8 +54,8 @@ export class ModelRouterBridge {
54
54
  async routeTask(task) {
55
55
  if (this.claudeFlowAvailable) {
56
56
  try {
57
- const { execSync } = await import('child_process');
58
- const result = execSync(`npx --no-install @claude-flow/cli hooks model-route --task ${this.escapeArg(task)}`, { encoding: 'utf-8', timeout: 10000, cwd: this.options.projectRoot });
57
+ const { execFileSync } = await import('child_process');
58
+ const result = execFileSync('npx', ['--no-install', '@claude-flow/cli', 'hooks', 'model-route', '--task', task], { encoding: 'utf-8', timeout: 10000, cwd: this.options.projectRoot });
59
59
  // Parse result
60
60
  const modelMatch = result.match(/model[:\s]+["']?(haiku|sonnet|opus)/i);
61
61
  const confMatch = result.match(/confidence[:\s]+([0-9.]+)/i);
@@ -88,8 +88,8 @@ export class ModelRouterBridge {
88
88
  }
89
89
  if (this.claudeFlowAvailable) {
90
90
  try {
91
- const { execSync } = await import('child_process');
92
- execSync(`npx --no-install @claude-flow/cli hooks model-outcome --task ${this.escapeArg(outcome.task)} --model ${outcome.model} --outcome ${outcome.outcome}`, { encoding: 'utf-8', timeout: 10000, cwd: this.options.projectRoot });
91
+ const { execFileSync } = await import('child_process');
92
+ execFileSync('npx', ['--no-install', '@claude-flow/cli', 'hooks', 'model-outcome', '--task', outcome.task, '--model', outcome.model, '--outcome', outcome.outcome], { encoding: 'utf-8', timeout: 10000, cwd: this.options.projectRoot });
93
93
  }
94
94
  catch (error) {
95
95
  // Non-critical: outcome recording is optional
@@ -172,19 +172,6 @@ export class ModelRouterBridge {
172
172
  reasoning: 'Medium complexity task - using sonnet for balance',
173
173
  };
174
174
  }
175
- /**
176
- * Escape shell argument using $'...' syntax for complete safety
177
- * This ANSI-C quoting handles ALL special characters including backslashes
178
- * CodeQL: js/incomplete-sanitization - Fixed by escaping backslashes AND quotes
179
- */
180
- escapeArg(arg) {
181
- // Escape backslashes first, then single quotes, using ANSI-C quoting
182
- // $'...' syntax interprets escape sequences like \\ and \'
183
- const escaped = arg
184
- .replace(/\\/g, '\\\\') // Escape backslashes first
185
- .replace(/'/g, "\\'"); // Then escape single quotes
186
- return "$'" + escaped + "'";
187
- }
188
175
  }
189
176
  /**
190
177
  * Create model router bridge