[object Object]

← back to Rentv 2026

closings: FIX enrichment merge — feed deals now gap-fill buyer/seller/broker (+summary/size/year/type) from their matching corpus article; before, all 23 feed closings showed NO party data despite the corpus having it for 22 (the whole corpus pipeline's payoff was defeated for feed rows)

1b924b35415fcd89bd7fdf05de940f1e357d7b32 · 2026-08-05 14:46:35 -0700 · Steve Abrams

Files touched

Diff

commit 1b924b35415fcd89bd7fdf05de940f1e357d7b32
Author: Steve Abrams <steve@designerwallcoverings.com>
Date:   Wed Aug 5 14:46:35 2026 -0700

    closings: FIX enrichment merge — feed deals now gap-fill buyer/seller/broker (+summary/size/year/type) from their matching corpus article; before, all 23 feed closings showed NO party data despite the corpus having it for 22 (the whole corpus pipeline's payoff was defeated for feed rows)
---
 server.js | 13 +++++++++++--
 1 file changed, 11 insertions(+), 2 deletions(-)

diff --git a/server.js b/server.js
index f6ea55a9..c6a6f2a7 100644
--- a/server.js
+++ b/server.js
@@ -337,11 +337,20 @@ app.get('/api/closings', adminOnly, (req, r) => {
   // Base = deals-pull Sales ∪ corpus Sales, deduped by article id (deals-pull wins — it has images).
   const feedSales = (feed.deals || []).filter((d) => String(d.txn_type || '').toLowerCase() === 'sale');
   const feedIds = new Set(feedSales.map((d) => String(d.id)));
-  const corpusExtra = corpusClosings().filter((a) => !feedIds.has(String(a.id)));
+  const allCorpus = corpusClosings();
+  const corpusById = new Map(allCorpus.map((a) => [String(a.id), a]));
+  const corpusExtra = allCorpus.filter((a) => !feedIds.has(String(a.id)));
   const base = [...feedSales, ...corpusExtra];
+  // The deals-pull feed carries images/price but NOT the LLM-extracted party fields — those live
+  // only in the corpus. GAP-FILL each feed row from its matching corpus article (never overwrite
+  // a field the feed already has) so buyer/seller/broker actually surface on feed closings.
+  const ENRICH = ['buyer', 'seller', 'broker', 'summary', 'size_label', 'year_built', 'property_type'];
   const feedRows = base.map((d) => {
+    const c = feedIds.has(String(d.id)) ? corpusById.get(String(d.id)) : null;
+    let d2 = d;
+    if (c) { d2 = { ...d }; for (const k of ENRICH) if (!d2[k] && c[k]) d2[k] = c[k]; }
     const e = edits[String(d.id)];
-    const row = e ? { ...d, ...e, _edited: true } : { ...d };
+    const row = e ? { ...d2, ...e, _edited: true } : { ...d2 };
     row._hidden = hides.has(String(d.id));
     row._corpus = feedIds.has(String(d.id)) ? undefined : true;
     return row;

← e6da0a92 auto-save: 2026-08-05T14:42:56 (7 files) — data/deals-regist  ·  back to Rentv 2026  ·  RENTV closings+deals editors: drill-down on every datum — ba dbc79b26 →