You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Archive/action FTS DDL is duplicated between schema creation and lifecycle repair code.
Evidence:
polylogue/storage/backends/schema_ddl_archive.py:258-285 declares the messages_fts table and its insert/delete/update triggers for fresh schema creation.
polylogue/storage/backends/schema_ddl_actions.py:48-82 declares the action_events_fts table and triggers.
polylogue/storage/fts/sql.py:9-18 separately declares the same FTS virtual tables for lifecycle helpers.
polylogue/storage/fts/fts_lifecycle.py:119-156 separately declares the same message/action FTS trigger DDL, with a comment saying it “must match” the schema files.
This creates a manual sync contract for some of the most sensitive storage machinery. It is directly adjacent to #619: sync ingest drops and restores these triggers, so a future trigger/schema edit must be propagated to both fresh schema and restore paths or bulk ingest will restore an old trigger definition.
Acceptance criteria
Define message/action FTS table and trigger DDL in one module, then import/reuse it from fresh schema creation and FTS lifecycle repair.
Remove the “must match” duplicate trigger literals from fts_lifecycle.py.
Add a test that fresh schema creation and lifecycle restoration use the same trigger names/SQL source, or otherwise fail if they drift.
Keep product-specific FTS DDL out of scope unless the same duplication is found there.
Superseded by #618. I consolidated this finding into the composite issue so the work can be handled as one coherent slice instead of as a tiny standalone ticket. The original evidence remains available in this issue history.
Activity
Sinity commentedon May 1, 2026
Superseded by #618. I consolidated this finding into the composite issue so the work can be handled as one coherent slice instead of as a tiny standalone ticket. The original evidence remains available in this issue history.