Files
proffesor-for-testing__agen…/docs/implementation/adrs/MADR-001-v3-implementation-initiative.md
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

9.8 KiB

MADR-001: Agentic QE V3 Implementation Initiative

Field Value
Decision ID MADR-001
Type Master ADR
Initiative Agentic QE V3 Architecture Rewrite
Proposed By Architecture Team
Date 2026-01-20
Aggregate Status In Progress (18/20 Implemented)

WH(Y) Decision Statement

In the context of Agentic QE's evolution from a monolithic v2 architecture to an enterprise-grade quality engineering platform,

facing the need for Domain-Driven Design with clear bounded contexts, O(log n) sublinear performance for large codebases, self-learning capabilities through ReasoningBank, and a fleet of 47 specialized QE agents operating across 12 domains,

we decided for a complete architectural rewrite implementing DDD with 12 bounded contexts, HNSW-indexed vector search, SONA (Self-Optimizing Neural Architecture) learning, and hierarchical multi-agent coordination,

and neglected incremental v2 enhancement (insufficient architectural flexibility), third-party QE platform adoption (vendor lock-in, limited customization), and microservices decomposition (operational complexity for CLI tool),

to achieve 150x-12,500x search performance improvements, autonomous test generation with learning, cross-domain knowledge transfer, production-grade reliability with comprehensive observability, and seamless integration with Claude Flow,

accepting that this requires significant development effort (~6 months), migration tooling for v2 users, coordination across 20 architectural decisions, and ongoing maintenance of dual v2/v3 compatibility during transition.


Strategic Context

Agentic QE v2 served well as a proof-of-concept for AI-powered quality engineering, but its monolithic architecture created limitations:

  1. Performance ceiling: Linear search algorithms couldn't scale to enterprise codebases
  2. Limited learning: No persistent memory or cross-session pattern recognition
  3. Tight coupling: Changes in one area rippled through the entire system
  4. Agent proliferation: Ad-hoc agent additions without clear domain boundaries

V3 addresses these by adopting:

  • Domain-Driven Design: 12 bounded contexts with clear responsibilities
  • CQRS pattern: Separate read/write paths for optimal performance
  • Event sourcing: Full audit trail and replay capabilities
  • Hierarchical coordination: Queen coordinator managing specialized agents

Scope Boundary

In Scope

  • 12 DDD bounded contexts (test-generation, coverage-analysis, etc.)
  • 47 specialized QE agents with defined capabilities
  • HNSW-indexed vector search (150x faster)
  • ReasoningBank with SONA learning
  • MCP integration with 100+ tools
  • CLI with 26 commands, 140+ subcommands
  • V2 migration tooling and compatibility layer

Out of Scope

  • GUI/web interface (future initiative)
  • Cloud-hosted SaaS offering (future initiative)
  • Non-QE agent domains (handled by Claude Flow)
  • IDE plugins (separate packages)

Child ADR Registry

ADR ID Title Status Phase Owner
ADR-030 Coherence Gated Quality Gates Implemented 1-Core QE Team
ADR-031 Strange Loop Self-Awareness Implemented 1-Core Intelligence Team
ADR-032 Time Crystal Scheduling Implemented 2-Perf Performance Team
ADR-033 Early Exit Testing Implemented 2-Perf Performance Team
ADR-034 Neural Topology Optimizer Implemented 2-Perf Intelligence Team
ADR-035 Causal Discovery Implemented 3-Intel Intelligence Team
ADR-036 Result Persistence Implemented 4-Infra Infrastructure Team
ADR-037 V3 QE Agent Naming Superseded 4-Infra Architecture Team
ADR-038 Memory Unification Implemented 1-Core Infrastructure Team
ADR-039 MCP Optimization Implemented 4-Infra Integration Team
ADR-040 Agentic Flow Integration Implemented 5-Integration Integration Team
ADR-041 CLI Enhancement Implemented 4-Infra CLI Team
ADR-042 Token Tracking Integration Implemented 5-Integration Integration Team
ADR-043 Vendor Independent LLM Implemented 5-Integration Architecture Team
ADR-044 Domain RL Integration Implemented 3-Intel Intelligence Team
ADR-045 Version-Agnostic Naming Implemented 6-Migration Architecture Team
ADR-046 V2 Feature Integration Implemented 6-Migration Migration Team
ADR-047 Mincut Self-Organizing QE Implemented 2-Perf Intelligence Team
ADR-048 V2-V3 Agent Migration Implemented 6-Migration Migration Team
ADR-049 V3 Main Publish Approved 7-Release Release Team

Decision Sequencing

Phase 1: Core Architecture (Foundation)

Establishes the fundamental architectural patterns and data structures.

Included ADRs:

  • ADR-030: Coherence Gated Quality Gates
  • ADR-031: Strange Loop Self-Awareness
  • ADR-038: Memory Unification

Prerequisites: None

Status: Complete

Phase 2: Performance Optimization

