agent: remove legacy string storage error variant

Commit 52565ea migrated storage to magnotia_storage::Error and flattened
typed storage failures into MagnotiaError::Storage { kind, operation,
detail }. No production code constructs the old
MagnotiaError::StorageError String variant anymore.

Remove the legacy variant so new storage failures cannot regress back to
stringly-typed errors.

Also updates living architecture-map docs that referenced the old
variant (core-error.md variant table, storage-overview.md
SQLITE_BUSY note, storage-crud-profiles.md duplicate-name + default-
profile-rename notes, storage-crud-transcripts.md pre-flight FK check
note) and one stale code comment in crates/storage/src/database.rs's
duplicate-name test. Survey doc + old residuals plan + phase8 historical
plan deliberately left alone — they're audit trail of how the migration
was decided, not living docs.

Pre-existing doc rot flagged but not fixed (Other(String) and
Io(std::io::Error) rows in core-error.md are about variants that
already don't match the actual enum shape — separate doc cleanup pass).

Verification:
- cargo fmt --all -- --check
- cargo check -p magnotia-core
- cargo check -p magnotia-storage
- cargo check --workspace --all-targets
- cargo test -p magnotia-storage — 60 passed, 0 failed
- cargo test --workspace --lib — all green
- rg 'StorageError\(' crates/ src-tauri/src/ — zero hits
- rg 'StorageError' crates/ src-tauri/src/ docs/architecture-map/ — zero
- rg 'Other\(String\)' crates/ src-tauri/src/ — zero

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-05-12 23:08:56 +01:00
parent 52565ea8b8
commit a36ae7e068
6 changed files with 8 additions and 11 deletions

View File

@@ -34,9 +34,6 @@ pub enum MagnotiaError {
#[error("file not found: '{}'", .0.display())]
FileNotFound(PathBuf),
#[error("storage error: {0}")]
StorageError(String),
/// Structured storage failure flowed up from `magnotia_storage::Error` via
/// its `From` impl. Display reads through to `detail` so the operation +
/// source context produced by the storage crate isn't double-prefixed.

View File

@@ -2129,7 +2129,7 @@ mod tests {
#[tokio::test]
async fn create_profile_rejects_duplicate_name() {
// Guardrail: UNIQUE(name) collision surfaces as StorageError.
// Guardrail: UNIQUE(name) collision surfaces as Error::Query.
let pool = test_pool().await;
create_profile(&pool, "Personal", "").await.unwrap();
let res = create_profile(&pool, "Personal", "").await;