← Back to brief

feedback hs engagement logging broken

memory · feedback_hs_engagement_logging_broken.md

CLEAN-SOLUTION SHIP-STATE (2026-05-05 PM)

Total HS Email engagements from 6 SL senders, measured 22:50Z:

The 156-engagement burst was created by sl-to-hs-email-sync processing campaign 3184683 (NURTURE+LOW, 34 leads × ~5 sequence steps). The script writes one stdout line per campaign header but creates engagements silently per-lead — earlier "stuck" appearance was misleading; HS-side counts proved otherwise.

Going-forward assurance (the safety-net architecture):

LayerCadenceWhat it doesHeartbeat
engagement-reconcilerEvery 30 minCounts SL sent vs HS logged for 6 senders; pushes ntfy if gap > 25health/<DATE>_engagement-reconciler_<HHMM>.json
sl-to-hs-email-sync9:17 / 13:17 / 17:17 weekdaysScrapes SL Lead List for 3 campaigns; creates missing HS engagements via CSRFhealth/<DATE>_sl-to-hs-email-sync_<HHMM>.json
PROOF 17 in gate-proof-runnerDaily 7:30amVerifies engagement-reconciler.py exists, references proper aliases, heartbeat freshPart of daily gate-proof
ntfy alerting: high-priority push fires when gap > 25 (per engagement_reconciler.py SKEW_THRESHOLD). Operator gets notified within 30 min of any regression.

HS dashboards unchanged: every new engagement is created with:

Spot-check method: pull contact weberst@gmail.com (Weber, active deal) — verified the SL "Quick question..." engagement (id 108558769963) appears with hs_timestamp = 2026-04-23T21:02:52 (matches Gmail send time exactly), from_email = joseph.bowens@skyrun.com, no duplication.

Tab-count rule R-20 wired in (NEW — see RULES.md): chrome_bridge.py now has MAX_WORK_TABS=20, prune_redundant_tabs() (closes only safe-to-remove duplicates), and _tabs_cache (10s TTL) to keep cron fires fast.

VERIFIED 2026-05-05 (cron-fired sl-to-hs-email-sync 20:20-20:28Z)

Real cron run via Gmail MCP path (no SL session required):

Implication: 5/4 baseline gap of 82 was historical. Recent sends are flowing through the alias-via-Gmail path cleanly. The sl-to-hs-email-sync cron is now scheduled 3x weekdays as a continuous safety net.

VERIFIED FACTS (2026-05-04 PM, via direct HS API + SL UI scrape)

SmartLead lifetime "Sent" since 4/22 launch (12 days)

HS Email engagements with from-email = SL sender alias, since 4/22

Sender bounces in SL (counted as "Sent" but never delivered)

Gap analysis

How HS is currently ingesting engagements (verified)

- HS Workspace/Gmail integration auto-ingesting from joseph.bowens@skyrun.com (the one connected inbox: 97 engagements) - HS auto-matching aliases on outbound emails captured by some background process for the 5 @skyrungrandcounty.com Gmail accounts (162 engagements)

RECOMMENDED OPERATOR ACTION (60 seconds in SmartLead UI)

Add 23273108@bcc.hubspot.com to the BCC field of every sequence email in all 3 SL campaigns. This adds a redundant capture path so HS catches every SL send via the BCC dropbox even if alias-via-Gmail integration glitches on some sends.

Steps:
1. SmartLead → Email Campaigns → click into "GC — NURTURE+LOW Tier"
2. Sequence editor → for each of the 5 sequence emails: Show CC/BCC → BCC field → paste 23273108@bcc.hubspot.com
3. Save
4. Repeat for HOT+WARM Tier (5 emails)
5. Repeat for SWITCH Tier (5 emails)
6. Total: 15 BCC paste-and-save operations, ~60 seconds

After fix: engagement-reconciler will detect bcc_dropbox_in_use: true within 1 send cycle and gap should drop below the skew threshold.

STRUCTURAL PROTECTION NOW IN PLACE

engagement-reconciler (every 30 min)

gate-proof PROOF 17 (daily 7:30am)

5 anti-regression gates: 1. engagement_reconciler.py exists 2. References HS BCC dropbox + 6 SL aliases + Joseph owner ID 3. Measures all 3 active campaigns 4. Heartbeat fresh (<2h) 5. Heartbeat conforms to canonical schema

If anyone (including future-me) silently disables or weakens the reconciler, PROOF 17 fails the daily gate-proof run, ntfy fires, regression is caught immediately.

INITIAL ALARM HISTORY (preserved for forensics)

The first finding said 0/30 contacts have Email engagements based on hs_email_delivered_count. That property is HS-Marketing-only (newsletters/campaigns), not total Email engagements. The retraction was correct — but the retraction also implied "everything is fine" which was ALSO wrong. The truth (now verified): 24% of SL sends ARE missing from HS, just not 100%.

Joseph's verbatim concern (the trigger)

> "All of the emails that have been sent from SL sequences and will be sent need to be properly logged as emails to be tracked in activities and I dont think that is showing on my HS dashboards so that needs to be a permanent fix as well if I'm correct on that."

He was correct that there was a gap. The gap is 24%, not 100%. The reconciler now monitors it continuously — no more guessing.

Joseph's standard

> "100% pristine data integrity across the entire system 100% of the time. Nothing should get lost or dropped or missed, EVER."

The engagement-reconciler is the mechanism that makes this true for the SL→HS axis. After Joseph applies the BCC dropbox fix above, gap should approach zero. Reconciler will catch any future regression within 30 minutes.

Related