排盘缓存、官方快照、负缓存、网关任务和分盘段过期后会删掉。同一张盘的数字写法合成一把缓存键。失败快照只用短期限。自测留存、异步任务、增长合同、安全缓存和隐私标记;一万个文件的清理慢于 2 秒,命中率提升不到 2.5 倍,都按实测写入记录。 Co-Authored-By: Grok (agent loop)
29 lines
711 B
Python
29 lines
711 B
Python
"""Byte-compare numeric chart-cache spellings. See api_disk_cache_ab.py."""
|
|
from __future__ import annotations
|
|
|
|
import json
|
|
import sys
|
|
from pathlib import Path
|
|
|
|
sys.path.insert(0, str(Path(__file__).resolve().parent))
|
|
|
|
import api_disk_cache_ab as ab
|
|
|
|
|
|
def main() -> dict:
|
|
parent_error = None
|
|
try:
|
|
parent = ab._load_parent()
|
|
except Exception as exc:
|
|
parent = None
|
|
parent_error = exc.__class__.__name__
|
|
report = ab.run_byte_diff(parent or ab.current)
|
|
report["parent_import"] = parent_error or "ok"
|
|
report["parent"] = ab.PARENT
|
|
return report
|
|
|
|
|
|
if __name__ == "__main__":
|
|
json.dump(main(), sys.stdout, ensure_ascii=False, indent=2)
|
|
sys.stdout.write("\n")
|