From 20b22254443af1f9dd3f70454d1983545ad9ecd2 Mon Sep 17 00:00:00 2001 From: BukeLy Date: Sun, 31 May 2026 21:23:19 +0800 Subject: [PATCH] fix(pifs): surface projection dimension mismatches --- pageindex/filesystem/cli.py | 3 +-- tests/test_pifs_cli.py | 18 ++++++++++++++++++ 2 files changed, 19 insertions(+), 2 deletions(-) diff --git a/pageindex/filesystem/cli.py b/pageindex/filesystem/cli.py index e808d32..7f91cda 100644 --- a/pageindex/filesystem/cli.py +++ b/pageindex/filesystem/cli.py @@ -162,8 +162,7 @@ def _parse_agent_command( def _filesystem_from_workspace(workspace: str) -> PageIndexFileSystem: filesystem = PageIndexFileSystem(Path(workspace).expanduser()) - with contextlib.suppress(Exception): - filesystem.configure_existing_projection_retrieval() + filesystem.configure_existing_projection_retrieval() return filesystem diff --git a/tests/test_pifs_cli.py b/tests/test_pifs_cli.py index 491cbb9..3b27156 100644 --- a/tests/test_pifs_cli.py +++ b/tests/test_pifs_cli.py @@ -25,6 +25,24 @@ def test_cli_workspace_configures_existing_projection_retrieval(monkeypatch, tmp assert filesystem.projection_retrieval_configured is True +def test_cli_workspace_surfaces_projection_dimension_mismatch(monkeypatch, tmp_path): + import pytest + + from pageindex.filesystem import cli + + class MismatchedFileSystem: + def __init__(self, workspace): + self.workspace = Path(workspace) + + def configure_existing_projection_retrieval(self): + raise RuntimeError("summary projection index dimension mismatch: rebuild") + + monkeypatch.setattr(cli, "PageIndexFileSystem", MismatchedFileSystem) + + with pytest.raises(RuntimeError, match="dimension mismatch"): + cli._filesystem_from_workspace(str(tmp_path / "workspace")) + + def test_cli_passthrough_invokes_pifs_command_executor(monkeypatch, capsys, tmp_path): from pageindex.filesystem import cli