{% extends "base.html" %} {% set page = 'loop' %} {% block title %}{{ view.title }}{% endblock %} {% block where %}{{ view.repo.key }} / {{ view.loop_id }}{% endblock %} {% block body_attrs %} data-pulse-url="{{ url_for('loop_pulse', repo_key=view.repo.key, loop_id=view.loop_id) }}" data-pulse="{{ pulse }}"{% endblock %} {% set here = url_for('loop_page', repo_key=view.repo.key, loop_id=view.loop_id) %} {% macro file_link(path, text) %}{% if path %}{{ text or path }}{% endif %}{% endmacro %} {% macro kind_icon(kind) %}{% set paths = { 'plan': '', 'research': '', 'analyse': '', 'build': '', 'review': '', 'gate': '', 'verdict': '', } %}{{ (paths.get(kind) or '')|safe }}{% endmacro %} {% block main %}

Loops / {{ view.repo.key }} / {{ view.loop_id }}

{{ view.title }}

{{ state.status }}{{ 'went quiet between rounds, past the time it said it would be back' if state.status == 'stalled' and state.rounds and not state.rounds[-1].running else status_text[state.status] }}{% if state.last_event %}last line {{ state.last_event|ago }}{% endif %}{% if branch %}branch {{ branch }}{% endif %}{% if view.repo.others %}written from {{ view.repo.path|place }}, the latest of {{ view.repo.others|length + 1 }} worktrees{% endif %}{% if manifest.pace %}{{ manifest.pace }}{% endif %}{% if state.status == 'sleeping' and state.expected %}back at {{ state.expected|stamp }}{% endif %}{% if state.ended %}ended between rounds: {{ state.ended.stop_reason|replace('_', ' ') }}{% if state.ended.summary %}, {{ state.ended.summary }}{% endif %}{% endif %}

{% if note %}

{{ note }}

{% endif %} {% if error %}{% endif %} {% if state.question %} {% set q = state.question %}

{{ 'A step needs you' if q.needs_person else 'The loop asks' }}{% if q.round %}, round {{ q.round }}{% endif %} · {{ q.asked|ago }}{% if q.blocks %} · it stands still until you answer{% if q.gives_up %}, at most until {{ q.gives_up|stamp }}{% endif %}{% endif %}

{{ q.text }}

{% if q.default %}

{% if q.gives_up %}Without an answer by {{ q.gives_up|stamp }} it goes on with{% elif q.blocks %}If it goes on without an answer, it goes on with{% else %}Until you answer, it goes on with{% endif %}: {{ q.default_text }}

{% endif %} {% if q.options %}
{% for option in q.options %}{% endfor %}
{% endif %}
{% endif %} {% set open_count = state.open_findings|length %} {% if tab == 'rounds' %} {% if not state.rounds %}

No round has run yet.

{% endif %} {% if state.rounds %}

Loop roundsa number counts that step's open material findings; pick a round

{% for r in state.rounds %}{% endfor %} {% for step_id in state.step_ids %} {% set step = manifest.step(step_id) %} {% for r in state.rounds %} {% set runs = r.runs_of(step_id) %} {% set on = ' on' if shown and r.number == shown.number else '' %} {% set not_run = 'not in a ' ~ r.mode ~ ' round' if r.mode else 'did not run' %} {% if not runs %} {% else %} {% set finds = runs|sum(attribute='material_open') %} {% set st = 'running' if runs|selectattr('status', 'equalto', 'running')|list else ('failed' if runs|selectattr('status', 'equalto', 'failed')|list else ('no' if runs|selectattr('passed', 'false')|list else ('ok' if runs|selectattr('status', 'equalto', 'ok')|list else 'skipped'))) %} {% endif %} {% endfor %} {% endfor %} {% for r in state.rounds %}{% endfor %}{% for r in state.rounds %}{% endfor %}{% for r in state.rounds %}{% endfor %}
Step{{ r.number }}
{{ (step.name if step else '') or step_id }}{{ step.kind if step else 'not in loop.json' }}{{ not_run }}{% if finds %}{{ finds }}{% else %}{{ 'said no' if st == 'no' else st }}{% endif %}
Verdict{{ (r.verdict or 'live')|replace('continue', 'go on') }}
Minutes{{ r.minutes if r.minutes is not none else '' }}
Cost{{ r.cost_usd|usd }}
{% if shown %}

