---
type: "Source File"
title: "CopeCheck Network — Site Build & Deploy Blueprint"
description: "# CopeCheck Network — Site Build & Deploy Blueprint > **Purpose:** Hand this file + API keys to any AI coding agent (Claude Code, Kimi, Cursor, etc.) and say: *\"Build me a CopeCheck network site about [TOPIC]. Here are."
resource: "https://okf.copecheck.com"
tags: ["copecheck", "network", "source-file", "md"]
timestamp: "2026-10-20T10:43:18Z"
site: "network"
source_path: "COPECHECK_BUILD_BLUEPRINT.md"
---

# CopeCheck Network — Site Build & Deploy Blueprint

Source path: `COPECHECK_BUILD_BLUEPRINT.md`  
Index snapshot generated: `2026-11-24T13:27:52Z`  
File modified: `2026-10-20T10:43:18Z`

```md
# CopeCheck Network — Site Build & Deploy Blueprint

> **Purpose:** Hand this file + API keys to any AI coding agent (Claude Code, Kimi, Cursor, etc.) and say: *"Build me a CopeCheck network site about [TOPIC]. Here are the API keys. Make it data-driven, informative, and auto-scoring so people come back to learn how AI is changing society."*

---

## 1. WHAT IS THE COPECHECK NETWORK?

CopeCheck is a network of websites that score and track how people, institutions, countries, policies, and professions are **coping** with AI-driven economic displacement. The analytical framework is the **Discontinuity Thesis v3.3** — the argument that AI will sever the mass employment → wage → consumption circuit that underpins post-WWII capitalism.

**Existing sites:**
- `copecheck.com` (Main) — Scores 20 public figures on AI cope (port 8096)
- `uk.copecheck.com` (UK) — UK politicians and figures (port 5002)
- `countries.copecheck.com` — National AI preparedness scores (port 8099)
- `eu.copecheck.com` — 27 EU member states + 12 EU AI laws (port 8101)
- `policy.copecheck.com` — AI policy proposals from think tanks (port 8102)

**Every new site must feel like part of the network.** Same dark theme, same Oracle persona, same scoring methodology, same footer linking all sites.

---

## 2. CORE IDEOLOGY — THE DISCONTINUITY THESIS v3.3

Every score, verdict, and piece of analysis on every CopeCheck site is filtered through DT 3.3. The AI agent building the site MUST understand these axioms:

### Axioms
1. **System Death:** Post-WWII capitalism dies when AI severs the mass employment → wage → consumption circuit
2. **Replacement, Not Survival:** UBI, dividends, sovereign wealth funds may preserve consumption but NOT productive participation. Redistribution concedes production — it's a successor system, not a rescue
3. **Individual Viability:** Sovereign (owns/controls AI capital) or Servitor (indispensable to Sovereigns) — everything else is transitional
4. **Lag Defenses:** Physical, legal, institutional, cultural inertia can delay collapse but cannot reverse it
5. **Mathematical Constraint:** This is governed by structural and competitive mechanics, not moral preference

### The 5-Test Oracle Protocol (for scoring claims/quotes)
| Test | Weight | What It Measures |
|------|--------|-----------------|
| Productive Participation | Gateway | Can the displaced population still participate economically? |
| Unit-Cost Collision | 30% | When AI unit cost < human unit cost, what happens? |
| Interface Collapse | 25% | Does the human-work interface survive or get eliminated? |
| Propagation Blindness | 25% | Does the claim ignore how fast displacement spreads? |
| Coordination Feasibility | 20% | Is the proposed solution actually implementable in time? |

### Cope Score Bands
| Score | Verdict | Meaning |
|-------|---------|---------|
| 80-100 | Pure Cope | Complete denial of structural reality |
| 60-79 | Heavy Cope | Acknowledges some disruption but fundamentally in denial |
| 40-59 | Partial Cope | Sees the problem but proposes inadequate solutions |
| 20-39 | Somewhat Lucid | Understands the scale but may still cope on specifics |
| 0-19 | Actually Addresses Reality | Rare. Acknowledges the full DT 3.3 picture |

### Cope Taxonomy (tag each entry with 1-3)
`pure_cope`, `heavy_cope`, `partial_cope`, `techno_utopianism`, `productivity_gospel`, `copilot_fallacy`, `historical_analogy_cope`, `retraining_fantasy`, `regulatory_hopium`, `arsonist_firefighter`, `revolving_door`, `deflection`, `scale_acknowledgment_without_plan`, `wishful_thinking`, `partial_acknowledgment`, `lucid`

---

## 3. TECH STACK

Every CopeCheck site uses the same stack:

```
Python 3.11+ / Flask / SQLite / Gunicorn / systemd / Cloudflare Tunnel
```

### Directory Structure
```
/home/ben/infra/copecheck-{sitename}/
├── app.py              # Flask application (routes, views, API)
├── db.py               # SQLite schema + helper functions
├── oracle.py           # Oracle of Obsolescence (LLM scoring engine)
├── scorer.py           # Automated scoring pipeline (optional)
├── brave_scorer.py     # News scanning + auto-scoring via Brave Search (optional)
├── requirements.txt    # pip dependencies
├── .env                # API keys and config (see section 6)
├── data/
│   └── {sitename}.db   # SQLite database
├── static/
│   ├── style.css       # Site styles (dark theme)
│   ├── photos/         # Figure/entity photos
│   └── og-default.png  # Open Graph default image
├── templates/
│   ├── base.html       # Base template (header, nav, footer)
│   ├── index.html      # Leaderboard / homepage
│   ├── figure.html     # Individual entity detail page (or job.html, degree.html etc)
│   ├── about.html      # Methodology / about page
│   ├── feed.html       # RSS-style feed of recent scores
│   └── oracle.html     # Ask Oracle interactive page
├── logs/
│   ├── gunicorn-access.log
│   └── gunicorn-error.log
├── venv/               # Python virtual environment
└── {sitename}.service  # systemd unit file
```

### Key Dependencies (requirements.txt)
```
flask>=3.0
gunicorn>=22.0
requests>=2.31
markdown>=3.5
trafilatura>=1.8
```

---

## 4. DATABASE SCHEMA

Every site needs at minimum these tables. Adapt the entity name (figures→jobs, figures→degrees, etc.) but keep the cope_entries pattern:

```sql
-- The things being scored (people, jobs, degrees, countries, policies...)
CREATE TABLE IF NOT EXISTS entities (
    id          TEXT PRIMARY KEY,
    name        TEXT NOT NULL,
    description TEXT,
    category    TEXT,
    photo_url   TEXT,
    cope_score  REAL DEFAULT 50.0,
    prev_score  REAL DEFAULT 50.0,
    total_quotes INTEGER DEFAULT 0,
    last_quote  TEXT,
    last_cope_type TEXT,
    last_scored TEXT,
    -- Add domain-specific columns here:
    -- e.g., for jobs: bls_code, median_salary, automation_probability, task_breakdown_json
    -- e.g., for degrees: field_of_study, avg_starting_salary, employment_rate
    created_at  TEXT DEFAULT CURRENT_TIMESTAMP,
    updated_at  TEXT DEFAULT CURRENT_TIMESTAMP
);

