{% macro status_badge(status) -%} {%- set key = status or "unknown" -%} {%- if key == "failed" -%} {{ key }} {%- elif key == "success" -%} {{ key }} {%- else -%} {{ key }} {%- endif -%} {%- endmacro %} {% if manifest %} {% set status_key = manifest.status or "unknown" %} {% set is_stale = staleness.is_stale %} {% set card_tone = "border-red-300 bg-red-50" if status_key == "failed" else "border-emerald-300 bg-emerald-50" if status_key == "success" and is_stale == false else "border-amber-300 bg-amber-50" %}

Latest run

{{ status_badge(status_key) }} {% if is_stale %} stale {% endif %}
Triggered by
{{ manifest.triggered_by or "—" }}
Events
{{ manifest.n_events if manifest.n_events is not none else "—" }}
Users with recommendations
{{ manifest.n_users_with_recommendations if manifest.n_users_with_recommendations is not none else "—" }}
Models
{{ manifest.models or "—" }}
{% if manifest.status == "failed" and manifest.error %}
{{ manifest.error }}
{% endif %} {% if is_stale %}

Stale: expected another run by {{ staleness.expected_next_run }}, none seen yet.

{% elif staleness.error %}

Can't determine staleness: job.cron_schedule is misconfigured ({{ staleness.error }}).

{% endif %}
{% else %}

Latest run

No job runs recorded yet.
{% endif %} {% if events_enabled %}

Incremental events

Source: {{ events_kind or "—" }}
{% if incremental %}
Last flush
{% if incremental.last_incremental_at %} {% else %} — {% endif %}
Status
{{ status_badge(incremental.status) }}
Events applied
{{ incremental.events if incremental.events is not none else "—" }}
{% if incremental.online_users_refreshed is not none %}
Online users refreshed
{{ incremental.online_users_refreshed }}
{% endif %} {% if incremental.online_fit_partial_epochs is not none %}
Online fit_partial epochs
{{ incremental.online_fit_partial_epochs }}
{% endif %}
{% if incremental.status == "failed" and incremental.error %}
{{ incremental.error }}
{% endif %}

Last successful flush from manifests. Live lag is on serve /metrics as cicerone_events_source_lag.

{% else %}

No incremental flushes recorded in recent manifests yet.

Live lag/backlog is on serve /metrics.

{% endif %}
{% endif %} {% if history %}

Recent runs

{% for run in history %} {% set is_current = manifest and (run.generated_at|string) == (manifest.generated_at|string) %} {% endfor %}
Recent job runs
When Status Triggered by Error
{% if is_current %}Current. {% endif %} {% if run.generated_at %} {% else %} — {% endif %} {{ status_badge(run.status) }} {% if is_current %} current {% endif %} {{ run.triggered_by or "—" }} {% if run.error %}
{{ run.error }}
{{ run.error }}
{% else %} {% endif %}
{% if history|length == 1 %}

Only the latest run is available for this output backend (a "dataset" output overwrites manifest.json every run -- switch to a "db" output for full history).

{% endif %} {% endif %}