pointlock_provider_kit/lib.rs
1//! # pointlock-provider-kit
2//!
3//! The Provider SPI of Pointlock (spine §4; 04 §1–§8): the authoritative
4//! in-process Rust trait form of `Provider` / `ProviderSession` (a stdio
5//! JSON-RPC sidecar adapter form is reserved for v0.2), the static
6//! capability declaration types (`ProviderManifest`, `CapabilityLockfile`,
7//! `CapabilityAttestation`), the unified [`ProviderError`] carrier, the
8//! deterministic programmable [`FakeProvider`], and the provider
9//! [`conformance`] suite every implementation must pass before the CLI
10//! assembles it.
11//!
12//! Authoritative design documents:
13//! - `docs/design/00-architecture-spine.md` §4 (SPI TS signatures, the
14//! canonical notation this crate renders into Rust), §5 (error taxonomy)
15//! - `docs/design/04-provider-interface-and-devicerail.md` §1–§8 (contract
16//! clauses, error normalization, timeout/cancellation, conformance)
17//!
18//! Shared runtime DTOs (`ActionOutcome`, `ActionResult`, `ReconcileResult`,
19//! `ErrorInfo`, `Observation`, `AssetRef`, …) are defined in `pointlock-ir`
20//! (type truth source, R12) and re-exported here for one-stop SPI imports.
21//!
22//! ## Serde discipline
23//!
24//! Wire shape is camelCase (`rename_all`) with closed objects
25//! (`deny_unknown_fields`); type, field and enum-literal spellings follow
26//! spine Appendix A verbatim (error classes stay snake_case by decree).
27//! M0 iron law: the public contract *shapes* here are final; contents may
28//! still be narrow (each narrowing carries a pending-incorporation note).
29
30pub mod conformance;
31pub mod error;
32pub mod fake;
33pub mod lockfile;
34pub mod manifest;
35pub mod spi;
36
37pub use conformance::{
38 CheckResult, CheckStatus, ConformanceOptions, ConformanceReport, run_conformance,
39};
40pub use error::{ProviderError, RetryableSource};
41pub use fake::{FakeHandle, FakeProvider, FakeProviderSession, ScriptedOutcome};
42pub use lockfile::{
43 CapabilityAttestation, CapabilityLockfile, LOCKFILE_DIGEST_DOMAIN_TAG, LockfileDevice,
44 LockfileHello, LockfileProvider, PeerInfo, ProtocolVersion, lockfile_digest,
45};
46pub use manifest::{
47 ActionDefinitionStatic, ActionProtection, ChannelRole, ChannelSupport, ConditionalFeature,
48 FeatureDeclarations, PlatformKind, ProtocolRange, ProviderManifest, VerbBinding,
49};
50pub use spi::{
51 BoundActionCall, CancellationToken, EvidenceStream, ObserveRequest, ObserveWant,
52 OpenSessionOptions, Provider, ProviderSession, SessionHealth, SessionOutcome,
53 UiSnapshotOutcome, VERDICT_EVIDENCE_MAX_ENTRIES, VERDICT_SUMMARY_MAX_CHARS, VerdictWrite,
54 now_ms, observation_projection, synthetic_observation_wants,
55};
56
57// Shared runtime wire types (defined in `pointlock-ir`, spine R12).
58pub use pointlock_ir::{
59 ActionExecution, ActionOutcome, ActionResult, AssetRef, ErrorClass, ErrorInfo, EventCursor,
60 Observation, ReconcileResult, UiContextRef, UiNodeRef, UiSnapshotRef, Verdict, Viewport,
61};