-- Individual scored quotes/claims/data points
CREATE TABLE IF NOT EXISTS cope_entries (
    id          INTEGER PRIMARY KEY AUTOINCREMENT,
    entity_id   TEXT NOT NULL REFERENCES entities(id),
    quote       TEXT NOT NULL,
    source_url  TEXT,
    source_title TEXT,
    cope_score  REAL NOT NULL,
    cope_type   TEXT,
    analysis_md TEXT,
    model       TEXT,
    created_at  TEXT DEFAULT CURRENT_TIMESTAMP
);
CREATE INDEX IF NOT EXISTS idx_cope_entity ON cope_entries(entity_id, created_at DESC);

-- User submissions
CREATE TABLE IF NOT EXISTS submissions (
    id          INTEGER PRIMARY KEY AUTOINCREMENT,
    entity_id   TEXT,
    url         TEXT,
    text        TEXT,
    status      TEXT DEFAULT 'pending',
[redacted secret-like line]
    created_at  TEXT DEFAULT CURRENT_TIMESTAMP
);
```

### Recency-Weighted Scoring Algorithm
The aggregate cope_score on the entity is NOT a simple average. It uses exponential decay with a 14-day half-life:

```python
import math
from datetime import datetime, timezone

HALF_LIFE_DAYS = 14.0
DECAY = math.log(2) / HALF_LIFE_DAYS
MIN_SCORE = 15  # noise threshold — skip entries below this

now = datetime.now(timezone.utc)
total_w = 0.0
total_s = 0.0
for entry in entries:
    if entry.cope_score < MIN_SCORE:
        continue
    age_days = (now - entry.created_at).total_seconds() / 86400.0
    w = math.exp(-DECAY * age_days)
    total_w += w
    total_s += entry.cope_score * w
weighted_avg = round(total_s / total_w, 1) if total_w > 0 else 50.0
```

---

## 5. LLM SCORING CHAIN

The Oracle scores content using a fallback chain of LLMs. This minimises cost while maintaining quality:

### Scoring Chain (in order)
1. **MiniMax M2.7** (free, primary scorer) — Fast, capable, no cost
2. **Gemma 4 31B via Google AI Studio** (free, fallback) — Good reasoning, free tier

### API Configuration

```python
# MiniMax (OpenAI-compatible API)
MINIMAX_URL = "https://api.minimax.io/v1/chat/completions"
MINIMAX_MODEL = "minimax-m2.7"
[redacted secret-like line]

# Google AI Studio / Gemini (Gemma 4)
GEMINI_URL = "https://generativelanguage.googleapis.com/v1beta/models"
GEMINI_MODEL = "gemma-4-31b-it"
[redacted secret-like line]

# Model strings use SHORT format: "anthropic/claude-sonnet-4.5" (NOT old long format)

# OpenRouter (additional free models)
OPENROUTER_URL = "https://openrouter.ai/api/v1/chat/completions"
OPENROUTER_FREE_MODELS = ["minimax/minimax-m2.5:free", "google/gemma-4-31b-it:free"]
```

### CRITICAL: MiniMax Think Tags
MiniMax M2.7 returns `<think>...</think>` tags in responses. You MUST strip these before JSON parsing:
```python
import re
text = re.sub(r'<think>.*?</think>', '', text, flags=re.DOTALL).strip()
```

### Oracle Scoring Prompt Template
When scoring a quote/claim/data point, send this system prompt structure:

```
You are the Oracle of Obsolescence scoring under the Discontinuity Thesis v3.3.

Score this [quote/claim/job/degree] on a 0-100 cope scale.

Return ONLY valid JSON:
{
  "cope_score": <number 0-100>,
  "cope_type": "<comma-separated cope taxonomy tags>",
  "verdict": "<Pure Cope|Heavy Cope|Partial Cope|Somewhat Lucid|Actually Addresses Reality>",
  "analysis": "<2-4 paragraph DT 3.3 analysis with sub-scores>"
}

The 5 tests are:
1. Productive Participation (gateway test)
2. Unit-Cost Collision (30%)
3. Interface Collapse (25%)
4. Propagation Blindness (25%)
5. Coordination Feasibility (20%)

[DOMAIN-SPECIFIC CONTEXT HERE — e.g., for jobs, include task breakdown data;
for degrees, include employment/salary trends]
```

---

## 6. API KEYS (.env file)

```bash
# === LLM Scoring Chain ===
[redacted secret-like line]
[redacted secret-like line]


