commit 01b77455004e7a9003df8005ab966bc288a6d81c
parent 63c0baf12f49f3f298b17f3f87d425a204ca61ec
Author: triesap <tyson@radroots.org>
Date: Sat, 1 Aug 2026 18:46:05 +0000
storage: align package manifest and module root
- declare the exact Release V1 storage dependency boundary
- expose the approved storage SPI module skeleton
- configure the memory and serde feature vocabulary
- guard package identity and forbidden backend dependencies
Diffstat:
13 files changed, 92 insertions(+), 0 deletions(-)
diff --git a/Cargo.lock b/Cargo.lock
@@ -5122,6 +5122,13 @@ dependencies = [
[[package]]
name = "radroots_storage"
version = "0.1.0-alpha"
+dependencies = [
+ "radroots_event",
+ "radroots_protocol",
+ "radroots_trade",
+ "radroots_transport",
+ "serde",
+]
[[package]]
name = "radroots_storage_sqlite"
diff --git a/crates/storage/Cargo.toml b/crates/storage/Cargo.toml
@@ -14,5 +14,20 @@ publish = false
[lib]
name = "radroots_storage"
+[features]
+default = ["memory", "serde"]
+memory = []
+serde = ["dep:serde"]
+
+[dependencies]
+radroots_event = { workspace = true, default-features = false }
+radroots_protocol = { workspace = true, default-features = false }
+radroots_trade = { workspace = true, default-features = false }
+radroots_transport = { workspace = true, default-features = false }
+serde = { workspace = true, default-features = false, features = [
+ "alloc",
+ "derive",
+], optional = true }
+
[lints]
workspace = true
diff --git a/crates/storage/src/atomic.rs b/crates/storage/src/atomic.rs
@@ -0,0 +1 @@
+//! Atomic storage workflow contracts.
diff --git a/crates/storage/src/backup.rs b/crates/storage/src/backup.rs
@@ -0,0 +1 @@
+//! Backup, restore, and integrity contracts.
diff --git a/crates/storage/src/event.rs b/crates/storage/src/event.rs
@@ -0,0 +1 @@
+//! Canonical event persistence contracts.
diff --git a/crates/storage/src/journal.rs b/crates/storage/src/journal.rs
@@ -0,0 +1 @@
+//! Durable operation journal contracts.
diff --git a/crates/storage/src/lib.rs b/crates/storage/src/lib.rs
@@ -1 +1,14 @@
//! Backend-neutral persistence abstractions for Radroots.
+
+#![forbid(unsafe_code)]
+
+pub mod atomic;
+pub mod backup;
+pub mod event;
+pub mod journal;
+#[cfg(feature = "memory")]
+pub mod memory;
+pub mod outbox;
+pub mod private_artifact;
+pub mod projection;
+pub mod status;
diff --git a/crates/storage/src/memory.rs b/crates/storage/src/memory.rs
@@ -0,0 +1 @@
+//! In-memory reference storage backend.
diff --git a/crates/storage/src/outbox.rs b/crates/storage/src/outbox.rs
@@ -0,0 +1 @@
+//! Durable outbox and delivery-evidence contracts.
diff --git a/crates/storage/src/private_artifact.rs b/crates/storage/src/private_artifact.rs
@@ -0,0 +1 @@
+//! Private-artifact metadata contracts.
diff --git a/crates/storage/src/projection.rs b/crates/storage/src/projection.rs
@@ -0,0 +1 @@
+//! Projection checkpoint and invalidation contracts.
diff --git a/crates/storage/src/status.rs b/crates/storage/src/status.rs
@@ -0,0 +1 @@
+//! Storage capability, health, and integrity status contracts.
diff --git a/crates/storage/tests/package_boundary.rs b/crates/storage/tests/package_boundary.rs
@@ -0,0 +1,48 @@
+use std::fs;
+use std::path::PathBuf;
+
+#[test]
+fn manifest_matches_the_release_v1_package_boundary() {
+ let manifest = fs::read_to_string(PathBuf::from(env!("CARGO_MANIFEST_DIR")).join("Cargo.toml"))
+ .expect("storage package manifest must be readable");
+
+ for required in [
+ "radroots_event",
+ "radroots_protocol",
+ "radroots_trade",
+ "radroots_transport",
+ ] {
+ assert!(
+ manifest.contains(&format!("{required} = {{ workspace = true")),
+ "missing required Radroots dependency {required}"
+ );
+ }
+
+ for forbidden in ["sqlx", "rusqlite", "reqwest", "nostr-sdk"] {
+ assert!(
+ !manifest.contains(forbidden),
+ "storage SPI must not depend on {forbidden}"
+ );
+ }
+}
+
+#[test]
+fn release_v1_public_module_skeleton_is_declared() {
+ let root = include_str!("../src/lib.rs");
+ for module in [
+ "atomic",
+ "backup",
+ "event",
+ "journal",
+ "memory",
+ "outbox",
+ "private_artifact",
+ "projection",
+ "status",
+ ] {
+ assert!(
+ root.contains(&format!("pub mod {module};")),
+ "missing public module {module}"
+ );
+ }
+}