{% import "macros.html" as m with context %} {% set rec = s.context.record %}

{{ s.number }} {{ s.title }}

{% if meta.creators %}{{ m.row(t('creators'), m.agent_line(meta.creators)) }}{% endif %} {% if meta.contributors %}{{ m.row(t('contributors'), m.agent_line(meta.contributors)) }}{% endif %} {% if meta.created %}{{ m.row(t('created'), meta.created) }}{% endif %} {% if meta.issued %}{{ m.row(t('issued'), meta.issued) }}{% endif %} {% if meta.modified %}{{ m.row(t('modified'), meta.modified) }}{% endif %} {% if meta.version_iri %}{{ m.row(t('this_version'), m.link_or_text(meta.version_iri)) }}{% endif %} {% if meta.prior_version %}{{ m.row(t('prior_version'), m.link_or_text(meta.prior_version)) }}{% endif %}
{% if rec %}

{{ t('prov_timeline') }}

    {% for e in rec.events %}
  1. {{ e.title }}{% if e.detail %}{{ e.detail }}{% endif %}
  2. {% endfor %}
{% if rec.fixes %}

{{ t('prov_fixes') }}

{{ t('prov_fixes_intro', original=rec.fixes.derived_from.name or '?', n=rec.fixes.applied|length) }}

{% for a in rec.fixes.applied %} {% set term = onto.terms.get(a.subject) if a.subject else none %} {% endfor %}
{{ t('prov_fix_term') }}{{ t('prov_fix_change') }}{{ t('prov_fix_by') }}{{ t('prov_fix_at') }}
{% if term %}{{ term.label }}{% else %}{{ t('prov_fix_ontology') }}{% endif %} {{ a.title }}{% if a.ai_assisted %} AI-assisted{% endif %}
{{ a.option }}{% if a.edited %} · {{ t('prov_fix_edited') }}{% endif %}
{% if a.made_by.type == 'llm' %}{{ a.made_by.provider or a.made_by.source }} · {{ a.made_by.model }}{% if a.made_by.revision %}
{{ a.made_by.revision[:16] }}{% endif %}{% else %}{{ a.source }} {{ a.made_by.id or a.rule }}{% endif %}
{% endif %}

{{ t('prov_build') }}

{% if rec.source.name %}{{ m.row(t('prov_source'), rec.source.name ~ (' (' ~ rec.source.size|filesize ~ ')' if rec.source.size else '')) }}{% endif %} {% if rec.source.sha256 %}{% endif %} {{ m.row(t('prov_tool'), rec.tool.name ~ ' ' ~ rec.tool.version) }} {% if rec.checks %}{{ m.row(t('prov_checks'), rec.checks|join(', ')) }}{% endif %}
SHA-256{{ rec.source.sha256 }}
{{ t('prov_started') }}
{{ t('prov_finished') }} ({{ rec.seconds }} s)
{% endif %}

{{ t('prov_generated', source=onto.source_kind == 'linkml' and 'a LinkML schema' or 'the ontology source', version=version) }}{% if not inline %} Machine-readable: provenance.ttl (W3C PROV-O).{% endif %}