gabriel / musehub public
feat BREAKING mist task/mist-phase3-snapshot-indexer #1 / 1
AI Agent gabriel · 142 days ago · May 1, 2026 · Diff

feat(mist): Phase 3 — snapshot indexer writes anchors to normalized tables

- New musehub/services/musehub_mist_indexer.py: build_mist_anchor_index(session, repo_id, head_commit_id): walks HEAD commit → snapshot_id → manifest → MusehubObject (content_cache / disk / S3) → extract_mist_symbol_anchors → upserts into musehub_symbol_history_entries (ON CONFLICT DO NOTHING) and musehub_symbol_intel (upsert on repo_id+address); returns mist.anchor_index intel result tuple - musehub_intel_providers.py MistProvider.compute refactored: always calls build_mist_anchor_index first (VCS + API paths); appends mist.anchors blob result only when MusehubMist row exists (API path) - 13 TDD tests: importability, history entry fields, multiple artifacts, binary skip, symbol intel rows, idempotency, missing object graceful skip, commit without snapshot, result tuple shape, MistProvider delegation

sha256:2b25b8ee68018f1375948dc273cae101d091c6f23afc056cf216758c3ba43c94 sha
+50 ~2 symbols
sha256:e090fe3ec11ac6f1efd543763d17a29fba8fdb3a97c596baf77dade9ed44be64 snapshot
+50
symbols added
~2
symbols modified
0
dead code introduced
Semantic Changes 52 symbols
+ _utc_now function function _utc_now L37–38
+ build_mist_anchor_index function async_function build_mist_anchor_index L41–165
+ AsyncSession import import AsyncSession L29–29
+ JSONObject import import JSONObject L32–32
+ annotations import import annotations L22–22
+ datetime import import datetime L25–25
+ db import import db L31–31
+ logging import import logging L24–24
+ pg_insert import import pg_insert L28–28
+ select import import select L27–27
+ timezone import import timezone L25–25
+ logger variable variable logger L34–34
+ TestBuildMistAnchorIndexExists class class TestBuildMistAnchorIndexExists L141–152
+ test_function_is_importable method method test_function_is_importable L142–145
+ test_function_signature method method test_function_signature L147–152
+ TestMistAnchorIndexerEdgeCases class class TestMistAnchorIndexerEdgeCases L368–457
+ test_commit_without_snapshot_returns_empty method async_method test_commit_without_snapshot_returns_empty L370–396
+ test_object_missing_from_store_is_skipped method async_method test_object_missing_from_store_is_skipped L399–437
+ test_returns_intel_result_tuple method async_method test_returns_intel_result_tuple L440–457
+ TestMistAnchorIndexerHistoryEntries class class TestMistAnchorIndexerHistoryEntries L159–265
+ test_binary_artifact_produces_no_history_entries method async_method test_binary_artifact_produces_no_history_entries L245–265
+ test_history_entry_fields method async_method test_history_entry_fields L188–214
+ test_multiple_artifacts_all_indexed method async_method test_multiple_artifacts_all_indexed L217–242
+ test_python_artifact_writes_history_entries method async_method test_python_artifact_writes_history_entries L161–185
+ TestMistAnchorIndexerIdempotency class class TestMistAnchorIndexerIdempotency L328–361
+ test_indexing_same_commit_twice_is_idempotent method async_method test_indexing_same_commit_twice_is_idempotent L330–361
+ TestMistAnchorIndexerSymbolIntel class class TestMistAnchorIndexerSymbolIntel L272–321
+ test_python_artifact_writes_symbol_intel method async_method test_python_artifact_writes_symbol_intel L274–296
+ test_symbol_intel_churn_is_at_least_one method async_method test_symbol_intel_churn_is_at_least_one L299–321
+ TestMistProviderDelegatesToIndexer class class TestMistProviderDelegatesToIndexer L464–488
+ test_mist_provider_writes_normalized_rows method async_method test_mist_provider_writes_normalized_rows L466–488
+ _commit_id function function _commit_id L48–49
+ _manifest_blob function function _manifest_blob L44–45
+ _now function function _now L36–37
+ _oid function function _oid L40–41
+ _seed_mist_vcs_repo function async_function _seed_mist_vcs_repo L56–134
+ _snap_id function function _snap_id L52–53
+ AsyncSession import import AsyncSession L26–26
+ annotations import import annotations L17–17
+ blob_id import import blob_id L24–24
+ compute_identity_id import import compute_identity_id L28–28
+ compute_repo_id import import compute_repo_id L28–28
+ datetime import import datetime L20–20
+ db import import db L29–29
+ func function import func L25–25
+ msgpack import import msgpack L22–22
+ pytest import import pytest L23–23
+ select import import select L25–25
+ timezone import import timezone L20–20
+ uuid import import uuid L19–19
← Older Oldest on task/mist-phase3-snapshot-indexer
All commits
Newer → Latest on task/mist-phase3-snapshot-indexer

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:2b25b8ee68018f1375948dc273cae101d091c6f23afc056cf216758c3ba43c94 --body "your comment"