From 1904eb6ea1943c1f201ad972183dca67bc7a786e Mon Sep 17 00:00:00 2001 From: SimoneBottoni Date: Thu, 24 Sep 2026 16:17:05 +0200 Subject: [PATCH 1/4] refactor: simplify bootstrap URL retrieval for Provably API and app URLs --- src/sourcerykit/config.py | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/src/sourcerykit/config.py b/src/sourcerykit/config.py index 9d273bd..71b4189 100644 --- a/src/sourcerykit/config.py +++ b/src/sourcerykit/config.py @@ -209,20 +209,22 @@ def _opt_uuid(env_name: str, local_key: str) -> uuid.UUID | None: ) +def _bootstrap_url(env_name: str, json_key: str, default: str) -> str: + """Env, then the global JSON, then *default*; no full settings validation.""" + raw = (os.getenv(env_name) or "").strip().rstrip("/") + if not raw: + raw = str(load_app_dir_config().get(json_key, "")).strip().rstrip("/") + return raw or default + + def get_bootstrap_settings() -> str: """Return the Provably API URL without requiring full settings validation. Safe to call before ``access_token``, ``org_id``, or ``postgres_url`` are configured. """ - raw = (os.getenv("SOURCERYKIT_PROVABLY_API_URL") or "").strip().rstrip("/") - if not raw: - raw = load_app_dir_config().get("provably_api", "").strip().rstrip("/") - return raw or DEFAULT_PROVABLY_API_URL + return _bootstrap_url("SOURCERYKIT_PROVABLY_API_URL", "provably_api", DEFAULT_PROVABLY_API_URL) def get_bootstrap_app_url() -> str: """Return the Provably app URL without requiring full settings validation.""" - raw = (os.getenv("SOURCERYKIT_PROVABLY_APP_URL") or "").strip().rstrip("/") - if not raw: - raw = str(load_app_dir_config().get("provably_app", "")).strip().rstrip("/") - return raw or DEFAULT_PROVABLY_APP_URL + return _bootstrap_url("SOURCERYKIT_PROVABLY_APP_URL", "provably_app", DEFAULT_PROVABLY_APP_URL) From 1a70b816614b886568470a27b8c6864c0fb6569d Mon Sep 17 00:00:00 2001 From: SimoneBottoni Date: Thu, 24 Sep 2026 16:17:10 +0200 Subject: [PATCH 2/4] chore: update provably-sdk dependency to version 0.3.2 --- pyproject.toml | 2 +- uv.lock | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 4e37e91..1b04765 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -47,7 +47,7 @@ dependencies = [ "requests >=2.34", "jsonschema>=4.0", "psycopg[binary]>=3.1", - "provably-sdk>=0.3.1,<1", + "provably-sdk>=0.3.2,<1", "pydantic>=2.6", "python-dotenv>=1.2", "sqlalchemy>=2.0", diff --git a/uv.lock b/uv.lock index ebde15e..af229be 100644 --- a/uv.lock +++ b/uv.lock @@ -1860,7 +1860,7 @@ wheels = [ [[package]] name = "provably-sdk" -version = "0.3.1" +version = "0.3.2" source = { registry = "https://pypi.org/simple" } dependencies = [ { name = "httpx" }, @@ -1868,9 +1868,9 @@ dependencies = [ { name = "pydantic" }, { name = "structlog" }, ] -sdist = { url = "https://files.pythonhosted.org/packages/17/48/8586bacc9a2450a8fc2b20f6aec6e4f1b9c311aa38cd8acae5163cfd78dd/provably_sdk-0.3.1.tar.gz", hash = "sha256:dcbc261ff21b60e77aa43668e744c22bafd9d6f23bce749b7ab6db37a029aa6a", size = 68115, upload-time = "2026-09-23T13:19:15.871Z" } +sdist = { url = "https://files.pythonhosted.org/packages/64/ea/f7691721076846e1ef3e4d25d2faba9cf06c841feb3f9067cd9e21419823/provably_sdk-0.3.2.tar.gz", hash = "sha256:463f3f6da5ccdba8e8f905297a209ca3208652e6d1ae71dba87441a1855c8206", size = 67963, upload-time = "2026-09-24T13:59:56.216Z" } wheels = [ - { url = "https://files.pythonhosted.org/packages/80/0a/ed8f26f908e97e9b4fc90d953211f5e8b4ef48c52430963e773143f0f569/provably_sdk-0.3.1-py3-none-any.whl", hash = "sha256:870e62f1ed4c09e98d78f5d2aacf4abf66d9043ac5c71f24b74921aa2a97e635", size = 26231, upload-time = "2026-09-23T13:19:14.51Z" }, + { url = "https://files.pythonhosted.org/packages/d0/29/b353d8bb38a597b41a68bf988aa049d306bb64a045613e8cb19836ed3f01/provably_sdk-0.3.2-py3-none-any.whl", hash = "sha256:6ce9c253133f90c219f36934ab8244b9e8d57e6a91dd6407c72ea3786b40115b", size = 25978, upload-time = "2026-09-24T13:59:54.802Z" }, ] [[package]] @@ -2476,7 +2476,7 @@ requires-dist = [ { name = "mypy", marker = "extra == 'dev'", specifier = ">=1.10" }, { name = "openai-agents", marker = "extra == 'dev'", specifier = ">=0.0.3" }, { name = "pre-commit", marker = "extra == 'dev'", specifier = ">=4.0" }, - { name = "provably-sdk", specifier = ">=0.3.1,<1" }, + { name = "provably-sdk", specifier = ">=0.3.2,<1" }, { name = "psycopg", extras = ["binary"], specifier = ">=3.1" }, { name = "pydantic", specifier = ">=2.6" }, { name = "pytest", marker = "extra == 'dev'", specifier = ">=8.0" }, From 6a1ceae0a00604f9a421cd91fffc3e040047db96 Mon Sep 17 00:00:00 2001 From: SimoneBottoni Date: Thu, 24 Sep 2026 16:18:03 +0200 Subject: [PATCH 3/4] chore: bump version to 1.3.0 --- pyproject.toml | 4 ++-- uv.lock | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 1b04765..cc506f6 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "hatchling.build" [project] name = "sourcerykit" -version = "1.2.0b2" +version = "1.3.0" description = "Counterspell for hallucinating agents. Python SDK that breaks the illusion on every tool call, API response, and MCP handoff before bad outputs propagate." readme = { file = "README.md", content-type = "text/markdown" } requires-python = ">=3.12" @@ -154,7 +154,7 @@ exclude_also = ["if TYPE_CHECKING:", "raise NotImplementedError", "\\.\\.\\."] sourcerykit = "sourcerykit.cli.main:app" [tool.bumpversion] -current_version = "1.2.0b2" +current_version = "1.3.0" commit = false tag = false tag_name = "v{new_version}" diff --git a/uv.lock b/uv.lock index af229be..240499e 100644 --- a/uv.lock +++ b/uv.lock @@ -2423,7 +2423,7 @@ wheels = [ [[package]] name = "sourcerykit" -version = "1.2.0b2" +version = "1.3.0" source = { editable = "." } dependencies = [ { name = "aiohttp" }, From 3b6c5be54412433fa3a93b40c50f0844eb8d01ad Mon Sep 17 00:00:00 2001 From: SimoneBottoni Date: Thu, 24 Sep 2026 16:22:04 +0200 Subject: [PATCH 4/4] chore: update changelog and migration documentation for v1.3 release --- CHANGELOG.md | 4 +++- docs/docs.config.ts | 2 +- docs/migrations/README.md | 2 +- docs/migrations/{unreleased/unreleased.md => v1_3/v1_3.md} | 4 +--- 4 files changed, 6 insertions(+), 6 deletions(-) rename docs/migrations/{unreleased/unreleased.md => v1_3/v1_3.md} (90%) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7909cbc..914c448 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,8 +2,10 @@ ## Unreleased +## 1.3.0 + ### Breaking changes -- **User API key removed in favor of OAuth tokens** — authentication now uses `PROVABLY_ACCESS_TOKEN` (auto-refreshed via `PROVABLY_REFRESH_TOKEN`); the verify path uses the collection integration key. Existing users must re-run `sourcerykit init`. See the [migration guide](docs/migrations/unreleased/unreleased.md). +- **User API key removed in favor of OAuth tokens** — authentication now uses `PROVABLY_ACCESS_TOKEN` (auto-refreshed via `PROVABLY_REFRESH_TOKEN`); the verify path uses the collection integration key. Existing users must re-run `sourcerykit init`. See the [migration guide](docs/migrations/v1_3/v1_3.md). - **OAuth browser-only login** — `--register`, `--email`, and `--password` are removed; login is browser OAuth (PKCE) only. New accounts are created on the Provably web app during login. - **Provably API client moved to [`provably-sdk`](https://pypi.org/project/provably-sdk/)** — `sourcerykit.provably` is gone; import from `provably` instead (e.g. `from provably import ProvablyError`, `from provably.service import service`). `ProvablyError` no longer subclasses `SourceryKitError`; catch it explicitly. sourcerykit configures the SDK on import. diff --git a/docs/docs.config.ts b/docs/docs.config.ts index d6ee625..088d3c9 100644 --- a/docs/docs.config.ts +++ b/docs/docs.config.ts @@ -54,7 +54,7 @@ const config: RootConfig = { icon: "ArrowUpFromLine", pages: [ { id: "index", icon: "BookMarked" }, - { id: "unreleased", icon: "GitBranch" }, + { id: "v1_3", icon: "GitBranch" }, { id: "v1_0", icon: "GitBranch" }, ], }, diff --git a/docs/migrations/README.md b/docs/migrations/README.md index 7da7a46..a362fbb 100644 --- a/docs/migrations/README.md +++ b/docs/migrations/README.md @@ -4,7 +4,7 @@ Upgrade guides for SourceryKit releases. Each guide covers breaking changes, new | Version | Action | Guide | |---|---|---| -| [Unreleased](unreleased/unreleased.md) | `sourcerykit init` | Breaking: API key → OAuth tokens; browser-only login | +| [v1.3](v1_3/v1_3.md) | `sourcerykit init` | Breaking: API key → OAuth tokens; browser-only login | | [v1.1](v1_1/v1_1.md) | `sourcerykit upgrade` | Breaking: `reasoning` → `answer`; schema change (traces.answer) | | [v1.0.1](https://github.com/ProvablyAI/sourcerykit/blob/main/CHANGELOG.md#101) | `pip install --upgrade sourcerykit` | No schema change | | [v1.0](v1_0/v1_0.md) | `sourcerykit upgrade` | Full migration from previous versions | diff --git a/docs/migrations/unreleased/unreleased.md b/docs/migrations/v1_3/v1_3.md similarity index 90% rename from docs/migrations/unreleased/unreleased.md rename to docs/migrations/v1_3/v1_3.md index 726feb8..a949411 100644 --- a/docs/migrations/unreleased/unreleased.md +++ b/docs/migrations/v1_3/v1_3.md @@ -1,6 +1,4 @@ -# Migrating to the unreleased version - - +# Migrating to v1.3 ## Breaking change: user API key replaced by OAuth tokens