:hedgehog: PostHog is the leading platform for building self-driving products. Our developer tools – AI observability, analytics, session replay, flags, experiments, error tracking, logs, and more – capture all the context agents need to diagnose problems, uncover opportunities, and ship fixes. Steer it all from Slack, web, desktop, or the MCP.
Python ab-testingai-analyticsanalyticscdpdata-warehouseexperimentsfeature-flagsjavascriptproduct-analyticspythonreactsession-replaysurveystypescriptweb-analytics
feat(warehouse_sources): support lovable API version 2026-09-11 (#113236)
Tom Owers0108a8cd318f
diff --git a/.agents/skills/warehouse-source-new-version/SKILL.md b/.agents/skills/warehouse-source-new-version/SKILL.mdindex 377e380f8e51..b1fc20c87b25 100644--- a/.agents/skills/warehouse-source-new-version/SKILL.md+++ b/.agents/skills/warehouse-source-new-version/SKILL.md@@ -96,6 +96,8 @@ The opposite gap also occurs: a reference rendered from one version-blind OpenAP- When a vendor dates each endpoint separately and rejects a date an endpoint was not published under, the source label is a baseline, not the header value. An endpoint published after the baseline sends its own published date under that pin, so store the selector per endpoint.- A vendor alias that resolves to the newest version (`latest`, `current`, an undated `stable`) is not a version label. Never declare it in `supported_versions` or point `default_version` at it: a pin that moves under a running sync is the same drift, now written down as a supported choice.- First-time versioning of a source that sends no version selector today: keep the pre-existing label (the `UNVERSIONED_API_VERSION` default) sending nothing, and add the selector only for the new dated label. That preserves already-pinned rows byte-for-byte, and pinning the new default is the point — the no-selector path was tracking the vendor account's configured version, which is the drift. This is not the fallthrough bug above: the empty selector here is deliberate and belongs to one specific legacy label, not a `.get()` miss.+- That no-selector legacy path is byte-identical, not frozen: when the vendor resolves a missing selector to the new label (an "oldest supported" or "only stable" default), legacy pins already receive the new wire today. Call out in the PR which legacy requests the new wire no longer serves, rather than implying those pins still work.+- When the default version's table set shrinks, descriptions for tables kept only on older versions no longer appear in default discovery, so `test_source_catalog_invariants.py` fails until the source joins `DESCRIPTIONS_NOT_IN_SCHEMAS`. Keep those descriptions, because the older pins still render them.- Parallel version-bump PRs grab the same next migration number; the second to merge becomes a conflicting leaf and `ci:preflight` blocks it. Check `max_migration.txt` and renumber.- Don't regenerate schemas for existing customers as part of a version add; schema changes only apply to rows repinned via the (human-run) migration.- Discovery diffs under the SOURCE pin (`sync_new_schemas`, `refresh_schemas`, bulk sync-defaults). A schema-level `api_version` override on a version whose table set differs from the source's version can be disabled/soft-deleted by that diff — keep overrides to short verification windows, not as a long-term way to hold one table on another version.diff --git a/products/warehouse_sources/backend/temporal/data_imports/sources/lovable/canonical_descriptions.py b/products/warehouse_sources/backend/temporal/data_imports/sources/lovable/canonical_descriptions.pyindex abcc5f4f5cb1..7fae2934d71e 100644--- a/products/warehouse_sources/backend/temporal/data_imports/sources/lovable/canonical_descriptions.py+++ b/products/warehouse_sources/backend/temporal/data_imports/sources/lovable/canonical_descriptions.py@@ -1,7 +1,7 @@"""Canonical, documentation-sourced descriptions for Lovable endpoints and columns.Sourced from the Lovable API v1 reference (https://api.lovable.dev/v1/docs). Keyed by the resource-names in `settings.py` `LOVABLE_ENDPOINTS`, which match the `ExternalDataSchema.name` of a synced+names in `settings.py` `LOVABLE_VERSIONS`, which match the `ExternalDataSchema.name` of a syncedLovable table. Columns absent here fall back to LLM enrichment."""@@ -34,9 +34,10 @@ CANONICAL_DESCRIPTIONS: CanonicalDescriptions = {"id": "Project ID.","workspace_id": "Workspace the project belongs to.","user_id": "Project owner user ID.",- "name": "Project slug.",+ "owner_id": "Project owner user UUID.",+ "name": "Project name. A slug under API version v1, the human-readable name from 2026-09-11.","display_name": "Human-readable project name.",- "description": "Description supplied by the caller on create or update.",+ "description": "Under API version v1, the description supplied on create or update. From 2026-09-11, the AI-written summary of what the project does.","generated_description": "AI-written summary of what the project does. Absent until the agent has completed a response for the project.","project_type": "Project type: project or library.","tech_stack": "Project tech stack.",@@ -44,6 +45,7 @@ CANONICAL_DESCRIPTIONS: CanonicalDescriptions = {"visibility": "Project visibility: draft, private, workspace_view, or public.","is_published": "Whether the project is published.","publish_visibility": "Published visibility: public or private.",+ "publish_audience": "Who can open the published app. Null while the app is not published.","url": "Published project URL.","folder_id": "Folder the project belongs to, if any.","latest_screenshot_url": "URL of the latest screenshot.",@@ -54,12 +56,14 @@ CANONICAL_DESCRIPTIONS: CanonicalDescriptions = {},},"WorkspaceMembers": {- "description": "A member of a Lovable workspace, including pending invites.",+ "description": "A member of a Lovable workspace. API version v1 also lists pending invites.","docs_url": _DOCS_URL,"columns": {"workspace_id": "Workspace the membership belongs to.","user_id": "Stable identifier for the entry: the user ID for active members, the membership row ID for pending invites.","display_name": "User display name as stored on the membership.",+ "name": "Member display name. Null when unavailable.",+ "type": "Identity type, such as user.","email": "Member email as stored on the membership. For pending invites this is the invited email.","role": "Workspace role: owner, admin, member, viewer, or collaborator.","monthly_credit_limit": "Explicit monthly credit cap for this member. Absent when the workspace default applies.",@@ -104,6 +108,7 @@ CANONICAL_DESCRIPTIONS: CanonicalDescriptions = {"project_id": "Project that was scanned.","workspace_id": "Workspace the project belongs to.","scan_id": "Unique scan invocation ID.",+ "id": "Security scan ID.","status": "Scan status: running, completed, or failed.","trigger_source": "What triggered the scan, such as workflow, user, ui_auto, or workspace_scheduled.","triggered_by": "Actor that triggered the scan.",diff --git a/products/warehouse_sources/backend/temporal/data_imports/sources/lovable/lovable.py b/products/warehouse_sources/backend/temporal/data_imports/sources/lovable/lovable.pyindex 7f8c2065717f..d108b5f78e20 100644--- a/products/warehouse_sources/backend/temporal/data_imports/sources/lovable/lovable.py+++ b/products/warehouse_sources/backend/temporal/data_imports/sources/lovable/lovable.py@@ -17,11 +17,13 @@ from products.warehouse_sources.backend.temporal.data_imports.sources.common.soufrom products.warehouse_sources.backend.temporal.data_imports.sources.common.typings import SourceResponsefrom products.warehouse_sources.backend.temporal.data_imports.sources.lovable.settings import (LOVABLE_API_BASE_URL,- LOVABLE_ENDPOINTS,+ LOVABLE_URL_VERSION_SEGMENT,LovableEndpointConfig,+ version_config,)API_KEY_HEADER = "Lovable-API-Key"+VERSION_HEADER = "Lovable-Version"# Bounded connect/read timeout so a host that accepts the TCP connection but never responds can't# hold an import worker indefinitely.@@ -48,10 +50,15 @@ class _ParentRef:project_id: Optional[str] = None-def _client(api_key: str) -> RESTClient:+def _version_headers(api_version: str) -> dict[str, str]:+ header = version_config(api_version).version_header+ return {VERSION_HEADER: header} if header else {}+++def _client(api_key: str, api_version: str) -> RESTClient:return RESTClient(base_url=LOVABLE_API_BASE_URL,- headers={"Accept": "application/json"},+ headers={"Accept": "application/json", **_version_headers(api_version)},auth=APIKeyAuth(api_key=api_key, name=API_KEY_HEADER, location="header"),# Lovable-API-Key is a custom header, which `requests` does not strip on a cross-origin# redirect, so pin every request to the API host instead of replaying the key elsewhere.@@ -68,8 +75,8 @@ def _paginator() -> JSONResponseCursorPaginator:return JSONResponseCursorPaginator(cursor_path="pagination.next_cursor", cursor_param="cursor")-def _path(api_version: str, config: LovableEndpointConfig, parent: _ParentRef) -> str:- return f"/{api_version}{config.path}".format(+def _path(config: LovableEndpointConfig, parent: _ParentRef) -> str:+ return f"/{LOVABLE_URL_VERSION_SEGMENT}{config.path}".format(workspace_id=parent.workspace_id or "",project_id=parent.project_id or "",)@@ -92,10 +99,9 @@ def _iter_parents(client: RESTClient, api_version: str, config: LovableEndpointCyield _ParentRef()return- workspaces = LOVABLE_ENDPOINTS["Workspaces"]- for workspace in _iter_rows(- client, _path(api_version, workspaces, _ParentRef()), _params(workspaces, _ParentRef())- ):+ endpoints = version_config(api_version).endpoints+ workspaces = endpoints["Workspaces"]+ for workspace in _iter_rows(client, _path(workspaces, _ParentRef()), _params(workspaces, _ParentRef())):workspace_id = workspace.get("id")if not workspace_id:continue@@ -103,11 +109,9 @@ def _iter_parents(client: RESTClient, api_version: str, config: LovableEndpointCyield _ParentRef(workspace_id=workspace_id)continue- projects = LOVABLE_ENDPOINTS["Projects"]+ projects = endpoints["Projects"]workspace_ref = _ParentRef(workspace_id=workspace_id)- for project in _iter_rows(- client, _path(api_version, projects, workspace_ref), _params(projects, workspace_ref)- ):+ for project in _iter_rows(client, _path(projects, workspace_ref), _params(projects, workspace_ref)):project_id = project.get("id")if project_id:yield _ParentRef(workspace_id=workspace_id, project_id=project_id)@@ -167,7 +171,7 @@ def _iter_endpoint()for page in client.paginate(- path=_path(api_version, config, parent),+ path=_path(config, parent),params=_params(config, parent),paginator=_paginator(),data_selector="data",@@ -190,8 +194,8 @@ def lovable_source(endpoint: str,resumable_source_manager: ResumableSourceManager[LovableResumeConfig],) -> SourceResponse:- config = LOVABLE_ENDPOINTS[endpoint]- client = _client(api_key)+ config = version_config(api_version).endpoints[endpoint]+ client = _client(api_key, api_version)return SourceResponse(name=endpoint,@@ -210,8 +214,8 @@ def validate_credentials(api_key: str, api_version: str) -> tuple[bool, str | No# capture=False: the probe's response body carries the caller's real account/workspace# details, which the generic scrubber's name-based denylist won't catch.lambda: make_tracked_session(redact_values=(api_key,), capture=False),- f"{LOVABLE_API_BASE_URL}/{api_version}/me",- headers={API_KEY_HEADER: api_key},+ f"{LOVABLE_API_BASE_URL}/{LOVABLE_URL_VERSION_SEGMENT}{version_config(api_version).probe_path}",+ headers={API_KEY_HEADER: api_key, **_version_headers(api_version)},# The key rides a custom header, which `requests` replays across a cross-origin redirect.allow_redirects=False,)@@ -219,6 +223,13 @@ def validate_credentials(api_key: str, api_version: str) -> tuple[bool, str | Noreturn True, Noneif status_code == 401:return False, "Invalid Lovable API key. Create a new key in Lovable and reconnect."+ if status_code == 402:+ return False, "Lovable's API needs the Business plan or higher. Upgrade the workspace in Lovable and reconnect."+ if status_code == 403:+ return (+ False,+ "This Lovable API key can't read workspaces. Create a key with the workspaces:read scope and reconnect.",+ )return False, "Could not connect to Lovable. Check the API key and try again."@@ -234,9 +245,9 @@ def _probe_status(client: RESTClient, path: str, params: dict[str, Any]) -> intreturn 200-def _first_id(client: RESTClient, api_version: str, config: LovableEndpointConfig, parent: _ParentRef) -> str | None:+def _first_id(client: RESTClient, config: LovableEndpointConfig, parent: _ParentRef) -> str | None:try:- for row in _iter_rows(client, _path(api_version, config, parent), {**_params(config, parent), "limit": 1}):+ for row in _iter_rows(client, _path(config, parent), {**_params(config, parent), "limit": 1}):row_id = row.get("id")if row_id:return str(row_id)@@ -251,16 +262,14 @@ def check_endpoint_permissions(api_key: str, api_version: str, endpoints: list[sMost tables sit behind a Lovable plan tier and answer 402 below it, so probing turns a tablethat could only ever fail into one the schema picker shows as unavailable and leaves off."""- client = _client(api_key)- workspaces = LOVABLE_ENDPOINTS["Workspaces"]- workspace_id = _first_id(client, api_version, workspaces, _ParentRef())+ client = _client(api_key, api_version)+ catalog = version_config(api_version).endpoints+ workspace_id = _first_id(client, catalog["Workspaces"], _ParentRef())# A saved schema whose endpoint left the catalog must not fail the whole schema picker.- known = {name: LOVABLE_ENDPOINTS[name] for name in endpoints if name in LOVABLE_ENDPOINTS}+ known = {name: catalog[name] for name in endpoints if name in catalog}project_id: str | None = Noneif workspace_id and any(config.scope == "project" for config in known.values()):- project_id = _first_id(- client, api_version, LOVABLE_ENDPOINTS["Projects"], _ParentRef(workspace_id=workspace_id)- )+ project_id = _first_id(client, catalog["Projects"], _ParentRef(workspace_id=workspace_id))permissions: dict[str, str | None] = dict.fromkeys(endpoints)for name, config in known.items():@@ -271,7 +280,7 @@ def check_endpoint_permissions(api_key: str, api_version: str, endpoints: list[spermissions[name] = Nonecontinue- status = _probe_status(client, _path(api_version, config, parent), {**_params(config, parent), "limit": 1})+ status = _probe_status(client, _path(config, parent), {**_params(config, parent), "limit": 1})if status == 402:plan = config.minimum_plan or "paid"permissions[name] = f"This table needs Lovable's {plan} plan or higher."diff --git a/products/warehouse_sources/backend/temporal/data_imports/sources/lovable/settings.py b/products/warehouse_sources/backend/temporal/data_imports/sources/lovable/settings.pyindex ac09cedebb16..f5317fedf705 100644--- a/products/warehouse_sources/backend/temporal/data_imports/sources/lovable/settings.py+++ b/products/warehouse_sources/backend/temporal/data_imports/sources/lovable/settings.py@@ -14,6 +14,10 @@ LOVABLE_API_BASE_URL = "https://api.lovable.dev"# Version segment prefixed onto every endpoint path. Lovable also serves a `/v1beta` channel for# preview endpoints (audit logs, message exports); this source only calls the GA one.LOVABLE_API_VERSION_V1 = "v1"+# Dated stable version, selected by the `Lovable-Version` header on the same `/v1` paths.+LOVABLE_API_VERSION_2026_09_11 = "2026-09-11"++LOVABLE_URL_VERSION_SEGMENT = "v1"@frozen@@ -98,8 +102,68 @@ LOVABLE_ENDPOINTS: dict[str, LovableEndpointConfig] = {),}-ENDPOINTS = tuple(LOVABLE_ENDPOINTS.keys())+# 2026-09-11 drops credit history and project collaborators, lists only accepted members, and+# names the scan key `id`. Its project filters already default to every project, so none are sent.+LOVABLE_ENDPOINTS_2026_09_11: dict[str, LovableEndpointConfig] = {+ "Workspaces": LOVABLE_ENDPOINTS["Workspaces"],+ "Projects": LovableEndpointConfig(+ name="Projects",+ path="/projects",+ scope="workspace",+ parent_id_param="workspace_id",+ primary_keys=["id"],+ partition_key="created_at",+ ),+ "WorkspaceMembers": LovableEndpointConfig(+ name="WorkspaceMembers",+ path="/workspaces/{workspace_id}/members",+ scope="workspace",+ primary_keys=["workspace_id", "user_id"],+ page_size=50,+ minimum_plan="Business",+ ),+ "ProjectSecurityScans": LovableEndpointConfig(+ name="ProjectSecurityScans",+ path="/projects/{project_id}/security-scans",+ scope="project",+ primary_keys=["project_id", "id"],+ partition_key="started_at",+ minimum_plan="Business",+ ),+ "ProjectPiiLabels": LOVABLE_ENDPOINTS["ProjectPiiLabels"],+}+++@frozen+class LovableVersionConfig:+ endpoints: dict[str, LovableEndpointConfig]+ # `Lovable-Version` header value. v1 predates dated versions and sends none.+ version_header: str | None+ # Read by the credential probe. 2026-09-11 has no `/me`.+ probe_path: str+++LOVABLE_VERSIONS: dict[str, LovableVersionConfig] = {+ LOVABLE_API_VERSION_V1: LovableVersionConfig(+ endpoints=LOVABLE_ENDPOINTS,+ version_header=None,+ probe_path="/me",+ ),+ LOVABLE_API_VERSION_2026_09_11: LovableVersionConfig(+ endpoints=LOVABLE_ENDPOINTS_2026_09_11,+ version_header=LOVABLE_API_VERSION_2026_09_11,+ probe_path="/workspaces?limit=1",+ ),+}+++def version_config(api_version: str) -> LovableVersionConfig:+ try:+ return LOVABLE_VERSIONS[api_version]+ except KeyError as e:+ raise ValueError(f"Unsupported Lovable API version: {api_version!r}") from e+-# Every v1 list endpoint paginates by opaque cursor with no timestamp filter, so none of these+# Every list endpoint paginates by opaque cursor with no timestamp filter, so none of these# tables can sync incrementally. A run either walks the collection or it skips rows.INCREMENTAL_FIELDS: dict[str, list[IncrementalField]] = {}diff --git a/products/warehouse_sources/backend/temporal/data_imports/sources/lovable/source.py b/products/warehouse_sources/backend/temporal/data_imports/sources/lovable/source.pyindex e829996e07ce..90a9e2ffed64 100644--- a/products/warehouse_sources/backend/temporal/data_imports/sources/lovable/source.py+++ b/products/warehouse_sources/backend/temporal/data_imports/sources/lovable/source.py@@ -28,9 +28,10 @@ from products.warehouse_sources.backend.temporal.data_imports.sources.lovable.lovalidate_credentials as validate_lovable_credentials,)from products.warehouse_sources.backend.temporal.data_imports.sources.lovable.settings import (- ENDPOINTS,INCREMENTAL_FIELDS,+ LOVABLE_API_VERSION_2026_09_11,LOVABLE_API_VERSION_V1,+ version_config,)from products.warehouse_sources.backend.types import ExternalDataSourceType@@ -38,8 +39,8 @@ from products.warehouse_sources.backend.types import ExternalDataSourceType@SourceRegistry.registerclass LovableSource(ResumableSource[LovableSourceConfig, LovableResumeConfig]):lists_tables_without_credentials = True # static endpoint catalog, safe for public docs- supported_versions = (LOVABLE_API_VERSION_V1,)- default_version = LOVABLE_API_VERSION_V1+ supported_versions = (LOVABLE_API_VERSION_V1, LOVABLE_API_VERSION_2026_09_11)+ default_version = LOVABLE_API_VERSION_2026_09_11api_docs_url = "https://api.lovable.dev/v1/docs"@property@@ -51,6 +52,7 @@ class LovableSource(ResumableSource[LovableSourceConfig, LovableResumeConfig]):"401 Client Error": "Your Lovable API key is invalid or has been revoked. Create a new key in Lovable and reconnect.","402 Client Error": "This table needs a higher Lovable plan. Turn it off in the sync settings, or upgrade the workspace in Lovable.","403 Client Error": "Your Lovable API key does not have permission to read this data. Use a key from an account with access, or turn this table off in the sync settings.",+ "410 Client Error": "Lovable has retired the API version this source uses. Contact PostHog support to move the source to a supported version.",}def get_canonical_descriptions(self) -> CanonicalDescriptions:@@ -69,7 +71,9 @@ class LovableSource(ResumableSource[LovableSourceConfig, LovableResumeConfig]):force_refresh: bool = False,api_version: str | None = None,) -> list[SourceSchema]:- return build_endpoint_schemas(ENDPOINTS, INCREMENTAL_FIELDS, names)+ # The table set differs by version, so discovery must follow the source's pin.+ endpoints = tuple(version_config(self.resolve_api_version(api_version)).endpoints)+ return build_endpoint_schemas(endpoints, INCREMENTAL_FIELDS, names)def validate_credentials(self,diff --git a/products/warehouse_sources/backend/temporal/data_imports/sources/lovable/tests/test_lovable.py b/products/warehouse_sources/backend/temporal/data_imports/sources/lovable/tests/test_lovable.pyindex 90e4fd6c4eb5..6c66a359e6e7 100644--- a/products/warehouse_sources/backend/temporal/data_imports/sources/lovable/tests/test_lovable.py+++ b/products/warehouse_sources/backend/temporal/data_imports/sources/lovable/tests/test_lovable.py@@ -71,16 +71,33 @@ def _rows(source_response: Any) -> list[dict[str, Any]]:return [row for page in source_response.items() for row in page]-def _run(endpoint: str, manager: mock.MagicMock | None = None) -> Any:+def _run(endpoint: str, manager: mock.MagicMock | None = None, api_version: str = "v1") -> Any:return lovable_source(api_key="lov_key",- api_version="v1",+ api_version=api_version,endpoint=endpoint,resumable_source_manager=manager or _manager(),)class TestLovableSourceTransport:+ @parameterized.expand(+ [+ ("v1_sends_no_version_header", "v1", {}),+ ("dated_version_pins_the_header", "2026-09-11", {"Lovable-Version": "2026-09-11"}),+ ]+ )+ @mock.patch(CLIENT_SESSION_PATCH)+ def test_version_selects_the_header_on_the_v1_path(+ self, _name: str, api_version: str, expected_headers: dict[str, str], mock_session: mock.MagicMock+ ) -> None:+ urls = _wire(mock_session.return_value, [_page([{"id": "ws-1"}])])++ _rows(_run("Workspaces", api_version=api_version))++ assert urls == ["https://api.lovable.dev/v1/workspaces?limit=100"]+ assert mock_session.return_value.headers == {"Accept": "application/json", **expected_headers}+@mock.patch(CLIENT_SESSION_PATCH)def test_account_endpoint_follows_the_cursor(self, mock_session: mock.MagicMock) -> None:urls = _wire(@@ -138,6 +155,22 @@ class TestLovableSourceTransport:assert "visibility=all" in urls[1]assert "publish_status=any" in urls[1]+ @parameterized.expand(+ [+ ("Projects", "https://api.lovable.dev/v1/projects?limit=100&workspace_id=ws-1"),+ ("WorkspaceMembers", "https://api.lovable.dev/v1/workspaces/ws-1/members?limit=50"),+ ]+ )+ @mock.patch(CLIENT_SESSION_PATCH)+ def test_dated_version_drops_the_filters_it_no_longer_accepts(+ self, endpoint: str, expected_url: str, mock_session: mock.MagicMock+ ) -> None:+ urls = _wire(mock_session.return_value, [_page([{"id": "ws-1"}]), _page([{"id": "row-1"}])])++ _rows(_run(endpoint, api_version="2026-09-11"))++ assert urls[1] == expected_url+@mock.patch(CLIENT_SESSION_PATCH)def test_project_endpoint_fans_out_through_workspaces_and_stamps_both_parents(self, mock_session: mock.MagicMock@@ -174,19 +207,24 @@ class TestLovableSourceTransport:@parameterized.expand([- ("Workspaces", ["id"], "created_at"),- ("Projects", ["id"], "created_at"),- ("WorkspaceMembers", ["workspace_id", "user_id"], "invited_at"),- ("WorkspaceCreditHistory", ["workspace_id", "id"], "occurred_at"),- ("ProjectCollaborators", ["project_id", "user_id"], None),- ("ProjectSecurityScans", ["project_id", "scan_id"], "started_at"),- ("ProjectPiiLabels", ["project_id", "id"], "found_at"),+ ("v1", "Workspaces", ["id"], "created_at"),+ ("v1", "Projects", ["id"], "created_at"),+ ("v1", "WorkspaceMembers", ["workspace_id", "user_id"], "invited_at"),+ ("v1", "WorkspaceCreditHistory", ["workspace_id", "id"], "occurred_at"),+ ("v1", "ProjectCollaborators", ["project_id", "user_id"], None),+ ("v1", "ProjectSecurityScans", ["project_id", "scan_id"], "started_at"),+ ("v1", "ProjectPiiLabels", ["project_id", "id"], "found_at"),+ ("2026-09-11", "Workspaces", ["id"], "created_at"),+ ("2026-09-11", "Projects", ["id"], "created_at"),+ ("2026-09-11", "WorkspaceMembers", ["workspace_id", "user_id"], None),+ ("2026-09-11", "ProjectSecurityScans", ["project_id", "id"], "started_at"),+ ("2026-09-11", "ProjectPiiLabels", ["project_id", "id"], "found_at"),])def test_primary_keys_and_partitioning_per_endpoint(- self, endpoint: str, primary_keys: list[str], partition_key: str | None+ self, api_version: str, endpoint: str, primary_keys: list[str], partition_key: str | None) -> None:- response = _run(endpoint)+ response = _run(endpoint, api_version=api_version)assert response.name == endpointassert response.primary_keys == primary_keys@@ -255,10 +293,44 @@ class TestLovableResume:class TestValidateCredentials:+ @parameterized.expand(+ [+ ("v1", "https://api.lovable.dev/v1/me", {"Lovable-API-Key": "lov_key"}),+ (+ "2026-09-11",+ "https://api.lovable.dev/v1/workspaces?limit=1",+ {"Lovable-API-Key": "lov_key", "Lovable-Version": "2026-09-11"},+ ),+ ]+ )+ @mock.patch(PROBE_SESSION_PATCH)+ def test_probe_targets_an_endpoint_the_version_serves(+ self, api_version: str, expected_url: str, expected_headers: dict[str, str], mock_session: mock.MagicMock+ ) -> None:+ response = Response()+ response.status_code = 200+ mock_session.return_value.get.return_value = response++ assert validate_credentials("lov_key", api_version) == (True, None)+ assert mock_session.return_value.get.call_args.args[0] == expected_url+ assert mock_session.return_value.get.call_args.kwargs["headers"] == expected_headers+@parameterized.expand([("valid", 200, True, None),("bad_key", 401, False, "Invalid Lovable API key. Create a new key in Lovable and reconnect."),+ (+ "plan_too_low",+ 402,+ False,+ "Lovable's API needs the Business plan or higher. Upgrade the workspace in Lovable and reconnect.",+ ),+ (+ "missing_scope",+ 403,+ False,+ "This Lovable API key can't read workspaces. Create a key with the workspaces:read scope and reconnect.",+ ),("server_error", 500, False, "Could not connect to Lovable. Check the API key and try again."),])@@ -275,8 +347,7 @@ class TestValidateCredentials:response.status_code = status_codemock_session.return_value.get.return_value = response- assert validate_credentials("lov_key", "v1") == (expected_valid, expected_message)- assert mock_session.return_value.get.call_args.args[0] == "https://api.lovable.dev/v1/me"+ assert validate_credentials("lov_key", "2026-09-11") == (expected_valid, expected_message)@mock.patch(PROBE_SESSION_PATCH)def test_transport_failure_is_not_valid(self, mock_session: mock.MagicMock) -> None:@@ -324,6 +395,15 @@ class TestCheckEndpointPermissions:assert check_endpoint_permissions("lov_key", "v1", ["RetiredTable"]) == {"RetiredTable": None}+ @mock.patch(CLIENT_SESSION_PATCH)+ def test_table_the_version_dropped_reports_no_reason_without_a_probe(self, mock_session: mock.MagicMock) -> None:+ urls = _wire(mock_session.return_value, [_page([{"id": "ws-1"}])])++ assert check_endpoint_permissions("lov_key", "2026-09-11", ["WorkspaceCreditHistory"]) == {+ "WorkspaceCreditHistory": None+ }+ assert urls == ["https://api.lovable.dev/v1/workspaces?limit=1"]+@mock.patch(CLIENT_SESSION_PATCH)def test_project_scoped_table_probes_a_project(self, mock_session: mock.MagicMock) -> None:urls = _wire(diff --git a/products/warehouse_sources/backend/temporal/data_imports/sources/lovable/tests/test_lovable_source.py b/products/warehouse_sources/backend/temporal/data_imports/sources/lovable/tests/test_lovable_source.pyindex 97d0e343f243..74849e954e1c 100644--- a/products/warehouse_sources/backend/temporal/data_imports/sources/lovable/tests/test_lovable_source.py+++ b/products/warehouse_sources/backend/temporal/data_imports/sources/lovable/tests/test_lovable_source.py@@ -12,7 +12,6 @@ from products.warehouse_sources.backend.temporal.data_imports.sources.generated_LovableSourceConfig,)from products.warehouse_sources.backend.temporal.data_imports.sources.lovable.lovable import LovableResumeConfig-from products.warehouse_sources.backend.temporal.data_imports.sources.lovable.settings import ENDPOINTSfrom products.warehouse_sources.backend.temporal.data_imports.sources.lovable.source import LovableSourceSOURCE_MODULE = "products.warehouse_sources.backend.temporal.data_imports.sources.lovable.source"@@ -38,10 +37,39 @@ class TestLovableSource:assert api_key_field.secret is Trueassert api_key_field.required is True- def test_get_schemas_lists_every_endpoint_as_full_refresh(self) -> None:- schemas = self.source.get_schemas(self.config, team_id=1)+ @parameterized.expand(+ [+ (+ "v1",+ "v1",+ [+ "Workspaces",+ "Projects",+ "WorkspaceMembers",+ "WorkspaceCreditHistory",+ "ProjectCollaborators",+ "ProjectSecurityScans",+ "ProjectPiiLabels",+ ],+ ),+ (+ "dated",+ "2026-09-11",+ ["Workspaces", "Projects", "WorkspaceMembers", "ProjectSecurityScans", "ProjectPiiLabels"],+ ),+ (+ "unpinned_uses_the_default",+ None,+ ["Workspaces", "Projects", "WorkspaceMembers", "ProjectSecurityScans", "ProjectPiiLabels"],+ ),+ ]+ )+ def test_get_schemas_lists_the_pinned_versions_endpoints_as_full_refresh(+ self, _name: str, api_version: str | None, expected: list[str]+ ) -> None:+ schemas = self.source.get_schemas(self.config, team_id=1, api_version=api_version)- assert [schema.name for schema in schemas] == list(ENDPOINTS)+ assert [schema.name for schema in schemas] == expected# No v1 list endpoint takes a timestamp filter, so nothing here can sync incrementally.assert all(not schema.supports_incremental and not schema.supports_append for schema in schemas)assert all(schema.incremental_fields == [] for schema in schemas)@@ -75,11 +103,14 @@ class TestLovableSource:assert manager._data_class is LovableResumeConfig+ @parameterized.expand([("pinned_v1", "v1", "v1"), ("unpinned_uses_the_default", None, "2026-09-11")])@mock.patch(f"{SOURCE_MODULE}.lovable_source")- def test_source_for_pipeline_plumbs_arguments(self, mock_lovable_source: mock.MagicMock) -> None:+ def test_source_for_pipeline_plumbs_arguments(+ self, _name: str, pinned: str | None, expected_version: str, mock_lovable_source: mock.MagicMock+ ) -> None:inputs = mock.MagicMock()inputs.schema_name = "Projects"- inputs.api_version = None+ inputs.api_version = pinnedmanager = mock.MagicMock()self.source.source_for_pipeline(self.config, manager, inputs)@@ -87,7 +118,7 @@ class TestLovableSource:kwargs = mock_lovable_source.call_args.kwargsassert kwargs == {"api_key": "lov_key",- "api_version": "v1",+ "api_version": expected_version,"endpoint": "Projects","resumable_source_manager": manager,}@@ -95,11 +126,11 @@ class TestLovableSource:@mock.patch(f"{SOURCE_MODULE}.validate_lovable_credentials", return_value=(True, None))def test_validate_credentials_resolves_the_api_version(self, mock_validate: mock.MagicMock) -> None:assert self.source.validate_credentials(self.config, team_id=1) == (True, None)- assert mock_validate.call_args.args == ("lov_key", "v1")+ assert mock_validate.call_args.args == ("lov_key", "2026-09-11")@mock.patch(f"{SOURCE_MODULE}.check_endpoint_permissions", return_value={"Projects": None})def test_endpoint_permissions_delegate_to_the_probe(self, mock_check: mock.MagicMock) -> None:assert self.source.get_endpoint_permissions(self.config, team_id=1, endpoints=["Projects"]) == {"Projects": None}- assert mock_check.call_args.args == ("lov_key", "v1", ["Projects"])+ assert mock_check.call_args.args == ("lov_key", "2026-09-11", ["Projects"])diff --git a/products/warehouse_sources/backend/temporal/data_imports/sources/tests/test_source_catalog_invariants.py b/products/warehouse_sources/backend/temporal/data_imports/sources/tests/test_source_catalog_invariants.pyindex 7b2ff60e0884..b7719ba3ff04 100644--- a/products/warehouse_sources/backend/temporal/data_imports/sources/tests/test_source_catalog_invariants.py+++ b/products/warehouse_sources/backend/temporal/data_imports/sources/tests/test_source_catalog_invariants.py@@ -32,6 +32,7 @@ DESCRIPTIONS_NOT_IN_SCHEMAS = {"EZOfficeInventory","Giphy","GoogleSearchConsole",+ "Lovable","OpenWeather","Pexels","ShipStation",