docs/generated/contracts.mdgenerated from code

Reference · 2 min read

log

Contracts: log.

Source: crates/lvcs-doc/src/kinds/log/mod.rs.

ruston main
1/// An action's last failed run's masked log (discussion:owner/500), the one value2/// of its log document at `LOG_PREFIX` + its channel's name.3///4/// `run` is the run's id (a `RunRecord`'s, its bytes, which hashes the5/// channel, `frontier`, `runner`, and `started_ms`), `frontier` the6/// frontier it failed at, `runner` the runner that ran it and signs the7/// change that puts it, `started_ms` when it took the run, `time_ms` when, by the runner's clock, in the8/// change's second. `errors` are the error lines its run record kept, at9/// most `STEP_ERROR_LINES_MAX` and `CHECK_LOG_TAIL_BYTES` bytes in all, and10/// `tail` its log's last `CHECK_LOG_TAIL_BYTES` at most, both masked when11/// they were kept (discussion:owner/283), so nothing is masked again.12#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]13pub struct FailedLog {14    /// The run's id.15    #[serde(with = "crate::cbor::fixed")]16    pub run: [u8; 32],17    /// The frontier it failed at.18    pub frontier: FrontierId,19    /// The runner that ran it.20    pub runner: PeerKey,21    /// When the runner took the run, by its clock: with the channel,22    /// frontier, and runner, what `run` hashes, so a reader checks the id.23    pub started_ms: i64,24    /// When, in Unix milliseconds by the runner's clock.25    pub time_ms: i64,26    /// Its kept error lines, in order.27    pub errors: Vec<String>,28    /// Its log's tail.29    pub tail: String,30}3132/// Put `log` into the log document as its one value (discussion:owner/500),33/// replacing what it held, committed by `origin` like an edit and answered34/// like one: `DocOutput::Changed` with `req`, or `DocOutput::Rejected`35/// `Failed` when the document is of another kind or closed, or the log36/// isn't within [`FailedLog::bounded`]'s bounds. A log the document37/// already holds commits nothing and answers at the current heads. The38/// caller checks that `origin`'s signer is `log.runner` and holds39/// the channel move verb on `<channel>`: every node's verifier refuses a change whose log40/// would fail there.41#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]42pub struct LogPut {43    pub req: RequestId,44    pub origin: Origin,45    pub log: FailedLog,46}