feat(evals): eval the Edge Function secrets guide in supabase.com/docs - #285
Draft
czenko wants to merge 6 commits into
Draft
feat(evals): eval the Edge Function secrets guide in supabase.com/docs#285czenko wants to merge 6 commits into
czenko wants to merge 6 commits into
Conversation
Adds build-docs-007-edge-function-secrets to the docs suite, with the Managing secrets guide as the subject under test. The seed is a Vite app that calls a provider straight from the browser with the key as a literal. The prompt asks for that to be sorted out and for the local stack to be running, and never names the mechanism. Whether the guide transmits where a local secret has to sit is the measurement. projectRunning is false so the agent owns the stack lifecycle. supabase start bakes supabase/functions/.env into the edge runtime container's environment at creation time, so a file written after the stack is up is invisible to it. Letting the agent start the stack is what makes the runtime claim measurable without the scorer restarting anything. The ignore-rules check uses git check-ignore rather than git ls-files, because the harness strips .git when it copies the seed in and a tracked-file scan matches nothing.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
The first baseline red two checks on every run with "the seeded provider key is not in any file in the workspace". Agents replace the placeholder the seed ships, so a check that hunts the literal reports nothing placed on a solution that placed a working credential in the right file. Both checks now resolve the env name the function reads, minus the names supabase start injects itself, and ask whether that name is set in a file the runtime loads and whether that file is ignored. A function that takes the whole environment at once falls back to asking whether any non-platform credential was placed at all. The ignore check carves out .env.example and its siblings, because shipping a template with a placeholder is the documented habit. A fixture reproducing the baseline failure, where the agent substitutes its own key value, now passes both checks. The fixture that puts the credential in the project-root .env still fails placement, which is the claim the eval exists to make.
The seed's contract read as an open task. It now states what is true: the team builds against POST /functions/v1/suggest, and the endpoint answers 503 with missing_api_key when the credential is not reachable. Same content, so the checks and the fixtures are unaffected. The docblock and README lines that referred to it as a TODO change with it.
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-1305
Problem
The Managing secrets guide is the only place that says where a local secret has to sit for the function runtime to load it. Neither the Supabase agent skill nor Supacademy covers the topic, so the page is the only carrier. Users keep landing on the wrong file: FDBKIN-11884 and CLI-818 both ask for the project-root
.envandsupabase/functions/.envto be told apart, and FDBKIN-12716 and FDBKIN-6831 are the recurring "I set it and the function cannot read it" shape.Nothing in the repo tests an Edge Functions docs page as the subject under test.
deploy-functions-001-edge-function-secretsowns the hosted side and does not touch local loading.Solution
evals/docs/build-docs-007-edge-function-secrets. The seed is a Vite app that calls a provider from the browser with the key as a literal, and a TODO comment fixes the endpoint and themissing_api_keyfailure contract the probe needs.README.md.projectRunning: false, so the agent owns the stack lifecycle.supabase startbakessupabase/functions/.envinto the edge runtime container's environment at creation time, so a file written after the stack is up is invisible to it. Letting the agent start the stack is what makes the runtime claim measurable without the scorer restarting anything.git check-ignorerather thangit ls-files. The harness strips.gitwhen it copies the seed in, so the tracked-file form matches nothing and reads green whatever the project ignores. The same check indeploy-functions-001is affected.Manual testing
pnpm typecheck. Passes.npx biome check evals/docs/build-docs-007-edge-function-secrets/. Clean.pnpm eval:dry -- --suite docs --experiment-suite docs. Planscodex-gpt-5.6-luna-no-skills x build-docs-007-edge-function-secrets..envand failsthe provider key sits where the local function runtime loads it, with the other five failing on the bundle, the function source, and the ignore rules respectively.Baseline
Three runs on
codex-gpt-5.6-luna-no-skills, all 7/11.All three built a function reading
OPENAI_API_KEYfrom the environment, started the stack, and answered{"error":"missing_api_key"}. Two wrotesupabase/functions/.env.exampleand stopped rather than creating the filesupabase startreads. The third wrote no env file. Placement, ignore rules, and the request-time probe agree on every run, which is the source-level claim and the behavioral one corroborating each other.The fourth failure is instrumentation, not the page.
the agent read the Managing secrets guide the prompt referencedreds on every run even though every run reached the page. Codexweb_searchnever setshasContent, because CLI 0.138 manglesopen_pageinto the catch-all and the url-shape fallback inpackages/core/src/docs-results.ts:309leaves it unset. Every docs eval carries this check and docs evals run only on Codex, so it needs a fix that is not scoped to this PR.An earlier baseline on this branch red two checks that hunted the seeded literal. Agents replace it, so those checks reported nothing placed on solutions that placed a credential correctly. Fixed in
6f38449, and a fixture reproducing it is part of the set.