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
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
//! The move record: [`Metathesis`] and [`Metatheses`] (PRD 0022, stage C
//! of the structured document horizon, the reorder half).
//!
//! A *metathesis* is one movement testimony. It places an existing `target`
//! at a new [`Locus`] without changing the target dot. The name is the
//! grammarians' own for transposition, and it
//! carries the design's one load-bearing idea: *a move is a second placement
//! testimony for an existing identity*, exactly the `(dot, locus)` shape a
//! weave already records, never a delete-plus-reinsert that forks it.
//! `Metatheses` is the store of them, under the survivor law.
//!
//! The hazard this closes is the field-pinned identity fork: compose a move
//! as delete-plus-reinsert and a concurrent edit lands on the deleted
//! identity, converging stranded at the old slot. With movement as testimony
//! the identity survives, so an edit anchored to the moved element follows
//! it. The read that resolves placement is
//! [`Rhapsody::recension`](crate::metis::Rhapsody::recension).
//!
//! # The record never chooses
//!
//! This store is *record*, not decision. It remembers every testimony that
//! survives the survivor law, and the winner among conflicting moves is
//! decided only in the recension read, by the fixed public rank order the
//! delivery buffer already uses.
//!
//! Because that read is a pure function of converged state rather than an
//! operation log, retracting a testimony is lawful and useful: an
//! observed-remove of a move's dot *undoes the move* everywhere,
//! convergently.
//!
//! # The recipes
//!
//! A `Metatheses` behaves exactly like the payload store it carries
//! (`DotFun<Metathesis>`), so the register recipes apply verbatim, in a
//! causal pair parallel to the text's (the Scholia precedent):
//!
//! * *Move an element*: mint the testimony through the facade, rank from
//! the mover's clock, outranking the target's current effective bucket
//! the same way a visual insert does:
//! `composer.compose(|dot| (Metatheses::singleton(dot, metathesis),
//! DotSet::new()))`.
//! * *Move it again*: just another testimony; the highest-rank surviving,
//! non-refused testimony for a target wins in the read. To keep the
//! record tidy, supersede your own earlier moves of that target
//! (`moves_of(target)` is the supersede set) through `compose_super`.
//! * *Undo a move*: `composer.retract` of the testimony's dot; earlier
//! surviving testimonies (or the birth placement) take over in the read.
extern crate alloc;
use Locus;
use ;
use crateRawDot;
pub use ;
/// One movement testimony: an existing element re-placed by identity.
///
/// `target` is the moved element's dot (its identity preserved) and `to`
/// is where it now hangs, a fresh [`Locus`]: the new anchor, and the rank
/// that both orders it among its new siblings and timestamps the move in
/// the recension's replay.
///
/// A metathesis is immutable under its own dot (content follows the dot,
/// axis law 3): re-moving is a fresh testimony, undoing is a retract of
/// this one.
/// The move record: dot-tagged [`Metathesis`] testimonies under the
/// survivor law, the movement instance of the open
/// [`DotStore`](crate::metis::DotStore) axis (PRD 0022).
///
/// Structurally the payload store applied to movement
/// (`DotFun<Metathesis>`), with pure delegation for its `DotStore`
/// instance: no new merge semantics, so concurrent moves of one element
/// are surfaced sibling testimonies here and resolved only in the
/// [`recension`](crate::metis::Rhapsody::recension) read, by rank. What
/// the named type adds is the movement vocabulary and the two reads the
/// recipes need: [`moves_of`](Self::moves_of) (the supersede set for
/// re-moving tidily) and [`targets`](Self::targets) (which identities
/// have movement testimony at all).