Repository navigation
Description
Problem
spec/audit.py returns confident but wrong findings when it runs in a shallow hub clone, and it gives no warning. AUDIT.md section 8 says that re-running the audit needs a full hub clone. The tool never checks for one, so the requirement is enforced only by whoever happens to read that paragraph.
Two kinds of finding change, and nothing in the output marks either as unreliable:
- Stale-vs-modified classification. In a depth-1 clone, every stale verbatim section and every stale carried tree file reports "differs from the canonical and matches no past hub revision - the repo modified fixed content, review it". The remedy for that wording is to read each diff for a local edit. A full clone of the same hub commit reports the same units as "matches a past hub revision ... re-vendor it".
- The intent staleness advisory. In a depth-1 clone, every intent-fidelity file reports the hub canonical as last changed at the clone's single commit, so they all name the same SHA and date. AUDIT.md section 8 does not mention this one.
Reproduce
git clone --depth 1 --branch main https://github.com/ptr727/ProjectTemplate.git hubpython3 hub/spec/audit.py <any downstream repo with stale verbatim sections>git -C hub fetch --unshallow origin main, then re-run step 2.
Observed with a downstream audit at hub 6b1b147. The depth-1 run reported 32 "matches no past hub revision" findings. The full-history run of the same commit reported none, and every intent advisory named a different, earlier hub commit.
Expected
spec/audit.py checks git rev-parse --is-shallow-repository on the hub root. When the clone is shallow it either refuses with a message naming the fix (git fetch --unshallow), or it marks each history-dependent finding as unreliable instead of classifying it.
STANDUP.md/RESYNC.md section 1 could also say "a full clone" where they say "a checkout of your own", since a shallow clone is the natural way to read main cheaply.
Activity
Refuse History Reads in a Shallow Hub Clone (#2332)