Skip to content

fix(pipeline): four critical silent-failure sites #443

Closed

Description

@Sinity

Discovered by

silent-failure-audit agent (swarm 2026-04-26). Full report: .agent/scratch/swarm-2026-04-26/silent-failure-audit.md. Synthesized in .agent/scratch/swarm-2026-04-26/SYNTHESIS.md.

Problem

Four sites in production code swallow exceptions in ways that risk data corruption or silent wrong-answer behavior. The codebase has zero bare except: clauses (a strength), but these four except Exception: blocks each hide failure modes that combine with the archive's content-hash idempotency to make the bug sticky: once a record is misclassified, subsequent re-imports won't retry.

Site 1 — polylogue/sources/dispatch.py:144-149

Stream-decoding swallows every exception during provider detection and demotes the record to fallback_provider with no log. Combined with content-hash idempotency, this creates sticky misclassifications that subsequent ingests will not retry. A user export that one-shot fails to detect (transient I/O blip, malformed UTF-8, partial download) is permanently mislabeled.

Site 2 — polylogue/pipeline/run_execution.py:317-324

FTS-trigger restoration is wrapped in except Exception: pass with a comment claiming "index rebuild handles FTS." In practice if restoration fails, search returns stale results until a manual full rebuild — and the stale state is invisible to polylogue check/polylogue doctor.

Site 3 — polylogue/pipeline/services/ingest_worker.py:401-408

A JSONL sample crash quietly returns None, which the caller treats as "not stream-shaped" and reroutes through a different parser. This breaks content-hash stability: the same input produces different IDs depending on whether the sample probe happened to hit a malformed line. A subtle source of "duplicate conversation" reports.

Site 4 — polylogue/storage/backends/schema_bootstrap.py:602-611

with suppress(Exception) around vec0 DDL hides corruption of the vector table. The vector store may be partially-initialized but the bootstrap reports success, so semantic search returns silently empty results.

Target

For each site, replace silent pass / return None with one of:

  1. Explicit logger.exception(...) and surface in RunResult/ReadinessReport — operator sees degraded state.
  2. Re-raise as a typed exception when the failure is non-recoverable.
  3. Return a typed Failed | Skipped | Succeeded value when the caller needs to distinguish.

The clean three-tier exception pattern in polylogue/sources/source_acquisition.py and polylogue/sources/source_parsing.py is the canonical model — both modules surfaced as exemplars in the audit.

Acceptance criteria

  • Each of the four sites has explicit logging (at minimum) plus surfacing in the relevant operational report.
  • Site 3 fix preserves content-hash stability: failed-sample paths must produce the same ID as successful-sample paths, or refuse the input loudly.
  • Tests cover each site's failure mode (mock the underlying I/O / DDL / decode path to fail; assert observable behavior).
  • polylogue check (or doctor) surfaces FTS-trigger drift and vec0-table partial state.
  • No new except Exception: pass patterns introduced. Lint candidate: a future grep-based check.

Pattern follow-up

The 4 sites cluster at stage boundaries (acquire→parse, parse→materialize, materialize→index). The pipeline-stage-independence audit (separate report) identifies the meta-pattern: no runtime contract validation between stages. The companion issue for that systemic fix is filed separately as feat(pipeline): runtime stage contract validation.

Related

Activity

  1. added
    type:fix
    phase:architecture
    on Apr 26, 2026
  2. added a commit that references this issue on Apr 26, 2026
    8fdcb10
  3. added a commit that references this issue on May 7, 2026
    f4b51df
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:pipelinearea:storagephase:architecturetype:fix

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions