Repository navigation
test(memory): pin the neighbouring faces of three pinned invariants - #5701
Conversation
Adds protocol-level characterization tests for the sibling faces of rules already pinned elsewhere: delete_relations' exact match also rejects a space-padded relation type; entity identity is case-sensitive while search_nodes is case-insensitive; and observationCount agrees with delete_observations on the next read. Each request names every item once. Test-only; no behavior change. Proposed by @reservoir-cmyk in #5645. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: cliffhall <cliff@futurescale.com>
|
|
| Tools | Prompts | Resources | Resource templates | |
|---|---|---|---|---|
| Base | 9 | 0 | 1 | 0 |
| Head | 9 | 0 | 1 | 0 |
Updated by this run for c26881969a089cef0489c4e9180228cb44f24c2a.
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues were identified for the added memory-server characterization tests.
No open issues 🎉
What changed in this PR
Adds three protocol-level characterization tests for the memory server, addressing #5645 without changing production behavior. The tests use the shared SDK client harness and isolated temporary graphs.
Changes:
- Verifies that relation types with leading or trailing spaces do not match an exact-match deletion.
- Confirms that case-distinct entity names coexist while case-insensitive searches return both.
- Checks that observation counts and full reads reflect a preceding observation deletion.
| File | Description |
|---|---|
src/memory/__tests__/sibling-faces.test.ts |
Adds the three characterization tests using the shared in-memory transport harness. |
Review effort: Balanced
|
Copilot round 1: clean (no findings, no inline comments, no suppressed comments). Under pr-flow step 9 the loop stops on the first clean round, so no further round is requested. |
Closes #5645
Description
Adds
src/memory/__tests__/sibling-faces.test.ts: three characterization tests that re-measure invariants already pinned on one face of the memory server on their neighbouring face. All three pass on the current implementation; no behavior changes.delete_relationsexact match rejects a space-padded type. DeletingknowsorknowsreportsDeleted 0 of 1 relations. The rest matched nothing.and the relation survives; the exactknowsthen deletes it. (The different-type case is pinned intools.test.ts; the whitespace case was not.)Testandtestcoexist as distinct entities, andsearch_nodesfortestorTESTreturns both. The docs are silent on the asymmetry, so this is characterization.observationCountagrees withdelete_observationson the next read. After deleting one of three observations,read_graphwithobservationLimit: 0returnsobservationCount: 2and no observations, and an unlimited read returns the two that remain.The issue's proposed tests drove
KnowledgeGraphManagerdirectly; these are adapted to the repo's conventions: a purpose header, and protocol-level, driving the tools through an SDKClientover an in-memory transport with the sharedhelpers.tsharness (connect,makeTempGraph,call). The manager'sdeletedCountis asserted through the count the tool reports in its message.Every request names each item once, so the tests do not depend on how the write tools treat repeated items in one request (#5655, #5653), nor on how the write methods are implemented internally (#5693).
Credit: the cases and the proposed tests are by @reservoir-cmyk in #5645.
Server Details
src/memory/__tests__/sibling-faces.test.ts)Motivation and Context
See #5645: each invariant was pinned on one face and unpinned on the sibling face, where the same shape of accident could recur.
How Has This Been Tested?
No client-observable surface changes, so the evidence is a targeted probe:
npx vitest run __tests__/sibling-faces.test.tsinsrc/memory: 3 passed.deleteRelationsto compare againstdelRelation.relationType.trim()makes the first test fail (1 failed | 2 passed); restoring the source makes it pass again.npm run local:gateexits 0.Breaking Changes
None.
Types of changes
(Test-only change.)
Checklist
npm run changeset) if this changes what a TypeScript server publishes (not applicable: tests are not published)🤖 Generated with Claude Code