Skip to content

ADR-029: External Intelligence Providers for SONA Learning#190

Open
grparry wants to merge 2 commits intoruvnet:mainfrom
grparry:proposal/adr-029-intelligence-providers
Open

ADR-029: External Intelligence Providers for SONA Learning#190
grparry wants to merge 2 commits intoruvnet:mainfrom
grparry:proposal/adr-029-intelligence-providers

Conversation

@grparry
Copy link

@grparry grparry commented Feb 20, 2026

Summary

This proposes and implements a trait-based extension point — IntelligenceProvider — that lets external systems feed quality signals into ruvllm's SONA learning loops, embedding classifier, and model router without modifying ruvllm core.

Resolves #191

What's implemented

File Description
src/intelligence/mod.rs IntelligenceProvider trait, FileSignalProvider, IntelligenceProviderLoader registry, signal/weight types
claude_flow/model_router.rs calibration_bias() on TaskComplexityAnalyzer (requires 10+ feedback records)
lib.rs Public re-exports at crate root
docs/adr/ADR-029-* Status updated to "Accepted (Implemented)"

The trait

pub trait IntelligenceProvider: Send + Sync {
    fn name(&self) -> &str;
    fn load_signals(&self) -> Result<Vec<QualitySignal>>;
    fn quality_weights(&self) -> Option<QualityWeights> { None }
}
  • Providers are registered with IntelligenceProviderLoader and called during load_all()
  • A built-in FileSignalProvider covers the common case (non-Rust systems write JSON)
  • Zero overhead when no providers are registered
  • Backward compatible — existing loading is unchanged

Design decisions

  • Follows LlmBackend pattern — trait object behind Box<dyn IntelligenceProvider>
  • Non-fatal provider errors — one provider failing doesn't block others
  • Two JSON formats — bare array [...] or wrapped {"signals": [...]}
  • calibration_bias() requires 10+ records — avoids noisy corrections from sparse data

Test plan

  • cargo check -p ruvllm compiles
  • 7 intelligence module tests pass (file parsing, loader, fault tolerance)
  • 2 existing integration tests still pass
  • Manual: Write a signal JSON file, register FileSignalProvider, verify load_all() returns signals

🤖 Generated with Claude Code

ADR-029 proposes a trait-based extension point that lets external systems
(workflow engines, CI/CD pipelines, coding assistants) feed quality signals
into ruvllm's learning loops without modifying ruvllm core.

Motivated by the gap between ADR-002's vision (quality data feeding SONA)
and the current reality (no ingestion interface for external systems).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
ruvnet added a commit that referenced this pull request Feb 21, 2026
…Learning

Implement trait-based IntelligenceProvider extension point for external
quality signals. Addresses PR #190 proposal (renumbered from ADR-029 to
avoid collision with existing ADR-029-rvf-canonical-format).

- IntelligenceProvider trait with load_signals() and quality_weights()
- FileSignalProvider built-in for JSON file-based signal exchange
- IntelligenceLoader for multi-provider registration and aggregation
- QualitySignal, QualityFactors, ProviderQualityWeights types
- calibration_bias() on TaskComplexityAnalyzer for router feedback
- 12 unit tests (all passing)

Co-Authored-By: claude-flow <ruv@ruv.net>
Implements the trait-based extension point proposed in ADR-029:

- IntelligenceProvider trait (name, load_signals, quality_weights)
- FileSignalProvider built-in (reads JSON array or {signals:[...]} format)
- IntelligenceProviderLoader registry with load_all() and per-provider stats
- QualitySignal, QualityFactors, QualityWeights types with serde support
- calibration_bias() on TaskComplexityAnalyzer (requires 10+ feedback records)
- 7 unit tests covering file parsing, loader orchestration, and fault tolerance

ADR status updated from "Proposal (Draft)" to "Accepted (Implemented)".

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ADR-029: External Intelligence Providers for SONA Learning

1 participant