Skip to content

test(connect): pin scoped filter coverage and created-space profile policy - #230

Merged
auto-wood merged 1 commit into
mainfrom
fix/scoped-filter-and-create-policy
Nov 26, 2026
Merged

auto-wood merged 1 commit into
mainfrom
fix/scoped-filter-and-create-policy

Conversation

@auto-wood

Copy link
Copy Markdown
Contributor

Closes I-000194 and I-000195 (plan 2026-11-26-scoped-filter-and-create-policy).

Changes

  • I-000194 — scoped filter coverage. Rust ScopedKnowledgeStore gains a read-only call_scopes() accessor over the already-recorded (op, Option<Value>) scopes. New scoped_knowledge_get_put_keep_the_requested_narrowing_filters serves an admitted scope without entry_ids/entry_types and a request carrying entry_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 TS knowledge-face store 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).
  • I-000195 — created-space profile policy. tests/support/sqlite_memory.rs gets one REQUIRED_PROFILE_KINDS = ["personality"] constant used by memory.describe and by the Space built in create_space, matching provision_space. memory_conformance::created_space_applies_the_required_profile_policy creates a space through memory.spaces.create and pins that memory.reflections.generate for a subject with no personality profile answers PROFILE_INCOMPLETE with details.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 case scoped_knowledge_get_put_keep_the_requested_narrowing_filters included)
  • cargo +nightly test -p spoke-connect --features remote-adapter --test memory_conformance — 9 passed (new case created_space_applies_the_required_profile_policy included)
  • 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 files
  • pnpm -F @42ch/spoke-connect typecheck — clean

@greptile-apps

greptile-apps Bot commented Nov 26, 2026 •

Copy link
Copy Markdown

Confidence Score: 4/5 · The PR appears safe to merge, with a non-blocking test-data mismatch in both narrowing tests.RetriggerView in GreptileConfidence Score: 4/5

[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

  1. P2 Entries fall outside requested filters ▶
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.

Summary

Adds Rust and TypeScript tests that pin requested knowledge filters and applies the declared personality-profile requirement to newly created SQLite test spaces.

  • Scoped knowledge tests now check that requested filters reach every store call.
  • New spaces in the SQLite reference provider require a personality profile for reflection generation.

Reviews (1) · Last reviewed commit: "test(connect): pin scoped filter coverag..." · Reviewed by Greptile

@m-inspector

m-inspector Bot commented Nov 26, 2026 •

Copy link
Copy Markdown

✅ Verdict: ship it · Score 100% (mergeable)

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).
@auto-wood
auto-wood force-pushed the fix/scoped-filter-and-create-policy branch from 697dee7 to b535059 Compare November 26, 2026 03:15
@auto-wood
auto-wood merged commit 46a248f into main Nov 26, 2026
34 checks passed
@auto-wood
auto-wood deleted the fix/scoped-filter-and-create-policy branch November 26, 2026 03:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants