feat: registry schema migration + admin full-field editor + DB-backed leaderboard#208
Merged
Merged
Conversation
- getAgentFinancialSummary: check manifestData.error explicitly; previously a failed manifest query was silently swallowed as null - FinancialTruthSection: show header skeleton while fetch is in flight instead of returning null, preventing layout shift on slow connections
agent_books_history, agent_gdp_history, and agent_economic_events existed only in supabase/archive/ and were never guaranteed to exist in any environment. Code in agent-books-history.ts, gdp-history.ts, and agent-events.ts writes to these tables — without this migration those writes silently fail on fresh or reset environments. All three tables are created with IF NOT EXISTS so the migration is safe to run against databases where the tables were already applied manually from the archive scripts.
Admin editor (0b): - update-agent PATCH now accepts ecosystem, verificationStatus, treasuryHealth, priority, pfp, gitlawbRepo, evidenceSources, adminNotes — all fields validated against vocab before writing - luca-admin edit form gains a Load button that pre-fills all current values from Supabase; every field is now editable in one save — changes flow directly to the UI on next cache refresh DB-backed leaderboard (0c): - agent_gdp_history gains a gdp_json column (migration 20260725000002) to store the full serialized AgentGDP on every computation - getAgentGDP now checks the DB (4h TTL) before running a full buildAgentBooks fan-out — cold Vercel instances return consistent data instead of each recomputing independently - saveGDPSnapshot is called automatically after every fresh GDP build, not only from research/generate
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
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
agent_books_history,agent_gdp_history,agent_economic_events. Addsgdp_jsoncolumn toagent_gdp_historyfor cross-instance caching.getAgentGDPnow uses a DB-backed L2 cache (4h TTL) so cold Vercel instances return consistent data instead of each recomputing independently.Migrations
20260725000001_promote_archive_tables.sqlCREATE TABLE IF NOT EXISTSforagent_books_history,agent_gdp_history,agent_economic_events— code was writing to these tables but they were never in migrations20260725000002_gdp_cache_column.sqlgdp_json jsonbtoagent_gdp_historyfor full-snapshot cachingAll migrations are idempotent — safe to run against databases where the tables already exist.
Admin editor
Before: edit form accepted name, X handle, website, symbol, bio only. No way to load current values — you had to know what was already there.
After:
text[]), admin notes / Luca verdictLeaderboard cache
Before:
getAgentGDPhad a module-level 1h in-memory cache. On Vercel serverless each instance caches independently — cold starts triggered a fullbuildAgentBooksfan-out for every agent, and concurrent instances could return different leaderboard data.After:
gdp-history.tsgainsgetRecentGDPSnapshot()— reads the most recent DB row withgdp_jsonif within 4hgetAgentGDPchecks DB before computing (L1 memory → L2 DB → L3 live compute)saveGDPSnapshot()so subsequent instances hit L2Generated by Claude Code