Repository navigation
Conversation
… holds configured/active/chain/by_name, FullEnrich joins BetterContact as a second adapter whose bare profile URL is a complete query and whose credit_balance raises because the vendor exposes none, and lookup._submit walks the chain with every ProviderUnavailable stepped over, a terminal miss ending it
Author
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What and why
The email finder was BetterContact or nothing. This adds FullEnrich as a second adapter and lets the pipeline pick whichever keyed finder is cheaper, so an operator holding both keys pays the lower unit cost without changing a command.
openoutfind/enrichment/provider.pynow holds the choice:configured()lists the finders that have a key,active()returns the cheapest of them,chain()returns the active finder followed by the rest sorted by cost, andby_name()resolves a name recorded on a deal. Cost comes from each module'sUNIT_COST_USD(bettercontact0.075,fullenrich0.055), read throughgetattrwith an infinite default so a future adapter that forgets the constant sorts last rather than crashing the selection.openoutfind/enrichment/fullenrich.pyis the new adapter and mirrors the BetterContact surface:start,is_configured,credit_balance,submit,poll_once,FullEnrichUnavailable,SIGNUP_URL,UNIT_COST_USD, a sharedRequestBudget, and a retrying session. A bare profile URL is a complete query on FullEnrich's side, sosubmittakes the URL and nothing else.credit_balanceraises, because FullEnrich exposes no balance endpoint;statusrenders that asunknownrather than inventing a number.lookup._submitwalksprovider.chain()instead of calling BetterContact directly. EveryProviderUnavailableis stepped over and the next finder tried, because each typed refusal (401, 402, exhausted 429, transport failure) is a couldn't-run rather than an answer. A terminal miss ends the walk. A hit or a pending job records the finder'sNAMEon the deal socheck_lookuppolls the right vendor back.Spend and data boundaries
REQUIRED_DISCOVERY_FIELDSis deliberately unchanged, so a FullEnrich key alone buys email lookups but cannot start the free discovery planner. FullEnrich has no people-search here.RequestBudget(15, 60.0, label="fullenrich")is shared module state with no exempt request, unlike BetterContact's account read. The per-file autouse fixture clears the window between tests so a slow file cannot leak its spent slots into the next one.poll_oncemaps the vendor status honestly:RATE_LIMITandCREDITS_INSUFFICIENTsurface as typed refusals,CANCELEDis a miss,FINISHEDreadscontact_info, and anything else includingUNKNOWNis still running. OnlyDELIVERABLEandHIGH_PROBABILITYcount as a usable address, so a catch-all is never written to a lead._requestcallsraise_for_status(), so a 5xx surfaces as a failure the walk can step over instead of being read as a pending job that is polled forever.Validation
.venv/bin/python -m pytest -q(Python 3.13.13), three consecutive runs (172s, 107s, 145s). The 45 warnings are the existing sklearn convergence notices in the walk suite; the slow items are pre-existing.is_configured, the signup URL), 15 provider tests for the cost ordering and the chain, and 11 additions to the BetterContact tests for the budget label and the exempt account read.CLAUDE.mdandARCHITECTURE.mdare synchronized, including the per-file inventory entries forenrichment/fullenrich.pyandenrichment/provider.py.