DocFast session 148: BUG-111 CORS staging fix + type safety

This commit is contained in:
Hoid 2026-03-09 08:09:28 +01:00
parent 79917c1e5c
commit 2fa9293e45
3 changed files with 30 additions and 2 deletions

View file

@ -1,5 +1,25 @@
# Session Log
## Session 148 — 2026-03-09 07:00 UTC (Monday Morning)
- **Production:** v0.5.1 ✅ healthy, 2 replicas, 0 restarts, ~11d uptime
- **Staging:** v0.5.2 ✅ commit da049b7 (59+ commits ahead of prod)
- **K8s cluster:** All 3 nodes Ready
- **Support:** Zero tickets
- **Completed:**
1. **BUG-111: CORS staging fix (TDD)** — CORS middleware hardcoded `Access-Control-Allow-Origin: https://docfast.dev` for auth/billing routes. Staging frontend modals were silently broken (browser blocked XHR). Fixed with dynamic origin allowlist (docfast.dev + staging.docfast.dev), Vary: Origin header, unknown origins fall back to production. 13 TDD tests added. Commit da049b7.
2. **Eliminate all `as any` casts (TDD)** — Zero `as any` casts remaining in production code. Augmented Express.Request with `requestId`, `acquirePdfSlot`, `releasePdfSlot` via declaration merging. Used Puppeteer's `PaperFormat` and `PuppeteerLifeCycleEvent` types in browser.ts. Used `as const` for format literals. Replaced Stripe apiVersion `as any` with `@ts-expect-error`. Same commit.
3. **Sub-agent platform issue** — Sub-agent spawn failed instantly (same issue as sessions 142-145). Implemented changes directly.
- **Total tests:** 579 (all passing, 0 errors), 51 test files
- **Open bugs:** ZERO 🎉
- **CI runner:** Still absent — push doesn't trigger staging redeploy. Needs investor action.
- **Investor test:**
1. Would a stranger trust this with money? Yes ✅
2. Pod crash = data loss? No — CNPG WAL archiving + MinIO ✅
3. Free tier abuse? No — removed, demo rate-limited ✅
4. Pro key recovery? Yes — with DB fallback across pods ✅
5. Every feature works? Yes ✅
- **Recommendation:** Staging v0.5.2 production-ready. 59+ commits ahead with 579 tests. Awaiting CI runner restoration + investor approval for production tag.
## Session 147 — 2026-03-08 19:00 UTC (Sunday Evening)
- **Production:** v0.5.1 ✅ healthy, 2 replicas, 0 restarts, ~10d uptime
- **Staging:** v0.5.2 ✅ commit a60d379 (58+ commits ahead of prod)