Expand description
§pointlock-provider-devicerail
The DeviceRail implementation of the Pointlock provider SPI (design doc 04 §9; spine §4). The provider is a capability declaration plus faithful execution — it never folds, translates, improvises, retries, or degrades (04 §1):
DeviceRailProvider: staticdevicerail_manifest+ the atomicopenSessionsequence (spawn →system.hello→devices.list→device.select→device.connect→device.capabilities→ attestation →session.start, 04 §9.3) with lockfile-digest attestation (04 §9.2).DeviceRailSession: the tenProviderSessionmethods over one exclusively-owneddevicerail-clientconnection.lock_via_spawn/make_lockfile: thepointlock lockfreeze path (CLI wiring follows).
Wire names follow spine A.8 verbatim; DTO transcription is
field-by-field (convert); error normalization implements the 04 §6 /
§9.6 tables (error_map).
§Documented divergences and gaps (honesty over fabrication)
fetchEvidenceis a typed unsupported error: DeviceRail asset URIs (devicerail://assets/sha256/<digest>) have no byte channel on the control plane anddevicerail-clientexposes no fetch API.PlatformKindhas nomockcounterpart; the mock platform maps provisionally tolinuxon both the lock and attestation paths (seeconvert::platform_kind_from_wire).- Client-side backpressure errors surface directly as
transport_lost(04 §9.6 envisions provider-internal queueing; M1 has none). - The spawn exit protocol’s SIGTERM step is collapsed into the client’s kill path (stdin EOF → grace → kill).
Structs§
- Device
Rail Provider - The DeviceRail provider. Holds the capability lockfile the flow was
compiled against;
open_sessionre-attests the live world against it. - Device
Rail Session - One open DeviceRail session (see the module docs).
- Spawn
Spec - The spawn endpoint form: Pointlock owns the daemon process.
Constants§
- DEFAULT_
DAEMON_ COMMAND - Default daemon command, resolved through
PATH(04 §9.1). - DEFAULT_
SHUTDOWN_ GRACE_ MS - Default shutdown grace before the daemon child is killed (04 §9.1).
- DRIVER_
ERROR_ RPC_ CODE - The daemon’s numeric JSON-RPC code for driver-layer failures of
device.execute(DeviceRail daemonDRIVER_ERROR). A driver failure is appended to the session log as anactionCompletedfailedterminal before the RPC error is returned (durable-terminal shield), so this code is the wire discriminator between “the action reached the driver and failed” (a definitefailedterminal) and “the request never entered action execution” (a ProviderError). - INFRA_
REQUIRED_ FEATURES - Provider-infrastructure features (04 §9.2 ★ rows): preconditions of this
provider’s execution model itself, flow-independent, always placed in
FeatureOffer.required. - OFFERED_
OPTIONAL_ FEATURES - Every non-infrastructure feature this provider offers in
system.hello. The full known universe is always offered (required ∪ optional covers it), soFeatureSelection.enabled— and therefore the lockfile digest — depends only on the daemon, never on which flow triggered the handshake.action.protected.v1is deliberately absent: v0.1 does not offer and does not consume it (04 §9.2). - PROVIDER_
NAME - The v0.1 provider name (04 §8 assembly ruling: constant
devicerail).
Functions§
- classify_
remote_ rpc - Classifies a JSON-RPC envelope error (04 §6.2 priority rows 1–2 first, then the action-layer table).
- classify_
wire_ code - Maps one action-layer wire error code to the closed
ErrorClass(04 §6.2 / §9.6; the wire code set is open — unknown codes fall through on the daemon’s declaredretryablebit). - devicerail_
manifest - The DeviceRail provider manifest (built once, shared).
- execute_
terminal_ from_ rpc - Extracts a definite four-way terminal from a
device.executeRPC failure, when the wire fact is one (04 §9.6). - lock_
via_ spawn - Runs the
pointlock lockwire sequence against a freshly spawned daemon and freezes the outcome into a sealedCapabilityLockfile(04 §10.2; CLI wiring lands withpointlock lock). - lock_
via_ spawn_ at lock_via_spawnwith a caller-pinnedattestedAt. The digest domain already excludesattestedAt(spine §4.1, 04 §10.2), so pinning is never needed for digest stability — it remains useful only for byte-identical lockfile artifacts / pinned provenance in fixtures.- lockfile_
provider_ identity - The provider identity this crate stamps into fresh lockfiles.
- make_
lockfile - Builds a sealed
CapabilityLockfilefrom one live handshake + device-capabilities outcome. This is thepointlock lockfreeze path and — withprovider/attested_attaken from the held baseline — the attestation re-synthesis path. - provider_
error_ from_ client - Builds the unified
ProviderErrorcarrier from adevicerail-clientfailure (04 §9.6 “client” rows; class names follow the Rust client crate per the R12 note).