convez.ai
PluginAutomaçãoAvançado
raja-taparia

Orquestrador Delphi para Rust com IA

raja-taparia/delphi-to-rust-ai-orchestrator

Migra código Delphi legado para Rust com geração automática de testes

Ver no GitHub
InicialPluginScore · de 0 a 100

Plugin que automatiza a migração de código legado Delphi para Rust idiomático usando Claude da Anthropic, gerando testes Golden Master automaticamente. Reduz o esforço manual de refatoração de sistemas antigos através de orquestração de IA.

Instalação

$npx convez-ai raja-taparia/delphi-to-rust-ai-orchestrator

1 comando no terminal: detecta o formato do repositório (marketplace ou plugin avulso) e instala via Claude Code. Requer Node 18+ e o Claude Code instalado.

Métricas

Estrelas
0
Forks
0
Acompanhando
0
Saúde
28%
Último commit
há 8 meses
Versão
—
Issues abertas
0
Contribuidores
1

Casos de uso

  • Modernizar aplicações Delphi legadas para Rust
  • Gerar testes de caracterização (Golden Master) durante migração
  • Automatizar tradução de lógica de negócio entre linguagens

Veredito

Solução específica e bem-estruturada para um problema niche (migração Delphi→Rust). Funciona como prova de conceito sólida aproveitando Claude para tradução de código legado, mas exige conhecimento técnico profundo tanto de Delphi quanto de Rust para extensão efetiva.

README

A tradução para o português deste README ainda está na fila.

Delphi to Rust AI Orchestrator

A minimal, opinionated orchestrator that demonstrates how to migrate legacy Delphi logic into idiomatic Rust using an LLM (Anthropic Claude) and generate Golden Master tests.

This project is intentionally small and structured to be easy to extend.


🚀 Quick Start

1) Create and activate a Python virtual environment (recommended)

python -m venv .venv
source .venv/bin/activate

2) Install dependencies

pip install -r requirements.txt

3) Install the package in editable mode

pip install -e .

4) Configure your Anthropic API key

cp .env .env.local
# Edit .env.local and set your API key

5) (Optional) Tune behavior via config.yml

config.yml controls:

  • which Anthropic model is used
  • token limits for translation + test generation
  • output directory structure

▶️ Run the orchestrator

python -m delphi_to_rust_ai_orchestrator

CLI options

python -m delphi_to_rust_ai_orchestrator \
  --legacy-dir ./legacy_delphi \
  --target-dir ./out \
  --rust-dir src \
  --tests-dir tests \
  --config config.yml

Run without writing output:

python -m delphi_to_rust_ai_orchestrator --dry-run

✅ Recommended commands (Makefile)

make install  # install dependencies + editable package
make run      # run the orchestrator
make test     # run unit tests
make clean    # clean build artifacts

🗂 Project Structure

  • src/delphi_to_rust_ai_orchestrator/ — main package source
  • tests/ — unit tests
  • legacy_delphi/ — place legacy Delphi source files here for migration
  • config.yml — engine defaults (model, token limits, output paths)
  • .env — local secrets (API key)
  • pyproject.toml — packaging metadata
  • Makefile — convenience commands

🧠 How It Works

  1. The pipeline reads legacy Delphi code (currently mocked).
  2. It calls Anthropic Claude to translate Delphi → Rust.
  3. It calls Anthropic Claude to generate Golden Master tests.
  4. It writes generated outputs to the configured directory.

🧪 Testing

make test

� Example output (dry-run)

--- Starting Delphi to Rust Migration Pipeline ---
⚠️  No legacy Delphi sources found. Falling back to a mocked example.
🚀 Initializing AI-Assisted Extraction for module: mocked_ping_sensor...
🛡️ Generating Golden Master / Characterization Tests...

✅ AI Extraction Complete. Ready for Human Architectural Review.
Preview of generated Rust (Async Tokio implementation):
----------------------------------------
use tokio::net::TcpStream;
use std::net::SocketAddr;

pub async fn execute_ping(ip: &str) -> Result<u32, Error> {... }

🤝 How to contribute / extend

This project is intentionally small, so contributions are welcome.

  1. Fork the repo and create a feature branch.
  2. Add or improve the parser in src/delphi_to_rust_ai_orchestrator/legacy.py.
  3. Update prompts in src/delphi_to_rust_ai_orchestrator/prompts.py or improve generation in src/delphi_to_rust_ai_orchestrator/translator.py.
  4. Add tests under tests/ and run make test.
  5. Submit a PR with a short description of your change.

�🔧 Next Improvements

  • Add real Delphi parsing + discovery
  • Improve output formatting and module naming
  • Add richer CLI configuration
  • Add integration tests and error reporting
Ver o original no GitHub

Bom para