StarForge persists a version field in ~/.starforge/config.toml. The value
is a schema version, not the CLI version. Every incompatible storage change
must add one migration step from the immediately preceding version.
- Increment
CURRENT_CONFIG_VERSIONinsrc/utils/config.rs. - Add
migrate_vN_to_vN+1beside the existing migration helpers. - Register the step in
MIGRATION_STEPSin ascending order. - Preserve secrets and unknown optional fields unless the migration explicitly owns them.
- Add a fixture covering the old shape and tests for both the migrated values and the resulting version.
Migrations run in order, so a configuration at version N can safely move
through each supported N → N+1 step. Before writing, StarForge creates a
versioned backup such as config.backup.vN.<timestamp>.toml.
If a config declares a version newer than the binary supports, loading fails with an upgrade instruction. StarForge must never reinterpret a future schema as the current one: doing so could silently change wallet, network, or plugin trust settings.
Plugin authors should keep plugin configuration migrations independent from the core config migration and include a schema version in each plugin's persisted document. A plugin should reject unknown future versions with the same clear upgrade guidance rather than dropping fields.
- The migration is deterministic and idempotent after its version is applied.
- Existing wallet/key material is not logged or rewritten unnecessarily.
- A backup and rollback path remain available.
- Current, old, malformed, and future-version fixtures are tested.
README.mdand release notes describe user-visible migration behavior.