INNER CODE UNIT · Python

_corpus_provenance

valqore/valqore · benchmarks/run_benchmark.py:59

def _corpus_provenance() -> dict:
    """Hash every corpus file so a reviewer can confirm they ran the same inputs."""
    files = {}
    h_all = hashlib.sha256()
    for f in sorted(CORPUS.rglob("*")):
        if f.is_file():
            b = f.read_bytes()
            files[str(f.relative_to(ROOT))] = hashlib.sha256(b).hexdigest()[:16]
            h_all.update(b)
    return {"files": files, "corpus_sha256": h_all.hexdigest()[:16], "file_count": len(files)}

# Rule-prefix -> human domain (for Valqore's converged output).
DOMAIN = {
    "SP": "Security", "CS": "Security", "NET": "Security", "K8S": "Security",
    "SCS": "Supply chain", "IMG": "Supply chain",
    "CC": "Cost / FinOps", "GR": "Carbon / GreenOps", "GPU": "GPU / AI cost",
    "AIG": "AI governance", "CMP": "Compliance", "OH": "Reliability/Ops",
    "TF": "IaC (Terraform)", "DOC": "Dockerfile",

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…