ferrify_domain/lib.rs
1//! Core domain types for Ferrify.
2//!
3//! `agent-domain` is the vocabulary crate for the rest of the workspace. It
4//! defines the value objects, planning records, policy types, provenance
5//! labels, and reporting structures that let Ferrify describe a governed
6//! software-change run without reaching into filesystem or process concerns.
7//!
8//! The main design goal is to keep meaning-bearing concepts explicit. A path
9//! that must stay inside the repository is represented by [`RepoPath`], not a
10//! raw `String`. A mode identifier is a validated [`ModeSlug`], not a free-form
11//! label. The result is a control plane that can encode authority and scope in
12//! the type system before any command is run.
13//!
14//! # Core Concepts
15//!
16//! - [`PolicyLayer`], [`TrustLevel`], and [`Capability`] describe who may do
17//! what, and why.
18//! - [`ChangeIntent`], [`ChangePlan`], and [`PatchPlan`] carry work from intake
19//! into a bounded implementation strategy.
20//! - [`InputRole`] and [`ClassifiedInput`] explain how Ferrify separates
21//! operator goals, repository policy, code, evidence, and untrusted text.
22//! - [`FinalChangeReport`] and [`ValidationReceipt`] make reporting
23//! evidence-backed instead of speculative.
24//!
25//! # Examples
26//!
27//! ```
28//! use agent_domain::{ModeSlug, RepoPath, TrustLevel};
29//!
30//! # fn main() -> Result<(), agent_domain::DomainTypeError> {
31//! let target = RepoPath::new("crates/agent-cli/src/main.rs")?;
32//! let mode = ModeSlug::new("architect")?;
33//!
34//! assert_eq!(target.as_str(), "crates/agent-cli/src/main.rs");
35//! assert_eq!(mode.as_str(), "architect");
36//! assert!(TrustLevel::RepoPolicy.can_define_policy());
37//! # Ok(())
38//! # }
39//! ```
40
41mod change;
42mod policy;
43mod provenance;
44mod report;
45mod types;
46
47pub use change::{
48 ApiImpact, BlastRadius, ChangeIntent, ChangePlan, EvidenceRequirement, OutcomeSpec,
49 PatchAnchor, PatchBudget, PatchPlan, RiskItem, RiskLevel, ScopeBoundary, ScopeItem,
50 SemanticConcern, TaskKind, VerificationKind, VerificationPlan,
51};
52pub use policy::{
53 ApprovalRule, Capability, DependencyPolicy, EffectivePolicy, PathPattern, PolicyLayer,
54 ReportingPolicy, TrustLevel, ValidationMinimums,
55};
56pub use provenance::{ClassifiedInput, InputRole};
57pub use report::{
58 ArtifactRef, Assumption, ChangeStatus, ChangeSummary, FinalChangeReport, TouchedArea,
59 ValidationReceipt, VerificationStatus,
60};
61pub use types::{ApprovalProfileSlug, DomainTypeError, ModeSlug, RepoPath};