[object Object]

← back to Homesonspec

Fix new-builder ingest bugs caught on real data: lat/lon optional in home schema (KB/DRH feeds lack per-home geo), TOWNHOUSE→TOWNHOME enum (KB/Pulte), Pulte builder slug pulte→pultegroup + deploy-full pnpm install step

8456a67d7b0c5ec943102d6e3a3ef62319ad53ce · 2026-07-23 00:16:36 -0700 · Steve

Files touched

Diff

commit 8456a67d7b0c5ec943102d6e3a3ef62319ad53ce
Author: Steve <steve@designerwallcoverings.com>
Date:   Thu Jul 23 00:16:36 2026 -0700

    Fix new-builder ingest bugs caught on real data: lat/lon optional in home schema (KB/DRH feeds lack per-home geo), TOWNHOUSE→TOWNHOME enum (KB/Pulte), Pulte builder slug pulte→pultegroup + deploy-full pnpm install step
---
 collectors/kb-home/src/index.ts | 2 +-
 collectors/pulte/src/index.ts   | 4 ++--
 deploy-full.sh                  | 3 +++
 packages/schemas/src/index.ts   | 4 ++--
 4 files changed, 8 insertions(+), 5 deletions(-)

diff --git a/collectors/kb-home/src/index.ts b/collectors/kb-home/src/index.ts
index 77c9dc7..7caf5b9 100644
--- a/collectors/kb-home/src/index.ts
+++ b/collectors/kb-home/src/index.ts
@@ -116,7 +116,7 @@ export const kbHomeAdapter: SourceAdapter = {
         const thumb = str(r.ThumbnailImage) ?? str(r.GalleryPhotos)?.split(",")[0]?.trim() ?? null;
         const image = thumb ? (thumb.startsWith("http") ? thumb : ORIGIN + thumb) : null;
         const lot = str(r.Homesite) ?? str(r.MLSNumber);
-        const homeType = /town|condo|attached/i.test(str(r.HomeType) ?? "") ? "TOWNHOUSE" : "SINGLE_FAMILY";
+        const homeType = /town|condo|attached/i.test(str(r.HomeType) ?? "") ? "TOWNHOME" : "SINGLE_FAMILY";
         records.push({
           entityType: "inventory_home",
           canonicalHints: {
diff --git a/collectors/pulte/src/index.ts b/collectors/pulte/src/index.ts
index d2a0df0..ca90fad 100644
--- a/collectors/pulte/src/index.ts
+++ b/collectors/pulte/src/index.ts
@@ -17,7 +17,7 @@ import {
  * Plain HTTP, no anti-bot, no auth.
  */
 const API = "https://www.pulte.com";
-const BUILDER_SLUG = "pulte";
+const BUILDER_SLUG = "pultegroup";
 const STATE = process.env.PULTE_STATE ?? "California";
 const BRAND = process.env.PULTE_BRAND ?? "Pulte";
 const PAGE_LIMIT = Number(process.env.PULTE_PAGE_LIMIT ?? 200);
@@ -151,7 +151,7 @@ export const pulteAdapter: SourceAdapter = {
             sqft: fv(num(h.squareFeet), null, page.url),
             stories: fv(num(h.floors), null, page.url),
             garageSpaces: fv(num(h.garages), null, page.url),
-            homeType: fv((h.isSingleFamily === false ? "TOWNHOUSE" : "SINGLE_FAMILY") as never, null, page.url, "Pulte inventory home"),
+            homeType: fv((h.isSingleFamily === false ? "TOWNHOME" : "SINGLE_FAMILY") as never, null, page.url, "Pulte inventory home"),
             constructionStatus: fv(statusOf(str(h.dateAvailable)), str(h.dateAvailable), page.url),
             estCompletionDate: fv<string>(null, null, page.url),
             lotNumber: fv(str(h.lotBlock), str(h.lotBlock), page.url),
diff --git a/deploy-full.sh b/deploy-full.sh
index 5836a15..a594f06 100644
--- a/deploy-full.sh
+++ b/deploy-full.sh
@@ -19,6 +19,9 @@ rsync -az --delete ~/Projects/spechomes/packages/database/prisma/ $KH:$REMOTE/pa
 rsync -az          ~/Projects/spechomes/design-system/        $KH:$REMOTE/design-system/
 echo "  synced"
 
+echo "── 1.5/5 link workspace packages (new collector adapters) ──"
+ssh $KH "cd $REMOTE; export PATH=\$PATH:/root/.npm-global/bin:/usr/local/bin; pnpm install --silent 2>&1 | tail -1"
+
 echo "── 2/5 apply ADDITIVE migration to live DB (SourceRun + SourceRegistry cols) ──"
 ssh $KH "cd $REMOTE; $RP; pnpm --filter @spechomes/database exec prisma migrate deploy 2>&1 | grep -iE 'migration|applied|already|error' | head"
 
diff --git a/packages/schemas/src/index.ts b/packages/schemas/src/index.ts
index baa8eb0..7a7edc5 100644
--- a/packages/schemas/src/index.ts
+++ b/packages/schemas/src/index.ts
@@ -74,8 +74,8 @@ export const inventoryHomePayloadSchema = z.object({
   estCompletionDate: fieldValueSchema(z.string()), // ISO date string
   lotNumber: fieldValueSchema(z.string()),
   builderInventoryId: fieldValueSchema(z.string()),
-  lat: fieldValueSchema(z.number()),
-  lon: fieldValueSchema(z.number()),
+  lat: fieldValueSchema(z.number()).optional(), // not every builder feed carries per-home geo
+  lon: fieldValueSchema(z.number()).optional(),
   planName: fieldValueSchema(z.string()),
   // Builder-supplied listing photos (largest srcset variant per asset). Optional
   // so adapters that don't yet capture media still validate.

← 7478696 Add Pulte adapter (4th builder) — JSON API (getcommunities +  ·  back to Homesonspec  ·  Add Tri Pointe adapter (5th builder) — Next.js RSC (unescape f66f9ae →