{% extends "base.html" %} {% from "macros.html" import empty_state %} {% block title %}Goals - Agent Wasp{% endblock %} {% block page_css %} {% endblock %} {% block content %} {# ── Title ───────────────────────────────────────────────────────────────── #}

Autonomous Goals

Multi-step plans the agent executes autonomously {% if not goal_engine_enabled %} Engine offline {% endif %}

{# ── Stats + action bar ───────────────────────────────────────────────────── #}
{# Total #}
Goals
{{ stats.total }}
{# Active / Planning — hidden when 0 #}
Running
{{ stats.active }}
{# Completed — hidden when 0 #}
Done
{{ stats.completed }}
{# Failed — hidden when 0 #}
Failed
{{ stats.failed }}
{% if templates %} {% endif %} {% if goal_engine_enabled %} {% endif %}
{# ── Goal Cards ───────────────────────────────────────────────────────────── #} {% if not goals %} {{ empty_state("No goals yet", "Create a goal and WASP will autonomously plan and execute it step by step.", "M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-3 7h3m-3 4h3m-6-4h.01M9 16h.01") }} {% else %}
{% for g in goals %} {%- set step_pct = ((g.step_count / g.max_steps * 100) | int) if g.max_steps > 0 else 0 %}
{# ── Top row: dot + info + actions ── #}
{# State dot #}
{% if g.state == 'active' %} {% elif g.state == 'planning' %} {% elif g.state == 'paused' %} {% elif g.state == 'completed' %} {% else %} {% endif %}
{# Title #}

{{ g.title or g.objective[:70] }}

{# Badges row — separated from title #}
{# State #} {% if g.state == 'active' %} ACTIVE {% elif g.state == 'planning' %} PLANNING {% elif g.state == 'paused' %} PAUSED {% elif g.state == 'completed' %} ✓ Done {% else %} FAILED {% endif %} {# Autonomy mode #} {% if g.autonomy_mode == 'full' %} FULL AUTO {% elif g.autonomy_mode == 'semi' %} SEMI AUTO {% else %} ASSIST {% endif %} {# Template origin #} {% if g.template_name %} ⬡ {{ g.template_name }} {% endif %} {# Alerts — shown only when triggered #} {% if g.stability_locked %} 🔒 Locked {% elif g.stability_in_backoff %} ⏸ Backoff {% endif %} {% if g.budget_exceeded %} 💸 Budget limit {% endif %}
{# Constraints — only if set #} {% if g.constraints %}

⚠ {{ g.constraints }}

{% endif %} {# Meta stats row #}
{# Tasks completed vs total #} {{ g.total_tasks }} task{{ 's' if g.total_tasks != 1 }} {# Steps used vs budget #} {% if g.step_count > 0 %} · {{ g.step_count }}/{{ g.max_steps }} steps {% endif %} {# Replans — only if any #} {% if g.replan_count > 0 %} · {{ g.replan_count }} replan{{ 's' if g.replan_count != 1 }} {% endif %} {# Consecutive failures warning #} {% if g.stability_consecutive_failures >= 2 %} · {{ g.stability_consecutive_failures }} consecutive failures {% endif %} {# Created at #} {% if g.created_at %} · {{ g.created_at }} {% endif %} {# Runtime — ticking for active, static for completed #} {% if g.state in ('active', 'planning') and g.started_at %} · {{ g.runtime_s }}s {% elif g.runtime_s > 0 %} · {{ g.runtime_s }}s total {% endif %}
{# Action buttons #}
{# Autonomy mode switcher — non-terminal only #} {% if g.state not in ('completed', 'failed', 'cancelled') %} {% endif %} {% if g.state in ('active', 'planning') %} {% elif g.state == 'paused' %} {% endif %} {% if g.state not in ('completed', 'failed', 'cancelled') %} {% endif %} {% if g.state == 'completed' %} {% endif %}
{# ── Progress bar (only when there are tasks) ── #} {% if g.total_tasks > 0 %}
{{ g.completed_tasks }}/{{ g.total_tasks }} task{{ 's' if g.total_tasks != 1 }} completed {{ g.progress | round(0) | int }}%
{% endif %} {# ── Active task indicator ── #} {% if g.current_task_desc and g.state == 'active' %}
{{ g.current_skill }} {{ g.current_task_desc }}
{% endif %} {# ── Error ── #} {% if g.error %}
{{ g.error }}
{% endif %} {# ── Telemetry (only shown when non-zero events occurred) ── #} {% set has_tel = g.telemetry_policy_blocks > 0 or g.telemetry_budget_exceeded_events > 0 or g.telemetry_stability_interventions > 0 %} {% if has_tel %}
{% if g.telemetry_policy_blocks > 0 %} {{ g.telemetry_policy_blocks }} policy block{{ 's' if g.telemetry_policy_blocks != 1 }} {% endif %} {% if g.telemetry_budget_exceeded_events > 0 %} {{ g.telemetry_budget_exceeded_events }} budget exceeded {% endif %} {% if g.telemetry_stability_interventions > 0 %} {{ g.telemetry_stability_interventions }} stability intervention{{ 's' if g.telemetry_stability_interventions != 1 }} {% endif %}
{% endif %} {# ── Task DAG (collapsible) ── #} {% if g.nodes %}
Task plan ({{ g.nodes|length }} task{{ 's' if g.nodes|length != 1 }}) {# List view #}
{% for node in g.nodes %}
{% if node.status == 'done' %} {% elif node.status == 'running' %} {% elif node.status == 'failed' %} {% elif node.status == 'blocked' %} {% else %} {% endif %}
{{ node.id }} {{ node.description }} {{ node.skill_name }} {% if node.risk_level == 'critical' %} CRITICAL {% elif node.risk_level == 'high' %} HIGH {% elif node.risk_level == 'medium' %} medium {% endif %} {% if node.retries > 0 %} retry {{ node.retries }}/{{ node.max_retries }} {% endif %}
{% if node.dependencies %}
deps: {{ node.dependencies | join(', ') }}
{% endif %} {% if node.output_summary %}
{{ node.output_summary }}
{% elif node.error %}
{{ node.error }}
{% endif %}
{% endfor %}
{# Graph view #}
{% endif %}
{% endfor %}
{# Embed DAG data for graph view #} {% endif %}{# end goals #} {# ── Templates Modal ─────────────────────────────────────────────────────── #} {% if templates %} {% endif %} {# ── Save Template Modal ──────────────────────────────────────────────────── #} {# ── Cancel Goal Modal ────────────────────────────────────────────────────── #} {# ── Delete Goal Modal ────────────────────────────────────────────────────── #} {# ── Delete Template Modal ────────────────────────────────────────────────── #} {# ── Create Goal Modal ────────────────────────────────────────────────────── #} {% if goal_engine_enabled %} {% endif %} {% endblock %} {% block extra_scripts %} {% endblock %}