sdk

Radroots SDK and bindings
git clone https://radroots.dev/git/sdk.git
Log | Files | Refs | README

commit 7a2a8d817d8c7ac0038aa46957c1d4973ed5e973
parent 84699dbf840a054dd4cc19e291b4b28bffa7d7e7
Author: triesap <tyson@radroots.org>
Date:   Mon,  3 Aug 2026 13:13:47 +0000

bindings: use protocol as dto authority

- Make SDK contract validation consume the final protocol operation catalog.
- Drive CLI-host metadata generation from protocol-owned operation identities.
- Remove the retired runtime shim from active SDK tooling dependencies.
- Retain the shim only for the separately assigned CLI migration boundary.

Diffstat:
MCargo.lock | 2+-
Mdocs/implementation/COMPATIBILITY_SHIMS.md | 2+-
Mtools/xtask/Cargo.toml | 2+-
Mtools/xtask/src/cli_host.rs | 18++++++++----------
Mtools/xtask/src/contracts.rs | 2+-
5 files changed, 12 insertions(+), 14 deletions(-)

diff --git a/Cargo.lock b/Cargo.lock @@ -1924,8 +1924,8 @@ dependencies = [ "radroots_event_index", "radroots_identity", "radroots_identity_bindings", + "radroots_protocol", "radroots_replica_schema_bindings", - "radroots_runtime_contract_v1", "serde", "serde_json", "sha2", diff --git a/docs/implementation/COMPATIBILITY_SHIMS.md b/docs/implementation/COMPATIBILITY_SHIMS.md @@ -6,7 +6,7 @@ second protocol authority. | Shim | Final owner | Remaining consumers | Final removal | | --- | --- | --- | --- | -| `radroots_runtime_contract_v1` | `radroots_protocol::runtime::v1` | SDK CLI-host generator; standalone `oss/cli` runtime registry and command code | Step 270 | +| `radroots_runtime_contract_v1` | `radroots_protocol::runtime::v1` | standalone CLI runtime registry and command code only; SDK codegen now consumes protocol directly | Step 270 | The `radroots_sdk` library no longer depends on or reexports the runtime shim. Its radrootsd execution path also consumes diff --git a/tools/xtask/Cargo.toml b/tools/xtask/Cargo.toml @@ -21,8 +21,8 @@ radroots_event_bindings = { path = "../../crates/event_bindings", version = "=0. radroots_event_index = { workspace = true, features = ["dto-bindgen"] } radroots_identity = { workspace = true } radroots_identity_bindings = { path = "../../crates/identity_bindings", version = "=0.1.0-alpha" } +radroots_protocol = { workspace = true } radroots_replica_schema_bindings = { path = "../../crates/replica_schema_bindings", version = "=0.1.0-alpha" } -radroots_runtime_contract_v1 = { path = "../../crates/runtime_contract_v1", version = "=0.1.0-alpha" } flate2 = "1" serde_json = "1" serde = { workspace = true, features = ["derive"] } diff --git a/tools/xtask/src/cli_host.rs b/tools/xtask/src/cli_host.rs @@ -1,6 +1,6 @@ use std::path::{Path, PathBuf}; -use radroots_runtime_contract_v1::{RUNTIME_OPERATION_DESCRIPTORS_V1, RuntimeOperationIdV1}; +use radroots_protocol::runtime::v1::{CATALOG, OperationId}; use crate::fs::{workspace_root, write_if_changed}; @@ -540,7 +540,7 @@ fn render_registry() -> Result<String, String> { validate_metadata()?; let mut out = generated_header(); out.push_str("pub const OPERATION_REGISTRY: &[OperationSpec] = &[\n"); - for (index, descriptor) in RUNTIME_OPERATION_DESCRIPTORS_V1.iter().enumerate() { + for (index, descriptor) in CATALOG.iter().enumerate() { let metadata = metadata_for(descriptor.operation_id)?; out.push_str(" OperationSpec {\n"); out.push_str(&format!( @@ -598,7 +598,7 @@ fn render_target() -> Result<String, String> { validate_metadata()?; let mut out = generated_header(); out.push_str("target_operation_contracts! {\n"); - for descriptor in RUNTIME_OPERATION_DESCRIPTORS_V1 { + for descriptor in CATALOG { let metadata = metadata_for(descriptor.operation_id)?; let type_name = metadata.variant; out.push_str(&format!( @@ -615,26 +615,24 @@ fn generated_header() -> String { } fn validate_metadata() -> Result<(), String> { - if CLI_OPERATION_METADATA.len() != RUNTIME_OPERATION_DESCRIPTORS_V1.len() { + if CLI_OPERATION_METADATA.len() != CATALOG.len() { return Err(format!( "CLI metadata count {} does not match runtime descriptor count {}", CLI_OPERATION_METADATA.len(), - RUNTIME_OPERATION_DESCRIPTORS_V1.len() + CATALOG.len() )); } - for descriptor in RUNTIME_OPERATION_DESCRIPTORS_V1 { + for descriptor in CATALOG { metadata_for(descriptor.operation_id)?; } for metadata in CLI_OPERATION_METADATA { - RuntimeOperationIdV1::parse(metadata.operation_id) + OperationId::parse(metadata.operation_id) .map_err(|error| format!("invalid CLI metadata operation id: {error}"))?; } Ok(()) } -fn metadata_for( - operation_id: RuntimeOperationIdV1, -) -> Result<&'static CliOperationMetadata, String> { +fn metadata_for(operation_id: OperationId) -> Result<&'static CliOperationMetadata, String> { let operation_id = operation_id.as_str(); CLI_OPERATION_METADATA .iter() diff --git a/tools/xtask/src/contracts.rs b/tools/xtask/src/contracts.rs @@ -104,7 +104,7 @@ struct SdkArtifacts { } pub fn validate_sdk_contracts(root: &Path) -> Result<(), String> { - radroots_runtime_contract_v1::validate_runtime_contract_v1() + radroots_protocol::runtime::v1::validate_catalog(radroots_protocol::runtime::v1::CATALOG) .map_err(|error| error.to_string())?; let exports = load_contract_dir::<ExportContract>(&root.join("contracts").join("exports"))?; let packages = load_contract_dir::<PackageContract>(&root.join("contracts").join("packages"))?;