Files
proffesor-for-testing__agen…/docs/implementation/adrs/ADR-050-ruvector-neural-backbone.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

5.0 KiB

ADR-050: RuVector as Primary Neural Backbone

Field Value
Decision ID ADR-050
Status Implemented
Date 2026-01-20
Author GOAP Specialist
Review Cadence Monthly (active implementation)

WH(Y) Decision Statement

In the context of AQE v3's integration with ruvector ML capabilities including Q-Learning routing, SONA pattern recognition, and GNN-based code embeddings,

facing underutilized ML capabilities due to defensive fallback patterns (silent degradation), complete loss of learned patterns between sessions (no persistence), isolated code intelligence components without shared query language, and inability to measure actual ML vs fallback usage rates,

we decided for transforming ruvector from an optional enhancement to the primary neural backbone with mandatory observability, persistent learning state, and hypergraph-based code intelligence,

and neglected keeping the current fallback-first approach (hides ML failures), pure in-memory pattern storage (loses learning), and separate graph implementations per component (duplicated effort),

to achieve >80% ML usage rate (measured), 100% pattern retention across sessions, unified Cypher-like queries for code relationships, and explicit alerting when fallbacks occur,

accepting that this requires significant refactoring of the ruvector provider layer, migration of existing in-memory patterns to SQLite, and a 4-week phased implementation across 8 coordinated actions.


Context

The Six Thinking Hats analysis revealed three critical gaps in v3's ruvector integration:

  1. Fallback Overuse: The current architecture tries ML, fails silently to fallback, and users never know if ML is being used. No metrics exist to measure actual ML utilization.

  2. No Persistent Learning: Q-values from routing decisions and SONA patterns are stored in-memory only. Every restart loses all learned optimizations.

  3. Code Intelligence Gap: The KnowledgeGraphService, semantic analyzer, and impact analyzer operate in isolation without a shared query interface or cross-linking capability.

The GOAP plan defines 8 concrete actions to address these gaps, organized into 4 parallel-capable phases.


Options Considered

Option 1: ML-First with Observability (Selected)

Make ruvector the primary path, fallback only on error, with full metrics and alerting.

Pros: Maximizes ML value, provides visibility, enables optimization Cons: Requires refactoring, potential instability during transition

Option 2: Keep Fallback-First Approach (Rejected)

Maintain current defensive pattern where fallback is the safe default.

Why rejected: Hides ML value; users can't tell if they're getting ML benefits or basic fallback.

Option 3: Separate ML and Non-ML Modes (Rejected)

Let users explicitly choose between ML-enabled and fallback-only modes.

Why rejected: Adds configuration complexity; doesn't solve the observability or persistence problems.


Dependencies

Relationship ADR ID Title Notes
Part Of MADR-001 V3 Implementation Initiative Neural backbone enhancement
Depends On ADR-017 RuVector Integration Existing ruvector wrappers
Depends On ADR-038 Memory Unification SQLite persistence layer
Enables ADR-007 Quality Gate Decision Engine Better ML-based decisions
Enables ADR-022 Adaptive QE Agent Routing Persistent Q-values

References

Ref ID Title Type Location
SPEC-050-A ML Observability and Persistence Technical Spec specs/SPEC-050-A-ml-observability-persistence.md
SPEC-050-B Hypergraph Code Intelligence Technical Spec specs/SPEC-050-B-hypergraph-code-intelligence.md
SPEC-050-C Implementation Plan Implementation Guide specs/SPEC-050-C-implementation-plan.md
GOAP-PLAN Full GOAP Analysis Planning Document docs/plans/GOAP-V3-RUVECTOR-NEURAL-BACKBONE.md
SIX-HATS Six Thinking Hats Analysis Analysis docs/analysis/SIX-HATS-AQE-V3-RUVECTOR-ANALYSIS.md

Governance

Review Board Date Outcome Next Review
Architecture Team 2026-01-20 Approved 2026-02-20

Status History

Status Date Notes
Proposed 2026-01-20 GOAP plan created from Six Hats analysis
Approved 2026-01-20 Architecture review passed
In Progress 2026-01-20 Phase 1 implementation started
Implemented 2026-01-20 All 8 GOAP actions completed: observability, persistence, hypergraph