1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
//! Domain Entity Layer — persona-wire vocabulary as first-class entities.
//!
//! Sits on top of [`crate::domain::graph`] (Math backend SDK, the
//! tenant-agnostic graph primitives) and below the application layer.
//!
//! # Layer split
//!
//! - **Math backend** (`crate::domain::graph`) — open-vocabulary graph
//! primitives (Node / Edge / Specification / CRUD / Compute / Constraint /
//! AutoVersion / Repository). Tenant-agnostic, persona-agnostic. Owns no
//! domain knowledge of personas, slots, sources, or projections.
//! - **Domain Entity** (this module) — persona-wire's first-class vocabulary
//! (Persona / Slot / Source / Projection / Wiring / Workflow). Uses the
//! Math backend as a persistence SDK; the backend stays unaware of these
//! entities.
//!
//! # Composition
//!
//! ```text
//! Projection (Aggregate Root)
//! — rendering intent (template + spec_ref + plugin dispatch).
//! — the Wire's external OUT surface.
//!
//! Wiring (Entity)
//! ├ persona_id: PersonaId (natural composite key)
//! ├ slot: Slot (natural composite key)
//! ├ source: Source (directly owned)
//! └ projection_ref: Option<ProjectionName> (identity ref, Vernon Rule 3)
//!
//! Workflow (Entity)
//! ├ id: WorkflowId (surrogate)
//! ├ persona_id: Option<PersonaId>
//! ├ trigger: Trigger (OnDemand | OnEvent)
//! ├ action: Action (NoOp | EmitProjection { slots: Vec<Slot> })
//! └ enabled: bool
//! ```
//!
//! # Surface policy: Wire's OUT is `Projection`
//!
//! `Projection` is the only rendering surface exposed to application /
//! MCP callers. `Wiring` and `Workflow` are **internal vocabulary** —
//! they are not re-exported at this module root. Application code reading
//! raw `Wiring` / `Workflow` would bypass the rendering layer, so direct
//! access goes through the fully qualified
//! `crate::domain::entity::{wiring, workflow}` paths and is reserved for
//! entity-internal composition or a future Aggregate Root.
//!
//! # Persistence
//!
//! `Wiring` and `Workflow` are persisted through the existing Math backend
//! Repository (`Node` CRUD via [`crate::domain::graph`]). They do **not**
//! introduce a dedicated Registry / DTO / table. The Projection-specific
//! `ProjectionRegistry` (separate table + DTO + Mapper) is intentional —
//! Projection is the externally referenced rendering Aggregate Root, while
//! Wiring / Workflow live behind it as configuration data the Repository
//! pattern already handles.
pub use ;
pub use PersonaId;
pub use ;
pub use Slot;
pub use Source;
// `Wiring` / `Workflow` are intentionally NOT re-exported here. See the
// "Surface policy" section in the module docstring above.