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
80
81
82
83
84
85
86
87
88
//! `ContextWiring` — per-persona Composition Root (Aggregate Root identity).
//!
//! Marks the consistency boundary for one persona's context (its
//! [`crate::domain::entity::wiring::Wiring`] set and
//! [`crate::domain::entity::workflow::Workflow`] set). The boundary is
//! represented by [`PersonaId`] alone — there is exactly one
//! `ContextWiring` per persona, no surrogate id.
//!
//! # Skinny by design
//!
//! `ContextWiring` does **not** hold `Vec<Wiring>` / `Vec<Workflow>` in
//! memory. The wirings and workflows that belong to a persona live in the
//! Math backend graph (`Node` rows of type `outline_node` / `workflow_def`)
//! and are reached through the Repository (`crate::domain::graph`) when a
//! caller actually needs them. The Aggregate Root only carries the identity
//! that says "these are the rows that move together as one consistency
//! unit".
//!
//! This is a deliberate choice. Holding an in-memory `Vec<Wiring>` would
//! force load / mutate / save round-trips for every change and pull the
//! Aggregate into operations that don't need transactional consistency.
//! Today no application call site requires multi-`Wiring` atomic updates;
//! batch operations are explicitly non-atomic at the application surface.
//! Until such a requirement appears, the Aggregate Root stays an identity
//! marker — invariant-checking methods, atomic multi-wiring updates, and
//! collection ownership are deferred and added when they are actually
//! needed.
//!
//! # Surface
//!
//! Not re-exported at the entity module root. The Wire's external surface
//! is [`Projection`]; the Aggregate Root is internal vocabulary, used by
//! entity-layer composition (today) and by future application code that
//! needs an explicit consistency-boundary handle.
//!
//! [`PersonaId`]: crate::domain::entity::persona_id::PersonaId
//! [`Projection`]: crate::domain::entity::projection::Projection
use cratePersonaId;
/// Per-persona Composition Root.
///
/// Identity-only Aggregate Root. See the [module docs](self) for why it
/// does not hold an in-memory `Vec<Wiring>` / `Vec<Workflow>`.