Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

State Inspection

Batuta persists pipeline state in the .batuta/ directory. Inspecting this state reveals what happened at each phase when the pipeline behaves unexpectedly.

The .batuta/ Directory

.batuta/
├── pipeline_state.json     # Current phase and status
├── analysis/
│   ├── languages.json      # Detected languages and line counts
│   ├── dependencies.json   # Dependency graph
│   └── tdg_scores.json     # TDG grades per file
├── transpilation/
│   ├── tool_selection.json # Which transpiler per file
│   ├── errors.json         # Transpilation errors
│   └── mapping.json        # Source-to-output file mapping
├── optimization/
│   └── backend.json        # Backend selection decisions
├── validation/
│   ├── traces/             # renacer trace files
│   └── comparison.json     # Trace diff results
└── cache/
    ├── tool_versions.json  # Cached transpiler versions
    └── dep_mapping.json    # Cached dependency mappings

Inspecting Pipeline State

cat .batuta/pipeline_state.json
{
  "current_phase": "validation",
  "status": "failed",
  "phases": {
    "analysis": { "status": "completed", "duration_ms": 1234 },
    "transpilation": { "status": "completed", "duration_ms": 5678 },
    "validation": { "status": "failed", "error": "trace_mismatch" }
  }
}

Common Inspection Commands

# Find files that failed transpilation
cat .batuta/transpilation/errors.json | jq '.errors[]'

# Check TDG scores for failing modules
cat .batuta/analysis/tdg_scores.json | jq '.[] | select(.grade == "F")'

# Check backend selection decisions
cat .batuta/optimization/backend.json

Cache Invalidation

SymptomCache to Clear
Wrong transpiler versionrm .batuta/cache/tool_versions.json
Dependency mapping stalerm .batuta/cache/dep_mapping.json
Pipeline uses stale datarm -rf .batuta/analysis/

Resetting Pipeline State

# Reset a single phase
batuta reset --phase validation

# Reset the entire pipeline
batuta reset

Prefer batuta reset over manual deletion – it handles state transitions correctly.


Navigate: Table of Contents