From 2293f77b1aefcc793e658d047164ac243b778dec Mon Sep 17 00:00:00 2001 From: Daniel Yudelevich Date: Mon, 19 Oct 2026 18:43:42 -0700 Subject: [PATCH] Release 0.6.1: discover relevance, InsufficientBalanceError, footprint default 25 Bump the SDK and CLI to 0.6.1, date the changelog section and add the API's new min_digital_footprint default of 25. The platform release is live, so request models are regenerated from the production spec: relevance no longer needs the hand edit, and question_seq leaves PENDING_PROPERTIES. gen_requests.py --check and check_contract.py are clean against prod. --- CHANGELOG.md | 4 ++-- packages/discolike-cli/pyproject.toml | 4 ++-- packages/discolike/pyproject.toml | 2 +- .../discolike/src/discolike/_generated/requests.py | 6 +++--- packages/discolike/src/discolike/_version.py | 2 +- packages/discolike/tests/test_package.py | 2 +- scripts/gen_requests.py | 14 +------------- uv.lock | 2 +- 8 files changed, 12 insertions(+), 24 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e1e941f..0733078 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,11 +1,11 @@ # Changelog -## Unreleased +## 0.6.1 (2026-10-19) +- SDK/CLI: discover's server-side default for `min_digital_footprint` drops from 50 to 25 when the field is omitted, so lists include more real companies with a thin web presence. Pass `min_digital_footprint=50` (CLI `--min-digital-footprint 50`) to keep the old floor. No SDK change; older versions get the new default too. - SDK/CLI: the API now prices every billed request before it runs and refuses one the remaining balance cannot cover with a 403 whose `detail` is an object (`code: "INSUFFICIENT_BALANCE"`, `message`, `remaining_usd`, `max_affordable_records`, `requested_records`, `upgrade_url`). The SDK raises it as the new `InsufficientBalanceError`, a `PlanAccessError` subclass, so existing `except PlanAccessError` handlers still catch it; its message is the server's `message`, and `max_affordable_records`, `remaining_usd`, `requested_records` and `upgrade_url` are attributes, counted in the request's own size unit (records, or contacts, companies, domains, rows, queries or personas for requests sized by those; the message names it), so a caller can retry at `max_affordable_records`. Only a 403 carrying that code raises it. A request the API could not price answers 503 (`ServerError`), which the SDK retries automatically on GET calls. Any other object `detail` with a `message` now uses that message instead of the raw JSON. The CLI exits 3 with `"code": "insufficient_balance"` and adds `max_affordable_records` and `remaining_usd` to the error JSON. Older SDK versions raise a plain `PlanAccessError` whose message is the JSON body. - SDK/CLI: `DiscoverParams.relevance` (`MAX_RELEVANCE`, `BALANCED` or `MAX_COVERAGE`) picks where a discover list stops by estimated ICP fit: `MAX_RELEVANCE` returns the tightest list, `MAX_COVERAGE` the longest, stopping where fit drops too low. Left unset it is not sent and the list has no automatic stop. The CLI's `discover` and `bulk companies` gain `--relevance`. It needs an API release that knows the field; an older API ignores it. - SDK/CLI: `variance` on discover is deprecated; the API maps its old values onto `relevance`, which wins when both are sent. Use `relevance`. It is dropped from `DiscoverParams`, but passing it still sends it and raises a `DeprecationWarning`, and the SDK no longer checks its value. The CLI keeps `--variance` so existing scripts run, with help marking it deprecated. -- SDK (note for maintainers): `relevance`, and the removal of `variance`, were written into `discolike/_generated/requests.py` by hand ahead of the platform deploy, so `scripts/gen_requests.py --check` and `scripts/check_contract.py` report them until it lands. Regenerate once the production spec serves them. ## 0.6.0 (2026-10-12) diff --git a/packages/discolike-cli/pyproject.toml b/packages/discolike-cli/pyproject.toml index 5ec2b3e..c25eae5 100644 --- a/packages/discolike-cli/pyproject.toml +++ b/packages/discolike-cli/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "hatchling.build" [project] name = "discolike-cli" -version = "0.6.0" +version = "0.6.1" description = "Official CLI for the DiscoLike API" readme = "README.md" license = "MIT" @@ -12,7 +12,7 @@ license-files = ["LICENSE"] requires-python = ">=3.11" authors = [{ name = "DiscoLike", email = "support@discolike.com" }] dependencies = [ - "discolike==0.6.0", + "discolike==0.6.1", "typer>=0.26.1,<0.28", "rich>=13.0", ] diff --git a/packages/discolike/pyproject.toml b/packages/discolike/pyproject.toml index 9ad1bcd..507ad99 100644 --- a/packages/discolike/pyproject.toml +++ b/packages/discolike/pyproject.toml @@ -33,7 +33,7 @@ classifiers = [ ] [project.optional-dependencies] -cli = ["discolike-cli==0.6.0"] +cli = ["discolike-cli==0.6.1"] [project.urls] Homepage = "https://www.discolike.com" diff --git a/packages/discolike/src/discolike/_generated/requests.py b/packages/discolike/src/discolike/_generated/requests.py index 5aa1bb9..a519c7d 100644 --- a/packages/discolike/src/discolike/_generated/requests.py +++ b/packages/discolike/src/discolike/_generated/requests.py @@ -1759,7 +1759,7 @@ class DiscoverParams(DiscolikeRequest): min_digital_footprint: Annotated[ int | None, Field( - description="Minimum digital footprint score (0-800). Default 50.", + description="Minimum digital footprint score (0-800). Default 25.", ge=0, le=800, title="Min Digital Footprint", @@ -2099,7 +2099,7 @@ class DiscoverParams(DiscolikeRequest): relevance: Annotated[ Literal["MAX_RELEVANCE", "BALANCED", "MAX_COVERAGE"] | None, Field( - description="Where the list stops, by estimated ICP fit: MAX_RELEVANCE gives the tightest list, BALANCED the middle, MAX_COVERAGE the longest (stops where fit drops too low). Omit for no automatic stop.", + description="How far down the ranked list results go before the estimated ICP fit drops too low. Applies to lookalike searches (icp_text or domain). MAX_RELEVANCE stops earliest with the tightest fit, BALANCED goes further, MAX_COVERAGE serves the longest list. Omit for no automatic stop.", title="Relevance", ), ] = None @@ -2385,7 +2385,7 @@ class CountParams(DiscolikeRequest): min_digital_footprint: Annotated[ int | None, Field( - description="Minimum digital footprint score (0-800). Default 50.", + description="Minimum digital footprint score (0-800). Default 25.", ge=0, le=800, title="Min Digital Footprint", diff --git a/packages/discolike/src/discolike/_version.py b/packages/discolike/src/discolike/_version.py index 906d362..43c4ab0 100644 --- a/packages/discolike/src/discolike/_version.py +++ b/packages/discolike/src/discolike/_version.py @@ -1 +1 @@ -__version__ = "0.6.0" +__version__ = "0.6.1" diff --git a/packages/discolike/tests/test_package.py b/packages/discolike/tests/test_package.py index a6bf703..afc8344 100644 --- a/packages/discolike/tests/test_package.py +++ b/packages/discolike/tests/test_package.py @@ -2,4 +2,4 @@ def test_version() -> None: - assert discolike.__version__ == "0.6.0" + assert discolike.__version__ == "0.6.1" diff --git a/scripts/gen_requests.py b/scripts/gen_requests.py index 162c341..ae1d189 100644 --- a/scripts/gen_requests.py +++ b/scripts/gen_requests.py @@ -100,19 +100,7 @@ # Properties the SDK ships before the deployed spec has them. Merged in only while the spec # lacks them, so each entry clears itself once the platform release lands -- generation prints # the ones that have, to be deleted here. -PENDING_PROPERTIES: dict[str, dict[str, dict[str, Any]]] = { - "ProspectingMessageRequest": { - "question_seq": { - "anyOf": [{"minimum": 1, "type": "integer"}, {"type": "null"}], - "default": None, - "description": ( - "The seq of the question message whose suggested reply this is; the reply answers that question " - "only, never a newer one." - ), - "title": "Question Seq", - } - } -} +PENDING_PROPERTIES: dict[str, dict[str, dict[str, Any]]] = {} # Properties generated from this schema rather than the spec's, whatever the spec says. The # platform's sub-industry enum lists parent-qualified keys only; a bare label reaches it through diff --git a/uv.lock b/uv.lock index 429b470..38b08de 100644 --- a/uv.lock +++ b/uv.lock @@ -343,7 +343,7 @@ dev = [ [[package]] name = "discolike-cli" -version = "0.6.0" +version = "0.6.1" source = { editable = "packages/discolike-cli" } dependencies = [ { name = "discolike" },