feat(evals): eval the connecting to Postgres guide in supabase.com/docs - #257
Open
czenko wants to merge 7 commits into
Open
feat(evals): eval the connecting to Postgres guide in supabase.com/docs#257czenko wants to merge 7 commits into
czenko wants to merge 7 commits into
Conversation
The guide is pick 2 on the docs eval list, at 83,627 views in 90 days and 49.1 percent negative on 104 votes. The eval grades whether it gets an agent to a pooled connection with pooling-safe client settings when the prompt says only where the code runs. The checks come from outside the page: feedback intake (FDBKIN-31335, FDBKIN-13040, FDBKIN-7883, FDBKIN-8653, FDBKIN-19912, DOCS-740), the supabase-postgres-best-practices conn- rules, the Supavisor FAQ, Supacademy's connectivity-and-pooler module, and supabase/agent-skills issue 92. CONNECT.md hands the agent the three connection strings the dashboard prints, with nothing picked, on aws-1 rather than the aws-0 agents recite from memory. Seven file checks grade the string, port, username, and client settings. Two handler checks prove the code reaches the database, one of them against a row the scorer inserts after the code was written. Closes DOCS-1302
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Three checks read only the first postgres-js call site, so a workspace holding a correct module-scope client plus a per-request one in another file scored green. All three now require every site to qualify. The runtime string resolved only through env files, so an agent that set the variable on the platform and recorded the string in vercel.json read as having chosen nothing. Resolution falls back to any workspace file other than CONNECT.md. runProbes catches its own errors, so a failed status read costs the two handler checks rather than collapsing the run to one.
Agents left DATABASE_URL to the deploy, as the seed comment told them to, so no workspace file carried the string they chose and the connection check red all six runs. One of those runs named the transaction pooler and port 6543 in its own code comment. The seed now ships .env with DATABASE_URL empty, which is where the choice becomes observable. Two runs returned the client from a factory called once at module scope, which is correct and which a static read of whether the postgres() call sits inside a function reds. Client lifetime is behavioral now: the probe counts sockets across six invocations and requires one. Two runs set ssl: 'require', and the local database speaks no TLS, so both handler checks red on a more correct solution. The probe now sits in front of the database, answers the SSLRequest, and terminates TLS with a self-signed certificate.
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.
Closes DOCS-1302
Problem
database/connecting-to-postgresis pick 2 on the docs eval list. 83,627 views in 90 days, 49.1 percent negative on 104 votes. Nothing measures whether it gets an agent to a working connection for a serverless runtime.Solution
build-docs-004-postgres-connection,suite: regression,services: [].CONNECT.mdholding the three connection strings the dashboard Connect panel prints with nothing picked, and.env.examplewithDATABASE_URLempty.prepare: false,max, hardcoding, and the migration path.ssl: 'require'connects.supabase-postgres-best-practicesconn-rules, the Supavisor FAQ, Supacademy's connectivity-and-pooler module, and supabase/agent-skills issue 92.CONNECT.mdusesaws-1, notaws-0.aws-0is what agents recite from memory, so the host whitelist only measures anything if the project is on something else.Baseline, six runs, sonnet-5 with and without skills:
Three of six runs pass. All three failures are the pool cap: two left
maxunset, which is 10 on the postgres-js default, and one setmax: 5. Findings and suggested doc changes are on DOCS-1312.One thing for the reviewer to weigh: pool sizing is the only check that discriminates.
CONNECT.mdlabels the three strings the way the dashboard does, so picking the transaction pooler off a label costs an agent nothing. Making the fixture less generous is worth considering after the docs fix lands, so the two changes do not confound each other.Manual testing
Confirm the eval ports are free.
No output. Stop the holder with
supabase stop --project-id <id>if there is any.Confirm discovery and frontmatter.
One
PLANline per experiment, each readingstage=build suite=regression mode=local-stack.Typecheck.
Clean.
Lint the eval.
No fixes applied.