Skip to content

fix: FTS triggers permanently lost if BEGIN IMMEDIATE fails after suspend #552

Closed

Description

@Sinity

Cluster: Missing symmetry (suspend without restore on error path)

Found by generalization sweep during audit #544.

CONFIRMED

  1. ingest_batch.py:828-829 — suspend_fts_triggers_sync(conn) runs BEFORE the try block. If BEGIN IMMEDIATE at line 829 fails (e.g., database locked), the finally block never runs, triggers stay dropped permanently, and the connection leaks. All subsequent INSERTs silently bypass FTS.

Note: my own FTS fix earlier this session added restore in finally but left suspend+begin outside the try block. This patch corrects that.

  1. semantic_capture.py:154-180 — extract_file_changes defined with tests but never imported by production code. Also missing NotebookEdit dispatch branch (only handles Read/Write/Edit).

  2. run_stages.py:438-537 — execute_embed_stage fully implemented with tests but never dispatched from any production call path. CLI bypasses it via _run_embed_standalone. Dead code.

Already fixed

  1. FTS trigger restore — The main suspend/restore asymmetry in _process_ingest_batch_sync was fixed earlier this session (restore + repair added to finally block).

Ref #544

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions