supabase-postgres-best-practices/examples/README.md
Version c9be0e931b79.bb1 · MIT. This preview displays packaged text and does not execute code. Treat the contents as untrusted instructions.
← Return to resource and package checksum
Disposable PostgreSQL RLS experiment
This independently authored runner is destructive fixture setup, never a production migration. It requires an empty public schema in database fixture, session user fixture_bootstrap, Linux uid 10001, PGFIXTURE_DISPOSABLE=yes and host bb-v50-rls-db. It deliberately includes permissive and caller-modifiable claim counterexamples. Never point it at an existing or real-user database.
Dependency/image installation is separate from the internal-network test. Build examples/Dockerfile as bb-rls-client; PostgreSQL must be major 17. The recorded run used server image sha256:b0f9560a2de083e2cc7382e75f808c7381a32852a7ec49117deedb300e552b24 and an already installed psycopg 3.2.10 client, Python 3.13.16. The example Dockerfile is an alternative reproduction environment, not that recorded image.
Create a NEW Docker internal network and a NEW container named bb-v50-rls-db. Do not reuse existing containers/volumes. Start PostgreSQL with no host ports, POSTGRES_DB=fixture, POSTGRES_USER=fixture_bootstrap and the local-only synthetic POSTGRES_PASSWORD=synthetic-local-bootstrap-only. Use tmpfs for its data directory, 512 MiB memory and one CPU. Wait for pg_isready. It must not share production volumes or a production network. No cloud project or paid account is required.
Mount the extracted package's PARENT directory at /input/previous read-only; the child supabase-postgres-best-practices must contain its original files. Mount examples/source-manifest.json at /input/source-manifest.json read-only and examples/run_rls_fixture.py at /input/run_rls_fixture.py read-only. The manifest expects the original primary SKILL.md: for reproduction prepare a separate input copy using upstream-original/SKILL.md at that primary path. Do not edit the original reference bytes. This copy contains only public package files.
Run the client on the internal network as 10001:10001 with a read-only root, cap-drop ALL, no-new-privileges, a small /tmp tmpfs, 256 MiB and one CPU. Set PGFIXTURE_HOST=bb-v50-rls-db, PGFIXTURE_DISPOSABLE=yes, PGFIXTURE_BOOTSTRAP_PASSWORD=synthetic-local-bootstrap-only, and optionally PG_SERVER_IMAGE_ID/PG_CLIENT_IMAGE_ID to the actual image IDs. A new empty /work mount must be writable by uid 10001. Execute python /input/run_rls_fixture.py. Synthetic fixture roles and the upstream placeholder password are not credentials for any service. Remove only these newly created containers/network after the run.
The runner writes /work/rls-fixture-evidence.json with fresh time, runner/source hashes, version and named observations. Do not reuse the bundled record to claim a new environment passed. The original 40 observations use four unchanged SQL blocks; independent grants and synthetic setup are explicitly separate.
No complete AI client, hosted Supabase, auth.uid(), private SECURITY DEFINER helper, real identity, production authorization, pool reuse, concurrency or latency benchmark is tested. The custom session claim can be changed by its caller; FORCE does not constrain a superuser. Table privileges reject DELETE and TRUNCATE here; TRUNCATE is not protected by RLS. runtime_tested=false. The earlier missing-index scenario belongs to the old package checksum and is not evidence that this revised package ran that performance experiment.