{# One unit: its content, what was checked, what covered its requirements, and what produced it. The content is model output and is rendered as escaped text inside
— never as markup, and
never through `| safe` (risk S1). #}
{% extends "base.html" %}
{% from "mirrorwall/components.html" import badge, kv_list, empty_state %}
{% block content %}
{{ unit_key }} — {{ title }}
{{ kv_list([
{"label": "State", "value": state},
{"label": "Goal", "value": goal},
{"label": "Version", "value": version if version is not none else "not committed"},
{"label": "Words", "value": word_count if word_count is not none else "—"},
{"label": "Content hash", "value": content_hash or "—"},
{"label": "Committed", "value": committed_at or "—"},
]) }}
{% if paused_reason %}Paused: {{ paused_reason }}
{% endif %}
Content
{% if content %}{{ content }}
{% else %}{{ empty_state("No committed content yet.") }}{% endif %}
Requirements
{% if requirements %}
Key Requirement Class Checked by
{% for requirement in requirements %}
{{ requirement.key }} {{ requirement.text }}
{{ badge("blocking" if requirement.blocking else "advisory", tone="warning" if requirement.blocking else "neutral") }}
{{ requirement.checks }}
{% endfor %}
{% else %}{{ empty_state("No requirements assigned.") }}{% endif %}
Coverage
{% if coverage %}
Requirement Satisfied Decided by Detail
{% for entry in coverage %}
{{ entry.requirement_key }}
{{ badge("yes" if entry.satisfied else "no", tone="success" if entry.satisfied else "danger") }}
{{ entry.satisfied_by }}{% if entry.satisfied_by != "deterministic_check" %} {{ badge("model-assisted", tone="neutral") }}{% endif %}
{{ entry.detail }}
{% endfor %}
{% else %}{{ empty_state("No coverage recorded.") }}{% endif %}
Validation
{% if validation %}
Family Check Result Detail
{% for check in validation %}
{{ check.kind }} {{ check.key }}
{{ badge("pass" if check.passed else ("blocking" if check.blocking else "advisory"),
tone="success" if check.passed else ("danger" if check.blocking else "warning")) }}
{{ check.detail }}
{% endfor %}
{% else %}{{ empty_state("No validation recorded.") }}{% endif %}
Findings
{% if findings %}
What the reviews found, and in which round
Round Stage Severity Category Problem Evidence Would resolve it
{% for finding in findings %}
{{ finding.round }}
{{ finding.stage }}{% if finding.escalated %} {{ badge("escalated", tone="warning") }}{% endif %}
{{ badge(finding.severity, tone="danger" if finding.severity in ("critical", "major") else "neutral") }}
{{ finding.category }}
{{ finding.problem }}{% if finding.uncertain %} {{ badge("uncertain", tone="neutral") }}{% endif %}
{{ finding.evidence }}
{{ finding.fix }}
{% endfor %}
{% else %}{{ empty_state("No findings.") }}{% endif %}
Critique and revision
{% if critiques %}
What changed between rounds, and which rule stopped the loop
Round Verdict Improvement Stopped by Rationale
{% for critique in critiques %}
{{ critique.round }}
{{ badge(critique.verdict, tone="success" if critique.verdict != "materially_deficient" else "warning") }}
{% if critique.improvement_delta is not none %}{{ "%.0f%%" | format(critique.improvement_delta * 100) }}{% else %}—{% endif %}
{{ critique.stop_reason or "—" }}
{{ critique.rationale }}
{% endfor %}
{% else %}{{ empty_state("No critique recorded.") }}{% endif %}
Provenance
{% if attempts %}
Every attempt that produced this unit
Stage Attempt Outcome Backend Model Prompt Tokens Degradations
{% for attempt in attempts %}
{{ attempt.stage }} {{ attempt.attempt }} {{ attempt.outcome }}
{{ attempt.backend }} {{ attempt.model_canonical_id or "—" }}
{{ attempt.prompt_id }} {{ attempt.prompt_version }}
{{ attempt.input_tokens }}/{{ attempt.output_tokens }}
{{ attempt.degradations | join("; ") or "—" }}
{% endfor %}
{% else %}{{ empty_state("No attempts recorded.") }}{% endif %}
History
{% if history %}