EPIC C: Search + Account Lifecycle (Week 2-3) — Phase 3: Scope #34

Closed
opened 2026-05-28 00:57:53 +00:00 by Mark · 2 comments
Owner

Phase 3: Scope

  • Replace primary ILIKE search path with Postgres FTS
  • Implement account deletion end-to-end
  • Add demo seed/reset flow for predictable onboarding demos

Decomposed from nodedesk#3

## Phase 3: Scope - Replace primary ILIKE search path with Postgres FTS - Implement account deletion end-to-end - Add demo seed/reset flow for predictable onboarding demos --- _Decomposed from [nodedesk#3](https://forgejo.tail018ac4.ts.net/Mark/nodedesk/issues/3)_
Author
Owner

⏸ Needs Decision

Blocking factors:

  • Didn't meet auto-approve criteria — scope=medium, risk=medium, spec=aligned

Scope: medium Risk: medium Spec: aligned Type: enhancement
Summary: Replace ILIKE search with functional Postgres FTS (add migration + triggers for searchVector columns that are schema-defined but never created/populated), complete account deletion (already implemented in UI and server action), and harden demo seed/reset scripts.
Suggestion: Add a migration to create tsvector columns + GIN indexes via raw SQL (Prisma doesn't natively support tsvector), then add PostgreSQL triggers on Client/System/Note/WorkLog to auto-update searchVector on INSERT/UPDATE — this avoids touching every action file. Backfill existing rows. Remove the searchContains/SEARCH_MODE fallback since the schema already points at FTS. Account deletion and demo scripts are already implemented but likely need smoke-testing with the new triggers.
Rationale: The FTS infrastructure is half-built: searchVector columns exist in schema.prisma with GIN index annotations, search.ts already has an FTS query path with websearch_to_tsquery + ts_rank_cd, but no migration creates these columns and no triggers or hooks populate them — so FTS returns zero results today. That makes this a ~5-8 file change (1 migration, search.ts cleanup, env.ts, .env.example, seed.ts for trigger-aware backfill). Account deletion is already complete (settings page form + server action with email confirmation + Stripe cancel + cascade delete). Demo scripts exist and work. No test files exist to break. Risk is medium because the migration touches core DB columns and existing data needs backfill, but the schema already defines the columns so forward compatibility is assured.

Action: Review each blocking factor above. Remove blocked:needs-decision label to route back to triage.

## ⏸ Needs Decision **Blocking factors:** - **Didn't meet auto-approve criteria** — scope=medium, risk=medium, spec=aligned --- **Scope:** medium **Risk:** medium **Spec:** aligned **Type:** enhancement **Summary:** Replace ILIKE search with functional Postgres FTS (add migration + triggers for searchVector columns that are schema-defined but never created/populated), complete account deletion (already implemented in UI and server action), and harden demo seed/reset scripts. **Suggestion:** Add a migration to create tsvector columns + GIN indexes via raw SQL (Prisma doesn't natively support tsvector), then add PostgreSQL triggers on Client/System/Note/WorkLog to auto-update searchVector on INSERT/UPDATE — this avoids touching every action file. Backfill existing rows. Remove the searchContains/SEARCH_MODE fallback since the schema already points at FTS. Account deletion and demo scripts are already implemented but likely need smoke-testing with the new triggers. **Rationale:** The FTS infrastructure is half-built: searchVector columns exist in schema.prisma with GIN index annotations, search.ts already has an FTS query path with websearch_to_tsquery + ts_rank_cd, but no migration creates these columns and no triggers or hooks populate them — so FTS returns zero results today. That makes this a ~5-8 file change (1 migration, search.ts cleanup, env.ts, .env.example, seed.ts for trigger-aware backfill). Account deletion is already complete (settings page form + server action with email confirmation + Stripe cancel + cascade delete). Demo scripts exist and work. No test files exist to break. Risk is medium because the migration touches core DB columns and existing data needs backfill, but the schema already defines the columns so forward compatibility is assured. **Action:** Review each blocking factor above. Remove `blocked:needs-decision` label to route back to triage.
Author
Owner

GSD pipeline blocked at IMPLEMENT: API call failed after 3 retries.
]11;?\Error: Error code: 401 - {'detail': 'Unauthorized'}

GSD pipeline blocked at IMPLEMENT: API call failed after 3 retries. ]11;?\Error: Error code: 401 - {'detail': 'Unauthorized'}
Mark 2026-06-15 05:30:41 +00:00
Sign in to join this conversation.
No description provided.