Files
aigc-home/docs/hel-892/zimage-reverse-document-evidence/assemble_sources.py
T
2026-10-31 09:44:19 +08:00

58 lines
2.2 KiB
Python

"""Bind already fixed text independently to this graph; never execute upstream."""
import hashlib
import json
from pathlib import Path
REF = Path(__file__).resolve().parent.parent / "zimage-reverse-reference"
def main():
rows = json.loads((REF / "new-sources.json").read_bytes())["sources"]
root = REF.parent / "zimage-qwen-reference"
for original in json.loads((root / "sources.json").read_bytes())["sources"]:
if original["id"] not in [
"load",
"patch",
"frontend",
"cr",
"easy",
"reservedvram",
"dynamic-ramcache",
]:
continue
e = original.copy()
assert hashlib.sha256((root / e["local_file"]).read_bytes()).hexdigest() == e["sha256"]
e["local_file"] = "../zimage-qwen-reference/" + e["local_file"]
if not e["license_file"].startswith("未知"):
e["license_file"] = "../zimage-qwen-reference/" + e["license_file"]
e["identity_root"] = "../zimage-qwen-reference/" + e.get("identity_root", ".")
rows.append(e)
if "artifact_sha256" in e:
for suffix in ["-package.json", "-registry.json"]:
(REF / (e["id"] + suffix)).write_bytes((root / (e["id"] + suffix)).read_bytes())
p = REF.parent / "ace-qwen-reference/llama-unavailable.json"
raw = p.read_bytes()
rows.append(
dict(
id="llama-unavailable",
file="llama-unavailable.json",
local_file="../ace-qwen-reference/llama-unavailable.json",
sha256=hashlib.sha256(raw).hexdigest(),
commit="20571a3cf504b8308781d3cad2e432444ec3d75b",
tree="未知:准确提交不可得",
tag="声明提交不可得",
license_file="未知:准确提交不可得",
url="https://github.com/lihaoyun6/ComfyUI-llama-cpp_vlm",
provenance="第63批准确fetch拒绝与raw404调查记录;本批仅复核记录字节,不称新网络复核",
)
)
(REF / "sources.json").write_text(
json.dumps(dict(sources=rows), ensure_ascii=False, indent=2) + "\n"
)
print("PASS source assembly", len(rows))
if __name__ == "__main__":
main()