You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
test(backends): P1 reusable backend contract for TTL, clear, lifecycle and failures #111
Priority: P1 — contract before backend feature work
Define an installed-distribution conformance suite for InMemory, standalone Redis and experimental Memcached/DynamoDB. Do not claim backend parity based only on protocol types.
Contract matrix
get/get_with_ttl: missing, fresh, expiration, infinite TTL, clock skew, negative/zero TTL; no stale expired value returned when backend TTL cleanup is eventually consistent.
close/ownership: idempotency, lifecycle, repeated app start/stop, borrower-owned clients not closed by the cache decorator.
corrupt bytes, timeout, disconnection, cancel and retry behavior; no raw keys, credentials, auth headers or payloads in errors/logs.
Per-backend capability matrix in docs; every supported operation must have installed wheel/sdist tests and where appropriate a real service or qualified emulator.
Draft #114 adds a test-only shared InMemory/loopback Redis contract for get/set/TTL/scoped clear plus an explicit capability RFC. It does not change production backends or claim parity for experimental providers. CI uses Redis 7.x; Redis 7.4 and service-specific semantics remain separate evidence. A1/A2 app privacy and #112 failure policy must remain bounded. Keep this issue open for further TTL zero/negative, expiry, lifecycle, cancellation and Memcached/DynamoDB regressions.
Reproducible 0.6.0 TTL boundary found while bringing up #100 / draft #120 (2026-11-22): A published-wheel-only InMemory smoke benchmark set an entry with expire=1, waited ~1.1 real seconds, and get() still returned the payload (RuntimeError: Expired item was returned; workflow run 45079688560). The tagged v0.6.0 implementation uses _now = int(time.time()), stores ttl_ts = _now + expire, and expires only when ttl_ts < _now rather than <=. At an integer clock boundary, get_with_ttl() can therefore return (0, value) and get() can return the same value until the next integer tick. Classification: observable TTL rounding/edge contract requiring focused tests and decision under #111/#112; not a demonstrated security disclosure. The benchmark harness is being adjusted to wait >2s for deterministic already-expired checks; that does not resolve the backend behavior. Recommend exact-boundary fake-clock tests for bounded and unbounded InMemory and explicit decision whether <= is the correct contract, preserving legacy behavior analysis.
2026-11-23 scoped proposal: Open draft PR #123 for a deliberately small InMemory TTL boundary decision. Published 0.6.0's integer clock and strict ttl_ts < _now expose data at the exact expiry second with get_with_ttl() == (0, bytes). Proposed 0.7 behavior: expire at ttl_ts <= _now, for unbounded reads, bounded heap reclamation and LRU; use deterministic injected-clock tests for exact equality, TTL=0/negative, no resurrection after backward clock jump, and no eviction of a live LRU at a reclaimable expiry boundary. Seeded state-machine oracle and heap adversarial oracle updated in tandem. This is not yet an accepted general backend contract: Redis SET ex=0 rejects while InMemory immediate misses; separate backend sentinel and error semantics remain. Keep #111 OPEN for full installed-wheel backend matrix and #112 policy; no 0.6.0 changes or release.
2026-11-23 #123 independent-review follow-up: Latest Draft PR #123 is rebased via a merge of post-#122 stable (cdc27e9), exact head a48da525, 77/77 CI checks green. The earlier review gap is addressed: test_backward_wall_clock_shift_on_still_live_entry now proves that a not-yet-expired InMemory value remains readable and can acquire a larger remaining TTL after a backward wall-clock jump, in both bounded and unbounded modes. A distinct assertion proves an already-removed value cannot revive. This characterizes—not resolves—clock-skew semantics. The PR restores historical changelog.d/111.misc.md and creates a separate 123.misc.md. Decision pending: approve inclusive ttl_ts <= now for future 0.7 and document Redis EX<=0 differences; do not close full #111 on this narrow slice.
Proposed narrow acceptance decision for #123 — maintainer/security review required
Recommended 0.7.x scoped contract, NOT yet approved: InMemory uses integer wall-clock int(time.time()); expiration occurs at the computed integer deadline (ttl_ts <= now). Reads, get_with_ttl and bounded-heap reclamation apply the identical rule. expire=0 and negative InMemory TTL become immediate misses. Existing Redis semantics stay separate: nonpositive EX raises; don't silently normalize across backends. A backward wall-clock jump on a still-live entry can increase remaining TTL; monotonic elapsed-time/clock-skew guarantees are explicitly out of scope. Once a value is discarded it cannot revive.
Evidence: PR #123 exact post-#122 head a48da525, 77/77 checks, deterministic bounded/unbounded and still-live-clock tests, heap/LRU/fuzz oracle alignment, historical changelog fragment preserved.
Decision needed: maintainer explicitly ACCEPT or REJECT this narrow future-release contract, and independently approve the observable boundary change. Only then mark #123 ready/merge. Even if accepted and merged, keep #111 OPEN for backend clear/close/ownership, Redis errors, clock-skew alternatives, Memcached/DynamoDB conformance and broader installed-artifact evidence.
Decisión técnica acotada para el candidato 0.7.0 — ACCEPT (2026-11-23)
Tras revisión de las diferencias y pruebas de #123, se acepta para la rama de desarrollo la semántica de vencimiento InMemory inclusivo (ttl_ts <= int(time.time())) aplicada tanto al modo ilimitado como a la lectura y recuperación del heap LRU acotado. Implicaciones aceptadas:
El instante exacto de vencimiento y expire=0 se consideran MISS; get_with_ttl() == (0, None). TTL negativos igualmente MISS.
Se preserva el reloj entero wall-clock existente: una entrada todavía viva puede recuperar TTL aparente cuando el reloj retrocede, y una ya eliminada no revive. No se promete expiración monotónica.
Redis mantiene su contrato independiente: EX 0 o negativo da error; no hay normalización silenciosa ni paridad Memcached/DynamoDB.
Es una modificación futura respecto del wheel inmutable 0.6.0, sin cambio de keys, clientes externos ni política de expiración de Redis.
Límites de esta aceptación: solamente el diff y regresiones de #123; no equivale a aceptar todo #111 ni la versión 0.7.0. La compatibilidad final se verificará con CI sobre HEAD posterior a #127 y, después del merge, integración combinada con #124. El issue #111 sigue abierto para contratos completos de clear/close/cancellation/errores y proveedores experimentales. Esto documenta la decisión técnica de implementación bajo la solicitud de avanzar en el trabajo; no es una afirmación de firma personal del mantenedor sobre el release. No hay tag, TestPyPI ni PyPI autorizados.
Post-merge checkpoint (2026-11-23): Narrow inclusive InMemory TTL change from #123 is MERGED into stable as 612e9d6, after 77/77 exact-head checks against then-current stable; deterministic bounded/unbounded, live clock rollback and heap/LRU regression tests included. #124 also subsequently merged (4dc66ad); joint stable CI is being verified. This does not close #111: backend clear/close/ownership, Redis errors, clock-skew alternatives, Memcached/DynamoDB experimental contracts and installed-artifact conformance remain. No 0.7.0 artifact or release authorization.
Reabierto durante la preparación de la contraauditoría 0.7.0. El cierre previo como “completed” era inconsistente con la descripción y los comentarios post-merge: #123 cubre únicamente el TTL inclusivo InMemory y #114 el tuple Redis; no hay evidencia de cierre completo para clear/close/ownership, fallos de Redis, clock-skew comparado, ni matriz instalada Memcached/DynamoDB.
Próximo criterio: pruebas instaladas independientes por backend, matriz explícita PASS/FAIL/NOT RUN y límites de soporte documentados. No equiparar merge o CI verde con aceptación de todo #111. #130 es solo higiene de identidad del candidato, no satisface este gate.
0.7 risk disposition proposed, not final conformance certification
See PR #135 risk register and prepromotion audit assignment. Merged #114/#123/#131/#133 characterize Redis tuple and sentinel/EX=0 differences, InMemory inclusive TTL/clock rollback, empty bytes, client ownership and Docker real Redis stop/restart with retries explicitly disabled. These do not qualify experimental Memcached/DynamoDB parity, default redis-py retry latency, cluster namespace clear or all clear/close/cancel races.
Review selected 0.7 supported contract cases PASS/FAIL/NOT RUN; P0/P1 reproduced blockers cannot be waved away. Keep #111 OPEN for the broad matrix beyond this limited release. No final acceptance is claimed.
Under the maintainer's explicit authorization, the following documented limitations are accepted only for source df884644f11eb0e36ae5d74721009fc8e4470c4b and the exact 0.7.0 artifacts, pending final independent artifact/security review. This is not universal certification under issue #111.
InMemory: integer-second wall-clock TTL, inclusive expiry (now >= deadline), not monotonic. Backward clock shifts can extend a value that has not yet expired.
Standalone Redis: get_with_ttl() returns a tuple. Redis reports missing TTL as -2 versus InMemory's 0; Redis EX <= 0 raises rather than silently normalizing. Preserve these differences.
Clear/lifecycle: scoped key/namespace clearing for qualified standalone Redis, Redis connection owned by its caller. Redis Cluster clear(namespace) is unsupported.
Memcached/DynamoDB: experimental; no general backend parity or critical-deployment certification is asserted.
The final Phase B run passed all 12 Redis 7.4 migration/rollback jobs for wheel/sdist on Python 3.8–3.13, within the full 20-job first-attempt run. A new reproducible package-owned P0/P1 issue still blocks release. Keep #111 OPEN for broader backend support and untested cases. NOT RUN is not PASS.
This is not approval to tag or publish. Final evidence: #126.
Activity
agustin18 commentedon Nov 22, 2026
Draft #114 adds a test-only shared InMemory/loopback Redis contract for get/set/TTL/scoped clear plus an explicit capability RFC. It does not change production backends or claim parity for experimental providers. CI uses Redis 7.x; Redis 7.4 and service-specific semantics remain separate evidence. A1/A2 app privacy and #112 failure policy must remain bounded. Keep this issue open for further TTL zero/negative, expiry, lifecycle, cancellation and Memcached/DynamoDB regressions.
agustin18 commentedon Nov 22, 2026
Reproducible 0.6.0 TTL boundary found while bringing up #100 / draft #120 (2026-11-22): A published-wheel-only InMemory smoke benchmark set an entry with
expire=1, waited ~1.1 real seconds, andget()still returned the payload (RuntimeError: Expired item was returned; workflow run 45079688560). The taggedv0.6.0implementation uses_now = int(time.time()), storesttl_ts = _now + expire, and expires only whenttl_ts < _nowrather than<=. At an integer clock boundary,get_with_ttl()can therefore return(0, value)andget()can return the same value until the next integer tick. Classification: observable TTL rounding/edge contract requiring focused tests and decision under #111/#112; not a demonstrated security disclosure. The benchmark harness is being adjusted to wait >2s for deterministic already-expired checks; that does not resolve the backend behavior. Recommend exact-boundary fake-clock tests for bounded and unbounded InMemory and explicit decision whether<=is the correct contract, preserving legacy behavior analysis.agustin18 commentedon Nov 23, 2026
2026-11-23 scoped proposal: Open draft PR #123 for a deliberately small InMemory TTL boundary decision. Published 0.6.0's integer clock and strict
ttl_ts < _nowexpose data at the exact expiry second withget_with_ttl() == (0, bytes). Proposed 0.7 behavior: expire atttl_ts <= _now, for unbounded reads, bounded heap reclamation and LRU; use deterministic injected-clock tests for exact equality, TTL=0/negative, no resurrection after backward clock jump, and no eviction of a live LRU at a reclaimable expiry boundary. Seeded state-machine oracle and heap adversarial oracle updated in tandem. This is not yet an accepted general backend contract: RedisSET ex=0rejects while InMemory immediate misses; separate backend sentinel and error semantics remain. Keep #111 OPEN for full installed-wheel backend matrix and #112 policy; no 0.6.0 changes or release.agustin18 commentedon Nov 23, 2026
2026-11-23 #123 independent-review follow-up: Latest Draft PR #123 is rebased via a merge of post-#122 stable (
cdc27e9), exact heada48da525, 77/77 CI checks green. The earlier review gap is addressed:test_backward_wall_clock_shift_on_still_live_entrynow proves that a not-yet-expired InMemory value remains readable and can acquire a larger remaining TTL after a backward wall-clock jump, in both bounded and unbounded modes. A distinct assertion proves an already-removed value cannot revive. This characterizes—not resolves—clock-skew semantics. The PR restores historicalchangelog.d/111.misc.mdand creates a separate123.misc.md. Decision pending: approve inclusivettl_ts <= nowfor future 0.7 and document Redis EX<=0 differences; do not close full #111 on this narrow slice.agustin18 commentedon Nov 23, 2026
Proposed narrow acceptance decision for #123 — maintainer/security review required
Recommended 0.7.x scoped contract, NOT yet approved: InMemory uses integer wall-clock
int(time.time()); expiration occurs at the computed integer deadline (ttl_ts <= now). Reads,get_with_ttland bounded-heap reclamation apply the identical rule.expire=0and negative InMemory TTL become immediate misses. Existing Redis semantics stay separate: nonpositiveEXraises; don't silently normalize across backends. A backward wall-clock jump on a still-live entry can increase remaining TTL; monotonic elapsed-time/clock-skew guarantees are explicitly out of scope. Once a value is discarded it cannot revive.Evidence: PR #123 exact post-#122 head
a48da525, 77/77 checks, deterministic bounded/unbounded and still-live-clock tests, heap/LRU/fuzz oracle alignment, historical changelog fragment preserved.Decision needed: maintainer explicitly ACCEPT or REJECT this narrow future-release contract, and independently approve the observable boundary change. Only then mark #123 ready/merge. Even if accepted and merged, keep #111 OPEN for backend clear/close/ownership, Redis errors, clock-skew alternatives, Memcached/DynamoDB conformance and broader installed-artifact evidence.
docs(0.7): reconcile current release guides and prepare audit gates (#…
agustin18 commentedon Nov 23, 2026
Decisión técnica acotada para el candidato 0.7.0 — ACCEPT (2026-11-23)
Tras revisión de las diferencias y pruebas de #123, se acepta para la rama de desarrollo la semántica de vencimiento InMemory inclusivo (
ttl_ts <= int(time.time())) aplicada tanto al modo ilimitado como a la lectura y recuperación del heap LRU acotado. Implicaciones aceptadas:expire=0se consideran MISS;get_with_ttl() == (0, None). TTL negativos igualmente MISS.EX 0o negativo da error; no hay normalización silenciosa ni paridad Memcached/DynamoDB.Límites de esta aceptación: solamente el diff y regresiones de #123; no equivale a aceptar todo #111 ni la versión 0.7.0. La compatibilidad final se verificará con CI sobre HEAD posterior a #127 y, después del merge, integración combinada con #124. El issue #111 sigue abierto para contratos completos de clear/close/cancellation/errores y proveedores experimentales. Esto documenta la decisión técnica de implementación bajo la solicitud de avanzar en el trabajo; no es una afirmación de firma personal del mantenedor sobre el release. No hay tag, TestPyPI ni PyPI autorizados.
fix(inmemory): expire at exact TTL deadline in bounded and unbounded …
agustin18 commentedon Nov 23, 2026
Post-merge checkpoint (2026-11-23): Narrow inclusive InMemory TTL change from #123 is MERGED into
stableas612e9d6, after 77/77 exact-head checks against then-current stable; deterministic bounded/unbounded, live clock rollback and heap/LRU regression tests included. #124 also subsequently merged (4dc66ad); joint stable CI is being verified. This does not close #111: backend clear/close/ownership, Redis errors, clock-skew alternatives, Memcached/DynamoDB experimental contracts and installed-artifact conformance remain. No 0.7.0 artifact or release authorization.docs(0.7): align merged TTL, 304 and socket benchmark source status (#…
agustin18 commentedon Nov 23, 2026
Reabierto durante la preparación de la contraauditoría 0.7.0. El cierre previo como “completed” era inconsistente con la descripción y los comentarios post-merge: #123 cubre únicamente el TTL inclusivo InMemory y #114 el tuple Redis; no hay evidencia de cierre completo para clear/close/ownership, fallos de Redis, clock-skew comparado, ni matriz instalada Memcached/DynamoDB.
Próximo criterio: pruebas instaladas independientes por backend, matriz explícita PASS/FAIL/NOT RUN y límites de soporte documentados. No equiparar merge o CI verde con aceptación de todo #111. #130 es solo higiene de identidad del candidato, no satisface este gate.
agustin18 commentedon Nov 23, 2026
0.7 risk disposition proposed, not final conformance certification
See PR #135 risk register and prepromotion audit assignment. Merged #114/#123/#131/#133 characterize Redis tuple and sentinel/EX=0 differences, InMemory inclusive TTL/clock rollback, empty bytes, client ownership and Docker real Redis stop/restart with retries explicitly disabled. These do not qualify experimental Memcached/DynamoDB parity, default redis-py retry latency, cluster namespace clear or all clear/close/cancel races.
Review selected 0.7 supported contract cases PASS/FAIL/NOT RUN; P0/P1 reproduced blockers cannot be waved away. Keep #111 OPEN for the broad matrix beyond this limited release. No final acceptance is claimed.
agustin18 commentedon Nov 23, 2026
0.7.0 final-candidate backend risk disposition — NARROW SCOPE ACCEPTED
Under the maintainer's explicit authorization, the following documented limitations are accepted only for source
df884644f11eb0e36ae5d74721009fc8e4470c4band the exact 0.7.0 artifacts, pending final independent artifact/security review. This is not universal certification under issue #111.now >= deadline), not monotonic. Backward clock shifts can extend a value that has not yet expired.get_with_ttl()returns a tuple. Redis reports missing TTL as-2versus InMemory's0; RedisEX <= 0raises rather than silently normalizing. Preserve these differences.clear(namespace)is unsupported.Retry(NoBackoff(), 0). It does not qualify default redis-py retry latency, Sentinel, TLS, Cluster, managed failover or HA.The final Phase B run passed all 12 Redis 7.4 migration/rollback jobs for wheel/sdist on Python 3.8–3.13, within the full 20-job first-attempt run. A new reproducible package-owned P0/P1 issue still blocks release. Keep #111 OPEN for broader backend support and untested cases.
NOT RUNis notPASS.This is not approval to tag or publish. Final evidence: #126.
test(backends): qualify installed D4 contracts and experimental limit…
test(backends): split D4 assertions for Ruff (#111)
refactor(backends): codify capability, ownership and failure contracts (