Repository navigation
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
This branch has not been deployed
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-1660
Problem
Nothing measures whether the Postgres Triggers guide leads an agent to a trigger that works for app users. A trigger function runs with the rights of whoever made the change. An agent writes one that works when tested as the database owner. Then a signed-in user's update fails with
42501, or the agent opens the target table to make it pass.Evidence:
SECURITY INVOKERlet row level security hide rows from it. The agent's test passed because it ran as the owner.permission denied for table profiles (SQLSTATE 42501), fixed by making the function security definer.The ticket's draft claim, "a trigger fires on the right event", survives as two checks: firing once per row in a bulk update, and not firing on a save that leaves the status unchanged. The evidence points at the privilege failure, so that is the main claim.
Only
benchmark/build-auth-001seeds a trigger, and no eval tests trigger privileges, firing level or unchanged updates.Sources reached: Linear, Slack, agent-skills issues, supabase/supabase issues, troubleshooting guides. Not reached: Hex, Supacademy.
Changes
Adds
build-docs-035-postgres-triggers. An order page needs a status timeline, filled in automatically whoever changes the status. Customers can read their own timeline but never write it. The seed has the timeline table with row level security on and no write policy, andORDERS.mdfixes how the app saves orders.Checks:
Expected signal: The guide does not cover who a trigger runs as,
security definer,WHEN, orUPDATE OF. A trigger written from the page alone fails the customer, bulk and unchanged checks on42501.What part of the guide this tests:
OLDandNEWBEFOREandAFTERBEFOREtrigger that returns null fails, because the change does not landTG_*variables, dropping a trigger, restricted schemasVerification
pnpm exec biome check evals/docs/build-docs-035-postgres-triggerspasses.pnpm --filter @supabase-evals/framework typecheckpasses.pnpm eval:dry -- --suite docs --eval build-docs-035-postgres-triggersplans one pair oncodex-gpt-6-luna-no-skills.codex-gpt-6-luna-no-skillsin therun-evals-changedrun. All three passed all eight checks, including the guide read. A full-marks pass does not show the page carried the run, since a model that knows the security definer pattern produces the same result. Braintrust run.For new or changed evals (see Submitting evals for review):
run-evals-changedlabel or the Refresh eval results workflow (suite: regressionfor framework changes), and linked the Braintrust run here.