Cache Semantics
The cache stores canonical raw state — not profile-specific snapshots. Every cache hit re-projects through the requested profile, ensuring projection isolation.
Canonical Cache Architecture
Cache Storage: Canonical Raw State (profile-agnostic)
├── ?profile=fast → FAST projection
├── ?profile=standard → STANDARD projection
└── ?profile=full → FULL projectionInvariants
No Profile Leakage
Cached FULL data never leaks into FAST responses:
// FULL cached → FAST requested:
// diagnostics: omitted (FAST rule)
// preview.placeholder: omitted (FAST hides generated)
// preview.palette: omitted (FAST hides computed)
// Only provider-native preview survives FAST projectionNo Richness Degradation
Cached FAST data never limits FULL richness. FULL always includes diagnostics even when the cache was warmed by FAST.
Non-Regression Through Cache
Processing state never becomes stale. If workers complete between requests, the second request reflects updated canonical state.
Response Source Tracking
| Scenario | responseSource | cached | HTTP |
|---|---|---|---|
| First request | "fresh" | false | 200 |
| Cache hit | "cache" | true | 200 |
| Inflight attachment | "inflight" | false | 202 |
| FULL upgrading partial | "fresh" | false | 200 |
Provenance Immutability
Critical Rule
enrichmentSources is immutable across cache hits. responseSource may change to "cache", but provenance stays as originally recorded.
// Request 1 (fresh):
{ "responseSource": "fresh", "enrichmentSources": { "semantic": "fresh" } }
// Request 2 (cache hit) — provenance preserved:
{ "responseSource": "cache", "enrichmentSources": { "semantic": "fresh" } }Two distinct concepts:
responseSource— how was this response fulfilled (transport)enrichmentSources— when was this data produced (provenance)
Shared Orchestration
Multiple profiles for the same resource share a single job. FAST and STANDARD share the same job ID. Duplicate FULL requests reuse existing jobs.