Skip to main content

rite_model/
lib.rs

1//! Core domain model and IR for the Rite ceremony DSL.
2//!
3//! `rite-model` defines the Intermediate Representation (IR): the fully resolved
4//! ceremony data consumed by the executor. The YAML schema (parser input) lives in
5//! `rite-resolver`; this crate contains only the runtime-facing types.
6//!
7//! # Module structure
8//!
9//! - [`ir`]: IR types: [`Ceremony`], [`Step`], [`Role`], etc. and typed ID newtypes
10//! - [`expression`]: Expression parsing for `${artifact.name | sha256 | hex}` syntax
11//! - [`transcript`]: Persisted transcript schema (`StepFact` + friends)
12//! - [`safe_path`]: Confine untrusted, ceremony-derived names/paths to a directory
13//! - `types` (private): Shared semantic enums: [`ActionType`], [`DutyType`], etc.
14//!
15//! # `BackendConfig`
16//!
17//! Re-exported from `rite-sdk` for convenience. The canonical definition lives there.
18
19#![warn(missing_docs)]
20
21pub mod bip39;
22pub mod bundle;
23mod canonical;
24pub mod commitment;
25mod digest;
26pub mod display;
27pub mod expression;
28pub mod ir;
29
30mod material;
31pub mod paper32;
32pub mod params;
33pub mod safe_path;
34#[cfg(test)]
35mod schema;
36pub mod transcript;
37mod types;
38
39pub use rite_sdk::BackendConfig;
40
41pub use canonical::{CanonicalJsonError, canonical_json, check_numbers};
42pub use digest::{DigestFormatError, Sha256Digest};
43pub use material::MaterialSource;
44
45pub use safe_path::{PathSafetyError, confine, is_safe_component, safe_join, validate_component};
46
47pub use types::{
48    ActionType, BackendUsage, CertProfile, DutyType, ListInput, Metadata, OutputType,
49    ParameterType, ReadsContract, SharingScheme, UnknownCertProfile, UnknownSharingScheme,
50    derive_role_name, derive_step_name, role_type,
51};
52
53pub use ir::{
54    Act, ActId, ArtifactId, ArtifactRef, Ceremony, Material, MaterialId, MaterialKind, NamedInput,
55    Output, OutputId, ParamId, Parameter, PostCeremonyDuty, RetryPolicy, Role, RoleId, Section,
56    SectionId, Step, StepId, StepInputs, SymbolTable,
57};
58
59pub use display::{Layout, RevealFormat, TypedRow, TypedValue, UnknownRevealFormat};
60pub use transcript::{
61    ErrorClass, ErrorRecord, FACT_TYPES, FACT_VOCABULARY, Format, Level, PLACEHOLDER_LIMIT, Prompt,
62    ResponseRecord, Shown, StepFact, StepOutcome, TRANSCRIPT_FORMAT, TRANSCRIPT_SCHEMA,
63    TranscriptHeader, ValidatorSpec, compile_pattern,
64};