From 31ea56fe4f6937b23f790d112ae2c19068cb6690 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nguy=E1=BB=85n=20Tu=E1=BA=A5n=20Anh?= Date: Sun, 6 Dec 2026 09:08:02 +0700 Subject: [PATCH 1/6] fix(mcp): correct DirectoryPath cross-project claim MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Nguyễn Tuấn Anh Signed-off-by: Nguyễn Tuấn Anh --- src/basic_memory/mcp/tool_params.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/basic_memory/mcp/tool_params.py b/src/basic_memory/mcp/tool_params.py index 65dcfac07..0695d2e61 100644 --- a/src/basic_memory/mcp/tool_params.py +++ b/src/basic_memory/mcp/tool_params.py @@ -41,7 +41,7 @@ validation_alias=AliasChoices("path", "dir_name", "folder"), description=( "A directory in the project, e.g. 'specs' or 'specs/active'. '/' is the " - "project root; '/path' addresses another project." + "project root; '/path' must agree with the project parameter." ), ), ] From d242a10ed3c02df2826344863fa8ef3e85095438 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nguy=E1=BB=85n=20Tu=E1=BA=A5n=20Anh?= Date: Sun, 6 Dec 2026 09:10:04 +0700 Subject: [PATCH 2/6] fix(mcp): correct ProjectPrefixConflictError recovery hint MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Nguyễn Tuấn Anh --- src/basic_memory/mcp/project_context.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/basic_memory/mcp/project_context.py b/src/basic_memory/mcp/project_context.py index 5c8419b0a..c325e16ce 100644 --- a/src/basic_memory/mcp/project_context.py +++ b/src/basic_memory/mcp/project_context.py @@ -1859,8 +1859,8 @@ async def resolve_project_path_route( ) raise ProjectPrefixConflictError( f"path names project '{detected}' but project '{explicit}' was passed — " - f"use '{detected}/' alone, or project='{explicit}' with a " - "project-relative path" + f"use project='{detected}' with a project-relative path, or " + f"project='{explicit}' with a project-relative path" ) if detected is not None: From 472ad634929d06820581ba77d550ab556063ee88 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nguy=E1=BB=85n=20Tu=E1=BA=A5n=20Anh?= Date: Sun, 6 Dec 2026 09:11:52 +0700 Subject: [PATCH 3/6] test(mcp): update conflict-message assertion for new recovery hint MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Nguyễn Tuấn Anh --- tests/mcp/test_project_path_routing.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/mcp/test_project_path_routing.py b/tests/mcp/test_project_path_routing.py index e6f858680..c06a80f21 100644 --- a/tests/mcp/test_project_path_routing.py +++ b/tests/mcp/test_project_path_routing.py @@ -396,8 +396,8 @@ async def test_conflicting_prefix_raises_naming_both(multi_project_config): assert str(excinfo.value) == ( "path names project 'second-project' but project 'My Research' was passed — " - "use 'second-project/' alone, or project='My Research' with a " - "project-relative path" + "use project='second-project' with a project-relative path, or " + "project='My Research' with a project-relative path" ) From 896ac1a870b73485e54dd3616086e849f2914c05 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nguy=E1=BB=85n=20Tu=E1=BA=A5n=20Anh?= Date: Sun, 6 Dec 2026 09:13:05 +0700 Subject: [PATCH 4/6] docs(man): correct bm-list path cross-project claim MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Nguyễn Tuấn Anh --- src/basic_memory/man/man3/bm-list(3).md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/basic_memory/man/man3/bm-list(3).md b/src/basic_memory/man/man3/bm-list(3).md index 66462c350..ba12f3155 100644 --- a/src/basic_memory/man/man3/bm-list(3).md +++ b/src/basic_memory/man/man3/bm-list(3).md @@ -38,7 +38,7 @@ The shell counterpart is ls(1). ## PARAMETERS - **project** (string, required) — Required project name, 'workspace/project', or project external id. Discover projects with bm_project_list(). Paths are relative to this project; a qualified path must agree with it. -- **path** (string, optional, default: "/") — A directory in the project, e.g. 'specs' or 'specs/active'. '/' is the project root; '/path' addresses another project. +- **path** (string, optional, default: "/") — A directory in the project, e.g. 'specs' or 'specs/active'. '/' is the project root; '/path' must agree with the project parameter. - **glob** (string | null, optional, default: None) — File-name glob, e.g. '*.md' or '*meeting*'. - **sort** (string | null, optional, default: None) — File order. Folders always come first. - **page** (integer, optional, default: 1) — Page number. From a3c5dd097dcec70842796f0aa782826058475899 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nguy=E1=BB=85n=20Tu=E1=BA=A5n=20Anh?= Date: Sun, 6 Dec 2026 09:14:04 +0700 Subject: [PATCH 5/6] docs(man): correct bm-find path cross-project claim MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Nguyễn Tuấn Anh --- src/basic_memory/man/man3/bm-find(3).md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/basic_memory/man/man3/bm-find(3).md b/src/basic_memory/man/man3/bm-find(3).md index 7f931cdee..1cbc1a54e 100644 --- a/src/basic_memory/man/man3/bm-find(3).md +++ b/src/basic_memory/man/man3/bm-find(3).md @@ -37,7 +37,7 @@ The shell counterpart is find(1). ## PARAMETERS - **project** (string, required) — Required project name, 'workspace/project', or project external id. Discover projects with bm_project_list(). Paths are relative to this project; a qualified path must agree with it. -- **path** (string, optional, default: "/") — A directory in the project, e.g. 'specs' or 'specs/active'. '/' is the project root; '/path' addresses another project. +- **path** (string, optional, default: "/") — A directory in the project, e.g. 'specs' or 'specs/active'. '/' is the project root; '/path' must agree with the project parameter. - **name** (string | null, optional, default: None) — File-name glob, e.g. '*.md'. Not with `filters`. - **filters** (object | null, optional, default: None) — Frontmatter filters as {field: condition}. Nested fields use dot notation ("schema.confidence"). A condition is a value for equality ({"status": "draft"}), null for absent-or-null ({"owner": null}), a list for contains-all ({"tags": ["a", "b"]}), or an operator object with $gt, $gte, $lt, $lte, $in, $between, $contains or $exists, e.g. {"priority": {"$in": ["high"]}}. Several operators on one field AND together. - **fields** (array | null, optional, default: None) — Frontmatter fields to return per note (dot paths allowed), e.g. ["title", "priority"]. Needs `filters`. From 45d2f8a88d9630d9466cd46d5ffc1b09ce2981c5 Mon Sep 17 00:00:00 2001 From: phernandez Date: Sun, 6 Dec 2026 11:18:20 -0600 Subject: [PATCH 6/6] fix(mcp): name both ways out of a project prefix conflict The hint now says to pass the other project, or keep this one and drop the prefix. Adds the changelog entry. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01CMYVKz9DguvH7PfmUPwps2 Signed-off-by: phernandez --- CHANGELOG.md | 5 +++++ src/basic_memory/mcp/project_context.py | 4 ++-- tests/mcp/test_project_path_routing.py | 4 ++-- tests/test_publish_skills_release.py | 4 +++- 4 files changed, 12 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4f73ea1d0..5442ccd8b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -115,6 +115,11 @@ installs only patch releases; minor and major releases are announced with and auto-update and its hints pass `--prerelease=if-necessary-or-explicit`, which replaces the setting uv saved from an older install (#2164, #2177). +- The `bm_list` and `bm_find` `path` description no longer says `/path` + reaches another project; the prefix must agree with `project`. The conflict error + now suggests passing the other project instead of leaving `project` out, which the + schema does not allow (#2218, #2232). Thanks @anhnt256. + - **A workspace-qualified project or a cloud external ID now reaches that cloud project, even when a local project has the same name.** `--project /` or a cloud project's external ID, in a `bm_*` MCP tool or a `bm tool` command, used to diff --git a/src/basic_memory/mcp/project_context.py b/src/basic_memory/mcp/project_context.py index c325e16ce..25e5cdf2a 100644 --- a/src/basic_memory/mcp/project_context.py +++ b/src/basic_memory/mcp/project_context.py @@ -1859,8 +1859,8 @@ async def resolve_project_path_route( ) raise ProjectPrefixConflictError( f"path names project '{detected}' but project '{explicit}' was passed — " - f"use project='{detected}' with a project-relative path, or " - f"project='{explicit}' with a project-relative path" + f"pass project='{detected}', or keep project='{explicit}' and drop the " + f"'{detected}/' prefix" ) if detected is not None: diff --git a/tests/mcp/test_project_path_routing.py b/tests/mcp/test_project_path_routing.py index c06a80f21..ff9b75a95 100644 --- a/tests/mcp/test_project_path_routing.py +++ b/tests/mcp/test_project_path_routing.py @@ -396,8 +396,8 @@ async def test_conflicting_prefix_raises_naming_both(multi_project_config): assert str(excinfo.value) == ( "path names project 'second-project' but project 'My Research' was passed — " - "use project='second-project' with a project-relative path, or " - "project='My Research' with a project-relative path" + "pass project='second-project', or keep project='My Research' and drop the " + "'second-project/' prefix" ) diff --git a/tests/test_publish_skills_release.py b/tests/test_publish_skills_release.py index 97f674151..e555acd34 100644 --- a/tests/test_publish_skills_release.py +++ b/tests/test_publish_skills_release.py @@ -123,7 +123,9 @@ def test_a_failed_upload_changes_nothing_live(archives: dict[str, Path]) -> None def test_next_run_recovers_from_an_interrupted_one(archives: dict[str, Path]) -> None: - release = FakeRelease(_live(list(CONTRACT), "old"), fail_on=("rename", "basic-memory-chatgpt.zip")) + release = FakeRelease( + _live(list(CONTRACT), "old"), fail_on=("rename", "basic-memory-chatgpt.zip") + ) with pytest.raises(RuntimeError): publish_skills_release.publish(release, archives)