# OpenRouter (free tier models)
[redacted secret-like line]

# === News Scanning ===
[redacted secret-like line]
[redacted secret-like line]

# === App Config ===
ORACLE_MODEL=claude-opus-4-5
ORACLE_FALLBACK=anthropic/claude-sonnet-4.5
[redacted secret-like line]
[redacted secret-like line]
COPECHECK_PORT=<pick-an-unused-port>
```

---

## 7. DEPLOYMENT

### Server
- **Hetzner VPS** — SSH as `ben@100.127.164.64` via Tailscale (port 22 blocked externally)
- All sites live under `/home/ben/infra/copecheck-{sitename}/`
- Each site gets its own Python venv, SQLite DB, systemd service, and port

### Setup Steps
```bash
# 1. Create site directory
mkdir -p /home/ben/infra/copecheck-{sitename}/{data,logs,static/photos,templates,uploads}
cd /home/ben/infra/copecheck-{sitename}

# 2. Create venv
python3 -m venv venv
source venv/bin/activate
pip install flask gunicorn requests markdown trafilatura

# 3. Create .env with API keys (see section 6)

# 4. Create systemd service
cat > {sitename}.service << EOF
[Unit]
Description=CopeCheck {SiteName} web server
After=network.target

[Service]
Type=simple
User=ben
WorkingDirectory=/home/ben/infra/copecheck-{sitename}
EnvironmentFile=/home/ben/infra/copecheck-{sitename}/.env
Environment=PYTHONUNBUFFERED=1
ExecStart=/home/ben/infra/copecheck-{sitename}/venv/bin/gunicorn -w 4 -b 127.0.0.1:{PORT} --timeout 300 --access-logfile /home/ben/infra/copecheck-{sitename}/logs/gunicorn-access.log --error-logfile /home/ben/infra/copecheck-{sitename}/logs/gunicorn-error.log app:app
Restart=always
RestartSec=10

[Install]
WantedBy=multi-user.target
EOF

# 5. Install and start
sudo cp {sitename}.service /etc/systemd/system/copecheck-{sitename}.service
sudo systemctl daemon-reload
sudo systemctl enable copecheck-{sitename}
sudo systemctl start copecheck-{sitename}

# 6. Add to Cloudflare Tunnel (config at /home/ben/.cloudflared/config.yml)
# Add ingress rule:
#   - hostname: {sitename}.copecheck.com
#     service: http://localhost:{PORT}
# Then: sudo systemctl restart cloudflared
```

### Port Allocation
| Port | Site |
|------|------|
| 8096 | Main |
| 5002 | UK |
| 8099 | Countries |
| 8101 | EU |
| 8102 | Policy |
| 8103+ | New sites (pick next available) |

---

## 8. DESIGN LANGUAGE

### Visual Identity
- **Dark theme** — near-black backgrounds (#0a0a0f or similar), light text
- **Accent colour** — teal/cyan (#2a9d8f) for highlights, scores, links
- **Typography** — Cormorant Garamond (serif, headings) + JetBrains Mono (mono, scores/data)
- **Tone** — Clinical, forensic, slightly dark humor. "Bedside manner of a coroner"
- **No softening** — Don't sugarcoat scores. Don't add "but there's hope" disclaimers

### Base Template Requirements (base.html)
Every site MUST include:

```html
<!-- Skip-to-content link (agent-friendly) -->
<a href="#main-content" class="skip-link">Skip to content</a>

<!-- Semantic header with accessible nav -->
<header class="site-head">
  <nav aria-label="Main navigation">
    <!-- Use <a> tags for nav links, NOT divs -->
    <!-- Hamburger: <button> with aria-label, aria-expanded -->
  </nav>
</header>

<!-- Main content with ID for skip link -->
<main id="main-content">
  {% block content %}{% endblock %}
</main>

