Skip to main content

pointlock_provider_devicerail/
lib.rs

1//! # pointlock-provider-devicerail
2//!
3//! The DeviceRail implementation of the Pointlock provider SPI
4//! (design doc 04 §9; spine §4). The provider is a capability declaration
5//! plus faithful execution — it never folds, translates, improvises,
6//! retries, or degrades (04 §1):
7//!
8//! - [`DeviceRailProvider`]: static [`devicerail_manifest`] + the atomic
9//!   `openSession` sequence (spawn → `system.hello` → `devices.list` →
10//!   `device.select` → `device.connect` → `device.capabilities` →
11//!   attestation → `session.start`, 04 §9.3) with lockfile-digest
12//!   attestation (04 §9.2).
13//! - [`DeviceRailSession`]: the ten `ProviderSession` methods over one
14//!   exclusively-owned `devicerail-client` connection.
15//! - [`lock_via_spawn`] / [`make_lockfile`]: the `pointlock lock` freeze
16//!   path (CLI wiring follows).
17//!
18//! Wire names follow spine A.8 verbatim; DTO transcription is
19//! field-by-field (`convert`); error normalization implements the 04 §6 /
20//! §9.6 tables (`error_map`).
21//!
22//! ## Documented divergences and gaps (honesty over fabrication)
23//!
24//! - `fetchEvidence` is a typed unsupported error: DeviceRail asset URIs
25//!   (`devicerail://assets/sha256/<digest>`) have no byte channel on the
26//!   control plane and `devicerail-client` exposes no fetch API.
27//! - `PlatformKind` has no `mock` counterpart; the mock platform maps
28//!   provisionally to `linux` on both the lock and attestation paths (see
29//!   `convert::platform_kind_from_wire`).
30//! - Client-side backpressure errors surface directly as `transport_lost`
31//!   (04 §9.6 envisions provider-internal queueing; M1 has none).
32//! - The spawn exit protocol's SIGTERM step is collapsed into the client's
33//!   kill path (stdin EOF → grace → kill).
34
35mod budget;
36mod convert;
37mod endpoint;
38mod error_map;
39mod lock;
40mod manifest;
41mod provider;
42mod scan;
43mod session;
44
45pub use endpoint::{DEFAULT_DAEMON_COMMAND, DEFAULT_SHUTDOWN_GRACE_MS, SpawnSpec};
46pub use error_map::{
47    DRIVER_ERROR_RPC_CODE, classify_remote_rpc, classify_wire_code, execute_terminal_from_rpc,
48    provider_error_from_client,
49};
50pub use lock::{lockfile_provider_identity, make_lockfile};
51pub use manifest::{
52    INFRA_REQUIRED_FEATURES, OFFERED_OPTIONAL_FEATURES, PROVIDER_NAME, devicerail_manifest,
53};
54pub use provider::{DeviceRailProvider, lock_via_spawn, lock_via_spawn_at};
55pub use session::DeviceRailSession;