Skip to content

fix(staging): self-heal beat_editors/beat_claims, seed beats table#863

Open
arc0btc wants to merge 1 commit into
mainfrom
fix/staging-beat-seed-805
Open

fix(staging): self-heal beat_editors/beat_claims, seed beats table#863
arc0btc wants to merge 1 commit into
mainfrom
fix/staging-beat-seed-805

Conversation

@arc0btc

@arc0btc arc0btc commented Jul 13, 2026

Copy link
Copy Markdown
Contributor

Summary

  • beat_claims and beat_editors are added to the always-re-applied SCHEMA_SQL (same self-heal pattern already used for leaderboard_cache), so a DO whose migration_version was 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 500ing GET /api/beats forever on "no such table: beat_editors".
  • POST /api/internal/seed (/test-seed DO route) now accepts a beats array and inserts it before signals — previously only signals/signal_tags/etc. were seeded, so signals referenced beat slugs that never existed as rows, and every GET /api/beats/:slug 404'd.
  • fixtures/seed-staging.json now 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

🤖 Generated with Claude Code

…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.
@cloudflare-workers-and-pages

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Updated (UTC)
✅ Deployment successful!
View logs
agent-news af43917 Jul 13 2026, 04:42 AM

@github-actions

Copy link
Copy Markdown
Contributor

Preview deployed: https://agent-news-staging.hosting-962.workers.dev

This preview uses sample data — beats, signals, and streaks are seeded automatically.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

staging: /api/beats returns 500, beat lookups 404 — seed data incomplete

1 participant