{% extends "layout.html" %} {% block content %}
Projects {{ config.name }} {% if opportunity.dbt_model != '—' %}{{ opportunity.dbt_model }}{% else %}{{ opportunity.type | replace('_', ' ') }}{% endif %}
{% if is_delegated and cascade_root %}
{% if cascade_solution %}

Root cause fix applied to upstream model {{ cascade_root.dbt_model_name }}

This issue is expected to resolve after the upstream fix takes effect. The solution below was generated for the root cause model.

{% elif cascade_pending %}

Solution pending — Governor identified {{ cascade_root.dbt_model_name }} as the root cause

A solution is being generated for the upstream model. This downstream issue is expected to resolve after the upstream fix is applied.

{% endif %} {% if cascade_relationship and cascade_relationship.lineage_path %}

Lineage path: {{ cascade_relationship.lineage_path | join(' -> ') }}

{% endif %} {% if cascade_relationship and cascade_relationship.propagation_reason %}

{{ cascade_relationship.propagation_reason }}

{% endif %} {% if cascade_root.status == 'clearing' and cascade_root.clearing_until %}

{% if local_execution_mode %}Verification window until{% else %}Clearing until{% endif %} {{ cascade_root.clearing_until | timeago }}

{% endif %} View root cause opportunity →
{% endif %}

Recommendation

{% if opportunity.dbt_model != '—' %}

{{ opportunity.dbt_model }}

{% else %}

{{ opportunity.affected_table }}

{% endif %}
!
Open the sections below only when you need the why, evidence, workflow, or validation trail. The default view stays intentionally compact.
{{ opportunity.type | replace('_', ' ') }} {% if solutions and solutions[0].local_build_execution_mode %} {{ solutions[0].local_build_execution_mode.title }} {% endif %} {% if opportunity.local_evidence_label %} {{ opportunity.local_evidence_label }} {% endif %} {% if solution_generating %} Generating {% elif pr_record %} {% if local_execution_mode %}Change linked{% else %}PR open{% endif %} {% elif has_solutions %} Ready {% endif %}

{% if opportunity.dbt_model != '—' %} {{ opportunity.affected_table }} {% else %} {{ opportunity.type | replace('_', ' ') }} {% endif %} {% if has_solutions and solutions[0].is_upstream_fix %} · fixes {{ solutions[0].upstream_model_name or solutions[0].target_model }} {% elif has_solutions and solutions[0].target_model and solutions[0].target_model != opportunity.dbt_model %} · targets {{ solutions[0].target_model }} {% endif %}

{% if solutions and solutions[0].local_build_execution_mode %}

{{ solutions[0].local_build_execution_mode.description }}

{% endif %} {% if opportunity.local_evidence_description %}

{{ opportunity.local_evidence_description }}

{% endif %}
{% if pr_record and not local_execution_mode %} View Pull Request {% endif %} {% if opportunity.status in ['active', 'pr_pending'] and opportunity.type != 'storage_billing_optimization' %}
{% elif opportunity.status == 'clearing' %} {% if local_execution_mode %}Pending verification{% else %}Evaluating previous changes{% endif %} {% endif %}

Type

{{ opportunity.type | replace('_', ' ') }}

Observed Cost

{% if opportunity.query_cost_per_run is not none %} {{ opportunity.query_cost_per_run | format_usd }} {% else %} {{ opportunity.cost_estimate }} {% endif %}

{% if opportunity.query_cost_per_run is not none %}Latest Job{% else %}Detection estimate{% endif %}

{% if opportunity.possible_savings_value is not none %}{{ opportunity.possible_savings_label }}{% else %}Recommendation State{% endif %}

{% if opportunity.possible_savings_value is not none %} ~{{ opportunity.possible_savings_value | format_usd }} {% elif pr_record %} {% if local_execution_mode %}Change linked{% else %}PR Open{% endif %} {% elif has_solutions %} Ready {% elif solution_generating %} In progress {% else %} Pending {% endif %}

{% if opportunity.possible_savings_source_label %}
{{ opportunity.possible_savings_source_label }}
{% elif has_solutions and solutions[0].trust_tier %}
{{ solutions[0].trust_tier | replace('_', ' ') | title }}
{% endif %}

Occurrences

{{ opportunity.occurrence_count or 0 }}

{{ opportunity.created_at }}

{% if opportunity.status == 'clearing' %}

{% if local_execution_mode %}Pending Verification{% else %}Clearing — Changes Under Evaluation{% endif %}

{% if local_execution_mode %} Governor is waiting for fresh warehouse evidence to confirm whether the local change actually resolved this issue. {% elif clearing_pr_record and not local_execution_mode %} This opportunity is in clearing state. The following pull request was merged and its cost impact is being evaluated: {% else %} This opportunity is in clearing state. A previously merged change is being evaluated for cost impact. {% endif %} New solutions will not be generated until this verification window ends{% if opportunity.clearing_until %} on {{ opportunity.clearing_until.strftime('%d %b %Y') }}{% endif %}.

{% if clearing_pr_record and not local_execution_mode %} PR #{{ clearing_pr_record.pr_number }} {{ clearing_pr_record.repository.split('/')[-1] }} {% elif clearing_pr_record and not local_execution_mode %}

Historical PR #{{ clearing_pr_record.pr_number }} in {{ clearing_pr_record.repository }}

{% elif opportunity.clearing_pr_number and not local_execution_mode %}

PR #{{ opportunity.clearing_pr_number }} in {{ opportunity.clearing_repository }}

{% elif local_execution_mode %}

Local working-tree change is pending verification.

{% endif %}
{% elif opportunity.type == 'storage_billing_optimization' and opportunity.evidence %} {% set ev = opportunity.evidence %}

Prepared Action

Governor prepared a deterministic BigQuery billing change for this dataset. Run the command below to switch the dataset to physical billing.

ALTER SCHEMA `{{ ev.dataset|default(opportunity.affected_table) }}`
SET OPTIONS (
  storage_billing_model = 'PHYSICAL'
);
BigQuery billing model is dataset-level. This command updates the whole dataset and cannot be reversed for 14 days.
{% elif has_solutions and opportunity.type != 'storage_billing_optimization' %} {% if opportunity.explanation %}

Problem: {{ opportunity.explanation }}

{% endif %}

Generated Solution

{% for sol in solutions %}
{% with create_pr_route_prefix=route_prefix %} {% include "components/solution_detail_content.html" %} {% endwith %}
{% endfor %}
{% elif not solution_generating and opportunity.type != 'storage_billing_optimization' %}

Generated Solution

No solution generated yet.

{% endif %}

Action Workflow

1

Detection complete

Governor detected this opportunity on {{ opportunity.created_at }}.

{% if has_solutions or opportunity.type == 'storage_billing_optimization' %} 2 {% elif solution_generating %} 2 {% else %} 2 {% endif %}

{% if opportunity.type == 'storage_billing_optimization' %}Action prepared{% else %}Generate fix{% endif %}

{% if opportunity.type == 'storage_billing_optimization' %} Deterministic SQL action is ready to run. {% elif has_solutions %} Governor has produced a solution version for review. {% elif solution_generating %} Current status: {{ solution_job_status | replace('_', ' ') }}. {% else %} No generated solution exists yet. {% endif %}

{% if opportunity.type == 'storage_billing_optimization' %} 3 {% elif has_solutions and solutions[0].trust_tier %} 3 {% elif solution_generating %} 3 {% else %} 3 {% endif %}

Validation

{% if opportunity.type == 'storage_billing_optimization' %} Storage-billing recommendations use deterministic action text. {% elif has_solutions and solutions[0].trust_tier %} Latest solution is marked {{ solutions[0].trust_tier | replace('_', ' ') | title }}. {% elif solution_generating %} Validation will run after generation finishes. {% else %} Validation will appear once a solution exists. {% endif %}

{% if pr_record %} 4 {% elif has_solutions and opportunity.type != 'storage_billing_optimization' %} 4 {% else %} 4 {% endif %}

{% if local_execution_mode %}Review / Apply{% else %}Review / PR{% endif %}

{% if pr_record %} {% if local_execution_mode %} A change is linked, but local review happens from this opportunity page. {% else %} Pull request is open and linked below. {% endif %} {% elif has_solutions and opportunity.type != 'storage_billing_optimization' %} {% if local_execution_mode %} Ready for human review and working-tree apply. {% else %} Ready for human review and optional PR creation. {% endif %} {% else %} {% if local_execution_mode %} No apply activity yet. {% else %} No PR activity yet. {% endif %} {% endif %}

{% if solution_generating and opportunity.type != 'storage_billing_optimization' %} {% endif %}

Recommendation Summary

Affected target

{% if opportunity.dbt_model != '—' %} {{ opportunity.dbt_model }} {% else %} {{ opportunity.affected_table }} {% endif %}

Table reference

{{ opportunity.affected_table }}

Status

{{ opportunity.status_label }}

{% if opportunity.workload_estimate and opportunity.workload_estimate.monthly_projection %}

Monthly projection

{{ opportunity.workload_estimate.monthly_projection | format_usd }}

