# Spydecy - Self-Hosted Python/C-to-Rust Compiler-Debugger
[](https://crates.io/crates/spydecy)
[](https://github.com/noahgift/spydecy/actions)
[](https://opensource.org/licenses/MIT)
[](https://crates.io/crates/spydecy)
**Version 0.1.0 Released** ๐ โข **EXTREME TDD** โข **Zero Tolerance SATD** โข **50 Tests Passing**
Unified Python and C-to-Rust transpilation with introspective debugging capabilities.
## ๐ฆ Published Crates
| [spydecy](https://crates.io/crates/spydecy) | 0.1.0 | Main CLI application |
| [spydecy-hir](https://crates.io/crates/spydecy-hir) | 0.1.0 | Unified HIR (High-level IR) |
| [spydecy-python](https://crates.io/crates/spydecy-python) | 0.1.0 | Python AST parser (PyO3) |
| [spydecy-debugger](https://crates.io/crates/spydecy-debugger) | 0.1.0 | Introspective debugger |
## ๐ฏ Quick Start
### Installation
#### From crates.io (Recommended)
```bash
# Install the latest release
cargo install spydecy
# Verify installation
spydecy --version
```
#### For Development
**Prerequisites:**
- Rust 1.75.0+
- Python 3.10-dev: `sudo apt-get install python3.10-dev`
- libclang-14-dev: `sudo apt-get install libclang-14-dev`
- PMAT: `cargo install pmat`
```bash
# Clone repository
git clone https://github.com/noahgift/spydecy.git
cd spydecy
# Install all development tools
make install-tools
# Setup project
make setup
# Build
make build
# Run quality gates
make quality-gate
```
### Usage
```bash
# Visualize Python AST
spydecy debug --visualize example.py
# Show version
spydecy --version
# Get help
spydecy --help
```
## ๐ Documentation
**Start Here**: [Response to Gemini AI Review](docs/specification/RESPONSE-TO-GEMINI-REVIEW.md) โญ
### Critical Documents
1. **[Sprint 0: Tracer Bullet](docs/specification/SPRINT-0-TRACER-BULLET.md)** - 2-week validation sprint
2. **[Incremental Debugger Roadmap](docs/specification/INCREMENTAL-DEBUGGER-ROADMAP.md)** - Build debugger alongside transpiler
3. **[Pluggable C-API Architecture](docs/specification/PLUGGABLE-C-API-ARCHITECTURE.md)** - Extensible C-API analysis
### Full Specification
- [Main Specification](docs/specification/transpiled-python-c-to-rust-self-hosted-compiler-debugger.md)
- [Specification Index](docs/specification/README.md)
## ๐งช Quality Standards
| Test Coverage | โฅ80% | PMAT + CI |
| Mutation Score | โฅ90% | cargo-mutants |
| Complexity | โค10 CCN | PMAT pre-commit |
| SATD Comments | 0 | PMAT (zero tolerance) |
| Clippy Warnings | 0 | CI/CD |
| Unsafe Code | <5 per 1000 LOC | Static analysis |
## ๐ Development
### Quality Gates
```bash
# Fast quality check
make quality-fast
# Full quality gate (with coverage & mutation)
make quality-gate
# Pre-commit checks
make pre-commit
# Continuous improvement analysis
make kaizen
```
### Testing
```bash
# Run all tests
make test
# Property-based tests (1000 cases/property)
make test-property
# Mutation testing
make mutants
# Code coverage
make coverage
```
### Development Mode
```bash
# Auto-reload on changes
make dev
# Watch and run tests
make watch
```
## ๐๏ธ Project Status
**Current Version**: v0.1.0 (Released 2025-10-22)
**Current Phase**: Sprint 3 - C Transpiler Foundation
### Completed Milestones โ
- โ
**Sprint 0**: Tracer Bullet Validation - Core assumption proven: `len()` unification works!
- โ
**Sprint 2**: Python Transpiler - Full Python AST parsing with PyO3 (7/7 tests)
- โ
**v0.1.0 Release**: Published to crates.io with 50 passing tests
- spydecy-hir: Unified HIR foundation
- spydecy-python: Python parser working
- spydecy-debugger: Introspective debugger
- spydecy: Main CLI application
### In Progress ๐ง
- โณ **Sprint 3**: C Transpiler Foundation
- โ
C parser complete (11/11 tests)
- โ
CPython API pattern recognition
- โณ First unification tests (Python + C โ Rust)
- โณ C debugger visualization
### Roadmap
- **v0.2.0** (Est. 2 weeks): Complete unification - First Python + C โ Rust tests working
- **v0.3.0** (Est. 4 weeks): Cross-layer optimization - Boundary elimination
- **v0.4.0** (Est. 8 weeks): Full code generation pipeline
- **v1.0.0** (Est. 12 weeks): Production ready - Self-hosting capability
See [RELEASE-v0.1.0.md](RELEASE-v0.1.0.md) for detailed release notes.
## ๐ฌ Architecture
### Multi-Layer Pipeline
```
Python Source โ Python HIR โโ
โโโ Unified HIR โ Optimizer โ Rust
C Source โ C HIR โโโโโโโโโโโโ
```
### Key Innovations
1. **Unified Python/C Transpilation** - Leverages CPython's C implementation
2. **Introspective Debugging** - Step through transpilation process
3. **Pluggable C-API** - CPython, NumPy, SciPy, community plugins
4. **Self-Hosting** - Compiler transpiles itself for validation
## ๐ Makefile Targets
```bash
make help # Show all available targets
make install-tools # Install all dev tools (PMAT, etc.)
make quality-gate # Run full quality gate suite
make kaizen # Continuous improvement analysis
make ci # Full CI pipeline
```
## ๐ค Contributing
### Development Methodology: EXTREME TDD
1. **RED**: Write failing tests first
2. **GREEN**: Minimal implementation
3. **REFACTOR**: Meet quality gates (โค10 CCN, 0 SATD, 80%+ coverage)
### Quality Requirements
- โ
All tests pass
- โ
Coverage โฅ80%
- โ
Mutation score โฅ90%
- โ
Complexity โค10 CCN
- โ
Zero SATD comments (TODO/FIXME/HACK)
- โ
Zero Clippy warnings
- โ
Code formatted with rustfmt
### Pre-Commit Hooks
Pre-commit hooks automatically enforce quality gates:
- Code formatting
- Clippy lints
- PMAT complexity & SATD checks
- Fast test suite
## ๐ License
Licensed under either of:
- Apache License, Version 2.0 ([LICENSE-APACHE](LICENSE-APACHE))
- MIT license ([LICENSE-MIT](LICENSE-MIT))
at your option.
## ๐ Acknowledgments
Inspired by:
- **depyler**: Python-to-Rust transpiler
- **decy**: C-to-Rust transpiler with extreme quality
- **bashrs**: Formal verification and property testing
- **ruchy**: Self-hosting and PMAT integration
- **Toyota Production System**: Jidoka, Kaizen, Genchi Genbutsu
---
**Built with EXTREME quality standards. Zero compromises. ๐**
**Status**: v0.1.0 Released to crates.io โ
**Current**: Sprint 3 - C Transpiler Foundation
**Next**: v0.2.0 - First Python + C unification tests
๐ฆ **Install now**: `cargo install spydecy`
๐ **Documentation**: [RELEASE-v0.1.0.md](RELEASE-v0.1.0.md)
๐ **Crates.io**: https://crates.io/crates/spydecy