INNER CODE UNIT · Python
_render_approval
i3T4AN/KADATH · kadath/cli.py:227
def _render_approval(architect: dict, inventory: dict | None = None, styled: bool = False) -> str:
benchmark = architect["benchmark"]
title = _ansi("KADATH ARCHITECT APPROVAL", "1", "38;5;51") if styled else "KADATH benchmark approval"
section = (lambda value: _ansi(value, "1", "38;5;213")) if styled else (lambda value: value)
label = (lambda value: _ansi(value, "1", "38;5;51")) if styled else (lambda value: value)
lines = [
title,
f"{label('Objective:')} {architect['objective_prompt']}",
f"{label('Metric:')} {architect['measurement_method']}",
f"{label('Attribution:')} {architect['attribution_method']}",
f"{label('Baseline:')} {architect['baseline']}",
f"{label('Score range:')} {benchmark['score_range'][0]} to {benchmark['score_range'][1]}",
section("Rubric:"),
]
for item in benchmark["scoring_rubric"]:
lines.append(f" - {item['criterion']} ({item['weight']}%): " + json.dumps(item["measurement"], sort_keys=True))
lines.append(f"{label('Required outputs:')} " + "; ".join(f"{item['description']} [{item['evidence_ref']}]" for item in benchmark["required_outputs"]))
lines.append(f"{label('Evidence requirements:')} " + "; ".join(architect["evidence_requirements"]))