Round {{ shown.number }}

{% if shown.mode %}{{ shown.mode }} round · {% endif %}{{ shown.started|stamp }}{% if shown.minutes is not none %} · {{ shown.minutes }} min{% endif %}{% if shown.cost_usd %} · {{ shown.cost_usd|usd }}{% if shown.round_cost %} for the round{% endif %}{% if shown.earlier_usd %}, {{ shown.earlier_usd|usd }} of it in an earlier try{% endif %}{% elif shown.tokens %} · {{ shown.tokens|tokens }} tokens{% endif %}{% if shown.outcome == 'discarded' %} · discarded{% endif %} · {% if shown.verdict %}{{ shown.verdict }}{% if shown.stop_reason %}: {{ shown.stop_reason|replace('_', ' ') }}{% endif %}{% else %}under way{% endif %}{% if shown.commit %} · commit {{ shown.commit[:10] }}{% endif %} · {{ shown.findings_open }} open, {{ shown.findings_closed }} closed
{% if shown.all_metrics %}

{% for m in shown.all_metrics %}{{ m.value|figure(m.unit) }} {{ m.name|replace('_', ' ') }}{% if m.target is not none %} target {{ m.target|figure(m.unit) }}{% endif %}{% endfor %}

{% endif %} {% if shown.plan or shown.plan_artifact %}

Plan{% if shown.plan_artifact %} · {{ file_link(shown.plan_artifact, 'the whole plan') }}{% endif %}

{% if shown.plan %}

{{ shown.plan }}

{% endif %}
{% endif %} {% if shown.runs %}
{% for run in shown.runs %} {% set step = manifest.step(run.step) %} {% endfor %}
StepStateWhat it did and foundTokensCostFile
{{ (step.name if step else '') or run.step }}{% if run.label %}{{ run.label }}{% endif %}{{ step.kind if step else '' }}{% if step and step.backend %} · {{ step.backend }}{% endif %}{% if run.model or (step and step.model) %}model {{ run.model or step.model }}{% endif %}{% if run.session %}session {{ run.session|truncate(12, True, '…', 0) }}{% endif %} {% if run.status == 'ok' and run.passed is false %}said no{% elif run.status == 'ok' and run.passed %}passed{% else %}{{ run.status }}{% if run.status == 'skipped' and shown.mode %} · as a {{ shown.mode }} round does{% endif %}{% endif %}{% if run.attempt and run.attempt > 1 %} · try {{ run.attempt }}{% endif %} {% if run.error %}

{{ 'Needs you: ' if run.error.kind == 'needs_person' else 'Error: ' }}{{ run.error.text }}

{% endif %}{% set head, rest = run.summary|lead %}

{{ head }}

{% if rest %}
The rest

{{ rest }}

{% endif %}{% if run.metrics %}

{% for m in run.metrics %}{{ m.name|replace('_', ' ') }} {{ m.value|figure(m.unit) }}{{ ', ' if not loop.last }}{% endfor %}

{% endif %}{% if run.findings %}
    {% for f in run.findings %}
  1. {% if f.closed %}{{ f.text }} {{ (f.resolution or 'closed')|replace('_', ' ') }}{% if f.reason %}: {{ f.reason }}{% endif %}{% else %}{{ f.text }}{% if f.severity == 'minor' %} (minor){% endif %}{% endif %}
  2. {% endfor %}
{% endif %}
{% if run.cost %}{{ run.cost.tokens|tokens }}{% if run.cost.estimated %}~{% endif %}{% endif %} {% if run.cost %}{{ run.cost.usd|usd }}{% endif %} {{ file_link(run.artifact, 'file') }}
{% elif shown.running %}

