App Index
Precomputed, query-efficient index over the installed apps. Built once per app list (not per query), it replaces the old per-query full scans + double Levenshtein in CommandRouter. Two jobs:
resolve — map a model-chosen app name to a real installed app, with a confidence flag, through ordered tiers (exact → compact → acronym → prefix → token-prefix → substring → subsequence → fuzzy). Only the fuzzy tier is "not confident", so the UI knows when to ask.
candidates — top-K apps for a free-text query, used to ground the LLM prompt so the model picks a real installed app instead of hallucinating a name. This is where device-discovered entries (app shortcuts, deep-link targets) would also be folded in later — same ranking, richer corpus.
Functions
Deterministic app resolver — the launcher's job, not the LLM's. Progressive tiers (exact → alias → acronym → prefix → substring → subsequence → fuzzy) each yield a numeric Resolution.score; the confidence decision (execute / confirm / present candidates / no-match) is derived from the centralized, tunable ResolverConfig thresholds (SoT §15) rather than hard-coded per tier.