#39
RAI-273: simulated week runner (40 shops, 7 days, worker kills, soak)
Part of RAI-273 (the simulated week); the console wiring and Sheets export in that issue are not in this PR. Draft for review.
What
python -m mimi.api.week: one synthetic distributor (Coral Lane) and its 40 shops for a full Lagos week through the real HTTP API, the durable store and real worker processes, with forced SIGKILLs, webhook replays and a soak mode. Scored from the store. Docs: docs/WEEK.md. Reports: docs/runs/week-offline.*, docs/runs/soak-offline.*.
Numbers (offline, ₦0, seed 273, SQLite, 2 workers)
| Mark | Week (6 kills) | Short soak (0.12 h, 3 kills) |
|---|---|---|
| Verdict | PASS, 360 turns, 65.4 s | PASS, 10 weeks, 3,632 turns, 453.5 s |
| Turns complete | 100.0% | 100.0% |
| Invented figures / duplicate sends / lost jobs | 0 / 0 / 0 | 0 / 0 / 0 |
| Replays returning the first turn | 15/15 | 162/162 |
| Budget / daily-cap breaches | 0 / 0 | 0 / 0 |
| Never-tier attempts refused / actions | 4 / 0 | 42 / 0 |
| Forced kills taken over, completed once | 6/6 | 3/3 |
| Lease takeovers with no planned kill | 1 | 26 |
| Claims-gate holds | 11 | 91 |
| Routing (informative, offline) | 98.8% of 338 | 98.7% of 3,417 |
| Latency p50 / p95 / max | 0.50 / 3.09 / 3.31 s | 0.44 / 1.17 / 3.20 s |
| Cost | ₦0; ₦7,185.81 projected (₦19.96/turn) | ₦0; ₦72,677.44 projected (₦20.01/turn) |
Four bugs the week found (fixed here)
mimi/harness/binding.py: "ok noted", "seen", a thumbs up on an open delivery receipt went to small talk and the receipt stayed open. Non-greeting small talk on an open ask now binds as "unclear" (one ask again); a greeting alone still releases.mimi/harness/lexicon.py: "Which shops owe me the most?" was a money misroute to the low-stock report. Newcollector/chasephrase rule.mimi/harness/loop.py: thebudget_hittrace now carriesmax_koboandreserve_kobo, so every figure in the owner's budget note is in the trace.mimi/proof/tools.py: a resent screenshot (same content-hash proof id) skipped its own original, was checked as new, and after the invoice was paid failedtime_after_deliveryand was flagged fake. The original is now kept as prior proof. Regression intests/test_api_helpers.py.
CI
New step in the test job: one simulated day, 2 workers, 1 forced kill (--days 1 --workers 2 --week-kills 1 --no-write, ~26 s locally). make week, make week-day, make week-soak added.
Open items
- One fewer model call per ask turn: needs Tobi's yes and a paid re-record of the recorded answers.
- The 6 h soak with 20 kills and a live week (
--live --max-naira): need a budget yes. - Known gaps (in
docs/WEEK.md): fakes f06/f07 excluded (their tell needs another shop's prior proof the week cannot set up); offline routing misses on the refund probe and one unreadable caption (still refused, no money moves); lease takeovers under load with the 3 s week lease.
Activity
10d8f77b6This pull request is a draft
Merging is unavailable until it is marked ready for review.
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
❤️ Share
Comment
@coderabbitai helpto get the list of available commands.