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
//! Goal composition + the pre-mint name preview (DESIGN §3.3, §3.4).
//!
//! Everything here is pure. The **payload prefill** ([`prefill`]) is the editable
//! text the operator sees: empty (bare), a target preamble naming the directory
//! verbatim (path), or the ball's title/body/worktree preamble (ball). What the
//! operator edits is exactly what fires (bl-6920: the goal reaches the model
//! unmutated); identity is not text at all — the minted name rides `--name`, and
//! lernie states the stored fact in its assembled context. The name is the
//! **conversation's** ([`mint_conversation`]): the workspace never enters the
//! prompt (bl-df65), because `YOG_NAME` already carries it and the world's `bl`
//! shim defaults `--as` to it (§16.7 W9, §3.3). [`preview`] mints the predicted
//! conversation name from a pure read (the target workspace's already-derived
//! name facts + the injected RNG) and pairs it with the prefill; the mint is
//! re-derived at fire — the preview is a prediction, the fire's mint is the
//! truth.
//!
//! The one stamp still composed here is read back by its inverse **in this
//! module**, one home for compose and parse (§3.3, PRINCIPLES "single source of
//! truth" — change the format here and every derivation follows):
//! [`parse_ball_stamp`] inverts [`ball_preamble`]'s header for the
//! conversation↔ball join. The identity stamp's parse survives only as
//! [`parse_identity_stamp`]'s legacy rung (`super::identity`) — its compose is
//! retired.
use identity_preview;
use ;
use cratework_worktree_path;
use crateRng;
use ;
/// The composer view-model (§3.3): the greyed name-prediction `preview` line and
/// the editable payload `prefill`. Both are pure reads — nothing spawns (I7).
/// The pre-submit composer view-model (§3.3): the predicted name paired with
/// the payload prefill. Nothing spawns (I7).
/// The editable payload prefill (§3.3), per rung — since bl-6920 also exactly
/// what fires: nothing is prepended. Bare is empty (the operator types); path and
/// ball carry their target preambles verbatim. `worktree` is the resolved ball
/// worktree the composer names (§3.3, threaded from the claim cross-check): the
/// canonical `<id>` leaf or the `<id>-<claimant>` variant bl actually minted, so
/// the preamble never names a nonexistent path. `None` for bare/path/new rungs.
pub
/// The path rung's target preamble (§3.3): the working directory named verbatim,
/// **on line one**. Every prefill yog composes leads with its headline — the
/// display ladder's second rung is the first payload line (§3.3), so a sentence
/// that buried the path on line two previewed the conversation by its own
/// boilerplate. The ball rung's `Ball <id>: <title>` header is the same invariant.
/// The ball worktree the composer/preamble names for an **existing** ball (§3.3,
/// §3.5): the canonical `work_worktree_path` `<id>` leaf — the pure formula the
/// planner previews and the resume path falls back to. `None` for bare/path/new
/// rungs. The executor overrides this with the claim's cross-checked worktree
/// (the `<id>-<claimant>` variant when bl minted it — addendum: never a guess).
pub
/// A workspace's name — its path leaf (§3.1): the `--as`/`YOG_NAME` stamp, for a
/// named focus, a foreign one, or a raise. **The name is a query, not a field**
/// (§3.1: the dir's existence is the registration), so this is the one place the
/// start flow answers "what is this workspace called". It never reaches the goal
/// text (§3.3, bl-df65) — the harness channel is its only one. Empty for a
/// rootless path (never a real workspace).
pub
/// The §3.3 ball worktree preamble verbatim: the ball header, the body, and the
/// durable target-repo binding (the absolute work-worktree path rides in the
/// goal *content* because lernie has no target-repo concept, §3.3).
/// The ball id a conversation root's `goal.md` carries (§3.3): the inverse of
/// [`ball_preamble`]'s `Ball {id}: {title}` header. Pre-bl-6920 roots carry
/// the legacy identity stamp *above* the header, so the scan is line-wise — the
/// first line shaped `Ball <id>: <rest>` yields `<id>`. `None` for a bare/path
/// conversation (no header) or any goal without one. The one parse paired with
/// the one compose above: a start-flow ball is the only conversation-level
/// attribution that exists (§3.2), so a single id — never a set — is derivable.
/// The ball id in one `Ball <id>: <title>` line, else `None`. A well-formed id
/// carries no whitespace (the compose emits a single token); that guard rejects
/// a prose line merely opening with the word `Ball` and an empty id.
/// The per-rung driver cwd (§3.4): `~` (bare / a not-yet-created ball), the given
/// directory (path), or the resolved work worktree (an existing ball). `worktree`
/// is the claim's cross-checked path (canonical or `<id>-<claimant>`); the
/// existing-ball arm prefers it, falling back to `~` only defensively (the
/// executor always resolves one). Belt-and-suspenders beside the goal-content
/// binding (§3.3).
pub
/// The composer's fire-time parameters as a [`Prepared`](super::Prepared): the
/// resolved name, its workspace path, the per-rung driver cwd, and the editable
/// goal prefill (fired verbatim, bl-6920). `worktree` is the resolved ball worktree
/// (§3.3, addendum): the planner passes the canonical formula, the executor the
/// claim's cross-checked path. The single source both [`super::plan`]'s `Prompt`
/// step and [`super::prepare`]'s return derive from.
pub