Skip to content

feat: cache async dogfood results#121

Merged
douglasmonsky merged 1 commit into
mainfrom
feature/dogfood-warm-cache
Jul 8, 2026
Merged

feat: cache async dogfood results#121
douglasmonsky merged 1 commit into
mainfrom
feature/dogfood-warm-cache

Conversation

@douglasmonsky

Copy link
Copy Markdown
Owner

Summary

  • add warm result caching for async dogfood jobs keyed by request options plus local DB/config fingerprints
  • cache compact aggregate dogfood payloads in memory and on disk under the dogfood cache directory
  • expose result_cache metadata in usage_dogfood_status so agents can see hit/miss/source/cache key
  • document the fast repeat pattern: run fresh once, then repeat with refresh=false and use_cache=true

Real local evidence

  • cold usage_dogfood_start(refresh=False, evidence_limit=4, privacy_mode="strict", write_markdown=False, use_cache=True): ~12.2s
  • next identical run after cache store: disk hit in ~0.0008s
  • next identical run after memory load: memory hit in ~0.0002s

Validation

  • PYTHONPATH=src .venv/bin/python -m pytest -q --tb=short
  • .venv/bin/python -m ruff check .
  • .venv/bin/python -m compileall src
  • python3 scripts/check_release.py
  • git diff --check

Notes

  • Cache hits intentionally require refresh=False; refresh=True still refreshes/recomputes so agents do not accidentally hide newly indexed usage.
  • Cached payloads are the existing compact aggregate dogfood artifacts, not raw logs or indexed snippets.

@douglasmonsky
douglasmonsky merged commit 0debb75 into main Jul 8, 2026
12 checks passed
@douglasmonsky
douglasmonsky deleted the feature/dogfood-warm-cache branch July 8, 2026 13:59
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