Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down
2 changes: 1 addition & 1 deletion docs/docs.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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" },
],
},
Expand Down
2 changes: 1 addition & 1 deletion docs/migrations/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 |
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
# Migrating to the unreleased version

<!-- When cutting the release, rename this directory to the version (e.g. `v1_2/v1_2.md`) and update the link in `docs/migrations/README.md` and `CHANGELOG.md`. -->
# Migrating to v1.3

## Breaking change: user API key replaced by OAuth tokens

Expand Down
6 changes: 3 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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",
Expand Down Expand Up @@ -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}"
Expand Down
18 changes: 10 additions & 8 deletions src/sourcerykit/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
10 changes: 5 additions & 5 deletions uv.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading