Internal onboarding. How a single behavioural read becomes everything a customer sees, and how a new quarter ships.
The pipeline produces one thing: the read for each market (the signals + the narrative). That single read is then published as three products, all from the same source:
Because all three come from one source of truth, they can never disagree.
The narrative prose is composed from the signals, not written by hand. That’s why a new market can “self-write” its own report, and why the Skill’s answer can never contradict a published figure. A person then reviews it before it ships — judgement at the end.
Cadence refreshes on a quarterly rhythm:
Collect fresh data → regenerate the reads → review → publish (website + reports + Skill)
Each release is designed to be reproducible — same method, same inputs, same output — so the story of how a market changed over time stays comparable. That comparable history, quarter after quarter, is the part competitors can’t back-fill.
How the read actually becomes three products.
gen_editions.py (per market): load
movers + origin + macro → derive_signals() builds the
single signals object (the divergence / mood / trade-down /
premium logic) → compose() selects a story
type (ahead / diverge-up / two-speed / blue / squeeze / …) and
fills a template keyed to the story type, never the market,
with the data’s own brand / % / theme facts. key_points()
bins every fact to Happening / Do / Watch as receipted chips.
creative(), segments(),
playbooks(), brand_activity() attach the
desk-level detail. A single archetype() rule (resilient /
two-speed / blue / behavioural) is imported by all three generators, so
the clustering is identical everywhere.
gen_history.py reconstructs 8 quarters
using the same derive/archetype on as-of movers, applies
hysteresis (a state change publishes only after 2
consecutive quarters, or immediately on an extreme mood swing), and
computes resemblance = the 3 nearest neighbours by
Euclidean distance over z-scored 6-dimensional vectors. One source, so
the country and Europe reports agree.
gen_europe.py builds the leagues
(sovereignty / mood / trade-down / premium-under- pressure), the
archetype clusters (from the hysteresis-smoothed history), and the
cross-market whitespace / defending lists (iterating each edition’s
demand × supply tags), plus the three-minute synthesis and the
choropleth.
Ship. astro build:prod (base
/, includes functions/) →
render_shots.py (Playwright per-palette section shots) →
git push → the git-connected Pages project rebuilds. The
Skill is published separately:
build-data.mjs bundles only the trimmed, receipted
answer layer into the Worker (the raw families never leave the build
box), deployed with wrangler deploy.
Quarterly release. Append a
(quarter, date) tuple to QS in
gen_history, run
eu_movers --asof <quarter-end> in enrich, regenerate,
review, ship. It’s built to be reproducible: same
method + same inputs → same output.
Previous: Data pipeline · Next: Analytics methodology.