[object Object]

← back to Costa Rica

cycle 21 docs: YOLO_NOTES ledger — deterministic (serial) test suite

ab1e4bea09cd22379cc0bbb4b330347a3d65640b · 2026-09-24 02:19:46 -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 ab1e4bea09cd22379cc0bbb4b330347a3d65640b
Author: Steve <steve@designerwallcoverings.com>
Date:   Thu Sep 24 02:19:46 2026 -0700

    cycle 21 docs: YOLO_NOTES ledger — deterministic (serial) test suite
    
    Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
    
    Claude-Session: https://claude.ai/code/session_01TouFkmUGKHtwqpZwgReVic
---
 YOLO_NOTES.md | 15 +++++++++++++++
 1 file changed, 15 insertions(+)

diff --git a/YOLO_NOTES.md b/YOLO_NOTES.md
index 684e35a..f38ac19 100644
--- a/YOLO_NOTES.md
+++ b/YOLO_NOTES.md
@@ -468,3 +468,18 @@ Canonical apply order now: `004_marketplace → 005_apple → 006_contacts → 0
 **Known flake (test-hygiene follow-up):** the real-DB test files occasionally (≈1/3 runs) collide under `node --test` parallelism on `place_id=1` + overlapping date windows (`bookings_no_overlap_stay` EXCLUDE) — intermittent, clears on rerun; the deterministic result is 197/197. New tests use unique far-future windows to avoid ADDING to it, but a cycle to give each real-DB test file its own place/window (or serialize them) would remove the flake.
 
 **Backlog:** approval-enforcement decision + reconciler-cron decision both on Steve's desk (2 gated). Provider-honored idempotency key + sig-encoding (live-only); processorFee schema prerequisite; per-event webhook auto-reply try/catch; the test-parallelism flake. Next cycle: fix the flake (deterministic green matters for the loop), or another cold audit.
+
+## /yoloforever CYCLE 21 (2026-09-24, yf-costa) — deterministic test suite (kill the parallelism flake)
+
+**Fixed the intermittent ~1/3 false-red** that undermined the loop's own gate. Root cause was NOT one data collision but `node --test`'s default file-level PARALLELISM, surfacing in THREE unrelated places:
+- `booking-pay-idempotency` created place_id=1 bookings at bare `CURRENT_DATE..+1` → collided with a parallel file under the `bookings_no_overlap_stay` EXCLUDE.
+- `server-routes` q-floor asserted `oneChar.total === totalAll` (two separately-timed COUNT queries) → a parallel file creating a throwaway ACTIVE place (double-book) shifted the count between them.
+- `async-harden` HTTP-server E2E tests flaked under heavy parallel load (event-loop/resource pressure) — nothing to do with data.
+
+**Three unrelated sources ⇒ remove the concurrency, don't whack-a-mole.** `npm test` is now `node --test --test-concurrency=1` (files serial; within-file tests were already sequential). **Verified: 15 consecutive serial runs, 0 failures; a full serial run is ~3.3s** (negligible). Belt-and-suspenders data isolation added too (booking far-future windows 3000/3100/3200; server-routes count tolerance) so an accidental parallel run is also safer.
+
+**IMPORTANT for the loop:** future gate checks should run **`npm test`** (serial, deterministic), NOT bare `node --test test/*.test.js` (parallel, flaky). The "baseline N/N" in wakeup prompts refers to the serial `npm test`.
+
+**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.

← b6fb0a1 costa-rica: make the test suite deterministic — serialize +  ·  back to Costa Rica  ·  costa-rica: per-event isolation for the WhatsApp inbound aut 8578926 →