Skip to main content

trellis_core/
lib.rs

1//! Core graph skeleton for Trellis.
2//!
3//! This crate currently defines typed identities, graph metadata, scope
4//! metadata, declared dependencies, deterministic inspection, input
5//! transactions, pure derived node recomputation, collection diffs, and
6//! data-only resource plans with recursive scope teardown and materialized
7//! output frames. Transaction results include deterministic phase traces, and
8//! failures expose typed categories.
9//!
10//! # API stability
11//!
12//! Trellis is pre-1.0. Core semantics are intended to be more stable than item
13//! names and exact signatures: resource plans are data, graph mutation is
14//! transactional, dependencies are explicit, scopes own lifecycle, outputs are
15//! revisioned, and incremental behavior must remain checkable against full
16//! recompute.
17
18#![forbid(unsafe_code)]
19#![deny(missing_docs)]
20
21mod audit;
22mod audit_types;
23mod collection;
24mod collection_build;
25mod collection_diff;
26mod collection_recompute;
27mod collection_storage;
28mod debug;
29mod dependency;
30mod dependency_validate;
31mod derive;
32mod error;
33mod graph;
34mod graph_support;
35mod host_status;
36mod ids;
37mod input;
38mod model;
39mod node;
40mod oracle;
41mod output;
42mod output_build;
43mod output_frame;
44mod output_payload;
45mod output_reconcile;
46mod read;
47mod resource;
48mod resource_build;
49mod resource_key;
50mod resource_reconcile;
51mod scope;
52mod scope_lifecycle;
53mod topology;
54mod trace;
55mod transaction;
56mod transaction_build;
57mod transaction_trace_build;
58mod transaction_types;
59
60pub(crate) use audit_types::AuditState;
61pub use audit_types::{
62    NodeChangeExplanation, OutputFrameExplanation, ResourceCoalescedTrace, ResourceCommandCause,
63    ResourceCommandExplanation, ScopeResourceInventory,
64};
65pub use collection::CollectionContext;
66pub use collection_diff::{Added, MapDiff, Removed, SetDiff, Unchanged, Updated};
67pub use dependency::DependencyList;
68pub use derive::{DeriveContext, DeriveError};
69pub use error::{
70    ErrorAuditEvent, ErrorCategory, ErrorTarget, FullRecomputeOutputMismatch,
71    FullRecomputeResourceMismatch, GraphError, GraphResult, OutputError, PlanError,
72    ResourcePayloadConflict,
73};
74pub use graph::Graph;
75pub use host_status::{
76    HostResourceCommandState, HostResourceOutcome, HostResourceStatus, HostStatusClass,
77    classify_host_resource_status,
78};
79pub use ids::{NodeId, OutputKey, Revision, ScopeId, TransactionId};
80pub use node::{CollectionNode, DerivedNode, InputNode, NodeHandle, NodeKind, NodeMeta};
81pub use oracle::FullRecomputeCheck;
82pub use output::{MaterializedOutput, OutputContext, OutputMeta, OutputOptions};
83pub use output_frame::{ClearReason, OutputFrame, OutputFrameKind, RebaselineReason};
84pub use output_payload::OutputPayload;
85pub use resource::{PlanContext, ResourceCommand, ResourcePlan};
86pub use resource_key::ResourceKey;
87pub use scope::ScopeMeta;
88pub use trace::{
89    OutputFrameKindTrace, OutputFrameTrace, ResourceCommandKind, ResourceCommandTrace,
90    TraceMismatch, TransactionTrace, assert_transaction_traces_match,
91};
92pub use transaction::Transaction;
93pub use transaction_types::{
94    AuditEntry, AuditEvent, AuditExplanationLevel, CollectionDiffKind, CollectionDiffTrace,
95    InvariantResultTrace, ScopeLifecycleKind, ScopeLifecycleTrace, StagedInputChange,
96    StagedInputOutcome, TransactionOptions, TransactionPhase, TransactionResult,
97};
98
99/// Deterministic model-test helpers for oracle and replay checks.
100pub mod testing {
101    pub use crate::model::{ModelGenerator, ModelScript, ModelStep, ModelTopology};
102}