sc_router: Missing pre-push hook for BLAKE3 LFS uploads

Resolved 💬 2 comments Opened Jan 25, 2026 by mslinn Closed Feb 12, 2026

Summary

sc_router's LFS implementation uses BLAKE3 hashing instead of SHA-256 for performance. However, the standard git lfs push command cannot recognize BLAKE3 OIDs (blake3:... instead of sha256:...), which means LFS objects are never uploaded to S3.

Root Cause

  1. sc_router's clean filter creates LFS pointers with oid blake3:...
  2. Standard git-lfs client only recognizes oid sha256:...
  3. When git lfs push scans commits for LFS objects, it finds nothing to upload
  4. The transfer agent is never invoked for uploads

Required Solution

Implement a custom pre-push hook (sc_router-pre-push) that:

  1. Scans the commits being pushed for BLAKE3 LFS pointers
  2. Collects OIDs that need to be uploaded
  3. Calls the LFS server batch API to get presigned upload URLs
  4. Invokes the transfer agent (or uploads directly) to S3

Architecture Reference

From docs/lfs_spec_v4.md:

  • "The standard Git LFS pre-push hook (installed via git lfs install) is mandatory for all Git LFS implementations"
  • "It triggers the LFS client during uploads, which then utilizes the custom transfer agent's multiplexed pipe for parallel data transfer"

Since sc_router uses BLAKE3, we cannot rely on the standard git-lfs pre-push hook - we need our own.

Files to Create

  • cmd/sc_router-pre-push/main.go - Pre-push hook binary
  • internal/filters/prepush/prepush.go - Core implementation
  • internal/filters/prepush/prepush_test.go - Unit tests

Integration with repo_setup

The sc_router repo_setup command must install the pre-push hook alongside the existing post-checkout hook:

.git/hooks/pre-push -> /path/to/sc_router-pre-push

Testing

The S3 integration test (internal/integration/s3/s3_integration_test.go) currently fails because git lfs push doesn't upload BLAKE3 objects. Once the pre-push hook is implemented, git push will trigger it automatically.

View original on GitHub ↗

This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