{# Opportunity drill-down — read-only mirror of governor-web's opportunity detail page. PR/GitHub/auto-apply surfaces deliberately removed (audit is read-only). #} {% extends "layout.html" %} {% block content %}
← Back to opportunities

Opportunity

{{ row.rule_label }}

{% if row.severity_bucket == 'critical' %} severity {{ row.severity }} · critical {% elif row.severity_bucket == 'high' %} severity {{ row.severity }} · high {% else %} severity {{ row.severity }} · {{ row.severity_bucket }} {% endif %} {% if row.is_dbt_originated %} dbt {% endif %}

{{ row.affected_table }}

{# ── Stat strip ── #}

Current cost

${{ "{:,.4f}".format(row.current_cost) }}

Estimated savings

${{ "{:,.4f}".format(row.expected_savings) }}

dbt model

{{ row.dbt_model_name or '—' }}

{# ── Rule explanation + recommendation ── #}

Why this fired

{{ row.explanation }}

{% if rule_meta and rule_meta.description %}

{{ rule_meta.description }}

{% endif %}

Recommended fix

{{ row.explanation }}

{# ── Evidence ── #}

Evidence

{% if row.evidence_snapshot %}
{% for key, value in row.evidence_snapshot.items() %}
{{ key }}
{% if value is mapping or value is iterable and value is not string %} {{ value | tojson }} {% else %} {{ value }} {% endif %}
{% endfor %}
{% else %}

No structured evidence recorded.

{% endif %}
{# ── Offending SQL ── #} {% if job and job.query %}
Offending SQL · job {{ job.job_id }} view job → {{ job.query | length }} chars
{% for line in job.query.split('\n') %}{{ loop.index }}{{ line }}
{% endfor %}
{% else %}

Offending SQL

Source job no longer cached — re-scan to repopulate.

{% endif %}
{% endblock %}