WIP: Editorial city copy for 83 city/record pages #39

Draft
admin_emi wants to merge 1 commit from worktree-city-copy-backfill into main
Owner

What

Backfills original editorial copy for the city SEO pages (/climate/<slug>) and record pages (/climate/<slug>/records), replacing the generic trimmed-Wikipedia blurb with in-depth, analytical prose that says what a place is, why it exists, what's notable, and its climate character — framed the Thermograph way (unusual-vs-its-own-history, never absolute temperatures).

This first tranche targets the 90 cities that had no cities_flavor.json blurb at all. 83 of 90 are included here; the remaining 7 are listed below for finishing.

How the copy was produced

Each city was researched across multiple independent sources (Britannica, official/government pages, geographic/history references — not a single scrape), written to a fixed house voice, then fact-checked entry by entry. A first pass produced 61 clean entries; 29 were held back with specific factual objections and re-researched to correct or drop the disputed claim, recovering 22 more. Every surviving entry:

  • carries the independent sources it was written from (≥2 distinct domains each),
  • passed automated checks (no numeric climate claims that would contradict the live page data, no boilerplate/brochure phrasing, lede 266–330 chars),
  • is marked reviewed: false — pending a human spot-check before it's considered final.

Changes

  • backend/city_copy.json (new) — 83 entries keyed by slug: {lede, body[], records_intro, sources[], source, reviewed}. Kept separate from cities_flavor.json so the two provenances don't collide.
  • backend/data/cities.pycopy(slug) loader, mirroring flavor() (lazy, tolerant of a missing file).
  • backend/api/content_payloads.pycopy field on the city and records payloads.
  • backend/api/payloads.pyPAYLOAD_VER p2p3 so cached content rows rebuild with the new field.
  • frontend/content.py + templates/city.html.j2 / records.html.j2 — render the editorial lede/body in place of the Wikipedia blurb, falling back to the flavor blurb (with its "via Wikipedia" credit) wherever copy isn't written yet. Record pages gain a per-city intro line they never had.

Additive and backward-compatible: no API-contract bump; any slug without a copy entry keeps today's behavior.

Tests

  • Full backend suite: 349 passed, 7 skipped (incl. content/payload tests; PAYLOAD_VER bump is consistent with test_payloads.py).
  • Both templates parse; the copy block renders correctly on both the copy and fallback paths.

Not included — 7 cities need a human finish

Held out because the fact-check couldn't fully clear them; each has a concrete reason:

  • nagpur-maharashtra-in — Nagpur Pact date (1953, not 1960) needs correcting in the lede.
  • kennedy-bogota-d-c-co — post-1963 "Bavaria brewery anchored the economy" chronology unverified.
  • burlington-ontario-ca — 1784 Haldimand Proclamation acreage/tract detail conflated.
  • kakinada-andhra-pradesh-in — one source is a content farm; needs a credible replacement.
  • san-pablo-calabarzon-ph — "Laguna's largest municipality by land area" unverified against its city-charter status.
  • bedok-new-town-sg / jurong-town-sg — all sources were Wikipedia mirrors; need an independent second source.

Follow-ups

  • Human review to flip reviewed: true (spot-check a sample against the pages).
  • Finish the 7 above.
  • Later tranches can rewrite the ~910 cities that currently carry only the generic Wikipedia extract.
