docs/generated/contracts.mdgenerated from code
Reference · 20 min read
api-status
Contracts: api-status.
Read as
Source: crates/lvcs-api/src/status.rs.
1/// `status` (discussion:owner/164): where the caller stands. Read-only, and never2/// retried.3///4/// It shows the caller only what is its own (its grants, notifications,5/// trees, stale saves, and errors) and a node count. `path` asks how this daemon classifies one path6/// now (row 180), answered as `path`; it is refused when it is no valid7/// address.8#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]9pub struct StatusParams {10 /// The one path to classify, as `lvcs explain <path>` asks (row 180).11 #[serde(default, skip_serializing_if = "Option::is_none")]12 pub path: Option<String>,13 /// A kept stray copy to remove before answering (`--clear-stray`,14 /// discussion:owner/781): its file under `.lvcs/stray/`.15 #[serde(default, skip_serializing_if = "Option::is_none")]16 pub clear_stray: Option<String>,17}1819/// Why a file `StatusResult::kept` names is held back (orchestrator/57).20#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]21pub struct StatusHeldBack {22 /// The path.23 pub address: String,24 /// The refusal's rule, when it named one (`lvcs explain <rule>`).25 #[serde(default, skip_serializing_if = "Option::is_none")]26 pub rule: Option<String>,27 /// Why the save was refused, as its refusal said.28 pub reason: String,29 /// The refused save's writer, as an id, when it is another peer than30 /// the caller: every peer sees the one tree's held files, and only the31 /// writer's is "your save" (orchestrator/57).32 #[serde(default, skip_serializing_if = "Option::is_none")]33 pub by: Option<String>,34}3536/// A refused save's bytes kept under `.lvcs/stray/` (`StatusResult::stray`,37/// discussion:owner/781).38#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]39pub struct StatusStray {40 /// The path the refused save was for.41 pub path: String,42 /// The copy's file under `.lvcs/stray/`.43 pub file: String,44 /// The refused save's writer, as an id.45 pub writer: String,46 /// When it was kept, in Unix ms.47 pub at_ms: u64,48}4950/// A plugin whose `serve` is halted (`StatusResult::halted`).51#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]52pub struct StatusHalted {53 pub plugin: String,54 pub said: String,55}5657/// An installed plugin held because its local record has no kept receipt.58#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]59pub struct StatusHeldPlugin {60 pub name: String,61 pub path: String,62}6364/// One line a plugin keeps for `status` (`StatusResult::notes`,65/// discussion:owner/672): its `.lvcs/plugins/<plugin>/notes` file's.66#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]67pub struct StatusNote {68 pub plugin: String,69 pub line: String,70}7172/// One count a plugin keeps for a project card (discussion:owner/684): its73/// manifest's label and the number its counts file holds.74#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]75pub struct PluginCount {76 pub plugin: String,77 pub label: String,78 pub n: u64,79}8081/// A project's transport restarts (discussion:owner/676): how many within82/// `TRANSPORT_PANIC_WINDOW_MS`, and the last one's time.83#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]84pub struct StatusRestarts {85 /// The restarts within the window.86 pub count: u32,87 /// The last one's time, in Unix milliseconds.88 pub last_ms: i64,89}9091/// `status` result (discussion:owner/164).92#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]93pub struct StatusResult {94 /// The caller, in `ID_ENCODING`.95 pub peer: String,96 /// The caller's `trust_tier` value now, as other peers' daemons97 /// compute it from its grants: `owner`, or `peer` (also when it98 /// holds no live grant).99 pub tier: String,100 /// The harness its grant names, if any.101 #[serde(default, skip_serializing_if = "Option::is_none")]102 pub harness: Option<String>,103 /// The model its grant names, if any.104 #[serde(default, skip_serializing_if = "Option::is_none")]105 pub model: Option<String>,106 /// The caller's live grants, newest first: those whose window holds107 /// now and whose revocation the caps document doesn't render, which108 /// the daemon signs under.109 #[serde(default)]110 pub grants: Vec<StatusGrant>,111 /// The local peer has no sync admission yet (discussion:owner/494 and discussion:owner/495).112 #[serde(default, skip_serializing_if = "core::ops::Not::not")]113 pub waiting_for_sync_grant: bool,114 /// The caller's grants that ended in the last `RETRY_WINDOW_SECS`,115 /// latest end first: by their window, or once their revocation renders116 /// (discussion:owner/148).117 #[serde(default)]118 pub ended: Vec<StatusEnded>,119 /// How many of the caller's notifications wait unread, with no120 /// filter applied.121 #[serde(default)]122 pub pending: u32,123 /// The stale saves of the trees the caller authors since each file's124 /// last clean save, oldest first.125 #[serde(default)]126 pub stale_saves: Vec<StatusStale>,127 /// The saves of the trees the caller authors that the daemon read128 /// and its document hasn't answered yet, oldest first: not on `main`129 /// yet (owner/12).130 #[serde(default, skip_serializing_if = "Vec::is_empty")]131 pub pending_saves: Vec<StatusPendingSave>,132 /// File changes the daemon's watcher saw that the project hasn't read133 /// yet, in any tree: a save among them reaches `main` only after134 /// they are read (owner/12).135 #[serde(default, skip_serializing_if = "Option::is_none")]136 pub unread_changes: Option<StatusUnread>,137 /// The files of the trees a local change was seen on whose read from138 /// disk waits, oldest first (release-qual/9): each one's disk is newer139 /// than `main` until it is read, and it is neither refused nor held140 /// back. A scan's reads are not listed. Every peer sees them: every141 /// session edits the one tree.142 #[serde(default, skip_serializing_if = "Vec::is_empty")]143 pub unread_paths: Vec<StatusUnreadPath>,144 /// The paths the trees the caller authors sync but never write to145 /// disk, since this platform's filesystem can't hold them (Windows,146 /// discussion:owner/252), in tree then address order; empty elsewhere.147 #[serde(default, skip_serializing_if = "Vec::is_empty")]148 pub unmaterialized: Vec<StatusUnmaterialized>,149 /// The paths the trees the caller authors stopped writing because150 /// another program held them open past `HELD_DEADLINE_MS` (Windows,151 /// the held-rename row refining discussion:owner/252), until a later write of152 /// each lands, in tree then address order; empty elsewhere.153 #[serde(default, skip_serializing_if = "Vec::is_empty")]154 pub held: Vec<StatusHeld>,155 /// The documents holding changes this node can't read, or keeping a156 /// refusal no evidence proves (discussion:owner/671 rule 6), at most157 /// `STATUS_STUCK_MAX`, in document address order; each names the file's158 /// path when its document has one.159 #[serde(default, skip_serializing_if = "Vec::is_empty")]160 pub stuck: Vec<StatusStuck>,161 /// The files the trees the caller authors hold back from `main`: each162 /// keeps a refused save's bytes, so `main` lacks that change and the163 /// tree writes none of its renders, until a save of it is answered or164 /// `main` holds exactly those bytes (owner/12), in tree then address165 /// order.166 #[serde(default, skip_serializing_if = "Vec::is_empty")]167 pub kept: Vec<String>,168 /// Why each file `kept` names is held back (orchestrator/57): the rule169 /// and reason of the refusal that kept its bytes, in `kept`'s order.170 #[serde(default, skip_serializing_if = "Vec::is_empty")]171 pub held_back: Vec<StatusHeldBack>,172 /// The refused saves' bytes kept under `.lvcs/stray/` (discussion:owner/781):173 /// each a save refused where this node's peer holds no `write`, whose174 /// path the tree restored to main's version, until it is cleared, oldest175 /// first.176 #[serde(default, skip_serializing_if = "Vec::is_empty")]177 pub stray: Vec<StatusStray>,178 /// The caller's unread `executable_cleared` notifications (179 /// discussion:owner/366): each file whose executable bit a save of its, through a tree180 /// it authors, cleared, until it reads them.181 #[serde(default, skip_serializing_if = "Vec::is_empty")]182 pub cleared: Vec<Notification>,183 /// The caller's unread `verdict_disputed` notifications (184 /// discussion:owner/549): each document that keeps changes another node refused, judging185 /// by the same rules and grants, until it reads them.186 #[serde(default, skip_serializing_if = "Vec::is_empty")]187 pub disputed: Vec<Notification>,188 /// The digest of the grants this node judges changes by now, hex189 /// (discussion:owner/787): a stored refusal names the grants it was190 /// judged under by this digest. `None` when they don't encode.191 #[serde(default, skip_serializing_if = "Option::is_none")]192 pub grants_digest: Option<String>,193 /// How many nodes this daemon syncs a document with now.194 #[serde(default)]195 pub nodes: u32,196 /// The project's network didn't answer within `STATUS_NET_WAIT_MS`197 /// (request-flood/6): its facts (`nodes`, `addresses`, `incompatible`,198 /// `transport_restarts`, `unreached`, `ports_waiting`, `node_versions`)199 /// are left at their empty values, and the rest of the answer stands.200 #[serde(default, skip_serializing_if = "std::ops::Not::not")]201 pub net_busy: bool,202 /// The addresses another node dials to reach this project's node203 /// (discussion:owner/639), each ending in `/p2p/<node id>`, ready for204 /// `lvcs join --bootstrap`: relayed first, then public, then private;205 /// loopback left out. One `address` line each.206 #[serde(default, skip_serializing_if = "Vec::is_empty")]207 pub addresses: Vec<String>,208 /// No relay is dialed: `LVCS_RELAY` is `off`, or names none and the209 /// release names none (discussion:owner/639).210 /// One `relay: off` line.211 #[serde(default, skip_serializing_if = "core::ops::Not::not")]212 pub relay_off: bool,213 /// The project is hosted with no mDNS (discussion:owner/307): one `mdns: off`214 /// line.215 #[serde(default, skip_serializing_if = "core::ops::Not::not")]216 pub no_mdns: bool,217 /// The nodes this daemon found running a release it can't sync with218 /// in this run (production-readiness U4), by node id, until one219 /// identifies as compatible again.220 #[serde(default, skip_serializing_if = "Vec::is_empty")]221 pub incompatible: Vec<StatusIncompatible>,222 /// The project's transport restarts after its swarm panicked, within223 /// `TRANSPORT_PANIC_WINDOW_MS` (discussion:owner/676); absent when none.224 #[serde(default, skip_serializing_if = "Option::is_none")]225 pub transport_restarts: Option<StatusRestarts>,226 /// The configured bootstrap addresses whose every dial failed while no227 /// node connected, each with its node id (session-8faca4ed/29); empty228 /// once a node connects.229 #[serde(default, skip_serializing_if = "Vec::is_empty")]230 pub unreached: Vec<String>,231 /// The listen addresses whose port was taken, which the transport232 /// listens beside on a port the system picked and retries233 /// (discussion:owner/683); empty once each binds.234 #[serde(default, skip_serializing_if = "Vec::is_empty")]235 pub ports_waiting: Vec<String>,236 /// The `lvcs` releases of the nodes connected now, as their identify237 /// agent versions name them, each with how many run it, newest238 /// release first and unknown last: one `lvcs on machines:` line, so an239 /// operator sees a fleet took a release (`node.list` names which node240 /// runs which).241 #[serde(default, skip_serializing_if = "Vec::is_empty")]242 pub node_versions: Vec<StatusNodeVersion>,243 /// Each revocation some known node doesn't hold yet (discussion:owner/326),244 /// newest first, at most `STATUS_REVOCATIONS_MAX`; a revocation leaves245 /// once every known node holds it.246 #[serde(default, skip_serializing_if = "Vec::is_empty")]247 pub revocations: Vec<StatusRevocation>,248 /// The namespace changes set aside because a change each depends on249 /// was never stored here (secfix/31): their writes have to be made250 /// again.251 #[serde(default, skip_serializing_if = "Vec::is_empty")]252 pub dangling: Vec<StatusDangling>,253 /// The last error the daemon answered the caller, on any connection,254 /// since the daemon started, until a later request of the same op255 /// succeeds, or, for a refused save (no op), a later save of the256 /// caller's is admitted; a restart forgets it.257 #[serde(default, skip_serializing_if = "Option::is_none")]258 pub last_error: Option<LastError>,259 /// The caller's open failing streaks (discussion:owner/193): the latest260 /// `action_failed` it received for each check no `action_succeeded` has261 /// ended since, newest first; a restart forgets them.262 #[serde(default)]263 pub checks: Vec<Notification>,264 /// On a change runner's daemon, the change actions failing here now265 /// (discussion:owner/193), each with the authors its runner told; empty when266 /// this daemon serves no change channel.267 #[serde(default)]268 pub red: Vec<StatusRed>,269 /// The channels this daemon's runner attests, comma-separated, with270 /// why it runs nothing when the sandbox can't run here (discussion:owner/245271 /// and 297); `None` when its peer's grants name no channel it272 /// can run.273 #[serde(default, skip_serializing_if = "Option::is_none")]274 pub runner: Option<String>,275 /// Every protected path main changed past its approved heads, waiting276 /// for an approval (discussion:owner/314): what to run to approve it, or why it277 /// can't be approved yet.278 #[serde(default, skip_serializing_if = "Vec::is_empty")]279 pub waiting: Vec<StatusWaiting>,280 /// The approvals segments holding a carry that isn't the fold of the281 /// segment before (discussion:owner/805): it is never used, and readers282 /// read past it; each with the peers that put such a carry.283 #[serde(default, skip_serializing_if = "Vec::is_empty")]284 pub refused_carries: Vec<StatusRefusedCarry>,285 /// For a paired device's session, the peer it pairs for (286 /// discussion:owner/300), `ID_ENCODING`: who it acts for, as a plugin's surface shows287 /// it (`context.peer`); absent for any other caller.288 #[serde(default, skip_serializing_if = "Option::is_none")]289 pub acts_for: Option<String>,290 /// That person's own `trust_tier` (discussion:owner/526): the device acts as291 /// them, capped by its pairing, which `tier` and `grants` show.292 #[serde(default, skip_serializing_if = "Option::is_none")]293 pub acts_for_tier: Option<String>,294 /// That person's own live grants, newest first.295 #[serde(default, skip_serializing_if = "Vec::is_empty")]296 pub acts_for_grants: Vec<StatusGrant>,297 /// Well-formed local plugin records with no kept receipt. Each is298 /// unavailable until its installation is recovered.299 #[serde(default, skip_serializing_if = "Vec::is_empty")]300 pub held_plugins: Vec<StatusHeldPlugin>,301 /// Each plugin whose `serve` stopped for its configuration (exit302 /// `EX_CONFIG`), with what it said: one `plugin <name> halted: <said>`303 /// line each.304 #[serde(default, skip_serializing_if = "Vec::is_empty")]305 pub halted: Vec<StatusHalted>,306 /// Each plugin whose `serve` ended itself idle (`plugin.dormant`) and307 /// waits for its wake, by name: one `plugin <name> dormant` line each308 /// (discussion:owner/790).309 #[serde(default, skip_serializing_if = "Vec::is_empty")]310 pub dormant: Vec<String>,311 /// What each running plugin keeps for `status` (discussion:owner/672:312 /// the actions it can't read and skips), at most `PLUGIN_NOTES_MAX`313 /// lines of `PLUGIN_NOTE_MAX_BYTES` each per plugin, in its order: one314 /// `plugin <name>: <line>` line each.315 #[serde(default, skip_serializing_if = "Vec::is_empty")]316 pub notes: Vec<StatusNote>,317 /// The counts each running plugin keeps for the project's card318 /// (discussion:owner/684), in the registry's order and then each319 /// manifest's: one `plugin <name>: <label> <n>` line each. A count its320 /// file doesn't hold is left out, never 0.321 #[serde(default, skip_serializing_if = "Vec::is_empty")]322 pub counts: Vec<PluginCount>,323 /// The project listing's main language (`.lvcs/listing.json`), when it324 /// has one: the card's tag (discussion:owner/684).325 #[serde(default, skip_serializing_if = "Option::is_none")]326 pub language: Option<String>,327 /// The protected paths the owner approved before `check` attested328 /// them (discussion:owner/407), sorted, until an attested frontier holds each329 /// at its approved heads: one `unattested <path>` line each.330 #[serde(default, skip_serializing_if = "Vec::is_empty")]331 pub unattested: Vec<String>,332 /// Every action's channel and every `[channels]` combination at333 /// `lvcs.toml`'s approved heads, by name, with its value (334 /// discussion:owner/297): one `channel <name>: <frontier ids or none>` line each.335 #[serde(default, skip_serializing_if = "Vec::is_empty")]336 pub channels: Vec<StatusChannel>,337 /// While the runner serves channels, one line when its sandbox's runs338 /// have the rlimits only, with no cgroup memory, pids, or cpu limits,339 /// since the daemon has no writable delegated cgroup v2 subtree (the340 /// sandbox-hardening row), then one when its steps have no `/proc` of341 /// their own, since the kernel refused the sandbox's `proc` mount (row342 /// 307): each why, with how to recover and the next action.343 #[serde(default, skip_serializing_if = "Vec::is_empty")]344 pub sandbox: Vec<String>,345 /// One line per GitHub workflow file at main's approved heads346 /// (discussion:owner/245, stage C): `actions <file>: <n> mapped, <n> skipped,347 /// <n> ignored`, or `actions <file>: refused <reason> <name>: <next>`348 /// for each job it refused, which holds every change channel.349 #[serde(default, skip_serializing_if = "Vec::is_empty")]350 pub actions: Vec<String>,351 /// At most `DERIVED_STATUS_MAX` of the derived files the caller's352 /// trees hold that are stale or failed, or that were superseded for353 /// the caller in the last `RETRY_WINDOW_SECS`, stale and failed first,354 /// then by address (row 180).355 pub derived: Vec<DerivedView>,356 /// How many more such files `derived` leaves out.357 #[serde(default)]358 pub derived_omitted: u32,359 /// The path a `status { path }` asked about, as this daemon classifies360 /// it now (row 180); absent when none was asked.361 #[serde(default, skip_serializing_if = "Option::is_none")]362 pub path: Option<DerivedView>,363 /// How to name each peer the result names, the caller364 /// included (discussion:owner/243), by id.365 #[serde(default)]366 pub names: BTreeMap<String, Named>,367 /// How text shows each id the result holds, by id: the caller's and368 /// the owner's peer ids among the peers this daemon knows, and each369 /// grant's id among the grants it knows, each as its shortest unique370 /// start of at least `SHORT_ID_MIN` characters (discussion:owner/674).371 /// The result's other fields keep full ids.372 #[serde(default, skip_serializing_if = "BTreeMap::is_empty")]373 pub ids: BTreeMap<String, String>,374 /// The aliases a grant gave the caller that were first granted to375 /// another peer, so they name that one, not the caller376 /// (discussion:owner/243).377 #[serde(default, skip_serializing_if = "Vec::is_empty")]378 pub alias_conflicts: Vec<String>,379 /// Whether this daemon applies a signed release itself (discussion:owner/293):380 /// its own setting, under its own `LVCS_NO_AUTO_UPDATE`, not the381 /// caller's.382 #[serde(default)]383 pub auto_update: bool,384}385386/// One path as row 179's classifier sees it, with where its derived output387/// stands (row 180), as `status` and `lvcs explain <path>` show it.388#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]389pub struct DerivedView {390 /// The path.391 pub address: String,392 /// Whether it is derived.393 pub derived: bool,394 /// The `derived_rule` value of the rule that decided: `none` when no395 /// rule applies, and for a path that is never derived.396 pub rule: String,397 /// What matched, cut to `RANGE_CONTEXT_MAX_CHARS` code points: the398 /// `.gitattributes` line as `<file>:<line>: <text>`, the `lvcs.toml`399 /// pattern, the vocabulary pattern, or the marker; empty for `none`400 /// with no pattern.401 pub detail: String,402 /// the generator's command at main's approved heads, for a derived403 /// path of a project that has one: its argv when it is one `Exec`404 /// step, else one word describing its steps (discussion:owner/248).405 #[serde(default, skip_serializing_if = "Option::is_none")]406 pub generator: Option<Vec<String>>,407 /// Where its output stands under the generator; absent without one.408 #[serde(default, skip_serializing_if = "Option::is_none")]409 pub state: Option<DerivedState>,410 /// For a `stale` path, how far its shown output is behind its inputs.411 #[serde(default, skip_serializing_if = "Option::is_none")]412 pub behind: Option<Behind>,413 /// For a `failed` path, why its derivation failed and how to recover.414 #[serde(default, skip_serializing_if = "Option::is_none")]415 pub error: Option<ErrorData>,416}417418/// Where a derived path's output stands under the generator (row 180).419#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize)]420#[serde(rename_all = "snake_case")]421pub enum DerivedState {422 /// A counted generation covers its inputs' newest change.423 Current,424 /// Its inputs changed after the shown generation, or its new output425 /// waits for approval.426 Stale,427 /// Its derivation for the newest inputs failed or diverged.428 Failed,429}430431/// How far a stale derived path's shown output is behind its inputs (row432/// 180).433#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize)]434pub struct Behind {435 /// The input documents whose heads moved past the shown generation's436 /// frontier.437 #[serde(default)]438 pub inputs: u32,439 /// When the first of them moved, in Unix milliseconds by the daemon's440 /// clock.441 pub since_ms: i64,442}443444/// One channel's value, as `status` lists it (discussion:owner/297).445#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]446pub struct StatusChannel {447 /// The channel's or combination's name.448 pub name: String,449 /// Its value's frontier ids, in `ID_ENCODING`, sorted; empty for none.450 pub frontiers: Vec<String>,451 /// For an action's channel, why it can't move (discussion:owner/321): no452 /// runner can attest it, or none who may is online; `None` when a453 /// runner is online for it, and for a combination.454 #[serde(default, skip_serializing_if = "Option::is_none")]455 pub blocked: Option<ErrorData>,456}457458/// A change action failing on this runner's daemon (discussion:owner/193).459#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]460pub struct StatusRed {461 /// The check's id, in `ID_ENCODING`.462 pub check: String,463 /// Why it is red: a `red_kind` value (discussion:owner/230). `timed_out` with464 /// no one told is a first timeout, which reruns at the next quiet;465 /// with authors told, a second consecutive timeout at the same inputs466 /// opened its streak.467 #[serde(serialize_with = "vocab_to", deserialize_with = "vocab_from")]468 pub kind: RedKind,469 /// The id of the frontier where it last passed on its channel; absent470 /// when it never did.471 #[serde(default, skip_serializing_if = "Option::is_none")]472 pub passed_at: Option<String>,473 /// The id of the frontier where its failing streak began, or where it474 /// timed out.475 pub failed_at: String,476 /// The peers told with an `action_failed`: the authors of changes477 /// in the window to files the check reads. Empty when no change there478 /// touches one (a toolchain or environment change, or a flaky check):479 /// the check is red with no cause.480 #[serde(default)]481 pub told: Vec<String>,482}483484/// One live grant of the caller's.485#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]486pub struct StatusGrant {487 /// The grant's id, in `ID_ENCODING`.488 pub id: String,489 /// Its issuer, in `ID_ENCODING`.490 pub issuer: String,491 /// The paths it covers (gitignore syntax).492 pub paths: Vec<String>,493 /// The capabilities it gives on them.494 pub capabilities: Vec<CapabilityParam>,495 /// The end of its window, in Unix seconds; absent when it has none.496 #[serde(default, skip_serializing_if = "Option::is_none")]497 pub not_after_s: Option<i64>,498 /// Whether this daemon, holding its issuer's key, renews it before its499 /// window ends (discussion:owner/148): never for a grant with no window, nor500 /// for a lineage with a revoked grant or one a revocation this daemon501 /// sent names (discussion:owner/185).502 #[serde(default)]503 pub renews: bool,504}505506/// One grant of the caller's that ended lately.507#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]508pub struct StatusEnded {509 /// The grant's id, in `ID_ENCODING`.510 pub id: String,511 /// When it ended, in Unix seconds: its window's end, or the time its512 /// revocation names when that comes first.513 pub ended_s: i64,514 /// Whether it is revoked.515 pub revoked: bool,516}517518/// One stale save of a tree the caller authors (discussion:owner/66).519#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]520pub struct StatusStale {521 /// The file.522 pub address: String,523}524525/// A save in flight: read from a tree the caller authors, its document's526/// answer still to come.527#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]528pub struct StatusPendingSave {529 /// The file.530 pub address: String,531 /// When the tree saved it, Unix milliseconds.532 pub saved_ms: i64,533}534535/// File changes the daemon's watcher saw that the project hasn't read yet.536#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]537pub struct StatusUnread {538 /// How many watcher reports wait.539 pub count: u64,540 /// When the oldest was seen, Unix milliseconds.541 pub oldest_ms: i64,542}543544/// A file a local change was seen on whose read from disk waits545/// (release-qual/9), for room in the daemon's memory or in flight.546#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]547pub struct StatusUnreadPath {548 /// The file.549 pub address: String,550 /// When its read was first asked for, Unix milliseconds: a later551 /// change of the same file doesn't move it.552 pub since_ms: i64,553}554555/// A path a tree the caller authors syncs but never materializes, since556/// this platform's filesystem can't hold it under its own name (557/// discussion:owner/252): a reserved device name, a trailing dot or space, a character558/// Windows forbids, or a name equal ignoring case to a sibling's that sorts559/// first. Its document syncs as any other.560#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]561pub struct StatusUnmaterialized {562 /// The path.563 pub address: String,564 /// Why, and how to recover: `fix_request`, with a `read` of the565 /// document as `next`, to move its content to a path this platform566 /// can hold.567 pub error: ErrorData,568}569570/// A path a tree the caller authors stopped writing (`write_held`):571/// another program held the file open past `HELD_DEADLINE_MS`, so the file572/// on disk is older than its document. Listed until a later write of it573/// lands.574#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]575pub struct StatusHeld {576 /// The path.577 pub address: String,578 /// Why, and how to recover: `wait`, with a `read` of the document as579 /// `next`; close the file in the program holding it, and the next580 /// render writes it.581 pub error: ErrorData,582}583584/// A document this node can't bring up to date (discussion:owner/671585/// rule 6): it set aside changes it can't read, or keeps a refusal no586/// evidence proves, so it falls behind its writers until this node is587/// upgraded.588#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]589pub struct StatusStuck {590 /// The file's path when the document has one, else its address.591 pub address: String,592 /// Why, and how to recover: `upgrade`, with `lvcs update` as `next`.593 pub error: ErrorData,594}595596/// A revocation not every known node holds yet (discussion:owner/326): the grants597/// one `revoke` ended (their ids in `ID_ENCODING`, sorted), their598/// grantee's name, its time `at_s` (Unix seconds), and the known nodes599/// that hold it and those that don't, as `revoke`'s result splits them.600/// A node in `not_seen_by` keeps honouring the grants until it syncs.601#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]602pub struct StatusRevocation {603 pub grants: Vec<String>,604 pub grantee: String,605 pub at_s: i64,606 #[serde(default)]607 pub seen_by: Vec<crate::grants::RevocationNode>,608 #[serde(default)]609 pub not_seen_by: Vec<crate::grants::RevocationNode>,610}611612/// How many connected nodes run one `lvcs` release.613#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]614pub struct StatusNodeVersion {615 /// The release (`0.1.2`), absent for nodes whose agent version names616 /// none.617 #[serde(default, skip_serializing_if = "Option::is_none")]618 pub version: Option<String>,619 /// How many connected nodes run it.620 pub nodes: u32,621}622623/// A node whose release this daemon can't sync with (production-readiness624/// U4): its identify advertised another wire major, none, or no sync625/// protocol of this daemon's major, so no sync stream opens with it.626#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]627pub struct StatusIncompatible {628 /// Its node id.629 pub node: String,630 /// Its identify agent version (`lvcs/<version> wire/<major>.<minor>`631 /// from a release that has one), printable ASCII, at most632 /// `AGENT_MAX_BYTES`.633 pub agent: String,634 /// The wire major it advertises, absent when its agent version names635 /// none.636 #[serde(default, skip_serializing_if = "Option::is_none")]637 pub wire: Option<u16>,638 /// The wire major this daemon speaks.639 pub here: u16,640 /// Why, and who upgrades: `upgrade` when its wire major is newer than641 /// this daemon's, with `lvcs daemon` to run once a newer `lvcs` is642 /// installed; else `ask`, its owner to install an `lvcs` of this643 /// daemon's major, with `lvcs --version` for the release to name.644 pub error: ErrorData,645 /// This daemon's agent version, present when the node speaks the same646 /// wire major but this daemon refused its sync (discussion:owner/320): their647 /// builds disagree.648 #[serde(default, skip_serializing_if = "Option::is_none")]649 pub ours: Option<String>,650}651652/// A namespace change set aside because a change it depends on was never653/// stored here (secfix/31).654#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]655pub struct StatusDangling {656 /// Who signed the change.657 pub signer: String,658 /// When it was made, in Unix seconds.659 pub time_s: i64,660 /// The file holding its record, byte for byte.661 pub file: String,662}663664/// The last error the daemon answered a peer (discussion:owner/164).665#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]666pub struct LastError {667 /// The op of the request it answered, when the request named one.668 #[serde(default, skip_serializing_if = "Option::is_none")]669 pub op: Option<String>,670 /// Its JSON-RPC error code.671 pub code: i64,672 /// Its `data`, as the answer carried it.673 pub data: ErrorData,674 /// When it was answered, in Unix milliseconds.675 pub ts: i64,676}677678/// An approvals segment holding a carry that isn't the fold of the segment679/// before it (discussion:owner/805), which is never used.680#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]681pub struct StatusRefusedCarry {682 /// The approvals segment, at least 1.683 pub segment: u32,684 /// Who put the refused carries, in `ID_ENCODING`, sorted.685 pub signers: Vec<String>,686}687688/// A protected path waiting for approval (discussion:owner/314): main holds it at689/// other heads than its approved heads, so trees and every frontier's690/// tree keep its approved version until an `approve` names it.691#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]692pub struct StatusWaiting {693 pub path: String,694 /// Main's visible frontier, which holds the path as main does and695 /// which `lvcs approve --frontier <frontier> <path>` approves it at696 /// (`lvcs approve --waiting` at main's frontier then, discussion:owner/613;697 /// discussion:owner/532:698 /// a run's or channel's wait is the actions plugin's); absent while699 /// main has none.700 #[serde(default, skip_serializing_if = "Option::is_none")]701 pub frontier: Option<String>,702 /// What to do: `fix_request` with the `lvcs approve` line, or why it703 /// can't be approved yet, with how to recover.704 pub error: ErrorData,705}