{% extends "mirrorwall/base.html" %} {% from "mirrorwall/components.html" import badge, empty_state, json_viewer, kv_list, table %} {% block title %}Decision {{ explanation.decision_id }} — LoadCoach{% endblock %} {% block content %}

Routing explanation

{{ explanation.decision_id }}

{{ kv_list([ {"label": "Task profile", "value": explanation.task_profile.id ~ " " ~ explanation.task_profile.version}, {"label": "Strategy", "value": explanation.strategy.name ~ " " ~ explanation.strategy.version}, {"label": "Confidence policy", "value": explanation.confidence_policy_version}, {"label": "Requested at", "value": explanation.requested_at}, {"label": "Took", "value": explanation.duration_ms ~ " ms"}, {"label": "Flags", "value": (explanation.flags | join(", ")) or "none"}, {"label": "Evidence", "value": explanation.evidence_summary.source ~ " (" ~ ((explanation.evidence_summary.contributing_sources | join(", ")) or "no contributing source") ~ ")"}, ]) }} {% include "routing/_narrative.html" %} {% if explanation.selected %}

Selected

{{ kv_list([ {"label": "Model", "value": explanation.selected.canonical_id}, {"label": "Runtime profile", "value": explanation.selected.runtime_profile_hash}, {"label": "Served context", "value": explanation.selected.served_context ~ " tokens (" ~ explanation.selected.served_context_source ~ ")"}, {"label": "Target GPU", "value": explanation.selected.target_gpu_index if explanation.selected.target_gpu_index is not none else "no GPU evaluated"}, {"label": "Final score", "value": "%.4f"|format(explanation.selected.final_score)}, ]) }} {% else %} {{ empty_state("No candidate was eligible.") }} {% endif %}

Candidates

{% if explanation.candidates %} {% for candidate in explanation.candidates %}

{{ candidate.rank }}. {{ candidate.canonical_id }}

task_fit {{ "%.4f"|format(candidate.task_fit) }} × reliability {{ candidate.factors.reliability }} × availability {{ candidate.factors.availability }} × residency {{ candidate.factors.residency }} × cost {{ candidate.factors.cost }} = {{ "%.4f"|format(candidate.final_score) }} · served {{ candidate.served_context }} ({{ candidate.served_context_source }}) · profile {{ candidate.runtime_profile_hash }} {% if candidate.estimated_vram_bytes is not none %}· est. VRAM {{ candidate.estimated_vram_bytes | bytes_human }}{% endif %}

{% set columns = [ {"label": "Capability"}, {"label": "Weight", "numeric": true}, {"label": "Score", "numeric": true}, {"label": "Confidence", "numeric": true}, {"label": "Source"}, {"label": "Note"} ] %} {% set rows = [] %} {% for capability in candidate.capabilities %} {% set _ = rows.append([ capability.capability, capability.weight, "%.3f"|format(capability.score) if capability.score is not none else "absent", "%.3f"|format(capability.confidence) if capability.confidence is not none else "—", capability.source, (capability.get("note") or "") ~ (" " ~ capability.remedy if capability.get("remedy") else "") ]) %} {% endfor %} {{ table(columns, rows, table_id="candidate-" ~ candidate.model_id, complete=true, row_count=rows | length) }} {% endfor %} {% else %} {{ empty_state("No candidate survived the hard constraints.") }} {% endif %} {% if explanation.rejected %}

Rejected

{% set columns = [{"label": "Model"}, {"label": "Reason"}, {"label": "Numbers"}] %} {% set rows = [] %} {% for rejection in explanation.rejected %} {% set _ = rows.append([ rejection.canonical_id, badge(rejection.reason, tone="danger"), rejection.detail | json_pretty ]) %} {% endfor %} {{ table(columns, rows, caption="\"Nothing was eligible\" is useless without the numbers.", table_id="rejected", complete=true) }} {% endif %} {{ json_viewer(explanation, "The complete stored explanation (raw source)") }} {% endblock %}