Skip to content

Refuse or Flag a spec/audit.py Run in a Shallow Hub Clone #2311

Closed

Description

@ptr727

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

  1. git clone --depth 1 --branch main https://github.com/ptr727/ProjectTemplate.git hub
  2. python3 hub/spec/audit.py <any downstream repo with stale verbatim sections>
  3. 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions