Skip to main content

live_row_identity

Function live_row_identity 

Source
pub fn live_row_identity(
    runner: &str,
    harness: &str,
    harness_step_ref: Option<&str>,
    attempt_id: Option<&str>,
) -> Option<(String, String)>
Expand description

The identity (harness, step_ref) of the row the provider serves for a step a runner announced on the bus (step.finished.v1), from that event’s members. Plain strings, so it needs nothing from the runner contract crate.

The live row must carry the identity of the row the provider later records from a durable read, or last-row-wins could not replace it:

  • With a harness_step_ref (the runner declares history_key: "harness" and the host’s own store is the durable source): harness is the event’s harness, the hosting program, and step_ref is the host’s record id.
  • Without one: harness is the event’s runner, the runner’s module id, and step_ref is the event’s attempt_id, the id the runner gave that provider attempt and wrote in its own durable step record. Each attempt actually sent is its own row, because a billed retry is spend and its cache behaviour differs. The event’s run_id, step_id and attempt are not used: that triple can repeat after a session is restored. For a runner that is its own durable source (history_key: "step_ref") this is the identity the provider gives the attempt when it reads the runner’s step log. For a host-keyed runner with no host record, the row stays live-only.

Returns None for an event with neither harness_step_ref nor attempt_id. The runner contract refuses to publish such an event, so a provider that receives one drops it rather than inventing an identity.