Simulate an entry-count-limited prefix cache with operations ["put", id, tokens] and ["match", query_tokens]. Put inserts or replaces an ID and makes it most recently used; evict the least-recently-used entry if over capacity. At capacity zero, puts store nothing.
Match chooses the longest stored token list that is a prefix of the query; equal lengths choose the lexicographically smallest ID. A hit refreshes only the chosen entry, and a miss changes no recency. Empty prefixes are allowed. Return {"matches": chosen IDs or null for each match, "lru": live IDs from least to most recently used}. This model counts entries, not KV bytes.