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/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`. 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. diff --git a/src/basic_memory/mcp/project_context.py b/src/basic_memory/mcp/project_context.py index 5c8419b0a..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 '{detected}/' alone, or 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/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." ), ), ] diff --git a/tests/mcp/test_project_path_routing.py b/tests/mcp/test_project_path_routing.py index e6f858680..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 'second-project/' alone, 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)