Expand description
Plan G t-006: read-side helper for surfacing captured thinking (Hypothesis / MentalModel / FailedAttempt / OpenQuestion) into prepare-change and context-for responses.
AcmeFlow refinement (2026-06-04): the helper now returns a
struct (PriorThinking) carrying BOTH the projected entries and
a ThinkingSummary metadata block. The summary always emits even
when no entries surface, so callers can distinguish:
-
“thinking exists on the queried symbols but was filtered out” (e.g. all hypotheses below the confidence floor):
surfaced == 0ANDby_kind_droppedpopulated → action: lower the floor or runasd think list <qname>to inspect. -
“no thinking entries exist for the queried symbols”: all-zero summary → action: maybe capture some via
asd think speculate/ model/question/failed. -
“thinking exists somewhere in the workspace but not on these symbols”:
matched_for_query == 0ANDentries_in_workspace > 0→ action: broaden the query, or this symbol cluster is unmapped.
entries_in_workspace is the only field that requires a workspace-
wide scan; per the AcmeFlow design call (Craig, 2026-06-04) it’s
computed ONLY when matched_for_query == 0 so the typical hot-path
call pays nothing extra.
Structs§
- Prior
Thinking - Result of
gather_prior_thinking— entries projected to JSON + metadata summary explaining what was scanned, what surfaced, and what was filtered. - Thinking
Summary - Metadata accompanying the prior_thinking projection. Parallel in
shape to
FeedbackMetrics— same idea, different domain.
Constants§
- DEFAULT_
CONFIDENCE_ FLOOR - Hypotheses with confidence below this are excluded from auto-surface
(still queryable via
asd think list). Plan G t-001 picked 0.3 as the default; callers may override.
Functions§
- all_
ledger_ buckets - One-pass read of the whole ledger tree, grouped per symbol bucket.
- all_
symbol_ entries - Bulk analog of the “list every indexed symbol’s ledger entries”
loop (per-qname
get_symbol_by_qname+ per-symbollist_entries, which is minutes at 10k symbols on a cold FTS cache): ONE id-map build + ONE ledger-tree walk. - count_
workspace_ thinking - Workspace-wide count of thinking entries across all symbols. Used as a fallback signal when prior_thinking finds nothing on the queried symbols.
- gather_
prior_ thinking - gather_
prior_ thinking_ all - Workspace-wide variant: ONE ledger-tree walk + ONE id-map build instead
of a per-qname symbol lookup + per-symbol ledger read. Same output shape
and filtering rules as calling
gather_prior_thinkingwith every indexed qname, but O(entries) instead of O(symbols × tree-depth) — the per-qname form measured ~9 minutes on a 9.6k-symbol repo with a cold FTS cache (Plan T t-007 finding); this walk is milliseconds. - live_
entries - Per-bucket supersede filtering — the same rule as
LedgerStore::list_entries(supersession never crosses symbols, so applying it per bucket is equivalent).