Implement fsck integrity verification #2

merged colechristensen cole.christensen@gmail.com wants to merge feat/fsck-integrity-verification into main
No CI

Summary

  • Add Fsck.check/2 with :full and :quick modes for repository integrity verification
  • Add list_objects/2 callback to Storage behaviour, implemented in all three backends
  • Full mode verifies: loose object SHA integrity, object graph completeness, ref validity, pack checksums
  • Quick mode verifies: ref validity and graph reachability only

Closes #14

Changes

  • lib/ex_git_objectstore/fsck.ex — New module with check/2 entry point
  • lib/ex_git_objectstore/storage.ex — Added list_objects callback
  • lib/ex_git_objectstore/storage/{memory,filesystem,s3}.exlist_objects implementations
  • test/support/tracking_memory.ex — Added list_objects delegation
  • test/ex_git_objectstore/fsck_test.exs — 11 tests covering all acceptance criteria

Test plan

  • Valid repo returns clean report
  • Detects corrupted object data (SHA mismatch)
  • Detects missing object referenced by tree
  • Detects missing parent commit
  • Detects dangling ref
  • Detects corrupted pack checksum
  • Detects missing tag target
  • Quick mode detects dangling ref but skips SHA verification
  • Report includes counts
  • All 540 tests pass, dialyzer clean
Created Apr 09, 2026 at 04:48 UTC | Merged Apr 09, 2026 at 12:51 UTC by colechristensen cole.christensen@gmail.com