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;
38pub mod validate;
39
40pub use rite_sdk::BackendConfig;
41
42pub use canonical::{CanonicalJsonError, canonical_json, check_numbers};
43pub use digest::{DigestFormatError, Sha256Digest};
44pub use material::MaterialSource;
45
46pub use safe_path::{PathSafetyError, confine, is_safe_component, safe_join, validate_component};
47
48pub use types::{
49    ActionType, BackendUsage, CertProfile, DutyType, ListInput, Metadata, OutputType,
50    ParameterType, ReadsContract, SharingScheme, UnknownCertProfile, UnknownSharingScheme,
51    derive_role_name, derive_step_name, role_type,
52};
53
54pub use ir::{
55    Act, ActId, ArtifactId, ArtifactRef, Ceremony, Material, MaterialId, MaterialKind, NamedInput,
56    Output, OutputId, ParamId, Parameter, PostCeremonyDuty, RetryPolicy, Role, RoleId, Section,
57    SectionId, Step, StepId, StepInputs, SymbolTable,
58};
59
60pub use display::{Layout, RevealFormat, TypedRow, TypedValue, UnknownRevealFormat};
61pub use transcript::{
62    ErrorClass, ErrorRecord, FACT_TYPES, FACT_VOCABULARY, Format, Level, PLACEHOLDER_LIMIT, Prompt,
63    ResponseRecord, Shown, StepFact, StepOutcome, TRANSCRIPT_FORMAT, TRANSCRIPT_SCHEMA,
64    TranscriptHeader, ValidatorSpec, compile_pattern,
65};