Skip to main content

suppress_stored_effort

Function suppress_stored_effort 

Source
pub fn suppress_stored_effort(
    resolved: &mut InferenceConfig,
    sources: &mut FieldSources,
    caps: &Option<TemplateCaps>,
) -> Option<SuppressedEffort>
Expand description

Stage 5b’s rule, applied to a resolution with no request in hand.

The predicate and both record-keeping edits, minus everything that needs a body: suppress_unsupported_effort is this plus the key deletion and the log line. Split out because gglib model explain and GET /api/models/:id/explain have to answer the same question about the same model and must not answer it differently. An explain surface that re-implemented the condition could only ever disagree with the gate it is describing — the same argument ADR 0007 makes for reading llama-server’s self-report instead of building a detector, one level in.

Note what an explain surface is doing when it calls this: it is reporting a conditional fact. The stored configuration resolves a level, and on any real request against this model that level would be deleted before sending. Nothing has been sent, and nothing here pretends otherwise — which is why the surfaces render it as would not be sent, not as was not sent.

catalog_resolved has no analogue here and is not needed: a caller holding a model row has, by construction, resolved the catalog. caps being None still means “never observed” and still answers Support::Unknown, so an unlaunched model keeps its level exactly as an unresolved request does.

Returns None — leaving both arguments untouched — unless the caps positively say the template does not read the variable and something resolved a level to suppress.