pub fn base_prompt_for<'a>(
prompts: &'a BTreeMap<String, String>,
model: &str,
) -> Option<&'a str>Expand description
BP-5 (catalog D2 “Per-model-family base-prompt selection”, cx§2
“Per-model base instructions”: “the system prompt is selected per model
family from bundled markdown”): the base prompt model should run
under, or None when no family pattern matches.
prompts is keyed by a crate::config::glob_match pattern over the
model id ("*codex*", "openai/gpt-5.*"). The MOST SPECIFIC match wins,
specificity being the pattern’s own length — a TOML table has no order to
rely on, so selection must not depend on one. Ties (equal-length patterns
both matching) break lexicographically, so the answer is total and
reproducible.