Skip to main content

ThinkingSummary

Struct ThinkingSummary 

Source
pub struct ThinkingSummary {
    pub scanned_qnames: usize,
    pub matched_for_query: usize,
    pub surfaced: usize,
    pub by_kind: BTreeMap<String, usize>,
    pub by_kind_dropped: BTreeMap<String, usize>,
    pub entries_in_workspace: Option<usize>,
}
Expand description

Metadata accompanying the prior_thinking projection. Parallel in shape to FeedbackMetrics — same idea, different domain.

Token economy (1.0.78): every count field that’s zero is skipped during serialization, and the all-zero by_kind / by_kind_dropped maps are skipped entirely. On a query where no thinking exists, the serialized form collapses to {"scanned_qnames": N} (or empty if even scanned_qnames is 0), saving ~200 chars/call. Non-zero counts still emit — accuracy preserved.

Fields§

§scanned_qnames: usize

Number of qnames the caller passed in for scanning. Skipped when zero (no qnames provided → nothing to summarize).

§matched_for_query: usize

Qnames that had at least one thinking entry (any kind). Skipped when zero; agent infers “no match” from absence.

§surfaced: usize

Entries kept after kind-filter + confidence-floor cuts. Skipped when zero; agent infers “no entries surfaced” from absence (and from prior_thinking being null/absent).

§by_kind: BTreeMap<String, usize>

Surfaced counts broken out by kind. Skipped entirely when every kind is zero. When emitted, ALL kinds appear (so the agent doesn’t have to defensive-check) — this is the established feedback_summary pattern.

§by_kind_dropped: BTreeMap<String, usize>

Entries the kind/confidence filters dropped, broken out by kind. The load-bearing field for the “thinking exists but isn’t showing” case — when by_kind_dropped["hypothesis"] > 0 AND by_kind["hypothesis"] == 0, the agent knows hypotheses exist for these symbols but all fell below the confidence floor. Skipped when all-zero (most calls).

§entries_in_workspace: Option<usize>

Workspace-wide thinking count (across ALL indexed symbols). Only populated when matched_for_query == 0 — gives the agent a signal whether to broaden the query (workspace has entries elsewhere) or capture new ones (workspace is genuinely empty). None otherwise to keep the typical hot path cheap.

Implementations§

Source§

impl ThinkingSummary

Source

pub fn is_quiet(&self) -> bool

True when the summary carries no signal — useful for the caller’s “emit at all?” decision per the sentinel rule (emit only when prior_thinking is null AND scanned_qnames > 0).

Trait Implementations§

Source§

impl Clone for ThinkingSummary

Source§

fn clone(&self) -> Self

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 ThinkingSummary

Source§

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

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

impl Serialize for ThinkingSummary

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, 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 = !

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

fn try_from(value: U) -> Result<T, !>

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.