Fix filing taxonomy persistence schema mismatch that breaks sync and overview loading #2

Closed
opened 2026-03-14 22:15:20 +00:00 by Francy51 · 1 comment
Owner

Summary

Background filing workflows are failing with SQLiteError: table filing_taxonomy_snapshot has no column named parser_engine, and the Overview workflow can then sit in a non-recovering loading state.

Evidence

  • Full run on 2026-03-14: bun run test:e2e
  • e2e/analysis.spec.ts timed out while waiting for the company overview to render.
  • Manual pass against bun run e2e:webserver showed /analysis stuck on Loading company overview.
  • Local server logs repeatedly showed the schema mismatch above while filing sync tasks were running.

Expected

  • Filing sync jobs persist taxonomy data successfully in local/e2e environments.
  • The overview page either loads usable data or surfaces a clear error state with recovery actions.

Acceptance Criteria

  • The local/e2e database schema is compatible with the filing taxonomy persistence path.
  • Filing workflows no longer fail with filing_taxonomy_snapshot ... parser_engine errors.
  • /analysis no longer hangs indefinitely in a loading state when the backend workflow fails.
  • A regression test covers the schema/path mismatch or migration requirement.
## Summary Background filing workflows are failing with `SQLiteError: table filing_taxonomy_snapshot has no column named parser_engine`, and the Overview workflow can then sit in a non-recovering loading state. ## Evidence - Full run on 2026-03-14: `bun run test:e2e` - `e2e/analysis.spec.ts` timed out while waiting for the company overview to render. - Manual pass against `bun run e2e:webserver` showed `/analysis` stuck on `Loading company overview`. - Local server logs repeatedly showed the schema mismatch above while filing sync tasks were running. ## Expected - Filing sync jobs persist taxonomy data successfully in local/e2e environments. - The overview page either loads usable data or surfaces a clear error state with recovery actions. ## Acceptance Criteria - The local/e2e database schema is compatible with the filing taxonomy persistence path. - Filing workflows no longer fail with `filing_taxonomy_snapshot ... parser_engine` errors. - `/analysis` no longer hangs indefinitely in a loading state when the backend workflow fails. - A regression test covers the schema/path mismatch or migration requirement.
Francy51 added the P0 label 2026-03-14 22:15:20 +00:00
Author
Owner

Issue #2 implementation update:

Implemented the SQLite bootstrap/schema-compat fix for the filing taxonomy drift that was causing filing_taxonomy_snapshot.parser_engine failures in local/e2e runs.

What changed:

  • Extracted the shared SQLite compat/bootstrap path into lib/server/db/sqlite-schema-compat.ts.
  • Extended ensureLocalSqliteSchema(...) to repair the missing taxonomy sidecar columns/tables/indexes for filing_taxonomy_snapshot, filing_taxonomy_context, filing_taxonomy_concept, and filing_taxonomy_fact.
  • Added the required backfill for legacy snapshot rows (faithful_rows, surface_rows, detail_rows, kpi_rows).
  • Refactored scripts/e2e-prepare.ts to stop replaying the stale hardcoded migration list and instead bootstrap through the shared compat helper, then run ingestion schema repair.
  • Updated scripts/dev.ts so compat bootstrap runs before ensureFinancialIngestionSchemaHealthy(...) on existing DBs.
  • Added regression coverage for old-schema bootstrap, partial sidecar drift, idempotency, and fresh e2e DB prep.

Verification run summary:

  • bun test lib/server/db/index.test.ts
  • bun test scripts/e2e-prepare.test.ts
  • bun x tsc --noEmit
  • bun run test:e2e:workflow still has 3 existing timeout failures unrelated to the taxonomy schema fix.
  • bun run test:e2e still has 6 existing browser/e2e failures unrelated to the taxonomy schema fix.
  • bun test is not green overall; it also includes pre-existing non-issue-#2 failures plus Bun trying to execute Playwright specs directly under e2e/.

Important result for this issue:

  • I did not reproduce the original SQLiteError: table filing_taxonomy_snapshot has no column named parser_engine failure after the change.
  • A grep across fresh e2e/runtime artifacts did not find the old parser_engine schema error.

Status:

  • The schema/bootstrap root cause described in this issue appears fixed.
  • Remaining failing tests are in other areas (analysis/financials/graphing/research e2e timeouts/locator issues, workflow hybrid analysis timeouts, unrelated unit/integration failures), so I have not closed this issue automatically.
Issue #2 implementation update: Implemented the SQLite bootstrap/schema-compat fix for the filing taxonomy drift that was causing `filing_taxonomy_snapshot.parser_engine` failures in local/e2e runs. What changed: - Extracted the shared SQLite compat/bootstrap path into `lib/server/db/sqlite-schema-compat.ts`. - Extended `ensureLocalSqliteSchema(...)` to repair the missing taxonomy sidecar columns/tables/indexes for `filing_taxonomy_snapshot`, `filing_taxonomy_context`, `filing_taxonomy_concept`, and `filing_taxonomy_fact`. - Added the required backfill for legacy snapshot rows (`faithful_rows`, `surface_rows`, `detail_rows`, `kpi_rows`). - Refactored `scripts/e2e-prepare.ts` to stop replaying the stale hardcoded migration list and instead bootstrap through the shared compat helper, then run ingestion schema repair. - Updated `scripts/dev.ts` so compat bootstrap runs before `ensureFinancialIngestionSchemaHealthy(...)` on existing DBs. - Added regression coverage for old-schema bootstrap, partial sidecar drift, idempotency, and fresh e2e DB prep. Verification run summary: - `bun test lib/server/db/index.test.ts` ✅ - `bun test scripts/e2e-prepare.test.ts` ✅ - `bun x tsc --noEmit` ✅ - `bun run test:e2e:workflow` still has 3 existing timeout failures unrelated to the taxonomy schema fix. - `bun run test:e2e` still has 6 existing browser/e2e failures unrelated to the taxonomy schema fix. - `bun test` is not green overall; it also includes pre-existing non-issue-#2 failures plus Bun trying to execute Playwright specs directly under `e2e/`. Important result for this issue: - I did not reproduce the original `SQLiteError: table filing_taxonomy_snapshot has no column named parser_engine` failure after the change. - A grep across fresh e2e/runtime artifacts did not find the old `parser_engine` schema error. Status: - The schema/bootstrap root cause described in this issue appears fixed. - Remaining failing tests are in other areas (analysis/financials/graphing/research e2e timeouts/locator issues, workflow hybrid analysis timeouts, unrelated unit/integration failures), so I have not closed this issue automatically.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Francy51/Neon-Desk#2