Repository navigation
fix(cli): allow disposable doctor project under configured root - #1324
mikemikimike wants to merge 2 commits into
Conversation
Signed-off-by: mikemikimike <[email protected]>
|
Validation evidence: |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 63c5f0ca74
ℹ️ About Codex in GitHub
Codex has been enabled to automatically 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 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| ) | ||
| # Doctor creates a disposable project inside the configured project root. | ||
| # It must be allowed to coexist with the existing root project. | ||
| if not name.startswith("doctor-"): |
There was a problem hiding this comment.
Delete the disposable doctor's files during cleanup
When BASIC_MEMORY_PROJECT_ROOT is configured and an existing project owns that root, this exemption lets doctor write its API and manual test notes beneath the existing project's directory. However, _delete_doctor_project() calls ProjectClient.delete_project(project_id) with the default delete_notes=False, and the fallback cleanup likewise removes only configuration/database state. Every successful doctor run therefore leaves canonical test Markdown under the configured root, where the enclosing project can index it as user knowledge; cleanup must remove the exact doctor directory as well as its registration.
AGENTS.md reference: AGENTS.md:L156-L160
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Fixed in 8e471e7. Doctor cleanup now requests delete_notes=true, so the disposable project directory and its canonical Markdown are removed.
| ) | ||
| # Doctor creates a disposable project inside the configured project root. | ||
| # It must be allowed to coexist with the existing root project. | ||
| if not name.startswith("doctor-"): |
There was a problem hiding this comment.
Restrict the nesting exemption to trusted doctor calls
For any ordinary API, CLI, or MCP create whose user-controlled name starts with doctor-, this skips all nested-path checks, even when BASIC_MEMORY_PROJECT_ROOT is unset. Such a caller can register a second project at or beneath an existing project's path; because project paths are not database-unique, both projects then operate on the same files, and deleting either with delete_notes=true can remove the other's canonical content. Pass an explicit trusted doctor-only capability or narrowly validate the exact disposable path instead of treating a public naming prefix as authorization to cross the project isolation boundary.
AGENTS.md reference: AGENTS.md:L391-L395
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Fixed in 8e471e7. Regular project creation always enforces nested-path isolation. The configured-root doctor flow now uses a dedicated server-generated disposable project endpoint, so user-provided doctor-* names cannot authorize nesting.
Signed-off-by: mikemikimike <[email protected]>
Add the tests the salvaged #1324 commits were missing: the service-level nested-under-root regression for #1323 (including directory cleanup via delete_notes), the doctor endpoint's 201 and 400 responses (dropping the pragma on its now-tested error path), and the typed client's doctor call. Also record the fix in the v0.23.1 changelog entry. Co-Authored-By: Claude Fable 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01G4rbaeHJN3L7CREp5v38J9 Signed-off-by: phernandez <[email protected]>
|
Landed via #1327 with your commits and authorship preserved (cherry-picked so the full CI suite could run — fork PRs skip most of it). Test coverage for the new endpoint, service method, and client call was added on top, and the fix ships in v0.23.1, releasing today. Thanks for the well-designed fix — the keyword-only allow_nested with the server-generated name was exactly the right shape for the isolation boundary. |
Fixes #1323\n\nAllow doctor-owned disposable projects to be created beneath BASIC_MEMORY_PROJECT_ROOT while preserving nested path validation for normal projects.\n\nTests: uv run --frozen pytest -q tests/services/test_project_service.py -k nested --no-cov