{# One chat turn: user question + labeled deterministic answer (+ auto-loading LLM answer). #}
{{ question }}

{{ t('ask.src_graph') }} {% if result %}{{ t('ask.strategy') }}: {{ result.strategy }}{% if result.tool %} · {{ t('ask.tool') }}: {{ result.tool }}{% endif %}{% if result.subgraph and result.subgraph.truncated %} · {{ t('ask.truncated') }}{% endif %}{% endif %}

{% if error %}

⚠ {{ error }}

{% elif nodes %}
{% for n in nodes %} {% set kind = n.id.split(':', 1)[0] %} {% set bare = n.id.split(':', 1)[1] if ':' in n.id else n.id %}
{% if kind == 'scope' %} {{ t('ask.kind_scope') }} {% elif kind == 'module' %} {{ t('ask.kind_module') }} {% elif kind == 'package' %} {{ t('ask.kind_package') }} {% else %} {{ t('ask.kind_workitem') }} {% endif %}
{{ bare }} {% if n.score %} · {{ '%.2f'|format(n.score) }}{% endif %}
{{ n.text[:220] }}{% if n.text|length > 220 %}…{% endif %}
{% endfor %}
{% elif result and result.tool_result is not none %}
{{ result.tool_result|tojson(indent=2) }}
{% else %}

{{ t('ask.empty') }}

{% endif %}
{% if llm_follow %} {# Auto-loads the AI answer after the deterministic one lands; replaces itself. #}
{{ t('ask.llm_wait') }}
{% endif %}