Summary
Provide a smooth upgrade path for users with existing .dual.toml files. Detect the old format and either auto-migrate or guide the user.
Behavior
When load_hints() or dual init detects .dual.toml exists but .dual/settings.json doesn't:
- Log a warning: "Found .dual.toml (deprecated). Run
dual init to migrate to .dual/settings.json"
- Fallback: still load from
.dual.toml if .dual/settings.json is missing (graceful degradation)
dual init in a repo with .dual.toml:
- Read existing values (extra_commands, anonymous_volumes, shared)
- Pre-populate the init wizard with these values
- Write
.dual/settings.json
- Prompt: "Remove old .dual.toml? [Y/n]"
Implementation
load_hints() fallback — if .dual/settings.json missing but .dual.toml exists, load from TOML with deprecation warning
cmd_init() migration — detect .dual.toml, read its values, use as defaults for new config
- Keep TOML parsing temporarily —
toml crate stays as dependency until migration period ends
Tests
.dual.toml only → loads with warning
.dual/settings.json present → .dual.toml ignored
- Migration populates settings.json from .dual.toml values
Summary
Provide a smooth upgrade path for users with existing
.dual.tomlfiles. Detect the old format and either auto-migrate or guide the user.Behavior
When
load_hints()ordual initdetects.dual.tomlexists but.dual/settings.jsondoesn't:dual initto migrate to .dual/settings.json".dual.tomlif.dual/settings.jsonis missing (graceful degradation)dual initin a repo with.dual.toml:.dual/settings.jsonImplementation
load_hints()fallback — if.dual/settings.jsonmissing but.dual.tomlexists, load from TOML with deprecation warningcmd_init()migration — detect.dual.toml, read its values, use as defaults for new configtomlcrate stays as dependency until migration period endsTests
.dual.tomlonly → loads with warning.dual/settings.jsonpresent →.dual.tomlignored