feat(supabase): add findings_* tables for paper-figure summaries (formula-code/fc-eval#19) - #25
Merged
Merged
Conversation
…mula-code/fc-eval#19)
Adds eight public-read tables backing the seven paper-figure summaries on
api.formulacode.org/rest/v1/findings_*:
findings_global_leaderboard Table 1
findings_stratified_advantage Figure 3
findings_tag_advantage Table 2
findings_repo_quintiles Table 3
findings_cost_pareto Figure 4 / Table 10
findings_workload_tradeoff Figure 5
findings_temporal_generalization Table 4 / Figure 1
findings_metadata sidecar: _source / _generated_at /
axis_metadata / row_count per finding
Row column names align with the canonical scaffolds at
formula-code/formula-code.github.io:src/data/findings/f{1..7}_*.json
(rp_rank, advantage_norm, speedup_geomean, worst_workload_speedup,
cost_usd_per_task + advantage_weighted). Per-task rows in
findings_workload_tradeoff use (owner, repo, issue_number) to match
pull_requests / harbor_runs.
RLS + anon grants mirror 00012_public_read_rls.sql + 00015_revoke_anon_select.sql:
enable RLS, public_read SELECT policy for anon, then explicit GRANT SELECT
(since 00015 revoked the schema-wide anon default).
Rows are refreshed by analysis/export_website_findings.py in fc-eval
(separate; not yet upstreamed). Pending follow-up after merge:
1. supabase migration up on prod
2. uv run analysis/export_website_findings.py --upsert-supabase
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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
Adds the database half of formula-code/fc-eval#19: eight public-read tables backing the seven paper-figure summaries the website (formula-code/formula-code.github.io) currently ships as static JSON under `src/data/findings/f{1..7}_*.json`.
Once this lands and the exporter populates rows, the website's `findings.js` shim can swap from static JSON to live PostgREST fetches at `https://api.formulacode.org/rest/v1/findings_*\` — no API gateway changes required (same anon-key surface as `repositories` / `pull_requests` / `harbor_runs`).
Tables added
Schema choices
Test plan
Local apply + RLS sanity:
```bash
make supabase-up
docker exec supabase_db_datasmith_new psql -U postgres -d postgres \
-f /dev/stdin < supabase/migrations/00021_findings_tables.sql
RLS gating is in place:
docker exec supabase_db_datasmith_new psql -U postgres -d postgres -c \
"SELECT tablename, policyname FROM pg_policies WHERE tablename LIKE 'findings_%';"
→ 8 rows, all 'public_read'
Anon SELECT returns 200 OK (empty before exporter runs):
curl -s -H "apikey: $SUPABASE_ANON_KEY" \
http://127.0.0.1:54321/rest/v1/findings_global_leaderboard?select=*
```
Schema verification against canonical contract: each table's columns are a 1:1 match for the website scaffolds at `formula-code/formula-code.github.io:src/data/findings/f{1..7}_*.json` (verified during plan phase).
Follow-up
🤖 Generated with Claude Code