[object Object]

← back to Rentv 2026

pr/geo+jobs: Cody gate — make the coverage major-metro model STATE-AWARE. My tier-aware gap fix used the CA-only MAJOR_METRO_KEYS in the state-parameterized generate-coverage-report, so for AZ (no metro in the CA set) all 15 major-tier categories were silently dropped from gap detection — a latent bug that would misfire when Arizona unlocks. Added geo.MAJOR_METRO_KEYS_BY_STATE + majorMetrosFor(state) (AZ = Phoenix/Maricopa cluster + Tucson); job now uses majorMetrosFor(state). CA unchanged, AZ major-type gaps correctly detected in the big AZ metros

0d18fabb53430e41c0142a841baccdc2ba56961d · 2026-08-05 22:58:30 -0700 · Steve

Files touched

Diff

commit 0d18fabb53430e41c0142a841baccdc2ba56961d
Author: Steve <steve@designerwallcoverings.com>
Date:   Wed Aug 5 22:58:30 2026 -0700

    pr/geo+jobs: Cody gate — make the coverage major-metro model STATE-AWARE. My tier-aware gap fix used the CA-only MAJOR_METRO_KEYS in the state-parameterized generate-coverage-report, so for AZ (no metro in the CA set) all 15 major-tier categories were silently dropped from gap detection — a latent bug that would misfire when Arizona unlocks. Added geo.MAJOR_METRO_KEYS_BY_STATE + majorMetrosFor(state) (AZ = Phoenix/Maricopa cluster + Tucson); job now uses majorMetrosFor(state). CA unchanged, AZ major-type gaps correctly detected in the big AZ metros
---
 src/pr/jobs/index.js |  2 +-
 src/pr/lib/geo.js    | 11 ++++++++++-
 2 files changed, 11 insertions(+), 2 deletions(-)

diff --git a/src/pr/jobs/index.js b/src/pr/jobs/index.js
index 47bd49cc..d1023e10 100644
--- a/src/pr/jobs/index.js
+++ b/src/pr/jobs/index.js
@@ -664,7 +664,7 @@ const handlers = {
     // in index.js): universal types are expected in every metro; 'major' types only in the big metros.
     // Without this, a specialist type missing in a secondary metro (e.g. pr_agency in Central Valley)
     // was reported as a FALSE gap, inflating gap_count and misdirecting the research pipeline.
-    const majorMetros = new Set(geo.MAJOR_METRO_KEYS);
+    const majorMetros = new Set(geo.majorMetrosFor(state)); // state-aware: CA major metros for CA, AZ major metros for AZ (a CA-only set would drop every AZ major-type gap)
     const expected = (type, metro) => ORG_TYPE_TIER[type] === 'universal' || (ORG_TYPE_TIER[type] === 'major' && majorMetros.has(metro));
     const gaps = [];
     for (const g of grid) for (const c of g.coverage) if (c.count === 0 && expected(c.type, g.metro)) gaps.push({ metro: g.metro, type: c.type });
diff --git a/src/pr/lib/geo.js b/src/pr/lib/geo.js
index c722af3e..24408473 100644
--- a/src/pr/lib/geo.js
+++ b/src/pr/lib/geo.js
@@ -32,6 +32,15 @@ const STATES = { CA: { label: 'California', metros: CA_METROS }, AZ: { label: 'A
 // Major CA metros — the coverage tier model expects 'major'-tier categories (finance/PR/
 // proptech) only here, not in secondary metros (Sacramento, Inland Empire, Central Coast/Valley).
 const MAJOR_METRO_KEYS = ['la', 'oc', 'san-diego', 'bay-area'];
+// Per-STATE dominant CRE markets — the metros where 'major'-tier specialist categories
+// (finance/PR/proptech) realistically concentrate, for the tier-aware coverage denominator + gap
+// report. MUST be state-aware: the CA set applied to AZ would drop every major-type gap there.
+// AZ: the Phoenix/Maricopa cluster + Tucson dominate; Pinal + Flagstaff are secondary.
+const MAJOR_METRO_KEYS_BY_STATE = {
+  CA: MAJOR_METRO_KEYS,
+  AZ: ['phoenix', 'scottsdale', 'tempe', 'mesa', 'chandler', 'gilbert', 'glendale-az', 'tucson'],
+};
+function majorMetrosFor(state) { return MAJOR_METRO_KEYS_BY_STATE[state] || []; }
 
 function metrosFor(state) { return (STATES[state] || {}).metros || []; }
 function metroLabel(state, key) {
@@ -51,4 +60,4 @@ function geoPriority(state, metroKey) {
   return Math.max(30, 100 - Math.round((i / Math.max(list.length - 1, 1)) * 60));
 }
 
-module.exports = { CA_METROS, AZ_METROS, MAJOR_METRO_KEYS, STATES, metrosFor, metroLabel, metroForCounty, geoPriority };
+module.exports = { CA_METROS, AZ_METROS, MAJOR_METRO_KEYS, MAJOR_METRO_KEYS_BY_STATE, majorMetrosFor, STATES, metrosFor, metroLabel, metroForCounty, geoPriority };

← d76172e5 pr/jobs: make generate-coverage-report gap detection TIER-AW  ·  back to Rentv 2026  ·  auto-save: 2026-08-05T23:16:37 (7 files) — data/deals-regist f1d77cee →