Skip to content

Prospects: the fit check after research is not sent email addresses or phone numbers - #657

Merged
Deodat-Lawson merged 1 commit into
mainfrom
claude/distracted-sammet-71410a
Nov 29, 2026
Merged

Deodat-Lawson merged 1 commit into
mainfrom
claude/distracted-sammet-71410a

Conversation

@Deodat-Lawson

@Deodat-Lawson Deodat-Lawson commented Nov 29, 2026 •

Copy link
Copy Markdown
Owner

Summary

  • After a company is researched, the fit check judges it again on 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. They carry its mailboxes and sometimes a phone number, so both went to the chat model with every check.
  • At that one call, the company's name, listing description, summary, risks and claims now pass through a new pure function, 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].
  • What is stored and shown does not change: the dossier, its contact channels, the evidence and the published profile still hold every address and number.

Related

This edits enrichCandidate, the same function as #653 (open), in a different block. A trial merge with #653's head merges run.ts cleanly. The one conflict, in apps/web/drizzle/meta/_journal.json, is between #653 and main and comes up without this PR as well.

Checklist

  • pnpm check passes (lint + typecheck)
  • pnpm --filter @launchstack/web test passes: not run here, since no web file changes; CI runs it
  • Changeset added (@launchstack/pipelines, patch)
  • New env vars documented in .env.example and apps/web/src/env.ts: none added
  • UI changes exercised in a browser: no UI change
  • Docs updated if behavior changed: no doc describes what this call sends

Testing

  • pnpm --filter @launchstack/pipelines test with TEST_DATABASE_URL set 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 --noEmit and pnpm check: pass. Lint reports 0 errors, and no warning is in a touched file.
  • redact.test.ts, 119 cases:
    • email addresses: plain, mailto: and the [at] / [dot] forms;
    • phone numbers with a country code, and in Norwegian, US, UK, German, Dutch, French and Spanish-style national formats;
    • numbers that must stay: years, prices, amounts in threes, postcodes beside street numbers, organisation and VAT numbers, percentages, dates, opening hours and coordinates.
  • run.contact-details.test.ts runs enrichCandidate with 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 unfixed run.ts. The second also fails if redaction runs after the cut.
  • I ran the function over 5,834 claims, summaries and listing descriptions stored in local test databases, printing only counts. Before: 219 email addresses and 12 phone numbers. After: none. Those texts held no other number of seven digits or more for the function to keep or remove.
  • No model was called and nothing went out over the network. Whether a fit verdict changes when a placeholder stands in for a detail has not been tried against a model.

Notes for reviewers

  • How a phone number is recognised (also in redact.ts and 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.
  • A number that could be either is removed. A bare nine digits in threes is how Spanish, Portuguese, Polish and Czech phone numbers are written, and also how an unlabelled Norwegian organisation number looks. With Org.nr., MVA, VAT, KvK, CVR or a currency beside it, the number stays. One line in readsAsAnotherNumber changes this.
  • Not caught: a local number under eight digits with no label or country code, digits glued to letters (tlf12345678), an address or number spelled out in words, and people's names.
  • Each part is redacted before companyText joins and cuts it, so the cut can never leave half an address.
  • The new test has a file of its own instead of going into 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 ./db mock with the same function names and different behaviour, and the two versions merge into duplicate keys that do not compile.
  • Scope: only this call changes. The embedding after research and the rationale writer still see the dossier summary as written, and the research agent reads whole pages by design.

🤖 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 withoutContactDetails in distribution/redact.ts so email addresses become [email] and phone numbers become [phone], using regex heuristics that try to keep dates, amounts, postcodes, and labelled org/VAT numbers.

enrichCandidate runs that redaction on name, description, dossier summary, risks, and up to 20 evidence claims before companyText joins and truncates to 2,000 characters for the post-research judgeFit call 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.

…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>
@vercel

vercel Bot commented Nov 29, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated
pdr-ai-v2 Ignored Ignored Nov 29, 2026 11:02pm UTC

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 29, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-29T23:03:55.285153Z 1f28560 PR opened
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment on lines +170 to +173
.replace(NEVER_A_PHONE, match => {
held.push(match);
return HELD;
});

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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 👍 / 👎.

Comment on lines +158 to +160
if (digits < 8) return false;
if (MONEY_BEFORE.test(before) || NOT_A_PHONE_AFTER.test(after)) return false;
if (/^\(?\+/.test(run)) return true;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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 👍 / 👎.

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes using high effort and found 1 potential issue.

Fix All in Cursor

❌ 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;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 1f28560. Configure here.

@Deodat-Lawson
Deodat-Lawson merged commit 587ce71 into main Nov 29, 2026
14 checks passed
@Deodat-Lawson
Deodat-Lawson deleted the claude/distracted-sammet-71410a branch November 29, 2026 23:14
Deodat-Lawson added a commit that referenced this pull request Nov 29, 2026
…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>
rafchen added a commit that referenced this pull request Nov 30, 2026
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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant