pub struct CodingOracle;Expand description
Offline-first lookup that generalises the built-in coding catalogue using the external knowledge sources’ cached snapshots.
Implementations§
Source§impl CodingOracle
impl CodingOracle
Sourcepub const fn snapshots() -> &'static [OracleSnippet]
pub const fn snapshots() -> &'static [OracleSnippet]
Every committed snapshot.
Sourcepub fn lookup(task_slug: &str, language: &str) -> Option<&'static OracleSnippet>
pub fn lookup(task_slug: &str, language: &str) -> Option<&'static OracleSnippet>
Resolve a (task, language) request to a cached snippet.
The language is matched by slug or case-insensitive display label so a
bare kotlin / Kotlin both resolve. Returns None when the oracle has
no cached answer — the caller then stays on its existing path (the static
catalogue or, ultimately, the unknown opener), so this is purely
additive.
Sourcepub fn knows_language(language: &str) -> bool
pub fn knows_language(language: &str) -> bool
Whether the oracle can answer for language (any task), used to decide
when to generalise beyond the static catalogue.
Sourcepub fn languages() -> Vec<&'static str>
pub fn languages() -> Vec<&'static str>
Distinct language labels the oracle covers that the built-in catalogue does not, in committed order, for diagnostics and the case study.
Sourcepub fn cached_count(source: KnowledgeSource) -> usize
pub fn cached_count(source: KnowledgeSource) -> usize
Number of snapshots cached for source, for the cache-cap ratchet test.