# Prompt-cache arrival exercise

Anant Mishra · 18 November 2026. Prepared with AI assistance.

Save fixture.json and reproduce.py together. Run `python3 reproduce.py` with Python 3. The verifier checks six exact normalized cost totals with rational arithmetic, equal prefix lengths, expiry-boundary and prefix-identity counterexamples.

The fixture starts empty. A read is eligible only strictly before the stored expiry. Every read or write refreshes expiry. Writes take zero time and entries have unlimited capacity until expiry. These are toy assumptions, including invented tariff multipliers. No API was contacted and no token count, provider hit, invoice, latency or task quality was measured. Modelled cost covers only stable prefixes and excludes all other charges.
