ND-007 FTS search fix closed but never applied to running deployment #43

Closed
opened 2026-07-22 17:48:51 +00:00 by Mark · 2 comments
Owner

Description

Issue #11 (ND-007: Replace primary search with Postgres FTS) was closed at 2026-07-16T15:30:10Z, and the code is correct (12/12 unit tests pass, well-engineered three-tier search strategy with tsvector/GIN indexes). However, the fix was never applied to the running system. Three independent findings confirm the deployment is incomplete.


Finding 1: ND-007 commits not merged to origin/main

The four ND-007 commits exist on the local mirror of main (HEAD 24365ca, 9 commits ahead of origin/main) and on the origin/nd-007-fts-search feature branch, but have not been merged into origin/main. Any deployment tracking the main branch will not pick up the FTS search.

  • Expected: ND-007 commits present on origin/main.
  • Actual: Local main is 9 commits ahead of origin/main. The fix is only available on the feature branch.

Commits in scope:

  • 24365ca ND-007: Three-tier FTS search strategy with tests and docs
  • 0643a0f ND-007: Add search benchmarks (ILIKE vs FTS)
  • bcb2c40 fix: gate Stripe production check on ENV_VALIDATION_STRICT and annotate FTS columns
  • 22a4308 fix: handle generated FTS columns in migration

Finding 2: FTS migration not applied to database

Postgres (nodedesk-pg) is running, but prisma migrate status reports 4 unapplied migrations, including 20260207200000_add_fts_search. The running database lacks the required tsvector generated columns and GIN indexes.

  • Expected: All migrations applied, FTS search functional.
  • Actual: Migration unapplied -- the app would not have FTS capability with the current database state.

Finding 3: App and supporting containers not running

Only the Postgres container is running. Neither nodedesk_app (port 3000) nor nodedesk_minio are running. Port 3000 returns no response.

  • Expected: All three services (app, postgres, minio) running per docker-compose.
  • Actual: Only nodedesk-pg is up.

Steps to Reproduce

  1. Check origin/main for ND-007 commits:

    cd /home/b/Projects/nodedesk && git log origin/main --oneline | grep -i fts
    

    Result: empty -- commits not on origin/main.

  2. Check migration status:

    cd /home/b/Projects/nodedesk && npx prisma migrate status
    

    Result: 4 unapplied migrations including the FTS migration.

  3. Check running containers:

    podman ps --format "{{.Names}}"
    

    Result: Only nodedesk-pg appears.

  4. Check app endpoint:

    curl -s -o /dev/null -w "%{http_code}" http://localhost:3000 || echo "no response"
    

    Result: Connection refused -- app not running.


Kanban Reference

Discovered by probe card t_1a0b2b6c during post-deploy verification of Mark/nodedesk#11. See the probe findings for full details.

## Description Issue #11 (ND-007: Replace primary search with Postgres FTS) was **closed** at 2026-07-16T15:30:10Z, and the code is correct (12/12 unit tests pass, well-engineered three-tier search strategy with tsvector/GIN indexes). However, the fix was **never applied to the running system**. Three independent findings confirm the deployment is incomplete. --- ### Finding 1: ND-007 commits not merged to origin/main The four ND-007 commits exist on the local mirror of `main` (HEAD 24365ca, 9 commits ahead of origin/main) and on the `origin/nd-007-fts-search` feature branch, but have **not been merged into origin/main**. Any deployment tracking the main branch will not pick up the FTS search. - **Expected:** ND-007 commits present on origin/main. - **Actual:** Local main is 9 commits ahead of origin/main. The fix is only available on the feature branch. Commits in scope: - `24365ca ND-007: Three-tier FTS search strategy with tests and docs` - `0643a0f ND-007: Add search benchmarks (ILIKE vs FTS)` - `bcb2c40 fix: gate Stripe production check on ENV_VALIDATION_STRICT and annotate FTS columns` - `22a4308 fix: handle generated FTS columns in migration` ### Finding 2: FTS migration not applied to database Postgres (`nodedesk-pg`) is running, but `prisma migrate status` reports 4 unapplied migrations, including `20260207200000_add_fts_search`. The running database lacks the required tsvector generated columns and GIN indexes. - **Expected:** All migrations applied, FTS search functional. - **Actual:** Migration unapplied -- the app would not have FTS capability with the current database state. ### Finding 3: App and supporting containers not running Only the Postgres container is running. Neither `nodedesk_app` (port 3000) nor `nodedesk_minio` are running. Port 3000 returns no response. - **Expected:** All three services (app, postgres, minio) running per docker-compose. - **Actual:** Only `nodedesk-pg` is up. --- ## Steps to Reproduce 1. Check origin/main for ND-007 commits: ``` cd /home/b/Projects/nodedesk && git log origin/main --oneline | grep -i fts ``` Result: empty -- commits not on origin/main. 2. Check migration status: ``` cd /home/b/Projects/nodedesk && npx prisma migrate status ``` Result: 4 unapplied migrations including the FTS migration. 3. Check running containers: ``` podman ps --format "{{.Names}}" ``` Result: Only `nodedesk-pg` appears. 4. Check app endpoint: ``` curl -s -o /dev/null -w "%{http_code}" http://localhost:3000 || echo "no response" ``` Result: Connection refused -- app not running. --- ## Kanban Reference Discovered by probe card **t_1a0b2b6c** during post-deploy verification of [Mark/nodedesk#11](https://forgejo.tail018ac4.ts.net/Mark/nodedesk/issues/11). See the probe findings for full details.
Author
Owner

