git-lfs-pointer-payload-audit
Check the declared size and SHA-256 of a Git LFS v1 pointer against an explicitly supplied local payload without fetching it.
Try your first task
A source-grounded starter task has not been verified for this skill yet.
SKILL.md
name: git-lfs-pointer-payload-auditdescription: "Check the declared size and SHA-256 of a Git LFS v1 pointer against an explicitly supplied local payload without fetching it."category: developmentrisk: safesource: selfsource_type: selfdate_added: "2026-12-02"author: Koushik-Katkamtags: [git-lfs, integrity, release]Git LFS Pointer Payload Audit
Overview
Verify a small Git LFS pointer against local candidate bytes. Distinguish an invalid pointer, an unavailable payload, a size mismatch, and a same-size digest mismatch. The result applies to the supplied evidence and the selected profile.
When to Use
- Use when a Git LFS file in a release artifact or cache may be a pointer, missing, or corrupt.
- Verify pinned submodule members separately when a Git tree entry points to another commit.
Prerequisites
Supply an approved local canonical v1 pointer and optionally one approved local payload. The harness uses Python 3.12 and its standard library. Use the verification reference for the input contract and runnable block.
How It Works
1. Establish the inputs
Read the bounded pointer first. Check the selected version line, lowercase SHA-256 OID and declared size before opening any payload.
2. Perform the task
Compare sizes. When equal, hash the file in fixed-size chunks, stopping if it grows beyond the declared size.
3. Verify the result
Report scope and exact mismatch. If no payload was supplied or the file is absent, report the comparison as unverified.
Examples
A four-byte LFS payload changes from fake to bake. The illustrative expected result is payload_oid_mismatch even though the byte counts match. Run python -I verify.py --self-test on the extracted reference. Audit the selected fixture or evidence with python -I verify.py --audit pointer.txt payload.bin.
Limitations
- The first profile accepts the canonical three-line LF representation and SHA-256. Extension fields, legacy version URLs and larger objects need separate handling.
- A match establishes consistency with the supplied pointer. Publisher identity and repository signature verification require separate evidence.
- Size and OID come from the LFS pointer format. The accepted size cap and narrow three-line profile are harness policy.
Safety and side effects
Read approved stable local regular files only. Do not fetch, hydrate, invoke smudge filters, follow a symlink payload, or change tracked files.