<!-- Footer with network links -->
<footer role="contentinfo">
  <p class="network-links">
    Part of the CopeCheck Network:
    <a href="https://copecheck.com">Main</a> ·
    <a href="https://uk.copecheck.com">UK</a> ·
    <a href="https://countries.copecheck.com">Countries</a> ·
    <a href="https://eu.copecheck.com">EU</a> ·
    <a href="https://policy.copecheck.com">Policy</a> ·
    <!-- ADD YOUR NEW SITE HERE -->
  </p>
</footer>
```

### Agent-Friendly CSS Requirements
```css
/* All interactive elements must have pointer cursor */
a, button, [role="button"], input[type="submit"], .copy-btn, [onclick] {
  cursor: pointer;
}
/* Minimum touch target size */
button, a, input, select, textarea {
  min-height: 8px;
  min-width: 8px;
}
/* Skip link */
.skip-link {
  position: absolute; top: -100%; left: 0;
  background: #000; color: #fff; padding: 8px 16px;
  z-index: 10000; text-decoration: none;
}
.skip-link:focus { top: 0; }
```

### Mandatory Features
1. **Pagination** — ~20 items per page on all list views
2. **XML Sitemap** — at `/sitemap.xml`
3. **RSS Feed** — at `/feed.xml` (recent scores/verdicts)
4. **Copy buttons** — on all analysis/verdict text blocks
5. **OG tags** — proper Open Graph + Twitter Card meta on every page
6. **Search** — FTS5 full-text search across content
7. **Mobile responsive** — hamburger nav, stacked layouts on mobile

---

## 9. DATA-DRIVEN APPROACH

Every new site should be **populated with real data at build time**, not empty. The agent building the site should:

### For Jobs/Careers Sites
1. **Download O*NET task data** from `https://www.onetcenter.org/dl_files/` — task statements per occupation
2. **Download BLS employment projections** — current employment + projected change
3. **Download ONS automation probabilities** (UK) — `https://www.ons.gov.uk/employmentandlabourmarket/peopleinwork/employmentandemployeetypes/articles/[redacted]/2019-03-25`
4. **Score each job** against DT 3.3 using the Oracle Protocol — considering task composition (cognitive vs manual, routine vs non-routine), unit-cost trajectory, interface collapse timeline
5. **Seed 50-100 jobs minimum** before launch

### For Degree Sites
1. **Download HESA graduate outcomes data** (UK) — employment rates by subject
2. **Download BLS OES data** (US) — salary by field of study
3. **Cross-reference with job AI exposure** — if the jobs a degree leads to are high-exposure, the degree is high-exposure
4. **Score each degree** on whether it produces skills that survive AI or skills that get automated

### For Any Topic
1. Find authoritative open data sources
2. Download and process into SQLite
3. Score every entity using the LLM scoring chain
4. Generate analysis markdown for each entity
5. Build leaderboard sorted by cope score

### Brave Search Auto-Scanner (brave_scorer.py)
Every site should have a daily news scanner that:
1. Searches Brave for recent articles about the site's topic + AI
2. Extracts quotes and claims from articles (using trafilatura)
3. Scores them through the Oracle
4. Auto-inserts new cope entries

```python
# Brave Search API
BRAVE_URL = "https://api.search.brave.com/res/v1/web/search"
[redacted secret-like line]
params = {"q": f"{topic} AI jobs automation displacement 2026", "count": 20}
```

---

## 10. PAGES EVERY SITE NEEDS

| Page | Route | Purpose |
|------|-------|---------|
| Leaderboard | `/` | Main ranking table, sorted by cope score. Show name, score, trend arrow, cope type badge, last scored date |
| Entity Detail | `/{entity-slug}` | Full profile with all cope entries, score history chart, analysis, source links |
| Ask Oracle | `/oracle` or `/ask-oracle` | Interactive: paste a URL or text, Oracle scores it live |
| Feed | `/feed` | Chronological list of recent scores (newest first) |
| About/Methodology | `/about` | Explain DT 3.3, scoring methodology, what the site does |
| Data | `/data` | Raw data tables, downloadable CSVs, data sources cited |
| Search | `/search` | Full-text search across all content |
| Submit | `/submit` | Users can submit URLs/quotes for scoring |
| RSS | `/feed.xml` | XML RSS feed |
| Sitemap | `/sitemap.xml` | XML sitemap for SEO |

