{# One-sentence plain summary for a non-technical user (decision + clause); numbers live in the meta line below. #} {% macro plain_summary(d) %}

{{ t('ps.' ~ d.decision.value) }}{% if d.evidence.contract_clauses_cited %} · {{ d.evidence.contract_clauses_cited|join(', ') }}{% endif %}{% if d.risk.escalation %} · {{ t('ev.escalation_24') }}{% endif %}

{% endmacro %} {# AI-assistant (LLM) status chip: green=on (provider · model), gray=off with a how-to tooltip. #} {% macro llm_chip(llm) %} {% if llm and llm.enabled %} {{ t('llm.on') }} {{ llm.model }} {% else %} {{ t('llm.off') }} {% endif %} {% endmacro %} {# Short glossary (technical terms) for a PMO/manager. #} {% macro glossary() %}
{{ t('gl.title') }}
{{ t('gl.cr_t') }}
{{ t('gl.cr_d') }}
{{ t('gl.baseline_t') }}
{{ t('gl.baseline_d') }}
{{ t('gl.scope_item_t') }}
{{ t('gl.scope_item_d') }}
{{ t('gl.excluded_t') }}
{{ t('gl.excluded_d') }}
{{ t('gl.impact_t') }}
{{ t('gl.impact_d') }}
{{ t('gl.churn_t') }}
{{ t('gl.churn_d') }}
{{ t('gl.pert_t') }}
{{ t('gl.pert_d') }}
{{ t('gl.gray_t') }}
{{ t('gl.gray_d') }}
{% endmacro %} {# One-click version comparison for a dependency-change decision (case + triage screens). dep = {package, old, new} prefill; the diff loads on demand via HTMX. #} {% macro dep_compare_block(case, dep, i, deps_online) %}
📦 {{ t('vd.case_title', package=dep.package) }}
{% if deps_online %}
{{ t('vd.loading') }}
{% else %}

{{ t('deps.online_off') }}

{% endif %}
{% endmacro %} {# Shows a triage decision's full evidence chain in a collapsible accordion (reused). #} {% macro evidence_details(d) %}
{{ t('ev.title') }}
{{ t('ev.decision') }}
{{ d.decision.value|tr_decision }} · {{ t('ev.confidence') }} %{{ '%.0f'|format(d.confidence * 100) }}
{{ t('ev.reasoning') }}
{{ d.evidence.reasoning }}
{{ t('ev.best_match') }}
{{ d.evidence.best_match.item or '—' }} ({{ t('ev.similarity') }} {{ d.evidence.best_match.similarity }})
{{ t('ev.cited_clause') }}
{{ d.evidence.contract_clauses_cited|join(', ') or '—' }}
{% if d.evidence.source_coverage %}
{{ t('ev.source_coverage') }}
{% for s in d.evidence.source_coverage %} {{ "✓" if s.covered else "✗" }} {{ s.source }} ({{ s.detail }}) {% endfor %}
{% endif %} {% if d.evidence.assumptions %}
{{ t('ev.assumptions') }}
    {% for a in d.evidence.assumptions %}
  • {{ a }}
  • {% endfor %}
{% endif %}
{{ t('ev.checked') }}
{{ t('ev.checked_n', n=d.evidence.checked_against|length) }} {% for c in d.evidence.checked_against %}{{ c }}{% endfor %}
{{ t('ev.impacted_modules') }}
{% if d.evidence.impacted_signals %} {% for s in d.evidence.impacted_signals %} {% endfor %}
{{ t('ev.col_module') }}LOC{{ t('ev.col_complexity') }}
(cyclomatic)
churn
{{ t('ev.col_churn_sub') }}
{{ s.id }}{{ s.loc }}{{ s.cyclomatic }} {{ s.churn if s.churn > 1 else "—" }}
{% else %}—{% endif %}
{{ t('ev.effort_est') }}
{{ d.effort_estimate.low }}–{{ d.effort_estimate.high }} {{ d.effort_estimate.unit|tr_unit }} · {{ d.effort_estimate.basis }}
{{ t('ev.risk') }}
{{ d.risk.level.value|tr_risk }} {{ t('ev.risk_formula', p=t('risk.word.' + d.risk.probability), i=t('risk.word.' + d.risk.impact))|safe }} {% if d.risk.escalation %}· {{ t('ev.escalation_24') }}{% endif %} {% if d.risk.basis %}
{{ t('ev.risk_basis') }}: {{ d.risk.basis }}{% endif %}
{% if d.risk.signals %}
{{ t('ev.risk_signals') }}
{% for s in d.risk.signals %}{{ s }}{% endfor %}
{% endif %} {% if d.cr_draft %}
{{ t('ev.cr_draft') }}
{{ d.cr_draft.impact_analysis }}
{{ t('ev.cr_effort') }}: {{ d.cr_draft.cost }}
{% endif %}
{{ t('ev.auditability') }}
{{ t('ev.audit_line', m=d.model_version, f=d.index_freshness, d=d.human_decision.value|tr_status) }}{% if d.plugin_set %}
{{ t('ev.plugin_set') }}: {{ d.plugin_set|join(', ') }}{% endif %}
{% if d.evidence.cited_clauses %}

{{ t('ev.cited_header') }}

{% for c in d.evidence.cited_clauses %}
{{ t('badge.excluded') if c.polarity.value == 'EXCLUDED' else t('badge.included') }} {{ c.source_clause or c.id }} · {{ c.category }} · {{ c.id }}

{{ c.description }}

{% if c.limits.quantity %}{{ t('ev.limit') }} {{ c.limits.quantity }}{% if c.limits.period %}/{{ c.limits.period }}{% endif %} · {% endif %} {% if c.effort_pool_hours %}{{ t('ev.effort_pool') }}: {{ c.effort_pool_hours|int }} {{ t('common.hours_short') }} ·{% endif %} {{ t('ev.mapped_modules') }}: {{ c.mapped_modules|join(', ') or '—' }}

{% endfor %} {% endif %}
{% endmacro %}