Expand description
smix-migrate — static maestro→smix YAML codemod.
§Why this crate exists
smix run already accepts maestro-flavored yaml directly (smix is a
superset of maestro). Migration is not required for correctness. But
when a consumer commits their yaml flows for long-term maintenance,
they want:
- Canonical verb names — grep for
- tap:finds every tap, not a mix of- tapOn:(maestro) /- tap:(smix). Better code review, better tooling. - smix-native argument shapes — e.g.
extendedWaitUntil.timeoutbecomesexpect.timeoutMs, aligning with smix’sexpectverb family. - Deprecated-verb removal — maestro-only forms flagged
(
WARN:to stderr) so consumers can decide whether to hand-edit.
§Scope
- Top-20 verb transforms (list below in
Migrator::default) - Comment preservation — line-based rewriter keeps copyright headers, audit-trail comments, and blank lines byte-identical.
- Unrecognized verbs preserved verbatim — e.g.
runScript,evalScript— aWARN:per unknown verb, one line to stderr. - Library + CLI — this crate exposes
Migrator+MigrateReport;smix migratein the CLI is a thin wrapper.
§Design decisions
The codemod operates on serde_norway::Value (loose YAML AST) for a
syntactic sanity check, then applies changes with a line-based
rewriter to preserve comments. We do NOT deserialize into a
strongly-typed maestro schema because:
- Preserving unknown / smix-native verbs verbatim is required
- We only touch the specific keys we care about (whitelist approach)
- Round-tripping through a typed schema would drop any field we don’t know about, breaking already-smix-native yamls
§Anti-goals
- Not a linter (no correctness checks; malformed yaml surfaces as a parse error)
- Not a formatter (indentation / trailing spaces preserved verbatim)
Structs§
- Migrate
Report - Result of migrating one flow file.
- Migrator
- The migrator. Stateless by design —
runis a pure fn of input. - Rename
- One verb rename recorded during a migration pass.