Skip to content

Fix legacy ref files showing as orphans in cache list#52

Merged
JAORMX merged 1 commit intomainfrom
fix-legacy-ref-orphan-display
Mar 24, 2026
Merged

Fix legacy ref files showing as orphans in cache list#52
JAORMX merged 1 commit intomainfrom
fix-legacy-ref-orphan-display

Conversation

@JAORMX
Copy link
Contributor

@JAORMX JAORMX commented Mar 24, 2026

Summary

  • Legacy-format ref files (written by v0.0.24, digest-only without imageRef) were not recognized by buildRefMap(), causing List() to report entries as (orphan) and gc --dry-run to incorrectly claim they would be deleted — while actual GC() via liveDigests() correctly preserved them
  • LookupRef() now self-heals by upgrading legacy refs to extended format (imageRef\tdigest) on cache hit
  • buildRefMap() now marks legacy refs as referenced with a (unknown image) placeholder until upgraded

Test plan

  • Existing tests updated for new legacy ref behavior
  • New TestLookupRef_UpgradesLegacyRef test verifies self-healing upgrade
  • All image package tests pass with -race

🤖 Generated with Claude Code

Legacy-format ref files (written by v0.0.24, digest-only) were not
recognized by buildRefMap(), causing List() to report them as orphans
and gc --dry-run to incorrectly claim they would be deleted (while
actual GC via liveDigests() correctly preserved them).

Two fixes:
- LookupRef now upgrades legacy refs to extended format on cache hit
- buildRefMap now marks legacy refs as referenced with a placeholder

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@JAORMX JAORMX merged commit 7c27de6 into main Mar 24, 2026
7 checks passed
@JAORMX JAORMX deleted the fix-legacy-ref-orphan-display branch March 24, 2026 11:35
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.

1 participant