Files
getcargohq__cargo-skills/cargo-gtm/scripts/fixtures_current_role.json
Auree Aubert 2792b990ed feat(gtm): executable QA layer — fixture-tested contact-accuracy scripts (#53)
* feat(gtm): executable QA layer — fixture-tested contact-accuracy scripts

Four deterministic TypeScript scripts under cargo-gtm/scripts/ (Node >= 22.18
native type-stripping, zero deps in file mode) replace in-context row checking:

- validate-emails.ts        free syntax/risk/duplicate cull before paid verifyEmail
- select-current-role.ts    current role from an experiences array (job changers)
- validate-linkedin-names.ts name<->profile match (same-name decoys); P>=0.95/R>=0.85 gate
- contact-accuracy-audit.ts  final per-row SEND/VERIFY/REVIEW/REMOVE stamp

Each reads --input CSV/JSON or a finished run directly (--workflow-uuid via
@cargo-ai/api, reusing the CLI's stored login) and self-tests with --fixtures
(152 synthetic cases total). New qa-script-fixtures CI job runs every suite on
push/PR. Doctrine in references/contact-accuracy.md ("run the script, don't
re-derive"); wired into the router (new section 8, spine step 8) and the
prospecting / outreach-activation verify steps. cargo-gtm -> 1.2.0.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

* feat(gtm): provider playbooks 6 → 20 + read-first gate (#54)

Fourteen new per-provider playbooks grounded in live `connection integration
get` schemas: sourcing/company-data (linkedin, proxycurl, apolloio, oceanio,
datagma), email/contact (hunter, prospeo, icypeas, findyMail, leadMagic,
contactOut, zeroBounce), research (firecrawl, serper). Each carries the action
table with credit costs, real config-shape examples, input quirks, cost traps,
and its recipe-spine position.

Router §11 opens with a hard read-first stop before any paid call to a covered
provider; the linter now errors when a playbook on disk is missing from the
SKILL.md catalog.

Grounding also surfaced and fixed a recipe bug: linkedin-url-lookup.md
documented findProfileUrl inputs that don't exist — the live schema is
fullName (required) + companyName. Stale cost-table rows (prospeo.verifyEmail,
serper pricing) flagged in the CHANGELOG for the next regeneration.
cargo-gtm -> 1.3.0.

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>

* fix(gtm): QA-chain review feedback — six wiring bugs in scripts and recipes

- contact-accuracy-audit.ts: detect a bare "status" header (raw waterfall
  verifyEmail rows) as the verification column, lowest priority so specific
  headers still win; two new fixture cases.
- lib/common.ts: accept raw execute-batch output ({"results": [...]} /
  {"records": [...]}) in JSON inputs — no jq unwrap needed.
- validate-emails.ts + contact-accuracy-audit.ts: new --json flag emits rows
  as a JSON array for jq chaining; duplicates now get recommendation "skip"
  so they never enter the paid verify batch (savings count includes them).
- prospecting.md step 6/6.5: the paid verify batch is built from the culled
  output (recommendation != "skip"), an explicit merge step joins statuses
  back onto ALL rows before the audit, and only audit_action == "SEND" rows
  proceed to write-back.
- outreach-activation.md step 4: same cull -> verify survivors -> merge ->
  audit-all -> SEND-only flow; steps 5-6 now read the audited SEND set
  (deliverable.json), with the step-5/6 jq paths fixed for array input.
- contact-accuracy.md: documents the never-pre-filter-to-valid rule, the
  execute-batch input support, and --json.

All four fixture suites pass; the full recipe chain was exercised end-to-end
on simulated batch outputs (disposable + duplicate culled before payment,
catch-all single-source -> VERIFY, only SEND rows in the handoff set).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

* fix(gtm): case-insensitive status merge; strict identity coverage; dedupe verdict

- Recipes: the verification-status merge now joins on the lowercased email —
  verifyEmail results may re-case the address, and a missed join left
  emailStatus empty, silently degrading deliverable rows to VERIFY.
- contact-accuracy-audit.ts: identityColumnsPresent now requires BOTH
  name_match and role_confidence columns — one upstream script alone no
  longer masks partial identity coverage (partial-signals flag stays on).
- contact-accuracy-audit.ts: new duplicate-row REMOVE rule reading the
  is_duplicate column — a later occurrence of an address never reaches the
  sequencer even when all other signals are green (found while re-testing:
  the case-insensitive join let the dupe inherit "valid" and SEND).

23 fixture cases pass; chain re-run with re-cased verify results yields
exactly one SEND.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

* fix(gtm): merge verifyEmail via email_status, not status

waterfall.verifyEmail batch rows expose the verdict on email_status per the
connector output schema. The recipe merge jq read .status, so merged rows got
an empty emailStatus and contact-accuracy-audit stamped VERIFY instead of SEND.

Co-authored-by: Auree Aubert <aureeaubert@users.noreply.github.com>

---------

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
Co-authored-by: Cursor Agent <cursoragent@cursor.com>
Co-authored-by: Auree Aubert <aureeaubert@users.noreply.github.com>
2026-07-10 00:16:01 -07:00

235 lines
12 KiB
JSON

{
"cases": [
{
"name": "single-current-role",
"experiences": [
{ "title": "Head of Growth", "companyName": "Northwind Labs", "startDate": "2022-03", "current": true }
],
"expected": { "title": "Head of Growth", "company": "Northwind Labs", "confidence": "high" },
"note": "Exactly one active operating role."
},
{
"name": "ended-then-current",
"experiences": [
{ "title": "Account Executive", "companyName": "Old Harbor Software", "startDate": "2019-02", "endDate": "2022-05" },
{ "title": "Senior Account Executive", "companyName": "Northwind Labs", "startDate": "2022-06" }
],
"expected": { "title": "Senior Account Executive", "company": "Northwind Labs", "confidence": "high" },
"note": "Past endDate makes the first role inactive; no endDate means active."
},
{
"name": "string-false-current-flag",
"experiences": [
{ "title": "VP Engineering", "companyName": "Old Harbor Software", "start_date": "2018-01", "end_date": "2021-03", "jobStillWorking": "false" },
{ "title": "VP Engineering", "companyName": "Vector Systems", "start_date": "2021-04", "jobStillWorking": "true" }
],
"expected": { "title": "VP Engineering", "company": "Vector Systems", "confidence": "high" },
"note": "The classic bug: the string \"false\" is truthy — naive code picks Old Harbor."
},
{
"name": "string-true-current-flag",
"experiences": [
{ "title": "CTO", "company": "Vector Systems", "startDate": "2020-06", "isCurrent": "true" },
{ "title": "Engineering Manager", "company": "Old Harbor Software", "startDate": "2016-01", "endDate": "2020-05", "isCurrent": "false" }
],
"expected": { "title": "CTO", "company": "Vector Systems", "confidence": "high" },
"note": "String \"true\" flag counts as current; string \"false\" does not."
},
{
"name": "string-false-capitalized-no-end-date",
"experiences": [
{ "title": "Sales Director", "companyName": "Old Harbor Software", "startDate": "2019-01", "jobStillWorking": "False" },
{ "title": "Sales Director", "companyName": "BrightWave", "startDate": "2023-02", "jobStillWorking": "True" }
],
"expected": { "title": "Sales Director", "company": "BrightWave", "confidence": "high" },
"note": "\"False\" with a missing end date means left-with-unknown-end, not active."
},
{
"name": "string-zero-and-one-flags",
"experiences": [
{ "title": "Recruiter", "companyName": "Old Harbor Software", "startDate": "2019-05", "endDate": "2021-06", "isCurrent": "0" },
{ "title": "Senior Recruiter", "companyName": "BrightWave", "startDate": "2021-07", "isCurrent": "1" }
],
"expected": { "title": "Senior Recruiter", "company": "BrightWave", "confidence": "high" },
"note": "\"0\" is false and \"1\" is true — both are strings, never truthiness-test."
},
{
"name": "operator-beats-board-seat",
"experiences": [
{ "title": "Board Member", "companyName": "Harbor Ventures", "startDate": "2023-01", "current": true },
{ "title": "Chief Executive Officer", "companyName": "Northwind Labs", "startDate": "2021-05", "current": true }
],
"expected": { "title": "Chief Executive Officer", "company": "Northwind Labs", "confidence": "high" },
"note": "Board seat is excluded even though it started later; the operator role wins."
},
{
"name": "only-board-roles",
"experiences": [
{ "title": "Advisor", "companyName": "BrightWave", "startDate": "2021-03", "current": true },
{ "title": "Board Member", "companyName": "Harbor Ventures", "startDate": "2023-06", "current": true }
],
"expected": { "title": "Board Member", "company": "Harbor Ventures", "confidence": "low" },
"note": "Only non-operating roles are active: pick the most recent, confidence low."
},
{
"name": "charity-org-excluded",
"experiences": [
{ "title": "Program Lead", "companyName": "City Harvest Charity", "startDate": "2023-01", "current": true },
{ "title": "Operations Manager", "companyName": "Northwind Labs", "startDate": "2020-04", "current": true }
],
"expected": { "title": "Operations Manager", "company": "Northwind Labs", "confidence": "high" },
"note": "Charity/volunteer orgs are excluded from primary selection by company name."
},
{
"name": "multiple-active-no-flags",
"experiences": [
{ "title": "Co-Founder", "companyName": "Quantum Forge", "startDate": "2021-01" },
{ "title": "Chief Product Officer", "companyName": "Orbit Metrics", "startDate": "2023-04" }
],
"expected": { "title": "Chief Product Officer", "company": "Orbit Metrics", "confidence": "medium" },
"note": "Two concurrent operating roles, neither flagged: pick latest start, medium."
},
{
"name": "multiple-active-latest-flagged",
"experiences": [
{ "title": "Co-Founder", "companyName": "Quantum Forge", "startDate": "2021-01", "current": true },
{ "title": "Chief Executive Officer", "companyName": "Orbit Metrics", "startDate": "2023-04", "current": true }
],
"expected": { "title": "Chief Executive Officer", "company": "Orbit Metrics", "confidence": "high" },
"note": "A clear latest start that also carries a current-flag is high confidence."
},
{
"name": "no-active-roles",
"experiences": [
{ "title": "Product Manager", "companyName": "Old Harbor Software", "startDate": "2015-01", "endDate": "2019-12" },
{ "title": "Senior Product Manager", "companyName": "BrightWave", "startDate": "2020-01", "endDate": "2023-08", "jobStillWorking": false }
],
"expected": { "title": "Senior Product Manager", "company": "BrightWave", "confidence": "low" },
"note": "Everything ended: pick the most recently ended role, low — re-verify downstream."
},
{
"name": "title-repair-at",
"experiences": [
{ "title": "VP Sales at Acme Corp", "companyName": "Acme Corp", "startDate": "2022-01", "current": true }
],
"expected": { "title": "VP Sales", "company": "Acme Corp", "confidence": "high" },
"note": "Trailing \" at <company>\" segment equals the company: stripped."
},
{
"name": "title-repair-at-symbol-fuzzy",
"experiences": [
{ "title": "Head of Marketing @ BrightWave", "companyName": "BrightWave Inc", "startDate": "2021-09", "current": true }
],
"expected": { "title": "Head of Marketing", "company": "BrightWave Inc", "confidence": "high" },
"note": "\"@ BrightWave\" fuzzy-equals \"BrightWave Inc\" once the legal suffix is ignored."
},
{
"name": "title-repair-dash-legal-suffix",
"experiences": [
{ "title": "CTO - Quantum Forge Inc", "companyName": "Quantum Forge", "startDate": "2020-02", "current": true }
],
"expected": { "title": "CTO", "company": "Quantum Forge", "confidence": "high" },
"note": "\" - <company> Inc\" trailing segment stripped despite the suffix mismatch."
},
{
"name": "title-repair-pipe",
"experiences": [
{ "title": "Director of Operations | Helios Ltd", "companyName": "Helios", "startDate": "2022-07", "current": true }
],
"expected": { "title": "Director of Operations", "company": "Helios", "confidence": "high" },
"note": "Pipe separator variant, Ltd suffix ignored during the match."
},
{
"name": "title-with-at-not-stripped",
"experiences": [
{ "title": "Head of Data at Scale", "companyName": "Meridian Analytics", "startDate": "2022-05", "current": true }
],
"expected": { "title": "Head of Data at Scale", "company": "Meridian Analytics", "confidence": "high" },
"note": "\"at Scale\" is part of the real title — trailing segment does not match the company, so no repair."
},
{
"name": "company-as-object",
"experiences": [
{ "position": "Staff Engineer", "company": { "name": "Orbit Metrics" }, "start_date": "2021-11", "isCurrent": true }
],
"expected": { "title": "Staff Engineer", "company": "Orbit Metrics", "confidence": "high" },
"note": "Company arrives as an object {name}; title arrives under \"position\"."
},
{
"name": "year-only-dates",
"experiences": [
{ "title": "Analyst", "companyName": "Old Harbor Software", "startDate": "2016", "endDate": "2019" },
{ "title": "Senior Analyst", "companyName": "Northwind Labs", "startDate": "2019" }
],
"expected": { "title": "Senior Analyst", "company": "Northwind Labs", "confidence": "high" },
"note": "Bare \"YYYY\" strings parse with month defaulting to January."
},
{
"name": "year-month-object-dates",
"experiences": [
{ "title": "Data Engineer", "companyName": "Northwind Labs", "startDate": { "year": 2022, "month": 3 } },
{ "title": "Senior Data Engineer", "companyName": "Northwind Labs", "startDate": { "year": 2022, "month": 7 } }
],
"expected": { "title": "Senior Data Engineer", "company": "Northwind Labs", "confidence": "medium" },
"note": "{year, month} objects compare correctly; two concurrent roles → medium."
},
{
"name": "iso-timestamp-dates",
"experiences": [
{ "title": "Platform Engineer", "companyName": "Old Harbor Software", "startDate": "2017-02-01T00:00:00.000Z", "endDate": "2021-03-31T00:00:00.000Z" },
{ "title": "Staff Platform Engineer", "companyName": "Vector Systems", "startDate": "2021-04-15T09:30:00Z" }
],
"expected": { "title": "Staff Platform Engineer", "company": "Vector Systems", "confidence": "high" },
"note": "Full ISO timestamps reduce to (year, month) tuples."
},
{
"name": "future-end-date",
"experiences": [
{ "title": "Interim CFO", "companyName": "Helios", "startDate": "2024-01", "endDate": "2099-12-31" },
{ "title": "Finance Director", "companyName": "Old Harbor Software", "startDate": "2018-03", "endDate": "2023-12" }
],
"expected": { "title": "Interim CFO", "company": "Helios", "confidence": "high" },
"note": "An endDate in the future counts as active (fixed-term contract)."
},
{
"name": "snake-case-and-jobTitle-variants",
"experiences": [
{ "jobTitle": "Growth Lead", "organization": "BrightWave", "dateFrom": "2020-08", "dateTo": "2022-01" },
{ "jobTitle": "Head of Growth", "organization": "Orbit Metrics", "start_date": "2022-02", "jobStillWorking": true }
],
"expected": { "title": "Head of Growth", "company": "Orbit Metrics", "confidence": "high" },
"note": "jobTitle/organization/dateFrom/dateTo/start_date field variants all resolve."
},
{
"name": "tie-start-prefers-current-flag",
"experiences": [
{ "title": "Principal Consultant", "companyName": "Helios", "startDate": "2022-01" },
{ "title": "Field CTO", "companyName": "Vector Systems", "startDate": "2022-01", "current": "1" }
],
"expected": { "title": "Field CTO", "company": "Vector Systems", "confidence": "medium" },
"note": "Same startDate: the role with a true current-flag wins the tie; still medium."
},
{
"name": "tie-start-no-flags-first-listed",
"experiences": [
{ "title": "Fractional CMO", "companyName": "BrightWave", "startDate": "2023-01" },
{ "title": "Fractional CMO", "companyName": "Orbit Metrics", "startDate": "2023-01" }
],
"expected": { "title": "Fractional CMO", "company": "BrightWave", "confidence": "medium" },
"note": "Same startDate, no flags: the role listed first wins (providers list newest first)."
},
{
"name": "unparseable-experiences",
"experiences": "{{not valid json",
"expected": { "title": "", "company": "", "confidence": "low" },
"note": "A cell that fails JSON.parse yields empty title/company, low, reason unparseable-experiences."
},
{
"name": "empty-experiences",
"experiences": [],
"expected": { "title": "", "company": "", "confidence": "low" },
"note": "An empty array yields empty title/company, low."
}
]
}