DR-150: A memoized extraction is keyed by the LLM identity that produced it
Context
Section titled “Context”Extraction memo entries keyed on (function fingerprint, content_text) only.
The id-389 tier substrate runs the same extractors against three different
answerers (mock sidecar, OpenRouter-served models, direct Anthropic), and the
mock tier had memoized canned outputs under the same key a real-model run would
hit — every tier-2/tier-3 “quality” run would silently replay mock outputs.
Discovered S559 while executing AC-3 (the EXTRACTION_MODEL knob, owner-ruled
for GLM-5.2 tier-2 extraction).
Decision
Section titled “Decision”The effective LLM identity — resolved base URL (or anthropic-direct) plus
model — is a required argument of every memoized extractor, so it participates
in the memo key. Changing tier or model can never serve another identity’s
memoized output. The signature change itself re-fingerprints the extractors:
one whole-corpus re-extraction per DB on first deploy (owner-approved burn,
$0 on mock).
Alternatives considered
Section titled “Alternatives considered”- DR-060 manual
version=bump per model change — burns the corpus on every swap, requires an operator to remember, and cannot fix cross-tier poisoning within one DB. Rejected. - Sweep the memo store per tier switch — operational, unenforced, and destroys valid entries for the returning tier. Rejected.
Consequences
Section titled “Consequences”- Switching tiers back and forth is correct and cheap after the first walk per identity.
- OPEN (needs sign-off, id-389):
ingest_file’s OUTER memo still short-circuits an env-only tier flip on unchanged bytes — the inner key protects changed bytes /full_reprocess/ self-heal paths only. Closing it means adding the identity toingest_file’s memo key, a change to the id-400-hardened surface. - Sibling gap, unclosed:
entity_pair_resolutions(pair_resolver’s DB cache) keys on(name_a, name_b, entity_type)— model-agnostic; needs a migration if the same rule is to hold there.
Implementation: canonical bf250ef28 (knob + identity threading + workflow
tier wiring); grounding in tasks/id-389.md S559 entries.