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
//! **What a detached launch produced** (DESIGN §8.1, §13.3, bl-b95e) — the
//! state a `-2` row's failure is derived from, in place of what its sink said.
//!
//! §13.3's `driver.log` ruling is the general one: *"The log is append-only
//! across launches, so its **content** is never the trigger — a stale line from
//! a healed crash must not alarm — only the diagnosis."* The §8.1 stderr sink
//! was the one capture file yog still read the other way round: a byte in it
//! made the row a rendered failure, and the marker table (`opslog::notice`,
//! bl-1296) existed only to hold back the benign lines that reading swept up.
//! A phrase table over sentences litany is free to reword is not a classifier,
//! and it could never reach the defect underneath it — the sink is append-only
//! for the driver's whole life, so **one** unrecognized line held that row red
//! for every later sweep, however many turns the driver went on to run.
//!
//! The **state** is the orphan's own pair ([`crate::steps_view::orphan`], the
//! template), asked of the thing the launch was fired to produce:
//!
//! - **Nobody is driving it** — the target agent's §3.5 lock is free
//! ([`AgentState::driven`]). A driver at work is the answer to "did it
//! survive", so nothing else is asked.
//! - **It has begun no model call since the launch** — every matching agent's
//! [`Agent::call_start_unix`] predates the row's own `ts`, or there is none
//! at all. litany writes a step's `request.json` immediately before handing
//! the request to the adapter, so that stamp is the one fact saying the loop
//! got as far as asking (§5.1 #28, the same anchor the §7.3 wound's catch-up
//! window rides).
//!
//! Both hold **vacuously when the target does not exist at all**, which is the
//! class the sink was added for (bl-4895): a `litany prompt` whose driver died
//! before writing a branch leaves no conversation, no step and no transcript —
//! nothing but its ops row and its sink.
//!
//! **The second half used to be `last_action_unix`, and that left the
//! commonest birth failure unreadable** (bl-6495). A `litany prompt` that
//! refuses *after* creating the conversation — a role granting a tool its
//! governing config does not describe, a bad lineage, a version skew — leaves
//! a branch, a queued deposit and no step; and the branch's own dispatch
//! commit is an action later than the row's stamp, so the launch read as
//! having produced something and its sink was never opened. What the operator
//! got was `ok:true` from the fire, `stopped` in the roster, an ops row saying
//! `-2` with an empty `stderr`, and the refusal itself only in
//! `state/yog/detached/<ts>-<ws>.err`, which no gesture reads. On a remote
//! engine — the shape REMOTE describes — there is no reach to that file at
//! all.
//!
//! The fix is to ask what the launch was fired to **produce**. A branch is not
//! it: a conversation nobody has asked a model about is the same nothing as a
//! conversation that does not exist, and both are this sink's class. A model
//! call is, and from the instant one begins the §7.3 wound owns the story —
//! the step's own `response.json`/`meta.json`/`stderr.log` say what happened
//! to it, on the conversation surface where it is being read. So the two
//! divisions §13.3 draws now meet exactly: **the sink answers for a driver
//! that died before its first model call, the wound from that call onward**,
//! with no launch falling between them and none answered twice.
//!
//! Nothing is stored and no new signal is introduced. The verdict is re-derived
//! per sweep from the already-derived §3.5 trees, and the sink is read **only**
//! when it holds — a healthy launch pays no syscall for it, exactly as a
//! healthy conversation pays none for `driver.log`.
//!
//! **It waits, and it never answers over a world it cannot read.** The §7.3
//! grace window (bl-90bf, `Cadence::wound_grace`) is the same catch-up bound
//! the wound banner rides: a launch younger than it has not had time to produce
//! anything, and the rising edge of a healthy start is indistinguishable from a
//! death until yog has looked again (bl-18e8). A workspace with no derived tree
//! is **no verdict** rather than a death — §10's rule against a false definite,
//! and the reason a start into a wall yog has not enumerated yet is silent.
use HashMap;
use PathBuf;
use Duration;
use ;
use crate;
/// litany's start verb, and the flag carrying the §3.3 name the fire minted.
/// Here rather than beside the spawn for [`super::detached::sink`]'s own
/// reason: the launch writes these tokens into `ops.jsonl` and this reads them
/// back, so the two sides of that join have one home and cannot drift.
pub const PROMPT: &str = "prompt";
/// See [`PROMPT`].
pub const NAME_FLAG: &str = "--name";
/// litany's resume verb (§8.2): `advance <workspace> <agent>`, the driver
/// launch behind a capability release and the operator's own nudge.
pub const ADVANCE: &str = "advance";
/// Which agents a detached launch was fired to move — the row's own argv, read
/// back. `Conversation` is a start, named by the §3.3 name the fire minted and
/// matched on [`Agent::name_fact`]; `Agent` is a resume, named by the id it was
/// handed.
/// Whether this ops entry is a detached launch that **produced nothing** —
/// the module's whole question, and the one input to a `-2` row's failure.
///
/// `now` is the derivation's own clock reading and `grace` the §7.3 window
/// ([`Cadence::wound_grace`](crate::app::Cadence::wound_grace)); `trees` is
/// the pass's already-derived §3.5 forest, keyed by workspace path.
pub