Skip to content

Commit 8ad6959

Browse files
authored
fix: finish V1 production cleanup (#46)
## Summary - Restore the V2 thread model update grants removed by the runtime privilege rebuild. - Remove the final two V1 pgvector search functions from production. - Let migration-only commits pass the staged Biome hook without bypassing hooks. ## Decisions - Keep the already-applied 0078 migration immutable and add 0079 for the actual `extensions.vector` type identity. - Grant only the V2 column permissions required by the gateway and agent roles. ## Verification - [x] Guarded production migrations applied in their declared phases. - [x] Production readiness validation passes. - [x] Legacy tables, functions, and cron jobs report zero. - [x] V2 user, projects, threads, and runtime grants remain intact. - [x] Lint, typecheck, production build, and live gateway health pass.
1 parent 8857d07 commit 8ad6959

7 files changed

Lines changed: 42 additions & 8 deletions
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
-- 0069 rebuilds the runtime privilege surface after earlier expansions. Model
2+
-- attribution arrived later, so restore only the two V2 update grants its
3+
-- writers require after that rebuild.
4+
grant update (latest_model_id) on table public.v2_threads to app_gateway, app_agent;
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
-- The protected V1 cleanup resolved visible vector arguments as `vector`, not
2+
-- `public.vector`, and therefore left these two exact legacy functions behind.
3+
-- Drop only the audited V1 signatures; RESTRICT preserves the cleanup boundary.
4+
drop function if exists public.match_components(
5+
public.vector,
6+
double precision,
7+
integer
8+
) restrict;
9+
10+
drop function if exists public.match_mobile_components(
11+
public.vector,
12+
double precision,
13+
integer
14+
) restrict;
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
-- Production installs pgvector in `extensions`, so remove the two remaining
2+
-- V1 search functions against their actual argument type identities.
3+
drop function if exists public.match_components(
4+
extensions.vector,
5+
double precision,
6+
integer
7+
) restrict;
8+
9+
drop function if exists public.match_mobile_components(
10+
extensions.vector,
11+
double precision,
12+
integer
13+
) restrict;

infra/supabase/migrations/raw-phases.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,5 +62,8 @@
6262
"infra/supabase/migrations/post/0073_finalize_direct_run_statuses.sql": "post-deploy",
6363
"infra/supabase/migrations/post/0074_remove_product_policy_residue.sql": "post-deploy",
6464
"infra/supabase/migrations/post/0075_attribute_thread_models.sql": "pre-deploy",
65-
"infra/supabase/migrations/post/0076_remove_skill_proposals.sql": "pre-deploy"
65+
"infra/supabase/migrations/post/0076_remove_skill_proposals.sql": "pre-deploy",
66+
"infra/supabase/migrations/post/0077_restore_thread_model_runtime_grants.sql": "pre-deploy",
67+
"infra/supabase/migrations/post/0078_remove_v1_vector_search_functions.sql": "post-deploy",
68+
"infra/supabase/migrations/post/0079_remove_extensions_vector_v1_functions.sql": "post-deploy"
6669
}

lefthook.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ pre-commit:
33
commands:
44
biome-staged:
55
glob: "*.{ts,tsx,js,jsx,json,jsonc}"
6-
run: pnpm biome check --staged --write {staged_files}
6+
run: pnpm biome check --staged --write --no-errors-on-unmatched {staged_files}
77
stage_fixed: true
88

99
commit-msg:

pnpm-lock.yaml

Lines changed: 5 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pnpm-workspace.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ overrides:
4747
'ajv@>=8.0.0 <8.18.0': 8.20.0
4848
'dompurify@<=3.4.10': 3.4.11
4949
'js-yaml@<3.15.0': 3.15.0
50-
'js-yaml@>=4.0.0 <4.2.0': 4.2.0
50+
'js-yaml@>=4.0.0 <4.3.0': 4.3.0
5151
'minimatch@>=10.0.0 <10.2.3': 10.2.5
5252
'path-to-regexp@>=6.0.0 <6.3.0': 6.3.0
5353
'path-to-regexp@>=8.0.0 <8.4.0': 8.4.2

0 commit comments

Comments
 (0)