Expose typed Prepared Lower failures

This commit is contained in:
ms2k 2026-07-19 03:18:50 +09:00
commit 30cd36dcdd

View file

@ -279,7 +279,10 @@ fn recovery_deletes_only_exact_owned_stage_and_preserves_foreign_stage() {
fixture.catalog.record_prepare(&intent).unwrap();
std::fs::create_dir(fixture.root.join(&stage)).unwrap();
std::fs::write(fixture.root.join(&stage).join("foreign"), b"keep").unwrap();
assert!(fixture.store.recover_prepare(&intent).is_err());
assert!(matches!(
fixture.store.recover_prepare(&intent),
Err(PreparedLowerError::Recovery { .. })
));
assert!(fixture.root.join(&stage).join("foreign").exists());
std::fs::remove_dir_all(fixture.root.join(&stage)).unwrap();
assert_eq!(
@ -337,7 +340,7 @@ fn reclaim_refuses_forged_identity_and_leases() {
fixture.catalog.acquire_lease(&lease).unwrap();
assert!(matches!(
fixture.store.reclaim(&artifact),
Err(error)
Err(error @ PreparedLowerError::Catalog { .. })
if matches!(error.downcast_ref::<CatalogError>(), Some(CatalogError::LeasesPresent))
));
fixture.catalog.release_lease(&lease).unwrap();
@ -367,7 +370,10 @@ fn selected_gc_is_idempotent_only_at_the_durable_reclaim_boundary() {
))
.unwrap();
let id = artifact.prepared_artifact_id;
assert!(fixture.store.gc_artifacts(&[id, id]).is_err());
assert!(matches!(
fixture.store.gc_artifacts(&[id, id]),
Err(PreparedLowerError::Reclaim { .. })
));
let lease = lazaret_core::records::ArtifactLease {
prepared_artifact_id: id,