Skip to content

Email finder: CLI command group, known_pattern, contract-checked routes, examples folder - #5

Merged
quantumdark merged 4 commits into
developmentfrom
feature/cli-email
Aug 21, 2026
Merged

Email finder: CLI command group, known_pattern, contract-checked routes, examples folder#5
quantumdark merged 4 commits into
developmentfrom
feature/cli-email

Conversation

@quantumdark

@quantumdark quantumdark commented Aug 19, 2026

Copy link
Copy Markdown
Contributor

What

  • CLI: new discolike email group - find (with --known-pattern), find-batch (CSV and/or repeatable --contact), results (find or verify batches), job; each with --wait/--no-wait polling. 14 new tests.
  • SDK: email.find accepts known_pattern (sync + async), omitted from the body when unset, matching the platform's POST /email/find.
  • Contract: email routes dropped openapi=False - the platform now exposes /email/find, /email/find/batch, and the poll routes in its OpenAPI spec (discolike-platform 69c2f5a80 on development).
  • Examples: new examples/ folder - match_crm_contacts.py (bulk-match a CRM CSV to personas: chunked, resumable checkpointing that retries failed chunks, domain keys from both website and email columns), find_emails_from_csv.py, discover_and_enrich.py. Referenced from the README; the docs site SDK guide links here too (docs MR 17).

Verification

  • 301 tests pass across both packages; ruff + ty clean; all examples compile and --help works.
  • check_contract.py --spec run against a spec generated from platform development: 48 routes checked, 0 skipped, all match.

Note for CI

The contract job checks the dev spec - it needs the platform development deploy (69c2f5a80) to be live on api.dev first. If the job ran before that, re-run it.

Greptile Summary

The PR adds the email-finder CLI and SDK support, enables contract checking for email routes, and introduces runnable workflow examples. The latest changes also revise CRM query chunking and preserve terminal email failures in CSV output, although failed contacts remain unidentifiable.

  • Adds single and batch email-finder CLI commands with polling support.
  • Adds known_pattern to synchronous and asynchronous SDK calls.
  • Adds CSV, CRM matching, and discovery/enrichment examples.
  • Packs CRM bulk-match requests by expanded query count.

Confidence Score: 4/5

The PR is not yet safe to merge because failed email-batch contacts remain unidentifiable in the generated CSV.

The attempted failure-output fix preserves an error row but replaces its contact identity with blank values, preventing users from determining which submitted contact failed or retrying it accurately.

Files Needing Attention: examples/find_emails_from_csv.py

Important Files Changed

Filename Overview
examples/find_emails_from_csv.py The failure branch now emits a CSV row, but blank contact fields leave failed inputs unidentifiable.
examples/match_crm_contacts.py The revised packing logic keeps expanded queries within the 500-query API limit while preserving each row’s queries in one chunk.
packages/discolike-cli/src/discolike_cli/email.py Adds email find, batch, result, and job commands with input limits and optional polling.
packages/discolike/src/discolike/resources/email.py Adds optional known-pattern support and enables OpenAPI contract validation for email routes.
packages/discolike-cli/tests/test_email_cli.py Covers the new CLI commands, validation paths, polling, output, and authentication handling.

Fix all with Greploop Fix All in Claude Code Fix All in Codex

Prompt To Fix All With AI
### Issue 1
examples/find_emails_from_csv.py:76-78
**Failed contacts lose their identity**

When a terminal batch item has `result=None`, this branch writes empty first-name, last-name, and domain fields instead of correlating the failure with its submitted contact, causing an anonymous CSV row that users cannot correct or retry accurately.

---

For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.

Reviews (2): Last reviewed commit: "fix(examples): cap bulk-match chunks by ..." | Re-trigger Greptile

Greptile also left 1 inline comment on this PR.

Yegor Dolgopolov added 3 commits August 19, 2026 13:13
find (with --known-pattern), find-batch from CSV and/or repeatable
--contact, results (find or verify batches), and job - each with
--wait/--no-wait polling. 14 tests.
…t check

known_pattern matches the platform's POST /email/find body and is omitted
when unset. The platform now exposes the email find/poll routes in its
OpenAPI spec, so the openapi=False stamps are gone and check_contract.py
validates the routes and params like every other resource.
match_crm_contacts.py (bulk-match a CRM CSV to personas with resumable
checkpointing and website+email domain keys), find_emails_from_csv.py,
and discover_and_enrich.py, referenced from the README.
Comment thread examples/match_crm_contacts.py Outdated
Comment thread examples/find_emails_from_csv.py
…l jobs in output

Rows expand to up to two queries (website + email domain), so chunking by
row count could send up to 1,000 queries against the 500-per-call limit.
Chunks are now packed by expanded query count, rows never split across
calls. In find_emails_from_csv, terminal jobs with no result carried only
item.error and vanished from the CSV; they now write a row with their
status and error.
Comment on lines +76 to +78
writer.writerow(
{
"first_name": "",

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Failed contacts lose their identity

When a terminal batch item has result=None, this branch writes empty first-name, last-name, and domain fields instead of correlating the failure with its submitted contact, causing an anonymous CSV row that users cannot correct or retry accurately.

Prompt To Fix With AI
This is a comment left during a code review.
Path: examples/find_emails_from_csv.py
Line: 76-78

Comment:
**Failed contacts lose their identity**

When a terminal batch item has `result=None`, this branch writes empty first-name, last-name, and domain fields instead of correlating the failure with its submitted contact, causing an anonymous CSV row that users cannot correct or retry accurately.

---

For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.

Fix in Claude Code Fix in Codex

@quantumdark
quantumdark merged commit 0c4eece into development Aug 21, 2026
8 checks passed
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