Repository navigation
test(connect): pin scoped filter coverage and created-space profile policy - #230
Conversation
[Low impact] The changes are confined to test coverage and the SQLite reference provider used by tests. The PR appears safe to merge, with a non-blocking test-data mismatch in both narrowing tests. Findings
Fix with agent prompt### Issue 1
packages/spoke-connect-ts/tests/remote/knowledge-face.test.ts:1605
Both new narrowing tests request `entry_types: ["capability"]`, but `entry()` and Rust’s `scoped_entry()` produce `"note"` entries. The calls succeed because the test stores ignore type filters. Adding correct filter checks later would break these success cases.
Use `"note"` in the requested filters, or create `"capability"` entries in both tests. The recorded-scope assertions will still catch dropped filters.
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.SummaryAdds Rust and TypeScript tests that pin requested knowledge filters and applies the declared personality-profile requirement to newly created SQLite test spaces.
Reviews (1) · Last reviewed commit: "test(connect): pin scoped filter coverag..." · Reviewed by Greptile |
✅ Verdict:
|
| Findings | Count |
|---|---|
| 🔴 must-fix | 0 |
| 🟠 should-fix | 0 |
| 🟡 may-fix | 0 |
| 🔵 nit | 0 |
📋 Review
What this PR does: This PR closes the scoped-filter coverage gap and the created-space profile-policy gap. On the Rust side it adds a read-only call_scopes() accessor to the loopback ScopedKnowledgeStore and a test proving the get, put pre-read, and put each receive the requested entry_ids/entry_types narrowing; the TypeScript knowledge-face suite gets the mirrored store-spy assertion. It also factors the reference provider's required-profile policy into one REQUIRED_PROFILE_KINDS constant shared by memory.describe, provisioning, and space creation, and adds a conformance test that a newly created space refuses reflection generation with PROFILE_INCOMPLETE and missing == ["personality"].
Findings
none
Revalidated findings
none
Linked-issue AC
- I-000194 — scoped filter coverage: met; ScopedKnowledgeStore::call_scopes() plus scoped_knowledge_get_put_keep_the_requested_narrowing_filters and the TS keeps the requested entry_ids/entry_types narrowing on get and put case pin the requested narrowing across get, put pre-read, and put. (Issue text is not present in the review packet; the criterion is taken from the PR description.)
- I-000195 — created-space profile policy: met; one REQUIRED_PROFILE_KINDS = ["personality"] constant feeds memory.describe, provisioning, and the Space built by create_space, and created_space_applies_the_required_profile_policy asserts PROFILE_INCOMPLETE with details.missing == ["personality"]. (Issue text is not present in the review packet; the criterion is taken from the PR description.)
✅ Verified
- ✅ Settled review outcome: verdict ship it, 100% (mergeable), zero findings across must-fix/should-fix/may-fix/nit.
- ✅ Diff inspection in this seat: the new Rust accessor and both new test cases exist and assert the narrowing and profile-policy behavior described; REQUIRED_PROFILE_KINDS is referenced by memory.describe, provision_space, and create_space.
- ❓ cargo +nightly test -p spoke-connect --features remote-adapter --test remote_loopback scoped_knowledge — PR description claims 11 passed; no command output appears in the review document.
- ❓ cargo +nightly test -p spoke-connect --features remote-adapter --test memory_conformance — PR description claims 9 passed; not evidenced in the review document.
- ❓ cargo +nightly test -p spoke-connect --features remote-adapter --test sqlite_provider — PR description claims 81 passed; not evidenced in the review document.
- ❓ pnpm -F @42ch/spoke-connect test — PR description claims 654 passed across 40 files; not evidenced in the review document.
- ❓ pnpm -F @42ch/spoke-connect typecheck — PR description claims clean; not evidenced in the review document.
🗑️ Considered & rejected
none — the authoritative review recorded zero findings, so no candidate concern was raised and rejected.
🛠️ Plan to fix
none
Review 2 · commit b535059
…olicy - Assert the requested entry_ids/entry_types reach the scoped knowledge store on get, put pre-read and put, on both stacks (I-000194). - Give the SQLite reference provider one required-profile policy constant and apply it to spaces built by memory.spaces.create, pinned by a PROFILE_INCOMPLETE conformance case (I-000195).
697dee7 to
b535059
Compare
Closes I-000194 and I-000195 (plan 2026-11-26-scoped-filter-and-create-policy).
Changes
ScopedKnowledgeStoregains a read-onlycall_scopes()accessor over the already-recorded(op, Option<Value>)scopes. Newscoped_knowledge_get_put_keep_the_requested_narrowing_filtersserves an admitted scope withoutentry_ids/entry_typesand a request carryingentry_ids: ["ke-knowledge-a", "ke-knowledge-b"]+entry_types: ["capability"], then asserts the get, the put pre-read and the put all received exactly that narrowing. The TSknowledge-facestore spy records the scope per call and gets the equivalent case (keeps the requested entry_ids/entry_types narrowing on get and put). Both assertions carry a comment naming the regression they catch (dropping the requested filter).tests/support/sqlite_memory.rsgets oneREQUIRED_PROFILE_KINDS = ["personality"]constant used bymemory.describeand by theSpacebuilt increate_space, matchingprovision_space.memory_conformance::created_space_applies_the_required_profile_policycreates a space throughmemory.spaces.createand pins thatmemory.reflections.generatefor a subject with no personality profile answersPROFILE_INCOMPLETEwithdetails.missing == ["personality"].No wire, schema, codegen or A2 intersection changes;
memory.spaces.create's wire response is unchanged.Verification
cargo +nightly test -p spoke-connect --features remote-adapter --test remote_loopback scoped_knowledge— 11 passed (new casescoped_knowledge_get_put_keep_the_requested_narrowing_filtersincluded)cargo +nightly test -p spoke-connect --features remote-adapter --test memory_conformance— 9 passed (new casecreated_space_applies_the_required_profile_policyincluded)cargo +nightly test -p spoke-connect --features remote-adapter --test sqlite_provider— 81 passed (the support module's other consumer, since the reference provider behavior changed)pnpm -F @42ch/spoke-connect test— 654 passed, 40 filespnpm -F @42ch/spoke-connect typecheck— clean