Files
aigc-home/docs/hel-892/krea-story-newline-correction/verify_sources.py
T
2026-11-01 01:22:09 +08:00

46 lines
1.5 KiB
Python

"""Bind approved source evidence to f0affd5 without acquiring upstream material."""
import hashlib
import json
import subprocess
from build_definition import OUT, REPO
from rebuild import BASE
def main():
names = [
"docs/hel-892/krea-story-document-evidence/source-check.json",
"docs/hel-892/krea-story-document-evidence/source-closure.json",
"docs/hel-892/krea-story-document-evidence/frontend-build.txt",
"docs/hel-892/krea-story-document-evidence/browser-results.json",
]
rows = []
for name in names:
raw = (REPO / name).read_bytes()
assert raw == subprocess.check_output(["git", "show", BASE + ":" + name], cwd=REPO)
rows.append(dict(path=name, sha256=hashlib.sha256(raw).hexdigest(), base=BASE))
closure = json.loads((REPO / names[1]).read_bytes())
for row in closure["files"]:
assert hashlib.sha256((REPO / row["path"]).read_bytes()).hexdigest() == row["sha256"]
(OUT / "inherited-evidence.json").write_text(
json.dumps(
dict(
base=BASE,
files=rows,
source_closure_files=closure["count"],
inherited_frontend_build=True,
inherited_full_browser_assertions=3454,
new_upstream_acquisitions=0,
),
ensure_ascii=False,
indent=2,
)
+ "\n"
)
print("PASS f0affd5 approved sources/frontend/shared full-browser evidence unchanged")
if __name__ == "__main__":
main()