Skip to content

fix(evals): soften the pgTAP coverage rubric in the RLS guide eval - #224

Merged
czenko merged 5 commits into
mainfrom
evals/drop-rls-coverage-judge
Aug 21, 2026
Merged

czenko merged 5 commits into
mainfrom
evals/drop-rls-coverage-judge

Conversation

@czenko

@czenko czenko commented Aug 21, 2026 •

Copy link
Copy Markdown
Contributor

Ref DOCS-1274

Problem

build-docs-002-rls-guide measures whether the RLS guide produces good RLS. Tests are the bonus. The coverage judge graded test craft, and it was the eval's only unreliable check.

An eval passes only when every check passes, so one bonus check turned the whole doc red while all 40 RLS checks were green.

Four runs against the #49276 preview:

Sample Judge config Score Judge verdict on audit
1 5.5, high 43/43 Correct. Thorough suite, passed it
2 5.5, high 42/43 Correct. lives_ok with no state checks
3 5.6-sol, medium 41/43 Correct. Same, plus a broken assertion

The judge was right every time. Its verdict tracked whichever suite the agent wrote that run, which varies. #222 raising the default model and effort did not change that, because the variance was never in the judge.

Solution

Keep the check. Scope the rubric to what the bonus is worth.

The bar is now one assertion against an application table, one allowed case, one denied case, and a role or identity set at least once. Ties go to a pass.

Every craft requirement that produced the reds is dropped, and each is named in the rubric as explicitly acceptable:

Was required Now
All six tables, by name Covering only some is fine
Allow and deny for each of select, insert, update, delete One allowed and one denied anywhere
Allowed write must be shown to change state lives_ok alone is fine
Both anon and authenticated One role is fine
Switch role and identity per case At least once
using-filtered row asserted intact Not required

Renamed to the pgTAP tests exercise access control on the application tables rather than standing in as placeholders, since the old name claimed far more than the rubric now asks.

What it still catches

A suite that tests nothing. Eight select ok(true) placeholders, assertions that never touch the application's tables, or a suite with no allowed case or no denied case anywhere. That floor is the reason to keep a judge here rather than delete the check.

Manual testing

  1. Confirm the change typechecks and formats.

    pnpm typecheck && pnpm biome check evals
  2. Label this PR run-evals-changed and confirm the coverage check passes on suites that previously failed it. Samples 2 and 3 above are the cases to beat: both were rejected only for lives_ok and partial coverage, which the rubric now accepts.

@czenko
czenko requested a review from a team August 21, 2026 16:12
@vercel

vercel Bot commented Aug 21, 2026 •

Copy link
Copy Markdown

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

Project Deployment Actions Updated (UTC)
evals Ready Ready Preview Aug 21, 2026 8:53pm

Request Review

@czenko
czenko marked this pull request as draft August 21, 2026 17:39
@czenko czenko changed the title fix(evals): drop the pgTAP coverage judge from the RLS guide eval fix(evals): soften the pgTAP coverage rubric in the RLS guide eval Aug 21, 2026
@czenko
czenko marked this pull request as ready for review August 21, 2026 18:08
The coverage judge graded test craft, so its verdict tracked whichever
suite the agent wrote that run. An eval passes only when every check
passes, so that failed the RLS guide on the bonus while all 40 RLS
checks were green.

The bar is now one assertion on an application table, one allowed case,
one denied case, and a role set at least once. Partial coverage and
lives_ok alone pass. A suite that asserts nothing still fails.
@czenko
czenko force-pushed the evals/drop-rls-coverage-judge branch from 7950b77 to 2d40115 Compare August 21, 2026 18:16
Comment thread evals/build-docs-002-rls-guide/tests.ts Resolved
@mattrossman mattrossman added the run-evals-changed Add to a PR to refresh only the benchmark evals that have had changes label Aug 21, 2026
@mattrossman mattrossman added run-evals-changed Add to a PR to refresh only the benchmark evals that have had changes and removed run-evals-changed Add to a PR to refresh only the benchmark evals that have had changes labels Aug 21, 2026
@mattrossman

Copy link
Copy Markdown
Collaborator

I've tested by adding run-evals-changed to the PR, and removed / re-added it again for a second run. Note in those sample runs the agent didn't write pgTAP tests so they're still failing and not really testing the new softened rubric.

FWIW I don't think the eval failing is a problem! It's good to hold agents to a high standard, and I see this as an opportunity to strengthen our docs or skill guidance around pgTAP.

Eventually I think we can support partial credit in scorers to make the signal here more refined. In the meantime, if pgTAP truly isn't an important part of the guide, you might consider keeping the check for passive awareness but relaxing the all-or-nothing passed: checks.every((check) => check.passed) in the result.

Given that the sample run didn't test the updated rubric, let me know if you'd like to make this change anyway as a preventative measure or take another approach.

@czenko

czenko commented Aug 21, 2026 •

Copy link
Copy Markdown
Contributor Author

Given that the sample run didn't test the updated rubric, let me know if you'd like to make this change anyway as a preventative measure or take another approach.

@mattrossman Yes, I want to make this change anyway.

I have worked on the doc in an unmerged PR. That is why it is still failing. I have been running the Eval in a test branch and have verified that this passes whereas it was flakey and there was no more doc change I could do to make it pass. That's where this comes from.

@czenko
czenko merged commit ae200dd into main Aug 21, 2026
3 checks passed

This branch was successfully deployed

1 active deployment
Preview — bebb4d01 Deployed Aug 21, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

run-evals-changed Add to a PR to refresh only the benchmark evals that have had changes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants