mirror of
https://github.com/nomadkaraoke/karaoke-gen.git
synced 2026-11-30 17:21:26 +09:00
@coderabbitai ignore Follow-up to #725 — found during post-deploy verification. The error-monitor Cloud Run Job only alerted on patterns its own Cloud Logging scan produced. Frontend crash patterns inserted via the new \`POST /api/client-errors\` endpoint landed in Firestore with \`status=new\`/\`alerted_at=None\` but never fired a Discord alert. ## Fix - New adapter method \`get_unalerted_new_patterns()\` — queries Firestore for \`status=new\` AND \`alerted_at=None\`. - New Step 3b in the monitor cycle merges those out-of-band patterns into \`new_pattern_ids\` + \`groups\` before the LLM/dedup/alert steps. - Early-exit moved from "no log entries" to "no patterns AND no unalerted" so an empty-log cycle still flushes pending frontend alerts. - 3 new unit tests for the adapter method. ## Verified reproduction (pre-fix) Three frontend patterns from #725's live-verification are currently sitting in \`error_patterns\` with \`alerted_at=None\`: - \`fad2f5811881700e...\` (curl probe) - \`f84b386bc152102e...\` (async throw via Firefox) - \`13a3b42284f7e66f...\` (unhandled rejection via Firefox) The 01:31 UTC monitor execution ran and processed 1 backend log entry — our 3 frontend patterns were ignored because they weren't in \`new_pattern_ids\`. ## Test plan - [ ] Merge + deploy. - [ ] Manually trigger the Cloud Run Job (\`gcloud run jobs execute nomad-error-monitor --region=us-central1\`). - [ ] Confirm Discord receives 3 alerts for the pending frontend patterns. - [ ] Confirm those patterns now have \`alerted_at\` set in Firestore. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>