Skip to content

refactor: adopt MaybeSend portability vocabulary - #2229

Draft
gold-silver-copper wants to merge 1 commit into
mainfrom
agent/maybe-send-portability
Draft

refactor: adopt MaybeSend portability vocabulary#2229
gold-silver-copper wants to merge 1 commit into
mainfrom
agent/maybe-send-portability

Conversation

@gold-silver-copper

Copy link
Copy Markdown
Contributor

Adopt MaybeSend portability vocabulary

Description

This refactors Rig's cross-platform async portability vocabulary to conventional Rust naming while preserving the exact existing behavior.

  • Rename WasmCompatSend, WasmCompatSync, and WasmBoxedFuture to MaybeSend, MaybeSync, and BoxFuture.
  • Relax thread-safety only for all(target_arch = "wasm32", target_os = "unknown"); WASI and every other target retain real Send/Sync guarantees.
  • Implement BoxFuture with futures::future::BoxFuture or LocalBoxFuture.
  • Remove the HTTP-only stream marker in favor of target-specific BoxStream/LocalBoxStream aliases.
  • Audit portable provider, tool, hook, memory, vector-store, erased-object, boxed-error, future, and stream bounds.
  • Add core and root-facade compile contracts plus native regression coverage.
  • Update public documentation, contributor guidance, migration notes, and the changelog.

This is intentionally a breaking API rename with no compatibility shims.

Type of change

  • Bug fix
  • New feature
  • Breaking change
  • Documentation update

Testing

  • cargo fmt --all --check
  • cargo clippy --all-targets --all-features -- -D warnings
  • cargo test
  • cargo check -p rig-core --target wasm32-unknown-unknown
  • cargo check -p rig-agent --target wasm32-unknown-unknown
  • cargo check -p rig --target wasm32-unknown-unknown
  • cargo doc --workspace --no-deps
  • Targeted core/facade/rig-memory checks and stale-identifier audits

Checklist

  • My code follows the style guidelines of this project
  • I have commented code where the target-specific behavior needs explanation
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove the portability contract
  • New and existing unit tests pass locally with my changes

Notes

A fresh independent review covered the complete diff. Its one finding—a stale compatibility name in a comment—was fixed, affected checks were rerun, and the final independent pass found no remaining actionable issues.

Two broader pre-existing target limitations remain outside this PR's scope:

  • rig-core --all-features on browser WASM is blocked by lopdfgetrandom without wasm_js.
  • WASI compilation is blocked earlier by existing Tokio feature and socket2 target support.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant