Repository navigation
Prospects: the fit check after research is not sent email addresses or phone numbers - #657
Conversation
…r phone numbers After a company is researched, the fit check judges it again on what research found: the dossier's summary, its risks and up to 20 evidence claims. With the no-model site reader those claims are sentences from the company's own website, and they carry its mailboxes and sometimes a phone number, so both went to the chat model with every check. The company's name, listing description, summary, risks and claims now pass through withoutContactDetails (new, distribution/redact.ts) at that one call, before the text is joined and cut to length: an email address becomes [email], a phone number [phone]. The dossier, its contact channels, the evidence and the published profile are stored and shown as before, and no other model call changes. Telling a phone number from a year, a price, a postcode, a date or an organisation number is the work: the rule and what it does not catch are in redact.ts and the changeset, with a test for each kind of number. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 1f28560400
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| .replace(NEVER_A_PHONE, match => { | ||
| held.push(match); | ||
| return HELD; | ||
| }); |
There was a problem hiding this comment.
Honor explicit phone labels before protecting numeric patterns
When a phone number resembles a year range or opening hours, NEVER_A_PHONE hides it before isPhoneNumber can inspect its explicit phone label. For example, withoutContactDetails("Telephone: 2015 2020") returns the input unchanged, even though the label identifies the eight digits as a phone number. Such numbers in research summaries or evidence therefore still reach the fit model. Apply the explicit-phone-label override before holding these numeric patterns aside.
Useful? React with 👍 / 👎.
| if (digits < 8) return false; | ||
| if (MONEY_BEFORE.test(before) || NOT_A_PHONE_AFTER.test(after)) return false; | ||
| if (/^\(?\+/.test(run)) return true; |
There was a problem hiding this comment.
Recognize short international numbers before the eight-digit cutoff
For a number with a country-code prefix but fewer than eight total digits, the early return prevents the international-number check from running. For example, withoutContactDetails("Reach us on +47 02800.") leaves the entire contact number intact. This contradicts the documented handling of explicitly international numbers and allows these contact details through the post-research fit check. Check the country-code prefix before applying the cutoff for unlabelled national numbers.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using high effort and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 1f28560. Configure here.
| if (groups.length !== 2) return false; | ||
| const join = run.slice(run.search(/\d/) + first.length, run.length - second.length); | ||
| // 59.913868 and 0.12345678: a decimal. | ||
| if (join === "." && (first === "0" || !first.startsWith("0"))) return true; |
There was a problem hiding this comment.
Dotted two-group phones treated as decimals
Medium Severity
The decimal check treats almost every two-group dotted run as a coordinate, so unlabelled numbers like 333.1234567 stay in the judge payload. The same digits with a slash are already treated as a phone, and a leading 0 is the only dotted form that still redacts.
Reviewed by Cursor Bugbot for commit 1f28560. Configure here.
…earch's main gained place search (#654), the pipelines tests in CI (#655), the claim check's company profile (#656) and contact details kept out of the fit check (#657). Place search's migration took journal slot 58, which this branch's migration also held. drizzle-kit builds on the snapshot whose name sorts last, and the migration runner requires every journal entry to be later than the one before, so this branch's migration cannot keep its earlier timestamp. drizzle-kit regenerated it after place search's, nothing edited by hand: 20261124154024_distribution_fit_verdicts is now 20261129231658_distribution_fit_verdicts, slot 59. Its SQL is byte-identical and its snapshot now builds on place search's. No deployed database ran the old tag; a local one that did needs its ledger row renamed to the new tag. Everything else merged without a conflict. The changeset names the new migration, and the experiments README says run.ts also runs e1-production now. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Resolves #587's conflicts with main (16 new commits): - Prospects for every workspace (#646): the Scenarios prospects source, segment list and picker drop the beta gate like main, and keep the segment / company picks (now passed to v2 runs). - Keyless runs keep reading five companies at once alongside main's place pool (#654); run.ts keeps the pictures, pool and redaction imports (#657). - The partner-org pictures migration is regenerated after main's newest migration (same three columns, still last in the table). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>


Summary
withoutContactDetails(pipelines/src/distribution/redact.ts), before the text is joined and cut to 2,000 characters. An email address becomes[email]and a phone number[phone].Related
This edits
enrichCandidate, the same function as #653 (open), in a different block. A trial merge with #653's head mergesrun.tscleanly. The one conflict, inapps/web/drizzle/meta/_journal.json, is between #653 and main and comes up without this PR as well.Checklist
pnpm checkpasses (lint + typecheck)pnpm --filter @launchstack/web testpasses: not run here, since no web file changes; CI runs it@launchstack/pipelines, patch).env.exampleandapps/web/src/env.ts: none addedTesting
pnpm --filter @launchstack/pipelines testwithTEST_DATABASE_URLset to a local throwaway Postgres, run the way the CI step runs it: 94 files and 1,282 tests pass. 7 are skipped: the company-search replays that need recordings.pnpm --filter @launchstack/pipelines exec tsc --noEmitandpnpm check: pass. Lint reports 0 errors, and no warning is in a touched file.redact.test.ts, 119 cases:mailto:and the[at]/[dot]forms;run.contact-details.test.tsrunsenrichCandidatewith research whose summary, risk and claims hold an address and a number. The judge's whole input holds neither, and the stored dossier and evidence still hold both. A second test makes the text run past 2,000 characters so that the cut falls inside an address, and checks that no half address is sent. Both tests fail against the unfixedrun.ts. The second also fails if redaction runs after the cut.Notes for reviewers
redact.tsand the changeset). Digits count as a phone number in two cases. The first is when the text says so: a+country code, or tel / mobil / fax in front, and then five digits are enough. The second is eight or more digits, grouped the way phone numbers are, that do not read as a date, opening hours, years, an amount, a street number beside a postcode, or a number labelled as a registration, VAT or customs number.Org.nr.,MVA,VAT,KvK,CVRor a currency beside it, the number stays. One line inreadsAsAnotherNumberchanges this.tlf12345678), an address or number spelled out in words, and people's names.companyTextjoins and cuts it, so the cut can never leave half an address.run.test.ts. Other branches (Prospects: the shortlist learns from each fit verdict and keeps what it learned #653 and work stacked on it) extend that file's./dbmock with the same function names and different behaviour, and the two versions merge into duplicate keys that do not compile.🤖 Generated with Claude Code
Note
Low Risk
Scoped to one LLM call with stored data untouched; heuristic phone detection may occasionally mislabel ambiguous digit runs and slightly affect fit verdicts.
Overview
Adds
withoutContactDetailsindistribution/redact.tsso email addresses become[email]and phone numbers become[phone], using regex heuristics that try to keep dates, amounts, postcodes, and labelled org/VAT numbers.enrichCandidateruns that redaction on name, description, dossier summary, risks, and up to 20 evidence claims beforecompanyTextjoins and truncates to 2,000 characters for the post-researchjudgeFitcall only. Stored dossiers, contact channels, evidence, and published output are unchanged.Includes broad unit tests for the redactor and integration tests that assert the judge payload has no raw contact details (including no truncated emails at the cut boundary).
Reviewed by Cursor Bugbot for commit 1f28560. Bugbot is set up for automated code reviews on this repo. Configure here.