Iteration 6: --resume + persistent input history + migration scaffold
Closes out track 2's ADR-0015 backlog. * `--resume` CLI flag (L1a, ADR-0015 §7) opens the most- recently-used project, tracked in <data-root>/last_project. Mutually exclusive with a positional <project-path>; errors cleanly to stderr (above the shell prompt) on missing file or stale recorded path. last_project is rewritten on every successful project open (startup, load, new, save as, import). * Persistent input history (I2-persist, ADR-0015 §12). On project open, the in-memory navigable history is hydrated from the tail of history.log (capped at the in-memory cap). ProjectSwitched gains a `history_entries` payload field; App::seed_history is the entry point. Pipes inside source text round-trip via splitn(3); unknown escape sequences are passed through literally. * Migration framework scaffold (F3, ADR-0015 §9). New persistence::migrations module with MigratorRegistry + migrate_to_latest + ensure_project_yaml_migrated. Empty in v1 (production registry has no migrators); the loader runs through it on every project open and is exercised by tests with a fake v1→v2 migrator. Writes project.yaml.v<N>.bak before any migrator runs; verifies each step bumps the version field. Refreshes docs/requirements.md (A1 / I2 / F3 / E1 / L1a / test baseline) and adds docs/handoff/20260508-handoff-3.md covering both Iter 5 and Iter 6. Total tests: 408 passing, 0 failing, 0 skipped (up from 345 at handoff-2). Clippy clean.
This commit is contained in:
+5
-2
@@ -78,11 +78,14 @@ pub enum AppEvent {
|
||||
entries: Vec<crate::app::LoadPickerEntry>,
|
||||
},
|
||||
/// A project switch (load / new / save-as / import)
|
||||
/// succeeded. Carries the new display name + temp flag
|
||||
/// so App can update the status bar.
|
||||
/// succeeded. Carries the new display name, the temp
|
||||
/// flag (drives the `[TEMP]` status-bar prefix), and the
|
||||
/// seed entries for input-history hydration off the new
|
||||
/// project's `history.log` (I2-persist, ADR-0015 §12).
|
||||
ProjectSwitched {
|
||||
display_name: String,
|
||||
is_temp: bool,
|
||||
history_entries: Vec<String>,
|
||||
},
|
||||
/// A project switch failed in a non-fatal way (target
|
||||
/// already exists, path unreadable, …). Surfaced as an
|
||||
|
||||
Reference in New Issue
Block a user