docs(architecture): document the /api/models cache invalidation contract

The /api/models cache identity shipped in #7556 (release #7558) changed from a
stat identity to content fingerprints with volatile-key deny-lists, and the #7556
review flagged that this runtime contract had no project-level documentation.
Record the three source-fingerprint axes and their rationale, the one-directional
deny-list invariant, the stat-identity fallbacks (including the deep-tree
RecursionError path), the independent schema/version stamps, and the change
protocol; index the document from docs/CONTRACTS.md. Docs only.
This commit is contained in:
webtecnica committed 2026-09-13 15:02:03 -03:00
1 parent 94fd2da830
commit 80610c7b6c
2 files changed
+102

No files matched your search

+7
View File
@@ -78,6 +78,13 @@ contributor guidance; it does not change runtime behavior or CI gates.
proof gates. Prefer the RFC's **Authoritative emitted events** table (live
`/api/chat/stream` wire names) over the aspirational semantic taxonomy when
writing clients against current source.
- [`docs/architecture/models-cache-invalidation.md`](architecture/models-cache-invalidation.md):
current contract for the `/api/models` catalog cache identity: the
`config.yaml`, `auth.json`, and catalog source-fingerprint axes, the
one-directional volatile-key deny-lists (auth rotation and Codex's
`models_cache.json` refresh timestamps), the stat-identity fallbacks, and the
schema/version stamps. Start here before changing model-catalog caching, the
`/api/models` cache keys, or the Codex catalog dependency (#2443, #7540).
When a change touches streaming, recovery, replay, compression, context
reconstruction, cancellation, approval/clarify, session metadata, or run state,