Skip to main content

Module trace

Module trace 

Source
Expand description

DECY-193: Decision tracing / flight recorder for transpilation.

Provides a JSON audit trail of all decisions made during transpilation, including ownership inference, type mapping, and code generation choices.

§Examples

use decy_core::trace::{TraceCollector, TraceEntry, DecisionType, PipelineStage};

let mut collector = TraceCollector::new();
collector.record(TraceEntry {
    stage: PipelineStage::OwnershipInference,
    source_location: Some("line 10".to_string()),
    decision_type: DecisionType::PointerClassification,
    chosen: "Box<i32>".to_string(),
    alternatives: vec!["&i32".to_string(), "&mut i32".to_string()],
    confidence: 0.95,
    reason: "malloc/free pattern detected".to_string(),
});

assert_eq!(collector.entries().len(), 1);

Structs§

TraceCollector
Collects trace entries during transpilation.
TraceEntry
A single decision recorded during transpilation.
TraceSummary
Summary statistics for a trace.

Enums§

DecisionType
Type of decision being recorded.
PipelineStage
Stage of the transpilation pipeline where a decision was made.