DrugResearchBench / verifier_tree.py
xiaojie06's picture
Add verified task assets and historical records
6f72289 verified
Raw History Blame Contribute Delete
566 Bytes
"""Bind a complete restricted reference installation without exposing private source to the actor."""
from pathlib import Path
from drb import load,require,sha,within
def check_verifier(task,root):
record=load(task/"oracle/authorized_installation.json")
private=within(root,record["directory"])
for item in record["files"]:
path=within(private,item["path"])
require(path.is_file() and path.stat().st_size==item["bytes"] and sha(path)==item["sha256"],
"Frozen private reference changed: "+item["path"])
return private