sdk

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

commit 6f16fa242bf1138d8e1d5210faa0438523cdd62c
parent 0bd19a81a23ee794481e684555a9175f18deb753
Author: triesap <tyson@radroots.org>
Date:   Tue,  7 Jul 2026 09:27:01 +0000

transport: guard proxy preview completion

- Extend source-boundary coverage for proxy preview and deferred mapping.
- Require typed daemon event id conversion for proxy receipts.
- Reject panic helpers in proxy receipt conversion.
- Validate with SDK fmt, check, tests, source-boundary, and xtask check.

Diffstat:
Mcrates/sdk/tests/source_boundary.rs | 47+++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 47 insertions(+), 0 deletions(-)

diff --git a/crates/sdk/tests/source_boundary.rs b/crates/sdk/tests/source_boundary.rs @@ -1322,6 +1322,38 @@ fn sdk_proxy_surfaces_reject_removed_daemon_publish_proxy_identifiers() { sync_runtime_source.contains("target.transport_kind == RadrootsTransportKind::Proxy"), "src/sync_runtime.rs must identify proxy delegate targets with RadrootsTransportKind::Proxy" ); + + for required in [ + "TransportPublishOutcomeKind::DeferredUntilImplemented", + "mark_delivery_target_deferred_until_implemented", + "TransportPublishOutcomeKind::PreviewUnavailable", + "mark_delivery_target_preview_unavailable", + "PushOutboxEventState::DeferredUntilImplemented", + "PushOutboxEventState::PreviewUnavailable", + "PushOutboxTargetOutcomeKind::DeferredUntilImplemented", + "PushOutboxTargetOutcomeKind::PreviewUnavailable", + ] { + assert!( + sync_runtime_source.contains(required), + "src/sync_runtime.rs must preserve proxy preview/deferred outcome witness `{required}`" + ); + } + + let receipt_source = source_between( + sync_runtime_source.as_str(), + "fn push_proxy_event_receipt", + "fn push_proxy_target_receipt", + ); + assert!( + receipt_source.contains("push_receipt_event_id("), + "push_proxy_event_receipt must convert daemon event ids through the typed receipt helper" + ); + for forbidden in [".expect(", ".unwrap(", "panic!("] { + assert!( + !receipt_source.contains(forbidden), + "push_proxy_event_receipt must not use production panic path `{forbidden}`" + ); + } } #[test] @@ -1512,6 +1544,21 @@ fn function_source<'source>(source: &'source str, function_name: &str) -> &'sour &source_after_start[..end] } +fn source_between<'source>( + source: &'source str, + start_marker: &str, + end_marker: &str, +) -> &'source str { + let start = source + .find(start_marker) + .unwrap_or_else(|| panic!("failed to find source marker `{start_marker}`")); + let source_after_start = &source[start..]; + let end = source_after_start + .find(end_marker) + .unwrap_or_else(|| panic!("failed to find source marker `{end_marker}`")); + &source_after_start[..end] +} + fn export_block<'source>(source: &'source str, marker: &str) -> &'source str { let start = source .find(marker)