Skip to content
Beskid Platform specification

Beskid

Jump to a Beskid service

Beskid

Jump to a Beskid service

Interop.Contracts — Conformance and versioning

Platform spec article

Interop.Contracts — Conformance and versioning

Spec standingStandard

Owner
Piotr Mikstacki
Submitter
Piotr Mikstacki

The platform publishes a monotonic runtime ABI version constant for the Rust runtime export surface (BESKID_RUNTIME_ABI_VERSION). An artifact must not load against a runtime that reports an incompatible version when linking builtins.

Implementation reference: compiler/crates/beskid_abi/src/version.rs and compiler/crates/beskid_tests/src/abi/contracts.rs.

User FFI (import layouts, interop views, export tables) is versioned separately — see User FFI layout band below. Bumping user FFI layouts must not require bumping BESKID_RUNTIME_ABI_VERSION unless a runtime export symbol or builtin signature changes.

The platform maintains a user FFI layout band for:

  • Interop view record layouts (CStringView, CBuffer, CArrayView).
  • Export/callback registration table header layout.
  • Optional future repr(C) rules (v0.3.1).

Toolchains should record the band in build metadata (for example manifest or artifact stamp) so linkers and hosts reject incompatible combinations. The reference constant name is reserved as BESKID_USER_FFI_LAYOUT_BAND (implementation may trail spec).

BandStandard content
v0.3.0Interop views, link-time import, export + callback registration
v0.3.1CLayout records with primitive fields only
v0.3.2+Proposed: nested FFI structs, foreign-thread entry

Interop.Contracts distinguishes:

  • Normative contracts — behavior and layouts the platform commits to for a given ABI version band.
  • Reserved extensions — symbol names or dispatch slots documented as internal or experimental; user code must not depend on them unless a feature explicitly promotes them to normative status.

When adding symbols or shapes, the platform should extend tables in beskid_abi with documentation in the Rust ABI profile before declaring user-visible stability.

A toolchain build conforms to Interop.Contracts if:

  1. Every emitted foreign call can be traced to an abstract call shape and symbol identity defined here or in a normative profile article.
  2. Runtime exports match the allowlisted symbol set for the declared ABI version.
  3. Diagnostics reject unsupported combinations (for example extern imports when the engine feature that resolves them is disabled).