Expand description
Deterministic oracle system for validating RLM REPL trace outputs.
This module provides oracles that can verify FINAL() answers from RLM traces without requiring cloud LLM judges. This enables synthetic training data generation for the BitNet distilled navigation model.
§Architecture
- Grep Oracle: Pattern-match verification (e.g., “find all async functions”)
- Tree-sitter Oracle: Structural AST verification (function signatures, etc.)
- Validator Pipeline: Routes queries to appropriate oracles and outputs golden traces
§Usage
ⓘ
use codetether_agent::rlm::oracle::{TraceValidator, OracleResult};
let validator = TraceValidator::new();
let result = validator.validate(&analysis_result, &source_file).await;
match result {
OracleResult::Golden(trace) => save_to_jsonl(trace),
OracleResult::Unverified => {} // No oracle available
OracleResult::Failed(reason) => {} // Oracle disagrees
}Structs§
- AstPayload
- AST/structural query payload.
- AstResult
- A single AST query result.
- Generated
Query - A pre-generated query ready for use.
- Grep
Match - A single grep match with line number and text.
- Grep
Oracle - Grep-based oracle for validating pattern-match queries.
- Grep
Payload - Grep/pattern-match payload.
- Query
Template - A query template for oracle-friendly trace generation.
- Semantic
Payload - Semantic/free-form text payload (unverifiable).
- Trace
Validator - Trace validator that routes to appropriate oracles.
- Tree
Sitter Oracle - Tree-sitter based oracle for validating structural queries.
- Validated
Trace - A validated RLM trace ready for training data export.
Enums§
- Final
Answer Format - Classification of an RLM FINAL() answer format.
- Final
Payload - The top-level FINAL() payload envelope.
- Oracle
Result - Result of oracle validation.
- Query
Type - Query type classification for routing to the appropriate oracle.
- Template
Kind - The kind of oracle this template is designed for.
- Verification
Method - Method used to verify the trace.