{% extends "mirrorwall/base.html" %} {% from "mirrorwall/components.html" import empty_state, kv_list, table %} {% block title %}Job {{ job.job_id }} — LoadCoach{% endblock %} {% block head %} {# Stopgap until MirrorWall 0.2.1 (M5C-6): .kv-list dd clips nothing but wraps nowhere, so a long unbroken value — a canonical_id, a fingerprint — scrolls the whole page at 375 px. Structural only, no colour (UI standards §13). Remove when components.css carries it. #} {% endblock %} {% block content %}

Job

{{ job.job_id }}

{{ kv_list([ {"label": "State", "value": job.state ~ (" (" ~ job.state_reason ~ ")" if job.state_reason else "")}, {"label": "Class", "value": job["class"] ~ ", priority " ~ job.priority.base ~ " → " ~ job.priority.effective}, {"label": "Task profile", "value": job.task.id ~ " " ~ job.task.version}, {"label": "Source", "value": job.source}, {"label": "Idempotent", "value": job.idempotent}, {"label": "Model", "value": job.model.canonical_id or "not yet routed"}, {"label": "Served context", "value": (job.model.served_context ~ " tokens (" ~ job.model.served_context_source ~ ")") if job.model.served_context else "—"}, {"label": "Target GPU", "value": job.model.target_gpu_index if job.model.target_gpu_index is not none else "—"}, {"label": "Attempts", "value": job.attempt ~ " of at most " ~ job.max_attempts}, {"label": "Queue wait", "value": (job.timing.queue_wait_ms ~ " ms") if job.timing.queue_wait_ms is not none else "—"}, {"label": "Provider time", "value": (job.timing.provider_ms ~ " ms") if job.timing.provider_ms is not none else "—"}, {"label": "Overhead", "value": (job.timing.loadcoach_overhead_ms ~ " ms") if job.timing.loadcoach_overhead_ms is not none else "—"}, {"label": "Error", "value": (job.error.code ~ ": " ~ (job.error.message or "")) if job.error else "none"}, ]) }} {# Plain links, never HTML smuggled through the definition list (F6/M5C-6): kv_list escapes its values — the `| e` on the pieces made Jinja's markup_join escape the surrounding markup too, and the outer `| safe` then sealed the escaped text in. MirrorWall 0.2.1 item recorded for a kv_list link facility. #}

Explanation: {% if job.routing.decision_id %}decision {{ job.routing.decision_id }} · {% endif %}the stored document (JSON)

{% if narrative %} {% include "routing/_narrative.html" %}

Every candidate, every number, and the stored document

{% endif %} {% if job.retention.content_scrubbed_at %}

Output

Content removed by retention at {{ job.retention.content_scrubbed_at }} — the hashes, token counts, timings and the routing decision remain (spec §14). A database backup taken before the sweep keeps the text.

{% elif job.output.text %}

Output

{{ job.output.text }}
{% endif %}

Attempts

{% if job.attempts %} {% set columns = [ {"label": "#", "numeric": true}, {"label": "Model"}, {"label": "Rank", "numeric": true}, {"label": "Outcome"}, {"label": "Provider ms", "numeric": true}, {"label": "Error"}, {"label": "Prompt record"} ] %} {% set rows = [] %} {% for attempt in job.attempts %} {% set _ = rows.append([ attempt.attempt, attempt.model or "—", attempt.rank if attempt.rank is not none else "—", attempt.outcome, attempt.provider_ms if attempt.provider_ms is not none else "—", attempt.error_code or "", (attempt.prompt_id ~ " " ~ attempt.prompt_version) if attempt.prompt_id else "" ]) %} {% endfor %} {{ table(columns, rows, caption="One row per attempt; a corrective retry is a new row.", table_id="attempts", complete=true, row_count=job.attempts | length) }} {% else %} {{ empty_state("No attempt has been made yet.") }} {% endif %}

Feedback

{% if job.feedback %} {% set columns = [{"label": "Source"}, {"label": "Accepted"}, {"label": "Quality", "numeric": true}, {"label": "Edited"}, {"label": "Caller validation"}, {"label": "Notes"}, {"label": "Updated"}] %} {% set rows = [] %} {% for item in job.feedback %} {% set _ = rows.append([ item.source, "yes" if item.accepted else "no", ("%.2f"|format(item.quality_score)) if item.quality_score is not none else "—", "yes" if item.edited else "no", ("passed" if item.validation.passed else "failed") if item.validation.passed is not none else "—", item.notes or "", item.updated_at | timestamp ]) %} {% endfor %} {{ table(columns, rows, caption="One record per source; a source's later verdict replaces its earlier one.", table_id="feedback", complete=true, row_count=job.feedback | length) }} {% else %} {{ empty_state("No caller has given feedback on this job. POST /api/v1/jobs/" ~ job.job_id ~ "/feedback, or `loadcoach job feedback " ~ job.job_id ~ " --accepted`.") }} {% endif %}

Events

{% set columns = [{"label": "#", "numeric": true}, {"label": "When"}, {"label": "Event"}, {"label": "Message"}] %} {% set rows = [] %} {% for event in events %} {% set _ = rows.append([event.sequence, event.timestamp | timestamp, event.type, event.message or ""]) %} {% endfor %} {{ table(columns, rows, caption="The persisted event stream a reconnecting client replays from.", table_id="events", complete=true, row_count=events | length) }} {% endblock %}