No step has reported yet.

{% endif %} {% if shown.summary or shown.next or shown.questions %}
{% if shown.summary %}

Verdict{% if shown.verdict_artifact %} · {{ file_link(shown.verdict_artifact, 'all of it') }}{% endif %}

{{ shown.summary }}

{% endif %} {% if shown.next %}

Next round

{{ shown.next }}

{% endif %} {% if shown.questions %}

Asked you

{% for q in shown.questions %}

{{ q }}

{% endfor %}
{% endif %}
{% endif %} {% endif %}
{% endif %} {% elif tab == 'findings' %} {% set reviewed = state.open_findings[0][0] if state.open_findings else none %}

Open nowwhat the last reviewed round found and nobody closed; reviews are fresh each round

{% if state.open_findings %}
{% for run, finding in state.open_findings %} {% set step = manifest.step(run.step) %} {% endfor %}
Found byFindingWeightFileYour call
{{ (step.name if step else '') or run.step }}{% if run.label %}{{ run.label }}{% endif %}{{ step.kind if step else '' }} · no. {{ finding.id }} {{ finding.text }} {{ finding.severity }} {{ file_link(run.artifact, 'file') }} {% set sent = state.settling(run, finding) %}{% if sent %}

{{ settle_words.get(sent.entry.finding.resolution, sent.entry.finding.resolution) }} sent {{ sent.entry.ts|ago }}{% if sent.entry.finding.reason %}: {{ sent.entry.finding.reason }}{% endif %}.
{{ 'The loop has read it and kept the finding open; you can send again.' if sent.read else 'The loop closes it at its next round.' }}

{% endif %}{% if not sent or sent.read %}
{% for key, word in settle_words.items() %}{% endfor %}
{% endif %}

A finding stays open until the loop closes it. "Accept as is" keeps it on purpose, "Won't fix" leaves it, "Not a problem" says the reviewer was wrong. The board sends your call to the loop; the loop closes the finding and the next review does not raise it again.

{% else %}

Nothing is open{% if not state.rounds %}: no round has run yet{% endif %}.

{% endif %} {% elif tab == 'inbox' %}

Your messages to the loopnewest first, and whether the loop has taken each

{% if state.inbox %}
{% for item in state.inbox|reverse %} {% set mark = signed[item.entry.id] %} {% endfor %}
SentKindWhatTaken by the loopFrom
{{ item.entry.ts|stamp }} · {{ item.entry.ts|ago }} {{ item.entry.kind }} {{ item.entry.text or 'Stop after the current round.' }}{% if item.entry.choice %} (picked option {{ item.entry.choice }}){% endif %}{% if item.entry.round %} · round {{ item.entry.round }}{% endif %} {% if item.read %}taken{% else %}not yet{% endif %} {% if mark is true %}this board{% elif mark is false %}not from the board{% else %}unknown{% endif %}

A line marked "not from the board" was written into inbox.jsonl by something else, an agent of the loop perhaps. A loop that checks signed ignores it.

{% else %}

Nothing sent yet. An answer, a note or a stop from this page shows here.

{% endif %} {% elif tab == 'items' %} {% if not state.items %}

This loop reports no items. A loop that evaluates a list of things sends a check event per check.

{% endif %} {% if state.items %}

What the loop evaluateseach cell is the latest check of that kind; a hatched cell means none has run

{% for kind in state.check_kinds %}{% endfor %} {% for item in state.items %} {% for kind in state.check_kinds %} {% set latest = item.latest(kind) %} {% if latest %} {% else %}{% endif %} {% endfor %} {% endfor %}
Item{{ kind }}
{{ item.name }}
{{ latest.result }}{{ latest.at|stamp }}{% if latest.who %} · {{ latest.who }}{% endif %}
    {% for check in item.history(kind)|reverse %}
  • {{ check.at|stamp }} · {{ check.result }}{% if check.who %} · {{ check.who }}{% endif %}{% if check.finding %}: {{ check.finding }}{% endif %} {{ file_link(check.evidence, 'evidence') }}
  • {% endfor %}