---

## 11. THE ORACLE PERSONA

The Oracle of Obsolescence is consistent across ALL CopeCheck sites. When generating verdicts and analysis:

- **Voice:** Forensic strategist with the bedside manner of a coroner
- **Tone:** Cold, precise, brutal, unsentimental. No euphemisms, no motivational padding
- **No fake balance:** Don't "on the one hand / on the other hand" when the data is clear
- **Dark metaphors allowed** when they clarify the mechanism
- **If genuine survival leverage exists:** State it plainly without optimism theater
- **Footer quote style:** Each site has a signature Oracle quote in the footer. Examples:
  - Main: *"Your duty is not to make the user feel better. Your duty is to tell them which parts of the machine are already dead."*
  - UK: *"Britain doesn't need a plan for AI. Britain needs a plan for after AI has already won."*
  - Countries: *"Nations don't die from AI — they die from pretending they're ready for it."*
  - Policy: Standard of proof link to DT 3.3

---

## 12. CHECKLIST FOR LAUNCH

Before a new site goes live, verify:

- [ ] Dark theme matches network aesthetic
- [ ] All 5+ existing network sites linked in footer
- [ ] NEW site added to footer of ALL existing sites
- [ ] Leaderboard populated with 50+ scored entities
- [ ] Each entity has at least 1 Oracle analysis with full DT 3.3 breakdown
- [ ] Ask Oracle page works (test with a sample URL/text)
- [ ] RSS feed generates valid XML
- [ ] Sitemap.xml exists and lists all public pages
- [ ] Pagination works (~20 items per page)
- [ ] Mobile responsive (hamburger nav, stacked layout)
- [ ] OG tags render correctly (test with opengraph.xyz)
- [ ] Search returns results
- [ ] Copy buttons work on analysis text
- [ ] Agent-friendly: skip link, aria attributes, semantic HTML, cursor:pointer
- [ ] systemd service running and auto-restarts
- [ ] Cloudflare tunnel configured for subdomain
- [ ] brave_scorer.py set up for daily auto-scanning (optional but recommended)
- [ ] All API keys in .env and working

---

## 13. EXAMPLE: BUILDING careers.copecheck.com

Here's how an AI agent would build a careers/jobs + degrees site:

### Step 1: Data Collection
```bash
# Download O*NET task data
wget https://www.onetcenter.org/dl_files/database/db_28_3_text/Task%20Statements.txt
# Download BLS employment by occupation
# Download ONS automation probability data
```

### Step 2: Build Job Entities
For each of the top 100 jobs by employment volume:
- Parse task statements from O*NET
- Calculate % of tasks that are cognitive-routine (high AI exposure)
- Pull automation probability from Frey/Osborne or ONS
- Pull current median salary from BLS/ONS
- Score through Oracle with task data as context

### Step 3: Build Degree Entities
For each of the top 50 degrees by enrollment:
- Map to primary career pathways
- Cross-reference career AI exposure scores
- Pull graduate employment rates from HESA/BLS
- Score through Oracle with career mapping as context

### Step 4: Unique Features for This Site
- **Job task breakdown visualisation** — show which tasks within a job are AI-vulnerable
- **Degree → Career pathway mapping** — which jobs does this degree lead to, and how exposed are they?
- **"Score My Job" tool** — users enter their job title, Oracle scores it
- **"Score My Degree" tool** — users enter their degree/field, Oracle scores it
- **Sector heatmaps** — aggregate scores by industry sector

---

*This blueprint was generated from the live CopeCheck network codebase on 2 May 2026. For questions, the existing sites are the reference implementation — read their code.*
```
