# Error Log
<!-- Auto-checked before git push via 1SD threshold hook -->
<!-- Format: add entry when a bug is fixed. Increment Count on repeat. -->
<!-- When Count exceeds mean+2SD → promote rule to docs/LEARNINGS.md -->

---

## How to Use

**Add an error:**
```
## ERR-XXX | Short title
- Date first seen: YYYY-MM-DD
- Count: 1
- Category: UI / DB / API / Deploy / LLM / Logic
- Error: What went wrong (symptom)
- Root cause: Why it happened
- Fix: Exact fix applied
- Prevention: What rule was added / where
```

**Increment count:** When the same error recurs, update `Count: N` → `Count: N+1` and add the new date.

**Summarize:** When prompted (or count spikes), run *"summarize learnings"* to promote to `docs/LEARNINGS.md`.

---

## ERR-001 | Dark hover used solid color instead of opacity ✓ PROMOTED
- Date first seen: 2026-01-10
- Count: 3 → **Promoted to LEARN-001 on 2026-03-29**
- Category: UI / Dark Theme
- Error: Hover backgrounds too harsh in dark mode
- Root cause: Used `dark:hover:bg-slate-750` (solid) instead of opacity-based value
- Fix: Replace with `dark:hover:bg-white/[0.02]`
- Prevention: LEARN-001 — pre-commit now auto-checks for `hover:bg-slate-7` pattern

## ERR-002 | API health tab auto-fetched on every mount
- Date first seen: 2026-01-20
- Count: 2
- Category: UI / Performance
- Error: Expensive API calls fired on every tab switch, not user-triggered
- Root cause: `useEffect` with no guard fetching on component mount
- Fix: Removed auto-fetch, added manual "Refresh" button trigger
- Prevention: CLAUDE.md rule — no auto-fetch on component mount

## ERR-003 | Feature built as standalone page instead of dashboard tab
- Date first seen: 2026-01-25
- Count: 2
- Category: Architecture / UI
- Error: Cost analysis created as `/cost-analysis` route instead of dashboard tab
- Root cause: Not checking CLAUDE.md component patterns before building
- Fix: Migrated to tab inside `frontend/app/dashboard/page.tsx`
- Prevention: CLAUDE.md rule — dashboard tabs over new pages

## ERR-004 | Cron job frequency set too high (5x/day instead of 1x)
- Date first seen: 2026-02-01
- Count: 1
- Category: Cost / Scheduling
- Error: Marketing strategy agent ran 5x/day → $18/mo instead of $3.60/mo
- Root cause: Default frequency not validated against cost impact
- Fix: Set schedule to 1 run/day in `services/schedule-registry.js`
- Prevention: Always estimate monthly cost before setting cron frequency

## ERR-005 | Canvas used overflow-auto instead of CSS transform
- Date first seen: 2026-02-10
- Count: 2
- Category: UI / Canvas
- Error: Workflow canvas pan/zoom broken — content clipped instead of panning
- Root cause: Used `overflow-auto` container instead of transform-based approach
- Fix: Replaced with `transform: translate() scale()` on canvas element
- Prevention: CLAUDE.md pattern — never use overflow-auto on pannable canvases

## ERR-006 | TEDx media metadata lost on Fly.dev restart
- Date first seen: 2026-02-15
- Count: 2
- Category: Deploy / Fly.dev
- Error: Generated images disappeared after Fly machine restart
- Root cause: `.media-metadata.json` stored on ephemeral filesystem, wiped on restart
- Fix: CDN fallback in `index.js` + seed file committed to git + mmdbfiles backup
- Prevention: CLAUDE.md critical note — always commit seed file, use CDN URLs as source of truth

## ERR-007 | Tried to modify pre-built Next.js TSX at runtime
- Date first seen: 2026-02-20
- Count: 1
- Category: Deploy / Next.js
- Error: Runtime TSX file edit had no effect on live site
- Root cause: Next.js is pre-built at deploy time — source files are not read at runtime
- Fix: Used Express middleware CDN redirect instead of modifying source
- Prevention: CLAUDE.md rule — TSX changes require rebuild + redeploy
