You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
spec/audit.py Stamps the Checkout HEAD but Reads Tree Findings From Freshly Fetched main #4238
spec/audit.py stamps a run with one hub commit and measures parts of it against another. The two differ whenever the hub checkout running it is not at the tip of origin/main.
The stamp is git rev-parse --short HEAD in the hub checkout, at spec/audit.py near print(f"audit run {run_utc} | hub {hub_sha}{override}").
The tree findings read canonical_blob_sha, which resolves _hub_main_rev(). That runs git fetch -q origin main and reads FETCH_HEAD, so they always measure against the newest main on the remote.
So a run from a checkout one promotion behind stamps the older commit, while its tree: findings judge the carrier against the newer one.
Reproduction
Run it from a detached hub worktree at hub commit A, after main has moved to B:
Take a carrier whose .github/skills tree matches A byte for byte, where B changed some of those skill files. The run prints audit run <UTC> | hub <A>, and it also reports DRIFT tree: .github/skills/<skill>/SKILL.md matches a past hub revision, not the current canonical for each skill B changed. A reader holding the stamp sees drift against A that A doesn't have.
Observed on a downstream resync, from a worktree at hub 2.0.1479 (6e05308f) after #4237 promoted 54fc1303. The run stamped hub 6e05308f and flagged the five skills #4237 changed.
Expected
Either every check reads one commit and the stamp names it, or the stamp names both commits when they differ. RESYNC.md and AUDIT.md tell readers to quote the stamp in anything derived from a run, so the stamp has to identify what the findings were measured against.
Notes
The verbatim: findings appear to read the checkout's working tree, so a single run can mix the two commits. carry.py already refuses a hub checkout that is not at freshly fetched origin/main. Applying that same refusal here would be one fix.
Activity
Name the Fetched main in the Audit Run Stamp (#4260)