Files
aigc-home/docs/hel-892/animate-time-correction/finalize.py
T

99 lines
6.5 KiB
Python

"""Record narrow verification and a self-excluding purpose/SHA index; preserve e420 history."""
import hashlib
import json
import shutil
import subprocess
from pathlib import Path
ROOT = Path(__file__).resolve().parents[3]
OUT = Path(__file__).resolve().parent
BASE = "e420c312e8f7ad226661db6a20608af816c719ab"
def main():
for p in (ROOT / ".local-evidence").glob("animate-time-*.txt"):
shutil.copyfile(p, OUT / p.name)
browser = json.loads((OUT / "browser-collection.json").read_bytes())
correction = json.loads((OUT / "source-time-correction.json").read_bytes())
dates = "\n".join(f"- [{r['index']}] {r['reverified_at']}" for r in correction["checks"])
summary = f"""第162批三条来源时间窄修,真实基线{BASE};不开展163,待总管HEL-893独立复审。
116/117/127原记录将取源前批次时间写作复核时间,现已重读本地准确字节,逐一核SHA/blob、commit/tree及原许可后才采样实际UTC:
{dates}
原acquisition_time、源码字节与身份/路径/许可、其它125记录的时间和未知均不变;未取新上游或执行源码。source-time-correction.json保留e420原清单、三条原倒置记录被正式约束拒绝的错误和真实纠正证明。已加入日期解析/显式时区/先取得后复核约束,未知不套默认日期。
固定块完整差集仅6指针:三条reverified_at及相同三条来源claim中的日期展示。实际doc另仅source_review_sha变化,共7指针。中文沿原来源引用派生日期,既有Drawer直接显示claim,无Drawer/CSS改动。原270值/类型/具名缺失、schema、Note38码点/尾LF、六历史、90节点87边/14mode4、38准确/3缺口/48未知、准确前端与LiteGraph绑定及旧142块/其它155对象/163原件和资格冻结。
最终本轮1212后台专项通过,1既有AnyIO弃用警告;来源与日期约束、Ruff/format、后端build、wheel/sdist三资源、双次定义/报告、真实e420旧代码隔离库更新1/skip154、154整行不变、幂等155/精确回退重升、用户前后编辑各冲突1/29列保护通过。原e420完整7884浏览、JS/前端build和注册证据明确继承,未称本轮重跑或独立审核通过。
最终新自有隔离库首导155,1440/390窄浏览{browser["assertions"]}断言;GET与隔离doc_json全等,三条日期与DOM来源身份/日期、其余来源及270原值/类型、Note/六历史SHA冻结。10新截图全部实际查看;固定6+就绪1=7、轮询2/2逐路径一致,零夹具、零禁止请求,finally停服且端口独立拒绝/可绑定。首轮573通过但截图定位不佳的8图/日志另留被替代,不累计。
初次解释器UTC兼容、输出目录相对路径及lint/格式错误与被替代的前一轮检查如实保留,未重定向的仅标终端摘录。原e420/blocked/上传失败/恢复交付和原完整浏览历史不改。新清单自排除,不递归哈希。PNG/pyc不入Git。累计143参考9749保存项275注释,余12图;全部155最终定稿/新增可靠转换/真实生成0、rCM排除。未连接目标、增加依赖、执行上游/模型/媒体、写在线库、合并部署。
"""
(OUT / "delivery-summary.md").write_text(summary)
commands = r"""从仓库根,先核准确基线/来源,禁止执行上游。
所有原结果在animate-document-evidence为历史e420,不覆盖。
export ANIMATE_EVIDENCE_OUT=docs/hel-892/animate-time-correction
export PYTHONDONTWRITEBYTECODE=1
python3 docs/hel-892/animate-time-correction/correct_sources.py
python3 docs/hel-892/animate-document-evidence/rebuild.py
python3 docs/hel-892/animate-document-evidence/verify_sources.py
python3 docs/hel-892/animate-document-evidence/repeat.py
uv run --project calliope-backend --offline pytest -c calliope-backend/pyproject.toml \
calliope-backend/tests/test_animate_fixed_document.py -q
uv build --project calliope-backend --offline
uv run --project calliope-backend --offline python docs/hel-892/animate-time-correction/recompute.py
python3 docs/hel-892/animate-time-correction/check_delta.py
python3 docs/hel-892/animate-document-evidence/source_closure.py
uv run --project calliope-backend --offline ruff check --config calliope-backend/pyproject.toml \
docs/hel-892/animate-time-correction/*.py e2e/*animate-time*.py \
docs/hel-892/animate-document-evidence/{build_definition,render_report,verify_sources}.py
uv run --project calliope-backend --offline ruff format --check \
--config calliope-backend/pyproject.toml \
docs/hel-892/animate-time-correction/*.py e2e/*animate-time*.py \
docs/hel-892/animate-document-evidence/{build_definition,render_report,verify_sources}.py
node --check e2e/animate-time.mjs
确认源/pin/包/旧库全部成功,旧自有库/输出已停服后可逆隔离,未占用他人端口:
export LD_LIBRARY_PATH=/home/xiaomo/chromium-libs/root/usr/lib/x86_64-linux-gnu:\
/home/xiaomo/browserlibs/root/usr/lib/x86_64-linux-gnu
export PLAYWRIGHT_MODULE=/home/xiaomo/.npm-global/lib/node_modules/playwright/index.mjs
export BROWSER_EXECUTABLE=/home/xiaomo/.cache/ms-playwright/chromium-1248/chrome-linux64/chrome
calliope-backend/.venv/bin/python e2e/run-animate-time.py
python3 docs/hel-892/animate-time-correction/collect_browser.py
实际查看全部10新截图,再核截图SHA、check_delta和finalize;提交推送同head后打包,包含完整窄修补丁、必要来源闭包和新截图,逐成员字节/SHA/CRC并集核验。
"""
(OUT / "validation-commands.txt").write_text(commands)
tracked = (
subprocess.check_output(["git", "diff", "--name-only", "-z", BASE], cwd=ROOT)
.decode()
.strip("\0")
.split("\0")
)
paths = {ROOT / n for n in tracked}
paths.update(p for p in OUT.rglob("*") if p.is_file())
paths.update(
ROOT / "e2e" / n
for n in ["animate-time.mjs", "animate-time-server.py", "run-animate-time.py"]
)
paths.discard(OUT / "file-purpose-sha256.json")
assert not any(p.suffix in [".png", ".pyc"] for p in paths)
index = [
dict(
path=str(p.relative_to(ROOT)),
bytes=p.stat().st_size,
sha256=hashlib.sha256(p.read_bytes()).hexdigest(),
purpose="三来源实际时间窄修/日期约束/必要派生或真实验证;原失败/替代与继承明确分列",
)
for p in sorted(paths)
]
(OUT / "file-purpose-sha256.json").write_text(
json.dumps(dict(base=BASE, self_excluded=True, files=index), ensure_ascii=False, indent=2)
+ "\n"
)
print("PASS self-excluding purpose/SHA", len(index))
if __name__ == "__main__":
main()