Skip to content

feat(truapi-server): add platform runtime and host bridge#250

Open
pgherveou wants to merge 47 commits into
mainfrom
rust-core/03-server-runtime
Open

feat(truapi-server): add platform runtime and host bridge#250
pgherveou wants to merge 47 commits into
mainfrom
rust-core/03-server-runtime

Conversation

@pgherveou

@pgherveou pgherveou commented Jun 30, 2026

Copy link
Copy Markdown
Collaborator

Summary

Adds the Rust server runtime layer for product-host execution: product runtime state, session/auth orchestration, SSO pairing/signing flows, chain/preimage/statement-store plumbing, subscriptions, and host-core dispatch integration.

This layer also fixes the runtime permission/lifecycle issues found during review:

  • remote chain/preimage/statement submit paths require product-scoped permission before backend calls
  • get_user_id requires cached identity-disclosure consent
  • login single-flight state is cleared if pairing is aborted
  • runtime disposal cancels active subscriptions
  • permission state is documented with an ASCII product-to-host flow diagram

Stack

Part of the Rust core runtime port umbrella #104. Full port sequence:

  1. feat(truapi): add testing API and versioned wiring #248 - layer 1/9, merged historical: truapi testing API and versioned wiring.
  2. feat(truapi-platform): add host capability traits #249 - layer 2/9, merged historical: truapi-platform host capability traits.
  3. feat(truapi-codegen): emit Rust dispatcher, wire table, and host callbacks #254 - layer 3/9, merged historical: codegen Rust dispatcher, wire table, and host callbacks.
  4. feat(truapi-server): add host logic primitives #255 - layer 4/9, merged historical: server host logic primitives.
  5. feat(truapi-server): add wire and chain infrastructure #256 - layer 5/9, merged historical: server wire and chain infrastructure.
  6. 👉 feat(truapi-server): add platform runtime and host bridge #250 - active layer 1/4: server runtime, permissions, lifecycle, and permission-flow docs. This PR.
  7. feat(codegen): generate wasm bridge callbacks #265 - active layer 2/4: generic wasm bridge/codegen layer.
  8. feat(host-wasm): add @parity/truapi-host-wasm runtime #252 - active layer 3/4: @parity/truapi-host-wasm namespaced callback consumer.
  9. chore: docs, CI, tooling, and dotli integration for the Rust core #253 - active layer 4/4, top: docs, CI/tooling, playground, and dotli integration.

Active child #253 is kept tree-equivalent with umbrella #104.

Validation

  • cargo fmt --all --check
  • cargo check -p truapi-server
  • cargo test -p truapi-codegen golden_host_callbacks_ts
  • cargo test -p truapi-server

Adds the canonical testing module (api/testing.rs) and its v01/v02/versioned
wiring used by the Rust host runtime and generated clients.
@pgherveou pgherveou force-pushed the rust-core/03-server-runtime branch from b7c0a12 to c28f271 Compare July 1, 2026 06:39
@pgherveou pgherveou force-pushed the rust-core/02-platform-traits branch from df4a0ba to 1a7d349 Compare July 1, 2026 06:39
@pgherveou pgherveou force-pushed the rust-core/03-server-runtime branch from c28f271 to 71a3f71 Compare July 1, 2026 08:14
@pgherveou pgherveou changed the base branch from rust-core/02-platform-traits to rust-core/04-codegen July 1, 2026 08:17
@pgherveou pgherveou force-pushed the rust-core/03-server-runtime branch from 71a3f71 to 195a6b7 Compare July 1, 2026 09:26
@pgherveou pgherveou changed the base branch from rust-core/04-codegen to rust-core/04b-server-wire-chain July 1, 2026 09:27
@pgherveou pgherveou changed the title feat(truapi-server): add Rust host runtime feat(truapi-server): add platform runtime and host bridge Jul 1, 2026
@pgherveou pgherveou force-pushed the rust-core/03-server-runtime branch from 195a6b7 to 538cb2e Compare July 1, 2026 20:38
@pgherveou pgherveou force-pushed the rust-core/04b-server-wire-chain branch from 4567da7 to 26cc238 Compare July 1, 2026 20:38
@pgherveou pgherveou force-pushed the rust-core/03-server-runtime branch from 538cb2e to 3e7a360 Compare July 1, 2026 21:23
@pgherveou pgherveou force-pushed the rust-core/04b-server-wire-chain branch from 26cc238 to 937d576 Compare July 1, 2026 21:23
pgherveou added 2 commits July 2, 2026 10:10
New crate defining the host syscall traits (storage, navigation, consent,
permissions, ...) that host runtimes implement. Types are re-exported from
truapi::versioned/v01 rather than redefined.
@pgherveou pgherveou force-pushed the rust-core/04b-server-wire-chain branch from 2a75bee to e4d9a0d Compare July 3, 2026 15:32
@pgherveou pgherveou force-pushed the rust-core/03-server-runtime branch from b0c161b to 7ac562a Compare July 3, 2026 15:32
Base automatically changed from rust-core/04b-server-wire-chain to main July 3, 2026 20:49
@pgherveou pgherveou requested a review from a team July 3, 2026 20:49
pgherveou added 4 commits July 3, 2026 22:53
Gate identity disclosure and remote submit paths through product-scoped permission state, and cancel pending lifecycle work on abort/dispose.
Comment on lines +318 to +319
/// Product-scoped permission to disclose the user's primary identity.
IdentityDisclosure,

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Temp, maybe we should not add it right now and define it in an RFC first.
cc @filvecchiato what do you think

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