Implements sublinear algorithms and scheduling optimizations.

Included ADRs:

  • ADR-032: Time Crystal Scheduling
  • ADR-033: Early Exit Testing
  • ADR-034: Neural Topology Optimizer
  • ADR-047: Mincut Self-Organizing QE

Prerequisites: Phase 1 complete (self-awareness for optimization signals)

Status: Complete

Phase 3: Intelligence Layer

Adds learning, causal discovery, and reinforcement learning capabilities.

Included ADRs:

  • ADR-035: Causal Discovery
  • ADR-044: Domain RL Integration

Prerequisites: Phase 1 complete (memory for learning storage)

Status: Complete

Phase 4: Infrastructure

CLI, MCP, result storage, and operational infrastructure.

Included ADRs:

  • ADR-036: Result Persistence
  • ADR-037: V3 QE Agent Naming (superseded by ADR-045)
  • ADR-039: MCP Optimization
  • ADR-041: CLI Enhancement

Prerequisites: Phase 1 complete

Status: Complete

Phase 5: Integration

External system integration and cross-cutting concerns.

Included ADRs:

  • ADR-040: Agentic Flow Integration
  • ADR-042: Token Tracking Integration
  • ADR-043: Vendor Independent LLM

Prerequisites: Phase 4 complete (CLI and MCP ready)

Status: Complete

Phase 6: Migration

V2 compatibility and migration tooling.

Included ADRs:

  • ADR-045: Version-Agnostic Naming
  • ADR-046: V2 Feature Integration
  • ADR-048: V2-V3 Agent Migration

Prerequisites: Phase 5 complete (full v3 functionality)

Status: Complete

Phase 7: Release

Publication and distribution.

Included ADRs:

  • ADR-049: V3 Main Publish

Prerequisites: Phase 6 complete (migration ready)

Status: In Progress


Progress Dashboard

MADR-001: Agentic QE V3 Implementation Initiative
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

Aggregate Status: In Progress (18/20 implemented, 1 superseded)

Phase 1: Core Architecture
  [✓] ADR-030: Coherence Gated Quality Gates (Implemented)
  [✓] ADR-031: Strange Loop Self-Awareness (Implemented)
  [✓] ADR-038: Memory Unification (Implemented)

Phase 2: Performance
  [✓] ADR-032: Time Crystal Scheduling (Implemented)
  [✓] ADR-033: Early Exit Testing (Implemented)
  [✓] ADR-034: Neural Topology Optimizer (Implemented)
  [✓] ADR-047: Mincut Self-Organizing QE (Implemented)

Phase 3: Intelligence
  [✓] ADR-035: Causal Discovery (Implemented)
  [✓] ADR-044: Domain RL Integration (Implemented)

Phase 4: Infrastructure
  [✓] ADR-036: Result Persistence (Implemented)
  [⊘] ADR-037: V3 QE Agent Naming (Superseded by ADR-045)
  [✓] ADR-039: MCP Optimization (Implemented)
  [✓] ADR-041: CLI Enhancement (Implemented)

Phase 5: Integration
  [✓] ADR-040: Agentic Flow Integration (Implemented)
  [✓] ADR-042: Token Tracking Integration (Implemented)
  [✓] ADR-043: Vendor Independent LLM (Implemented)

Phase 6: Migration
  [✓] ADR-045: Version-Agnostic Naming (Implemented)
  [✓] ADR-046: V2 Feature Integration (Implemented)
  [✓] ADR-048: V2-V3 Agent Migration (Implemented)

Phase 7: Release
  [~] ADR-049: V3 Main Publish (Approved, pending execution)

Progress: ██████████████████░░ 90%

Aggregate Status History

Status Date Notes
Proposed 2025-10-01 V3 initiative scoped
In Progress 2025-11-01 Phase 1 ADRs approved
In Progress 2025-12-15 Phase 1-4 complete
In Progress 2026-01-10 Phase 5-6 complete
In Progress 2026-01-20 ADR format migration initiated

Governance

Review Board Date Outcome Next Review
Architecture Team 2025-10-15 Approved initiative 2026-04-15
Architecture Team 2026-01-20 Phase 6 complete review 2026-04-20

References

Reference ID Title Type Location
ROADMAP V3 Implementation Roadmap Planning Doc docs/roadmap/v3-roadmap.md
DEP-GRAPH ADR Dependency Graph Dependency Map dependencies/adr-dependencies.yaml
MIGRATION ADR Format Migration Plan Migration Plan docs/plans/ADR-MIGRATION-PLAN-WHY-FORMAT.md

Definition of Done

This Master ADR is complete when:

  • All child ADRs identified and registered (20 ADRs)
  • Phase sequencing defined with dependencies (7 phases)
  • All Phase 1-6 ADRs implemented
  • Phase 7 (Release) complete
  • Progress dashboard reflects current state
  • Dependency graph created
  • All child ADRs migrated to WH(Y) format