## What Backfills original editorial copy for the city SEO pages (`/climate/<slug>`) and record pages (`/climate/<slug>/records`), replacing the generic trimmed-Wikipedia blurb with in-depth, analytical prose that says what a place is, why it exists, what's notable, and its climate character — framed the Thermograph way (unusual-vs-its-own-history, never absolute temperatures). This first tranche targets the **90 cities that had no `cities_flavor.json` blurb at all**. **83 of 90** are included here; the remaining 7 are listed below for finishing. ## How the copy was produced Each city was **researched across multiple independent sources** (Britannica, official/government pages, geographic/history references — not a single scrape), written to a fixed house voice, then **fact-checked entry by entry**. A first pass produced 61 clean entries; 29 were held back with specific factual objections and **re-researched to correct or drop the disputed claim**, recovering 22 more. Every surviving entry: - carries the **independent sources** it was written from (≥2 distinct domains each), - passed automated checks (no numeric climate claims that would contradict the live page data, no boilerplate/brochure phrasing, lede 266–330 chars), - is marked **`reviewed: false`** — pending a human spot-check before it's considered final. ## Changes - **`backend/city_copy.json`** (new) — 83 entries keyed by slug: `{lede, body[], records_intro, sources[], source, reviewed}`. Kept separate from `cities_flavor.json` so the two provenances don't collide. - **`backend/data/cities.py`** — `copy(slug)` loader, mirroring `flavor()` (lazy, tolerant of a missing file). - **`backend/api/content_payloads.py`** — `copy` field on the city and records payloads. - **`backend/api/payloads.py`** — `PAYLOAD_VER` `p2`→`p3` so cached content rows rebuild with the new field. - **`frontend/content.py`** + **`templates/city.html.j2`** / **`records.html.j2`** — render the editorial lede/body in place of the Wikipedia blurb, **falling back to the flavor blurb (with its "via Wikipedia" credit) wherever copy isn't written yet**. Record pages gain a per-city intro line they never had. Additive and backward-compatible: no API-contract bump; any slug without a copy entry keeps today's behavior. ## Tests - Full backend suite: **349 passed, 7 skipped** (incl. content/payload tests; `PAYLOAD_VER` bump is consistent with `test_payloads.py`). - Both templates parse; the copy block renders correctly on both the copy and fallback paths. ## Not included — 7 cities need a human finish Held out because the fact-check couldn't fully clear them; each has a concrete reason: - `nagpur-maharashtra-in` — Nagpur Pact date (1953, not 1960) needs correcting in the lede. - `kennedy-bogota-d-c-co` — post-1963 "Bavaria brewery anchored the economy" chronology unverified. - `burlington-ontario-ca` — 1784 Haldimand Proclamation acreage/tract detail conflated. - `kakinada-andhra-pradesh-in` — one source is a content farm; needs a credible replacement. - `san-pablo-calabarzon-ph` — "Laguna's largest municipality by land area" unverified against its city-charter status. - `bedok-new-town-sg` / `jurong-town-sg` — all sources were Wikipedia mirrors; need an independent second source. ## Follow-ups - Human review to flip `reviewed: true` (spot-check a sample against the pages). - Finish the 7 above. - Later tranches can rewrite the ~910 cities that currently carry only the generic Wikipedia extract.
admin_emi added 1 commit 2026-07-24 09:05:25 +00:00
Add editorial city copy for 83 city/record pages, wired through payload + templates
All checks were successful
secrets-guard / encrypted (pull_request) Successful in 6s
PR build (required check) / changes (pull_request) Successful in 12s
PR build (required check) / validate-observability (pull_request) Has been skipped
PR build (required check) / build-frontend (pull_request) Successful in 1m24s
PR build (required check) / build-backend (pull_request) Successful in 1m32s
PR build (required check) / gate (pull_request) Successful in 1s
d1ef5be859
Introduce backend/city_copy.json: original, researched per-city editorial copy
(a lede, 2-4 body paragraphs, and a records-page intro), keyed by slug next to
the existing Wikipedia cities_flavor.json. Covers 83 of the 90 cities that had
no flavor blurb at all; each entry carries the independent sources it was
written from and reviewed:false pending a human spot-check.

Wire it end to end:
- cities.copy(slug) loader, mirroring cities.flavor() (lazy, tolerant of a
  missing file so pages render fine until copy exists).
- A `copy` field on the city and records content payloads. PAYLOAD_VER p2->p3
  so cached content rows rebuild with the new field instead of serving the old
  shape.
- city.html.j2 renders the editorial lede + body in place of the Wikipedia
  blurb, falling back to the flavor blurb (with its "via Wikipedia" credit)
  wherever copy isn't written yet. records.html.j2 gains a per-city intro line
  it never had before.

Additive and backward-compatible: no API contract bump, and any slug without a
copy entry keeps its existing behavior.
All checks were successful
secrets-guard / encrypted (pull_request) Successful in 6s
PR build (required check) / changes (pull_request) Successful in 12s
PR build (required check) / validate-observability (pull_request) Has been skipped
PR build (required check) / build-frontend (pull_request) Successful in 1m24s
PR build (required check) / build-backend (pull_request) Successful in 1m32s
PR build (required check) / gate (pull_request) Successful in 1s
Required
Details
This pull request is marked as a work in progress.
This branch is out-of-date with the base branch
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin worktree-city-copy-backfill:worktree-city-copy-backfill
git checkout worktree-city-copy-backfill
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: Jinemi/thermograph#39
No description provided.