fix(staging): self-heal beat_editors/beat_claims, seed beats table#863
Open
arc0btc wants to merge 1 commit into
Open
fix(staging): self-heal beat_editors/beat_claims, seed beats table#863arc0btc wants to merge 1 commit into
arc0btc wants to merge 1 commit into
Conversation
…805) GET /api/beats 500ed on staging because migration_version was written past the beat_editors/beat_claims migrations (#13, #17) without the tables actually landing — the version counter never retries a migration once it's marked applied. Add both tables (and their indexes) to the always-re-applied SCHEMA_SQL so they self-heal on cold start, same pattern already used for leaderboard_cache. Beat lookups 404ed separately because /api/internal/seed's /test-seed route never seeded the beats table itself — only signals, which reference beat_slug but aren't FK-enforced by sqlite. Add a beats seed block (ordered before signals) and populate fixtures/seed-staging.json with the 7 beats staging's seed signals actually reference.
Deploying with
|
| Status | Name | Latest Commit | Updated (UTC) |
|---|---|---|---|
| ✅ Deployment successful! View logs |
agent-news | af43917 | Jul 13 2026, 04:42 AM |
Contributor
|
Preview deployed: https://agent-news-staging.hosting-962.workers.dev This preview uses sample data — beats, signals, and streaks are seeded automatically. |
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.
Summary
beat_claimsandbeat_editorsare added to the always-re-appliedSCHEMA_SQL(same self-heal pattern already used forleaderboard_cache), so a DO whosemigration_versionwas bumped past Bug: /api/inscriptions returns stale 2024 data #13/ci: add syntax check and Pages Functions build validation #17 without those tables actually landing recovers on next cold start instead of 500ingGET /api/beatsforever on "no such table: beat_editors".POST /api/internal/seed(/test-seedDO route) now accepts abeatsarray and inserts it before signals — previously onlysignals/signal_tags/etc. were seeded, so signals referenced beat slugs that never existed as rows, and everyGET /api/beats/:slug404'd.fixtures/seed-staging.jsonnow includes the 7 beats its seed signals actually reference (bitcoin-macro,quantum,agent-economy,agent-skills,governance,infrastructure,security), matching the canonical name/description/color from the migrations that created them.Context
Closes #805. Root cause was confirmed in the issue thread — this PR implements the two-part fix proposed there (structural self-heal + seed-endpoint fix).
Test plan
tsc --noEmitpasses (verified locally, no new errors from these files)GET /api/beatsreturns 200 with 7 seeded beatsGET /api/beats/bitcoin-macro(and the other 6 slugs) resolve instead of 404🤖 Generated with Claude Code