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
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
//! THE SEAT THE EMITTED ROOT PROJECTION LANDS ON.
//!
//! [`Attributes`](crate::Attributes) has always been the seam a node's root projection arrives
//! through, and its own note has always said where the projection comes from: *a field access on
//! the record's declared key, which an emitted wrapper writes*. This is that wrapper.
//!
//! # The wrapper is the FRAMEWORK's and the impl is the RECORD's
//!
//! A record declaration is the only place that knows a record's root — the key is `lineage ⊕ id`,
//! flat and root-first, so the root is the key's FIRST column and the derive has it. But the
//! `Attributes` trait is this crate's, so an impl of it has to name something local to the crate
//! that writes it. [`RootProjection<T>`] is what makes the pair legal: the emitted impl is
//! `impl Attributes<Keyframe> for RootProjection<Keyframe>`, whose self type carries the local
//! record, so a declaring crate may write it without owning either the trait or the wrapper.
//!
//! ```ignore
//! // emitted beside a record's other impls, from its own `lineage(…)` declaration:
//! impl ::ingraph::Attributes<Keyframe> for ::ingraph::RootProjection<Keyframe> {
//! const FAMILY: &'static str = "media";
//! type Root = MediaId;
//! fn root(&self, record: &Keyframe) -> MediaId { ::core::clone::Clone::clone(&record.media) }
//! fn observe(&self, _: &MediaId, _: &::ingraph::NodeName, _: &::ingraph::Arrival) {}
//! }
//! ```
//!
//! # IT CARRIES NOTHING, and that is the design rather than an omission
//!
//! A projection is a COMPILE-TIME fact — which column of which type a record descends from — so the
//! value has nothing to hold and is zero-sized. The registry the counts go to is the RESIDENT's,
//! reached through [`Resident::registries`](crate::Resident::registries), and joining the two is
//! the counting knife's act: this one only has to make the root nameable.
//!
//! `observe` is therefore the empty program here. That is not a stub standing in for a call — it is
//! the honest state of a projection whose counting has not been wired yet, and it is the same empty
//! program [`Attributes for ()`](crate::Attributes) already ships.
//!
//! # WHAT INSTALLS IT, and where the word for it lives
//!
//! [`Declared::Attribution`](crate::Declared::Attribution) — a seat on the NODE's own declaration,
//! written by the `attributed` word — and [`Wiring::resident`](crate::Wiring::resident) is what
//! spends it, on every buffered node it wires and with no branch of its own.
//!
//! It had to be the declaration's, and the reason is worth keeping because it is what the shape
//! answers. A per-node install written by the GRAPH expansion cannot work: that expansion sees a
//! node's output only as the TYPE `<Cell<N> as Mount<N>>::Out` and cannot ask whether that type is
//! a declared record at all — there is no specialization to branch on and an autoref probe dies on
//! an associated-type projection — while a great many nodes' outputs are not records (a `String`, a
//! `u64`, a `()`), so an unconditional `.attributing(RootProjection::<Out>::new())` written THERE
//! would refuse to compile for every one of them. The party that knows is the node's own
//! declaration, which is the party the word is written on; the seat is how the answer crosses to a
//! root that cannot read those tokens, exactly as [`Declared::Pair`](crate::Declared::Pair) and
//! [`Declared::Wires`](crate::Declared::Wires) already do for their own facts.
//!
//! So the install is unconditional and the BRANCH is the seat: `attributed` seats
//! `RootProjection<O>` and silence seats `()`, whose [`Attributes`](crate::Attributes) impl is the
//! empty program and whose value is zero-sized. A word written over an output no record declared is
//! `E0277` at the mount, naming the payload.
//!
//! [`Resident::attributing`](crate::Resident::attributing) stays public beside it, and it is the
//! road for the attribution that carries STATE — a journal writer, a queue, a handle — which no
//! walk can mint from a type. Such a deployment seats `()` and attaches its own, replacing what the
//! seat installed.
//!
//! # WHAT IS STILL NOT HERE, and it is a ward rather than a line
//!
//! Nothing refuses a node that **lands record rows and wears no attribution**. Such a declaration
//! is legal and silent: its rows reach a store, its observations stay counter-grade, and no
//! sentence anywhere says the two facts disagree. The launch floor is where that check would live —
//! it already refuses the node that claims durability and performs none
//! ([`Refusal::LandsNowhere`](crate::Refusal::LandsNowhere)) — and this would be its sibling, read
//! off [`Declared::EFFECT`](crate::Declared::EFFECT) beside the seat. It is a candidate for a later
//! knife rather than an omission from this one: whether an unattributed landing is a MISTAKE or an
//! ordinary posture is a ruling, and a refusal shipped before that ruling would refuse deployments
//! that are working.
use PhantomData;
/// The value an emitted root projection is written on — zero-sized, and see the
/// [module note](self) for why.
>);
/// Written rather than derived, for the reason [`Registry`](super::Registry)'s is: a derived one
/// would carry `T: Debug`, and `T` is a NAME here rather than a value — the marker is
/// `PhantomData<fn(&T)>`, which owns nothing and prints nothing.
/// `fn(&T)` is what makes both derivable without a bound on `T`, and it is chosen for that: the
/// marker carries no ownership, no drop obligation and none of `T`'s own auto traits, exactly as
/// [`App`](crate::App)'s own root marker does.