{# The progress fragment: included by job.html and polled at /jobs/{id}/progress. Its root carries the header's running line, which app.js copies after each swap. #} {% import "_icons.html" as icons with context %}

{{ t('progress.pipeline') }}

{% if p.current_index %}{{ t('progress.stage_of', current=p.current_index, total=p.steps | length) }}{% endif %}
    {% for s in p.steps %}
  1. {% if s.state == 'done' %} {% elif s.state == 'running' %} {% elif s.state == 'failed' %}{{ icons.sev('error', '', 20) }} {% else %}{% endif %} {{ s.title }}{{ icons.who(s.who) }}{{ t('progress.state.' ~ s.state) }} {{ s.description }} {% if s.detail %}{{ s.detail }}{% endif %} {% if s.usage %}{{ t('progress.usage', n=s.usage.calls, tokens=number(s.usage.tokens_in + s.usage.tokens_out, ui_lang), time=duration(s.usage.seconds)) }} {% elif s.key == 'check' and s.state == 'done' %}{{ t('progress.no_model', rules=rule_count) }}{% endif %}
  2. {% endfor %}
{% if job.status == "failed" %} {% endif %} {% if p.factsheet or p.draft or p.live %}

{{ t('progress.results') }}

{% if p.live %}{{ t('progress.results_hint') }}{% endif %}
{% endif %} {% if p.factsheet or p.draft %}
{% if p.factsheet %}

{{ t('progress.factsheet') }}

{{ icons.who('model') }} {{ t('detail.facts', n=p.factsheet.facts | length, keep=p.factsheet.facts | selectattr('must_keep') | list | length) }}
{% for c in p.core %}
{{ c.label }}
{% if c.answer.text %}{{ c.answer.text }}{% else %}{{ t('core.unanswered') }}{% endif %}
{% endfor %}
{{ t('progress.must_keep') }}
    {% for f in p.factsheet.facts if f.must_keep %}
  • {{ f.id }}{{ t.get('kind.' ~ f.kind, f.kind) }}{{ f.text }}{% if f.value_norm %}{{ f.value_norm }}{% endif %}
  • {% endfor %}
{% if p.factsheet.omit_candidates %}

{{ t('progress.background', n=p.factsheet.omit_candidates | length) }}

{% endif %}
{% endif %} {% if p.draft %} {% set errors = p.rules.findings | selectattr('severity', 'equalto', 'error') | list | length if p.rules else 0 %} {% set warns = p.rules.findings | selectattr('severity', 'equalto', 'warn') | list | length if p.rules else 0 %}

{{ t('draft.version', version=p.draft.version) }}

{{ icons.who('model') }} {% if p.rules %}{{ icons.icon('code', 12) }}{{ t('progress.checked_by_code') }}{% endif %} {% if p.rules %}{{ t('count.errors', n=errors) }} ยท {{ t('count.warnings', n=warns) }}{% endif %}
{% for b in p.draft.blocks %} {% set mark = p.block_marks.get(b.id) %}
{% if mark %}{{ icons.sev(mark, t('sev.' ~ mark)) }}{% endif %}{% if b.kind == "list_item" %}• {% endif %}{{ b.text }}
{% endfor %}
{% if p.rules %}

{{ t('progress.findings', errors=errors, warns=warns) }} {{ t('progress.doc_findings') }}

{% endif %}
{% endif %}
{% endif %}