Refuse a missing `project_id` when more than one project is visible, and reject an unknown workspace qualifier
Observed behavior
On a shared local Basic Memory server with eight visible projects and a global default_project set:
read_note(identifier="<title>")withproject_idandprojectomitted did not refuse. It resolved through the server default/hierarchy and returned notes from a different project.read_note(project="bogus-workspace/homelab")did not refuse. The unknown workspace qualifier was ignored and the note from thehomelabproject was returned.read_note(project="<other-name>", project_id="<exact-homelab-uuid>")correctly returned thehomelabnote, soproject_idprecedence works.- An invalid UUID and an invalid project name both returned
Project not found: '<value>'. No wrong-project write was observed.
Expected behavior
The tool contract should fail closed for project selection:
- If
project_idis omitted and more than one project is visible, refuse with a readable error instead of resolving a default. - If a workspace qualifier is unknown, refuse once instead of silently ignoring it.
- If a project name is ambiguous, refuse and name the exact IDs or ask for
project_id. - A valid exact
project_idcontinues to win.
Why it matters
This server is shared by multiple agents and projects. A caller that forgets project_id currently reads a different project without any error. That is a silent cross-project read, and it undermines a one-project-per-agent binding contract. A wrong-project write was not demonstrated, but the read path is not fail-closed.
Suggested change
Add a strict project-binding mode (ideally the default for a multi-project server) that enforces the rules above at the tool boundary, and return a stable typed error plus the candidate project IDs. A config switch is acceptable if the strict behavior is reachable without a code fork.
Repro notes
No secrets, customer content, or credentials are needed. The behavior reproduces with any two visible projects and an omitted project_id.
The missing-project half is fixed in 1.0: the bm_* tools require project. The unknown-workspace half needs Cloud, because only Cloud knows which workspace was routed. Tracked in https://github.com/basicmachines-co/basic-memory-cloud/issues/3124.
Closing. The missing-project half shipped in 1.0, and the unknown-workspace half is tracked in Cloud: https://github.com/basicmachines-co/basic-memory-cloud/issues/3124