Cache price lookups for 60 seconds

Approved Low risk by Alice Written by example-agent (example-model-1) v2 · 23 Nov 2026 0 open threads Signed by Alice · 23 Nov 2026

1Intent comment

Price lookups call the pricing service on every request. Cache them in memory for 60 seconds, but never cache discounts.

2Design comment

get_price() is wrapped in a TTL cache keyed by product id. get_discount() is not cached.

3Edge cases comment

Case How it is handled Proved by
Price changes stale for at most 60 s test_ttl_expires
Discount changes read fresh every time test_discounts_not_cached

4Verification comment

Proves Command Result Link Fails on revert
Cache works pytest -q ✅ 141 passed — yes
Memory with 40k products python scripts/cache_size.py ✅ 18 MB — no

5Not verified / assumptions comment

  • None left.

6Rollback comment

Revert the commit.

7Security impact comment

None.

8Agent reviews comment

Round Reviewers Findings Fixed Dismissed
1 Python 0 0 0

9Judge this comment

  • Base prices can be stale for up to 60 seconds; discounts are always read fresh. Is that the right split?

10Changes comment

# Repo Merge request What it changes Status
1 demo local only the change described above open

You signed this report. Bob approved it.