You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Found during review of #1479 (GC). The per-store config keys hash_prefix, schema_prefix, and filepath_prefix are accepted and validated by settings (Config.get_store_spec → _validate_prefix_separation; also listed in storage_adapter.py COMMON_SPEC_KEYS) — but only <filepath@> consumes them, and only as reserved-namespace guards (builtin_codecs/filepath.py: filepath may not write under hash_prefix/schema_prefix; must stay under filepath_prefix).
Neither the hash writer (hash_registry.build_hash_path — fixed _hash/{schema}/... layout, now via the HASH_STORAGE_PREFIX constant) nor the schema-addressed writer (storage.build_object_path — {schema}/{table}/{pk}/...) nor GC honors them as relocation knobs.
Why this needs a decision
A user who sets stores.x.hash_prefix = "content" expecting relocation gets a validated, silent no-op — misleading config surface.
Worse, the trap is loaded: if a future change wires hash_prefix into the writer without teaching GC, hash objects land outside _hash/, get enumerated by the schema-addressed walk, match no schema reference, and are deleted as orphans — data loss. (fix(#1469): codec-driven GC reference discovery + file-level orphan matching #1479 added a comment on HASH_STORAGE_PREFIX flagging exactly this.)
Options
Declare the layout fixed (recommended): document hash_prefix/schema_prefix as what they actually are today — reserved-namespace declarations for <filepath@> cohabitation validation, not relocation settings — and rename or clearly re-document them (e.g. in the object-store-configuration spec).
Wire them through: honor the prefixes in build_hash_path/build_object_path AND in gc.list_stored_hashes/list_schema_paths in the same change, with migration guidance for existing stores. Larger and of unclear demand.
Either way, the current state — validate-and-ignore — should not survive. Related: the <filepath@>-cohabitation GC hazard noted on #1479 (unattributable files) and the fail-safe planned with #1445/#1478.
Found during review of #1479 (GC). The per-store config keys
hash_prefix,schema_prefix, andfilepath_prefixare accepted and validated by settings (Config.get_store_spec→_validate_prefix_separation; also listed instorage_adapter.pyCOMMON_SPEC_KEYS) — but only<filepath@>consumes them, and only as reserved-namespace guards (builtin_codecs/filepath.py: filepath may not write underhash_prefix/schema_prefix; must stay underfilepath_prefix).Neither the hash writer (
hash_registry.build_hash_path— fixed_hash/{schema}/...layout, now via theHASH_STORAGE_PREFIXconstant) nor the schema-addressed writer (storage.build_object_path—{schema}/{table}/{pk}/...) nor GC honors them as relocation knobs.Why this needs a decision
stores.x.hash_prefix = "content"expecting relocation gets a validated, silent no-op — misleading config surface.hash_prefixinto the writer without teaching GC, hash objects land outside_hash/, get enumerated by the schema-addressed walk, match no schema reference, and are deleted as orphans — data loss. (fix(#1469): codec-driven GC reference discovery + file-level orphan matching #1479 added a comment onHASH_STORAGE_PREFIXflagging exactly this.)Options
hash_prefix/schema_prefixas what they actually are today — reserved-namespace declarations for<filepath@>cohabitation validation, not relocation settings — and rename or clearly re-document them (e.g. in the object-store-configuration spec).build_hash_path/build_object_pathAND ingc.list_stored_hashes/list_schema_pathsin the same change, with migration guidance for existing stores. Larger and of unclear demand.Either way, the current state — validate-and-ignore — should not survive. Related: the
<filepath@>-cohabitation GC hazard noted on #1479 (unattributable files) and the fail-safe planned with #1445/#1478.