Repository navigation
Conversation
A retailer for one brand shouldn't cold-email a club already wearing it. New icp.exclude_if_site_mentions lists the brands. Before writing, the writer reads the company's homepage and up to six of its own kit, shop, sponsor and about pages; a whole-word mention (text, link or image URL, including a <brand>store link) marks the prospect 'excluded' and skips it. The sender re-checks before sending so earlier drafts are caught, and 'excluded' joins the statuses that stop a sequence. Verdicts are cached per company for 30 days; an unreadable site gives no verdict and is retried. Off unless a brand is listed. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Jon Ward <357348325+wardjon31@users.noreply.github.com>
Names come from page titles and URLs, and drafts were going out with "https://www.example.co.uk/'s badge", "Welcome to Example Academy", "Example FC l Ladies l" and "Example Co". Add clean_company_name and run every stored name through it (add_company, rename_company, add_prospect): a URL becomes the name it spells, "Welcome to" is dropped, a title is cut at its separator (including a lone "l" used as a pipe) to the segment the domain backs up, and trailing "!"/":" goes. name_from_domain and the domain stem now strip second-level suffixes (.co.uk, .ac.uk, .sch.uk). Two Precleared tests seeded a bare domain as the company name; they now store the cleaned name, which is what the database holds. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Jon Ward <357348325+wardjon31@users.noreply.github.com>
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.
What this changes
Company names come from page titles and URLs, and some reached drafts in forms like
https://www.example.co.uk/'s badge,Welcome to Example Academy,Example FC l Ladies lorExample Co(a domain-derived name that took.co.uk's "co" for a word).Every name is now cleaned as it's stored (
add_company,add_prospect,rename_company), whichever path found it:Domain-derived names now skip second-level suffixes (
.co.uk,.ac.uk,.sch.uk, ...).Stacked on #258 (the brand-exclusion PR) because the branches were built in order. The changes don't depend on each other, so until that one merges, review only the last commit here: "Clean company names before they reach an email".
How it was tested
tests/test_clean_company_name.py: parametrised cases for each rule, plus names that must be left alone (St. Example's School,Example O.N. Rovers FC), and a state test thatadd_company,add_prospectandrename_companystore cleaned names. All fictional data.tests/test_precleared_pause.pyupdated for the cleaned name.Checklist
pytestpasses.git commit -s).CHANGELOG.mdupdated if behaviour changed.🤖 Generated with Claude Code