Repository navigation
test(cortex): pin that erasing only a proxied tenant's node never purges it - #313
Conversation
…ges it On the proxied wire an erase of a tenant's user node purges the whole tenant only when it also reaches every descendant and every kind. The kinds case was tested; the exact-reach case was not, so dropping the descendants check went unnoticed.
|
Warning Review limit reached
This review includes 1 billable file and costs up to $0.25. Or wait 52 minutes for your next included review. View limit details
Comment |
Tiny Sweeper reviewReviewed head: Verdict: Ready for maintainer review · Priority: none Diagnostics and supporting detailsFull summaryPull request purpose (title): test(cortex): pin that erasing only a proxied tenant's node never purges it. Tiny Sweeper completed its review; deterministic results follow. Review snapshot
Completeness: Complete What changedAdds one test, `erasing_only_the_tenant_node_does_not_purge_the_tenant`, to the proxied engine test module. It stores a learning at `user:alice` and one at `user:alice/agent:helper` under the same tenant, erases only the `user:alice` node with `Reach::exact`, and asserts no purge request was sent, the descendant learning survives (event count drops from 2 to 1), and all requests still name the tenant. The test uses existing helpers in the same file; no production code is modified. Features
TestsNo supported feature-to-test mapping was produced. Test execution is not inferred. FindingsNo active actionable findings. Before mergeNone. Agent review detailscritique
security
tests
commits
description
Evidence and run details
|
Summary
Test only. On the proxied wire, an erase that targets a tenant's
user:<id>node purges the whole tenant (POST v1/tenant/purge) only when it reaches every descendant and every kind. A narrower erase goes scope by scope. The kinds case is already tested. The exact-reach case, the tenant node only with no descendants, was not. Without it, losing thedescendantscheck would let a single-scope erase wipe the tenant's whole memory.The new test stores a learning at
user:aliceand one atuser:alice/agent:helper, then erasesReach::exact("user:alice"). No purge may be sent, and the agent's learning below must survive.Related issue
None. Found in an edge-case audit (a coverage gap; the behaviour is correct).
API or behavior changes
None.
Validation
Commands actually run, with their outcome:
cargo fmt --all -- --check. rustfmt--check(edition 2024) passed on the touched file. CI runs the full check.cargo clippy --all-targets --all-features -- -D warnings. Left to CI.cargo build --all-targets --all-features. Left to CI.cargo test -p tinymemory-integrations --lib erasing_only_the_tenant_node_does_not_purge_the_tenant:&& req.reach.descendantsremoved fromis_whole_tenant: FAILED on the "no tenant purge" assertion. Restored by copy.Tests
New
erasing_only_the_tenant_node_does_not_purge_the_tenantin the proxied engine tests.Documentation
Not needed (test only).
Checklist
#[allow(...)],#[ignore], or relaxed lints.envcontents in the diff or the description