Additional findings from post-deploy probe (kanban card t_826fd183)

The following breaking changes are part of the unmerged PR #42 (nd-007-fts-search) and need review before merge:

Breaking: S3 env var rename

STORAGE_S3_* env vars have been renamed to S3_*. Deployments using the old names will break after merge unless env var files are updated:

  • STORAGE_S3_ENDPOINT → S3_ENDPOINT
  • STORAGE_S3_REGION → S3_REGION
  • STORAGE_S3_ACCESS_KEY → S3_ACCESS_KEY
  • STORAGE_S3_SECRET_KEY → S3_SECRET_KEY
  • STORAGE_S3_BUCKET → S3_BUCKET

Deprecated: SEARCH_MODE env var

The SEARCH_MODE env toggle is deprecated in PR #42. The new code auto-detects query type (raw-substring bypass → FTS → ILIKE fallback), making the manual toggle obsolete.

Removed: isEmailVerificationEnabled()

env.ts was simplified; isEmailVerificationEnabled() was removed and replaced with isResendConfigured(). Any code or config relying on the old function will break.

PR Status

  • PR #42: Still OPEN, mergeable (no conflicts), branch nd-007-fts-search
  • No app deployed: Only nodedesk-pg is running; port 3000 returns no response

Discovered by probe card t_826fd183 during post-deploy verification of Mark/nodedesk#11.

## Additional findings from post-deploy probe (kanban card t_826fd183) The following **breaking changes** are part of the unmerged PR #42 (`nd-007-fts-search`) and need review before merge: ### Breaking: S3 env var rename `STORAGE_S3_*` env vars have been renamed to `S3_*`. Deployments using the old names will break after merge unless env var files are updated: - `STORAGE_S3_ENDPOINT` → `S3_ENDPOINT` - `STORAGE_S3_REGION` → `S3_REGION` - `STORAGE_S3_ACCESS_KEY` → `S3_ACCESS_KEY` - `STORAGE_S3_SECRET_KEY` → `S3_SECRET_KEY` - `STORAGE_S3_BUCKET` → `S3_BUCKET` ### Deprecated: `SEARCH_MODE` env var The `SEARCH_MODE` env toggle is deprecated in PR #42. The new code auto-detects query type (raw-substring bypass → FTS → ILIKE fallback), making the manual toggle obsolete. ### Removed: `isEmailVerificationEnabled()` `env.ts` was simplified; `isEmailVerificationEnabled()` was removed and replaced with `isResendConfigured()`. Any code or config relying on the old function will break. ### PR Status - **PR #42**: Still OPEN, mergeable (no conflicts), branch `nd-007-fts-search` - **No app deployed**: Only `nodedesk-pg` is running; port 3000 returns no response Discovered by probe card t_826fd183 during post-deploy verification of Mark/nodedesk#11.
Author
Owner

Resolution summary

Triaged live state on 2026-09-18 against the three findings in this issue:

