gabriel / musehub public
feat patch task/raw-op-fidelity #2 / 3
AI Agent gabriel · 139 days ago · May 4, 2026 · Diff

feat: add backfill_raw_ops_from_commits + deploy script

Re-indexes all 29,414 historic symbol history entries that were stored with coarse ops (add/modify/rename) by reading the original structured_delta from commit_meta.

After running deploy/backfill_raw_ops_from_commits.py: insert: 12554, replace: 12035, delete: 3900, patch: 2699, directory_rename: 1 — no coarse values remain in the DB.

TestBackfillRawOpsFromCommits: 8 tests (dry_run, per-op, idempotent, missing-from-delta, all-repos, file-level patch detection).

sha256:b8287d3ee90123d331f2bca73464a888ad2050e041d0b77450cc6d9870108c6a sha
+25 symbols
sha256:1e9bf70eaf62e146ea5e11e1d80055a831374d98daacb608ebd51be2cdede9a6 snapshot
+25
symbols added
0
dead code introduced
Semantic Changes 25 symbols
+ AsyncSession import import AsyncSession L37–37
+ annotations import import annotations L30–30
+ argparse import import argparse L32–32
+ asyncio import import asyncio L33–33
+ backfill_raw_ops_from_commits import import backfill_raw_ops_from_commits L44–44
+ create_async_engine import import create_async_engine L37–37
+ get_database_url import import get_database_url L43–43
+ sessionmaker import import sessionmaker L38–38
+ sys import import sys L34–34
+ time import import time L35–35
+ main function function main L74–82
+ run function async_function run L47–71
+ backfill_raw_ops_from_commits function async_function backfill_raw_ops_from_commits L862–956
~ tests/test_snapshot_symbol_indexer.py .py 12 symbols added
+ TestBackfillRawOpsFromCommits class class TestBackfillRawOpsFromCommits L1645–1899
+ _seed_commit_with_meta method async_method _seed_commit_with_meta L1649–1669
+ _seed_stale_entry method async_method _seed_stale_entry L1671–1692
+ test_add_becomes_insert_with_payload method async_method test_add_becomes_insert_with_payload L1722–1748
+ test_already_correct_ops_not_touched method async_method test_already_correct_ops_not_touched L1819–1835
+ test_dry_run_returns_count_without_writing method async_method test_dry_run_returns_count_without_writing L1695–1719
+ test_entry_missing_from_delta_left_alone method async_method test_entry_missing_from_delta_left_alone L1838–1861
+ test_idempotent method async_method test_idempotent L1884–1899
+ test_modify_becomes_patch_for_file_level method async_method test_modify_becomes_patch_for_file_level L1780–1816
+ test_modify_becomes_replace_with_payload method async_method test_modify_becomes_replace_with_payload L1751–1777
+ test_repo_id_none_fixes_all_repos method async_method test_repo_id_none_fixes_all_repos L1864–1881
+ select import import select L42–42

0 comments

No comments yet. Be the first to start the discussion.

To add a comment, use the Muse CLI: muse hub commit comment sha256:b8287d3ee90123d331f2bca73464a888ad2050e041d0b77450cc6d9870108c6a --body "your comment"