{% endif %}
{% if opportunity.workload_estimate %}

Jobs Analyzed

{{ opportunity.workload_estimate.jobs_analyzed }}

Jobs With Filters

{{ opportunity.workload_estimate.jobs_with_filters }}

Filter Coverage

{{ "%.0f"|format(opportunity.workload_estimate.filter_coverage_pct) }}%

Recommendation Type

{{ opportunity.workload_estimate.recommendation_type | replace('_', ' ') | title }}

{% endif %} {% if opportunity.type == 'storage_billing_optimization' and opportunity.evidence %} {% set ev = opportunity.evidence %}

Storage Billing Analysis

Current Billing

{% with billing_model=ev.current_billing_model|default('LOGICAL') %} {% include "components/storage_billing_badge.html" %} {% endwith %}

Tables

{{ ev.table_count|default(1) }}

Compression Ratio

{{ "%.1f"|format(ev.compression_ratio|default(0)) }}x

Dataset Size

{% set tbl_gb = ev.total_logical_gb|default(0) %} {% if tbl_gb >= 1000 %}{{ "%.1f"|format(tbl_gb / 1000) }} TB{% elif tbl_gb >= 1 %}{{ "%.1f"|format(tbl_gb) }} GB{% else %}{{ "%.0f"|format(tbl_gb * 1000) }} MB{% endif %}

Estimated Savings

{{ ev.monthly_savings|default(0) | format_usd }}/mo

Logical Physical
Monthly Cost {{ ev.logical_cost_monthly|default(0) | format_usd }} {{ ev.physical_cost_monthly|default(0) | format_usd }}
Savings {{ ev.monthly_savings|default(0) | format_usd }}/mo ({{ "%.0f"|format(ev.savings_percentage|default(0)) }}%)

Recommended Action

Run the following SQL in BigQuery to switch the dataset to physical billing.

ALTER SCHEMA `{{ ev.dataset|default(opportunity.affected_table) }}`
SET OPTIONS (
  storage_billing_model = 'PHYSICAL'
);
BigQuery billing model is dataset-level. This command updates the whole dataset and cannot be reversed for 14 days.
{% else %} {% if opportunity.evidence %}

Evidence Snapshot

{% if opportunity.suppressed_findings %}
{% with suppressed_findings=opportunity.suppressed_findings %} {% include "components/suppressed_findings.html" %} {% endwith %}
{% endif %} {% if opportunity.generic_evidence %}
{% for key, value in opportunity.generic_evidence.items() %}

{{ key }}

{{ value | string | truncate(120, True, '...') }}

{% if value is mapping or (value is sequence and value is not string) %}
{{ value | tojson(indent=2) }}
{% else %}

{{ value }}

{% endif %}
{% endfor %}
{% endif %}
{% endif %} {% endif %} {% if pr_record and not local_execution_mode %}

Pull Request

Open in Pull Requests PR #{{ pr_record.pr_number }} Branch: {{ pr_record.branch_name }} {% if pr_record.created_at %} {{ pr_record.created_at }} {% endif %}
{% endif %} {% if verified_savings_data %}

Post-Merge Cost Verification

{% if verified_savings_data.status == 'confirmed' %} Confirmed {% elif verified_savings_data.status == 'negative' %} Negative {% elif verified_savings_data.status == 'collecting' %} Collecting {% elif verified_savings_data.status == 'pending' %} Pending {% elif verified_savings_data.status == 'insufficient_data' %} Insufficient Data {% endif %}
{% if verified_savings_data.status == 'pending' %}

Waiting for post-merge job data to accumulate. Savings will be calculated automatically.

{% elif verified_savings_data.status == 'collecting' %}

Collecting post-merge job data. Results will appear once enough jobs have run.

{% elif verified_savings_data.status == 'insufficient_data' %}

Not enough job data in the measurement windows to calculate verified savings.

{% else %}

Pre-Merge Avg

{{ verified_savings_data.pre_merge_avg_cost | format_usd }}

{{ verified_savings_data.pre_merge_job_count }} jobs

Post-Merge Avg

{{ verified_savings_data.post_merge_avg_cost | format_usd }}

{{ verified_savings_data.post_merge_job_count }} jobs

Verified Savings

{% if verified_savings_data.verified_savings is not none %} {{ verified_savings_data.verified_savings | format_usd }} {% else %} — {% endif %}

Per run

{% endif %}
{% endif %}
Detected: {{ opportunity.created_at }} {% if opportunity.resolved_at %}Resolved: {{ opportunity.resolved_at }}{% endif %}
← Back to {{ config.name }}
{% endblock %}