Finding 1: ND-007 commits on origin/main

  • Resolved (effectively). The 4 ND-007 commits on origin/nd-007-fts-search (68597a9, 66c9346, fb27e60, bf49e6c) are no longer needed on main:
    • fb27e60 fix: handle generated FTS columns in migration — landed via other PRs.
    • 66c9346 ND-007: Add search benchmarks — landed via other PRs.
    • 68597a9 ND-007: Three-tier FTS search strategy with tests and docs — landed via other PRs.
    • bf49e6c fix: gate Stripe production check on ENV_VALIDATION_STRICT and annotate FTS columns — the assertProductionStripeConfigured gate landed; the schema @default(dbgenerated(...)) annotation was reverted in 676a29a / ff676b2 because Postgres rejects column references in DEFAULT expressions (cannot use column reference in DEFAULT expression). The schema is intentionally clean (Unsupported("tsvector")? with no @default) and the GENERATED ALWAYS expression is owned by the migration.
  • PR #69 (Merge nd-007-fts-search -> main) closed as superseded at 2026-09-18T23:16:29Z.

Finding 2: FTS migration not applied to database

  • Partially resolved. Live Postgres (pg-nodedesk) has 4 tsvector columns (Client.searchVector, System.searchVector, Note.searchVector, WorkLog.searchVector) but they are not GENERATED ALWAYS and there are no GIN indexes. Migration 20260207200000_add_fts_search is not in the migration history (_prisma_migrations table is absent because the DB was bootstrapped via prisma db push, not migrate deploy). All tables are empty so the missing backfill is not yet user-visible.
  • Tracked as a follow-up operational gap (apply the migration's ALTER TABLE ... GENERATED ALWAYS AS (...) STORED and CREATE INDEX ... USING GIN statements, then re-seed dev data).

Finding 3: App + minio containers

  • Out of scope for this issue. pg-nodedesk and minio-nodedesk are running (Up 7h); nodedesk_app restart is an ops task tracked elsewhere.

Prisma schema state

prisma validate passes (prisma/schema.prisma is valid 🚀). No code change required from this issue.

## Resolution summary Triaged live state on 2026-09-18 against the three findings in this issue: ### Finding 1: ND-007 commits on origin/main - **Resolved (effectively).** The 4 ND-007 commits on `origin/nd-007-fts-search` (`68597a9`, `66c9346`, `fb27e60`, `bf49e6c`) are no longer needed on main: - `fb27e60 fix: handle generated FTS columns in migration` — landed via other PRs. - `66c9346 ND-007: Add search benchmarks` — landed via other PRs. - `68597a9 ND-007: Three-tier FTS search strategy with tests and docs` — landed via other PRs. - `bf49e6c fix: gate Stripe production check on ENV_VALIDATION_STRICT and annotate FTS columns` — the `assertProductionStripeConfigured` gate landed; the schema `@default(dbgenerated(...))` annotation was reverted in `676a29a` / `ff676b2` because Postgres rejects column references in DEFAULT expressions (`cannot use column reference in DEFAULT expression`). The schema is intentionally clean (`Unsupported("tsvector")?` with no `@default`) and the GENERATED ALWAYS expression is owned by the migration. - PR #69 (`Merge nd-007-fts-search -> main`) closed as superseded at 2026-09-18T23:16:29Z. ### Finding 2: FTS migration not applied to database - **Partially resolved.** Live Postgres (`pg-nodedesk`) has 4 `tsvector` columns (`Client.searchVector`, `System.searchVector`, `Note.searchVector`, `WorkLog.searchVector`) but they are not GENERATED ALWAYS and there are no GIN indexes. Migration `20260207200000_add_fts_search` is not in the migration history (`_prisma_migrations` table is absent because the DB was bootstrapped via `prisma db push`, not `migrate deploy`). All tables are empty so the missing backfill is not yet user-visible. - Tracked as a follow-up operational gap (apply the migration's `ALTER TABLE ... GENERATED ALWAYS AS (...) STORED` and `CREATE INDEX ... USING GIN` statements, then re-seed dev data). ### Finding 3: App + minio containers - **Out of scope** for this issue. `pg-nodedesk` and `minio-nodedesk` are running (Up 7h); `nodedesk_app` restart is an ops task tracked elsewhere. ### Prisma schema state `prisma validate` passes (`prisma/schema.prisma is valid 🚀`). No code change required from this issue.
Mark closed this issue 2026-09-18 23:16:59 +00:00
Sign in to join this conversation.
No description provided.