Skip to main content

PipelineEvent

Struct PipelineEvent 

Source
#[non_exhaustive]
pub struct PipelineEvent {
Show 22 fields pub session_hash: String, pub tool_call_id_hash: String, pub tool_name_anon: String, pub endpoint_class: String, pub response_chars: u64, pub shape: Shape, pub inner_formats: Vec<String>, pub content_sha_prefix_hex: String, pub file_path_hash: Option<String>, pub is_dedup_hit: bool, pub layer_used: Layer, pub template_id: Option<String>, pub tokens_baseline: u32, pub tokens_final: u32, pub context_partition: u32, pub is_sidechain: bool, pub ts_ms: i64, pub sample_rate_applied: f32, pub enricher_prefetched: bool, pub enricher_predicted_cost_tokens: u32, pub enricher_decline_reason: Option<String>, pub cited_in_next_n_turns: Option<bool>,
}
Expand description

Single pipeline decision — emitted once per tool-result.

See docs/research/paper-2-mckp-format-adaptive.md §Telemetry & Observability for field-level documentation.

Fields (Non-exhaustive)§

This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.
§session_hash: String

SHA-256 prefix of the session UUID (not the raw UUID).

§tool_call_id_hash: String

SHA-256 prefix of this tool_use_id — identifies the response for dedup references without exposing the raw id.

§tool_name_anon: String

Anonymized tool name. MCP slugs are hashed (mcp__p<hash>__verb).

§endpoint_class: String

Coarse endpoint classification (e.g. git_log, curl, or the full tool_name for single-endpoint tools).

§response_chars: u64

Raw byte count of the response.

§shape: Shape

Structural shape of the response.

§inner_formats: Vec<String>

Names of embedded formats detected inside the response (e.g. diff, log, url, hash). Empty when no embedded formats were seen.

§content_sha_prefix_hex: String

Hex-encoded prefix of SHA-256 over the response bytes — 32 hex chars representing the first 16 bytes (128 bits), matching the paper’s stated fingerprint width and the Python extractor’s output.

§file_path_hash: Option<String>

Anonymized file-path hash for Read/Edit/Write-family tools; None for tools that don’t operate on a file path.

§is_dedup_hit: bool

Did the pipeline emit a dedup hint in lieu of full content?

§layer_used: Layer

Terminal layer in the pipeline decision tree.

§template_id: Option<String>

L1 template identifier if layer_used == L1.

§tokens_baseline: u32

Token count before pipeline encoding (baseline).

§tokens_final: u32

Token count of what the pipeline emitted.

§context_partition: u32

Monotonic partition counter; increments on each compaction boundary.

§is_sidechain: bool

True for subagent (sidechain) tool-results; false for main session.

§ts_ms: i64

Unix milliseconds at which the response was produced.

§sample_rate_applied: f32

Fraction of events kept when sampling is enabled. 1.0 when every event is recorded. Consumers of telemetry must scale counts by 1 / sample_rate_applied.

§enricher_prefetched: bool

True when the planner pre-fetched this tool call (rather than the LLM emitting it directly). Drives the prefetch_hit_rate metric — paired with cited_in_next_n_turns once the post-pass scanner runs.

§enricher_predicted_cost_tokens: u32

cost_model.typical_kb-derived prediction (in tokens) at the moment the planner admitted the call. Compared with tokens_baseline to compute cost_overrun_rate.

§enricher_decline_reason: Option<String>

Set on declined candidates that the host emitted anyway as a telemetry-only event (so tune analyze can study what the planner skipped). One of "budget" / "low_probability" / "preempted" / "prereq_missing".

§cited_in_next_n_turns: Option<bool>

Reserved for an offline citation-enrichment post-pass that re-reads the JSONL log and sets this to true when the next 1–3 LLM messages textually reference any of the response’s content_sha_prefix_hex bytes. The live pipeline never sets this; the post-pass is not shipped yet (the existing tune from-claude-logs --tools only seeds [tools.*] defaults, it does not populate citation fields). Stays None until that pass lands.

Trait Implementations§

Source§

impl Clone for PipelineEvent

Source§

fn clone(&self) -> PipelineEvent

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for PipelineEvent

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for PipelineEvent

Source§

fn default() -> PipelineEvent

Returns the “default value” for a type. Read more
Source§

impl<'de> Deserialize<'de> for PipelineEvent

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Serialize for PipelineEvent

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,