Files
Volve-DIA/volve_dia/m2.py
lamlvh 2b59d635ce Complete M2 validation and lock the G1 evaluation protocol
Run and record both blind LLM validation passes and the external
cross-checks. Freeze the evaluation inputs, well splits, and reporting
scope with a SHA-256 checksum.

Use NPT definition b for DDR-code prediction with definition a as a
sensitivity analysis. Retain the class reporting thresholds and record
the empty set of eligible classes. Make T4 and OCR fidelity the headline
analyses and align the progress report and project documentation.

Co-authored-by: OpenAI Codex <noreply@openai.com>
2026-11-18 04:13:13 +00:00

49 lines
1.2 KiB
Python

"""Shared paths and provenance helpers for the M2 validation runs."""
from __future__ import annotations
import hashlib
import json
from datetime import datetime, timedelta, timezone
from pathlib import Path
import yaml
from volve_dia import paths
CONFIG = paths.REPO_ROOT / "configs"
VALIDATION = CONFIG / "m2_validation.yaml"
PROTOCOL = CONFIG / "protocol_v1.yaml"
def directory() -> Path:
return paths.outputs_dir() / "audit" / "m2_300"
def spec() -> dict:
return yaml.safe_load(VALIDATION.read_text(encoding="utf-8"))
def repeatability_gap() -> timedelta:
protocol = yaml.safe_load(PROTOCOL.read_text(encoding="utf-8"))
return timedelta(days=protocol["validation"]["llm_raters"]["audit_1"]["second_pass_after_days"])
def digest(path: Path) -> str:
with path.open("rb") as stream:
return hashlib.file_digest(stream, "sha256").hexdigest()
def read_json(path: Path) -> dict:
return json.loads(path.read_text(encoding="utf-8"))
def write_json(path: Path, obj: dict) -> None:
tmp = path.with_suffix(".tmp")
tmp.write_text(json.dumps(obj, indent=2, ensure_ascii=False, allow_nan=False) + "\n", encoding="utf-8")
tmp.replace(path)
def utc_now() -> datetime:
return datetime.now(timezone.utc)