{# One
per JobVersion. Summary line carries everything the user needs to scan the list (date range, execution count, cost, resolved / new-rule chips); the diff body and the full query are hidden until the user expands. The LATEST version is open by default - the caller sets ``is_latest`` to True when looping. Earlier versions stay collapsed so the page is short by default and the user expands only what they want to see. Anchor target: id="version-{{ version.version_id }}". The chart's click-handler navigates to /jobs/{first_job_id}?from=cohort which hits the per-execution view; the per-execution view then links back to /jobs/{table}#execution-{job_id} which scrolls to a matching anchor lower in this card. #}
v{{ version.version_index }} {{ version.first_seen.strftime("%Y-%m-%d %H:%M") }} {% if version.first_seen != version.last_seen %} → {{ version.last_seen.strftime("%Y-%m-%d %H:%M") }} {% endif %} UTC {{ version.executions | length }} execution{% if version.executions | length != 1 %}s{% endif %} · {{ version.total_cost | format_usd }} {# Inline resolved / new chips so users see the headline-level "what changed" without expanding the card. #} {% if version.resolved_rules %} {% for rule_type in version.resolved_rules | sort %} {{ rule_type | replace('_', ' ') }} resolved {% endfor %} {% endif %} {% if version.newly_introduced_rules %} {% for rule_type in version.newly_introduced_rules | sort %} {{ rule_type | replace('_', ' ') }} new {% endfor %} {% endif %}
{% if version.diff_against_previous %}
{% set diff_lines = version.diff_against_previous %} {% set file_path = "v" ~ (version.version_index - 1) ~ " → v" ~ version.version_index %} {% include "components/code_diff.html" %}
{% else %}

Initial version in this scan window - no previous version to diff against.

{% for line in (version.query_text or '').split('\n') %}{{ loop.index }}{{ line }}
{% endfor %}
{% endif %}
{# Per-execution anchors so /jobs/{job_id}?from=cohort can scroll back to the right execution. Hidden visually - anchor only. #}