Skip to content

Dream tail: guard user_profiles.db failures so one corrupt shared DB doesn't fail every agent's dream run #899

Description

@olegbrok

Stopgap for the #889 corruption family (4 specimens across TOD + Mini), proposed by the TOD fleet agent who diagnosed specimen 4 (2026-07-23).

Problem: every agent's dream run reads/writes the shared data/user_profiles.db in its tail. When that one file is malformed, ALL agents' dream runs error ("database disk image is malformed" + "database is locked" pile-up), and — as the Mini specimen showed — the entire post-link-building dream tail (profiles, relationships, KG extraction, insights) dies with it, silently.

Proposed guard (maintenance-grade):

  • Wrap the profile-store open/read/write in the dream tail with a catch for sqlite3.DatabaseError ("malformed") — on failure, log ONE loud line (owner-notify-worthy, not a quiet scheduler line — the Mini specimen went unnoticed for 2 weeks), skip the profile step, and let the REST of the dream tail (KG extraction, insights) still run.
  • A malformed shared DB should degrade one step, not kill the batch fleet-wide.

Removal condition (per stopgap rule): tied to #889 root-cause fix — when the writer bug is fixed and no new specimen appears for a month, the guard stays as cheap insurance but the owner-notify escalation can be reviewed.

Codex lane: Kuzya build, Murzik review.

🤖 Opened by Barsik

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions