Summary
Add tests for the currently-uncovered branches of render_report in src/intent_alignment/report.py.
Why
render_report is the library's primary human-readable output, but two branches are never exercised (0% coverage per a local run):
- Empty evidence —
report.py:41: lines.append(" No evidence collected.") when report.evidence is empty.
- Timeline section —
report.py:62-66: rendered only when report.timeline is non-empty; the engine always produces timeline=[] (engine.py:118), so the Timeline block is currently dead code.
Both are simple to construct directly since AlignmentReport is a plain dataclass (src/intent_alignment/models.py:28-37).
Suggested approach
Add tests/unit/test_report.py:
def test_render_report_empty_evidence():
report = AlignmentReport(overall_alignment=50.0, confidence=40.0, status="Moderate_Drift",
breakdown={}, summary="s", evidence=[], risk="r",
recommendation="rec", timeline=[])
out = render_report(report)
assert "No evidence collected." in out
def test_render_report_timeline():
report = AlignmentReport(overall_alignment=50.0, confidence=40.0, status="Moderate_Drift",
breakdown={}, summary="s", evidence=[], risk="r",
recommendation="rec",
timeline=[{"stage": "day-1", "score": 80.0}])
out = render_report(report)
assert "Timeline" in out
assert "day-1" in out
Also cover _evidence_marker thresholds (value >= 0.7, >= 0.4, else) and _format_status if convenient.
Acceptance criteria
- Both branches and the marker/format helpers are covered.
pytest tests/ passes.
Summary
Add tests for the currently-uncovered branches of
render_reportinsrc/intent_alignment/report.py.Why
render_reportis the library's primary human-readable output, but two branches are never exercised (0% coverage per a local run):report.py:41:lines.append(" No evidence collected.")whenreport.evidenceis empty.report.py:62-66: rendered only whenreport.timelineis non-empty; the engine always producestimeline=[](engine.py:118), so the Timeline block is currently dead code.Both are simple to construct directly since
AlignmentReportis a plain dataclass (src/intent_alignment/models.py:28-37).Suggested approach
Add
tests/unit/test_report.py:Also cover
_evidence_markerthresholds (value >= 0.7, >= 0.4, else) and_format_statusif convenient.Acceptance criteria
pytest tests/passes.