commit 727f97fbe7bcdd12e7854b4c31bd8a577cd06c00
parent 00cf3888b08e490730dc189cd124cc89a39a21f0
Author: triesap <tyson@radroots.org>
Date: Thu, 30 Jul 2026 14:54:51 +0000
transport: align package manifest and module root
- add the exact required event identity and protocol dependency set
- expose only the approved eight-module transport skeleton
- establish additive std and serde feature propagation for no-std use
- enforce package identity dependency and module boundaries with tests
Diffstat:
10 files changed, 124 insertions(+), 6 deletions(-)
diff --git a/Cargo.lock b/Cargo.lock
@@ -5164,6 +5164,9 @@ name = "radroots_transport"
version = "0.1.0-alpha"
dependencies = [
"futures",
+ "radroots_event",
+ "radroots_identity",
+ "radroots_protocol",
"serde",
"serde_json",
"sha2",
diff --git a/crates/transport/Cargo.toml b/crates/transport/Cargo.toml
@@ -15,11 +15,27 @@ readme = "README.md"
name = "radroots_transport"
[features]
-default = ["serde"]
-serde = ["dep:serde"]
+default = ["std", "serde"]
+std = [
+ "radroots_event/std",
+ "radroots_identity/std",
+ "radroots_protocol/std",
+]
+serde = [
+ "dep:serde",
+ "radroots_event/serde",
+ "radroots_identity/serde",
+ "radroots_protocol/serde",
+]
[dependencies]
-serde = { workspace = true, optional = true }
+radroots_event = { workspace = true, default-features = false }
+radroots_identity = { workspace = true, default-features = false }
+radroots_protocol = { workspace = true, default-features = false }
+serde = { workspace = true, default-features = false, features = [
+ "alloc",
+ "derive",
+], optional = true }
sha2 = { workspace = true, default-features = false }
[dev-dependencies]
diff --git a/crates/transport/src/capability.rs b/crates/transport/src/capability.rs
@@ -0,0 +1 @@
+//! Transport-neutral capability vocabulary.
diff --git a/crates/transport/src/endpoint.rs b/crates/transport/src/endpoint.rs
@@ -0,0 +1 @@
+//! Transport endpoint identity and validation.
diff --git a/crates/transport/src/lib.rs b/crates/transport/src/lib.rs
@@ -1,17 +1,23 @@
-#![no_std]
+#![cfg_attr(not(feature = "std"), no_std)]
#![forbid(unsafe_code)]
#![cfg_attr(coverage_nightly, feature(coverage_attribute))]
extern crate alloc;
+pub mod capability;
mod delivery;
-mod error;
+pub mod endpoint;
+pub mod error;
mod kind;
mod message;
+pub mod outcome;
mod payload;
+pub mod policy;
mod reticulum;
+pub mod sink;
+pub mod source;
mod status;
-mod target;
+pub mod target;
mod transport;
pub use delivery::{
diff --git a/crates/transport/src/outcome.rs b/crates/transport/src/outcome.rs
@@ -0,0 +1 @@
+//! Normalized transport operation outcomes.
diff --git a/crates/transport/src/policy.rs b/crates/transport/src/policy.rs
@@ -0,0 +1 @@
+//! Transport-neutral delivery and fetch policy.
diff --git a/crates/transport/src/sink.rs b/crates/transport/src/sink.rs
@@ -0,0 +1 @@
+//! Outbound event delivery SPI and request models.
diff --git a/crates/transport/src/source.rs b/crates/transport/src/source.rs
@@ -0,0 +1 @@
+//! Inbound event source SPI and page models.
diff --git a/crates/transport/tests/package_boundary.rs b/crates/transport/tests/package_boundary.rs
@@ -0,0 +1,87 @@
+use std::collections::BTreeSet;
+
+#[allow(unused_imports)]
+use radroots_transport::{
+ capability as _, endpoint as _, error as _, outcome as _, policy as _, sink as _, source as _,
+ target as _,
+};
+
+const MANIFEST: &str = include_str!("../Cargo.toml");
+const ROOT: &str = include_str!("../src/lib.rs");
+
+#[test]
+fn manifest_has_final_identity_features_and_required_radroots_dependencies() {
+ for required in [
+ "name = \"radroots_transport\"",
+ "version = \"0.1.0-alpha\"",
+ "publish = false",
+ "[lib]\nname = \"radroots_transport\"",
+ "default = [\"std\", \"serde\"]",
+ "radroots_event = { workspace = true, default-features = false }",
+ "radroots_identity = { workspace = true, default-features = false }",
+ "radroots_protocol = { workspace = true, default-features = false }",
+ ] {
+ assert!(
+ MANIFEST.contains(required),
+ "manifest is missing {required}"
+ );
+ }
+
+ assert_eq!(
+ table_keys(MANIFEST, "[features]"),
+ BTreeSet::from(["default", "serde", "std"])
+ );
+ assert_eq!(
+ table_keys(MANIFEST, "[dependencies]")
+ .into_iter()
+ .filter(|dependency| dependency.starts_with("radroots_"))
+ .collect::<BTreeSet<_>>(),
+ BTreeSet::from(["radroots_event", "radroots_identity", "radroots_protocol"])
+ );
+}
+
+#[test]
+fn crate_root_declares_the_approved_public_module_skeleton() {
+ assert!(ROOT.contains("#![cfg_attr(not(feature = \"std\"), no_std)]"));
+ assert_eq!(
+ root_declarations("pub mod "),
+ BTreeSet::from([
+ "capability",
+ "endpoint",
+ "error",
+ "outcome",
+ "policy",
+ "sink",
+ "source",
+ "target",
+ ])
+ );
+}
+
+fn table_keys<'a>(source: &'a str, heading: &str) -> BTreeSet<&'a str> {
+ let mut in_table = false;
+ source
+ .lines()
+ .filter_map(|line| {
+ let line = line.trim();
+ if line == heading {
+ in_table = true;
+ return None;
+ }
+ if in_table && line.starts_with('[') {
+ in_table = false;
+ }
+ in_table
+ .then(|| line.split_once('=').map(|(key, _)| key.trim()))
+ .flatten()
+ })
+ .collect()
+}
+
+fn root_declarations(prefix: &str) -> BTreeSet<&str> {
+ ROOT.lines()
+ .map(str::trim)
+ .filter_map(|line| line.strip_prefix(prefix))
+ .filter_map(|line| line.strip_suffix(';'))
+ .collect()
+}