{# Shared solution presentation used by opportunity detail and admin solutions pages. Expects: sol (solution view model) create_pr_route_prefix (optional, defaults to /app) #} {% set create_pr_prefix = create_pr_route_prefix | default('/app') %}
⚠ Breaking change — partition filter will become mandatory
Applying this change tells BigQuery to reject any future query on this table that does not filter on the partition column. This is a guardrail, not a silent optimization.
Downstream safety not yet verified. Run shadow validation below before applying.
{% elif sol.shadow_run.status in ['queued', 'running'] %}Shadow validation is in progress — downstream safety will be verified once the run completes.
{% elif sol.shadow_run.status == 'succeeded' %}✓ Shadow-verified: no downstream model in this project fails with the change applied.
{% elif sol.shadow_run.status == 'failed' %}
✗ Shadow validation failed.
{% if sol.shadow_run.failure_reason %}
Downstream impact: {{ sol.shadow_run.failure_reason }}.
{% endif %}
Review the dbt build logs below to identify affected models before applying.
Shadow validation was skipped — downstream safety is not verified.
{% else %}Downstream safety not yet verified.
{% endif %}Solution: {{ sol.explanation }}
{% endif %} {% if sol.file_path %}Target File
{{ sol.file_path }}
{{ sol.repository }}
{% if sol.commit_sha %} · {{ sol.commit_sha[:8] }}{% endif %}
{% if sol.template_name in downstream_patch_guardrail_template_ids %} Downstream patches (spec 128) {% else %} Additional files in this fix {% endif %}
{% for fd in sol.file_diffs[1:] %} {% set pm = fd.proposal_meta or {} %} {% set patch_status = pm.get('status') if pm else None %} {% set is_spec128 = sol.template_name in downstream_patch_guardrail_template_ids and pm.get('change_type') == 'downstream_partition_filter_patch' %}{{ fd.file_path }}
{% if is_spec128 %} {{ (patch_status or 'proposed') | replace('_', ' ') | title }} {% endif %}Unable to propose an automatic patch
{% if pm.get('abstain_reason') %}{{ pm.get('abstain_reason') }}
{% endif %}Hand-edit this file to add a partition filter, then re-run shadow validation on the bundle.
| Bytes | Cost (USD) | |
|---|---|---|
| Baseline (current) | {{ "{:,}".format(sol.shadow_run.total_baseline_bytes or 0) }} | ${{ "%.4f"|format(sol.shadow_run.total_baseline_cost_usd or 0) }} |
| Shadow (proposed) | {{ "{:,}".format(sol.shadow_run.total_shadow_bytes or 0) }} | ${{ "%.4f"|format(sol.shadow_run.total_shadow_cost_usd or 0) }} |
| Delta | {% if sol.shadow_run.bytes_delta_pct is not none %}{{ "%+.1f"|format(sol.shadow_run.bytes_delta_pct) }}%{% else %}—{% endif %} | {% if sol.shadow_run.cost_delta_usd is not none %}{{ "%+.4f"|format(sol.shadow_run.cost_delta_usd) }}{% else %}—{% endif %} |
Cascade of {{ sol.shadow_run.cascade_size }} model(s). Empirical numbers from dbt run_results, not estimates.
{% elif sol.shadow_run.status == 'skipped' %}
Skipped: {{ sol.shadow_run.skipped_reason }}. Falling back to dry-run evidence above.
{% if sol.shadow_run.status == 'queued' %}Queued{% else %}Running{% endif %} — executing the dbt cascade twice against BigQuery.
{% if sol.shadow_run.cascade_size %}Cascade of {{ sol.shadow_run.cascade_size }} model(s). {% endif %} Terminal below updates every ~3 s while the cascade runs; the page will refresh itself only when it finishes. {% if sol.shadow_run.triggered_by == 'auto' %}Triggered automatically — "Auto-validate Safe solutions" is enabled.{% endif %}
content is updated in place by a
small JS polling loop hitting /app/shadow-runs//tail.
We deliberately do NOT reload the whole page — that was the
old behaviour and it was disruptive (lost scroll, reran
template, flashed UI). Only when the run reaches a terminal
status do we reload once to render the final comparison view. #}
Shadow validation — live output
{{ (sol.shadow_run.build_logs | length) // 1024 + 1 if sol.shadow_run.build_logs else 0 }} KB
{{ sol.shadow_run.build_logs or '' }}
{% else %}
Failed: {{ sol.shadow_run.failure_reason or sol.shadow_run.status }}.
{% endif %}
{% if sol.shadow_run.build_logs %}
Show dbt build logs ({{ (sol.shadow_run.build_logs | length) // 1024 + 1 }} KB)
{{ sol.shadow_run.build_logs }}
{% endif %}
{% if not sol.shadow_run or sol.shadow_run.status not in ['succeeded', 'running'] %}
Run Comparison executes the cascade twice (baseline + shadow) against your local BigQuery dataset and reports real bytes/cost deltas. Live dbt output streams below.
Skip writes the change directly to {{ sol.file_path }} with no empirical check.
{% else %}
Writes the generated change to {{ sol.file_path }} inside {{ sol.local_project_path }}.
{% endif %}
{% if sol.local_build_execution_mode and sol.local_build_execution_mode.description %}
{{ sol.local_build_execution_mode.description }}
{% endif %}
Change written to {{ sol.file_path }}. Run dbt build then sync to verify.
Local working tree not connected yet
Set the dbt project folder on this project configuration to enable
Apply to Working Tree for
{{ sol.file_path }}.
Notes
{{ sol.explanation }}
{{ sol.risk_justification }}
{% endif %} {% if sol.validation_report %} {% set report_tier = sol.validation_report.tier or sol.validation_report.overall_tier %} {% if report_tier %}Tier: {{ report_tier | replace('_', ' ') | title }}
{% endif %} {% if sol.validation_report.error %}{{ sol.validation_report.error }}
{% endif %} {% if sol.validation_report.steps %}{{ step.details }}
{% endif %} {% if step.classification %}Classification: {{ step.classification }}
{% endif %}dbt Compile
{% if sol.validation_report.dbt_compile.success %}Success{% else %}Not successful{% endif %} {% if sol.validation_report.dbt_compile.reason %} · {{ sol.validation_report.dbt_compile.reason | replace('_', ' ') }}{% endif %} {% if sol.validation_report.dbt_compile.exit_code is not none %} · Exit {{ sol.validation_report.dbt_compile.exit_code }}{% endif %} {% if sol.validation_report.dbt_compile.duration_ms is not none %} · {{ sol.validation_report.dbt_compile.duration_ms }}ms{% endif %}
{% if sol.validation_report.dbt_compile.stderr %}{{ sol.validation_report.dbt_compile.stderr }}
{% endif %}
dbt Parse
{% if sol.validation_report.dbt_parse.success %}Success{% else %}Not successful{% endif %} {% if sol.validation_report.dbt_parse.exit_code is not none %} · Exit {{ sol.validation_report.dbt_parse.exit_code }}{% endif %} {% if sol.validation_report.dbt_parse.duration_ms is not none %} · {{ sol.validation_report.dbt_parse.duration_ms }}ms{% endif %} {% if sol.validation_report.dbt_parse.manifest_available %} · Manifest available{% endif %} {% if sol.validation_report.dbt_parse.optimized_sql_source == 'manifest_diff' %} · Optimized SQL via synced manifest diff{% endif %}
{% if sol.validation_report.dbt_parse.stderr %}{{ sol.validation_report.dbt_parse.stderr }}
{% endif %}
⚠ {{ warning }}
{% endfor %}Validated: {{ sol.validation_report.timestamp }}
{% endif %} {% endif %}