Files
wifi-densepose/docs/adr/coherence-engine/ADR-CE-016-ruvllm-coherence-validator.md
ruv d803bfe2b1 Squashed 'vendor/ruvector/' content from commit b64c2172
git-subtree-dir: vendor/ruvector
git-subtree-split: b64c21726f2bb37286d9ee36a7869fef60cc6900
2026-02-28 14:39:40 -05:00

53 lines
1.2 KiB
Markdown

# ADR-CE-016: RuvLLM CoherenceValidator Uses Sheaf Energy
**Status**: Accepted
**Date**: 2026-01-22
**Parent**: ADR-014 Coherence Engine Architecture
## Context
RuvLLM's `CoherenceValidator` currently uses heuristic scoring to detect:
- Semantic inconsistency
- Factual contradictions
- Logical errors
These heuristics are:
- Pattern-based (can be fooled)
- Not mathematically grounded
- Difficult to explain
## Decision
**RuvLLM CoherenceValidator uses sheaf energy, not heuristic scores.**
Integration:
```rust
pub struct SheafCoherenceValidator {
graph: SheafGraph,
gate: CoherenceGate,
inner: CoherenceValidator, // Fallback
}
```
Process:
1. Convert context and response to sheaf nodes
2. Add edges for semantic implications
3. Compute coherence energy
4. Gate decision replaces heuristic score
## Consequences
### Benefits
- Mathematical proof of inconsistency, not pattern matching
- Explainable: can show which edges have high residuals
- Unified with Prime-Radiant governance
### Risks
- Requires embedding quality for node states
- Edge creation logic needs domain expertise
## References
- ADR-014: Coherence Engine Architecture, "RuvLLM Integration"
- ruvllm/src/quality/coherence.rs