← back to Costa Rica
cycle 22 docs: YOLO_NOTES ledger — per-event WhatsApp auto-reply isolation
1ccb0ed51455bff751fe9c2a2d026c1eaa88292a · 2026-09-24 02:44:25 -0700 · Steve
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01TouFkmUGKHtwqpZwgReVic
Files touched
Diff
commit 1ccb0ed51455bff751fe9c2a2d026c1eaa88292a
Author: Steve <steve@designerwallcoverings.com>
Date: Thu Sep 24 02:44:25 2026 -0700
cycle 22 docs: YOLO_NOTES ledger — per-event WhatsApp auto-reply isolation
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01TouFkmUGKHtwqpZwgReVic
---
YOLO_NOTES.md | 14 ++++++++++++++
1 file changed, 14 insertions(+)
diff --git a/YOLO_NOTES.md b/YOLO_NOTES.md
index f38ac19..f920ccf 100644
--- a/YOLO_NOTES.md
+++ b/YOLO_NOTES.md
@@ -483,3 +483,17 @@ Canonical apply order now: `004_marketplace → 005_apple → 006_contacts → 0
**Cost:** $0. Test-only, reversible. Skipped a Cody subagent (a package.json one-liner + date windows + an assertion tolerance is the trivial/precedented case — self-verified the light gate: no test relies on parallelism; the date change only moves the EXCLUDE window not any assertion; the count tolerance still catches a real filter on a 34k table).
**Backlog:** two gated decisions on Steve's desk (host-claim approval + reconciler cron). Provider-honored idempotency key + sig-encoding (live-only); processorFee schema prerequisite; per-event webhook auto-reply try/catch. The determinism fix means the loop's green is now trustworthy. Next cycle: the per-event webhook try/catch follow-up, or another cold audit.
+
+## /yoloforever CYCLE 22 (2026-09-24, yf-costa) — per-event WhatsApp auto-reply isolation (cycle-13 deferred item, clean pass)
+
+**Closed the concrete deferred item from cycle 13.** `routes/webhooks.js` `POST /whatsapp` wrapped `handleInbound()` AND the whole per-event auto-reply for-loop in ONE try/catch — a multi-message payload where the auto-reply `sendButtons` for message N threw (a Graph API error, or a timeout now bounded to ~15s by a prior cycle's `fetchT` wiring) jumped straight to the outer catch, so messages N+1.. in that batch got NO auto-reply.
+
+**Fix:** `handleInbound()` keeps its own try/catch; each event's `sendButtons` now has its OWN try/catch — a failure on one event is logged and doesn't skip its siblings. The route always `res.sendStatus(200)` regardless (never triggers a Meta retry storm).
+
+**Cody gate — clean pass, verified with a NEGATIVE test (not just a positive one):** stashed only the route file, reran the new test against the OLD code → it FAILED (1/13) as expected, proving the test is a real regression guard; against the NEW code → 13/13. Also checked and cleared: the `ev.contact.wa_id` argument-evaluation concern (false alarm — it's inside the try's dynamic extent, self-verified with a quick Node repro); `handleInbound`'s return shape can never produce an event with a missing `.contact`; no new double-processing (dedup runs before `handleInbound`); same-wa_id double-send in one batch is pre-existing/out-of-scope; log-and-swallow matches the existing `confirmBooking` WA-notify pattern.
+
+**Tests (+1, suite 197 → 198, serial/deterministic):** 2 greeting events, first `sendButtons` throws, second still attempted + route still 200s.
+
+**Cost:** $0 (local + one Cody pass — which ran an actual negative-test verification instead of a positive-only rubber-stamp).
+
+**Backlog:** two gated decisions still on Steve's desk (host-claim approval + reconciler cron — 3 and 2 cycles unanswered respectively). Provider-honored idempotency key + sig-encoding (live-only); processorFee schema prerequisite. With this item closed, the concrete-deferred backlog is now empty — next cycle should be another cold audit or a fresh area (Expo/RN app-side review, App Store submission checklist, or KYC-status dead-code cleanup noted back in cycle 9).
← 8578926 costa-rica: per-event isolation for the WhatsApp inbound aut
·
back to Costa Rica
·
costa-rica: close the cr_iban dead-payout path — completenes 789a630 →