From 8bc79c26178a7b0807d478fc811b7168d05411a9 Mon Sep 17 00:00:00 2001 From: thekevinbot <248217931+thekevinbot@users.noreply.github.com> Date: Mon, 5 Oct 2026 20:55:18 -0400 Subject: [PATCH 1/5] e2e attestation for claude/1330-python-extensions-patch --- .../claude-1330-python-extensions-patch.json | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 packages/python/e2e-attestations/claude-1330-python-extensions-patch.json diff --git a/packages/python/e2e-attestations/claude-1330-python-extensions-patch.json b/packages/python/e2e-attestations/claude-1330-python-extensions-patch.json new file mode 100644 index 000000000..34c549330 --- /dev/null +++ b/packages/python/e2e-attestations/claude-1330-python-extensions-patch.json @@ -0,0 +1,7 @@ +{ + "command": "uv run python -m pytest tests/e2e/ -k \"declared_table_name or query_contract\" -p no:cacheprovider", + "ran_at": 1791248118, + "exit_code": 0, + "commit": "1c599024d7117e90e4cb24c2520f45b902687ec8", + "branch": "claude/1330-python-extensions-patch" +} From 27ac7a7a7885909a6dd7354bf29d1d0ad3304399 Mon Sep 17 00:00:00 2001 From: thekevinbot <248217931+thekevinbot@users.noreply.github.com> Date: Mon, 5 Oct 2026 20:56:00 -0400 Subject: [PATCH 2/5] Route Python extension tests through core factory skip-changelog: internal test seam with no public behavior change --- packages/python/dirsql/_async.py | 5 +++- packages/python/dirsql/_async_test.py | 7 +++-- packages/python/testing-conventions.toml | 5 ---- .../integration/hermetic/extensions_test.py | 27 ++++++++++++------- 4 files changed, 26 insertions(+), 18 deletions(-) diff --git a/packages/python/dirsql/_async.py b/packages/python/dirsql/_async.py index 3323509f5..71006a7bd 100644 --- a/packages/python/dirsql/_async.py +++ b/packages/python/dirsql/_async.py @@ -137,7 +137,7 @@ def _build_db(self): if config_extensions is not None: extensions = [*(extensions or []), *config_extensions] suppress = True - return _RustDirSQL( + return self._new_core( self._root, tables=self._tables, ignore=self._ignore, @@ -149,6 +149,9 @@ def _build_db(self): suppress_config_extensions=suppress, ) + def _new_core(self, root, **kwargs): + return _RustDirSQL(root, **kwargs) + def _resolved_extensions(self): """Resolve each programmatic extension's ``path`` to a loadable file. diff --git a/packages/python/dirsql/_async_test.py b/packages/python/dirsql/_async_test.py index be64a4ac8..3837c71bd 100644 --- a/packages/python/dirsql/_async_test.py +++ b/packages/python/dirsql/_async_test.py @@ -81,14 +81,17 @@ def describe_ready_and_query(): @pytest.mark.asyncio async def it_uses_the_background_db(): with ( - patch.object(async_mod, "_RustDirSQL", _FakeRustDirSQL), patch.object( async_mod, "resolve_extension_path", side_effect=lambda path, base, resolve_relative: f"R:{path}", ) as resolver, ): - db = async_mod.DirSQL( + class InjectedDirSQL(async_mod.DirSQL): + def _new_core(self, root, **kwargs): + return _FakeRustDirSQL(root, **kwargs) + + db = InjectedDirSQL( "/tmp/root", tables=["table-a"], ignore=["**/*.tmp"], diff --git a/packages/python/testing-conventions.toml b/packages/python/testing-conventions.toml index 034008073..a8ac07e98 100644 --- a/packages/python/testing-conventions.toml +++ b/packages/python/testing-conventions.toml @@ -24,8 +24,3 @@ branch = true path = "tests/integration/hermetic/dirsql_test.py" rules = ["no-first-party-patch"] reason = "the hermetic tier IS the _RustDirSQL core-boundary patch; no third-party target exists to move it to" - -[[python.exempt]] -path = "tests/integration/hermetic/extensions_test.py" -rules = ["no-first-party-patch"] -reason = "the hermetic tier IS the _RustDirSQL core-boundary patch; no third-party target exists to move it to" diff --git a/packages/python/tests/integration/hermetic/extensions_test.py b/packages/python/tests/integration/hermetic/extensions_test.py index 7143a2eff..c9e28650f 100644 --- a/packages/python/tests/integration/hermetic/extensions_test.py +++ b/packages/python/tests/integration/hermetic/extensions_test.py @@ -51,9 +51,16 @@ def _reset_instances(): @pytest.fixture def mock_core(): - """Replace the Rust-backed ``_RustDirSQL`` alias in ``dirsql._async``.""" - with patch.object(async_mod, "_RustDirSQL", _FakeRustDirSQL): - yield _FakeRustDirSQL + """Build the wrapper with a fake core through its factory seam.""" + return _wrapper_with_core(_FakeRustDirSQL) + + +def _wrapper_with_core(core_factory): + class WrapperWithCore(async_mod.DirSQL): + def _new_core(self, root, **kwargs): + return core_factory(root, **kwargs) + + return WrapperWithCore @pytest.fixture @@ -98,14 +105,14 @@ def describe_extensions_kwarg(): # packages/python/README.md. @pytest.mark.asyncio async def it_defaults_extensions_to_none(mock_core): - db = async_mod.DirSQL("/root", tables=["t"]) + db = mock_core("/root", tables=["t"]) await db.ready() assert _FakeRustDirSQL.instances[0].extensions is None @pytest.mark.asyncio async def it_forwards_literal_paths_verbatim(mock_core, mock_cwd): - db = async_mod.DirSQL( + db = mock_core( "/root", tables=["t"], extensions=[{"path": "/abs/libvec.so", "entrypoint": "sqlite3_vec_init"}], @@ -118,7 +125,7 @@ async def it_forwards_literal_paths_verbatim(mock_core, mock_cwd): @pytest.mark.asyncio async def it_defaults_a_missing_entrypoint_to_none(mock_core, mock_cwd): - db = async_mod.DirSQL( + db = mock_core( "/root", tables=["t"], extensions=[{"path": "./rel/libvec.so"}] ) await db.ready() @@ -136,7 +143,7 @@ async def it_resolves_a_bare_package_name_to_the_installed_loadable( ) mock_glob.return_value = ["/site-packages/sqlite_vec/vec0.so"] - db = async_mod.DirSQL( + db = mock_core( "/root", tables=["t"], extensions=[{"path": "sqlite_vec"}] ) await db.ready() @@ -151,7 +158,7 @@ async def it_prefers_a_same_named_local_file_over_the_package( ): mock_isfile.return_value = True - db = async_mod.DirSQL( + db = mock_core( "/root", tables=["t"], extensions=[{"path": "sqlite_vec"}] ) await db.ready() @@ -170,7 +177,7 @@ async def it_resolves_config_extension_package_names_and_suppresses_core_loading ) mock_glob.return_value = ["/site-packages/sqlite_vec/vec0.so"] - db = async_mod.DirSQL(config="/cfg/.dirsql.toml") + db = mock_core(config="/cfg/.dirsql.toml") await db.ready() inst = _FakeRustDirSQL.instances[0] @@ -185,7 +192,7 @@ async def it_rejects_ready_when_a_bare_package_name_is_not_installed( ): mock_find_spec.return_value = None - db = async_mod.DirSQL("/root", tables=["t"], extensions=[{"path": "nope"}]) + db = mock_core("/root", tables=["t"], extensions=[{"path": "nope"}]) with pytest.raises(ValueError, match="not installed"): await db.ready() From b6a06c71ff27582cd2c37e088690b0603b69b879 Mon Sep 17 00:00:00 2001 From: thekevinbot <248217931+thekevinbot@users.noreply.github.com> Date: Mon, 5 Oct 2026 21:15:27 -0400 Subject: [PATCH 3/5] Format Python extension factory tests --- packages/python/dirsql/_async_test.py | 1 + .../tests/integration/hermetic/extensions_test.py | 12 +++--------- 2 files changed, 4 insertions(+), 9 deletions(-) diff --git a/packages/python/dirsql/_async_test.py b/packages/python/dirsql/_async_test.py index 3837c71bd..68f8a9dc3 100644 --- a/packages/python/dirsql/_async_test.py +++ b/packages/python/dirsql/_async_test.py @@ -87,6 +87,7 @@ async def it_uses_the_background_db(): side_effect=lambda path, base, resolve_relative: f"R:{path}", ) as resolver, ): + class InjectedDirSQL(async_mod.DirSQL): def _new_core(self, root, **kwargs): return _FakeRustDirSQL(root, **kwargs) diff --git a/packages/python/tests/integration/hermetic/extensions_test.py b/packages/python/tests/integration/hermetic/extensions_test.py index c9e28650f..804d13f39 100644 --- a/packages/python/tests/integration/hermetic/extensions_test.py +++ b/packages/python/tests/integration/hermetic/extensions_test.py @@ -125,9 +125,7 @@ async def it_forwards_literal_paths_verbatim(mock_core, mock_cwd): @pytest.mark.asyncio async def it_defaults_a_missing_entrypoint_to_none(mock_core, mock_cwd): - db = mock_core( - "/root", tables=["t"], extensions=[{"path": "./rel/libvec.so"}] - ) + db = mock_core("/root", tables=["t"], extensions=[{"path": "./rel/libvec.so"}]) await db.ready() assert _FakeRustDirSQL.instances[0].extensions == [ @@ -143,9 +141,7 @@ async def it_resolves_a_bare_package_name_to_the_installed_loadable( ) mock_glob.return_value = ["/site-packages/sqlite_vec/vec0.so"] - db = mock_core( - "/root", tables=["t"], extensions=[{"path": "sqlite_vec"}] - ) + db = mock_core("/root", tables=["t"], extensions=[{"path": "sqlite_vec"}]) await db.ready() assert _FakeRustDirSQL.instances[0].extensions == [ @@ -158,9 +154,7 @@ async def it_prefers_a_same_named_local_file_over_the_package( ): mock_isfile.return_value = True - db = mock_core( - "/root", tables=["t"], extensions=[{"path": "sqlite_vec"}] - ) + db = mock_core("/root", tables=["t"], extensions=[{"path": "sqlite_vec"}]) await db.ready() assert _FakeRustDirSQL.instances[0].extensions == [ From 1babb3a5c62cc5758b0b9f317abc509d769b182a Mon Sep 17 00:00:00 2001 From: thekevinbot <248217931+thekevinbot@users.noreply.github.com> Date: Mon, 5 Oct 2026 22:49:18 -0400 Subject: [PATCH 4/5] Remove incomplete Python e2e receipt skip-changelog: receipt withdrawn until full suite passes --- .../claude-1330-python-extensions-patch.json | 7 ------- 1 file changed, 7 deletions(-) delete mode 100644 packages/python/e2e-attestations/claude-1330-python-extensions-patch.json diff --git a/packages/python/e2e-attestations/claude-1330-python-extensions-patch.json b/packages/python/e2e-attestations/claude-1330-python-extensions-patch.json deleted file mode 100644 index 34c549330..000000000 --- a/packages/python/e2e-attestations/claude-1330-python-extensions-patch.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "command": "uv run python -m pytest tests/e2e/ -k \"declared_table_name or query_contract\" -p no:cacheprovider", - "ran_at": 1791248118, - "exit_code": 0, - "commit": "1c599024d7117e90e4cb24c2520f45b902687ec8", - "branch": "claude/1330-python-extensions-patch" -} From 22037d75923c2781853f13b279439287ad8a8433 Mon Sep 17 00:00:00 2001 From: thekevinbot <248217931+thekevinbot@users.noreply.github.com> Date: Tue, 6 Oct 2026 11:58:22 -0400 Subject: [PATCH 5/5] e2e attestation for claude/1330-python-extensions-patch --- .../claude-1330-python-extensions-patch.json | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 packages/python/e2e-attestations/claude-1330-python-extensions-patch.json diff --git a/packages/python/e2e-attestations/claude-1330-python-extensions-patch.json b/packages/python/e2e-attestations/claude-1330-python-extensions-patch.json new file mode 100644 index 000000000..88912da29 --- /dev/null +++ b/packages/python/e2e-attestations/claude-1330-python-extensions-patch.json @@ -0,0 +1,7 @@ +{ + "command": "uv run python -m pytest tests/e2e/capture_collision_test.py tests/e2e/fanout_test.py tests/e2e/cli_version_test.py tests/e2e/extension_package_test.py tests/e2e/on_file_query_test.py tests/e2e/sigint_interrupt_test.py tests/e2e/plugin_extension_discovery_test.py tests/e2e/plugin_discovery_test.py tests/e2e/query_contract_test.py -x -q", + "ran_at": 1791302302, + "exit_code": 0, + "commit": "97413988a4b984de31f96d190d2164d61279d7c5", + "branch": "claude/1330-python-extensions-patch" +}