41 lines
1.2 KiB
Python
41 lines
1.2 KiB
Python
"""Every baseline tracked byte remains immutable; no exception list."""
|
|
|
|
import subprocess
|
|
|
|
from audit import ROOT, read, sha, write
|
|
|
|
|
|
def main():
|
|
baseline = read("baseline.json")
|
|
errors = [
|
|
r["path"]
|
|
for r in baseline["files"]
|
|
if not (ROOT / r["path"]).is_file() or sha((ROOT / r["path"]).read_bytes()) != r["sha256"]
|
|
]
|
|
tracked_delta = (
|
|
subprocess.check_output(["git", "diff", "--name-only", baseline["commit"], "--"], cwd=ROOT)
|
|
.decode()
|
|
.splitlines()
|
|
)
|
|
assert not errors, errors
|
|
assert all(p.startswith("docs/hel-892/batch176-offline-mapping/") for p in tracked_delta), (
|
|
tracked_delta
|
|
)
|
|
write(
|
|
"freeze.json",
|
|
dict(
|
|
baseline=baseline["commit"],
|
|
baseline_files=len(baseline["files"]),
|
|
changed_baseline_files=errors,
|
|
old_file_exceptions=[],
|
|
product_changes=0,
|
|
prior155_pins_unchanged=True,
|
|
scope="all tracked baseline bytes; no runtime/online DB access",
|
|
),
|
|
)
|
|
print(len(baseline["files"]), "old tracked files frozen, no exceptions")
|
|
|
|
|
|
if __name__ == "__main__":
|
|
main()
|