Build deterministic run metadata for notebook/script parity.
(
config: dict[str, Any],
dataset_meta: dict[str, Any] | None = None,
)
| 24 | |
| 25 | |
| 26 | def research_run_manifest( |
| 27 | config: dict[str, Any], |
| 28 | dataset_meta: dict[str, Any] | None = None, |
| 29 | ) -> dict[str, Any]: |
| 30 | """Build deterministic run metadata for notebook/script parity.""" |
| 31 | payload = json.dumps(config, sort_keys=True, separators=(",", ":"), default=str).encode("utf-8") |
| 32 | digest = hashlib.sha256(payload).hexdigest()[:12] |
| 33 | meta: dict[str, Any] = { |
| 34 | "config_digest": digest, |
| 35 | "config": config, |
| 36 | } |
| 37 | if dataset_meta is not None: |
| 38 | meta["dataset"] = dataset_meta |
| 39 | return meta |
| 40 | |
| 41 | |
| 42 | def make_synthetic_futures_dataset( |