{# Ranked passages, with the score every stage gave them. The per-stage history is shown because "reranking helped" is only checkable while the pre-rerank score survives. #}{% extends layout %} {% import "macros.html" as m %} {% block content %}
{# No query yet — a bookmark, a typed URL, or Enter in an empty search box. The form above is the whole page in that state; nothing is run and nothing is claimed. #} {% if not query %} {{ m.empty('Type a query above to rank passages. Nothing is sent to a model — this is retrieval only.') }} {% elif panels.search.ok %} {% set found = panels.search.data %}{{ found.count }} passages · profile {{ found.profile }} · route {{ found.route or 'default' }} {# Scores and confidence are formatted to the same widths the command line uses. A raw float renders as 0.5232638788223267, which reads as precision this number does not have and disagrees with `manicule search` about the same value. #} {% if found.confidence is not none %} · confidence {{ "%.2f" | format(found.confidence) }} ({{ found.confidence_band }}){% endif %} {% if found.cached %} · cached{% endif %}{% if found.truncated %} · truncated{% endif %}
{% if found.confidence_reason %}{{ found.confidence_reason }}
{% endif %} {# Which words the search actually ran on, and where they came from. Above the results rather than below them, because it changes how the results should be read: passages retrieved partly through words the reader did not type have to be flagged before they are read. Every line names its source document, and that is a requirement rather than presentation — `bugs/bug2.md` §3 forbids showing an expansion without its provenance, and a template is the easiest place in the system to break that by writing one fewer field. #} {% for expansion in found.expansions %}{{ expansion.display }} expands to {{ expansion.expansion }} — defined in {{ expansion.title or expansion.uri }}{% if expansion.location %}, {{ expansion.location }}{% endif %} ({{ expansion.reason }})
{% endfor %} {% if found.expanded_query %}also searched: {{ found.expanded_query }}
{% endif %} {# Never resolved, here or anywhere. Both definitions are shown with their sources so the reader picks; choosing one and presenting it as *the* expansion is the failure this feature is most able to cause. #} {% for conflict in found.conflicts %}{{ conflict.acronym }} has {{ conflict.candidates | length }} conflicting definitions in scope, so it was not expanded:
{{ hit.text }}
{% if hit.scores %}{% for stage, value in hit.scores | items %}{{ stage }} {{ "%.4f" | format(value) }} {% endfor %}
{% endif %}