Repository navigation
feat(leads): record contacts on both research paths, and let the list out - #153
Merged
Merged
Conversation
… out outreach_contacts held nine rows against seventy-seven addressable leads. The cause was a missing call rather than a broken one: researchProspect has two branches, and only the unscanned one recorded a contact. Almost every lead arrived through the scanning branch, which wrote the address onto the prospect and nowhere else — so the durable, org-scoped record the table exists to be was very nearly empty, while the data itself sat in project-scoped prospect rows that have to be read one project at a time. Both branches record now, and the scanning branch links the prospect back to the contact so the relationship works in both directions. Contacts also carry a niche, which they never did. The campaign that found someone is the only statement about them the pipeline can make without asking a model to guess: someone found by a campaign called "game designers" is a game designer. A list that cannot be segmented is worth very little, and segment size is the thing that decides that. The backfill migration is the history the code fix cannot reach — everything found before it existed. Idempotent, since the unique index already holds every row it would add. Applied: 9 contacts to 80, 63 with a niche, 78 prospects linked, none left unrecorded. And the table had no surface at all, which made it a table rather than an asset. There is now a panel showing segment sizes and a CSV export. Fields that begin with =, + or - are prefixed, because a contact list is exactly the kind of file that gets opened in a spreadsheet without a thought. Anyone who asked not to be contacted is excluded from the counts and the export both, so a file cannot reintroduce them elsewhere. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
vu1nz Security Review0 finding(s) in PR #? No security issues found. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A missing call, not a broken one
researchProspecthas two branches. Only the unscanned one calledrecordContact. Almost every lead arrived through the scanning branch, which wrote the address onto the prospect and nowhere else — so the durable, org-scoped record the table exists to be was very nearly empty, while the data sat in project-scoped rows that have to be read one project at a time.Both branches record now, and the scanning branch sets
contact_idso the link works in both directions.Contacts now carry a niche
They never did. The campaign that found someone is the only statement about them the pipeline can make without asking a model to guess — someone found by a campaign called "game designers" is a game designer. A list that can't be segmented is worth very little, and segment size is what decides that.
Backfill: the history the code fix can't reach
Idempotent — the unique index on
(organization_id, identity_key)already holds every row it would add. Applied to prod:It had no surface at all
Which made it a table, not an asset. Now: a panel showing segment sizes, and a CSV export.
=,+,-or@are prefixed — a contact list is exactly the kind of file opened in a spreadsheet without a thought, and a leading=there is executabledo_not_contactrows are excluded from both the counts and the export, so a downloaded file can't reintroduce them somewhere elseChecks
tsc --noEmitclean · 1,028 tests pass (14 new) · build compilesupsertContactpassed the whole time this was broken, because nothing called it🤖 Generated with Claude Code