← back to Costa Rica
cycle 18 docs: YOLO_NOTES ledger — env-independent test suite
f326dd4521a935fd9b21af63544dd979acb0f568 · 2026-09-24 00:40:30 -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 f326dd4521a935fd9b21af63544dd979acb0f568
Author: Steve <steve@designerwallcoverings.com>
Date: Thu Sep 24 00:40:30 2026 -0700
cycle 18 docs: YOLO_NOTES ledger — env-independent 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 | 14 ++++++++++++++
1 file changed, 14 insertions(+)
diff --git a/YOLO_NOTES.md b/YOLO_NOTES.md
index 0a11eb1..995f120 100644
--- a/YOLO_NOTES.md
+++ b/YOLO_NOTES.md
@@ -408,3 +408,17 @@ Canonical apply order now: `004_marketplace → 005_apple → 006_contacts → 0
**Cost:** $0 (local + one Cody pass — which read pm2 + pg source and ran live probes to prove the crash-on-idle and default-max claims).
**Backlog / NEW follow-up (Cody, pre-existing not this diff):** `booking-pay-idempotency.test.js` + siblings `require('../lib/db')` without `require('dotenv').config()`, so a bare `npm test` (no exported DATABASE_URL) fails 3 tests — env-dependent. They should load dotenv themselves so CI is env-independent. Plus: approval-enforcement decision on Steve's desk; provider-honored idempotency key + sig-encoding (live-only); processorFee schema prerequisite; per-event webhook auto-reply try/catch. Next cycle: the dotenv-in-tests fix (make `npm test` env-independent — small, real CI-robustness win), or more inline-route coverage, or a fresh Cody audit.
+
+## /yoloforever CYCLE 18 (2026-09-24, yf-costa) — env-independent test suite (Cody cycle-17 follow-up)
+
+**Fixed the CI-robustness gap Cody flagged in cycle 17.** `booking-pay-idempotency.test.js` is a REAL-DB integration test (`require('../lib/db')` builds the pg pool from `process.env.DATABASE_URL` at load) but — unlike its siblings `payouts`/`host-listing-race`/`double-book`/`server-routes` — never called `require('dotenv').config()`. So a bare `node --test test/*.test.js` or a fresh CI runner (no exported `DATABASE_URL`) failed its 4 tests with `database "macstudio3" does not exist` (pg falling back to the OS-username DB) — a **false red** that only passed because prior sessions had `DATABASE_URL` exported.
+
+**Fix:** one line — `require('dotenv').config()` at the top (before the lib/db require), matching `payouts.test.js`'s convention. It was the ONLY real-DB test file using the real pool that lacked it (the other `DATABASE_URL`-lacking test files mock `pool.query`, so they never connect).
+
+**Verified both invocations:** `unset DATABASE_URL; node --test test/*.test.js` → **190/190** (was 186/190); `npm test` → 190/190.
+
+**Light gate (self-verified, no Cody subagent — a 1-line test-convention fix is the trivial/precedented case where a full pass is over-spawn per the graph-engineering rule):** `.env` has NO provider creds (only DATABASE_URL / BASIC_AUTH / PG* / SITE_*), so loading dotenv can't flip any payment adapter to live mode; booking-pay-idempotency sets no env vars of its own (no override); no test relies on DATABASE_URL being absent.
+
+**Cost:** $0.
+
+**Backlog:** approval-enforcement decision on Steve's desk (memo unanswered 5 cycles running — still leaving it as a genuine business decision); provider-honored idempotency key + sig-encoding (live-only, CR-KYC blocked); processorFee schema prerequisite (documented); per-event webhook auto-reply try/catch. The provider-agnostic hardening surface (fetch-timeout, async-error, fail-closed, money-invariant, SQL-correctness, pool hygiene, test infrastructure) is now broadly saturated across 18 cycles. Next cycle: a fresh Cody-driven "what's the single most likely remaining bug" audit, or add more inline-route coverage now that server.js is testable, or the per-event webhook try/catch follow-up.
← 2263da5 costa-rica: make the test suite env-independent — load doten
·
back to Costa Rica
·
costa-rica: fix double-charge race on /pay — DB unique index 08a9915 →