{% extends "base.html" %} {% block content %}

Discovery

{% if db_unavailable %}

State DB unavailable

Complete the setup wizard first.

{% else %}

Controls

Loading controls…

Live progress

Streaming from the newest discovery JSONL log. New lines appear here as the pipeline runs.
{% if last_run %}

Last run

Run ID
{{ last_run.run_id }}
Started
{{ last_run.started_at }}
Finished
{{ last_run.finished_at or "—" }}
Status
{{ last_run.status or "—" }}
Papers processed
{{ last_run.papers_processed or 0 }}
Papers skipped
{{ last_run.papers_skipped or 0 }}
Papers failed
{{ last_run.papers_failed or 0 }}
{% else %}

No discovery runs in the log yet.

{% endif %}

Run history (last 10)

{% if recent_runs %} {% for run in recent_runs %} {% endfor %}
StartedStatusProcessedSkippedFailed
{{ run.started_at }} {{ run.status or "—" }} {{ run.papers_processed or 0 }} {{ run.papers_skipped or 0 }} {{ run.papers_failed or 0 }}
{% else %}

No run history yet — runs appear here once discovery completes.

{% endif %} {# P8: discovery runs table with links to per-run paper cards (/discovery/{id}) #} {% if discovery_runs %}

Discovery runs

{% if latest_discovery_run %}

Latest run — #{{ latest_discovery_run.id }}

{{ (latest_discovery_run.started_at or "")[:19] or "—" }} · {{ latest_discovery_run.status or "unknown" }} · {{ latest_discovery_run.total_ingested or 0 }} ingested / {{ latest_discovery_run.total_found or 0 }} found · View papers →

{% endif %} {% for run in discovery_runs %} {% endfor %}
RunStartedStatusFoundIngested
#{{ run.id }} {{ (run.started_at or "")[:19] or "—" }} {{ run.status or "—" }} {{ run.total_found or 0 }} {{ run.total_ingested or 0 }} Papers →
{# AR-7: corpus-style prev/next pagination for the discovery-runs table. Prev is hidden at offset 0; Next is hidden on the last page. #}
{{ runs_offset + 1 }}–{{ runs_offset + discovery_runs|length }} of {{ runs_total }} {% if runs_has_prev %} ← Prev {% endif %} {% if runs_has_next %} Next → {% endif %}
{% endif %}

Today's digest

{% if digest_path %}

Source: {{ digest_path }}

{% if digest_content %}
{{ digest_content }}
{% else %}

Digest file exists but could not be read.

{% endif %} {% else %}

No digest file for today (or vault path not configured).

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