INNER CODE UNIT · Python
load_baseline
MinaProtocol/mina · maintenance/deps/main.py:158
def load_baseline() -> Baseline:
raw = _read_json(BASELINE_PATH)
if raw is None:
raise DepsError(
ErrorCode.BASELINE_MISSING,
f"{BASELINE_PATH} is missing; {BASELINE_HINT}",
path=BASELINE_PATH,
)
return parse_baseline(raw)
def baseline_document(graph: DuneGraph, sources: SourceIndex) -> dict[str, Any]:
"""The baseline as plain JSON-ready data. The serialization boundary."""
index = analysis.impact_index(graph)
unreferenced = sorted(
[found.source, found.dep]
for found in analysis.unreferenced_deps(graph, sources)
if analysis.impact_of(index, (found.source, found.dep)) >= analysis.IMPACT_THRESHOLD