not run
{% endif %} {% else %} {% set finished = state.rounds|rejectattr('running')|list %} {% set last_done = finished|last if finished else none %} {% macro cap_bar(name) %}{% set bar = caps|selectattr('name', 'equalto', name)|first %}{% if bar %}{% endif %}{% endmacro %}
{{ state.rounds|length }}{% if manifest.round_cap %}/ {{ manifest.round_cap }}{% endif %}rounds{% if manifest.round_cap %}, of the cap{% endif %}{{ cap_bar('rounds') }} {{ state.open_findings|length }}findings open now
{{ state.minutes|minutes or '0 min' }}in finished rounds{% if manifest.runtime_cap_minutes %}, cap {{ manifest.runtime_cap_minutes|minutes }}{% endif %}{{ cap_bar('runtime') }}
{{ state.cost_usd|usd or '$0' }}reported cost{% if manifest.cost_cap_usd %}, cap {{ manifest.cost_cap_usd|usd }}{% endif %}{% if state.tokens %}, {{ state.tokens|tokens }} tokens{% endif %}{{ cap_bar('cost') }}
{% for bar in caps if bar.name.startswith('start ') %}
{{ bar.used }}/ {{ bar.cap }}{{ bar.name|replace(', rounds', '') }}: rounds{{ cap_bar(bar.name) }}
{% endfor %} {% if graph %}{{ manifest.steps|length }}steps a round, {{ manifest.steps|selectattr('kind', 'equalto', 'review')|list|length }} of them reviewers{% endif %}
{% if stuck %}

No progress

    {% for sign in stuck %}
  • {{ sign|capitalize }}.
  • {% endfor %}

Each such round costs time and money without getting closer.

{% if last_done %}Read round {{ last_done.number }}{% endif %}{% if state.open_findings %}{{ 'The open finding' if state.open_findings|length == 1 else 'The ' ~ state.open_findings|length ~ ' open findings' }}{% endif %}{% if not state.question %}Send a note that changes the approach{% endif %}

{% endif %} {% if state.status == 'stalled' %}

Silent since {{ state.last_event|stamp }}, {{ state.last_event|ago }}

The last line was {{ state.last_line }}.{% if state.expected %} The loop said it would be back by {{ state.expected|stamp }}.{% endif %} No line since, and {% if process %}the process the board started {{ 'still runs' if process.alive else 'has ended' }}{% else %}the board did not start it{% endif %}.

    {% if process and not process.alive %}
  1. Read the last lines it printed, below, for why it ended.
  2. {% endif %}
  3. Look where the loop runs{% if manifest.workspace and manifest.workspace.worktree %} ({{ manifest.workspace.worktree }}){% endif %}: is its process alive, is it waiting on something outside?
  4. If it died, start it again{% if manifest.commands.get('start') %} with Start below{% endif %}; a round that starts again starts clean.
  5. If it should end, send a stop: the loop takes it at its next round.
{% endif %}
{% if not state.question or state.inbox %}

{{ 'Your messages' if state.question else 'Tell the loop' }}

{% if not state.question %}
{% endif %} {% if state.inbox %}
    {% for item in state.inbox|reverse %}{% if loop.index <= 3 %}
  • {{ item.entry.kind }} · {{ 'read' if item.read else 'not read yet' }}{{ item.entry.text or 'Stop after the current round.' }} {{ item.entry.ts|ago }}
  • {% endif %}{% endfor %}
{% if state.inbox|length > 3 %}{% endif %} {% endif %}
{% endif %}

Run

{% set start = manifest.commands.get('start') %} {% set alive = process and process.alive %} {% if start and alive %}

