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
//! **The machines registered in one workspace** — who participates in it, who
//! is connected right now, and what each of them offers (yog's
//! `docs/REMOTE.md` §5, §5.1; PROTOCOL 2's two fields).
//!
//! # Presence is an observation and the set is a statement
//!
//! The two facts on a row have different lifetimes and upstream says so:
//! [`ClientRow::present`] is true *at the moment the question was answered* and
//! nothing durable records it, while [`ClientRow::tools`] was written when that
//! machine last presented its set and stands whether or not it is connected. So
//! a row with no connection and a full set is the ordinary reading of a foot
//! that is not currently waiting for work — not a stale answer — and the pane
//! says both rather than folding them into one word.
//!
//! # And a third fact, because presence could not tell a ghost from a sleeper
//!
//! [`ClientRow::last_seen`] is durable where presence is not (REMOTE §5,
//! PROTOCOL 14): `present` reads `false` for a machine that spoke ten seconds
//! ago and for one that has never once connected, and **on this seat's command
//! line it reads `false` for everything**, because every verb opens and closes
//! its own connection. So a roster read from a terminal was a list of names
//! with nothing to choose by, and the operator's `rm` was unusable — no row
//! said which was safe to delete. **Absent is the answer, not a gap**: a row
//! with no stamp has never dialled, and it is precisely the row that can go.
//!
//! # `subject_cwd` is the consent, and its absence is the answer
//!
//! REMOTE §5.1: *"`true` states that the advertising box consents to run this
//! tool at a working directory the invocation names … Absent reads false,
//! rides only when true, and a mistyped value refuses at the read."* This
//! reader is that sentence exactly, including the strictness: `null` refuses
//! here as it does upstream, because the two ends must agree on what an absence
//! is and only one of them can be the author of that rule.
//!
//! # The schema is not decoded, because nothing paints it
//!
//! A tool's `input_schema` is its statement to a MODEL — yog carries it
//! verbatim and never validates it — and an operator looking at a roster of
//! machines is asking what a box can do, not what shape its arguments take. So
//! it rides through unread ([`super`]'s rung 4). The commit that paints a
//! schema is the commit that decodes one.
use Value;
use fields;
/// The kind token this reading answers to.
pub const KIND: &str = "clients";
/// One machine registered in the workspace.
/// One tool a machine offers.
/// One row of the listing.
pub
/// One advertised tool.
/// **What a row says of a machine that has never once dialled.**
///
/// The one half of [`ClientRow::last_seen`] this seat paints, and it is the
/// half that decides something: it names the enrolment that was minted and
/// abandoned, which is the row an operator can safely remove. The other half —
/// *how long ago* a machine that HAS dialled last spoke — is an age, and an
/// age needs a `now`. This crate holds no clock and every other age on this
/// surface is one the engine computed and sent (`age_secs`), so painting one
/// here would mean this seat asserting a time nobody handed it.
pub const NEVER: &str = "never dialled";
/// What a row says of a machine holding a connection at the moment it answered.
pub const HERE: &str = "connected now";
/// And of one that was not. **Not an error and not a stale set**: a tool host
/// holds its connection only while it is waiting for work, so a busy machine
/// looks exactly like an absent one from here.
pub const AWAY: &str = "not connected at this moment";