pub fn resolve_draft_source_kind(
plan: DraftSourcePlan,
embedded_head_loaded: bool,
dflash_loaded: bool,
) -> Result<DraftSourceKind, String>Expand description
The uniform draft-source selection law. Pure — no env, no engine, no family types — so it is CPU-gateable and so every spec family answers “which source” the same way.
THE LAW, in precedence order:
- A LOADED DFlash2 drafter IS the source. The operator asked for it by name (a set drafter flag that cannot load is already a loud boot failure, never a silent fallback), and the family’s embedded head is deliberately NOT loaded for this source — it is a full trunk layer of VRAM.
- Otherwise the embedded head, and only when the PLAN declares an embedded source: a
loaded head under a plan that does not declare
Embeddedis a load-path bug, not a draft source, and it is refused by name rather than drafted from. - Otherwise there is no draft source and speculative decode must refuse before drafting.