Ty adoption migration plan¶
Purpose¶
Adopt ty as a peer type checker alongside mypy, run both in parallel long
enough to build confidence, and then retire mypy once parity is proven.
Scope¶
- Python repositories governed by the canonical standards.
- CI hard gates and local validation scripts.
- Developer tooling and dependency management.
Non-goals¶
- Changing the type-hinting style rules or typing standards.
- Introducing new runtime dependencies.
- Rewriting unrelated tooling or CI workflows.
Assumptions¶
mypyremains the authoritative gate until cutover is explicitly approved.tyis installed as a dev dependency and invoked via the same tooling convention as existing checks (for example,uv run ty check).- The migration uses existing version and dependency gate policies.
Plan¶
Phase 0: Baseline decisions¶
- Pin
tyto the latest available version at adoption time (current target:0.0.13, released 2026-01-21) and manage it like other dev tools. - Use community defaults:
ty checkas the canonical command and[tool.ty]inpyproject.tomlfor configuration. - Define the parity criteria required to remove
mypy(TBD; data-driven).
Phase 1: Standards updates¶
- Update Python development standards to include
tyalongsidemypy. - Update local validation guidance to run
tyin addition tomypy. - Update CI gate definitions to include
tyas a hard gate (whilemypyremains in place). - Add
tyto dependency update scope and audit expectations.
Phase 2: Repository enablement¶
For each repo:
- Add
tyto the dev dependency group. - Update local validation scripts to run
ty. - Update CI workflows to run
tyin parallel withmypy. - Update project documentation to reflect the new command.
- Regenerate lockfiles and requirements exports.
Phase 3: Side-by-side evaluation¶
- Run
tyandmypyon every repo and capture outcomes. - Log discrepancies (false positives, missing coverage, configuration gaps) in repo-specific issues.
- Track elapsed time and stability of
tyruns for each repo.
Phase 4: Remediation and alignment¶
- Resolve code issues that are valid for both checkers.
- Adjust configuration to align
tywith the established typing standard. - Keep
mypyauthoritative until all blockers are closed.
Phase 5: Cutover and cleanup¶
- Remove
mypyfrom CI gates and local validation. - Remove
mypyfrom dev dependencies and requirements exports. - Update standards documentation to make
tythe sole required checker. - Close the migration issues and document the completion.
Acceptance criteria¶
tyruns cleanly on all in-scope repositories with no new unresolved errors.- All mismatches between
tyandmypyhave documented resolutions. typerformance and stability are acceptable for CI hard-gate usage.- Explicit approval to remove
mypyis recorded before cutover.
Risks and mitigations¶
- Behavioral divergence: keep
mypyauthoritative until parity is proven. - False positives: track issues per repo and fix or configure explicitly.
- Tooling instability: pin the
tyversion and upgrade only through the standard dependency update workflow.
Rollback strategy¶
If ty causes instability, disable it in CI and local validation by reverting
Phase 2 changes. Keep mypy as the sole gate until a new decision is made.
Open questions¶
- What criteria and duration define "parity" for cutover approval?