Files
proffesor-for-testing__agen…/docs/implementation/adrs/ADR-034-neural-topology-optimizer.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

4.1 KiB

ADR-034: Neural Topology Optimizer

Field Value
Decision ID ADR-034
Status Accepted
Date 2026-01-10
Author Architecture Team
Review Cadence 6 months

WH(Y) Decision Statement

In the context of v3 AQE swarm topologies that coordinate multi-agent test execution across hierarchical, mesh, and ring configurations,

facing static topology configuration that doesn't adapt to workload patterns, no optimization feedback from successful executions, suboptimal agent-to-agent routing for latency, and manual tuning burden requiring human intervention,

we decided for neural topology optimization using reinforcement learning with a value network and experience replay to dynamically optimize swarm communication structure,

and neglected static topology configuration (no adaptation), rule-based optimization (limited flexibility), and genetic algorithms (slower convergence),

to achieve self-optimizing topology that learns optimal communication structure, measurable improvement in communication efficiency, TD error convergence over training, and reduced manual tuning,

accepting that this adds learning complexity, requires initial exploration phase with suboptimal actions, and needs sufficient training episodes to converge.


Context

Current v3 AQE swarm topologies are statically configured as fixed mesh, hierarchical, or ring topologies. They don't adapt to workload patterns, don't learn from past executions, and require manual tuning for optimization.

RuVector's Neural Graph Optimizer demonstrates a powerful pattern: policy SNN outputs graph modification actions via spike rates, value network estimates mincut improvement, and experience replay enables stable learning. This creates a self-optimizing topology where the swarm learns the optimal communication structure.

The optimizer uses epsilon-greedy action selection with five possible actions: add connection, remove connection, strengthen connection, weaken connection, and no-op. Rewards combine mincut improvement with communication efficiency.


Options Considered

Option 1: Neural Topology Optimization (Selected)

Uses reinforcement learning with a value network to estimate state values and TD-learning for weight updates. Experience replay prioritized by TD error enables stable learning.

Pros:

  • Continuous adaptation to workload patterns
  • Learns from task outcomes (success/failure as reward)
  • No manual tuning once trained

Cons:

  • Initial exploration phase may be suboptimal
  • Requires sufficient training episodes

Option 2: Static Topology (Rejected)

Use fixed mesh, hierarchical, or ring topologies without adaptation.

Why rejected: No adaptation to workload patterns; requires manual optimization.

Option 3: Rule-Based Optimization (Rejected)

Use hand-coded rules for topology modifications based on metrics.

Why rejected: Limited flexibility; can't discover novel optimizations.


Dependencies

Relationship ADR ID Title Notes
Part Of MADR-001 V3 Implementation Initiative Swarm optimization
Relates To ADR-031 Strange Loop Self-Awareness Shared adaptation concepts
Relates To ADR-035 Causal Discovery Learning patterns

References

Ref ID Title Type Location
SPEC-034-A Value Network Technical Spec specs/SPEC-034-A-value-network.md
SPEC-034-B Experience Replay Technical Spec specs/SPEC-034-B-experience-replay.md
SPEC-034-C Neural Optimizer Implementation Guide specs/SPEC-034-C-neural-optimizer.md

Governance

Review Board Date Outcome Next Review
Architecture Team 2026-01-10 Accepted 2026-07-10

Status History

Status Date Notes
Proposed 2026-01-10 Initial creation from RuVector analysis
Accepted 2026-01-10 Approved by Architecture Team