Repository navigation
feat(evals): add resolve-database-005-fix-lint-findings CLI eval (CLI-2711) - #424
Conversation
…e types in resolve-database-005 (CLI-2711)
…abase-005 (CLI-2711)
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
… contents and the checks the agent ran (CLI-2711)
|
Cross-review (Codex) finding — SIGNIFICANT, confirmed:
|
…database-005 (CLI-2711)
|
thanks Andrew, you were right on this one - help and remote runs were both slipping through. Fixed in 4334af5:
the latest refresh shows it working - runs that only ran |
avallete
left a comment
There was a problem hiding this comment.
Thanks, the help/remote fix looks good. Re-review (Codex) raised one minor edge case, non-blocking — address here or in a follow-up as you prefer:
evals/cli/resolve-database-005-fix-lint-findings/commands.ts:78— adb lint/db advisorsinvocation that failed (non-zero exit, no findings printed) still counts toward "ran supabase db lint or db advisors".
…fore checking in resolve-database-005 (CLI-2711)
Current Behavior
The
clisuite has no eval for the resolve loop around the CLI's database checks: runsupabase db lint/supabase db advisorsagainst a local database, then fix what they report. That loop is what users asked for in FDBKIN-21143 and FDBKIN-3130, and what supabase/cli#3839 (db advisorsshipped) and supabase/cli#5868 (--localmissed the API-exposure lints; fixed in 2.110.0-beta.30) shaped.Expected Behavior
Adds
evals/cli/resolve-database-005-fix-lint-findings(CLI-2711). The prompt is "We're about to launch and I want the database in good shape first. Can you run Supabase's database checks on our local database and fix whatever they flag?" It names no command, finding, object or file (fixtures.test.tsguards the word list).The seeded orders app (
local/) has three migrations that apply cleanly but plant exactly five findings, plus a seed with two users' orders andsrc/orders.tsas the app contract (unit_price,rpc('order_total', { p_order_id })):db lint:public.order_total(bigint)still readsoi.priceafter a later migration renamed it tounit_price(plpgsql_check error).db advisors:rls_disabled_in_publicandpolicy_exists_rls_disabledonpublic.order_items,auth_rls_initplanon the orders policy,function_search_path_mutableon theupdated_attrigger function.No stack is running at the start (
projectRunning: false,needsDocker: false).local stack is running for this projectselect 1)ran supabase db lint or db advisorsdb lint reports no errors or warnings in the project functionsdb lint)advisors no longer flag the seeded findingsthe app still reads only its own orders and totalsunit_priceitems andorder_totaltotals asauthenticated;order_totalreturns nothing for orders the caller can't read; anon reads nothing; the trigger still stampsupdated_atevery migration file is recorded in the local migration historyreplaying the migrations and seed reproduces the fixed databaseno container-runtime detoursmetricsfinal report matches what the checks and database showNotes
--remote); it mirrorsdb lint's plpgsql_check call and the splinter predicates inprobe.sql, all in one psql session insidebegin … rollback, so nothing it does persists.order_totalrewritten aslanguage sql,search_path = pg_catalog,alter policy, also revoking anon's grants, editing the seeded migrations thendb reset, a migration wrapped inbegin; … commit;, a trigger stampingclock_timestamp().order_totalorset_updated_at,using (true), revokingauthenticated's grants, renamingunit_priceback, asecurity definerorder_totalthat returns other users' totals, fixing only via psql /db query(replay fails), applying a migration by hand (history fails).db diff -fwithout a laterdb resetormigration repairfails the history check by design: the file isn't recorded, so the nextmigration upwould re-run it.nodaemon/absentare red by design at the stack check:supabase startdefaults to the Docker backend (CLI-2534), as for build-database-005.db resetfor hand-installed extensions or non-idempotentcreate extension; history compares versions only.Verified locally
pnpm --filter @supabase-evals/framework exec vitest run --config vitest.cli-lib.config.ts evals/cli/resolve-database-005-fix-lint-findings(9 files, incl.EVAL.test.tswiring).pnpm --silent eval -- list --experiment-suite cli --eval resolve-database-005-fix-lint-findings→ pinned, stable, beta, next, nodaemon, absent.buildProbeScript→ psql →parseProbeOutput→ checks) run againstsupabase/postgres:17.11.0.004for 16 migration variants: the seeded state fails 3/4/5/7 with the five findings named; the correct fix and each valid alternative pass; each cheat fails with a specific note.pnpm format:check && pnpm typecheck && pnpm test(test:frameworkstops after its 8th smoke check without a judge key;test:cli-librun separately, green).Results
Latest refresh (run 39946200701, after the failed-runs fix, 3 runs per environment):
db advisors, neverdb lint, so it missed theorder_totalerrorEvery Docker-arm failure is an agent gap I've seen in earlier refreshes, and the report judge passed each truthful report. Pass rates on pinned and next move between refreshes with how often the agent asks before running
supabase start: the previous two refreshes (run 39941047477, run 39785046175) passed pinned and next 3/3.All 14
db lint/db advisorsruns that exited non-zero in this refresh wereDbConnectErrors before a stack was up (nodaemon, absent, and pinned run 2 before it started the stack). None were counted, and the check's notes list them as failed runs. No--fail-onrun found anything and exited non-zero this time; that case is covered by unit tests built from earlier refreshes' output.I read every failing transcript and one passing transcript per environment across the refreshes. The passing runs ran
db lintanddb advisorsagainst the local stack (or found theorder_totalbug through their own RLS smoke test), fixed all five findings in a new migration, applied it withmigration up, and re-checked. No false passes.Scorer fixes made along the way, each with regression tests:
db lint(stable, first refresh: an agent gap the lint, behaviour and replay checks already score). The rubric now holds the report to findings from checks the agent ran, and still fails a report that calls an unrun check clean;ran supabase db lint or db advisorscounted help runs (db lint help) and remote targets (--linked,--project-ref,--remote, a non-local--db-url). It now counts only runs against the local stack, notes any remote runs, and the reset /migration up/db querymetrics use the same filter;DbConnectError, a usage dump for a bad flag). A run now counts only when its output shows check results ("results",No issues found,No schema errors found, or lint'sLinting schema:), so a--fail-onrun that exits non-zero because it found something still counts. The reset /migration up/db querymetrics stay attempt counts.Braintrust (latest): pinned · stable · beta · next · nodaemon · absent
Related Issue(s)
Closes CLI-2711
🤖 Generated with Claude Code