Metadata-Version: 2.5
Name: mainframe-migration-toolkit
Version: 0.5.0
Summary: Runtime and deterministic tools for COBOL/JCL to PySpark migrations
Author: Mainframe Migration Toolkit
Requires-Python: >=3.10
Provides-Extra: all
Requires-Dist: pyarrow>=15; extra == 'all'
Requires-Dist: pyspark<5,>=3.5; extra == 'all'
Provides-Extra: dev
Requires-Dist: pytest-cov>=5; extra == 'dev'
Requires-Dist: pytest>=8.2; extra == 'dev'
Provides-Extra: parquet
Requires-Dist: pyarrow>=15; extra == 'parquet'
Provides-Extra: spark
Requires-Dist: pyspark<5,>=3.5; extra == 'spark'
Description-Content-Type: text/markdown

# Mainframe Migration Toolkit

Python tools and runtime support for specification-led COBOL and JCL migrations to PySpark.

## Installation

Install the complete runtime:

```bash
python -m pip install "mainframe-migration-toolkit[all]"
```

Python 3.10 or newer is required. Java 17 is required for the bundled dataset validator and is recommended when running PySpark pipelines.

## Quick start

Initialize a migration workspace from its parent directory:

```bash
python -m mainframe_toolkit init-workspace .
```

The command creates an isolated `migration/` Git repository and preserves existing source, input, and golden-dataset directories outside that repository.

Inspect the initialized workspace:

```bash
python -m mainframe_toolkit inspect migration --strict
```

Claude Code can run the orchestrated multi-agent workflow from `migration/`:

```bash
claude --agent mainframe-migration-supervisor
```

In Devin, invoke `migrate-mainframe-job`. The toolkit installs the native entry skill in `.devin/skills/` and worker agents in `.devin/agents/`; the principal session coordinates them sequentially. If delegation is unavailable, it continues the work itself. No ACP setup is required. Existing customized assets are preserved and reported as conflicts by `init-workspace`; review old `.agents/skills/` migration definitions before removing them. While these legacy definitions remain, installation of native Devin assets is deferred to avoid competing instructions; Claude assets can still be updated.

Other commands parse JCL and copybooks, convert sequential datasets, scaffold PySpark jobs, analyze source similarity, and validate output against golden datasets. Run `python -m mainframe_toolkit --help` for the complete command list.

Generated programs expose pure DataFrame functions. The caller wires `FunctionStep`,
`InputBinding` and `OutputBinding`; optional `OutputSink` exports an output while
the next program receives its canonical DataFrame in memory. Readers, raw
contracts, `to_canonical` mappers and canonical contracts remain separate.
Contract checks inspect structure/schema only; conversion errors arise from
native Spark expressions on normal actions. CSV and Parquet readers/writers
are provided; custom sources, mappers and sinks use explicit callables.
`PipelineProgram`/`ProgramStep` remain compatible with previously generated jobs.
Use `python -m mainframe_toolkit references --path` for runnable examples.
