lib

Core libraries for Radroots
git clone https://radroots.dev/git/lib.git
Log | Files | Refs | README

README.md (2631B)


      1 # Radroots native bindings
      2 
      3 This source owns the concrete UniFFI boundary over the current `radroots`
      4 client. Native app startup supplies its actual configured client and actual
      5 authenticated workspace through the Rust host constructors. Foreign input
      6 cannot create a grant, signer claim or delivery permission.
      7 
      8 Known input validation and command execution remain in shared Rust. The
      9 boundary owns language conversion, with exact identifiers and integer/decimal
     10 strings, explicit optional values and tagged business results. It does not
     11 implement a second command engine, storage adapter, signer or retry policy.
     12 
     13 Effectful command errors preserve the shared execution failure's actual code,
     14 retry class, original operation and admission. Optional `SignerRejection` carries
     15 a fixed reason and optional SHA-256 fingerprint with exact covered/total byte
     16 counts as canonical decimal strings. A prefix digest does not claim full
     17 coverage. No raw signer response or private input enters these diagnostics.
     18 Future unsupported reasons remain explicit, and unsupported state projection
     19 retains any bounded diagnostic. The generated error schema changes with this
     20 contract; source-owned Swift and Kotlin fixtures regenerate and execute it.
     21 
     22 Host injection is distinct from a general foreign-language open/enrollment
     23 factory, platform custody and callback qualification. These additional surfaces
     24 must be implemented and exercised before they are advertised. This package is
     25 not a compatibility wrapper for `radroots_sdk_ffi`.
     26 
     27 Lib's private `xtask` tooling owns the `radroots_ffi_bindgen` executable. It
     28 pins UniFFI0.32.2 and applies
     29 the `radroots-close-v1` Kotlin generation policy. When the actual native
     30 metadata declares `close`, generated `close` calls that method; the conflicting
     31 automatic AutoCloseable destruction alias is omitted. `destroy` remains the
     32 explicit generated handle-release operation. It is not asynchronous resource
     33 closure. Other generated objects retain their ordinary AutoCloseable behavior.
     34 Generation fails if the expected upstream template shape changes. Outputs are
     35 produced in staging and must use a new output directory and `--no-format`.
     36 
     37 The `radroots-swift-cancellation-v1` policy also connects Swift task cancellation
     38 to the existing Rust-future cancel ABI and converts its cancelled status into
     39 `CancellationError`. A synchronized lifetime owner prevents cancellation from
     40 using a released handle. Already-cancelled calls refuse before creating a Rust
     41 future. Cancellation ends observation; the shared runtime retains admitted
     42 work and obtained material. No command lifecycle is implemented in Swift.