-
Notifications
You must be signed in to change notification settings - Fork 0
v1.2.1 — three shipped service-role defects, four more, five review findings, and two regressions the fixes themselves introduced #7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
9c281e8
v1.2.1: three shipped service-role defects, a regression caught befor…
chiibitsu dad377c
v1.2.1: four review findings, one of them a false green, and the self…
chiibitsu 9547e04
Two regressions from the last commit, a false green it did not close,…
chiibitsu d2d2191
Two more false greens the last fix introduced, the false green it did…
chiibitsu 7ca2720
Replace both extractors with tokenisers: the regex was the defect, no…
chiibitsu 96e95a4
The baseUrl probe refused to look at the paths most likely to need it…
chiibitsu 3ace9d8
The tokenisers shipped a silent pass, a false green, and a quadratic …
chiibitsu 842d416
A stage that cannot see strings was deciding what the scanner would read
chiibitsu 036f939
Make good on a claim the last commit made about the README
chiibitsu 8867c72
Two false greens the last commit added, and one byte that could hide …
chiibitsu cdbbb9b
Dollar-quoted bodies are data, and the ALTER side did not know what t…
chiibitsu 6ee6636
The README claimed every grep passes -a; two more gates did not, and …
chiibitsu f4f7c93
Three P1 false greens Codex found in the tokeniser, two of them regre…
chiibitsu File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
Large diffs are not rendered by default.
Oops, something went wrong.
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
2 changes: 2 additions & 0 deletions
2
...ns-lint/bad/cases/alter-table-named-if/supabase/migrations/20260110000000_orders.down.sql
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
| drop table if exists public.orders; | ||
| drop table if exists public."if"; |
9 changes: 9 additions & 0 deletions
9
...rations-lint/bad/cases/alter-table-named-if/supabase/migrations/20260110000000_orders.sql
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| -- `if` and `exists` are non-reserved in PostgreSQL and are legal table names — the create | ||
| -- side already knew that. The ALTER side swallowed them wherever they appeared, so it bound | ||
| -- `enable` as the table name here, emitted no RLS record, and reported a violation on a file | ||
| -- that enables RLS correctly. The planted violation is `orders`, which genuinely has none; | ||
| -- the point of the file is that `if` must NOT also be reported. | ||
| create table if (id int); | ||
| alter table if enable row level security; | ||
|
|
||
| create table public.orders (id int); |
2 changes: 2 additions & 0 deletions
2
...t/bad/cases/comment-marker-in-a-string/supabase/migrations/20260106000000_orders.down.sql
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
| drop table if exists public.orders; | ||
| drop table if exists public.notes; |
13 changes: 13 additions & 0 deletions
13
...s-lint/bad/cases/comment-marker-in-a-string/supabase/migrations/20260106000000_orders.sql
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| -- A `/*` INSIDE a string literal. Comment stripping used to run as a separate stage with no | ||
| -- string state, so this opened a block comment that deleted every line until the `*/` in the | ||
| -- string below it — taking the create table with it. Verified against PostgreSQL 16: the file | ||
| -- applies cleanly and leaves public.orders with RLS off, while the gate reported ok, exit 0. | ||
| -- The two surviving quotes pair up, so the unterminated-string guard never fired either. | ||
| create table public.notes (body text); | ||
| alter table public.notes enable row level security; | ||
|
|
||
| insert into public.notes (body) values ('x /* y'); | ||
|
|
||
| create table public.orders (id int); | ||
|
|
||
| insert into public.notes (body) values ('*/ z'); |
2 changes: 2 additions & 0 deletions
2
...ations-lint/bad/cases/cross-schema-rls/supabase/migrations/20260102000000_orders.down.sql
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
| drop table if exists archive.orders; | ||
| drop table if exists public.orders; |
9 changes: 9 additions & 0 deletions
9
.../migrations-lint/bad/cases/cross-schema-rls/supabase/migrations/20260102000000_orders.sql
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| -- RLS ON A DIFFERENT SCHEMA'S SAME-NAMED TABLE. The create side discarded the schema | ||
| -- qualifier after reading it, so the check asked only "does SOME table called orders, in SOME | ||
| -- schema, have RLS?" while the message named one specific table. Both statements below are | ||
| -- accepted by PostgreSQL and the resulting state really does leave public.orders unprotected. | ||
| -- Two schemas holding a same-named table is an ordinary layout, not a contrivance. | ||
| create table public.orders (id uuid primary key, owner uuid); | ||
|
|
||
| create table archive.orders (id uuid primary key, owner uuid); | ||
| alter table archive.orders enable row level security; |
1 change: 1 addition & 0 deletions
1
...-lint/bad/cases/multiline-create-table/supabase/migrations/20260104000000_orders.down.sql
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| drop table if exists public.orders; |
8 changes: 8 additions & 0 deletions
8
...tions-lint/bad/cases/multiline-create-table/supabase/migrations/20260104000000_orders.sql
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| -- The table name is on the line after `create table`. grep is line-scoped, so the statement | ||
| -- was not seen at all and the file passed with no RLS anywhere in it: a silent green, which | ||
| -- is the one outcome this toolkit refuses. The tokeniser reads statements, not lines. | ||
| create table | ||
| public.orders ( | ||
| id uuid primary key, | ||
| owner uuid | ||
| ); |
1 change: 1 addition & 0 deletions
1
...ons-lint/bad/cases/non-utf8-identifier/supabase/migrations/20260107000000_orders.down.sql
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| drop table if exists public.clean; |
7 changes: 7 additions & 0 deletions
7
...grations-lint/bad/cases/non-utf8-identifier/supabase/migrations/20260107000000_orders.sql
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| -- A LATIN1 byte in a quoted identifier. `grep` without `-a` calls the records file | ||
| -- binary under an ordinary UTF-8 locale, SUPPRESSES the matching line and still exits 0, | ||
| -- so this table never reached the comparison and was never checked. The clean table | ||
| -- beside it was, which is what made the loss invisible: one violation reported where | ||
| -- two are planted. PostgreSQL 16 confirms both tables are real and both have RLS off. | ||
| create table public.clean (id int); | ||
| create table public."a�o" (id int); |
1 change: 1 addition & 0 deletions
1
...s-lint/bad/cases/quote-inside-a-string/supabase/migrations/20260105000000_orders.down.sql
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| drop table if exists public.orders; |
10 changes: 10 additions & 0 deletions
10
...ations-lint/bad/cases/quote-inside-a-string/supabase/migrations/20260105000000_orders.sql
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| -- ONE double quote inside an ordinary string literal. The scanner had no single-quoted-string | ||
| -- state, so this `"` opened a quoted identifier that ran to the end of the file and every | ||
| -- statement after it was invisible: the create below had no RLS anywhere and the file | ||
| -- reported ok, exit 0. An inch mark in seed data is enough to do it. | ||
| insert into public.products (name) values ('24" monitor'); | ||
|
|
||
| create table public.orders ( | ||
| id uuid primary key, | ||
| owner_id uuid not null | ||
| ); |
2 changes: 2 additions & 0 deletions
2
...-lint/bad/cases/quoted-identifier-case/supabase/migrations/20260103000000_orders.down.sql
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
| drop table if exists public."Orders"; | ||
| drop table if exists public.orders; |
8 changes: 8 additions & 0 deletions
8
...tions-lint/bad/cases/quoted-identifier-case/supabase/migrations/20260103000000_orders.sql
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| -- PostgreSQL folds an unquoted identifier to lower case and keeps a quoted one exactly, so | ||
| -- "Orders" and orders are two different tables. The extractor lowercased both and the RLS | ||
| -- search was case-insensitive, so RLS on one satisfied a create of the other — a false green. | ||
| -- The quoted PascalCase form is what Prisma and Drizzle emit, so this is not a contrivance. | ||
| create table public."Orders" (id uuid primary key, owner uuid); | ||
|
|
||
| create table public.orders (id uuid primary key, owner uuid); | ||
| alter table public.orders enable row level security; |
2 changes: 2 additions & 0 deletions
2
...lint/bad/cases/quoted-schema-qualifier/supabase/migrations/20260101000000_orders.down.sql
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
| drop table if exists "public"."orders"; | ||
| drop table if exists public.public; |
12 changes: 12 additions & 0 deletions
12
...ions-lint/bad/cases/quoted-schema-qualifier/supabase/migrations/20260101000000_orders.sql
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| -- The schema qualifier is quoted SEPARATELY from the table: "public"."orders". The extractor | ||
| -- read the first identifier it could and took `public` for the table name, so the RLS check | ||
| -- below was run against a table called public rather than against orders. | ||
| -- | ||
| -- This fixture is shaped to discriminate. A table actually named `public` exists here and | ||
| -- does enable RLS, so the broken reading finds what it is looking for and the file passes, | ||
| -- with orders — the real table, with no RLS — never checked at all. A gate that reads the | ||
| -- name correctly checks orders, finds no RLS, and goes red. Before the fix: green. After: red. | ||
| create table public.public (id uuid primary key); | ||
| alter table public.public enable row level security; | ||
|
|
||
| create table "public"."orders" (id uuid primary key); |
1 change: 1 addition & 0 deletions
1
...ad/unknown/ddl-in-a-dollar-quoted-body/supabase/migrations/20260109000000_orders.down.sql
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| drop function if exists public.f(); |
13 changes: 13 additions & 0 deletions
13
...int/bad/unknown/ddl-in-a-dollar-quoted-body/supabase/migrations/20260109000000_orders.sql
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| -- A dollar-quoted body is data, like any other string. Scanning it as SQL made the create | ||
| -- below a FAIL naming public.tmp — a table that does not exist at definition time and is | ||
| -- created only when the function runs. A red on a compliant file, naming a table nobody | ||
| -- created, which is the shape this gate refuses. | ||
| -- | ||
| -- `do $$ … $$` does execute immediately, so a create inside one is real; but the gate cannot | ||
| -- see whether RLS follows it inside the body either. UNKNOWN is the honest answer for both: | ||
| -- still red, still blocking, and claiming nothing it has not established. | ||
| create function public.f() returns void language plpgsql as $$ | ||
| begin | ||
| create table public.tmp (id int); | ||
| end | ||
| $$; |
1 change: 1 addition & 0 deletions
1
...bad/unknown/modifier-table-in-a-string/supabase/migrations/20260108000000_orders.down.sql
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| drop table if exists public.o; |
9 changes: 9 additions & 0 deletions
9
...lint/bad/unknown/modifier-table-in-a-string/supabase/migrations/20260108000000_orders.sql
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| -- `execute` running DDL this gate cannot follow must be UNKNOWN, and it was — until the | ||
| -- modifier allowance in that test was written as {0,2}, which mawk miscompiles to zero | ||
| -- repetitions when the group starts with a +-quantified bracket. The allowance was inert and | ||
| -- the test became exactly `create table`, so this line passed over silently. PostgreSQL 16 | ||
| -- confirms it creates a persistent unlogged table with RLS off. | ||
| create table public.o (id int); | ||
| alter table public.o enable row level security; | ||
|
|
||
| do $x$ begin execute 'CREATE UNLOGGED TABLE public.x (id int)'; end $x$; |
Binary file added
BIN
+258 Bytes
fixtures/nextjs-env/bad/cases/nul-byte-hides-the-name/src/config.ts
Binary file not shown.
4 changes: 4 additions & 0 deletions
4
fixtures/service-role/bad/cases/aliased-duplicate-path/package.json
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| { | ||
| "name": "fixture", | ||
| "dependencies": { "next": "15.0.0" } | ||
| } |
2 changes: 2 additions & 0 deletions
2
fixtures/service-role/bad/cases/aliased-duplicate-path/src/app/page.tsx
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
| import { key } from "@/lib/secret"; | ||
| export default function Page() { return <main>{key ? "y" : "n"}</main>; } |
2 changes: 2 additions & 0 deletions
2
fixtures/service-role/bad/cases/aliased-duplicate-path/src/app/x/page.tsx
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
| import { key } from "../../lib/secret"; | ||
| export default function X() { return <main>{key ? "y" : "n"}</main>; } |
1 change: 1 addition & 0 deletions
1
fixtures/service-role/bad/cases/aliased-duplicate-path/src/lib/secret.ts
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| export const key = process.env.SUPABASE_SECRET_KEY; |
6 changes: 6 additions & 0 deletions
6
fixtures/service-role/bad/cases/aliased-duplicate-path/tsconfig.json
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| { | ||
| "compilerOptions": { | ||
| "baseUrl": ".", | ||
| "paths": { "@/*": ["./src/*"] } | ||
| } | ||
| } |
1 change: 1 addition & 0 deletions
1
fixtures/service-role/bad/cases/baseurl-absolute-import/package.json
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| { "name": "fixture-baseurl-absolute-import", "dependencies": { "next": "15.0.0" } } |
9 changes: 9 additions & 0 deletions
9
fixtures/service-role/bad/cases/baseurl-absolute-import/src/app/page.tsx
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| // Next.js "Absolute Imports": baseUrl alone, no paths alias anywhere. `lib/supabase-admin` | ||
| // means `src/lib/supabase-admin.ts`. The gate parsed this baseUrl — it is the base for every | ||
| // alias target — and still skipped this bare specifier as a published package. Written | ||
| // `../lib/supabase-admin`, the same file and the same secret were caught. | ||
| import { admin } from "lib/supabase-admin"; | ||
|
|
||
| export default function Page() { | ||
| return admin; | ||
| } |
1 change: 1 addition & 0 deletions
1
fixtures/service-role/bad/cases/baseurl-absolute-import/src/lib/supabase-admin.ts
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| export const admin = process.env.SUPABASE_SERVICE_ROLE_KEY; |
1 change: 1 addition & 0 deletions
1
fixtures/service-role/bad/cases/baseurl-absolute-import/tsconfig.json
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| { "compilerOptions": { "baseUrl": "src" } } |
10 changes: 10 additions & 0 deletions
10
fixtures/service-role/bad/cases/baseurl-dot-absolute-import/app/page.tsx
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| // `"baseUrl": "."` is the spelling in Next.js's own Absolute Imports documentation and the | ||
| // one create-next-app ships. The first version of the baseUrl fallback armed on the VALUE | ||
| // rather than on the key being present, and "." is exactly the value it excluded — so the | ||
| // false green it was written to close stayed open on the commonest spelling, while the | ||
| // fixture beside this one used "src" and kept the selftest green over the half that worked. | ||
| import { admin } from "lib/supabase-admin"; | ||
|
|
||
| export default function Page() { | ||
| return admin; | ||
| } |
1 change: 1 addition & 0 deletions
1
fixtures/service-role/bad/cases/baseurl-dot-absolute-import/lib/supabase-admin.ts
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| export const admin = process.env.SUPABASE_SERVICE_ROLE_KEY; |
1 change: 1 addition & 0 deletions
1
fixtures/service-role/bad/cases/baseurl-dot-absolute-import/package.json
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| { "name": "fixture-baseurl-dot-absolute-import", "dependencies": { "next": "15.0.0" } } |
1 change: 1 addition & 0 deletions
1
fixtures/service-role/bad/cases/baseurl-dot-absolute-import/tsconfig.json
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| { "compilerOptions": { "baseUrl": "." } } |
1 change: 1 addition & 0 deletions
1
fixtures/service-role/bad/cases/baseurl-nonpackage-name/package.json
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| { "name": "fixture-baseurl-nonpackage-name", "dependencies": { "next": "15.0.0" } } |
1 change: 1 addition & 0 deletions
1
fixtures/service-role/bad/cases/baseurl-nonpackage-name/src/_components/Button.ts
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| export const admin = process.env.SUPABASE_SERVICE_ROLE_KEY; |
10 changes: 10 additions & 0 deletions
10
fixtures/service-role/bad/cases/baseurl-nonpackage-name/src/app/page.tsx
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| // An underscore-prefixed private folder is an ordinary Next.js convention, and a leading | ||
| // underscore is not a valid npm package name. The baseUrl probe was gated on the specifier | ||
| // LOOKING like a package, so it skipped exactly the names most likely to be baseUrl-relative: | ||
| // this file resolves under baseUrl and was reported UNKNOWN anyway — a red on a tree the gate | ||
| // could read perfectly well, and one that hides the violation underneath it. | ||
| import { admin } from "_components/Button"; | ||
|
|
||
| export default function Page() { | ||
| return admin; | ||
| } |
1 change: 1 addition & 0 deletions
1
fixtures/service-role/bad/cases/baseurl-nonpackage-name/tsconfig.json
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| { "compilerOptions": { "baseUrl": "src" } } |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| { | ||
| "name": "fixture", | ||
| "dependencies": { "next": "15.0.0" } | ||
| } |
2 changes: 2 additions & 0 deletions
2
fixtures/service-role/bad/cases/circular-import/src/app/page.tsx
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
| import { b } from "../lib/b"; | ||
| export default function Page() { return <main>{b ? "y" : "n"}</main>; } |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
| import { b } from "./b"; | ||
| export const a = b; |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| // b imports a, a imports b. Before the paths were canonicalised this pair grew a longer | ||
| // spelling every hop, the visited set never matched, and the walk did not terminate. | ||
| import { a } from "./a"; | ||
| export const b = a ?? process.env.SUPABASE_SECRET_KEY; |
9 changes: 9 additions & 0 deletions
9
fixtures/service-role/bad/cases/declaration-sidecar/app/page.jsx
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| // A hand-written declaration sits beside the implementation. Probing the declaration first | ||
| // resolved to a file that BY CONSTRUCTION cannot hold a secret, and lib/admin.js — the module | ||
| // Node actually loads — was never read. Deleting the .d.ts turned the same tree red, which is | ||
| // the sidecar doing the hiding. | ||
| import { admin } from "../lib/admin.js"; | ||
|
|
||
| export default function Page() { | ||
| return admin; | ||
| } |
1 change: 1 addition & 0 deletions
1
fixtures/service-role/bad/cases/declaration-sidecar/lib/admin.d.ts
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| export declare const admin: string | undefined; |
1 change: 1 addition & 0 deletions
1
fixtures/service-role/bad/cases/declaration-sidecar/lib/admin.js
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| export const admin = process.env.SUPABASE_SERVICE_ROLE_KEY; |
1 change: 1 addition & 0 deletions
1
fixtures/service-role/bad/cases/declaration-sidecar/package.json
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| { "name": "fixture-declaration-sidecar", "type": "module", "dependencies": { "next": "15.0.0" } } |
1 change: 1 addition & 0 deletions
1
fixtures/service-role/bad/cases/division-after-brace/lib/admin.js
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| export const admin = process.env.SUPABASE_SERVICE_ROLE_KEY; |
1 change: 1 addition & 0 deletions
1
fixtures/service-role/bad/cases/division-after-brace/package.json
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| { "name": "fixture-division-after-brace", "dependencies": { "next": "15.0.0" } } |
10 changes: 10 additions & 0 deletions
10
fixtures/service-role/bad/cases/division-after-brace/pages/index.js
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| // A slash after `}` is division here, not a regex. Treating `}` as a regex position made the | ||
| // scanner consume the rest of the line looking for a closing slash — swallowing the real | ||
| // import beside it. ok, exit 0, on a module reaching the key, where the pre-tokeniser | ||
| // extractor caught it. A block close can precede a regex, so this trades a rare false red | ||
| // for a false green, which is the trade this toolkit takes every time. | ||
| const x = {} / foo; import { admin } from "../lib/admin"; | ||
|
|
||
| export default function Page() { | ||
| return admin; | ||
| } |
1 change: 1 addition & 0 deletions
1
fixtures/service-role/bad/cases/emitted-extension-import/app/admin.mts
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| export const admin = process.env.SUPABASE_SERVICE_ROLE_KEY; |
7 changes: 7 additions & 0 deletions
7
fixtures/service-role/bad/cases/emitted-extension-import/app/page.tsx
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| // nodenext makes the import name the EMITTED file (.mjs) while the source is .mts. | ||
| // The gate must follow that mapping; appending extensions to "./admin.mjs" finds nothing. | ||
| import { admin } from "./admin.mjs"; | ||
|
|
||
| export default function Page() { | ||
| return admin; | ||
| } |
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🔒 Security & Privacy | 🛡️ Analyzed with Security Review | 🟠 Major | 🏗️ Heavy lift
🧩 Analysis chain
🤖 get_repo_knowledge executed:
get_repo_knowledge chiibitsu/gates /tmp/coderabbit-repo-knowledge/chiibitsu-gates-6e5ac456/architectureLength of output: 9226
🏁 Script executed:
Repository: chiibitsu/gates
Length of output: 21870
🌐 Web query:
site:github.com/chiibitsu/gates/releases v1.2.0 v1.2.1💡 Result:
The
chiibitsu/gatesrepository currently has no GitHub releases, and both tags appear unavailable:v1.2.0— 404v1.2.1— 404[GitHub releases page] (github.com)
Citations:
🏁 Script executed:
Repository: chiibitsu/gates
Length of output: 23530
Sensitive Data Exposure
Reachability: External
Exploitability: Moderate
CWE: CWE-693
Do not ship v1.2.0 as the default pin.
The template leaves the gates workflow,
gates_ref, and reviewer pinned to v1.2.0. The release table marks v1.2.0 unsafe because itsservice-role.shcan return green for a multiline dynamic import reachingSUPABASE_SERVICE_ROLE_KEY. A warning does not prevent consumers from copying these runnable defaults.Publish the template with a verified v1.2.1 commit SHA in all three references, or prevent the release process from publishing v1.2.0 as the default.
🤖 Prompt for AI Agents
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Correct, and deliberately left open — this is the one thing in this PR that is a repository-owner decision, not a patch. The PR body already flags it; a second independent voice on it is useful, so this thread stays unresolved until it is ruled on.
Why it cannot simply be fixed here: a commit cannot contain its own SHA, so the template pins the previous release by construction. And the previous releases have run out — the Releases table marks both v1.2.0 and v1.1.0 do-not-use (same three
service-role.shdefects), and v1.0.4, the last usable one, has noservice-rolegate at all and noreview.ymlfor the reviewer job to call. There is no existing release that is both usable and complete. The convention has genuinely hit its end, which is the decision that needs making.The options, none of them free:
@REPLACE_WITH_SHA_FROM_README_RELEASES_TABLE) — a consumer who copies without reading gets an immediate unresolvable-ref failure instead of a silently-running defective gate. Converts a quiet trap into a loud one, which is this repository's stated posture everywhere else. Costs the file its status as a runnable example.gates:at v1.0.4,review:at v1.2.0. Runnable and safe, but silently drops theservice-rolegate, which is the opposite failure: a consumer with fewer checks than they think they have.I have not taken 1 or 2 unilaterally. The repository owner explicitly deferred this convention question, and quietly changing it while marking the thread resolved would be exactly the "file starts lying" failure the header warns about.
Two corrections to the analysis, for the record. The web query in the collapsed section reports that this repository has no releases and that both tags 404 — that is wrong. Verified locally:
v1.1.0→7832ea67355f22a3e9077d061f1dd937cead905a. v1.2.0 is merged but not yet tagged, which is a real gap and part of why this pin question is live; v1.2.1 is this PR and cannot be tagged before it merges. Also, the reviewer pin at v1.2.0 is sound on its own terms — the README's own row saysThe reviewer it adds is sound; the gate underneath it is not— so only thegates:andgates_ref:pins carry the defect.Generated by Claude Code
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@chiibitsu, understood. The finding remains valid and should stay open pending the repository-owner decision on the caller-template pinning convention.The concern applies only to
gates:andgates_ref:. Thereview:pin at v1.2.0 is not part of this finding.Thanks for the correction on the tag status and release history.
(ᵔᴥᵔ)
✏️ Learnings added
🧠 Learnings used
You are interacting with an AI system.