commit 1d7f34d6c7390592f9001fe843115536bf4da76e parent 52e2a15a90aa4f07f053930be4dda203a0f6631a Author: triesap <tyson@radroots.org> Date: Sat, 17 Oct 2026 15:58:41 +0000 sdk: Expose the public shared domain and execution boundaries - Promote approved native owners while preserving introduction provenance - Validate current public allocation across metadata and dependency policies - Expose exact domain values and operation identity through the facade - Qualify generated APIs, standalone archives and native portable behavior Diffstat:
38 files changed, 642 insertions(+), 119 deletions(-)
diff --git a/AGENTS.md b/AGENTS.md @@ -182,7 +182,8 @@ Before editing code: - `contracts/crates/catalog.v2.toml` is the package-catalog authority. Preserve imported packages as `provenance_kind = "imported"` with their immutable repository, revision, path, and tree digest. New repository-native packages - must be active, unpublished `provenance_kind = "native"` entries and must + begin as active private `provenance_kind = "native"` entries; public eligibility + requires the approved current release allocation. Native entries always store only `introduction_tree_sha256`; never embed a self-referential introducing commit OID. - Before validating a new native catalog entry, stage the complete package path @@ -209,10 +210,11 @@ Before editing code: - Preview, code-generation, fixture, binding-generator, coverage, xtask, and implementation-assembly packages remain private and absent from published feature closures. -- During the migration, every package remains non-publishable until its - package-realistic release gates pass and publication is explicitly - authorized. `contracts/releases/publish_policy.toml` is the machine - authority; validation metadata does not authorize upload. +- Current public eligibility is governed by the catalog and Release V2, + including exact `contracts/releases/publish_policy.toml` ownership. Package + upload still requires its release gates and explicit authorization; current + Release V2 keeps `publication_authorized = false`. Source publication and + validation metadata never authorize a package upload. ## 8. Service hardening boundaries diff --git a/AGENT_INSTRUCTIONS.md b/AGENT_INSTRUCTIONS.md @@ -171,7 +171,8 @@ The package authority is `contracts/crates/catalog.v2.toml`. Imported entries retain their exact immutable source repository, full revision, source path, and source-tree digest. A newly created repository-native package instead uses `provenance_kind = "native"` and records only its -`introduction_tree_sha256`; native entries are active and unpublished. Stage +`introduction_tree_sha256`. Native entries begin active and private; a later +approved public allocation preserves that immutable provenance. Stage the complete new package path before running `cargo xtask catalog check` or `cargo xtask catalog write`. Before the first commit, xtask verifies the digest against canonical stage-zero index tree records. After that commit, xtask diff --git a/Cargo.lock b/Cargo.lock @@ -3041,6 +3041,7 @@ name = "radroots" version = "0.1.0-alpha" dependencies = [ "radroots_core", + "radroots_domain", "radroots_event", "radroots_identity", "radroots_sdk", diff --git a/Cargo.toml b/Cargo.toml @@ -56,6 +56,8 @@ members = [ ] default-members = [ "crates/core", + "crates/domain", + "crates/execution", "crates/identity", "crates/blossom", "crates/protocol", diff --git a/contracts/api_baselines/radroots.txt b/contracts/api_baselines/radroots.txt @@ -2,6 +2,7 @@ pub mod radroots pub use radroots::Client pub use radroots::ClientBuilder pub use radroots::Error +pub use radroots::OperationId pub use radroots::Result pub mod radroots::client pub const fn radroots::client::geonames_enabled() -> bool @@ -11,6 +12,16 @@ pub fn radroots::client::memory() -> radroots_sdk::client::ClientBuilder pub async fn radroots::client::native(radroots_sdk::storage::SqliteOptions) -> radroots_sdk::error::Result<radroots_sdk::client::ClientBuilder> pub fn radroots::client::with_nip46_signer(radroots_sdk::client::ClientBuilder, radroots_sdk::signing::Provider) -> radroots_sdk::client::ClientBuilder pub fn radroots::client::with_transport(radroots_sdk::client::ClientBuilder, alloc::sync::Arc<dyn radroots_transport::source::EventSource>, alloc::sync::Arc<dyn radroots_transport::sink::EventSink>) -> radroots_sdk::client::ClientBuilder +pub mod radroots::domain +pub use radroots::domain::AmountError +pub use radroots::domain::Decimal +pub use radroots::domain::ExecutorId +pub use radroots::domain::IdentifierError +pub use radroots::domain::OperationId +pub use radroots::domain::OrderId +pub use radroots::domain::PositiveDecimal +pub use radroots::domain::ThreadId +pub use radroots::domain::WorkspaceId pub mod radroots::event pub use radroots::event::Error pub use radroots::event::Event diff --git a/contracts/api_baselines/radroots_domain.txt b/contracts/api_baselines/radroots_domain.txt @@ -0,0 +1,137 @@ +pub mod radroots_domain +#[non_exhaustive] pub enum radroots_domain::AmountError +pub radroots_domain::AmountError::CoefficientOutOfRange +pub radroots_domain::AmountError::InvalidFormat +pub radroots_domain::AmountError::MustBePositive +pub radroots_domain::AmountError::NegativeResult +pub radroots_domain::AmountError::NonCanonical +pub radroots_domain::AmountError::ScaleOutOfRange +impl core::error::Error for radroots_domain::AmountError +impl core::fmt::Display for radroots_domain::AmountError +pub fn radroots_domain::AmountError::fmt(&self, &mut core::fmt::Formatter<'_>) -> core::fmt::Result +#[non_exhaustive] pub enum radroots_domain::IdentifierError +pub radroots_domain::IdentifierError::InvalidEncoding +pub radroots_domain::IdentifierError::InvalidLength +impl core::error::Error for radroots_domain::IdentifierError +impl core::fmt::Display for radroots_domain::IdentifierError +pub fn radroots_domain::IdentifierError::fmt(&self, &mut core::fmt::Formatter<'_>) -> core::fmt::Result +pub struct radroots_domain::Decimal +impl radroots_domain::Decimal +pub const radroots_domain::Decimal::MAX: Self +pub const radroots_domain::Decimal::MAX_COEFFICIENT: u64 +pub const radroots_domain::Decimal::MAX_ENCODED_LEN: usize +pub const radroots_domain::Decimal::MAX_SCALE: u8 +pub const radroots_domain::Decimal::ONE: Self +pub const radroots_domain::Decimal::ZERO: Self +pub fn radroots_domain::Decimal::checked_add(self, Self) -> core::result::Result<Self, radroots_domain::AmountError> +pub fn radroots_domain::Decimal::checked_sub(self, Self) -> core::result::Result<Self, radroots_domain::AmountError> +pub const fn radroots_domain::Decimal::coefficient(self) -> u64 +pub const fn radroots_domain::Decimal::from_parts(u64, u8) -> core::result::Result<Self, radroots_domain::AmountError> +pub const fn radroots_domain::Decimal::is_zero(self) -> bool +pub const fn radroots_domain::Decimal::scale(self) -> u8 +impl core::cmp::Ord for radroots_domain::Decimal +pub fn radroots_domain::Decimal::cmp(&self, &Self) -> core::cmp::Ordering +impl core::cmp::PartialOrd for radroots_domain::Decimal +pub fn radroots_domain::Decimal::partial_cmp(&self, &Self) -> core::option::Option<core::cmp::Ordering> +impl core::convert::From<radroots_domain::PositiveDecimal> for radroots_domain::Decimal +pub fn radroots_domain::Decimal::from(radroots_domain::PositiveDecimal) -> Self +impl core::convert::TryFrom<radroots_domain::Decimal> for radroots_domain::PositiveDecimal +pub type radroots_domain::PositiveDecimal::Error = radroots_domain::AmountError +pub fn radroots_domain::PositiveDecimal::try_from(radroots_domain::Decimal) -> core::result::Result<Self, Self::Error> +impl core::fmt::Display for radroots_domain::Decimal +pub fn radroots_domain::Decimal::fmt(&self, &mut core::fmt::Formatter<'_>) -> core::fmt::Result +impl core::str::traits::FromStr for radroots_domain::Decimal +pub type radroots_domain::Decimal::Err = radroots_domain::AmountError +pub fn radroots_domain::Decimal::from_str(&str) -> core::result::Result<Self, Self::Err> +impl serde_core::ser::Serialize for radroots_domain::Decimal +pub fn radroots_domain::Decimal::serialize<S: serde_core::ser::Serializer>(&self, S) -> core::result::Result<<S as serde_core::ser::Serializer>::Ok, <S as serde_core::ser::Serializer>::Error> +impl<'de> serde_core::de::Deserialize<'de> for radroots_domain::Decimal +pub fn radroots_domain::Decimal::deserialize<D: serde_core::de::Deserializer<'de>>(D) -> core::result::Result<Self, <D as serde_core::de::Deserializer>::Error> +pub struct radroots_domain::ExecutorId(_) +impl radroots_domain::ExecutorId +pub const fn radroots_domain::ExecutorId::as_bytes(&self) -> &[u8; 32] +pub const fn radroots_domain::ExecutorId::from_bytes([u8; 32]) -> Self +pub const fn radroots_domain::ExecutorId::into_bytes(self) -> [u8; 32] +impl core::fmt::Display for radroots_domain::ExecutorId +pub fn radroots_domain::ExecutorId::fmt(&self, &mut core::fmt::Formatter<'_>) -> core::fmt::Result +impl core::str::traits::FromStr for radroots_domain::ExecutorId +pub type radroots_domain::ExecutorId::Err = radroots_domain::IdentifierError +pub fn radroots_domain::ExecutorId::from_str(&str) -> core::result::Result<Self, Self::Err> +impl serde_core::ser::Serialize for radroots_domain::ExecutorId +pub fn radroots_domain::ExecutorId::serialize<S: serde_core::ser::Serializer>(&self, S) -> core::result::Result<<S as serde_core::ser::Serializer>::Ok, <S as serde_core::ser::Serializer>::Error> +impl<'de> serde_core::de::Deserialize<'de> for radroots_domain::ExecutorId +pub fn radroots_domain::ExecutorId::deserialize<D: serde_core::de::Deserializer<'de>>(D) -> core::result::Result<Self, <D as serde_core::de::Deserializer>::Error> +pub struct radroots_domain::OperationId(_) +impl radroots_domain::OperationId +pub const fn radroots_domain::OperationId::as_bytes(&self) -> &[u8; 32] +pub const fn radroots_domain::OperationId::from_bytes([u8; 32]) -> Self +pub const fn radroots_domain::OperationId::into_bytes(self) -> [u8; 32] +impl core::fmt::Display for radroots_domain::OperationId +pub fn radroots_domain::OperationId::fmt(&self, &mut core::fmt::Formatter<'_>) -> core::fmt::Result +impl core::str::traits::FromStr for radroots_domain::OperationId +pub type radroots_domain::OperationId::Err = radroots_domain::IdentifierError +pub fn radroots_domain::OperationId::from_str(&str) -> core::result::Result<Self, Self::Err> +impl serde_core::ser::Serialize for radroots_domain::OperationId +pub fn radroots_domain::OperationId::serialize<S: serde_core::ser::Serializer>(&self, S) -> core::result::Result<<S as serde_core::ser::Serializer>::Ok, <S as serde_core::ser::Serializer>::Error> +impl<'de> serde_core::de::Deserialize<'de> for radroots_domain::OperationId +pub fn radroots_domain::OperationId::deserialize<D: serde_core::de::Deserializer<'de>>(D) -> core::result::Result<Self, <D as serde_core::de::Deserializer>::Error> +pub struct radroots_domain::OrderId(_) +impl radroots_domain::OrderId +pub const fn radroots_domain::OrderId::as_bytes(&self) -> &[u8; 32] +pub const fn radroots_domain::OrderId::from_bytes([u8; 32]) -> Self +pub const fn radroots_domain::OrderId::into_bytes(self) -> [u8; 32] +impl core::fmt::Display for radroots_domain::OrderId +pub fn radroots_domain::OrderId::fmt(&self, &mut core::fmt::Formatter<'_>) -> core::fmt::Result +impl core::str::traits::FromStr for radroots_domain::OrderId +pub type radroots_domain::OrderId::Err = radroots_domain::IdentifierError +pub fn radroots_domain::OrderId::from_str(&str) -> core::result::Result<Self, Self::Err> +impl serde_core::ser::Serialize for radroots_domain::OrderId +pub fn radroots_domain::OrderId::serialize<S: serde_core::ser::Serializer>(&self, S) -> core::result::Result<<S as serde_core::ser::Serializer>::Ok, <S as serde_core::ser::Serializer>::Error> +impl<'de> serde_core::de::Deserialize<'de> for radroots_domain::OrderId +pub fn radroots_domain::OrderId::deserialize<D: serde_core::de::Deserializer<'de>>(D) -> core::result::Result<Self, <D as serde_core::de::Deserializer>::Error> +pub struct radroots_domain::PositiveDecimal(_) +impl radroots_domain::PositiveDecimal +pub const fn radroots_domain::PositiveDecimal::amount(self) -> radroots_domain::Decimal +pub const fn radroots_domain::PositiveDecimal::new(radroots_domain::Decimal) -> core::result::Result<Self, radroots_domain::AmountError> +impl core::convert::From<radroots_domain::PositiveDecimal> for radroots_domain::Decimal +pub fn radroots_domain::Decimal::from(radroots_domain::PositiveDecimal) -> Self +impl core::convert::TryFrom<radroots_domain::Decimal> for radroots_domain::PositiveDecimal +pub type radroots_domain::PositiveDecimal::Error = radroots_domain::AmountError +pub fn radroots_domain::PositiveDecimal::try_from(radroots_domain::Decimal) -> core::result::Result<Self, Self::Error> +impl core::fmt::Display for radroots_domain::PositiveDecimal +pub fn radroots_domain::PositiveDecimal::fmt(&self, &mut core::fmt::Formatter<'_>) -> core::fmt::Result +impl core::str::traits::FromStr for radroots_domain::PositiveDecimal +pub type radroots_domain::PositiveDecimal::Err = radroots_domain::AmountError +pub fn radroots_domain::PositiveDecimal::from_str(&str) -> core::result::Result<Self, Self::Err> +impl serde_core::ser::Serialize for radroots_domain::PositiveDecimal +pub fn radroots_domain::PositiveDecimal::serialize<S: serde_core::ser::Serializer>(&self, S) -> core::result::Result<<S as serde_core::ser::Serializer>::Ok, <S as serde_core::ser::Serializer>::Error> +impl<'de> serde_core::de::Deserialize<'de> for radroots_domain::PositiveDecimal +pub fn radroots_domain::PositiveDecimal::deserialize<D: serde_core::de::Deserializer<'de>>(D) -> core::result::Result<Self, <D as serde_core::de::Deserializer>::Error> +pub struct radroots_domain::ThreadId(_) +impl radroots_domain::ThreadId +pub const fn radroots_domain::ThreadId::as_bytes(&self) -> &[u8; 32] +pub const fn radroots_domain::ThreadId::from_bytes([u8; 32]) -> Self +pub const fn radroots_domain::ThreadId::into_bytes(self) -> [u8; 32] +impl core::fmt::Display for radroots_domain::ThreadId +pub fn radroots_domain::ThreadId::fmt(&self, &mut core::fmt::Formatter<'_>) -> core::fmt::Result +impl core::str::traits::FromStr for radroots_domain::ThreadId +pub type radroots_domain::ThreadId::Err = radroots_domain::IdentifierError +pub fn radroots_domain::ThreadId::from_str(&str) -> core::result::Result<Self, Self::Err> +impl serde_core::ser::Serialize for radroots_domain::ThreadId +pub fn radroots_domain::ThreadId::serialize<S: serde_core::ser::Serializer>(&self, S) -> core::result::Result<<S as serde_core::ser::Serializer>::Ok, <S as serde_core::ser::Serializer>::Error> +impl<'de> serde_core::de::Deserialize<'de> for radroots_domain::ThreadId +pub fn radroots_domain::ThreadId::deserialize<D: serde_core::de::Deserializer<'de>>(D) -> core::result::Result<Self, <D as serde_core::de::Deserializer>::Error> +pub struct radroots_domain::WorkspaceId(_) +impl radroots_domain::WorkspaceId +pub const fn radroots_domain::WorkspaceId::as_bytes(&self) -> &[u8; 32] +pub const fn radroots_domain::WorkspaceId::from_bytes([u8; 32]) -> Self +pub const fn radroots_domain::WorkspaceId::into_bytes(self) -> [u8; 32] +impl core::fmt::Display for radroots_domain::WorkspaceId +pub fn radroots_domain::WorkspaceId::fmt(&self, &mut core::fmt::Formatter<'_>) -> core::fmt::Result +impl core::str::traits::FromStr for radroots_domain::WorkspaceId +pub type radroots_domain::WorkspaceId::Err = radroots_domain::IdentifierError +pub fn radroots_domain::WorkspaceId::from_str(&str) -> core::result::Result<Self, Self::Err> +impl serde_core::ser::Serialize for radroots_domain::WorkspaceId +pub fn radroots_domain::WorkspaceId::serialize<S: serde_core::ser::Serializer>(&self, S) -> core::result::Result<<S as serde_core::ser::Serializer>::Ok, <S as serde_core::ser::Serializer>::Error> +impl<'de> serde_core::de::Deserialize<'de> for radroots_domain::WorkspaceId +pub fn radroots_domain::WorkspaceId::deserialize<D: serde_core::de::Deserializer<'de>>(D) -> core::result::Result<Self, <D as serde_core::de::Deserializer>::Error> diff --git a/contracts/api_baselines/radroots_execution.txt b/contracts/api_baselines/radroots_execution.txt @@ -0,0 +1,136 @@ +pub mod radroots_execution +pub mod radroots_execution::session +pub enum radroots_execution::session::SessionState +pub radroots_execution::session::SessionState::Closed +pub radroots_execution::session::SessionState::Closing +pub radroots_execution::session::SessionState::Ready +pub radroots_execution::session::SessionState::Running +pub radroots_execution::session::SessionState::Starting +pub struct radroots_execution::session::Session<H: radroots_execution::session::SessionHost> +impl<H: radroots_execution::session::SessionHost> radroots_execution::session::Session<H> +pub fn radroots_execution::session::Session<H>::admit(&self) -> radroots_execution::Result<radroots_execution::session::WorkPermit<H>> +pub async fn radroots_execution::session::Session<H>::close(&self) -> radroots_execution::Result<()> +pub fn radroots_execution::session::Session<H>::new(H, core::num::nonzero::NonZeroU16) -> Self +pub async fn radroots_execution::session::Session<H>::start(&self) -> radroots_execution::Result<()> +pub fn radroots_execution::session::Session<H>::state(&self) -> radroots_execution::session::SessionState +impl<H: radroots_execution::session::SessionHost> core::clone::Clone for radroots_execution::session::Session<H> +pub fn radroots_execution::session::Session<H>::clone(&self) -> Self +pub struct radroots_execution::session::WorkPermit<H: radroots_execution::session::SessionHost> +impl<H: radroots_execution::session::SessionHost> core::ops::drop::Drop for radroots_execution::session::WorkPermit<H> +pub fn radroots_execution::session::WorkPermit<H>::drop(&mut self) +pub trait radroots_execution::session::HostBound: core::marker::Send + core::marker::Sync +impl<T: core::marker::Send + core::marker::Sync + ?core::marker::Sized> radroots_execution::session::HostBound for T +pub trait radroots_execution::session::SessionHost: radroots_execution::session::HostBound +pub fn radroots_execution::session::SessionHost::close_storage(&self) -> radroots_execution::session::HostFuture<'_, radroots_execution::Result<()>> +pub fn radroots_execution::session::SessionHost::disconnect(&self) -> radroots_execution::session::HostFuture<'_, radroots_execution::Result<()>> +pub fn radroots_execution::session::SessionHost::dispose_callbacks(&self) -> radroots_execution::session::HostFuture<'_, radroots_execution::Result<()>> +pub fn radroots_execution::session::SessionHost::quiesce(&self) -> radroots_execution::session::HostFuture<'_, radroots_execution::Result<()>> +pub fn radroots_execution::session::SessionHost::start(&self) -> radroots_execution::session::HostFuture<'_, radroots_execution::Result<()>> +pub type radroots_execution::session::HostFuture<'a, T> = core::pin::Pin<alloc::boxed::Box<(dyn core::future::future::Future<Output = T> + core::marker::Send + 'a)>> +#[non_exhaustive] pub enum radroots_execution::Admission +pub radroots_execution::Admission::Confirmed +pub radroots_execution::Admission::NotAdmitted +pub radroots_execution::Admission::Unknown +#[non_exhaustive] pub enum radroots_execution::Code +pub radroots_execution::Code::AuthorityConflict +pub radroots_execution::Code::CapabilityUnavailable +pub radroots_execution::Code::CommitUnknown +pub radroots_execution::Code::Deficit +pub radroots_execution::Code::DeliveryPending +pub radroots_execution::Code::GrantRevoked +pub radroots_execution::Code::IdempotencyConflict +pub radroots_execution::Code::IdentityChanged +pub radroots_execution::Code::InsufficientStock +pub radroots_execution::Code::InvalidInput +pub radroots_execution::Code::MissingAuthority +pub radroots_execution::Code::MissingHistory +pub radroots_execution::Code::MissingSource +pub radroots_execution::Code::RecordFork +pub radroots_execution::Code::RecoveryRequired +pub radroots_execution::Code::RetentionExhausted +pub radroots_execution::Code::SignerRefused +pub radroots_execution::Code::SignerTampering +pub radroots_execution::Code::SignerUnavailable +pub radroots_execution::Code::SigningPending +pub radroots_execution::Code::SigningUnknown +pub radroots_execution::Code::StaleState +pub radroots_execution::Code::StorageFailure +pub radroots_execution::Code::Unauthenticated +pub radroots_execution::Code::Unauthorized +pub radroots_execution::Code::UnsupportedProfile +pub radroots_execution::Code::UnsupportedVersion +impl radroots_execution::Code +pub const radroots_execution::Code::ALL: &'static [Self] +pub const fn radroots_execution::Code::as_str(self) -> &'static str +pub const fn radroots_execution::Code::message(self) -> &'static str +#[non_exhaustive] pub enum radroots_execution::Field +pub radroots_execution::Field::Approval +pub radroots_execution::Field::Authority +pub radroots_execution::Field::Currency +pub radroots_execution::Field::Delivery +pub radroots_execution::Field::History +pub radroots_execution::Field::Input +pub radroots_execution::Field::Operation +pub radroots_execution::Field::Retention +pub radroots_execution::Field::Signer +pub radroots_execution::Field::Source +pub radroots_execution::Field::Stock +pub radroots_execution::Field::Storage +pub radroots_execution::Field::Unit +impl radroots_execution::Field +pub const radroots_execution::Field::ALL: &'static [Self] +pub const fn radroots_execution::Field::as_str(self) -> &'static str +impl core::fmt::Display for radroots_execution::Field +pub fn radroots_execution::Field::fmt(&self, &mut core::fmt::Formatter<'_>) -> core::fmt::Result +#[non_exhaustive] pub enum radroots_execution::InvalidErrorContext +pub radroots_execution::InvalidErrorContext::ConfirmedAdmissionRequired +pub radroots_execution::InvalidErrorContext::ConflictingRetry +pub radroots_execution::InvalidErrorContext::OperationIdentityRequired +pub radroots_execution::InvalidErrorContext::ReconciliationRequired +pub radroots_execution::InvalidErrorContext::RetainedRetryRequired +impl core::error::Error for radroots_execution::InvalidErrorContext +impl core::fmt::Display for radroots_execution::InvalidErrorContext +pub fn radroots_execution::InvalidErrorContext::fmt(&self, &mut core::fmt::Formatter<'_>) -> core::fmt::Result +#[non_exhaustive] pub enum radroots_execution::Reason +pub radroots_execution::Reason::Conflict +pub radroots_execution::Reason::InvalidEncoding +pub radroots_execution::Reason::Missing +pub radroots_execution::Reason::OutOfRange +pub radroots_execution::Reason::Unavailable +pub radroots_execution::Reason::Unknown +pub radroots_execution::Reason::Unsupported +impl radroots_execution::Reason +pub const radroots_execution::Reason::ALL: &'static [Self] +pub const fn radroots_execution::Reason::as_str(self) -> &'static str +impl core::fmt::Display for radroots_execution::Reason +pub fn radroots_execution::Reason::fmt(&self, &mut core::fmt::Formatter<'_>) -> core::fmt::Result +#[non_exhaustive] pub enum radroots_execution::RetryClass +pub radroots_execution::RetryClass::AfterStateRefresh +pub radroots_execution::RetryClass::ManualReconciliation +pub radroots_execution::RetryClass::Never +pub radroots_execution::RetryClass::SafeSameOperation +impl radroots_execution::RetryClass +pub const fn radroots_execution::RetryClass::as_str(self) -> &'static str +pub struct radroots_execution::Detail +impl radroots_execution::Detail +pub const fn radroots_execution::Detail::field(self) -> radroots_execution::Field +pub const fn radroots_execution::Detail::new(radroots_execution::Field, radroots_execution::Reason) -> Self +pub const fn radroots_execution::Detail::reason(self) -> radroots_execution::Reason +pub struct radroots_execution::Error +impl radroots_execution::Error +pub const fn radroots_execution::Error::code(self) -> radroots_execution::Code +pub const fn radroots_execution::Error::context(self) -> radroots_execution::OperationContext +pub const fn radroots_execution::Error::detail(self) -> core::option::Option<radroots_execution::Detail> +pub const fn radroots_execution::Error::new(radroots_execution::Code, radroots_execution::OperationContext, radroots_execution::RetryClass, core::option::Option<radroots_execution::Detail>) -> core::result::Result<Self, radroots_execution::InvalidErrorContext> +pub const fn radroots_execution::Error::retry(self) -> radroots_execution::RetryClass +impl core::error::Error for radroots_execution::Error +impl core::fmt::Display for radroots_execution::Error +pub fn radroots_execution::Error::fmt(&self, &mut core::fmt::Formatter<'_>) -> core::fmt::Result +pub struct radroots_execution::OperationContext +impl radroots_execution::OperationContext +pub const fn radroots_execution::OperationContext::admission(self) -> radroots_execution::Admission +pub const fn radroots_execution::OperationContext::admission_unknown(radroots_domain::identifier::OperationId) -> Self +pub const fn radroots_execution::OperationContext::operation_id(self) -> core::option::Option<radroots_domain::identifier::OperationId> +pub const fn radroots_execution::OperationContext::proposed(core::option::Option<radroots_domain::identifier::OperationId>) -> Self +pub const fn radroots_execution::OperationContext::retained(radroots_domain::identifier::OperationId) -> Self +pub type radroots_execution::Result<T> = core::result::Result<T, radroots_execution::Error> diff --git a/contracts/architecture/deviations.toml b/contracts/architecture/deviations.toml @@ -2,6 +2,34 @@ schema_version = 1 architecture_id = "radroots.crates.release.v1" [[deviation]] +id = "RCRV1-DEV-049" +date = "2026-10-17" +status = "closed" +approval = "The user authorizes the complete approved shared SDK refactor, necessary breaking source changes, verified source publication and master integration; package uploads and releases remain unauthorized." +affected_steps = ["040", "050", "060", "130"] +spec_anchors = ["contracts/crates/release_v1/radroots_crates_release_v1.toml#release_policy", "contracts/crates/release_v1/radroots_crates_release_v1.toml#repository_policy"] +source_evidence = [ + "The approved shared_sdk_refactor.v1 decision assigns reusable domain and execution to the public Lib package graph and the ordinary radroots facade.", + "Both implemented native packages currently remain private/unpublished boundaries; catalog and Release V1-derived public dependency guards therefore prohibit the facade from consuming their qualified values, errors and session implementation.", +] +replacement_action = "Promote exactly radroots_domain and radroots_execution into the current public allocation, preserving immutable native introduction provenance and frozen Release V1 artifacts. Derive current public metadata and dependency/API policy from the validated current allocation instead of rewriting historical package inventories. Keep package publication unauthorized, generate current projections and API baselines, and expose exact domain/operation values through the ordinary facade." +verification = [ + "Validate this prospective deviation before implementation. Preserve all existing test purposes and add denial controls for unapproved native promotion, public-to-private dependencies and stale/malformed current allocation.", + "Run focused owning tooling/package checks and tests, strict lint, current generated projections/API freshness, portable source checks and standalone package inspection/qualification through the owning commands.", + "Review native introduction digests and all frozen Release V1 artifact bytes as unchanged. Source allocation does not qualify an ordinary command, a durable store, browser runtime, binding or release.", +] +unresolved_risk = "The actual owned ordinary Client, authenticated command attachment, full receipts, known-kind durable workflows, browser/bindings and supported source/artifact/consumer adoption remain required; public eligibility supplies no execution or package-upload authority." +normative_architecture_change = true +adr_required = true +closure_evidence = [ + "Exactly domain and execution enter the current public allocation. Both immutable native introduction-tree digests and every frozen Release V1 artifact remain unchanged; Release V2 publication authorization remains false.", + "Current public metadata, all-kind dependency/API boundaries, source-policy, feature/target/API qualification and publication ownership use the validated current allocation. Negative controls retain rejection of malformed allocation and unapproved native exports.", + "Owner-generated catalog projections and three public API baselines are fresh. Cargo builds both actual package archives and verifies execution against the packaged domain provider through its temporary registry. The only dependency graph delta is the facade's exact domain edge.", + "The source-bound native tooling, facade/domain/execution tests, doctests, strict lint and selected native/no_std/WASM compiler checks pass. The two original canonical generator tests remain ignored with unchanged separate generator obligations. Ordinary Client, authenticated attachment, durable commands, browser runtime, bindings, consumer adoption and final acceptance remain open.", +] + + +[[deviation]] id = "RCRV1-DEV-048" date = "2026-10-17" status = "closed" diff --git a/contracts/crates/catalog.v2.toml b/contracts/crates/catalog.v2.toml @@ -6,7 +6,7 @@ version = "0.1.0-alpha" rust_version = "1.99.0" edition = "2024" resolver = "3" -public_package_count = 19 +public_package_count = 21 package_count = 53 digest_algorithm = "sha256-raw-bytes-v1" source_tree_digest_algorithm = "sha256-git-ls-tree-r-v1" @@ -65,17 +65,17 @@ name = "radroots_domain" path = "crates/domain" state = "active" tier = "domain" -visibility = "private_boundary" -publish = false +visibility = "public_release" +publish = true version = "0.1.0-alpha" license = "MIT OR Apache-2.0" platforms = ["any"] -groups = ["coverage_required", "preview"] +groups = ["coverage_required", "portable", "public_native"] owners = ["domain"] permitted_dependency_tiers = ["foundation"] provenance_kind = "native" introduction_tree_sha256 = "30a184507a178e87c4077506757fd6fa314594e17baf40679805a859f45fae1f" -compatibility = ["package_private"] +compatibility = ["rust_api", "features", "package"] replaces = [] [[package]] @@ -83,17 +83,17 @@ name = "radroots_execution" path = "crates/execution" state = "active" tier = "orchestration" -visibility = "private_boundary" -publish = false +visibility = "public_release" +publish = true version = "0.1.0-alpha" license = "MIT OR Apache-2.0" platforms = ["any"] -groups = ["coverage_required", "preview"] +groups = ["coverage_required", "portable", "public_native"] owners = ["execution"] permitted_dependency_tiers = ["domain"] provenance_kind = "native" introduction_tree_sha256 = "c3513293d70957c4ee2c93a722549573a8dc1bc9e893873a4f3e2dfdaa2881da" -compatibility = ["package_private"] +compatibility = ["rust_api", "features", "package"] replaces = [] [[package]] diff --git a/contracts/crates/generated/package_groups.v1.toml b/contracts/crates/generated/package_groups.v1.toml @@ -1,5 +1,5 @@ schema = "radroots.workspace.package-groups.v1" -catalog_sha256 = "1e679431ad70a024affc52e6c71151459aca41707429dd8015d014d27e5f40b6" +catalog_sha256 = "9c347e831bada40bd91e691aad9df2ba2573dc0ed1c76083939f47863f286d2c" [[group]] id = "boundaries" @@ -15,20 +15,20 @@ reserved_packages = [] [[group]] id = "portable" -packages = ["radroots", "radroots_blossom", "radroots_core", "radroots_event", "radroots_event_codec", "radroots_geonames", "radroots_identity", "radroots_nostr", "radroots_nostr_connect", "radroots_protocol", "radroots_sdk", "radroots_secrets", "radroots_signing", "radroots_storage", "radroots_storage_sqlite", "radroots_sync", "radroots_trade", "radroots_transport", "radroots_transport_nostr"] -active_packages = ["radroots", "radroots_blossom", "radroots_core", "radroots_event", "radroots_event_codec", "radroots_geonames", "radroots_identity", "radroots_nostr", "radroots_nostr_connect", "radroots_protocol", "radroots_sdk", "radroots_secrets", "radroots_signing", "radroots_storage", "radroots_storage_sqlite", "radroots_sync", "radroots_trade", "radroots_transport", "radroots_transport_nostr"] +packages = ["radroots", "radroots_blossom", "radroots_core", "radroots_domain", "radroots_event", "radroots_event_codec", "radroots_execution", "radroots_geonames", "radroots_identity", "radroots_nostr", "radroots_nostr_connect", "radroots_protocol", "radroots_sdk", "radroots_secrets", "radroots_signing", "radroots_storage", "radroots_storage_sqlite", "radroots_sync", "radroots_trade", "radroots_transport", "radroots_transport_nostr"] +active_packages = ["radroots", "radroots_blossom", "radroots_core", "radroots_domain", "radroots_event", "radroots_event_codec", "radroots_execution", "radroots_geonames", "radroots_identity", "radroots_nostr", "radroots_nostr_connect", "radroots_protocol", "radroots_sdk", "radroots_secrets", "radroots_signing", "radroots_storage", "radroots_storage_sqlite", "radroots_sync", "radroots_trade", "radroots_transport", "radroots_transport_nostr"] reserved_packages = [] [[group]] id = "preview" -packages = ["radroots_domain", "radroots_execution", "radroots_mesh", "radroots_mesh_agent_client", "radroots_mesh_agent_proto", "radroots_nostrdb", "radroots_replica_schema", "radroots_replica_store", "radroots_replica_sync", "radroots_runtime_distribution", "radroots_runtime_manager", "radroots_runtime_paths", "radroots_service_host", "radroots_service_sqlite", "radroots_simplex_agent_proto", "radroots_simplex_app_store", "radroots_simplex_chat_proto", "radroots_simplex_smp_crypto", "radroots_simplex_smp_proto", "radroots_simplex_smp_transport", "radroots_sql_core", "radroots_test_fixtures", "radroots_transport_reticulum"] -active_packages = ["radroots_domain", "radroots_execution", "radroots_mesh", "radroots_mesh_agent_client", "radroots_mesh_agent_proto", "radroots_nostrdb", "radroots_replica_schema", "radroots_replica_store", "radroots_replica_sync", "radroots_runtime_distribution", "radroots_runtime_manager", "radroots_runtime_paths", "radroots_service_host", "radroots_service_sqlite", "radroots_simplex_agent_proto", "radroots_simplex_app_store", "radroots_simplex_chat_proto", "radroots_simplex_smp_crypto", "radroots_simplex_smp_proto", "radroots_simplex_smp_transport", "radroots_sql_core", "radroots_test_fixtures", "radroots_transport_reticulum"] +packages = ["radroots_mesh", "radroots_mesh_agent_client", "radroots_mesh_agent_proto", "radroots_nostrdb", "radroots_replica_schema", "radroots_replica_store", "radroots_replica_sync", "radroots_runtime_distribution", "radroots_runtime_manager", "radroots_runtime_paths", "radroots_service_host", "radroots_service_sqlite", "radroots_simplex_agent_proto", "radroots_simplex_app_store", "radroots_simplex_chat_proto", "radroots_simplex_smp_crypto", "radroots_simplex_smp_proto", "radroots_simplex_smp_transport", "radroots_sql_core", "radroots_test_fixtures", "radroots_transport_reticulum"] +active_packages = ["radroots_mesh", "radroots_mesh_agent_client", "radroots_mesh_agent_proto", "radroots_nostrdb", "radroots_replica_schema", "radroots_replica_store", "radroots_replica_sync", "radroots_runtime_distribution", "radroots_runtime_manager", "radroots_runtime_paths", "radroots_service_host", "radroots_service_sqlite", "radroots_simplex_agent_proto", "radroots_simplex_app_store", "radroots_simplex_chat_proto", "radroots_simplex_smp_crypto", "radroots_simplex_smp_proto", "radroots_simplex_smp_transport", "radroots_sql_core", "radroots_test_fixtures", "radroots_transport_reticulum"] reserved_packages = [] [[group]] id = "public_native" -packages = ["radroots", "radroots_blossom", "radroots_core", "radroots_event", "radroots_event_codec", "radroots_geonames", "radroots_identity", "radroots_nostr", "radroots_nostr_connect", "radroots_protocol", "radroots_sdk", "radroots_secrets", "radroots_signing", "radroots_storage", "radroots_storage_sqlite", "radroots_sync", "radroots_trade", "radroots_transport", "radroots_transport_nostr"] -active_packages = ["radroots", "radroots_blossom", "radroots_core", "radroots_event", "radroots_event_codec", "radroots_geonames", "radroots_identity", "radroots_nostr", "radroots_nostr_connect", "radroots_protocol", "radroots_sdk", "radroots_secrets", "radroots_signing", "radroots_storage", "radroots_storage_sqlite", "radroots_sync", "radroots_trade", "radroots_transport", "radroots_transport_nostr"] +packages = ["radroots", "radroots_blossom", "radroots_core", "radroots_domain", "radroots_event", "radroots_event_codec", "radroots_execution", "radroots_geonames", "radroots_identity", "radroots_nostr", "radroots_nostr_connect", "radroots_protocol", "radroots_sdk", "radroots_secrets", "radroots_signing", "radroots_storage", "radroots_storage_sqlite", "radroots_sync", "radroots_trade", "radroots_transport", "radroots_transport_nostr"] +active_packages = ["radroots", "radroots_blossom", "radroots_core", "radroots_domain", "radroots_event", "radroots_event_codec", "radroots_execution", "radroots_geonames", "radroots_identity", "radroots_nostr", "radroots_nostr_connect", "radroots_protocol", "radroots_sdk", "radroots_secrets", "radroots_signing", "radroots_storage", "radroots_storage_sqlite", "radroots_sync", "radroots_trade", "radroots_transport", "radroots_transport_nostr"] reserved_packages = [] [[group]] diff --git a/contracts/crates/generated/platform_inventory.v1.toml b/contracts/crates/generated/platform_inventory.v1.toml @@ -1,5 +1,5 @@ schema = "radroots.workspace.platform-inventory.v1" -catalog_sha256 = "1e679431ad70a024affc52e6c71151459aca41707429dd8015d014d27e5f40b6" +catalog_sha256 = "9c347e831bada40bd91e691aad9df2ba2573dc0ed1c76083939f47863f286d2c" [[platform]] id = "any" diff --git a/contracts/crates/generated/release_inventory.v2.toml b/contracts/crates/generated/release_inventory.v2.toml @@ -1,7 +1,7 @@ schema = "radroots.workspace.release-inventory.v2" -catalog_sha256 = "1e679431ad70a024affc52e6c71151459aca41707429dd8015d014d27e5f40b6" +catalog_sha256 = "9c347e831bada40bd91e691aad9df2ba2573dc0ed1c76083939f47863f286d2c" architecture = "radroots.crates.release.v2" version = "0.1.0-alpha" -public_packages = ["radroots", "radroots_blossom", "radroots_core", "radroots_event", "radroots_event_codec", "radroots_geonames", "radroots_identity", "radroots_nostr", "radroots_nostr_connect", "radroots_protocol", "radroots_sdk", "radroots_secrets", "radroots_signing", "radroots_storage", "radroots_storage_sqlite", "radroots_sync", "radroots_trade", "radroots_transport", "radroots_transport_nostr"] -private_packages = ["radroots_core_bindings", "radroots_domain", "radroots_event_bindings", "radroots_event_codec_wasm", "radroots_execution", "radroots_identity_bindings", "radroots_mesh", "radroots_mesh_agent_client", "radroots_mesh_agent_proto", "radroots_nostrdb", "radroots_replica_schema", "radroots_replica_schema_bindings", "radroots_replica_store", "radroots_replica_store_wasm", "radroots_replica_sync", "radroots_replica_sync_wasm", "radroots_runtime_distribution", "radroots_runtime_manager", "radroots_runtime_paths", "radroots_sdk_ffi", "radroots_sdk_sql_wasm_runtime", "radroots_service_host", "radroots_service_sqlite", "radroots_simplex_agent_proto", "radroots_simplex_app_store", "radroots_simplex_chat_proto", "radroots_simplex_smp_crypto", "radroots_simplex_smp_proto", "radroots_simplex_smp_transport", "radroots_sql_core", "radroots_test_fixtures", "radroots_trade_bindings", "radroots_transport_reticulum", "xtask"] +public_packages = ["radroots", "radroots_blossom", "radroots_core", "radroots_domain", "radroots_event", "radroots_event_codec", "radroots_execution", "radroots_geonames", "radroots_identity", "radroots_nostr", "radroots_nostr_connect", "radroots_protocol", "radroots_sdk", "radroots_secrets", "radroots_signing", "radroots_storage", "radroots_storage_sqlite", "radroots_sync", "radroots_trade", "radroots_transport", "radroots_transport_nostr"] +private_packages = ["radroots_core_bindings", "radroots_event_bindings", "radroots_event_codec_wasm", "radroots_identity_bindings", "radroots_mesh", "radroots_mesh_agent_client", "radroots_mesh_agent_proto", "radroots_nostrdb", "radroots_replica_schema", "radroots_replica_schema_bindings", "radroots_replica_store", "radroots_replica_store_wasm", "radroots_replica_sync", "radroots_replica_sync_wasm", "radroots_runtime_distribution", "radroots_runtime_manager", "radroots_runtime_paths", "radroots_sdk_ffi", "radroots_sdk_sql_wasm_runtime", "radroots_service_host", "radroots_service_sqlite", "radroots_simplex_agent_proto", "radroots_simplex_app_store", "radroots_simplex_chat_proto", "radroots_simplex_smp_crypto", "radroots_simplex_smp_proto", "radroots_simplex_smp_transport", "radroots_sql_core", "radroots_test_fixtures", "radroots_trade_bindings", "radroots_transport_reticulum", "xtask"] reserved_packages = [] diff --git a/contracts/crates/release.v2.toml b/contracts/crates/release.v2.toml @@ -4,9 +4,11 @@ status = "approved_not_published" supersedes_without_mutation = "radroots.crates.release.v1" canonical_repository = "https://github.com/radrootslabs/lib" version = "0.1.0-alpha" -public_package_count = 19 +public_package_count = 21 publication_authorized = false public_packages = [ + "radroots_domain", + "radroots_execution", "radroots_core", "radroots_identity", "radroots_blossom", diff --git a/contracts/releases/api_boundaries.toml b/contracts/releases/api_boundaries.toml @@ -1,5 +1,5 @@ schema_version = 1 -spec_id = "radroots.crates.release.v1" +spec_id = "radroots.crates.release.v2" forbidden_public_paths = [ "core_foundation", "dispatch", @@ -97,3 +97,11 @@ allowed_public_paths = [] [[package]] name = "radroots" allowed_public_paths = [] + +[[package]] +name = "radroots_domain" +allowed_public_paths = [] + +[[package]] +name = "radroots_execution" +allowed_public_paths = [] diff --git a/contracts/releases/api_semver.toml b/contracts/releases/api_semver.toml @@ -5,6 +5,8 @@ minimum_tool_version = "0.50.0" release_type = "major" feature_policy = "all" packages = [ + "radroots_domain", + "radroots_execution", "radroots_blossom", "radroots_core", "radroots_event", @@ -33,3 +35,11 @@ revision = "865378c0bdefc74fae2320e41ea5f5727d444cee" [[baseline_override]] package = "radroots" revision = "865378c0bdefc74fae2320e41ea5f5727d444cee" + +[[baseline_override]] +package = "radroots_domain" +revision = "52e2a15a90aa4f07f053930be4dda203a0f6631a" + +[[baseline_override]] +package = "radroots_execution" +revision = "52e2a15a90aa4f07f053930be4dda203a0f6631a" diff --git a/contracts/releases/package_tiers.toml b/contracts/releases/package_tiers.toml @@ -1,5 +1,5 @@ schema_version = 1 -spec_id = "radroots.crates.release.v1" +spec_id = "radroots.crates.release.v2" direction = "same_or_lower" enforced_dependency_kinds = ["normal", "dev", "build"] @@ -16,7 +16,7 @@ packages = [ [[tier]] id = "domain" rank = 1 -packages = ["radroots_event", "radroots_event_codec", "radroots_trade"] +packages = ["radroots_domain", "radroots_event", "radroots_event_codec", "radroots_trade"] [[tier]] id = "spi" @@ -42,7 +42,7 @@ packages = [ [[tier]] id = "orchestration" rank = 4 -packages = ["radroots_sync"] +packages = ["radroots_execution", "radroots_sync"] [[tier]] id = "sdk" diff --git a/contracts/releases/portable_matrix.toml b/contracts/releases/portable_matrix.toml @@ -5,6 +5,14 @@ no_std_cross_cflags = "-target thumb-freestanding-eabihf -mcpu=cortex_m4" wasm_target = "wasm32-unknown-unknown" [[package]] +name = "radroots_domain" +wasm = true + +[[package]] +name = "radroots_execution" +wasm = true + +[[package]] name = "radroots_core" wasm = true diff --git a/contracts/releases/publish_policy.toml b/contracts/releases/publish_policy.toml @@ -5,8 +5,10 @@ version = "1.0.0-alpha.1" frozen = false registry = "crates-io" final_enablement_step = 305 -spec_id = "radroots.crates.release.v1" +spec_id = "radroots.crates.release.v2" approved_packages = [ + "radroots_domain", + "radroots_execution", "radroots_core", "radroots_identity", "radroots_blossom", @@ -28,6 +30,8 @@ approved_packages = [ "radroots", ] local_packages = [ + "radroots_domain", + "radroots_execution", "radroots_core", "radroots_identity", "radroots_blossom", @@ -52,8 +56,6 @@ external_packages = [] [workspace_classification] private = [ - "radroots_domain", - "radroots_execution", "radroots_runtime_distribution", "radroots_runtime_manager", "radroots_runtime_paths", @@ -97,6 +99,7 @@ retired = [] crates = [ "radroots_core", "radroots_identity", + "radroots_domain", "radroots_blossom", "radroots_protocol", "radroots_event", @@ -111,6 +114,7 @@ crates = [ "radroots_storage_sqlite", "radroots_transport_nostr", "radroots_sync", + "radroots_execution", "radroots_geonames", "radroots_sdk", "radroots", diff --git a/contracts/releases/supply_chain.toml b/contracts/releases/supply_chain.toml @@ -1,5 +1,5 @@ schema_version = 1 -spec_id = "radroots.crates.release.v1" +spec_id = "radroots.crates.release.v2" package_version = "0.1.0-alpha" [tools] @@ -128,3 +128,11 @@ manifest_path = "crates/sdk/Cargo.toml" [[package]] name = "radroots" manifest_path = "crates/radroots/Cargo.toml" + +[[package]] +name = "radroots_domain" +manifest_path = "crates/domain/Cargo.toml" + +[[package]] +name = "radroots_execution" +manifest_path = "crates/execution/Cargo.toml" diff --git a/crates/domain/Cargo.toml b/crates/domain/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "radroots_domain" -publish = false +publish = ["crates-io"] version = "0.1.0-alpha" edition.workspace = true authors.workspace = true @@ -10,6 +10,7 @@ repository.workspace = true homepage.workspace = true description = "Exact values and deterministic shared Radroots domain invariants" readme = "README.md" +include = ["src/**", "tests/**", "Cargo.toml", "README.md", "LICENSE-APACHE", "LICENSE-MIT"] [features] default = ["std", "serde"] diff --git a/crates/execution/Cargo.toml b/crates/execution/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "radroots_execution" -publish = false +publish = ["crates-io"] version = "0.1.0-alpha" edition.workspace = true authors.workspace = true @@ -10,6 +10,7 @@ repository.workspace = true homepage.workspace = true description = "Typed Radroots command execution and recovery boundaries" readme = "README.md" +include = ["src/**", "tests/**", "Cargo.toml", "README.md", "LICENSE-APACHE", "LICENSE-MIT"] [features] default = [] diff --git a/crates/radroots/Cargo.toml b/crates/radroots/Cargo.toml @@ -37,6 +37,7 @@ path = "src/lib.rs" [dependencies] radroots_core = { workspace = true } +radroots_domain = { workspace = true, features = ["std", "serde"] } radroots_event = { workspace = true } radroots_identity = { workspace = true, features = ["std"] } radroots_sdk = { workspace = true } diff --git a/crates/radroots/README.md b/crates/radroots/README.md @@ -76,6 +76,11 @@ delivery happens only when its `deliver` method is invoked. ## When to use radroots_sdk +`radroots::domain` exposes exact decimal values and separate order, thread, +workspace, executor and operation identities. `radroots::OperationId` is the +retained operation identity, not an operation-kind enum. These validated values +do not authenticate a participant or establish durable command admission. + Use `radroots` for ordinary applications and the primary farm, listing, trade, identity, event, and transport paths. Use `radroots_sdk` directly when the host must own source-generation identity, inject arbitrary storage/signing/sync diff --git a/crates/radroots/src/domain.rs b/crates/radroots/src/domain.rs @@ -0,0 +1,9 @@ +//! Exact shared values and independently typed identities. +//! +//! Construction validates representation. These values do not authenticate a +//! participant, select an executor or prove durable command admission. + +pub use radroots_domain::{ + AmountError, Decimal, ExecutorId, IdentifierError, OperationId, OrderId, PositiveDecimal, + ThreadId, WorkspaceId, +}; diff --git a/crates/radroots/src/lib.rs b/crates/radroots/src/lib.rs @@ -4,6 +4,7 @@ #![doc = include_str!("../README.md")] pub mod client; +pub mod domain; pub mod event; pub mod farm; pub mod identity; @@ -15,4 +16,5 @@ pub mod sync; pub mod trade; pub mod transport; +pub use radroots_domain::OperationId; pub use radroots_sdk::{Client, ClientBuilder, Error, Result}; diff --git a/crates/radroots/tests/domain.rs b/crates/radroots/tests/domain.rs @@ -0,0 +1,27 @@ +use radroots::{ + OperationId, + domain::{AmountError, Decimal, OrderId}, +}; + +#[test] +fn ordinary_facade_keeps_exact_values_and_distinct_operation_identity() { + let a: Decimal = "0.1".parse().unwrap(); + let b: Decimal = "0.2".parse().unwrap(); + assert_eq!(a.checked_add(b).unwrap().to_string(), "0.3"); + assert_eq!(a.checked_sub(b), Err(AmountError::NegativeResult)); + assert!("1e3".parse::<Decimal>().is_err()); + let operation: OperationId = "0123456789abcdef".repeat(4).parse().unwrap(); + assert_eq!( + serde_json::to_string(&operation).unwrap(), + format!("\"{operation}\"") + ); + let order: OrderId = operation.to_string().parse().unwrap(); + assert_eq!(order.to_string(), operation.to_string()); + assert!( + operation + .to_string() + .to_uppercase() + .parse::<OperationId>() + .is_err() + ); +} diff --git a/crates/radroots/tests/package_boundary.rs b/crates/radroots/tests/package_boundary.rs @@ -13,6 +13,7 @@ fn package_has_final_identity_and_exact_dependencies() { dependency_names(MANIFEST), BTreeSet::from([ "radroots_core", + "radroots_domain", "radroots_event", "radroots_identity", "radroots_sdk", @@ -48,7 +49,8 @@ fn root_has_exact_exports_and_no_sdk_namespace() { assert!(ROOT.contains("pub use radroots_sdk::{Client, ClientBuilder, Error, Result};")); assert!(!ROOT.contains("pub mod sdk")); assert!(!ROOT.contains("pub use radroots_sdk::*")); - assert_eq!(ROOT.matches("pub use ").count(), 1); + assert!(ROOT.contains("pub use radroots_domain::OperationId;")); + assert_eq!(ROOT.matches("pub use ").count(), 2); assert!(README.contains("```compile_fail\nuse radroots::sdk;\n```")); } diff --git a/tools/xtask/src/api_qualification.rs b/tools/xtask/src/api_qualification.rs @@ -22,7 +22,11 @@ struct BaselineOverride { pub fn run(root: &Path) -> Result<(), String> { let contract = load(root)?; - validate(&contract, 19)?; + let expected = crate::catalog::public_packages(root)?; + validate(&contract, expected.len())?; + if contract.packages.iter().collect::<BTreeSet<_>>() != expected.iter().collect() { + return Err("public API contract must match the current public allocation".to_owned()); + } verify_tool(&contract)?; verify_revision(root, &contract.baseline_revision)?; for baseline in &contract.baseline_override { @@ -71,14 +75,22 @@ fn validate(contract: &Contract, expected_packages: usize) -> Result<(), String> .iter() .map(|baseline| baseline.package.as_str()) .collect::<BTreeSet<_>>(); - if overrides != BTreeSet::from(["radroots", "radroots_sdk"]) + if overrides + != BTreeSet::from([ + "radroots", + "radroots_sdk", + "radroots_domain", + "radroots_execution", + ]) + || contract.baseline_override.len() != overrides.len() || contract .baseline_override .iter() .any(|baseline| baseline.revision.len() != 40) { return Err( - "public API baseline overrides must identify the two imported front doors".to_owned(), + "public API baselines must identify imported front doors and new shared owners" + .to_owned(), ); } Ok(()) @@ -153,7 +165,7 @@ mod tests { .and_then(std::path::Path::parent) .expect("workspace root"); let contract = load(root).expect("contract"); - validate(&contract, 19).expect("valid contract"); + validate(&contract, 21).expect("valid contract"); let invocation = invocation(&contract, "radroots_core"); assert!(invocation.contains(&"--all-features".to_owned())); assert!(invocation.ends_with(&["--release-type".to_owned(), "major".to_owned()])); diff --git a/tools/xtask/src/architecture.rs b/tools/xtask/src/architecture.rs @@ -165,11 +165,7 @@ pub fn validate(workspace_root: &Path) -> Result<(), String> { let architecture = toml::from_str::<ArchitectureIdentity>(&architecture_raw) .map_err(|error| format!("parse {}: {error}", architecture_path.display()))?; - let architecture_packages = architecture - .package - .iter() - .map(|package| package.name.clone()) - .collect::<BTreeSet<_>>(); + let architecture_packages = public_package_names(workspace_root, &architecture)?; core_contract::validate(workspace_root)?; api_leakage::validate_policy_catalog(workspace_root, &architecture_packages)?; dependency_boundary::validate_policy_catalog(workspace_root, &architecture_packages)?; @@ -318,6 +314,26 @@ fn validate_workspace_toolchain( Ok(()) } +fn public_package_names( + workspace_root: &Path, + architecture: &ArchitectureIdentity, +) -> Result<BTreeSet<String>, String> { + if workspace_root + .join("contracts/crates/catalog.v2.toml") + .is_file() + { + // Current allocation supersedes the frozen V1 inventory. A malformed + // present catalog must fail; only historical fixtures lack this input. + return crate::catalog::public_packages(workspace_root) + .map(|packages| packages.into_iter().collect()); + } + Ok(architecture + .package + .iter() + .map(|p| p.name.clone()) + .collect()) +} + fn validate_public_package_metadata( workspace_root: &Path, architecture: &ArchitectureIdentity, @@ -331,11 +347,7 @@ fn validate_public_package_metadata( .values() .find(|repository| repository.url == workspace.workspace.package.repository) .ok_or_else(|| "workspace repository has no architecture allocation".to_owned())?; - let all_packages = architecture - .package - .iter() - .map(|package| package.name.as_str()) - .collect::<BTreeSet<_>>(); + let all_packages = public_package_names(workspace_root, architecture)?; let consolidation_path = workspace_root.join("contracts/consolidation/architecture.v1.toml"); let consolidated_owner = if consolidation_path.is_file() { let consolidation = fs::read_to_string(&consolidation_path) @@ -499,26 +511,36 @@ fn validate_public_dependency_versions( .values() .find(|repository| repository.url == workspace.workspace.package.repository) .ok_or_else(|| "workspace repository has no architecture allocation".to_owned())?; - let local_packages = repository - .packages + let current_public = public_package_names(workspace_root, architecture)?; + let public_packages = current_public .iter() .map(String::as_str) .collect::<BTreeSet<_>>(); - let public_packages = architecture - .package - .iter() - .map(|package| package.name.as_str()) - .collect::<BTreeSet<_>>(); - let package_versions = architecture - .repositories - .values() - .flat_map(|repository| { - repository - .packages - .iter() - .map(|package| (package.as_str(), repository.version.as_str())) - }) - .collect::<BTreeMap<_, _>>(); + let current_catalog = workspace_root + .join("contracts/crates/catalog.v2.toml") + .is_file(); + let local_packages = if current_catalog { + public_packages.clone() + } else { + repository.packages.iter().map(String::as_str).collect() + }; + let package_versions = if current_catalog { + public_packages + .iter() + .map(|name| (*name, workspace.workspace.package.version.as_str())) + .collect() + } else { + architecture + .repositories + .values() + .flat_map(|repository| { + repository + .packages + .iter() + .map(|package| (package.as_str(), repository.version.as_str())) + }) + .collect::<BTreeMap<_, _>>() + }; for member in &workspace.workspace.members { let manifest_path = workspace_root.join(member).join("Cargo.toml"); @@ -1453,6 +1475,32 @@ adr_required = false } #[test] + fn malformed_current_catalog_never_falls_back_to_frozen_allocation() { + let root = test_root("malformed_current_catalog"); + fs::create_dir_all(root.join("contracts/crates")).unwrap(); + fs::write( + root.join("contracts/crates/catalog.v2.toml"), + "invalid current input", + ) + .unwrap(); + assert!(super::public_package_names(&root, &architecture()).is_err()); + let _ = fs::remove_dir_all(root); + } + + #[test] + fn current_allocation_includes_shared_owners_and_rejects_private_packages() { + let root = std::path::Path::new(env!("CARGO_MANIFEST_DIR")) + .parent() + .unwrap() + .parent() + .unwrap(); + let names = super::public_package_names(root, &architecture()).unwrap(); + assert_eq!(names.len(), 21); + assert!(names.contains("radroots_domain") && names.contains("radroots_execution")); + assert!(!names.contains("radroots_nostrdb")); + } + + #[test] fn public_package_metadata_requires_canonical_inheritance() { let root = test_root("public_package_metadata"); fs::create_dir_all(root.join("crates/radroots")).expect("create public package"); diff --git a/tools/xtask/src/architecture/api_leakage.rs b/tools/xtask/src/architecture/api_leakage.rs @@ -15,7 +15,7 @@ const API_BOUNDARIES_RELATIVE: &str = "contracts/releases/api_boundaries.toml"; const API_DECISION_RELATIVE: &str = "contracts/architecture/decisions/public_api_leakage_migration_baseline.v1.toml"; const API_DECISION_ID: &str = "radroots.public_api_leakage_migration_baseline.v1"; -const SPEC_ID: &str = "radroots.crates.release.v1"; +const SPEC_ID: &str = "radroots.crates.release.v2"; const POLICY_SCHEMA_VERSION: u16 = 1; const DECISION_SCHEMA_VERSION: u16 = 1; const CURRENT_STEP: u16 = 313; @@ -1391,8 +1391,7 @@ mod tests { const DECISION: &str = include_str!( "../../../../contracts/architecture/decisions/public_api_leakage_migration_baseline.v1.toml" ); - const ARCHITECTURE: &str = - include_str!("../../../../contracts/crates/release_v1/radroots_crates_release_v1.toml"); + const ARCHITECTURE: &str = include_str!("../../../../contracts/crates/release.v2.toml"); const GENERIC_SQLX: &str = include_str!("../../tests/fixtures/api-leakage/generic-sqlx.rs"); const GENERIC_RENAMED_TOKIO: &str = include_str!("../../tests/fixtures/api-leakage/generic-renamed-tokio.rs"); @@ -1402,12 +1401,7 @@ mod tests { include_str!("../../tests/fixtures/api-leakage/private-implementation.rs"); #[derive(Deserialize)] struct ArchitectureCatalog { - package: Vec<ArchitecturePackage>, - } - - #[derive(Deserialize)] - struct ArchitecturePackage { - name: String, + public_packages: Vec<String>, } fn policy() -> ApiBoundaryPolicy { @@ -1417,9 +1411,8 @@ mod tests { fn expected_packages() -> BTreeSet<String> { toml::from_str::<ArchitectureCatalog>(ARCHITECTURE) .expect("architecture") - .package + .public_packages .into_iter() - .map(|package| package.name) .collect() } diff --git a/tools/xtask/src/architecture/dependency_boundary.rs b/tools/xtask/src/architecture/dependency_boundary.rs @@ -8,7 +8,7 @@ use std::{ use serde::Deserialize; const PACKAGE_TIERS_RELATIVE: &str = "contracts/releases/package_tiers.toml"; -const SPEC_ID: &str = "radroots.crates.release.v1"; +const SPEC_ID: &str = "radroots.crates.release.v2"; const DIRECTION: &str = "same_or_lower"; const POLICY_SCHEMA_VERSION: u16 = 1; const CURRENT_STEP: u16 = 24; @@ -569,8 +569,7 @@ mod tests { use std::collections::BTreeSet; const POLICY: &str = include_str!("../../../../contracts/releases/package_tiers.toml"); - const ARCHITECTURE: &str = - include_str!("../../../../contracts/crates/release_v1/radroots_crates_release_v1.toml"); + const ARCHITECTURE: &str = include_str!("../../../../contracts/crates/release.v2.toml"); const DOMAIN_TO_STORAGE: &str = include_str!("../../tests/fixtures/dependency-boundaries/domain-to-storage.json"); const SPI_TO_ADAPTER: &str = @@ -582,12 +581,7 @@ mod tests { #[derive(Deserialize)] struct ArchitectureCatalog { - package: Vec<ArchitecturePackage>, - } - - #[derive(Deserialize)] - struct ArchitecturePackage { - name: String, + public_packages: Vec<String>, } fn policy() -> DependencyBoundaryPolicy { @@ -604,9 +598,8 @@ mod tests { let architecture = toml::from_str::<ArchitectureCatalog>(ARCHITECTURE).expect("architecture catalog"); let expected = architecture - .package + .public_packages .into_iter() - .map(|package| package.name) .collect::<BTreeSet<_>>(); validate_policy(policy, &expected).expect("valid package tier policy") } @@ -615,7 +608,7 @@ mod tests { fn policy_covers_the_exact_architecture_catalog() { let policy = policy(); let placements = placements(&policy); - assert_eq!(placements.len(), 19); + assert_eq!(placements.len(), 21); } #[test] diff --git a/tools/xtask/src/catalog.rs b/tools/xtask/src/catalog.rs @@ -23,6 +23,9 @@ const CATALOG_SCHEMA: &str = "radroots.workspace.catalog.v2"; const RELEASE_ID: &str = "radroots.crates.release.v2"; const CONSOLIDATION_ID: &str = "radroots.rust.consolidation.v1"; const VERSION: &str = "0.1.0-alpha"; +// Implemented public owners from the approved shared SDK target. Native +// introduction provenance is independent of publication eligibility. +const NATIVE_PUBLIC_PACKAGES: &[&str] = &["radroots_domain", "radroots_execution"]; const APPLICATION_RETIREMENT: &str = "contracts/architecture/decisions/tera_application_ownership.v1.json"; const RETIRED_APPLICATION_PACKAGES: [&str; 4] = [ @@ -212,6 +215,14 @@ pub(crate) fn active_packages(workspace_root: &Path) -> Result<Vec<String>, Stri active_packages_matching(workspace_root, |_| true) } +pub(crate) fn public_packages(workspace_root: &Path) -> Result<Vec<String>, String> { + let catalog = parse_file::<Catalog>(workspace_root, CATALOG_RELATIVE)?; + validate_catalog(&catalog)?; + let release = parse_file::<ReleaseV2>(workspace_root, RELEASE_RELATIVE)?; + validate_release(&release, &catalog, workspace_root)?; + Ok(release.public_packages) +} + fn active_packages_matching( workspace_root: &Path, predicate: impl Fn(&CatalogPackage) -> bool, @@ -306,7 +317,7 @@ fn validate_catalog(catalog: &Catalog) -> Result<(), String> { || catalog.rust_version != crate::architecture::STABLE_TOOLCHAIN || catalog.edition != "2024" || catalog.resolver != "3" - || catalog.public_package_count != 19 + || catalog.public_package_count != expected_public_packages().len() || catalog.package_count != catalog.package.len() || catalog.digest_algorithm != "sha256-raw-bytes-v1" || catalog.source_tree_digest_algorithm != "sha256-git-ls-tree-r-v1" @@ -433,7 +444,7 @@ fn validate_catalog(catalog: &Catalog) -> Result<(), String> { package_by_name.insert(package.name.as_str(), package); } if public != expected_public { - return Err("catalog must contain exactly the 19 approved public packages".to_owned()); + return Err("catalog must contain exactly the approved public allocation".to_owned()); } let required_groups = BTreeSet::from([ "boundaries", @@ -455,7 +466,7 @@ fn validate_catalog(catalog: &Catalog) -> Result<(), String> { .map(|package| package.name.as_str()) .collect::<BTreeSet<_>>(); if portable != expected_public { - return Err("portable group must contain exactly the 19 public packages".to_owned()); + return Err("portable group must contain exactly the public allocation".to_owned()); } for package in &catalog.package { for tier in &package.permitted_dependency_tiers { @@ -555,12 +566,15 @@ fn validate_package_provenance(package: &CatalogPackage) -> Result<(), String> { ) })?; validate_sha256(introduction_tree_sha256, "introduction tree digest")?; + let public = package.publish || package.visibility == "public_release"; if package.state != "active" - || package.publish - || package.visibility == "public_release" + || (public + && (!NATIVE_PUBLIC_PACKAGES.contains(&package.name.as_str()) + || !package.publish + || package.visibility != "public_release")) { return Err(format!( - "native package {} must be active and unpublished", + "native package {} must be active and use its approved publication boundary", package.name )); } @@ -615,7 +629,7 @@ fn validate_release( || release.supersedes_without_mutation != "radroots.crates.release.v1" || release.canonical_repository != "https://github.com/radrootslabs/lib" || release.version != VERSION - || release.public_package_count != 19 + || release.public_package_count != expected_public_packages().len() || release.publication_authorized || release .public_packages @@ -1337,7 +1351,7 @@ fn sort_map_values(values: &mut BTreeMap<&str, Vec<&str>>) { } fn expected_public_packages() -> BTreeSet<&'static str> { - BTreeSet::from([ + let mut packages = BTreeSet::from([ "radroots", "radroots_blossom", "radroots_core", @@ -1357,7 +1371,9 @@ fn expected_public_packages() -> BTreeSet<&'static str> { "radroots_trade", "radroots_transport", "radroots_transport_nostr", - ]) + ]); + packages.extend(NATIVE_PUBLIC_PACKAGES.iter().copied()); + packages } fn expected_retired_packages() -> BTreeSet<&'static str> { @@ -1534,7 +1550,7 @@ mod tests { #[test] fn public_inventory_is_exact() { - assert_eq!(expected_public_packages().len(), 19); + assert_eq!(expected_public_packages().len(), 21); assert!(expected_public_packages().contains("radroots")); assert!(expected_public_packages().contains("radroots_sdk")); } @@ -1549,6 +1565,24 @@ mod tests { } #[test] + fn only_approved_shared_native_packages_can_be_public() { + for name in ["radroots_domain", "radroots_execution"] { + let mut catalog = checked_in_catalog(); + let package = catalog.package.iter_mut().find(|p| p.name == name).unwrap(); + package.visibility = "public_release".to_owned(); + package.publish = true; + validate_package_provenance(package).expect("approved native public allocation"); + package.source_revision = Some("a".repeat(40)); + assert!(validate_package_provenance(package).is_err()); + } + let mut catalog = checked_in_catalog(); + let other = native_package(&mut catalog, "crates/nostrdb", &"a".repeat(64)); + other.visibility = "public_release".to_owned(); + other.publish = true; + assert!(validate_package_provenance(other).is_err()); + } + + #[test] fn provenance_kinds_are_disjoint_and_native_is_unpublished() { let mut catalog = checked_in_catalog(); let imported = catalog diff --git a/tools/xtask/src/contract.rs b/tools/xtask/src/contract.rs @@ -8815,13 +8815,9 @@ fn validate_v1_release_policy( expected_approved.len() )); } - if control.spec_id != architecture.spec_id || control.spec_id != "radroots.crates.release.v1" { - return Err(format!( - "publication.spec_id {} must match architecture id {}", - control.spec_id, architecture.spec_id - )); + if architecture.spec_id != "radroots.crates.release.v1" { + return Err("frozen release architecture must retain its V1 identity".to_owned()); } - let approved = collect_unique_set(&control.approved_packages, "publication.approved_packages")?; let local = collect_unique_set(&control.local_packages, "publication.local_packages")?; let external = collect_unique_set(&control.external_packages, "publication.external_packages")?; @@ -8842,6 +8838,28 @@ fn validate_v1_release_policy( } else { false }; + let current_allocation = consolidated_here + && workspace_root + .join("contracts/crates/catalog.v2.toml") + .is_file(); + let expected_approved = if current_allocation { + crate::catalog::public_packages(workspace_root)? + .into_iter() + .collect() + } else { + expected_approved + }; + let expected_spec = if current_allocation { + "radroots.crates.release.v2" + } else { + architecture.spec_id.as_str() + }; + if control.spec_id != expected_spec { + return Err(format!( + "publication.spec_id {} must match architecture id {expected_spec}", + control.spec_id + )); + } let (expected_local, expected_external) = if consolidated_here { (expected_approved.clone(), BTreeSet::new()) } else { diff --git a/tools/xtask/src/portable_qualification.rs b/tools/xtask/src/portable_qualification.rs @@ -68,8 +68,10 @@ fn load(workspace_root: &Path) -> Result<PortableMatrix, String> { let expected = [ "radroots_blossom", "radroots_core", + "radroots_domain", "radroots_event", "radroots_event_codec", + "radroots_execution", "radroots_identity", "radroots_nostr", "radroots_protocol", @@ -80,7 +82,7 @@ fn load(workspace_root: &Path) -> Result<PortableMatrix, String> { ]; if names != expected || matrix.package.iter().any(|package| !package.wasm) { return Err( - "portable matrix must contain exactly the 11 declared no_std and WASM packages" + "portable matrix must contain exactly the 13 declared no_std and WASM packages" .to_owned(), ); } @@ -136,7 +138,7 @@ mod tests { .and_then(std::path::Path::parent) .expect("workspace root"); let matrix = load(root).expect("portable matrix"); - assert_eq!(matrix.package.len(), 11); + assert_eq!(matrix.package.len(), 13); assert!(matrix.package.iter().all(|package| package.wasm)); } } diff --git a/tools/xtask/src/release_graph.rs b/tools/xtask/src/release_graph.rs @@ -1,7 +1,7 @@ use std::path::Path; /// Proves the standalone lower-crate resolved graph. The SDK capsule owns the -/// aggregate 19-package ordering check because its staged metadata closure +/// aggregate package ordering check because its staged metadata closure /// resolves both repository surfaces. pub fn run(workspace_root: &Path) -> Result<(), String> { crate::architecture::validate_dependency_boundaries(workspace_root)?; diff --git a/tools/xtask/src/release_qualification.rs b/tools/xtask/src/release_qualification.rs @@ -63,9 +63,15 @@ fn feature_matrix(workspace_root: &Path) -> Result<Vec<CargoInvocation>, String> }) .collect::<Vec<_>>(); packages.sort_by(|left, right| left.name.cmp(&right.name)); - if packages.len() != 19 { + let expected = crate::catalog::public_packages(workspace_root)?; + if packages + .iter() + .map(|p| p.name.as_str()) + .collect::<std::collections::BTreeSet<_>>() + != expected.iter().map(String::as_str).collect() + { return Err(format!( - "library feature qualification requires exactly 19 public packages, found {}", + "library feature qualification must match current public allocation, found {} packages", packages.len() )); } diff --git a/tools/xtask/src/supply_chain_qualification.rs b/tools/xtask/src/supply_chain_qualification.rs @@ -88,7 +88,17 @@ impl Drop for GeneratedSboms { pub fn run(root: &Path) -> Result<(), String> { let contract = load(root)?; - validate(root, &contract, 19)?; + let expected = crate::catalog::public_packages(root)?; + validate(root, &contract, expected.len())?; + if contract + .package + .iter() + .map(|p| &p.name) + .collect::<BTreeSet<_>>() + != expected.iter().collect() + { + return Err("supply-chain contract must match the current public allocation".to_owned()); + } verify_tools(&contract)?; let metadata = load_metadata(root)?; qualify_git_sources(root, &contract)?; @@ -113,7 +123,7 @@ fn load(root: &Path) -> Result<Contract, String> { fn validate(root: &Path, contract: &Contract, expected_packages: usize) -> Result<(), String> { if contract.schema_version != 1 - || contract.spec_id != "radroots.crates.release.v1" + || contract.spec_id != "radroots.crates.release.v2" || contract.package_version != "0.1.0-alpha" || contract.tools.cargo_deny != "0.19.8" || contract.tools.cargo_cyclonedx != "0.5.9" @@ -873,7 +883,7 @@ mod tests { fn current_contract_is_exact_and_exception_bound() { let root = root(); let contract = load(&root).expect("contract"); - validate(&root, &contract, 19).expect("valid contract"); + validate(&root, &contract, 21).expect("valid contract"); qualify_git_sources(&root, &contract).expect("exact direct and transitive Git sources"); } diff --git a/tools/xtask/src/target_qualification.rs b/tools/xtask/src/target_qualification.rs @@ -88,9 +88,10 @@ fn load(workspace_root: &Path) -> Result<(TargetMatrix, Vec<String>), String> { .map(|package| package.name) .collect::<Vec<_>>(); packages.sort(); - if packages.len() != 19 { + let expected = crate::catalog::public_packages(workspace_root)?; + if packages.iter().collect::<std::collections::BTreeSet<_>>() != expected.iter().collect() { return Err(format!( - "target qualification requires exactly 19 public packages, found {}", + "target qualification must match current public allocation, found {} packages", packages.len() )); } @@ -213,7 +214,7 @@ mod tests { ("macos", "aarch64-apple-darwin"), ] ); - assert_eq!(packages.len(), 19); + assert_eq!(packages.len(), 21); } #[test]