@@ -318,47 +318,47 @@ def collect(self, dry_run: bool = True, verbose: bool = False) -> dict[str, Any]
318318
319319 Returns a dict with per-section stats and the deletion outcome:
320320
321- - hash_referenced / hash_stored / hash_orphaned / hash_orphaned_bytes
322- - orphaned_hashes : orphaned hash items as full relative store paths
321+ - hash_paths_referenced / hash_paths_stored / hash_paths_orphaned / hash_paths_orphaned_bytes
322+ - orphaned_hash_paths : orphaned hash items as full relative store paths
323323 (NOT bare hashes — passed as-is to the deleter)
324324 - schema_paths_referenced / schema_paths_stored / schema_paths_orphaned
325325 / schema_paths_orphaned_bytes
326326 - orphaned_paths: orphaned schema files as full relative store paths
327- - hash_deleted / schema_paths_deleted / deleted / bytes_freed (0 when
327+ - hash_paths_deleted / schema_paths_deleted / deleted / bytes_freed (0 when
328328 dry_run) / errors / dry_run
329329 """
330330 # References can be gathered across all schemas at once: because paths
331331 # embed the schema, a file under schema X is only ever covered by an X
332332 # reference, so combined coverage equals per-schema coverage.
333- hash_referenced = self .hash_references (verbose = verbose )
333+ hash_paths_referenced = self .hash_references (verbose = verbose )
334334 schema_paths_referenced = self .schema_references (verbose = verbose )
335335
336- hash_stored : dict [str , int ] = {}
336+ hash_paths_stored : dict [str , int ] = {}
337337 schema_paths_stored : dict [str , int ] = {}
338338 for schema in self .schemas :
339- hash_stored .update (self .list_hash_paths (schema .database ))
339+ hash_paths_stored .update (self .list_hash_paths (schema .database ))
340340 schema_paths_stored .update (self .list_schema_paths (schema .database ))
341341
342- orphaned_hashes = sorted (set (hash_stored .keys ()) - hash_referenced )
342+ orphaned_hash_paths = sorted (set (hash_paths_stored .keys ()) - hash_paths_referenced )
343343 # Coverage, not exact set difference: a referenced path may be a
344344 # directory-valued object (many files + a manifest sidecar).
345345 orphaned_paths = sorted (p for p in schema_paths_stored if not _is_covered (p , schema_paths_referenced ))
346346
347- hash_deleted = 0
347+ hash_paths_deleted = 0
348348 schema_paths_deleted = 0
349349 bytes_freed = 0
350350 errors = 0
351351
352352 if not dry_run :
353353 # The size maps from the scan above are reused for the byte tally —
354354 # no second listing pass.
355- for path in orphaned_hashes :
355+ for path in orphaned_hash_paths :
356356 try :
357357 if delete_path (path , self .store , config = self .config ):
358- hash_deleted += 1
359- bytes_freed += hash_stored .get (path , 0 )
358+ hash_paths_deleted += 1
359+ bytes_freed += hash_paths_stored .get (path , 0 )
360360 if verbose :
361- logger .info (f"Deleted: { path } ({ hash_stored .get (path , 0 )} bytes)" )
361+ logger .info (f"Deleted: { path } ({ hash_paths_stored .get (path , 0 )} bytes)" )
362362 except Exception as e :
363363 errors += 1
364364 logger .warning (f"Failed to delete { path } : { e } " )
@@ -376,21 +376,21 @@ def collect(self, dry_run: bool = True, verbose: bool = False) -> dict[str, Any]
376376
377377 return {
378378 # Hash-addressed storage stats
379- "hash_referenced " : len (hash_referenced ),
380- "hash_stored " : len (hash_stored ),
381- "hash_orphaned " : len (orphaned_hashes ),
382- "hash_orphaned_bytes " : sum (hash_stored .get (h , 0 ) for h in orphaned_hashes ),
383- "orphaned_hashes " : orphaned_hashes ,
379+ "hash_paths_referenced " : len (hash_paths_referenced ),
380+ "hash_paths_stored " : len (hash_paths_stored ),
381+ "hash_paths_orphaned " : len (orphaned_hash_paths ),
382+ "hash_paths_orphaned_bytes " : sum (hash_paths_stored .get (h , 0 ) for h in orphaned_hash_paths ),
383+ "orphaned_hash_paths " : orphaned_hash_paths ,
384384 # Schema-addressed storage stats
385385 "schema_paths_referenced" : len (schema_paths_referenced ),
386386 "schema_paths_stored" : len (schema_paths_stored ),
387387 "schema_paths_orphaned" : len (orphaned_paths ),
388388 "schema_paths_orphaned_bytes" : sum (schema_paths_stored .get (p , 0 ) for p in orphaned_paths ),
389389 "orphaned_paths" : orphaned_paths ,
390390 # Deletion outcome (all zero when dry_run)
391- "hash_deleted " : hash_deleted ,
391+ "hash_paths_deleted " : hash_paths_deleted ,
392392 "schema_paths_deleted" : schema_paths_deleted ,
393- "deleted" : hash_deleted + schema_paths_deleted ,
393+ "deleted" : hash_paths_deleted + schema_paths_deleted ,
394394 "bytes_freed" : bytes_freed ,
395395 "errors" : errors ,
396396 "dry_run" : dry_run ,
0 commit comments