fix(core): scope episode KG cleanup by namespace - #309
Conversation
|
Important Approval pendingCodeRabbit has no unresolved comments, but it has not reviewed the latest commit. Use the checkbox below to review the latest commit. CodeRabbit will approve the changes if it finds no blocking issues.
Comment |
|
Claude finished @wshobson's task in 3m 15s —— View job Claude PR Review
The core fix — adding One finding (defense-in-depth completeness), left as an inline comment: The fix is incomplete. In the same
Suggested change to the "DELETE FROM kg_triples \
WHERE namespace_id = ?2 \
AND passage_id IN (SELECT id FROM observation_memories \
WHERE episode_id = ?1 AND namespace_id = ?2)"Other notes
Not blocking, but I'd close the |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: f15cb74115
ℹ️ 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".
|
Claude finished @wshobson's task in 1m 43s —— View job Claude PR Review
The new commit What changed since the last review
Correctness sweep of the remaining deletes in this function (all still sound):
Tests
Note: I could not run Nothing blocking — this resolves the P1 raised by both the earlier review and Codex. |
|
@codex review |
|
Codex Review: Didn't find any major issues. Delightful! 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". |
Summary
Measured reachability
The supported storage path was tested with one episode UUID reused across two namespaces. On both SQLite and live Postgres with enforced RLS, deleting observations in namespace A removed only A's observation and preserved namespace B's observation. The cross-namespace effect reproduced only for manually seeded SQLite knowledge-graph associations, so the supported-path security stop did not trigger.
Verification
cargo test -p pensyve-corePENSYVE_TEST_DATABASE_URL=<isolated-test-db> cargo test -p pensyve-core --features postgrescargo clippy -p pensyve-core --all-targets --features postgres -- -D warningscargo fmt --all -- --checkgit diff --check origin/main...HEADThe repo-wide
make checkadditionally reaches an existing unknown-Clippy-lint error inpensyve-mcp-tools/src/server.rs, outside this PR's allowed scope. The changed crate's stricter all-targets Postgres-feature Clippy command above is clean.Addresses #281. This intentionally avoids an auto-close keyword because the issue's deployment and production-smoke gates remain after merge.