fix(mcp): stop a same-named note from being read as its own project - #1460
Conversation
split_project_permalink_prefix matches a leading path segment against a project's permalink via generate_permalink, which drops file extensions. A single-segment identifier whose stem equals its project's name (e.g. moby-dick.txt in project moby-dick) therefore collapsed to the project's own permalink with an empty remainder, and cat/find refused it with "names a project, not a note" instead of resolving the note -- the layout the literary-analysis skill prescribes (<work>.txt in project <work>). A prefix claim that would leave no remainder now requires the raw segment to spell the permalink exactly, extension included. A claim that still has a remainder after it is unaffected -- extension stripping there was never wrong, since a project name never carries a real extension in that position. Fixes basicmachines-co#1458 Signed-off-by: mmaxjr <mmaxmjunior@gmail.com>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 0f2f73f964
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Signed-off-by: phernandez <paul@basicmachines.co>
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 82e0223541
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Signed-off-by: phernandez <paul@basicmachines.co>
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: c2c0dcbb21
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Signed-off-by: phernandez <paul@basicmachines.co>
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: b8bae86978
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Signed-off-by: phernandez <paul@basicmachines.co>
|
@codex review |
|
Codex Review: Didn't find any major issues. Nice work! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
Fixes #1458.
What changes
split_project_permalink_prefixmatches leading path segments against known project permalinks. Becausegenerate_permalinknormally drops file extensions, a single-segment note whose file stem equals its project name—such asmoby-dick.txtin projectmoby-dick—was mistaken for the project root. POSIX reads then rejected it as a project rather than reading the note.The permalink-only parser now preserves an extension when a match would consume the entire identifier. That prevents
moby-dick.txtfrom matching project permalinkmoby-dick; qualified paths such asmoby-dick/moby-dick.txtand bare project permalinks such asmoby-dickcontinue to work.Project mount routing also retains exact display-name identity before falling back to permalink parsing. This matters for a valid project literally named
docs.txt: the exact identifierdocs.txtstill routes to that project root even though its permalink isdocs. The mount table is the correct layer for this exception because it knows both the display name and permalink; the generic parser cannot distinguish that project from a note using strings alone.Workspace-qualified routing applies the same identity check against the projects discovered inside that workspace, so
team/docs.txtcan name the root of an extension-bearing project without weakening the permalink-only parser.Testing
second-project.txtstays a note insidesecond-project.docs.txtproject name still routes to its project root.team/docs.txtroutes the same project root.uv run pytest tests/mcp/test_project_path_routing.py -q— 71 passed.just fast-check— Ruff checks and formatting passed; after installing the repository'smilvusextra, the fullty check src tests test-intpassed.Other