spydecy 0.2.0

Self-hosted Python/C-to-Rust compiler-debugger with introspective debugging
Documentation
# Spydecy - Self-Hosted Python/C-to-Rust Compiler-Debugger

[![Crates.io](https://img.shields.io/crates/v/spydecy.svg)](https://crates.io/crates/spydecy)
[![CI Status](https://github.com/noahgift/spydecy/workflows/CI%20-%20Quality%20Gates/badge.svg)](https://github.com/noahgift/spydecy/actions)
[![License: MIT OR Apache-2.0](https://img.shields.io/badge/license-MIT%20OR%20Apache--2.0-blue.svg)](https://opensource.org/licenses/MIT)
[![Downloads](https://img.shields.io/crates/d/spydecy.svg)](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

| Crate | Version | Description |
|-------|---------|-------------|
| [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

| Metric | Target | Enforcement |
|--------|--------|-------------|
| 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