Skip to content

feat(wizard): schema drift auto-migration prompt (#25) - #251

Merged
Destynova2 merged 1 commit into
mainfrom
feat/wizard-schema-migrate
Apr 21, 2026
Merged

feat(wizard): schema drift auto-migration prompt (#25)#251
Destynova2 merged 1 commit into
mainfrom
feat/wizard-schema-migrate

Conversation

@Destynova2

Copy link
Copy Markdown
Contributor

Summary

  • Replaces the warning-only schema-drift detector with an interactive auto-migration flow: drift is listed, the user is prompted `Migrate now? [Y/n]`, and on confirmation the config is rewritten atomically with a `.toml.backup` safety copy.
  • New `setup::migrate` module handles the supported transforms: `[openai_compat]` → `[server.openai_compat]`, `[rate_limit]` → `[security].rate_limit_{rps,burst}`, and prunes unknown top-level keys.
  • `--yes` and `--dry-run` stay non-interactive.

Test plan

  • Five unit tests in `setup::migrate` (openai_compat move, rate_limit split, unknown prune, no-op, preserved sections)
  • `cargo clippy --lib --all-features -- -D warnings` clean
  • Manual: wizard run on legacy config with deprecated keys

Audit item #25 (sensitive, N=5).

🤖 Generated with Claude Code

Replaces the warning-only drift detector with an interactive
auto-migration path.

* `detect::detect_schema_drift` now returns a structured `DriftReport`
  instead of printing. The existing `check_schema_drift` stdout path
  is gone; `mod.rs` owns the UX.
* New `setup::migrate` module handles the supported transformations:
  `[openai_compat]` → `[server.openai_compat]`, `[rate_limit]` →
  `[security].rate_limit_{rps,burst}`, and unknown top-level keys are
  pruned.
* On wizard start with an existing config, drift is listed and the
  user is prompted `Migrate now? [Y/n]`. On confirmation the config
  is backed up (`toml.backup`) and rewritten atomically. `--yes` and
  `--dry-run` stay non-interactive by design.
* Five unit tests cover each transformation + no-op + preserved-sections.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@Destynova2
Destynova2 enabled auto-merge (squash) April 21, 2026 21:19
@Destynova2
Destynova2 merged commit 1105f36 into main Apr 21, 2026
42 checks passed
@Destynova2
Destynova2 deleted the feat/wizard-schema-migrate branch April 21, 2026 21:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant