{% extends "mirrorwall/base.html" %} {% from "mirrorwall/components.html" import badge, card, empty_state, json_viewer, kv_list, table %} {% from "_macros.html" import content_cell, measure, short %} {% block title %}{{ report.trajectory.trajectory_id }} — PromptCadence{% endblock %} {% block content %} {% set doc = report.document %}
{{ badge(report.trajectory.state, tone=state_tone(report.trajectory.state)) }} · {{ report.trajectory.data_classification }} · {{ "bypassed" if report.trajectory.bypass_planning else "planned" }} · served {{ report.source }}{% if report.revision %} from revision {{ report.revision }} ({{ report.revision_cause }}){% endif %} in {{ report.composed_ms }} ms
This page renders the composed
promptcadence.trajectory_explanation document — the same bytes
GET /trajectories/{id}/explanation returns, so nothing shown here is a second reading
of the rows.
{{ doc.plan.attempts | length }} drafting attempt(s); the validated plan is {{ short(doc.plan.plan_id) if doc.plan.plan_id else "none — no attempt validated" }}.
{% set columns = [ {"label": "Attempt", "numeric": true}, {"label": "Valid"}, {"label": "Model"}, {"label": "Input", "numeric": true}, {"label": "Output", "numeric": true}, {"label": "Issues"} ] %} {% set rows = [] %} {% for one in doc.plan.attempts %} {% set _ = rows.append([ one.attempt, badge("valid", tone="success") if one.valid else badge("invalid", tone="danger"), one.model_canonical_id or "—", measure(one.usage.input_tokens), measure(one.usage.output_tokens), one.issues | length ]) %} {% endfor %} {{ table(columns, rows, caption="Drafting attempts", row_count=rows | length) }} {% if doc.plan.steps %} {% set step_columns = [ {"label": "Step"}, {"label": "Description"}, {"label": "Depends on"}, {"label": "Tier"}, {"label": "Tools"}, {"label": "Status"} ] %} {% set step_rows = [] %} {% for one in doc.plan.steps %} {% set _ = step_rows.append([ one.step_id, one.description, one.depends_on | join(", ") or "—", one.tier, one.tools | join(", ") or "none", badge(one.status, tone=outcome_tone(one.status)) ]) %} {% endfor %} {{ table(step_columns, step_rows, caption="Validated steps", row_count=step_rows | length) }} {% endif %} {% if doc.plan.approval %} {{ json_viewer(doc.plan.approval.verdict, label="Plan verdict — " ~ doc.plan.approval.outcome) }} {% endif %} {% else %} {{ empty_state("This trajectory bypassed planning, so there is no plan — the record is otherwise identical in shape.") }} {% endif %}A summarization run in its own thread: it is not part of the transcript it summarized, so it is never replayed to the model and never spends the step's turn allowance.
{% endif %} {% if thread.turns %} {% set columns = [ {"label": "#", "numeric": true}, {"label": "Role"}, {"label": "Tier"}, {"label": "Model"}, {"label": "Finish"}, {"label": "Input", "numeric": true}, {"label": "Output", "numeric": true}, {"label": "LoadCoach", "numeric": true}, {"label": "Overhead", "numeric": true}, {"label": "Content"} ] %} {% set rows = [] %} {% for turn in thread.turns %} {% set _ = rows.append([ turn.sequence, turn.role, turn.tier or "—", turn.model.canonical_id or "—", turn.finish_reason or "—", measure(turn.usage.input_tokens), measure(turn.usage.output_tokens), measure(turn.loadcoach_ms | round(0) | int if turn.loadcoach_ms is not none else none, "ms"), measure(turn.overhead_ms | round(0) | int if turn.overhead_ms is not none else none, "ms"), content_cell(turn.content) ]) %} {% endfor %} {{ table(columns, rows, caption="Turns", row_count=rows | length) }} {% else %} {{ empty_state("This thread has no recorded turn.") }} {% endif %} {% if thread.failed_attempts %} {% set attempt_columns = [ {"label": "Attempt", "numeric": true}, {"label": "Failed turn"}, {"label": "Tier"}, {"label": "Error"}, {"label": "Cause"}, {"label": "At"} ] %} {% set attempt_rows = [] %} {% for one in thread.failed_attempts %} {% set _ = attempt_rows.append([ one.attempt, short(one.failed_turn_id), one.failed_tier, one.error_code, one.cause, one.at ]) %} {% endfor %} {{ table(attempt_columns, attempt_rows, caption="Attempts that produced no turn", row_count=attempt_rows | length) }}A failed attempt was announced and never answered, so it has an event and no turn row — which is why it is listed separately rather than mixed into the transcript.
{% endif %}Compaction is a view and never a deletion: every turn above is still recorded. These rows are why one turn saw less history than the turn before it.
{% else %} {{ empty_state("Nothing was compacted: the transcript stayed inside its tier's budget.") }} {% endif %}