{# The workspace: navigator, content, findings, coverage and the actions on one unit. Every string reaching this template is model output or user input and is escaped by the environment's autoescaping. Nothing here uses `| safe`, and nothing may: risk S1 names unescaped model output as this application's highest-impact security risk, and the unit content is the single largest piece of it. Works with JavaScript disabled (ADR-0020). The navigator is links, every action is a form, and the live region is filled by `workspace.js` only as an enhancement. #} {% extends "base.html" %} {% from "mirrorwall/components.html" import badge, empty_state, kv_list %} {% block head %}{% endblock %} {% block scripts %} {% endblock %} {% block content %}

{{ project.title }}

Project · Plan · Workspace

Backend: {{ backend.mode }} {% if backend.egress %}{{ badge("leaves this machine", tone="warning") }}{% else %}{{ badge("stays on this machine", tone="success") }}{% endif %} {% if backend.routes_internally %}{{ badge("routes by task profile", tone="neutral") }}{% endif %} {% if backend.mode != "none" and not backend.structured_output %}{{ badge("no schema enforcement — validated here", tone="neutral") }}{% endif %}

{% if running_task_id %}

A stage is running

Reload this page to see progress. With JavaScript enabled it updates here as it happens.

{% endif %} {% if not units %} {{ empty_state("Nothing has been planned yet. Build a plan to start work.") }} {% else %}
{% if not unit %} {{ empty_state("Select a unit.") }} {% else %}

{{ unit.unit_key }} — {{ unit.title }}

{{ kv_list([ {"label": "State", "value": unit.state}, {"label": "Goal", "value": unit.goal}, {"label": "Version", "value": unit.version if unit.version is not none else "not committed"}, {"label": "Words", "value": unit.word_count if unit.word_count is not none else "—"}, ]) }} {% if pause.paused %}

This unit is paused

{{ pause.reason }}

{% if pause.hint %}

{{ pause.hint }}

{% endif %}

Other units are unaffected: a paused unit never stops the rest of the stage.

{% endif %}

Requirement coverage

{{ coverage_summary.satisfied }} of {{ coverage_summary.total }} satisfied. {% if coverage_summary.model_guaranteed %} {{ badge(coverage_summary.model_guaranteed ~ " guaranteed by model review, not a deterministic check", tone="warning") }} {% endif %}

{% if unit.coverage %}
{% for entry in unit.coverage %} {% endfor %}
What settled each requirement, and how
RequirementSatisfiedDecided byDetail
{{ entry.requirement_key }} {{ badge("yes" if entry.satisfied else "no", tone="success" if entry.satisfied else "danger") }} {{ entry.satisfied_by }}{% if entry.satisfied_by == "audit" %} {{ badge("model review, not a deterministic check", tone="warning") }}{% elif entry.satisfied_by not in ("deterministic_check", "") %} {{ badge("model-assisted", tone="neutral") }}{% endif %} {{ entry.detail }}
{% else %}{{ empty_state("No coverage recorded yet.") }}{% endif %}

Content

{% if unit.content %}
{{ unit.content }}
{% else %}{{ empty_state("No committed content yet.") }}{% endif %}

Findings

{% if unit.findings %}
{% for finding in unit.findings %} {% endfor %}
What the reviews found, and in which round
RoundSeverityProblemWould resolve it
{{ finding.round }} {{ badge(finding.severity, tone="danger" if finding.severity in ("critical", "major") else "neutral") }} {{ finding.problem }} {{ finding.fix }}
{% else %}{{ empty_state("No findings.") }}{% endif %}

Versions

{% if unit.history and unit.history | length > 1 %}
{% endif %} {% if unit.history %}
    {% for entry in unit.history %}
  • Version {{ entry.version }} — {{ entry.word_count }} words{% if entry.committed %} (committed {{ entry.committed_at }}){% endif %}
  • {% endfor %}
{% else %}{{ empty_state("No versions yet.") }}{% endif %}
{% if diff %}

Difference

{% if diff.unavailable %}

{{ diff.unavailable }}

{% elif diff.diff_unchanged %}

Versions {{ diff.diff_old_version }} and {{ diff.diff_new_version }} are identical — the revision changed nothing.

{% else %}

Version {{ diff.diff_old_version }} → {{ diff.diff_new_version }}: {{ diff.diff_added }} line(s) added, {{ diff.diff_removed }} removed. {% if diff.diff_truncated %}Unchanged passages are elided.{% endif %}

{% for line in diff.diff_lines %} {% endfor %}
Line-by-line difference. + is new text, - is removed.
OldNewChangeLine
{{ line.old_number if line.old_number is not none else "" }} {{ line.new_number if line.new_number is not none else "" }} {{ line.marker }} {{ line.text }}
{% endif %}
{% endif %}

How this was produced

{% if unit.attempts %}
{% for attempt in unit.attempts %} {% endfor %}
Every attempt, with the model, the prompt version and the routing decision behind it
StageAttemptBackendModelPromptRoutingDegradations
{{ attempt.stage }} {{ attempt.attempt }} {{ attempt.backend }} {{ attempt.model_canonical_id or "—" }} {{ attempt.prompt_id }} {{ attempt.prompt_version }} {% if attempt.routing %} decision {{ attempt.routing.decision_id or "—" }}{% if attempt.routing.final_score is defined and attempt.routing.final_score is not none %}, score {{ attempt.routing.final_score }}{% endif %} {% if attempt.routing.flags %}
{% for flag in attempt.routing.flags %}{{ badge(flag, tone="warning") }} {% endfor %}{% endif %} {% else %}—{% endif %}
{% if attempt.degradations %}
    {% for degradation in attempt.degradations %}
  • {{ degradation }}
  • {% endfor %}
{% else %}—{% endif %}
{% else %}{{ empty_state("No attempts recorded.") }}{% endif %}

The full unit record

{% endif %}
{% endif %} {% endblock %}