Skip to content

Architecture: cora debt reads from file snapshots, not cora.db (SoT gap) #403

Closed

Description

@ajianaz

Problem

cora debt reads from .cora/history/*.json file snapshots while cora findings reads from cora.db. This creates a data inconsistency:

Source Reviews Findings
cora debt (file snapshots) 15 16
cora findings (cora.db) 12 1

The DB is supposed to be the Single Source of Truth (SoT) since v0.8.4.

Expected

cora debt should read from cora.db (reviews + findings tables) instead of file-based snapshots. File snapshots should be deprecated or synced.

Impact

  • cora debt shows stale/phantom data from old reviews that pre-date DB persistence
  • Users see conflicting numbers between cora debt and cora findings stats
  • File-based snapshots are not portable, not queryable, and prone to corruption

Proposed Fix

  1. Migrate debt_tracker to read from cora.db reviews/findings tables
  2. Optionally keep file snapshots as a backup/fallback
  3. Consider a migration tool to backfill DB from existing snapshot files

Related

Activity

  1. added
    bugSomething isn't working
    majorMajor severity issue
    on Jul 28, 2026
  2. ajianaz commented on Jul 28, 2026

    @ajianaz
    CollaboratorAuthor

    Already fixed in develop. debt.rs line 44-52: load_snapshots_from_db() is now the primary SoT, with file snapshots as fallback only. DB is the single source of truth.

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

    bugSomething isn't workingmajorMajor severity issue

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions