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 bundle;
22mod canonical;
23pub mod commitment;
24mod digest;
25pub mod expression;
26pub mod ir;
27mod material;
28pub mod params;
29pub mod safe_path;
30#[cfg(test)]
31mod schema;
32pub mod transcript;
33mod types;
34
35pub use rite_sdk::BackendConfig;
36
37pub use canonical::{CanonicalJsonError, canonical_json, check_numbers};
38pub use digest::{DigestFormatError, Sha256Digest};
39pub use material::MaterialSource;
40
41pub use safe_path::{PathSafetyError, confine, is_safe_component, safe_join, validate_component};
42
43pub use types::{
44    ActionType, BackendUsage, CertProfile, DutyType, ListInput, Metadata, OutputType,
45    ParameterType, ReadsContract, SharingScheme, UnknownCertProfile, UnknownSharingScheme,
46    derive_role_name, derive_step_name, role_type,
47};
48
49pub use ir::{
50    Act, ActId, ArtifactId, ArtifactRef, Ceremony, Material, MaterialId, MaterialKind, NamedInput,
51    Output, OutputId, ParamId, Parameter, PostCeremonyDuty, RetryPolicy, Role, RoleId, Section,
52    SectionId, Step, StepId, StepInputs, SymbolTable,
53};
54
55pub use transcript::{
56    ErrorClass, ErrorRecord, FACT_TYPES, FACT_VOCABULARY, Format, Level, PLACEHOLDER_LIMIT, Prompt,
57    ResponseRecord, StepFact, StepOutcome, TRANSCRIPT_FORMAT, TRANSCRIPT_SCHEMA, TranscriptHeader,
58    ValidatorSpec, compile_pattern,
59};