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: usizeNumber of qnames the caller passed in for scanning. Skipped when zero (no qnames provided → nothing to summarize).
matched_for_query: usizeQnames that had at least one thinking entry (any kind). Skipped when zero; agent infers “no match” from absence.
surfaced: usizeEntries 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.