Skip to content

Rust Engine v0.2.0 - Core Serialization πŸ¦€

Choose a tag to compare

@alanbld alanbld released this 14 Dec 08:17
· 181 commits to main since this release
0f18f00

πŸ¦€ Rust Engine v0.2.0 - Core Serialization

The Rust engine reaches its first functional milestone with complete core serialization.

βœ… What's Implemented

Core Serialization

  • Directory traversal: Recursive file walking with pattern matching
  • Plus/Minus format: Byte-identical output with Python engine
  • MD5 checksums: Content integrity verification
  • Binary detection: Skip non-text files automatically

Pattern Matching

  • Include patterns: Glob-based file selection
  • Exclude patterns: Directory and file filtering
  • Default ignores: .git, target, node_modules, etc.

πŸ“Š Test Status

running 8 tests
test test_calculate_md5 ... ok
test test_is_binary_empty ... ok
test test_is_binary_text ... ok
test test_is_binary_with_null ... ok
test test_format_file_entry ... ok
test test_walk_directory ... ok
test test_serialize_single_file ... ok
test test_serialize_excludes_binary ... ok

test result: ok. 8 passed; 0 failed

πŸ”§ Architecture

Library-First Pattern:

// lib.rs - Pure logic, reusable
pub fn serialize_project(root: &str) -> Result<String, String>
pub fn walk_directory(root: &Path, include: &[&str], exclude: &[&str]) -> Vec<FileEntry>
pub fn calculate_md5(content: &str) -> String
pub fn is_binary(content: &[u8]) -> bool

// bin/main.rs - Thin CLI wrapper
fn main() {
    let result = pm_encoder::serialize_project(&path);
    println!("{}", result.unwrap());
}

Enables future:

  • WASM compilation
  • Python bindings (PyO3)
  • Library embedding

πŸ“ˆ Comparison with Python

Feature Python v1.5.0 Rust v0.2.0
Core Serialization βœ… βœ…
Plus/Minus Format βœ… βœ…
MD5 Checksums βœ… βœ…
Binary Detection βœ… βœ…
Include/Exclude βœ… βœ…
Language Analyzers βœ… (7) ❌ (planned)
Truncation Modes βœ… (3) ❌ (planned)
Context Lenses βœ… (4) ❌ (planned)
--init-prompt βœ… ❌ (planned)

Next milestone: v0.3.0 - Configuration System


πŸš€ Usage

cd pm_encoder/rust
cargo build --release
./target/release/pm_encoder /path/to/project

πŸ—ΊοΈ Roadmap

Version Target Status
v0.1.0 Foundation βœ… Complete
v0.2.0 Core Serialization βœ… This release
v0.3.0 Configuration πŸ”„ Next
v0.4.0 Sorting & File Handling πŸ“‹ Planned
v0.5.0 Test Parity πŸ“‹ Planned
v1.0.0 Production Ready πŸ“‹ Q2 2026

πŸ“¦ Dependencies

[dependencies]
md5 = "0.7"  # Only external dependency

Zero runtime dependencies for core functionality.


The Twins grow together! πŸπŸ¦€

Changelog: rust-v0.1.0...rust-v0.2.0