{"record":{"id":"53d34e494ff587ad","repo":"astrid-runtime/astrid","slug":"durable-capsule-id-failed-authoritative-verifica","errorCode":null,"errorMessage":"durable capsule {id} failed authoritative verification","messagePattern":"durable capsule (.+?) failed authoritative verification","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/astrid-capsule-install/src/storage/migration.rs","lineNumber":188,"sourceCode":"        let durable_authority_bytes = serde_json::to_vec_pretty(&durable_authority)\n            .with_context(|| format!(\"serialize durable legacy capsule authority {id}\"))?;\n        let package = CapsulePackage::new(archive, meta_bytes, durable_authority_bytes);\n        let expectation = match registry.get_snapshot(&owner, id)? {\n            None => CapsuleInstallExpectation::Absent,\n            Some(snapshot) if snapshot.package() == &package => {\n                CapsuleInstallExpectation::Generation(snapshot.generation())\n            },\n            Some(_) => bail!(\"durable capsule {id} conflicts with legacy native content\"),\n        };\n        registry.install(&owner, id, &package, expectation)?;\n        let readback = registry\n            .get_snapshot(&owner, id)?\n            .ok_or_else(|| anyhow::anyhow!(\"durable capsule {id} disappeared after publish\"))?;\n        if readback.package() != &package {\n            bail!(\"durable capsule {id} failed byte-for-byte readback\");\n        }\n        read_verified_durable_package_for_owner(store, &owner, id)?.ok_or_else(|| {\n            anyhow::anyhow!(\"durable capsule {id} failed authoritative verification\")\n        })?;\n        astrid_core::platform_fs::verify_no_redirects(&target)\n            .with_context(|| format!(\"verify legacy capsule {id} before retirement\"))?;\n        let final_archive = canonical_legacy_archive(home, &target, &meta, &manifest)?;\n        if final_archive != package.archive {\n            bail!(\"legacy capsule {id} changed before retirement\");\n        }\n        if fs::read(target.join(\"meta.json\"))? != package.metadata {\n            bail!(\"legacy capsule {id} metadata changed before retirement\");\n        }\n        if read_installed_authority_bytes(home, &target)?.as_deref()\n            != Some(source_authority_bytes.as_slice())\n        {\n            bail!(\"legacy capsule {id} authority changed before retirement\");\n        }\n        astrid_core::platform_fs::verify_no_redirects(&target)\n            .with_context(|| format!(\"verify legacy capsule {id} retirement boundary\"))?;\n        astrid_core::dirs::retire_legacy_source_tree(&target)","sourceCodeStart":170,"sourceCodeEnd":206,"githubUrl":"https://github.com/astrid-runtime/astrid/blob/affd8760f44190dbdfbec23403f4c4b642c33112/crates/astrid-capsule-install/src/storage/migration.rs#L170-L206","documentation":"Thrown after a durable capsule passes snapshot readback: read_verified_durable_package_for_owner returned None, meaning no verified authoritative package could be read back from the durable store for this owner. The registry accepted the install but the authoritative verification layer cannot confirm the published bytes, so migration refuses to retire the legacy capsule.","triggerScenarios":"migrate_native_capsules_with_report runs; registry.install() and get_snapshot() succeed and bytes match, but read_verified_durable_package_for_owner(store, &owner, id) finds no verified durable package record — e.g. verification receipts were not written, were quarantined (see relocated_path_hashed_receipts_are_ingested_or_quarantined), or the durable record references a stale path/hash.","commonSituations":"Legacy capsules relocated on disk so path-hashed authority receipts no longer match; interrupted previous migration leaving installs without receipts; anti-virus or sync tools (Dropbox etc.) altering files after install; running migration as a different user so owner-scoped store paths differ.","solutions":["Re-run migration so receipts are re-ingested; relocated capsules are handled by the ingest-or-quarantine receipt path","Inspect the owner's durable store for missing/stale verification receipts and remove partial migration state before retrying","Confirm the capsule files were not modified between install and verification (antivirus, cloud sync, backup tools)","Check that migration runs under the same user/owner that owns the capsule store"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"// before migration, confirm authority receipts are valid\nmatch read_verified_durable_package_for_owner(store, &owner, &id) {\n    Some(pkg) => println!(\"verified: {}\", pkg.archive),\n    None => eprintln!(\"capsule {id} will fail verification — clean stale state first\"),\n}","typeGuard":null,"tryCatchPattern":"if let Err(e) = migrate_native_capsules(&home) {\n    if e.to_string().contains(\"failed authoritative verification\") {\n        // clear partial migration state and retry so receipts are re-ingested\n        purge_partial_migration_state(&home)?;\n        migrate_native_capsules(&home)?;\n    } else { return Err(e); }\n}","preventionTips":["Exclude capsule directories from antivirus and cloud-sync tools","Complete interrupted migrations fully; delete partial state before retrying","Keep capsules under their original paths so path-hashed receipts stay valid"],"tags":["rust","storage","migration","integrity","verification"],"backgroundTag":"checksum-mismatch","analyzedSha":"affd8760f44190dbdfbec23403f4c4b642c33112","analyzedAt":"2026-09-09T21:28:12.402Z","contentChangedAt":"2026-09-09T21:28:12.402Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}