Running since {{ process.started|stamp }}, pid {{ process.pid }}

{% elif start %}

{{ start }}

This command comes from this repository's loop.json, not from the board. It runs here with your rights.

{% if not confirmed %}{% endif %} {% if runs_elsewhere %}{% endif %}
{% else %}

This loop names no command the board could start. Start it where it lives, from its own repository.

{% endif %} {% if (start and not alive) or state.status in stoppable or state.stop_requested or alive %}
{% if start and not alive %}{% endif %} {% if state.status in stoppable or state.stop_requested %}
{% endif %} {% if alive %}
{% endif %}
{% endif %} {% if log_tail %}
{{ log_tail }}
{% endif %}
{% if charts %}

Convergenceper finished round; point at a round to read it, click to open it{% if charts|selectattr('target_y', 'ne', none)|list %}; dashed: the loop's target{% endif %}

{% endif %} {% if graph %} {% set busy = graph.nodes|selectattr('state', 'equalto', 'running')|map(attribute='name')|list %}

{% if shown %}Round {{ shown.number }}, step by step{% else %}How a round runs{% endif %}{% set broke = graph.nodes|selectattr('state', 'equalto', 'failed')|list %}{% set held = graph.nodes|selectattr('state', 'equalto', 'limit')|list %}{% set why = shown.runs|selectattr('error')|map(attribute='error.text')|map('trim')|unique|list if shown else [] %}{% if busy %}{{ busy|join(', ') }} running now{% elif shown and shown.running %}under way{% elif shown %}finished{% else %}no round yet{% endif %}{% if broke %} · {{ broke|length }} step{{ 's' if broke|length != 1 }} failed{% endif %}{% if held %} · {{ held|length }} step{{ 's' if held|length != 1 }} stopped by a limit{% if why %} ({{ why|join('; ')|replace(': None', '')|replace(': None', '')|truncate(60) }}){% endif %}{% endif %} · {{ file_link('.loops/' ~ view.loop_id ~ '/loop.json', 'defined in loop.json') }}{% if graph.nodes|selectattr('prompt')|list %} · click a step for its prompt{% endif %}

{% set kinds = graph.nodes|map(attribute='kind')|unique|list %}

Kind{% for kind in kinds %}{{ kind }}{% endfor %}

Statefinishedrunninga gate said nofailedstopped by a limitskippednot run3open material findings

{% endif %} {% set brief = manifest.brief %} {% if brief.goal or brief.audience or brief.bar or brief.path %}

Brief{% if brief.path %}{{ file_link(brief.path, 'read all of it') }}{% endif %}

{% if brief.goal %}

Goal

{{ brief.goal }}

{% endif %} {% if brief.audience %}

For

{{ brief.audience }}

{% endif %} {% if brief.bar %}

Done when

{{ brief.bar }}

{% endif %}
{% endif %} {% if manifest.outputs %}

Makes: {% for output in manifest.outputs %}{{ file_link(output.path, output.name) }}{{ ', ' if not loop.last }}{% endfor %}

{% endif %} {% if manifest.workspace or manifest.state %}

{% if manifest.workspace %}Runs on {% if manifest.workspace.branch %}branch {{ manifest.workspace.branch }}{% endif %}{% if manifest.workspace.worktree %} in {{ manifest.workspace.worktree }}{% endif %}. {% endif %}{% if manifest.state %}Hands from round to round: {% for item in manifest.state %}{{ file_link(item.path, item.name) }}{{ ', ' if not loop.last }}{% endfor %}.{% endif %}

{% endif %} {% if report.problems or report.warnings %}

What the protocol check findsthe same as loopcaptain validate in the loop's repository

    {% for line in report.problems %}
  • problem{{ line }}
  • {% endfor %} {% for line in report.warnings %}
  • warning{{ line }}
  • {% endfor %}
{% endif %} {% endif %} {% endblock %}