agent: lumotia — Phase A.6 dogfood drill for rebrand migration on real OS paths

scripts/dogfood-rebrand-drill.sh — end-to-end probe that launches the real
lumotia binary against synthetic legacy magnotia state on disk, then
verifies both migration paths produced the expected outcome:

  1. paths.rs: ~/.local/share/magnotia/ -> ~/.local/share/lumotia/, including
     magnotia.db -> lumotia.db rename + non-DB companion files carried along
     by the directory rename.
  2. tauri_app_data_migration.rs: ~/.local/share/uk.co.corbel.magnotia/
     copied via atomic staging to ~/.local/share/consulting.corbel.lumotia/,
     with legacy preserved as a backup and staging dir cleaned up.

Closes the last gap in Phase A: every other test (paths::tests + storage
integration test + localStorageMigration.test.ts) uses synthetic in-process
state. The drill is the only verification that the real binary's startup
hook calls migrate_legacy_data_dir + migrate_tauri_app_data_dir_with_paths
against real OS path resolution.

Two modes:
  (default)            Sandbox: HOME=<tempdir>, faithful on Linux. NOT
                       faithful on macOS — Tauri 2 uses
                       NSSearchPathForDirectoriesInDomains which ignores
                       HOME overrides. Drill refuses to start in sandbox
                       mode on macOS rather than silently writing to the
                       user's real Application Support tree.
  --against-real-home  Real $HOME. Refuses to start if any lumotia data
                       already exists at the real paths (no clobbering
                       real user data). Cleans up planted state on exit
                       unless --keep is passed.

Eight probes covering: data-dir rename outcome, db file rename, legacy
removal, companion file survival, Tauri app_data_dir copy, legacy-backup
preservation, staging-dir cleanup, and lumotia_startup log line presence.

README: documents the drill alongside cargo test + npm test in the
Testing section, with the macOS caveat clearly flagged.

Not run as part of this commit — the drill launches a Tauri WebView
window for a few seconds. Jake to invoke when ready to dogfood.
This commit is contained in:
2026-05-14 07:40:33 +01:00
parent 206ac6219d
commit 2aac366f32
2 changed files with 291 additions and 0 deletions

View File

@@ -321,6 +321,25 @@ Frontend test files live alongside source (`src/**/*.test.ts`) and run in
jsdom by default. See [vite.config.js](vite.config.js) for the vitest
configuration.
#### Rebrand-migration dogfood drill
End-to-end probe that launches the real `target/debug/lumotia` binary
against synthetic legacy magnotia state planted on disk, then verifies
both migration paths produced the expected on-disk outcome.
```bash
cargo build -p lumotia # need the binary first
scripts/dogfood-rebrand-drill.sh # sandbox mode (Linux only)
scripts/dogfood-rebrand-drill.sh --keep # leave sandbox dir for inspection
scripts/dogfood-rebrand-drill.sh --against-real-home # run against real $HOME
```
Sandbox mode is faithful only on Linux — Tauri 2 on macOS uses
`NSSearchPathForDirectoriesInDomains` which ignores `HOME` overrides. The
drill refuses to start in sandbox mode on macOS. Real-home mode refuses
to start if any lumotia data already exists at your real paths, so it
can roll back cleanly on exit.
---
## Project documentation