Skip to main content

Module oracle

Module oracle 

Source
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.
GeneratedQuery
A pre-generated query ready for use.
GrepMatch
A single grep match with line number and text.
GrepOracle
Grep-based oracle for validating pattern-match queries.
GrepPayload
Grep/pattern-match payload.
QueryTemplate
A query template for oracle-friendly trace generation.
SemanticPayload
Semantic/free-form text payload (unverifiable).
TraceValidator
Trace validator that routes to appropriate oracles.
TreeSitterOracle
Tree-sitter based oracle for validating structural queries.
ValidatedTrace
A validated RLM trace ready for training data export.

Enums§

FinalAnswerFormat
Classification of an RLM FINAL() answer format.
FinalPayload
The top-level FINAL() payload envelope.
OracleResult
Result of oracle validation.
QueryType
Query type classification for routing to the appropriate oracle.
TemplateKind
The kind of oracle this template is designed for.
VerificationMethod
Method used to verify the trace.