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

Knowledge Transfer

Migration projects create knowledge silos if not managed deliberately. This chapter covers documentation-driven development, Oracle mode as a knowledge base, and cross-training on Rust idioms.

Documentation-Driven Development

Every migrated module should have a doc comment explaining its origin:

#![allow(unused)]
fn main() {
//! # Data Loader
//!
//! Migrated from `src/data_loader.py`.
//!
//! ## Key Changes
//! - `load_csv()` returns `Result<DataFrame>` instead of raising exceptions
//! - NumPy operations replaced with trueno `Vector`
//! - File I/O uses `BufReader` for 3x throughput improvement
}

Oracle Mode as Knowledge Base

Batuta’s Oracle provides natural language access to stack knowledge:

batuta oracle "How do I load a model with quantization?"
batuta oracle --recipe ml-random-forest --format code
batuta oracle --rag "tokenization pipeline"

Re-index after adding documentation:

batuta oracle --rag-index

Cross-Training on Rust Idioms

Python-to-Rust Mental Model Shifts

Python ConceptRust EquivalentKey Difference
try/exceptResult<T, E> + ?Errors are values
None checksOption<T> + .map()Compiler-enforced null safety
classstruct + implNo inheritance; use traits
List comprehension.iter().map().collect()Lazy evaluation
with context managerDrop traitAutomatic cleanup on scope exit
  1. Week 1-2: Rust Book chapters 1-10 (ownership, borrowing, traits)
  2. Week 3-4: Read stack code with pmat query --include-source
  3. Week 5-6: Pair-program on a low-risk migration
  4. Week 7+: Independent migration with mentored review

Knowledge Artifacts

ArtifactLocationPurpose
CLAUDE.mdProject rootMachine-readable project context
Oracle recipesbatuta oracle --cookbookCode patterns with tests
mdBookbook/src/Comprehensive reference
API docscargo doc --no-depsGenerated from doc comments

Navigate: Table of Contents