fix: allow category_matrix widget + decouple its cache write#100
Merged
Conversation
The posture PR (#99) wrote a new category_matrix row to dashboard_cache, but the table's widget CHECK constraint didn't whitelist it — every compute raised 23514 and, because both rows were upserted together, took the essential category_ranks + history write down with it. Category ranks silently stopped updating (and start/sit/news lost their weak-category context line). - Migration 20260722_category_matrix_widget.sql adds category_matrix to the allowed widget list (apply manually in Supabase SQL editor). - Split _run_category_ranks_compute into two writes: category_ranks + history land first and unconditionally; category_matrix is a separate best-effort upsert, so a matrix failure can never block the essential ranks again. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
railway-app
Bot
temporarily deployed
to
dynastyops-secordlabs / dynastyos-pr-100
July 22, 2026 16:59
Destroyed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The regression
The posture PR (#99) writes a new
category_matrixrow todashboard_cache, but the table'sdashboard_cache_widget_checkconstraint didn't whitelist it. Every_run_category_ranks_computeraised23514, and because both rows were upserted in one batched call, the failure rolled back the essentialcategory_ranks+ history write too.Symptom: category ranks silently stopped updating after deploy; start/sit + news lost their "weakest categories" strategic line (they read
category_ranks). Seen in Railway logs post-sync.Fix
20260722_category_matrix_widget.sql— addscategory_matrixto the allowed widget list (apply manually in Supabase SQL editor, per repo convention).category_ranks+_snapshot_rank_historyland first and unconditionally;category_matrixis now a separate best-effort upsert in its own try/except. A matrix failure can never block the essential ranks/history again (also means it degrades gracefully until the migration is applied).Test
ruffclean.🤖 Generated with Claude Code