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
…rt is the whole lookup and returns a finished outcome so a hit never parks on a handle a vendor could strand, one POST carries nothing but the profile URL, its balance is a real read of the free credits endpoint, and its sixty-a-minute budget is a courtesy fifth of the three hundred the entry plan publishes per organisation
…art posts one linkedin_url and returns the vendor's id, poll_once reads it back while the search runs at 202, only valid and invalid settle a lookup, a lookup_failed LinkedIn status defers because the vendor bills nothing for it, an unknown or expired handle answers 500 rather than 404 so it defers too, and its hundred-and-twenty-a-minute budget leaves the free account read outside it while status shows a real balance
…gainst the vendor's own homepage today, which says fifty credits free and no credit card, so the README, the configuration table and the find-leads skill all carry the number an operator will actually see after signing up
This branch has not been deployed
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.
Supersedes #3. This branch carries that PR's commit plus two more, so the whole stack lands or falls together and #3 can be closed.
What and why
The waterfall had two finders behind a provider seam whose only job was to pick one. This branch makes the seam do three things: choose by price, admit a finder that answers in one request, and admit a cheaper asynchronous one.
Three commits, in order:
provider.pygrows_providers()and sorts the keyed adapters byUNIT_COST_USD, soactive()selects the cheapest that has a key and the rest of the chain follows. FullEnrich arrives as the second asynchronous adapter at0.055per contact. This is the pricing seam, not an architecture change, which is the point of it.0.0198per hit, so it sorts ahead of FullEnrich.openoutfind/enrichment/leadmagic.pymakesstartthe whole lookup: one POST returns aLookupcarrying a terminatedPollOutcome, a hit lands onRESOLVEDwithout the deal enteringFINDING_EMAIL, and nothing parks on a handle a vendor could strand. There is deliberately nopoll_once, and a test asserts it is absent so a later edit cannot reintroduce a poll a synchronous vendor will never answer.0.017, so it now sorts first.openoutfind/enrichment/enrow.pyis asynchronous and polled:POST /email/find/singlewith only the profile URL returns a handle,GET /email/find/single?id=…answers202while running and200with the address and qualification when done.The resulting chain by price is
enrow 0.017,leadmagic 0.0198,fullenrich 0.055,bettercontact 0.075.provider.chain()walks it, so an install holding every key tries the cheapest first and steps over a finder that cannot run.Enrow's answer is three-sided, and the adapter keeps the sides apart
Enrow distinguishes "no address exists" from "we could not look". Collapsing them would burn the deal, so they are mapped separately:
qualification: "valid"is an address. Anything else, includinginvalid, is a miss.linkedin_status: "lookup_failed"is transient and free, so it raisesEnrowUnavailableand the deal is deferred to the next walk rather than marked as having no address.profile_not_found,no_current_companyandemail_not_foundare real misses.404; an unknown or expired handle comes back as500, which is read as "not settled yet" and deferred.401isPROVIDER_AUTH,402isPROVIDER_OUT_OF_CREDITS,429backs off exponentially. Each is a couldn't-run the walk steps over, so the next finder is tried rather than the deal being failed.Spend and data boundaries
REQUIRED_DISCOVERY_FIELDSis unchanged, so a LeadMagic-only or Enrow-only install can resolve a known profile URL but cannot search.UNIT_COST_USDon this branch is the price of a hit, not of an attempt. Enrow bills one credit for a found address, a quarter credit for a LinkedIn search that finds nothing, and nothing when its own lookup fails. LeadMagic bills only on a valid address and nothing on429.credit_balanceis a real read of a free endpoint in both new adapters (GET /v1/creditsfor LeadMagic,GET /account/infofor Enrow), floored to anintand exempt from the request budget because the vendor documents those calls as free.statustherefore shows a true number instead ofunknown.60per minute for LeadMagic against the 300 the entry plan publishes,120per minute for Enrow against its documented 10 per second on the single-search POST. Both windows are shared module state and are cleared between tests.openoutfind/core/config.pygainsleadmagic_api_keyandenrow_api_key.Validation
.venv/bin/python -m pytest -q(Python 3.13.13) in 260.38s, no failures. The 45 warnings are the existing sklearn convergence notices in the walk suite.start, the absence ofpoll_once, that only the profile URL is sent, every HTTP refusal, the floored and exempt balance, the request budget,is_configuredand the signup URL.start,202read as still running,linkedin_status: "lookup_failed"as a deferral and not a miss, the three real misses,500on an unknown handle,401and402, the balanced credit count, the request budget with the free account read exempt,is_configuredand the signup URL.tests/test_provider.pyasserts the real roster and its price order, that the chain skips adapters without a key, and thatactive()lands on Enrow when every key is present.CLAUDE.mdandARCHITECTURE.mdare synchronized, including the per-file inventory entries forenrichment/leadmagic.pyandenrichment/enrow.py, the env keys, the status-tablecreditsrow and the budget sizes.