autoresearch/regression.test.ts — 283 lines. Must pass before any Autoresearch Loop experiment is considered valid. Pure (no network, no DB).
What it guards
No false-positive person names
A frozen list of ~50 strings that isValidPersonName() MUST reject. Maintained inline in the test (lines 30–88). Categories:
- Navigation:
Om Oss,Kontakta Oss,Contact Us,Read More - Business words:
Performance Cookies,Million Profiles,Data Science - Institutions:
Montessoriförskolan Bambina,Skolan Förskolan - Roles as names:
Regionchef Syd,VD Chef,Grundare Ägare - Brand names:
World Of Volvo,Warner Bros,Tjusta Golf - Podcast/media:
Dr Björklund,Flashback Horizons - Sports:
Golf Tennis,Tennis Club - Image filenames:
More_PR_Team,Photo1,IMG_3245 - WordPress placeholders:
Hello World,Test Demo - Compass + city:
Stockholm Göteborg,Region Syd
Accepts valid Swedish names
12 strings that MUST pass: Anna Svensson, André Le Blanc, Björn Öberg, Jan-Erik Karlsson, Per Olof Lindgren, Maria García López, Émilie Dupont, Sven-Åke Andersson, etc.
Blocklist integrity
Asserts INVALID_DOMAINS, INVALID_NAME_STANDALONE_WORDS, INVALID_SUFFIXES, LOCATION_TERMINATING_WORDS (from src/enrichment/config.ts) contain critical entries. See Blocklists and Domain Blocklist.
INVALID_DOMAINSmust include:allabolag.se,ratsit.se,proff.se,eniro.se,linkedin.com,facebook.com,google.com,rocketreach.co,apollo.io,podtail.seINVALID_NAME_STANDALONE_WORDSmust include:om,kontakt,performance,cookies,dr,golf,example,slider,demo,podcast,grundare,volvo,warnerINVALID_SUFFIXESmust include:ab,hb,ltd,inc,förening,sällskapLOCATION_TERMINATING_WORDSmust include:syd,nord,öst,väst,stockholm,göteborg
Role mapping correctness
17 input → output assertions for inferRoleType covering VD/CEO, CFO/Ekonomichef, Marknadschef/CMO/PR-konsult, Försäljningschef/Sales Director, Styrelseledamot/Board Member, Styrelseordförande/Chairman, CTO/IT-chef, Personalchef/HR-chef.
Name normalization
normalizeName('André') === 'andre'normalizeName('Björn') === 'bjorn'maybeFlipSwedishName('Andréasson Moa') === 'Moa Andréasson'maybeFlipSwedishName('Anna Svensson') === 'Anna Svensson'(no flip)
Metrics calculation
Tests calculateMetrics() from autoresearch/metrics.js (the experiment harness):
- Two-company input (1 with VD contact, 1 empty) produces
extraction_rate: 0.5,total_contacts: 1,false_positive_rate: 0,email_coverage: 1,phone_coverage: 1,composite_score > 0and ≤ 100 - Empty input → all zeros,
composite_score: 0
Maintenance
Add a new entry to MUST_REJECT or MUST_ACCEPT whenever a regression is observed in production. The test name is rejects "<string>" / accepts "<string>" so failures point directly at the offending input.
See also
Autoresearch Loop, Name Validation, Blocklists, Domain Blocklist, Test Strategy.