[object Object]

← back to Rentv Sheet Enrich

TK-10533: add 'LinkedIn (Contact) — found' date-provenance column + going-forward stamp

504437fc8bbba35dd389baa3231cc1a9055719f8 · 2026-08-24 11:35:34 -0700 · Steve Abrams

Cody FIX-FIRST secondary item, approved by Steve. write_by_contact.py now resolves
a per-contact 'LinkedIn (Contact) — found' column (append-only at rightmost edge,
by-label lookup, auto-created if missing) and stamps today's ISO date the day a
LinkedIn slug is first written — giving each green LinkedIn stamp a liveness date.
ADD-only + append-only: cannot shift columns under or collide with the concurrent
RENTV writer. Column header created live at AF on gid 3823360. Legacy 1335 cells left
undated (honest 'unknown') rather than back-stamped with a false today's-date.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

Files touched

Diff

commit 504437fc8bbba35dd389baa3231cc1a9055719f8
Author: Steve Abrams <steve@designerwallcoverings.com>
Date:   Mon Aug 24 11:35:34 2026 -0700

    TK-10533: add 'LinkedIn (Contact) — found' date-provenance column + going-forward stamp
    
    Cody FIX-FIRST secondary item, approved by Steve. write_by_contact.py now resolves
    a per-contact 'LinkedIn (Contact) — found' column (append-only at rightmost edge,
    by-label lookup, auto-created if missing) and stamps today's ISO date the day a
    LinkedIn slug is first written — giving each green LinkedIn stamp a liveness date.
    ADD-only + append-only: cannot shift columns under or collide with the concurrent
    RENTV writer. Column header created live at AF on gid 3823360. Legacy 1335 cells left
    undated (honest 'unknown') rather than back-stamped with a false today's-date.
    
    Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
---
 write_by_contact.py | 13 +++++++++++--
 1 file changed, 11 insertions(+), 2 deletions(-)

diff --git a/write_by_contact.py b/write_by_contact.py
index 5267564..e655047 100644
--- a/write_by_contact.py
+++ b/write_by_contact.py
@@ -8,10 +8,11 @@ the company-only write_by_name.py). Each result item = {company, name, contact_l
 Only fills empty cells; contact_li becomes =HYPERLINK; email -> "Updated Email (found)".
 Reports matched / unmatched / cells.
 """
-import sys, os, json, re
+import sys, os, json, re, datetime
 sys.path.insert(0, os.path.dirname(__file__))
 import lib
 GID = int(sys.argv[1]); results = json.load(open(sys.argv[2]))
+TODAY = datetime.date.today().isoformat()  # "enriched-as-of" provenance stamp (TK-10533)
 def norm(s): return re.sub(r'[^a-z0-9]', '', (s or '').lower())
 
 tok = lib.access_token()
@@ -24,11 +25,17 @@ hdr = rows[hr]
 def hidx(label): return next((i for i in range(len(hdr)) if (hdr[i] if i < len(hdr) else "").strip() == label), None)
 NAME = hidx("Contact Name"); CO = hidx("Company/Venue")
 LIC = hidx("LinkedIn (Contact)"); EM = hidx("Updated Email (found)")
-# auto-create any missing target columns
+# FND = per-contact "enriched-as-of" date column beside the LinkedIn stamp (TK-10533, Cody
+# provenance ask). ADD-only, like every other cell here: stamped the day a LinkedIn slug is
+# first written, giving each green LinkedIn stamp a liveness date instead of an undated "verified".
+FND = hidx("LinkedIn (Contact) — found")
+# auto-create any missing target columns (append-only at the rightmost edge — never shifts
+# existing columns, so it can't collide with the concurrent RENTV writer)
 rightmost = max((i for i, v in enumerate(hdr) if v.strip()), default=0); nxt = rightmost + 1
 newh = []
 if LIC is None: LIC = nxt; newh.append({"row0": hr, "col0": nxt, "value": "LinkedIn (Contact)"}); nxt += 1
 if EM  is None: EM  = nxt; newh.append({"row0": hr, "col0": nxt, "value": "Updated Email (found)"}); nxt += 1
+if FND is None: FND = nxt; newh.append({"row0": hr, "col0": nxt, "value": "LinkedIn (Contact) — found"}); nxt += 1
 if newh: lib.batch_fill(tok, GID, newh)
 def cell(r, i): return (rows[r][i] if i is not None and r < len(rows) and i < len(rows[r]) else "").strip()
 
@@ -70,6 +77,8 @@ for it in results:
         em = (it.get("email") or "").strip()
         if li and not cell(r0, LIC):
             cells.append({"row0": r0, "col0": LIC, "value": '=HYPERLINK("%s")' % li.replace('"', ""), "formula": True})
+            if not cell(r0, FND):  # stamp the found-date only when we newly fill the LinkedIn cell
+                cells.append({"row0": r0, "col0": FND, "value": TODAY})
         if em and not cell(r0, EM):
             cells.append({"row0": r0, "col0": EM, "value": em})
 res = lib.batch_fill(tok, GID, cells)

← eec7a10 yoloforever cycle 20: wb_045 +21 contact-LinkedIn (1325/4297  ·  back to Rentv Sheet Enrich  ·  auto-data-snapshot: 2026-08-24T11:44:27 (1 data files) — __p 4f190d2 →