refactor(hub): oneshot waiters and plugin hygiene

Merged
S0
2mo ago
+5829-3002

Summary

  • Replace Condvar read/drain waiters with sync_channel(1), atomic slot install, read fallthrough, and one shared drain idle path (desktop = shared).
  • Strengthen test process: trust matrix, command inventory, AT/mux serde contract, exchange-options Jest, ACL smoke, deflake sleeps.
  • Hygiene: drop dead deps/PortBackend, wide tauri/tauri-plugin reqs with updated lockfile, README drift fixes, thin guest-js cleanup, playground AT quick buttons.

Test plan

  • cargo test --lib hub::
  • cargo test --lib -- command_inventory acl_smoke invoke_contract
  • cargo test --lib -- cancel_exchange_while_at_in_flight write_succeeds_while_exchange_waiting exchange_fails_fast_on_disconnect
  • pnpm test
  • cargo clippy --all-targets -- -D warnings
  • Smoke playground AT quick buttons on a real modem (optional)

Made with Cursor


Summary by cubic

Replaces the hub's Condvar read/drain waiters with sync_channel(1) oneshot signaling and unifies desktop/shared drain idle paths, fixing waiter wake-up races. Also hardens CI, testing, dependencies, and release tooling for publish readiness.

Refactors

  • Read waiters install an atomic slot with fallthrough; the read completes and the waiter consumes the result instead of timing out.
  • PortBackend is deprecated as an alias of ExchangeIo but kept exported for patch compatibility until the next major.
  • SerialPort.open() now resolves with the canonical path string instead of undefined.
  • Pins jni to 0.21, widens tauri/tauri-plugin/serde requirements, and bumps base64/serialport.
  • License files keep the upstream Tauri notice, add s00d, and unify under LICENSE-MIT/LICENSE-APACHE; release tagging moved to release-it with a Cargo version sync hook and pnpm-only publish auth.

Testing & CI

  • Adds command-inventory, ACL smoke, exchange-options, and camelCase serde contract tests with coverage thresholds.
  • Windows CI runs plain cargo test (nextest hits an exe failure) and excludes the plugin lib from Windows runs; connected JNI tests stay local-only.
  • Replaces fixed sleeps with polling, covers the read/drain reclaim race, and clears pending waiters so harnesses exit cleanly.