Repository navigation
fix(mcp): validate updates against the expected owner - #1725
Conversation
Use the atomic store owner assertion instead of the MCP process project so shared multi-project servers can update observations. Keep mandatory expected_project validation, align response metadata and docs, and cover mismatched assertions without mutation.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configuration
📒 Files selected for processing (7)
Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 5 remain after this review. 📝 WalkthroughWalkthrough
ChangesObservation ownership assertion
Priority: ➖ Normal Estimated code review effort: 2 (Simple) | ~12 minutes Change: Bug fix Suggested reviewers: Merge Risk: ⚪ Minimal · up to mem_update now validates expected_project against the observation's stored owner, so shared multi-project servers can update observations. Mismatches are still rejected without mutation. Docs and tests cover the change, and no merge-blocking risk is evident. 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)✅ Passed checks (4 passed)Full details: Docstring CoverageExplanation Docstring coverage is 9.09% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 11 functions across 4 files. (3 skipped: 3 unsupported.)
✨ Finishing Touches 💡 1🛠️ Fix failing CI checks 💡
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
9d8413d
🔗 Linked Issue
Closes #1720
🏷️ PR Type
type:bug— Bug fixtype:feature— New featuretype:question— Question requiring tracked worktype:docs— Documentation onlytype:refactor— Code refactoring (no behavior change)type:chore— Maintenance, dependencies, toolingtype:breaking-change— Breaking change📝 Summary
📂 Changes
internal/mcp/mcp.gointernal/mcp/mcp_test.go,internal/mcp/ownership_update_test.goDOCS.md,docs/AGENT-SETUP.md,docs/codebase/memory-core.mdinternal/project/detect.go🧪 Test Plan
go test ./internal/mcp -run 'TestHandleUpdate|TestMutationExpectedProject' -count=1— PASS, including independent verifier execution (exit 0).go test ./internal/mcp ./internal/store ./internal/server ./internal/project -count=1— PASS.git diff --check— PASS; independent static verification — PASS; native risk/readability/reliability review — approved and acknowledged.🤖 Automated Checks
After pushing/opening the PR, GitHub CI runs the broad unit/E2E/lint and applicable platform checks. These automated statuses remain pending until the actual checks run; do not claim a pass from local evidence. Windows checks run for PRs but not merge groups, and are not among the six required contexts. Lint and Check PR Has No Transient Artifacts also run for PRs but are not required contexts; Lint also runs on pushes to main. All required checks must pass before merge:
Closes #N/Fixes #N/Resolves #Nstatus:approvedlabelgo test ./...passesgo test -tags e2e ./internal/server/...passesnpm testpasses inplugin/pi✅ Contributor Checklist
Closes #N)type:*label to this PRCo-Authored-Bytrailers in commits💬 Notes for Reviewers
Single review unit: 559 changed lines (123 additions, 436 deletions), predominantly removal of obsolete process/cwd-guard tests. A maintainer explicitly approved
size:exception; separating the behavior, required test expectation changes, and docs would leave an inconsistent intermediate contract.The owner assertion is not authentication or a permission grant. Remote client authorization remains separate. No store schema changes, save/session resolution changes, or mem_delete implementation changes.
Native review:
review-b95667b64e03d644approved and consumed. Risk: item 2 (ownership guard change), independently verified. Nonblocking coverage note: direct whitespace-only stored-owner MCP coverage was removed; NULL-owner regressions remain and both use the shared normalization guard.Summary by CodeRabbit