Skip to content

Derive the asset id lazily: SQLite opens no longer hash the song (#108) - #110

Merged
thorwhalen merged 1 commit into
mainfrom
fix/108-lazy-asset-id
Oct 14, 2026
Merged

thorwhalen merged 1 commit into
mainfrom
fix/108-lazy-asset-id

Conversation

@thorwhalen

@thorwhalen thorwhalen commented Oct 14, 2026 •

Copy link
Copy Markdown
Collaborator

Fixes #108.

asset_id is the Postgres tenant anchor and the media reference of new annotations; deriving it SHA-256s the whole song. It was computed eagerly on every FolderStorage.open_stores, open_project_graph and ProjectGraph(...) even under SQLite.

  • open_graph_store / iter_scope_stores now take asset_id as a str or a zero-argument callable; only the Postgres path calls it. A plain string behaves as before.
  • FolderStorage.open_stores and open_project_graph[_readonly] pass a callable; ProjectGraph.asset_id is a cached_property (still computed once per graph).
  • tests/test_lazy_asset_id.py forbids lacing.hash_file and opens stores, graph, readonly graph and the provenance walk (fails on main, passes here).

Compatibility: public API only widened; no stored-data change. reelee needs no floor bump to keep working; it gets the speedup once it runs this nw version. Low-stakes change, so no adversarial review (per policy); full suite 786 passed, 3 skipped.

🤖 Generated with Claude Code

… its song (#108)

open_graph_store / iter_scope_stores accept a zero-argument callable for
asset_id, called only by the Postgres backend; FolderStorage.open_stores,
open_project_graph and ProjectGraph.asset_id use it. A plain string still works.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@thorwhalen
thorwhalen merged commit badb3a9 into main Oct 14, 2026
12 checks passed
@thorwhalen
thorwhalen deleted the fix/108-lazy-asset-id branch October 14, 2026 02:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

FolderStorage hashes the song file on every open, even under SQLite

1 participant