Skip to content

fix: cap V1_IDEMPOTENCY_TTL at 30 days (gap #11) - #33

Merged
man4ish merged 1 commit into
mainfrom
feature/m18-30-day-ttl-cap
Oct 4, 2026
Merged

man4ish merged 1 commit into
mainfrom
feature/m18-30-day-ttl-cap

Conversation

@man4ish

@man4ish man4ish commented Oct 4, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • The idempotency-replay cache (V1Store.idempotency_finish) stores the full response body for /v1/literature/answers//search -- real answer text and citations, not just metadata. It's one of only two places in this system where that text survives at all (the other is omnibioai-rag's own query cache, see the companion PR there).
  • The design doc's 30-day question/answer deletion policy had nothing enforcing it: V1_IDEMPOTENCY_TTL already defaults well under 30 days (24h), but nothing stopped a misconfigured env var from raising it past that. Config.V1_IDEMPOTENCY_TTL is now hard-capped at 30 days regardless of what's configured.
  • No new deletion job: there's no durable store (SQL table, disk file) anywhere holding question/answer text -- only this Redis TTL cache. Capping the TTL is the enforcement mechanism; a separate batch-delete job would have nothing to run against.

Test plan

  • pytest tests/test_config.py -q -- 9 passed (2 new)
  • Full suite: pytest -q -- 425 passed
  • ruff check . -- clean

🤖 Generated with Claude Code

V1Store's idempotency-replay cache holds the real answer text and
citations returned by /v1/literature/answers, not just metadata --
one of only two places in this system that text survives at all (the
other is omnibioai-rag's own query cache). The design doc's 30-day
question/answer deletion policy is enforced here as a hard ceiling on
this already-short-lived cache's own TTL (default 24h), not a
separate deletion job -- there is no durable store for one to run
against.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@man4ish
man4ish merged commit 5f7f00e into main Oct 4, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant