commit b5d7520c7f1168914f4cedd3260108bb8e65aaf2
parent c19a9de1bd7c831a2b80d96f0bd89874df23995c
Author: triesap <tyson@radroots.org>
Date: Sun, 12 Apr 2026 22:36:20 +0000
spec: reconcile sdk contract topology
Diffstat:
10 files changed, 131 insertions(+), 17 deletions(-)
diff --git a/spec/README.md b/spec/README.md
@@ -11,22 +11,43 @@ It defines the public interoperability boundary for external integrators, keeps
Contract metadata is defined in `spec/manifest.toml` and currently includes:
-- model crates: `radroots_core`, `radroots_types`, `radroots_events`, `radroots_trade`, `radroots_identity`
+- model crates: `radroots_core`, `radroots_events`, `radroots_trade`, `radroots_identity`
- algorithm crate: `radroots_events_codec`
- wasm crate: `radroots_events_codec_wasm`
+The curated public Rust entrypoint is `radroots_sdk`.
+The crate list above records implementation provenance for the contract surface;
+it is not a promise that every listed crate is a first-class end-user SDK
+package.
+
Public SDK exports are intentionally narrower than the full Rust workspace.
## Export Targets
-Language export mappings and artifact layout rules are defined under `spec/exports/`:
+Language export metadata is split into two layers:
+
+- `spec/sdk-exports/`: curated public SDK package definitions, operation maps,
+ and shared-type maps
+- `spec/exports/`: lower-level package and artifact provenance mappings used by
+ tooling and generated artifact layout
+
+Curated public SDK package definitions are defined under `spec/sdk-exports/`:
+
+- `spec/sdk-exports/ts.toml`
+- `spec/sdk-exports/swift.toml`
+- `spec/sdk-exports/kotlin.toml`
+- `spec/sdk-exports/py.toml`
+
+Lower-level language package mappings and artifact layout rules remain defined
+under `spec/exports/`:
- `spec/exports/ts.toml`
- `spec/exports/py.toml`
- `spec/exports/swift.toml`
- `spec/exports/kotlin.toml`
-Each export target defines package naming, artifact directories, and runtime expectations.
+The `sdk-exports` files are the authoritative public package model.
+The `exports` files remain the lower-level substrate and artifact mapping layer.
## Internal Replica Contract
diff --git a/spec/exports/kotlin.toml b/spec/exports/kotlin.toml
@@ -4,7 +4,6 @@ repository = "sdk-kotlin"
[packages]
"radroots_core" = "radroots.core"
-"radroots_types" = "radroots.types"
"radroots_events" = "radroots.events"
"radroots_trade" = "radroots.trade"
"radroots_identity" = "radroots.identity"
diff --git a/spec/exports/py.toml b/spec/exports/py.toml
@@ -4,7 +4,6 @@ repository = "sdk-python"
[packages]
"radroots_core" = "radroots_core"
-"radroots_types" = "radroots_types"
"radroots_events" = "radroots_events"
"radroots_trade" = "radroots_trade"
"radroots_identity" = "radroots_identity"
diff --git a/spec/exports/swift.toml b/spec/exports/swift.toml
@@ -4,7 +4,6 @@ repository = "sdk-swift"
[packages]
"radroots_core" = "RadrootsCore"
-"radroots_types" = "RadrootsTypes"
"radroots_events" = "RadrootsEvents"
"radroots_trade" = "RadrootsTrade"
"radroots_identity" = "RadrootsIdentity"
diff --git a/spec/exports/ts.toml b/spec/exports/ts.toml
@@ -4,7 +4,6 @@ repository = "sdk-typescript"
[packages]
"radroots_core" = "@radroots/core"
-"radroots_types" = "@radroots/types"
"radroots_events" = "@radroots/events"
"radroots_trade" = "@radroots/trade"
"radroots_identity" = "@radroots/identity"
diff --git a/spec/manifest.toml b/spec/manifest.toml
@@ -6,7 +6,6 @@ source = "rust"
[surface]
model_crates = [
"radroots_core",
- "radroots_types",
"radroots_events",
"radroots_trade",
"radroots_identity",
@@ -14,6 +13,11 @@ model_crates = [
algorithm_crates = ["radroots_events_codec"]
wasm_crates = ["radroots_events_codec_wasm"]
+[sdk]
+rust_package = "radroots_sdk"
+public_surface = "operation_first"
+website_ingest_contract = true
+
[surface.internal_replica_crates]
schema = "radroots_replica_db_schema"
storage = "radroots_replica_db"
@@ -22,14 +26,7 @@ sync = "radroots_replica_sync"
sync_wasm = "radroots_replica_sync_wasm"
[export.ts]
-packages = [
- "@radroots/core",
- "@radroots/types",
- "@radroots/events",
- "@radroots/trade",
- "@radroots/identity",
- "@radroots/events-codec-wasm",
-]
+packages = ["@radroots/sdk"]
[policy]
exclude_internal_workspace_crates = true
diff --git a/spec/operations.toml b/spec/operations.toml
@@ -26,7 +26,6 @@ classes = ["encode_error", "parse_error", "validation_error", "address_error"]
[implementation_provenance]
model_crates = [
"radroots_core",
- "radroots_types",
"radroots_events",
"radroots_trade",
"radroots_identity",
@@ -34,6 +33,11 @@ model_crates = [
algorithm_crates = ["radroots_events_codec"]
wasm_crates = ["radroots_events_codec_wasm"]
+[sdk]
+rust_package = "radroots_sdk"
+primary_domains = ["profile", "farm", "listing", "trade"]
+public_surface = "operation_first"
+
[operations.profile_build_draft]
domain = "profile"
id = "profile.build_draft"
diff --git a/spec/sdk-exports/kotlin.toml b/spec/sdk-exports/kotlin.toml
@@ -0,0 +1,32 @@
+[language]
+id = "kotlin"
+repository = "sdk-kotlin"
+
+[sdk]
+package = "radroots.sdk"
+deterministic_codec = "native_or_wasm"
+signing = "native"
+networking = "native"
+
+[operations]
+"profile.build_draft" = "profile.buildDraft"
+"farm.build_draft" = "farm.buildDraft"
+"listing.build_tags" = "listing.buildTags"
+"listing.build_draft" = "listing.buildDraft"
+"listing.parse_event" = "listing.parseEvent"
+"trade.build_envelope_draft" = "trade.buildEnvelopeDraft"
+"trade.parse_envelope" = "trade.parseEnvelope"
+"trade.parse_listing_address" = "trade.parseListingAddress"
+"trade.validate_listing_event" = "trade.validateListingEvent"
+
+[shared_types]
+"WireEventParts" = "WireEventParts"
+"UnsignedEventDraft" = "UnsignedEventDraft"
+"RadrootsNostrEvent" = "RadrootsNostrEvent"
+"RadrootsNostrEventRef" = "RadrootsNostrEventRef"
+"RadrootsNostrEventPtr" = "RadrootsNostrEventPtr"
+"RadrootsTradeListingAddress" = "TradeListingAddress"
+"RadrootsProfile" = "RadrootsProfile"
+"RadrootsFarm" = "RadrootsFarm"
+"RadrootsListing" = "RadrootsListing"
+"RadrootsTradeEnvelope" = "TradeEnvelope"
diff --git a/spec/sdk-exports/py.toml b/spec/sdk-exports/py.toml
@@ -0,0 +1,32 @@
+[language]
+id = "py"
+repository = "sdk-python"
+
+[sdk]
+package = "radroots_sdk"
+deterministic_codec = "native_or_wasm"
+signing = "native"
+networking = "native"
+
+[operations]
+"profile.build_draft" = "profile_build_draft"
+"farm.build_draft" = "farm_build_draft"
+"listing.build_tags" = "listing_build_tags"
+"listing.build_draft" = "listing_build_draft"
+"listing.parse_event" = "listing_parse_event"
+"trade.build_envelope_draft" = "trade_build_envelope_draft"
+"trade.parse_envelope" = "trade_parse_envelope"
+"trade.parse_listing_address" = "trade_parse_listing_address"
+"trade.validate_listing_event" = "trade_validate_listing_event"
+
+[shared_types]
+"WireEventParts" = "WireEventParts"
+"UnsignedEventDraft" = "UnsignedEventDraft"
+"RadrootsNostrEvent" = "RadrootsNostrEvent"
+"RadrootsNostrEventRef" = "RadrootsNostrEventRef"
+"RadrootsNostrEventPtr" = "RadrootsNostrEventPtr"
+"RadrootsTradeListingAddress" = "TradeListingAddress"
+"RadrootsProfile" = "RadrootsProfile"
+"RadrootsFarm" = "RadrootsFarm"
+"RadrootsListing" = "RadrootsListing"
+"RadrootsTradeEnvelope" = "TradeEnvelope"
diff --git a/spec/sdk-exports/swift.toml b/spec/sdk-exports/swift.toml
@@ -0,0 +1,32 @@
+[language]
+id = "swift"
+repository = "sdk-swift"
+
+[sdk]
+package = "RadrootsSDK"
+deterministic_codec = "native_or_wasm"
+signing = "native"
+networking = "native"
+
+[operations]
+"profile.build_draft" = "profile.buildDraft"
+"farm.build_draft" = "farm.buildDraft"
+"listing.build_tags" = "listing.buildTags"
+"listing.build_draft" = "listing.buildDraft"
+"listing.parse_event" = "listing.parseEvent"
+"trade.build_envelope_draft" = "trade.buildEnvelopeDraft"
+"trade.parse_envelope" = "trade.parseEnvelope"
+"trade.parse_listing_address" = "trade.parseListingAddress"
+"trade.validate_listing_event" = "trade.validateListingEvent"
+
+[shared_types]
+"WireEventParts" = "WireEventParts"
+"UnsignedEventDraft" = "UnsignedEventDraft"
+"RadrootsNostrEvent" = "RadrootsNostrEvent"
+"RadrootsNostrEventRef" = "RadrootsNostrEventRef"
+"RadrootsNostrEventPtr" = "RadrootsNostrEventPtr"
+"RadrootsTradeListingAddress" = "TradeListingAddress"
+"RadrootsProfile" = "RadrootsProfile"
+"RadrootsFarm" = "RadrootsFarm"
+"RadrootsListing" = "RadrootsListing"
+"RadrootsTradeEnvelope" = "TradeEnvelope"