Skip to content

fix(evals): correct false-negative scoring (seed dir, endpoint case, brittle test check) - #50

Merged
Rodriguespn merged 2 commits into
mainfrom
pedrorodrigues/fix-eval-false-negatives
Jun 22, 2026
Merged

fix(evals): correct false-negative scoring (seed dir, endpoint case, brittle test check)#50
Rodriguespn merged 2 commits into
mainfrom
pedrorodrigues/fix-eval-false-negatives

Conversation

@Rodriguespn

@Rodriguespn Rodriguespn commented Jun 19, 2026

Copy link
Copy Markdown
Contributor

Fixes false-negative eval scoring found while auditing claude-code-haiku-4.5 and claude-code-sonnet-4.6 runs.

Fixed

  • seed never applied in investigate-auth-001-deleted-user-access and investigate-realtime-001-subscribed-no-events because their seed was still under the old seed/ driectory (renamed to remote/. So both ran against an empty DB (scorer threw relation "profiles" does not exist; the realtime judge penalized the agent for rebuilding the scenario it was forced to recreate).
  • build-cli-002's "supabase db diff used" check matched tc.endpoint === "bash", but Claude Code emit "Bash" instead. Lowercased tc.endpoint
  • discoverStackConfig() read the API keys once and threw if absent. Now retries briefly (5×2s) before failing.
  • The agent wrote passing tests and correctly diagnoses posts still failed it, because the "negative tests catch the bug (failedTests > 0)" check hard-coded one test style contradicted the diagnosis judge. Dropped it and kept only the judge assessment.
  • the mock edge runtime's require shim only resolved @supabase/supabase-js and threw "import not supported" for npm:/node:/esm.sh imports the real Deno runtime accepts (build-functions-004 used npm:jwt-decode). Now resolves node: builtins, npm:/jsr:/CDN URLs/bare specifiers (version-stripped) against the runtime's modules; unresolvable packages error clearly instead of being rejected. Verified via bootPlatformBackend (npm:zod + node:crypto → 200).

Notes
These are framework/eval-definition fixes, independent of the Claude Code feature work (#47).

…brittle test check) + status retry

Audit of Claude Code eval runs surfaced false negatives that mis-score any agent:

P1 — seed never applied. investigate-auth-001 and investigate-realtime-001
shipped their seed under `seed/`, but the harness reads hosted state from
`remote/` — so both ran against an empty DB (scorer threw `relation "profiles"
does not exist`; the realtime judge penalized the agent for rebuilding the
scenario it had to recreate). Rename `seed/` → `remote/` for both.

P2a — CLI endpoint case. build-cli-002's "supabase db diff used" check matched
`tc.endpoint === "bash"`, but CLI agents (Claude Code) emit `Bash`, making the
check unwinnable for them. Compare case-insensitively.

P2b — `supabase status` readiness. discoverStackConfig() read the API keys once
and threw if absent, false-failing getClient()-based REST checks when gotrue
hadn't finished coming up. Retry briefly (5×2s) before failing.

build-tests-001 — the "negative tests catch the bug (failedTests > 0)" check
hard-coded one test style (assert correct isolation → fails on the buggy posts
policy) and contradicted the diagnosis judge: an agent that writes passing
characterization tests and correctly diagnoses `posts` (judge passes) still
failed this check. Drop it; the judge already requires identifying `posts` from
the results. Keep files-exist + "tests ran and pass"; de-style the judge wording
("test failures" → "test results").

Not changed: edge-runtime npm-import rejection (needs confirmation that the real
runtime accepts pure-JS imports — the mock may be wrong) and the deliberately
strict RLS judge in resolve-dataapi-001.

sandbox/framework typecheck clean; sandbox tests 24/24.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@vercel

vercel Bot commented Jun 19, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated (UTC)
evals Ignored Ignored Preview Jun 19, 2026 4:05pm

Request Review

…e:/esm.sh)

The real Supabase Edge runtime (Deno) accepts npm:/jsr:/node:/esm.sh and bare
imports, but the mock's require shim only resolved @supabase/supabase-js and
threw "edge function import not supported" for everything else — false-failing
any function that used, e.g., npm:jwt-decode or node:crypto (build-functions-004).

Resolve node-like specifiers against the eval runtime's modules (createRequire):
- node: builtins, npm:/jsr: prefixes, esm.sh/CDN URLs, and bare specifiers, with
  the version stripped (pkg@1.2.3/sub -> pkg/sub).
- @supabase/supabase-js keeps its runtime-fetch shim.
- Node can't fetch on demand like Deno, so a package an eval needs must be
  installed; an unresolvable one now errors clearly ("not available in the eval
  runtime") instead of "import not supported".
- Bumped the vm top-level timeout 100ms→1000ms (require() now loads real packages).

Verified end-to-end via bootPlatformBackend: a function importing npm:zod +
node:crypto returns 200 (previously threw). Confirmed in a temp dir that
npm:jwt-decode resolves+runs too.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

@mattrossman mattrossman left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Down the road we may want to rethink the edge function JS imports stuff, support for @supabase/supabase-js was a short term hack and I wonder how far we can get w/ this solution of installing everything the agent might need in our evals repo deps. Maybe there's a middle ground between that and spinning up the full edge functions runtime in local stack mode, like running actual Deno + letting it resolve deps with any version.

@Rodriguespn

Copy link
Copy Markdown
Contributor Author

Down the road we may want to rethink the edge function JS imports stuff, support for @supabase/supabase-js was a short term hack and I wonder how far we can get w/ this solution of installing everything the agent might need in our evals repo deps. Maybe there's a middle ground between that and spinning up the full edge functions runtime in local stack mode, like running actual Deno + letting it resolve deps with any version.

Answered here

@Rodriguespn
Rodriguespn merged commit aa21e72 into main Jun 22, 2026
5 checks passed
@raulb
raulb deleted the pedrorodrigues/fix-eval-false-negatives branch July 29, 2026 11:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants