gabriel / musehub public
refactor BREAKING task/remove-legacy-flat-store #1 / 1
AI Agent gabriel · 142 days ago · May 1, 2026 · Diff

refactor: remove all legacy flat-store code from musehub

- Delete LocalBackend._safe_id(), _root, objects_dir init param - LocalBackend._path/put/get/exists/delete now require repo_root — no silent fallback - Delete _object_disk_path() from musehub_sync; _write_object uses LocalBackend.put with repo_root - ingest_push looks up repo owner/slug from DB to resolve repo_root before writing objects - objects.py security check uses musehub_repos_dir instead of musehub_objects_dir - Remove musehub_objects_dir setting from config.py (superseded by musehub_repos_dir) - Update conftest, test_storage_backends, test_storage_tiers, test_push_object_integrity to use per-repo API - Add test_no_legacy_flat_store.py: 20 regression guards (all GREEN) preventing re-introduction of flat-store code

sha256:a5077c32e9287f75475bf4cb1354772d524f5774358b74a4e2a2b7ff483a6d08 sha
+42 ~65 −19 symbols
sha256:3d4023105cf226047f126964d3235d61b71fdbfc04c4ad70c6a7af613e323fde snapshot
+42
symbols added
~65
symbols modified
−19
symbols removed
0
dead code introduced
Semantic Changes 126 symbols
~ tests/test_no_legacy_flat_store.py .py 34 symbols added
+ TestConfigNoLegacy class class TestConfigNoLegacy L176–198
+ test_musehub_repos_dir_present method method test_musehub_repos_dir_present L185–191
+ test_no_musehub_objects_dir_in_settings method method test_no_musehub_objects_dir_in_settings L177–183
+ test_no_objects_dir_in_config_source method method test_no_objects_dir_in_config_source L193–198
+ TestLocalBackendNoLegacy class class TestLocalBackendNoLegacy L54–168
+ test_exists_without_repo_root_raises method async_method test_exists_without_repo_root_raises L117–122
+ test_get_without_repo_root_raises method async_method test_get_without_repo_root_raises L110–115
+ test_init_takes_no_objects_dir_arg method method test_init_takes_no_objects_dir_arg L72–80
+ test_no_flat_path_in_source method method test_no_flat_path_in_source L156–168
+ test_no_root_attribute method method test_no_root_attribute L63–70
+ test_no_safe_id_method method method test_no_safe_id_method L55–61
+ test_path_with_repo_root_uses_algo_shard_layout method method test_path_with_repo_root_uses_algo_shard_layout L89–101
+ test_path_without_repo_root_raises method method test_path_without_repo_root_raises L82–87
+ test_per_repo_object_on_disk_at_correct_path method async_method test_per_repo_object_on_disk_at_correct_path L141–154
+ test_per_repo_roundtrip method async_method test_per_repo_roundtrip L124–139
+ test_put_without_repo_root_raises method async_method test_put_without_repo_root_raises L103–108
+ TestMusehubSyncNoLegacy class class TestMusehubSyncNoLegacy L206–230
+ test_no_musehub_objects_dir_in_sync_source method method test_no_musehub_objects_dir_in_sync_source L215–221
+ test_no_object_disk_path_function method method test_no_object_disk_path_function L207–213
+ test_no_safe_id_in_sync_source method method test_no_safe_id_in_sync_source L223–230
+ TestObjectsRouteNoLegacy class class TestObjectsRouteNoLegacy L238–254
+ test_no_musehub_objects_dir_in_objects_route method method test_no_musehub_objects_dir_in_objects_route L239–245
+ test_objects_route_validates_against_repos_dir method method test_objects_route_validates_against_repos_dir L247–254
+ TestStorageInitNoLegacy class class TestStorageInitNoLegacy L262–268
+ test_no_flat_store_description_in_init method method test_no_flat_store_description_in_init L263–268
+ _REPO_ROOT variable variable _REPO_ROOT L36–36
+ _ast_names function function _ast_names L43–46
+ _source function function _source L39–40
+ Path import import Path L30–30
+ annotations import import annotations L25–25
+ ast import import ast L27–27
+ inspect import import inspect L28–28
+ pytest import import pytest L32–32
+ textwrap import import textwrap L29–29
~ musehub/config.py .py 1 symbol modified
~ musehub/services/musehub_sync.py .py 2 symbols removed, 2 symbols modified
_object_disk_path function function _object_disk_path L76–93
settings import import settings L26–26
~ musehub/storage/backends.py .py 1 symbol removed, 7 symbols modified
_safe_id method method _safe_id L186–188
~ _path
~ exists
~ get
~ put
~ tests/conftest.py .py 1 symbol modified
~ tests/test_storage_backends.py .py 8 symbols added, 16 symbols removed, 48 symbols modified
test_path_traversal_variations_sanitised method method test_path_traversal_variations_sanitised L507–517
test_global_storage_same_id_shares_object method async_method test_global_storage_same_id_shares_object L236–242
test_put_colon_in_object_id method async_method test_put_colon_in_object_id L229–234
test_delete_with_dotdot_object_id_is_noop method async_method test_delete_with_dotdot_object_id_is_noop L571–574
test_dotdot_deep_in_object_id_sanitised method method test_dotdot_deep_in_object_id_sanitised L538–542
test_dotdot_in_object_id_sanitised method method test_dotdot_in_object_id_sanitised L532–536
test_exists_with_dotdot_object_id_sanitised method async_method test_exists_with_dotdot_object_id_sanitised L565–569
test_get_with_dotdot_object_id_sanitised method async_method test_get_with_dotdot_object_id_sanitised L559–563
test_object_id_colon_sanitised_prevents_ambiguity method method test_object_id_colon_sanitised_prevents_ambiguity L544–549
test_put_with_dotdot_object_id_sanitised method async_method test_put_with_dotdot_object_id_sanitised L551–557
test_write_many_objects_different_ids method async_method test_write_many_objects_different_ids L430–437
test_path_basic method method test_path_basic L66–70
test_path_dotdot_deep_stays_in_root method method test_path_dotdot_deep_stays_in_root L89–92
test_path_sanitises_colon_in_object_id method method test_path_sanitises_colon_in_object_id L72–76
test_path_sanitises_dotdot_in_object_id method method test_path_sanitises_dotdot_in_object_id L83–87
test_path_sanitises_slash_in_object_id method method test_path_sanitises_slash_in_object_id L78–81
+ test_per_repo_isolation method async_method test_per_repo_isolation L247–255
+ test_sha256_oid_round_trip method async_method test_sha256_oid_round_trip L238–245
+ test_exists_without_repo_root_raises method async_method test_exists_without_repo_root_raises L541–545
+ test_get_without_repo_root_raises method async_method test_get_without_repo_root_raises L535–539
+ test_put_without_repo_root_raises method async_method test_put_without_repo_root_raises L529–533
+ test_path_requires_repo_root method method test_path_requires_repo_root L70–73
+ test_path_with_repo_root_uses_algo_shard_layout method method test_path_with_repo_root_uses_algo_shard_layout L75–82
+ _repo_root function function _repo_root L60–61
← Older Oldest on task/remove-legacy-flat-store
All commits
Newer → Latest on task/remove-legacy-flat-store

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