Commit Graph

23 Commits

Author SHA1 Message Date
Dragan Spiridonov c2f973e792 feat: add CLI code intelligence commands (complexity, --incremental, --git-since) and fix stale references
- Add `aqe code complexity` action with cyclomatic/cognitive/Halstead metrics, hotspot detection, batched concurrency
- Add `--incremental` and `--git-since <ref>` flags for `aqe code index`
- Fix command injection vulnerability: replace execSync with execFileSync (CWE-78)
- Fix missing return after cleanupAndExit in complexity action
- Add --depth NaN validation
- Import shared SOURCE_EXTENSIONS instead of duplicating inline
- Fix stale `aqe kg` commands in SKILL.md Quick Start/CLI Examples across .claude/, assets/, .kiro/
- Fix phantom agent names (qe-knowledge-graph, qe-semantic-searcher) in skills, evals, and catalog
- Fix `ruflo doctor --fix` references in CLAUDE.md, skill gotchas, and docs → `aqe health`/`aqe init`
- Fix `aqe code-intelligence index` → `aqe code index .` in fleet integration guide
- Add code intelligence CLI section to README.md
- Fix tool-scoping test: add hypergraph_query to all 5 scoped roles
- Fix queen-dependency test: correct expectation for agents without inline mcp__ refs

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-30 09:57:49 +00:00
Dragan Spiridonov 0f44d7231a feat: migrate agents/skills from MCP to CLI, improve skill descriptions, make MCP opt-in
- Standardize 15 QE skill names to kebab-case (matching directory names)
- Enrich 18 skill descriptions with third-person voice and trigger terms
- Add `aqe memory` CLI command (store/get/search/list/delete/share/usage)
  with full MCP parity, reusing existing MCP handlers
- Migrate all 431 mcp__agentic-qe__* references across 230 agent/skill
  files (.claude/, assets/, .kiro/) to CLI equivalents (aqe task, aqe agent,
  aqe fleet, aqe memory, aqe coverage, aqe quality, aqe security, etc.)
- Make MCP server opt-in during `aqe init` (--with-mcp flag); CLI commands
  work without MCP server running
- Zero mcp__agentic-qe__* references remain in agent/skill definitions

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-24 15:45:15 +00:00
Dragan Spiridonov 2086bafa6b feat(parsers): add web-tree-sitter WASM for Python, Java, C#, Rust, Swift (#323)
Integrate tree-sitter WASM as the default parser for 5 languages, replacing
regex-only parsing (~97-98%) with AST-based parsing (~100% accuracy).

- Add TreeSitterWASMParser implementing ILanguageParser for 5 languages
- Bundle only needed WASM grammars in assets/grammars/ (8.5MB vs 50MB)
- Add FallbackParser with 3-retry logic before permanent regex degradation
- Add per-call parser instances to prevent concurrency races across await
- Add cyclomatic complexity computation from AST branching nodes
- Add property extraction from class/struct AST nodes
- Add AQE_PARSER_REGEX_ONLY=1 env var for opt-out to regex
- Replace require() with ESM-compatible dynamic import() in registry
- Mark web-tree-sitter as external in CLI/MCP esbuild configs
- Amend ADR-076 with decision rationale and alternatives evaluated

Alternatives evaluated and rejected:
- @ast-grep/napi: npm package only ships JS/TS/CSS/HTML, others need native .so
- node-tree-sitter: requires native C compilation via node-gyp

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-24 12:43:14 +00:00
Dragan Spiridonov 0cc11ea05b fix: unify hypergraph persistence to memory.db, add CLI/MCP query tools
Eliminates the separate hypergraph.db file — all hypergraph data now lives
in the unified .agentic-qe/memory.db alongside other QE tables. Fixes stale
v3/ path references in governance shards. Adds user-facing hypergraph query
surface via CLI (`aqe hypergraph stats/untested/impacted/gaps`) and MCP
(`hypergraph_query` tool).

Key changes:
- coordinator + coordinator-hypergraph default path: hypergraph.db → memory.db
- governance shards: v3/src/domains/ → src/domains/ (12 files + constitution)
- init phase 06: now builds hypergraph tables during `aqe init --auto`
- coordinator.index(): rebuilds hypergraph on every code_index MCP call
- protocol: removed redundant buildHypergraphFromIndex (coordinator handles it)
- shared code-index-extractor: async batched I/O, arrow/method/interface patterns
- CLI handler: ensureInitialized guard, connection leak fix, path resolution
- MCP handler: hypergraph_query tool with stats/untested/impacted/gaps queries
- tool-scoping: hypergraph_query added to 5 agent roles
- completions: bash/zsh/fish/powershell support for hypergraph subcommands
- coordinator: publishes HypergraphDegraded event on init failure
- 12 new tests for code-index-extractor

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-23 13:48:09 +00:00
Dragan Spiridonov 475bd61a75 fix(learning): purge 15K junk patterns, fix DB corruption, improve quality scoring
- Rebuild corrupted memory.db (82 corrupt pages causing 43% dream cycle failures)
- Purge 15,624 benchmark/test artifacts from qe_patterns (bench-*, Dream: novel_association, Test Pattern)
- Fix benchmark test isolation: add useUnified: false to prevent prod DB pollution
- Improve cli-hook quality scoring: context-aware (source/speed) instead of hardcoded 0.7/0.3
- Fix statusline to show only meaningful patterns (was inflating count with junk + cross-table sum)
- Update fallback statusline generator with same meaningful-only query

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-19 12:02:53 +00:00
Dragan Spiridonov ef9b9c3fee feat(skills): implement ADR-086 skill design standards across 84 QE skills
Based on Anthropic's "Lessons from Building Claude Code: How We Use Skills" article.
Transforms QE skills from flat knowledge cards into folder-based systems with
gotchas, progressive disclosure, composition, config, hooks, and run history.

Changes across all 4 phases:
- Add Gotchas sections to 30 skills with battle-tested failure data from Nagual/memory.db
- Rewrite all 84 skill descriptions as "Use when..." trigger conditions
- Strip 892 lines of textbook knowledge from 15 skills (26% reduction)
- Create 10 reference/template files across 7 skills (OWASP, k6, mutation operators, etc.)
- Add config.json with _setupPrompt to 7 skills
- Add run-history.json with write instructions to 5 metric-producing skills
- Create 5 on-demand hook skills with executable scripts (strict-tdd, no-skip, coverage-guard, freeze-tests, security-watch)
- Create 5 new category-filling skills (test-failure-investigator, coverage-drop-investigator, e2e-flow-verifier, test-metrics-dashboard, skill-stats)
- Add Skill Composition cross-references to 10 key skills
- Remove 3 redundant/obsolete skills (qe-contract-testing → contract-testing, qe-security-compliance → security-testing, aqe-v2-v3-migration)
- Add DEPRECATED_SKILLS cleanup to skills-installer.ts for --upgrade
- Update all manifests (trust-tier, TRUST-TIERS.md, README.md, CLAUDE.md)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-18 15:23:57 +00:00
Dragan Spiridonov f341beefdf fix(init): resolve issues #361-367 from Nate's testing feedback
- #361: opencode-installer uses package-relative path resolution with
  resolveViaPackageJson() fallback, never uses CWD as source
- #362: permissions union-merged via _aqePermissions to preserve user entries
- #363: brain-checkpoint/statusline hooks use hardcoded projectRoot fallback
  instead of `pwd` in $(git rev-parse ... || echo "<path>")
- #364: created .claude/helpers/validation-pipeline.cjs with 13-step
  requirements pipeline, updated SKILL.md references
- #365: agents-installer bumps `updated:` frontmatter date when overlays
  modify agent content
- #366: qe-security-scanner dependency on qe-dependency-mapper changed
  from hard to soft
- #367: --steps parameter documented as comma-separated string consistently

Closes #361, closes #362, closes #363, closes #364, closes #365, closes #366, closes #367

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-17 18:46:53 +00:00
Dragan Spiridonov a78e9c80d0 fix(skills): remove blank lines inside YAML frontmatter across 114 SKILL.md files (#360)
Blank lines between the opening `---` and closing `---` delimiters
caused frontmatter parsers to fail validation. Removed the offending
empty lines from all affected skills in both .claude/skills/ and
assets/skills/.

Closes #360

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-17 17:21:36 +00:00
Dragan Spiridonov 65f9999a77 fix(security): complete ruflo rebrand across skills, helpers, and bridge modules
Finish the claude-flow → ruflo rename in all remaining references:
skills (iterative-loop, QCSD swarms), git helpers, statusline, and
the TypeScript bridge modules (model-router, pretrain, trajectory).
Add resolveCliPackage() for consistent CLI resolution with fallback.
Also includes SONA graceful degradation and isSONAAvailable() API.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-17 17:19:11 +00:00
Dragan Spiridonov b5539aa471 chore(release): bump version to v3.8.1
Fix MCP tool prefix mismatch in 8 agent files (mcp__agentic_qe_v3__ → mcp__agentic-qe__)
and permission pattern in settings.json/settings-merge.ts. Closes #357.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-17 10:28:39 +00:00
Dragan Spiridonov 948d4e0f41 fix: use __dirname instead of process.cwd() in helpers for reliable path resolution (#352)
Helpers (brain-checkpoint.cjs, statusline-v3.cjs) used process.cwd()
to find the project root, which breaks when Claude Code runs hooks from
a different working directory. Fixed to use path.resolve(__dirname, '..', '..')
since these files always live at <project>/.claude/helpers/.

Also updated hook commands in 07-hooks.ts and settings-merge.ts to use
$(git rev-parse --show-toplevel) for absolute path resolution.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-14 09:54:30 +00:00
Dragan Spiridonov 575633958a fix: eliminate shell injection vectors, upgrade error logging, and reduce DRY violations
P1 (Security): Convert all execSync template-literal calls to execFileSync
with argument arrays, eliminating shell metacharacter injection across:
- claude-flow-adapter.ts (8 calls)
- trajectory-bridge.ts, pretrain-bridge.ts, model-router-bridge.ts (8 calls)
- brain-checkpoint.cjs, statusline-v3.cjs helpers (3 calls)
- 07-hooks.ts generated scripts (2 calls)
Remove dead escapeArg() methods from bridge files.

P2 (Reliability): Replace swallowed .catch(() => {}) handlers with
structured logging via createLogger() from the project's LoggerFactory:
- task-executor.ts: 5 recordOutcome catches → logger.warn with taskId
- experience-capture-middleware.ts: embedding catch → ecLogger.warn
- token-tracker.ts: DB init + KV persist → ttLogger.warn
- qe-reasoning-bank.ts: 3 witness chain catches → logger.warn
- init-wizard.ts: V2 migration → console.warn (logger not yet initialized)

P2 (Correctness): Guard non-null assertion in mincut-test-optimizer.ts
with early continue. Wrap JSON.parse in brain-rvf-exporter.ts with
inner try-catch for clearer error messages on malformed kernel data.

P3 (DRY): Extract shared backoffDelay() to src/shared/llm/retry.ts,
replacing 12 duplicate Math.min(1000 * Math.pow(2, attempt), 30000)
across 6 LLM providers. Collapse 100-line capability boolean matrix
in agent-router-config.ts into 4 named presets.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-13 16:15:37 +00:00
Dragan Spiridonov 5baf27e8e7 feat: implement agent dependency intelligence (#342)
Add three subsystems for fleet orchestration intelligence:
- Pre-spawn MCP validation scans agent files for tool references and
  validates availability at install and spawn time (advisory only)
- 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 signal merger for routing decisions

Wire all subsystems into the queen coordinator: dependency graph built
on initialize(), MCP validation in requestAgentSpawn(), co-execution
recording in handleTaskCompletionCallback(), and getSpawnPlan()/
getDependencyGraph() exposed on the public interface.

Add structured dependencies frontmatter to 5 agent definitions and
475 passing tests including 7 end-to-end integration tests proving
the wiring works.

Closes #342

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-13 13:52:27 +00:00
Dragan Spiridonov 253cefab7e fix: wire semgrep into SAST pipeline and correct security scanner overclaims
Semgrep integration was well-written but only used as a fallback in the
coordination layer — never invoked when the regex scanner succeeded.
Now SASTScanner.scanWithRules() runs pattern scanning + semgrep in parallel
when semgrep is installed, merging and deduplicating results.

Also corrects agent documentation that falsely claimed OWASP ZAP, TruffleHog,
Gitleaks, ESLint Security, and Snyk integrations. The actual implementations
are: regex patterns + semgrep (SAST), OSV API (deps), custom fetch-based
scanner (DAST), and regex patterns (secrets).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-13 13:46:52 +00:00
Dragan Spiridonov 87ff3e96da feat: YAML pipelines, validation pipeline, cross-phase signals, heartbeat scheduler, context sources
- Add YAML deterministic pipeline loader and registry (Imp-9) for token-free workflow execution
- Add validation pipeline skill and MCP handler (BMAD-003) with 13-step requirements validation
- Add cross-phase signal handlers for QCSD feedback loops (store, query, agent_complete, phase events)
- Add heartbeat scheduler worker (Imp-10) for token-free background maintenance every 30 minutes
- Add defect intelligence and requirements traceability context sources
- Register all new MCP tools in protocol-server and server
- Update skills manifests, tests, and documentation

chore(release): bump version to v3.7.19

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-12 16:17:04 +00:00
Dragan Spiridonov 9e7320e79f feat(bmad): implement 6 BMAD-inspired quality engineering improvements
- Adversarial review with minimum findings enforcement (weighted scoring, second-pass, clean justification)
- Agent customization overlays via .claude/agent-overrides/*.yaml with runtime integration
- Structured validation pipelines with 13-step requirements validation and blocking gates
- Mechanical edge case detection with regex-based branch enumerator (13 construct types) and CLI command
- Context compilation for agents with parallel source gathering and token budget management
- Micro-file step architecture splitting 5 QCSD skills into 44 step files (<500 lines each)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-11 13:29:49 +00:00
Dragan Spiridonov 6307ce1f9a statusline fixes 2026-03-11 11:43:34 +00:00
Profa 18e15e843c feat(validation): add trigger optimizer, version comparator, and skill intent classification
Implements three improvements from Claude Blog skill-creator analysis:
- Trigger Optimizer: analyzes skill descriptions/tags for false positive/negative activation risks
- Version Comparator: A/B testing between skill versions with Cohen's d effect size
- Skill Intent: classify skills as capability_uplift, encoded_preference, or hybrid

Includes 52 unit tests (23 + 29), schema sync across all 3 copies, and ADR-056 update.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-07 11:01:05 +00:00
Profa b6fe4abec8 fix: resolve MCP path, stale v3/ refs, CRLF line endings, and rewrite README
- Fix MCP entry path resolution in mcp.ts (1 level up, not 2)
- Remove stale v3/ directory references in 10-workers.ts
- Fix CRLF line endings in 170+ skill files breaking frontmatter parsing
- Add CRLF→LF safety net in prepare-assets.sh
- Rewrite README.md for clarity (1097→280 lines, outcome-focused)
- Sync assets from .claude/skills via prepare-assets.sh

Fixes issues reported in v3.7.9 upgrade (skill-lint failures, MCP errors)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-05 15:46:53 +00:00
Profa 68cdc5ad7e feat(skills): add eval infrastructure for 5 tier-3 skills and fix asset sync
- Create eval configs (evals/*.yaml, schemas/output.json, scripts/validate-config.json)
  for: qcsd-cicd-swarm, qcsd-development-swarm, enterprise-integration-testing,
  observability-testing-patterns, middleware-testing-patterns
- Set debug-loop and pr-review to tier 0 (advisory-only, no eval needed)
- Update trust-tier-manifest.json with correct tier assignments
- Fix prepare-assets.sh to include qcsd-*, n8n-*, and 15 additional QE skills
  that were in assets/ but not matched by the copy filter
- Sync all eval infrastructure to assets/skills/ for npm distribution

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-05 12:50:50 +00:00
Profa e2fb4a2f14 feat(multi-lang): add docs, ADRs, tests, and fixtures for multi-language support
Update ADRs 075-079 with implementation details, revise the
multi-language GOAP implementation plan, add test generators and
parser test fixtures for Go, Rust, Java, C#, Swift, Python.
Include skill validation schema updates and v2→v3 migration skill.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-05 12:00:01 +00:00
Profa 33c6687e71 fix(agents): normalize memory namespace paths in agent definitions
Remove redundant /v3/ segment from agent memory namespace paths
(e.g., aqe/v3/accessibility/outcomes/* → aqe/accessibility/outcomes/*).
Namespace identifiers in memory.db remain unchanged — this only
affects the documentation references in agent markdown files.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-05 11:59:28 +00:00
Profa 2253d05618 feat: flatten project structure — archive v2, promote v3 to root
Remove the nested v3/ subdirectory by moving all active source code,
tests, configs, and assets directly to the project root. Archive v2/
(dead code, 847MB) to v2-archive.tar.gz.

Key changes:
- Move v3/src/ → src/, v3/tests/ → tests/, v3/packages/ → packages/
- Move v3/tsconfig.json, v3/vitest.config.ts to root
- Merge v3/package.json into root package.json (ESM, scripts, deps, exports)
- Merge v3/scripts/ into scripts/, v3/implementation/ into docs/implementation/
- Update all CI workflows to remove "cd v3 &&" and v3/ path prefixes
- Fix all init installer path resolution (3-level-up → 2-level-up)
- Fix hooks to use "node ./dist/cli/bundle.js" instead of bare "aqe"
- Update settings.json ADR/DDD directories to docs/implementation/
- Fix helper scripts (statusline, adr-compliance, ddd-tracker, guidance-hooks)
- Update 58 agent definitions: aqe/v3/ → aqe/ memory namespaces
- Update 15 guidance shards: v3/src/ → src/ path references
- Fix sync interfaces: remove v3/ and v2/ path references
- Fix test path calculations (process.cwd() + '..' no longer needed)
- Fix flaky perf test threshold (500ms → 1000ms for CI environments)
- Fix complexity-analyzer test to match ADR-051 keyword-based eligibility

Build passes, 17,901 tests pass, CLI and MCP bundles verified.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-01 11:35:41 +00:00