commit 68aa381171e6184587537c13c6959127cd139e3d
parent dc4f3bf20089bf49d86bab378fdd31a22f3f8484
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:
3 files changed, 10 insertions(+), 12 deletions(-)
diff --git a/tools/sdk_xtask_import/Cargo.toml b/tools/sdk_xtask_import/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/sdk_xtask_import/src/cli_host.rs b/tools/sdk_xtask_import/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/sdk_xtask_import/src/contracts.rs b/tools/sdk_xtask_import/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"))?;