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
//! The **flag** — VISION §4.9's signal-out verb, and the §6 signal it raises
//! (bl-7aef, joined to attention by bl-6f2f).
//!
//! A flag is not a check. A monitor row is a verdict about a sha; a flag is
//! *"a human should look at this"*, and anyone granted the verb may write one —
//! which is why it has its own pseudo-binary, its own row shape and, since
//! bl-6f2f, its own file beside [`super::row`]'s.
//!
//! **The defect this closes.** `/flag` wrote one exit-0 ops row and stopped
//! there, while VISION §4.9's ladder table, `Reply::Flagged`'s doc and the
//! gesture's own help all promise *"attention item + ops row"*. §6's predicate
//! reads `refs/litany/*` marks and the inbox listing and **no ops row**, so the
//! two halves were never joined: the verb that exists so the machine can raise
//! its hand raised it where nobody looks. That matters beyond the verb —
//! `flag` is the alignment monitor's **floor grant**, so a responder wired as
//! "a pure judge" signalled into silence.
//!
//! **Why the fact rides the agent.** Every other §6 signal is something the
//! agent carries, and that is the predicate's shape, not an accident of it:
//! [`attention`](crate::attention::attention) and
//! [`evidence`](crate::attention::evidence) both take `&Agent` and nothing
//! else. A seventh signal reached by a seventh parameter would have to be
//! threaded through the rank sort, both rollups, the roster walk and every
//! caller of each — six signatures to say one thing — and the acknowledgement
//! path could not follow it at all. So the flag becomes a fact on the agent,
//! folded on by the one place the ops trail and the derived trees are both
//! final ([`fold`], called from the snapshot's publish), exactly as the §7.2
//! live-tail follower supersedes a rendered agent's stream.
//!
//! **The watermark is the row's timestamp.** Rules 1–4 acknowledge an oid and
//! re-fire when the ref moves; a flag has no ref, and its `ts` behaves
//! identically — `/seen` records it, and the next flag is a new stamp and a new
//! firing. Nothing is stored: the row is the home, this is a query over it.
use HashMap;
use ;
use crateGitTree;
use crate;
/// `argv[0]` of a **flag** row (VISION §4.9, bl-7aef): an attention item raised
/// on one conversation, with its reason. Its own pseudo-binary rather than a
/// monitor row, because it asserts something different — a monitor row is a
/// verdict about a sha, a flag is "a human should look at this" — and because
/// anyone granted the verb may write one, not only the check.
pub const YOG_FLAG: &str = "yog-flag";
/// One raised flag as the agent carries it: **when** it was raised — the §6
/// watermark evidence — and **why**, in the raiser's own words.
///
/// The value, not a bare stamp, on `held`'s precedent (§8.6): what an operator
/// needs from a signal that says "look at this" is what the raiser said about
/// it, and a second query to recover the sentence would be a second query to
/// forget.
/// The ops entry a flag appends. `argv[1]` is the conversation, `stdout` the
/// reason, exit `0`: raising attention is not a failure, and must not banner as
/// one (§7.3's ichor is for actions that failed).
/// The newest flag on one `(workspace-key, agent)` in a durable tail, or `None`
/// when that conversation carries none. File order, so the last match wins —
/// [`super::row::latest`]'s own reading one noun over.
///
/// Reading is forgiving, like every other `ops.jsonl` read: a hand-mangled row,
/// or one from a future yog with more argv, simply is not a flag.
/// Is this row's pre-joined `argv` a flag raised on `agent`? [`OpRow`] joins
/// `argv` for display and both fields a flag row puts there are space-free by
/// construction (the pseudo-binary and an agent id), so the split is lossless.
/// Stamp every derived agent with its newest flag — the one place the ops trail
/// and the derived trees are both final (the snapshot's publish).
///
/// Consumes and returns the map rather than mutating a borrow, because the
/// caller is already paying a clone to freeze the snapshot and folding into
/// that clone costs nothing more. A world with no flag at all walks the rows
/// once and finds nothing, which is the ordinary case.
pub