{
  "version": "1.0.0",
  "template": "Ultimate Guide Master",
  "base_concept": "USA Today grid (v1) + Magazine masthead (v2)",
  "model_default": "claude-haiku-4-5",
  "validator_rules": [
    "numbers_must_exist_in_facts_packet",
    "no_addresses_in_sold_teaser",
    "no_listing_urls_without_auth_for_sold_pins",
    "cite_sources_array_required_for_bot_sections",
    "hide_section_if_status_not_published"
  ],
  "facts_packet_sql": [
    "scout_neighbourhoods.lookup_key",
    "segment intel: fetchNeighbourhoodPageIntel (condo + freehold)",
    "insider counts by deal type: scout_active_listings GROUP BY insider_flags",
    "sold_90d: properties_freehold + properties_condo MAX/MIN close_price, COUNT (no addresses public)",
    "sub_pocket_intelligence top 5 by sold_count_24mo",
    "adjacent neighbourhoods: scout_neighbourhoods same city_slug"
  ],
  "sections": [
    {
      "key": "why_buy_verdict",
      "slot": "[data-slot=why_buy_verdict]",
      "layer": "bot",
      "model": "claude-haiku-4-5",
      "max_tokens": 120,
      "prompt": "Write 2 sentences answering 'Why buy in {display_name}?'. Sentence 1 = definition-first (segment baselines + insider count). Sentence 2 = buyer leverage (list/sale, DOM). Use ONLY facts_packet JSON. No dates. No superlatives without numbers.",
      "sources": ["facts_packet"],
      "hide_if_empty": true
    },
    {
      "key": "why_buy_scorecard",
      "slot": "[data-slot=why_buy_scorecard]",
      "layer": "live",
      "source": "SQL render — no bot",
      "fields": [
        "live.condo_floor",
        "live.condo_baseline",
        "live.insider_total",
        "live.list_to_sale_condo_pct",
        "live.dom_condo",
        "live.momentum_condo",
        "live.vs_city_condo_pct"
      ]
    },
    {
      "key": "segment_panels",
      "slot": "[data-slot=segment_panels]",
      "layer": "live",
      "source": "fetchNeighbourhoodPageIntel dual segment — hide segment if no data (Option A)"
    },
    {
      "key": "insider_filter_counts",
      "slot": "[data-slot=insider_filters]",
      "layer": "live",
      "source": "COUNT per InsiderDealTypeId on scout_active_listings WHERE lookup_key",
      "scout_url_pattern": "/scout?lookup_key={lookup_key}&neighbourhood_text={name}&city={city}&sort=deal_score&insider=true&insider_types={type_id}",
      "deal_types": [
        "below_market",
        "price_reduced",
        "just_listed",
        "estate_sale",
        "power_of_sale",
        "fixer_upper",
        "motivated_seller",
        "vtb",
        "teardown"
      ]
    },
    {
      "key": "active_listings_map",
      "slot": "[data-slot=active_map]",
      "layer": "live",
      "source": "BpiNeighbourhoodMap — public pins with deal scores"
    },
    {
      "key": "sold_teaser_high_low",
      "slot": "[data-slot=sold_teaser]",
      "layer": "live",
      "source": "SQL: MAX(close_price), MIN(close_price), COUNT(*) last 90d by segment — NO street address, NO listing_key public",
      "vow_note": "Stats allowed; pin locations and addresses require auth"
    },
    {
      "key": "sold_map_auth_gate",
      "slot": "[data-slot=sold_map_gate]",
      "layer": "auth",
      "source": "Sold pin map — blurred until Insider/session auth",
      "cta": "/scout?lookup_key=...&view=solds or sign-in flow"
    },
    {
      "key": "sub_pocket_table",
      "slot": "[data-slot=sub_pockets]",
      "layer": "live",
      "source": "sub_pocket_intelligence ORDER BY sold_count_24mo DESC LIMIT 5",
      "bot_wrap": "Optional 1-sentence Haiku intro from facts only"
    },
    {
      "key": "vs_neighbours",
      "slot": "[data-slot=vs_neighbours]",
      "layer": "live",
      "source": "Compare 3 adjacent published neighbourhoods — baseline, DOM, insider per segment"
    },
    {
      "key": "guide_schools",
      "slot": "[data-slot=schools]",
      "layer": "geo",
      "source": "POST /api/geo/intelligence at centroid_lat/lng",
      "bot_wrap": "Haiku: 1 sentence family-fit only — table is primary",
      "research": ["Fraser Institute report card URL if rating shown"]
    },
    {
      "key": "guide_transit",
      "slot": "[data-slot=transit]",
      "layer": "geo",
      "source": "GeoIntelligence.transit",
      "bot": "Haiku 2 sentences max from geo facts"
    },
    {
      "key": "guide_flood_heritage",
      "slot": "[data-slot=risk]",
      "layer": "geo",
      "source": "GeoIntelligence.flood + heritage — buyer risk section"
    },
    {
      "key": "bryons_take",
      "slot": "[data-slot=bryons_take]",
      "layer": "bot",
      "model": "claude-haiku-4-5",
      "prompt": "Bryon Bertrim REALTOR voice. Headline max 12 words + body 2-3 sentences. JSON {headline, body}. Same as generate-neighbourhood-takes-v2.ts",
      "sources": ["facts_packet", "bpi_takes supersede chain"]
    },
    {
      "key": "faq_block",
      "slot": "[data-slot=faq]",
      "layer": "bot+live",
      "prompt": "Generate FAQPage items: one condo price Q, one freehold Q (if segment exists), one insider Q, one why-buy Q. Answers from facts_packet only.",
      "schema": "FAQPage JSON-LD"
    },
    {
      "key": "hero_photo",
      "slot": "[data-slot=hero_photo]",
      "layer": "asset",
      "source": "Unsplash or CDN neighbourhood hero — alt text bot-generated from display_name + city",
      "size": "1200x630 for OG"
    }
  ],
  "city_sections": [
    {
      "key": "city_why_buy_verdict",
      "slot": "[data-slot=city_verdict]",
      "layer": "bot",
      "prompt": "Why buy in {city}? Citywide condo/freehold mix, top 3 neighbourhoods by insider density."
    },
    {
      "key": "city_neighbourhood_map",
      "slot": "[data-slot=city_nb_map]",
      "layer": "live",
      "source": "Mapbox pins at each scout_neighbourhoods.centroid — link to /ontario/{city_slug}/{nb_slug}",
      "sub_page": "/ontario/{city_slug}/neighbourhoods"
    },
    {
      "key": "city_neighbourhood_table",
      "slot": "[data-slot=city_nb_table]",
      "layer": "live",
      "columns": ["name", "dominant_segment", "condo_baseline", "freehold_baseline", "active", "insider", "link"]
    }
  ],
  "mobile_strip": [
    "why_buy_verdict",
    "scorecard_compact",
    "insider_filter_counts",
    "sold_teaser_high_low",
    "segment_panels_condensed",
    "cta_msv",
    "mobile_nav"
  ],
  "mobile_remove": [
    "sub_pocket_table",
    "vs_neighbours",
    "schools_table",
    "sold_map_auth_gate",
    "guide_flood_heritage",
    "left_rail",
    "right_rail"
  ],
  "seo": {
    "speakable": "Mirror scorecard + verdict in .bpi-guide-speakable",
    "schema": ["BreadcrumbList", "WebPage", "Place", "FAQPage", "Dataset"],
    "json_api": "/api/neighbourhood-data/{city_slug}/{neighbourhood_slug}",
    "indexnow": "On facts_packet refresh"
  }
}
