Repository navigation
Description
Background
scripts/db.py writes repos and runs tables into discovery.db on every run — but *.db is gitignored and CI does a fresh checkout every time, so everything written evaporates when the job ends. init_db / save_repo / save_run are pure overhead on the only environment that actually runs (GitHub Actions).
The downstream casualty is verify_scoring.py (382 lines, advertised in the README as the scoring-backtest capability): in any fresh environment it can only print Database not found. The single backtest report in reports/ is dated 2026-06-25 — backtesting has effectively been dead since the project moved to pure-CI operation. dedup.py's own comments even call out this exact trap ("*.db gitignored, CI checks out fresh, so Repeat is always empty") and migrated dedup to JSON — but the db.py tail was never cut.
Motivation
- A verification module that cannot run is worse than none: it makes the README's "backtest-verified scoring" claim false and misleads anyone evaluating a scoring change.
- Maintaining two storage layers when only one carries data is ongoing tax — every schema-adjacent change has to consider a code path that never matters.
- This blocks the roadmap item "Scoring backtest report in CI" (Roadmap #4 roadmap list), which presumes a working data source for
verify_scoring.py.
Proposed approach
Decide one of two directions — the current in-between is the only wrong answer:
Option A — accept JSON as the data source (recommended). The committed data/discovery-*.json files already contain everything the backtest needs (scores, sources, per-repo metadata, one file per day). Rewrite verify_scoring.py to read those, delete db.py and all save_repo/save_run call sites. This also un-blocks running the backtest in CI with zero persistence machinery.
Option B — give SQLite a real persistence mechanism. Upload discovery.db as an Actions artifact restored at job start, or commit it to a dedicated data branch. Only worth it if there's a concrete need JSON can't serve (e.g. cross-day queries too slow over 200+ JSON files — currently not the case).
Acceptance criteria
- Either
db.pyis gone andverify_scoring.py --days 30produces a real report from committed JSON on a fresh clone, or the DB demonstrably survives across CI runs and the backtest works in CI. - No code path writes data that nothing can ever read.
- README's backtest section matches reality; tests updated accordingly.
Activity