analysis: resolve SHA references and measure timestamp anonymisation
Two checks the human asked for after Phase 1: whether the mapping list from the 2026-08-07 history rewrite still resolves older references, and how far the anonymisation rule actually reaches. sha_refs.tsv verifies all 251 mapping rows against the repos and resolves every SHA cited in a management doc. timestamp_anonymisation.tsv separates the project's own commits from upstream fork history before counting non-compliant timestamps.
This commit is contained in:
@@ -82,11 +82,19 @@ def assert_untouched():
|
||||
"field-test mandate forbids:\n " + "\n ".join(offending))
|
||||
|
||||
|
||||
def git(repo, *args):
|
||||
"""Run git in repo, return stdout as text. Raises on non-zero exit."""
|
||||
def git(repo, *args, env_tz=None):
|
||||
"""Run git in repo, return stdout as text. Raises on non-zero exit.
|
||||
|
||||
env_tz pins the timezone git renders dates in. Date rules in this
|
||||
project are stated in UTC; rendering them in the machine's local zone
|
||||
silently misclassifies every commit.
|
||||
"""
|
||||
env = None
|
||||
if env_tz:
|
||||
env = dict(os.environ, TZ=env_tz)
|
||||
res = subprocess.run(
|
||||
["git", "-C", str(repo), *args],
|
||||
capture_output=True, text=True, errors="replace",
|
||||
capture_output=True, text=True, errors="replace", env=env,
|
||||
)
|
||||
if res.returncode != 0:
|
||||
raise RuntimeError(f"git {' '.join(args)} in {repo}: {res.stderr.strip()}")
|
||||
|
||||
Reference in New Issue
Block a user