---
type: "Source File"
title: "<section class=\"hero hero-compact\">"
description: "{% extends \"base.html\" %} {% block title %}ONS Oracle{% endblock %} {% block content %} <section class=\"hero hero-compact\"> <div class=\"hero-inner\"> <h1 class=\"hero-title\">The ONS Oracle</h1> <p class=\"hero-subtitle\">."
resource: "https://uk.copecheck.com"
tags: ["copecheck", "uk", "source-file", "html"]
timestamp: "2026-04-23T08:44:17Z"
site: "uk"
source_path: "copecheck-uk/templates/oracle.html"
---

# <section class="hero hero-compact">

Source path: `copecheck-uk/templates/oracle.html`  
Index snapshot generated: `2026-11-24T13:42:54Z`  
File modified: `2026-04-23T08:44:17Z`

```html
{% extends "base.html" %}
{% block title %}ONS Oracle{% endblock %}

{% block content %}
<section class="hero hero-compact">
    <div class="hero-inner">
        <h1 class="hero-title">The ONS Oracle</h1>
        <p class="hero-subtitle">
            AI-scored analysis of ONS and Bank of England data. What the numbers actually say
            versus what politicians claim they say.
        </p>
    </div>
</section>

<section class="oracle-section">
    {% if latest %}
    <div class="oracle-latest">
        <div class="oracle-month-header">
            <h2 class="oracle-month-title">{{ latest.month }}</h2>
            <span class="oracle-model-badge">Scored by {{ latest.ai_model or 'seed' }}</span>
        </div>

        {% if latest.ai_summary %}
        <div class="oracle-block">
            <h3 class="oracle-block-title">
                <span class="block-icon">&#x1f4ca;</span> Summary
            </h3>
            <div class="oracle-text">{{ latest.ai_summary }}</div>
        </div>
        {% endif %}

        {% if latest.ai_gap_analysis %}
        <div class="oracle-block oracle-block-gap">
            <h3 class="oracle-block-title">
                <span class="block-icon">&#x1f50d;</span> Gap Analysis: Claims vs Reality
            </h3>
            <div class="oracle-text">{{ latest.ai_gap_analysis }}</div>
        </div>
        {% endif %}

        {% if latest.ai_scapegoat_check %}
        <div class="oracle-block oracle-block-scapegoat">
            <h3 class="oracle-block-title">
                <span class="block-icon">&#x1f3af;</span> Scapegoat Check
            </h3>
            <div class="oracle-text">{{ latest.ai_scapegoat_check }}</div>
        </div>
        {% endif %}

        {% if latest.data %}
        <div class="oracle-data-grid">
            <h3 class="oracle-block-title">
                <span class="block-icon">&#x1f4c8;</span> Raw Data
            </h3>
            <div class="data-cards">
                {% if latest.data.gdp_growth is defined %}
                <div class="data-card">
                    <span class="data-label">GDP Growth</span>
                    <span class="data-value">{{ latest.data.gdp_growth }}%</span>
                </div>
                {% endif %}
                {% if latest.data.inflation_cpi is defined %}
                <div class="data-card">
                    <span class="data-label">CPI Inflation</span>
                    <span class="data-value">{{ latest.data.inflation_cpi }}%</span>
                </div>
                {% endif %}
                {% if latest.data.unemployment_rate is defined %}
                <div class="data-card">
                    <span class="data-label">Unemployment</span>
                    <span class="data-value">{{ latest.data.unemployment_rate }}%</span>
                </div>
                {% endif %}
                {% if latest.data.wage_growth_real is defined %}
                <div class="data-card">
                    <span class="data-label">Real Wage Growth</span>
                    <span class="data-value">{{ latest.data.wage_growth_real }}%</span>
                </div>
                {% endif %}
                {% if latest.data.net_migration is defined %}
                <div class="data-card">
                    <span class="data-label">Net Migration</span>
                    <span class="data-value">{{ "{:,}".format(latest.data.net_migration) }}</span>
                </div>
                {% endif %}
                {% if latest.data.housing_avg_price is defined %}
                <div class="data-card">
                    <span class="data-label">Avg House Price</span>
                    <span class="data-value">&pound;{{ "{:,}".format(latest.data.housing_avg_price) }}</span>
                </div>
                {% endif %}
                {% if latest.data.base_rate is defined %}
                <div class="data-card">
                    <span class="data-label">Base Rate</span>
                    <span class="data-value">{{ latest.data.base_rate }}%</span>
                </div>
                {% endif %}
                {% if latest.data.productivity_growth is defined %}
                <div class="data-card">
                    <span class="data-label">Productivity Growth</span>
                    <span class="data-value">{{ latest.data.productivity_growth }}%</span>
                </div>
                {% endif %}
            </div>
        </div>
        {% endif %}

        <div class="oracle-actions">
            <button class="btn btn-secondary" onclick="rescoreMonth('{{ latest.month }}')">
                <span class="btn-text">Re-score with AI</span>
                <span class="btn-loading" style="display:none"><span class="spinner"></span> Scoring...</span>
            </button>
        </div>
    </div>
    {% endif %}

    {% if archive|length > 1 %}
    <div class="oracle-archive">
        <h3 class="archive-title">Archive</h3>
        <div class="archive-grid">
            {% for entry in archive %}
            {% if not loop.first %}
            <a href="/oracle/{{ entry.month }}" class="archive-card">
                <span class="archive-month">{{ entry.month }}</span>
                <span class="archive-model">{{ entry.ai_model or 'seed' }}</span>
                {% if entry.data and entry.data.gdp_growth is defined %}
                <span class="archive-stat">GDP {{ entry.data.gdp_growth }}%</span>
                {% endif %}
            </a>
            {% endif %}
            {% endfor %}
        </div>
    </div>
    {% endif %}


    {% if bulletins %}
    <div class="bulletin-section">
        <h2 class="section-title">
            <span class="block-icon">&#x1f4f0;</span> ONS Bulletin Analyses
        </h2>
        <p class="section-subtitle">
            The ONS publishes statistical bulletins alongside data releases. The Oracle scores their framing.
        </p>

        <div class="bulletin-grid">
            {% for b in bulletins %}
            <a href="/bulletin/{{ b.id }}" class="bulletin-card">
                <div class="bulletin-card-header">
                    <span class="bulletin-type-badge">{{ b.bulletin_type|replace('-', ' ')|title }}</span>
                    <span class="bulletin-card-score {{ b.cope_score|copecolor }}">{{ b.cope_score }}</span>
                </div>
                <h3 class="bulletin-card-title">{{ b.bulletin_title or 'ONS Bulletin' }}</h3>
                {% if b.bulletin_date %}
                <span class="bulletin-card-date">{{ b.bulletin_date }}</span>
                {% endif %}
                {% if b.what_they_said %}
                <div class="bulletin-card-preview">
                    <span class="preview-label">ONS says:</span>
                    <span class="preview-text">{{ b.what_they_said[:120] }}{% if b.what_they_said|length > 120 %}...{% endif %}</span>
                </div>
                {% endif %}
                <span class="bulletin-card-verdict">{{ b.cope_score|copelabel }}</span>
            </a>
            {% endfor %}
        </div>

        <div class="bulletin-actions">
            <button class="btn btn-secondary" onclick="fetchBulletins()" id="fetch-bulletins-btn">
                <span class="btn-text">&#x1f504; Fetch Latest Bulletins</span>
                <span class="btn-loading" style="display:none"><span class="spinner"></span> Fetching &amp; scoring...</span>
            </button>
        </div>
    </div>
    {% else %}
    <div class="bulletin-section bulletin-empty">
        <h2 class="section-title">
            <span class="block-icon">&#x1f4f0;</span> ONS Bulletin Analyses
        </h2>
        <p class="section-subtitle">
            The Oracle can analyse ONS statistical bulletins -- scoring their framing choices through the structural reality lens.
        </p>
        <button class="btn btn-primary" onclick="fetchBulletins()" id="fetch-bulletins-btn">
            <span class="btn-text">&#x1f504; Fetch &amp; Score Latest Bulletins</span>
            <span class="btn-loading" style="display:none"><span class="spinner"></span> Fetching &amp; scoring (this takes a minute)...</span>
        </button>
    </div>
    {% endif %}

    <div class="oracle-sources">
        <h3>Data Sources</h3>
        <p>
            ONS Labour Market Statistics &bull;
            ONS Consumer Price Inflation &bull;
            ONS Migration Statistics &bull;
            Bank of England Base Rate &bull;
            All data from official public APIs.
        </p>
    </div>
</section>
{% endblock %}

{% block scripts %}
<script>

async function fetchBulletins() {
    const btn = document.getElementById('fetch-bulletins-btn');
    const btnText = btn.querySelector('.btn-text');
    const btnLoading = btn.querySelector('.btn-loading');
    btnText.style.display = 'none';
    btnLoading.style.display = 'inline-flex';
    btn.disabled = true;

    try {
        const resp = await fetch('/api/bulletin/fetch-all', {method: 'POST'});
        const data = await resp.json();
        if (data.ok) {
            location.reload();
        } else {
            alert(data.error || 'Fetch failed');
        }
    } catch (e) {
        alert('Error: ' + e.message);
    } finally {
        btnText.style.display = 'inline';
        btnLoading.style.display = 'none';
        btn.disabled = false;
    }
}

async function rescoreMonth(month) {
    const btn = event.target.closest('.btn');
    const btnText = btn.querySelector('.btn-text');
    const btnLoading = btn.querySelector('.btn-loading');
    btnText.style.display = 'none';
    btnLoading.style.display = 'inline-flex';
    btn.disabled = true;

    try {
        const resp = await fetch(`/api/oracle/rescore/${month}`, {method: 'POST'});
        const data = await resp.json();
        if (data.ok) {
            location.reload();
        } else {
            alert(data.error || 'Scoring failed');
        }
    } catch (e) {
        alert('Error: ' + e.message);
    } finally {
        btnText.style.display = 'inline';
        btnLoading.style.display = 'none';
        btn.disabled = false;
    }
}
</script>
{% endblock %}
```
