How it works
MigraSutra turns a repository into reviewable evidence in five steps. Nothing from your project is ever executed.
The whole flow#
scan.json
Findings with file, line, rule ID and a SHA-256 of each source.
plan.json
One field change, its baseline hash, prerequisites and rollback notes.
rehearsal.json
Before and after hashes. Tests and rollback are marked as not run.
gate.json
NO_GO or REVIEW_REQUIRED with every reason listed.
Step 1: Scan#
The scanner reads only an allow-list of files. It refuses symbolic links and files over 1 MiB, and hashes everything it reads.
| Ecosystem | What happens | Depth |
|---|---|---|
| SQL migrations | 7 rules | rules |
| npm | 3 rules, plan and rehearsal | deepest |
| Python requirements | 1 rule | rules |
| Dockerfile | 1 rule | rules |
| Go, PHP | Inventory with counts | inventory |
| Java, pyproject, .tool-versions | Detected only | presence |
| .NET, Rust, Kubernetes, OpenTofu | Not read yet | roadmap |
Step 2: Check SQL#
Comments and quoted strings are blanked first, so a DROP TABLE inside a comment is not reported.
Step 3: Plan one change#
You name the target, such as npm:express@5.0.0 or node:22. The plan records the old value, the new value and the hash of the file it was based on.
Step 4: Rehearse safely#
Step 5: Gate#
Reading a report#
Findings are sorted from high to low. The chart below comes from the bundled risky sample.
Open the risky sample report to see the full layout.
Safe schema changes#
- 1. ExpandAdd the new column as nullable. Old code keeps working.
- 2. Dual writeThe application writes both old and new columns.
- 3. BackfillCopy history in small batches. Check the counts.
- 4. Switch readsRead the new column. Keep the old one for rollback.
- 5. ContractAfter a safe window and a tested restore, drop the old column.
With an AI coding assistant#
The 20 skills tell an assistant how to run the CLI and how to treat evidence. They do not replace the CLI output.
What never happens#
The tool does
- Read allow-listed filesmanifests, Dockerfile, SQL migrations
- Hash and matchdeterministic rules, stable evidence IDs
- Write reportsonly where you point --out
- Rehearse in a temp folderdeleted afterwards
The tool never
- Runs your codeno installs, scripts, tests or migrations
- Calls the internetno cloud, no telemetry, no keys
- Edits your sourcetests compare bytes before and after
- Reads .env filesunlisted files are ignored