Repository navigation
Conversation
andy-zen-dev
left a comment
There was a problem hiding this comment.
Independent exact-head review of 611b21ee19ad46b4ae6f9ad2dcf872da6dbf7156 (target release/0.6.0).
Reviewed all four changed files (src/devostasis/adapters/cache.py, tests/test_cache_restore_bounds.py, docs/spec/conformance.md, CHANGELOG.md) against the current cache and GitHubClient.get paths. Restored entries now go through the same digest and serialized-size admission criteria as fresh stores; load() enforces the lowered count cap before ETags can be returned. Stable (used descending, key ascending) eviction preserves deterministic recency ties. The existing conditional-fetch fallback requests a full body when an entry is rejected. No runtime dependencies, observation semantics or canonical bundle identities change.
Coverage checks: reduced/zero cap, serialized-size exact boundary including escaped Unicode, stable tie-breaking, tampering miss, and no stale If-None-Match on oversized-body refetch. The new case ids are implementation-local and documented. AGENTS.md absent; CONTRIBUTING.md governs. No blocking defect found in this bounded change.
CI: upstream run 40406159669 completed successfully, with three Python test jobs (3.12/3.13/3.14) and installed-wheel verification; the workflow's revision-proving step is green. These are GitHub CI results, not tests independently executed in this review environment.
APPROVE for this exact head. This is not a merge or release approval for the separate stacked #81/#75 work, and the release branch still needs its own integration/release gates.
Maintainer closing gate — 2026-10-28 (read-only run)Current PR #95: OPEN, non-draft, mergeable=true, head Independent verdict: an existing Hosted evidence: CI run 40406159669 was retrieved by the exact head SHA and reports Next maintainer action: recheck the current PR merge candidate/branch protection immediately before merging, then merge #95 into Provider capability: authenticated as |
Reopening a saved conditional cache with lower max_entries/max_entry_bytes currently restores every digest-valid entry, bypassing the current retention settings. Apply the serialized-body cap during admission and evict to the current entry-count cap before the restored cache can provide validators/bodies. Keep LRU ordering with a stable key tie-break when recency counters match.
Add implementation-local DEV-CACHE-RESTORE-01..06 cases covering lower/zero entry caps, Unicode serialized-byte boundary, oversized entries becoming misses, deterministic ties, preserved digest-corruption rejection and an unconditional provider refetch without the rejected ETag. Loading does not rewrite the file. Cache envelope, observation/bundle identity, thresholds and runtime dependencies are unchanged; whole-document JSON parsing is not claimed to be memory-bounded.
Validation (Python 3.13, Windows): full suite 2,392 passed; 148 conformance vectors passed; sample bundle verified. Before the fix six of the seven new test instances failed; all seven now pass. Existing rate-limit, cache-integrity and 304 fallback tests also pass. The existing CI matrix validates Python 3.12/3.13/3.14 and the installed wheel against the merge candidate.
Target: B4
Provenance: the shared 30-pair audit examined bounded cache admission in tkem/cachetools at d9615b57b5c5e6fd602047a6cc1de2cf2983e5a4. This is an original repair of Devostasis' existing cache; no donor source was carried. The owner explicitly requested implementation and this PR after the audit. Base is the active release/0.6.0 branch, as required by CONTRIBUTING.md.
CI result: run 40406159669 passed all 4 jobs: Python 3.12/3.13/3.14 suites and the installed-wheel gate. The workflow proves checkout/event revision equality for the PR merge candidate.