The full, agent-consumable body of a recalled rule: the rendered code-spec
body (the same template get_rules emits), the structured examples, and
the supplementary check/trigger/origin/confidence fields that the
chunk-only recall path could not see.
A single bad/good example pair surfaced on a recalled rule. Mirrors the
rule_examples row shape the MCP get_rules tool already returns, so the
recall --json and get_rules example surfaces stay aligned.
Options for the CLI/MCP search-style retrieval helper. The helper fans
out across repo scopes, applies the shared confidence + age decay inputs
at the retrieve_rules_with_confidence layer, merges duplicates, then
applies the same lexical re-rank used by the MCP search tools.
Thin async seam so tests can substitute a fake cloud recall without
actually hitting the network. Blanket-implemented for CloudClient
below so real call sites keep using the concrete client directly.
Adaptive relevance gate for the EXPLICIT recall surfaces — the MCP
search_rules tool and the CLI recall command. Mirrors the hook
path’s adaptive pruning so an agent never has to weigh five weak rules
against an empty answer: irrelevant memory is worse than none.
Map a file path (or bare filename) to a canonical language tag. Matches
the spelling used in skill tags so QueryFilter.language can round-trip
cleanly between the MCP caller and the indexed chunk metadata. Unknown
extensions return None — callers pass that through as “no language
filter” rather than guessing at a language that’d drop real hits.
Fetch and render the full body (code-spec + structured examples + fix/check
fields) for each active skill id, keyed by id. Ids that don’t resolve to an
active skill are simply absent from the returned map, so the caller can fall
back to its chunk-only display for stale index entries.
Text-based recall variant. The server embeds the query itself, avoiding
the client/server algorithm + dimensionality drift that plagued the
chunk_embedding path when the client lacked a 1536-dim embedder.
Retrieve rules with confidence-weighted ranking.
Final score = hybrid rank score with one final confidence tie-breaker.
Rules with confidence < 0.2 are excluded (likely rejected).