Skip to main content

ContextUse

Struct ContextUse 

Source
pub struct ContextUse {
    pub frame: FrameId,
    pub selected: bool,
    pub rendered: bool,
    pub cited: bool,
}
Expand description

What actually became of one served frame, as three independent observations (the context_use vocabulary of ADR 0007).

They are deliberately not a single enum or a score. Each is a distinct, separately-observable fact, and collapsing them would destroy the signal that matters most: a frame that was selected and rendered but never cited is the interesting case — the host paid its tokens and the model read it, and it changed nothing. A single “used/unused” flag cannot express that, and a 0–1 usefulness score would invent a precision nobody measured.

The three are ordered by inclusion in practice — a frame is rendered only if selected, cited only if rendered — but that is an observation about honest hosts, not an invariant this type enforces. See is_coherent.

Fields§

§frame: FrameId

The frame this record is about — the same identity the usage report billed and verify revalidates, never a separate attribution id.

§selected: bool

The host chose this frame from the fan-out results: it survived consent, the budget audit, and ranking.

§rendered: bool

The frame’s content was actually composed into the prompt the model saw. Distinct from selected: a frame can win ranking and still be dropped by budget packing before it reaches the prompt.

§cited: bool

The model’s output referred to this frame — by citation label, or by whatever attribution the host can observe.

A claim about observable output, never an inference about influence. Whether a frame changed the model’s reasoning is unobservable from outside; recording “it was cited” is a fact, recording “it helped” would be a guess wearing a fact’s clothes.

Implementations§

Source§

impl ContextUse

Source

pub fn selected(frame: FrameId) -> Self

A record for a frame the host selected but has not yet observed further.

Source

pub fn rendered(self) -> Self

Mark the frame as having reached the prompt.

Source

pub fn cited(self) -> Self

Mark the frame as referred to by the model’s output.

Source

pub fn is_coherent(&self) -> bool

Whether the three observations are mutually consistent: a frame cannot be cited without having been rendered, nor rendered without having been selected.

A host that reports an incoherent record has an accounting bug, and scoring on it would silently mis-attribute value — so this is checkable rather than assumed.

Source

pub fn is_rendered_but_uncited(&self) -> bool

The frame reached the prompt and earned nothing observable — the case worth paying attention to, because it is pure spent budget.

Trait Implementations§

Source§

impl Clone for ContextUse

Source§

fn clone(&self) -> ContextUse

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 ContextUse

Source§

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

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

impl<'de> Deserialize<'de> for ContextUse

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 Eq for ContextUse

Source§

impl PartialEq for ContextUse

Source§

fn eq(&self, other: &ContextUse) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl Serialize for ContextUse

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
Source§

impl StructuralPartialEq for ContextUse

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> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

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> 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.