From e7fd7e34e6f985951414196df15d14272284f1f4 Mon Sep 17 00:00:00 2001 From: bchanot Date: Mon, 26 Oct 2026 17:53:37 +0100 Subject: [PATCH] test(supabase): the audit privacy check no longer reads a uuid as a date MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 014 #237 matched « 20[0-9]{2}- » inside a workspace uuid on a long-lived stack. The pattern now reads the metadata without workspace_id, still over every audit row. It would have stopped the DEV procedure at db:test. Found by the V1-1.6 verifier. --- .claude/tasks/contracts/2026-10-26-v1-1-6-animals-ui.md | 6 ++++++ supabase/tests/014_animals_relations.sql | 4 +++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/.claude/tasks/contracts/2026-10-26-v1-1-6-animals-ui.md b/.claude/tasks/contracts/2026-10-26-v1-1-6-animals-ui.md index e8da0e40..36cb974b 100644 --- a/.claude/tasks/contracts/2026-10-26-v1-1-6-animals-ui.md +++ b/.claude/tasks/contracts/2026-10-26-v1-1-6-animals-ui.md @@ -94,3 +94,9 @@ D-R7 form checks; no artificial Rust/wasm call; the boundary choice written in client page now reloads its animals). Fixed: `dropLateReplays` in `e2e/support/sandbox.ts`, called after each test by the three shell specs; the client journey ends on the reloaded animal section; `e2e:shell` 82/82 three runs in a row. +- Verifier round 2 (ECARTS C10): pgTAP 014 #237 « no name, role, breed or date in the audit rows » failed on the + long-lived sandbox: its date pattern `20[0-9]{2}-` matched a workspace uuid (`…2012-…`) in the metadata of a real + row (a false positive, latent since V1-1.4, that would also have stopped the owner's DEV procedure at `db:test`). + Authorised exception to C1 (test file only, no migration): the pattern now reads the metadata without + `workspace_id` (the test before it proves that key is the only one), still over every audit row; counter-checked + (uuid alone: false; a name or a date added: true); pgTAP 919/919 on the sandbox and on PGlite. diff --git a/supabase/tests/014_animals_relations.sql b/supabase/tests/014_animals_relations.sql index ffde347e..2e4de2be 100644 --- a/supabase/tests/014_animals_relations.sql +++ b/supabase/tests/014_animals_relations.sql @@ -784,7 +784,9 @@ select is( ); select is( (select count(*) from audit.audit_logs where split_part(action, '.', 1) in ('animal', 'animal_client_relation') - and (metadata::text ~* '(eclair|bijou|tonnerre|furet|selle|owner|keeper|contact|20[0-9]{2}-)' or correlation_id is not null)), + -- The workspace uuid is left out: its hex digits can read as a year (« …2012-… »); the test above proves it is the only key. + and ((metadata - 'workspace_id')::text ~* '(eclair|bijou|tonnerre|furet|selle|owner|keeper|contact|20[0-9]{2}-)' + or correlation_id is not null)), 0::bigint, 'no name, role, breed or date in the audit rows' ); select is(