[object Object]

← back to Rentv 2026

pr-intelligence: headless tool state-parametrized (PR_STATE, per-org state_presence)

9166e34771f6cd3ff95518c153684abc1c1e0364 · 2026-07-30 21:43:34 -0700 · Steve Abrams

Files touched

Diff

commit 9166e34771f6cd3ff95518c153684abc1c1e0364
Author: Steve Abrams <steve@designerwallcoverings.com>
Date:   Thu Jul 30 21:43:34 2026 -0700

    pr-intelligence: headless tool state-parametrized (PR_STATE, per-org state_presence)
---
 src/pr/tools/headless-team-extract.js | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/src/pr/tools/headless-team-extract.js b/src/pr/tools/headless-team-extract.js
index 2d0a06d9..ac6f3ce9 100644
--- a/src/pr/tools/headless-team-extract.js
+++ b/src/pr/tools/headless-team-extract.js
@@ -16,6 +16,7 @@ catch { ({ chromium } = require(require('path').join(process.env.HOME, '.npm-glo
 const API = process.env.PR_API || 'https://rentv.agentabrams.com';
 const AUTH = 'Basic ' + Buffer.from(process.env.PR_AUTH || 'admin:DW2024!').toString('base64');
 const MAX_ORGS = Number(process.argv[2]) || 50;
+const STATE = (process.env.PR_STATE || 'CA').toUpperCase();
 
 async function api(path, opts = {}) {
   const r = await fetch(API + '/api/pr' + path, {
@@ -36,12 +37,12 @@ async function main() {
     rows = [];
     for (const id of ids) { try { rows.push(await api('/organizations/' + id)); } catch { /* skip */ } }
   } else {
-    ({ rows } = await api(`/organizations?no_pr_contact=1&state=CA&sort=priority&dir=desc&limit=${MAX_ORGS}`));
+    ({ rows } = await api(`/organizations?no_pr_contact=1&state=${STATE}&sort=priority&dir=desc&limit=${MAX_ORGS}`));
   }
   // Skip coverage-excluded types (banks/credit unions — no public comms staff, Steve 7/30).
   const exclude = (await api('/settings')).coverage_exclude_types?.value || ['bank', 'credit_union'];
   const targets = rows.filter((o) => o.website_url && !exclude.includes(o.organization_type));
-  console.log(`[headless] ${targets.length} uncovered CA orgs to render (of ${rows.length} fetched)`);
+  console.log(`[headless] ${targets.length} uncovered ${STATE} orgs to render (of ${rows.length} fetched)`);
   const browser = await chromium.launch();
   const ctx = await browser.newContext({ userAgent: 'RENTV-PR-Research/1.0 (headless render; press-list research)' });
   let totalCreated = 0, totalRejected = 0, orgsWithPeople = 0;
@@ -109,7 +110,7 @@ async function main() {
           try {
             const r = await api('/people', { method: 'POST', body: {
               full_name: cand.full_name, exact_title: cand.exact_title,
-              organization_id: org.id, state: 'CA', metro: (org.metros || [])[0] || null,
+              organization_id: org.id, state: (org.state_presence || [])[0] || STATE, metro: (org.metros || [])[0] || null,
               lifecycle_status: 'discovered',
               evidence: {
                 source: {

← 2ed7c872 pr-intelligence: Arizona Phase-2 seed (67 real AZ CRE orgs,  ·  back to Rentv 2026  ·  console: add Developers facet → realestate (usre proxy + AZ 312a68db →