{% extends "layout.html" %} {% block content %}
{# Breadcrumb + Header #}
Projects {{ config.name }}

{{ config.name }}

BigQuery spend analysis for {{ date_range.display }}

{{ display_gcp_project_id or "Unavailable from run_results" }} {% if config.github_repo %} · {{ config.github_repo }} {% endif %} · {% if last_sync_at %}Last synced {{ last_sync_at | timeago }}{% else %}Never synced{% endif %}

{% with score=health_score.overall_score, status=health_score.overall_status %} {% include "components/health_badge.html" %} {% endwith %} {% set date_range_action = '/projects/' ~ config.id %} {% include "dashboard/_date_range_picker.html" %}

Total Spend

{{ project_kpis.total_spend }}

{{ days ~ 'd window' if date_range.days else date_range.display }}

Build Spend

{{ project_kpis.build_spend }}

{{ date_range.display }}

Consumption Spend

{{ project_kpis.consumption_spend }}

{{ date_range.display }}

Storage Monthly

{% if project_kpis.storage_monthly_cost is not none %}

{{ project_kpis.storage_monthly_cost }}

{% if project_kpis.storage_latest_synced_at %} Latest snapshot {{ project_kpis.storage_latest_synced_at.strftime('%Y-%m-%d %H:%M') }} UTC {% else %} Latest synced snapshot {% endif %}

{% else %}

No snapshot

Storage sync has not run yet.

{% endif %}

Opportunities

{{ "{:,}".format(project_kpis.opportunity_count | default(0)) }}

active opportunities

Estimated Savings

{{ project_kpis.possible_savings | default('$0.00', true) }}

{% if project_kpis.total_spend_raw and project_kpis.total_spend_raw > 0 and project_kpis.possible_savings_raw and project_kpis.possible_savings_raw > 0 %}

{{ "%.0f" | format(project_kpis.possible_savings_raw | float / project_kpis.total_spend_raw | float * 100) }}% of spend, {{ 'last ' ~ days ~ ' days' if date_range.days else date_range.display }}

{% else %}

{{ 'Heuristic estimate' if date_range.days else date_range.display }}

{% endif %}

Verified Savings

{{ project_kpis.verified_savings }}

{% if project_kpis.total_spend_raw and project_kpis.total_spend_raw > 0 and project_kpis.verified_savings_raw and project_kpis.verified_savings_raw > 0 %}

{{ "%.0f" | format(project_kpis.verified_savings_raw | float / project_kpis.total_spend_raw | float * 100) }}% of spend, {{ 'last ' ~ days ~ ' days' if date_range.days else date_range.display }}

{% else %}

{{ project_kpis.verified_savings_pct_of_spend }} of total spend{% if not date_range.days %}, {{ date_range.display }}{% endif %}

{% endif %}
{% if background_jobs_running %}
Processing in background: {% set parts = [] %} {% if running_syncs %}{% set _ = parts.append(running_syncs ~ ' sync' ~ ('s' if running_syncs != 1 else '')) %}{% endif %} {% if running_detections %}{% set _ = parts.append(running_detections ~ ' detection' ~ ('s' if running_detections != 1 else '')) %}{% endif %} {% if running_solutions %}{% set _ = parts.append(running_solutions ~ ' solution' ~ ('s' if running_solutions != 1 else '')) %}{% endif %} {{ parts | join(', ') }} · auto-refresh on
{% endif %} {# Cost trend chart #} {% if selected_lens != 'storage' %}

{% if selected_lens == 'build' %} Daily Build Spend Trend {% elif selected_lens == 'consumption' %} Daily Consumption Trend {% else %} Daily Spend Trend {% endif %}

{% if trend_data and trend_data | length > 0 %}
{% else %}

No {{ selected_lens_label | lower }} trend data available for this period

{% endif %}
{% endif %} {# Manifest Breakdown and Solution Safety cards removed — solution state is shown in the opportunities table #} {# Opportunity list — datastar-powered live filter (spec 025) #}

Opportunities

!
Row values use the same observed, estimated, and validated savings rules as the cross-project workspace.
{# Loading spinner — shown by datastar during SSE requests #}

Legend

Observed Estimated Validated Generating
{% include "project/_opportunities_table.html" %}
{# Storage cost breakdown — contextual with optimizations (spec 034) #} {% if storage_summary %}

Storage Billing Analysis

{% if storage_summary.latest_synced_at %}

Latest snapshot {{ storage_summary.latest_synced_at.strftime('%Y-%m-%d %H:%M') }} UTC

{% endif %}

Monthly Cost

{{ storage_summary.total_monthly_cost | format_usd }}

Savings Available

{{ storage_summary.total_potential_savings | format_usd }}

Datasets

{{ storage_summary.dataset_count }}

Logical Size

{% set gb = storage_summary.total_logical_bytes / 1000000000 %} {% if gb >= 1000 %}{{ "%.1f"|format(gb / 1000) }} TB{% else %}{{ "%.1f"|format(gb) }} GB{% endif %}

{% set initial_tables = storage_summary.datasets[:10] if storage_summary.datasets else [] %} {% with storage_tables=initial_tables, stor_pagination=storage_pagination, stor_sort='monthly_cost', stor_direction='desc', config_id=config.id %} {% include "project/_storage_table.html" %} {% endwith %}
{% endif %} {# Statistics charts #} {% if selected_lens != 'storage' %}

{% if selected_lens == 'build' %} Build Usage Statistics {% elif selected_lens == 'consumption' %} Consumption Usage Statistics {% else %} Usage Statistics {% endif %}

{% if trend_data and trend_data | length > 0 %}

{% if selected_lens == 'build' %}Build Jobs / Day{% elif selected_lens == 'consumption' %}Consumption Jobs / Day{% else %}Runs / Day{% endif %}

Bytes / Day

Slots / Day

{% else %}

No {{ selected_lens_label | lower }} usage data available for this period

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