Repository navigation
Conversation
Add a protocol-level round-trip test: 5,000 entities in ten batches and 999 chained relations written through one client, then read back through a second connection and compared record for record (read_graph, search_nodes and the JSONL file). No other test stores more than a few dozen records, so a default cap on a read tool or a chunk-boundary defect in the file path would pass the rest of the suite. Closes #5540 Co-Authored-By: Claude Fable 5.2 <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 7d0c78ad44c55d4da7a62a3ff8b77af2001f714d.
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues remain for the added memory-server scale test.
No open issues 🎉
What changed in this PR
Adds a test-only correctness check for the memory server at 5,000-entity scale, addressing #5540 without changing published behavior.
Changes:
- Writes 5,000 entities and 999 relations through an MCP client, verifying each creation response.
- Uses a fresh server connection to check exact graph read-back and a unique-observation search result.
- Verifies every JSONL record on disk and gives setup an explicit 30-second timeout for slower runners.
| File | Description |
|---|---|
src/memory/__tests__/scale-round-trip.test.ts |
Adds scale coverage for exact persistence, fresh-connection reads, and search results. |
Review effort: Balanced
|
Copilot round 1 (review of 7d0c78a): clean. "Approval recommended", no comments and no suppressed comments, so there is nothing to answer and no further round is requested. The review loop ends here on the first clean round. CI at 7d0c78a is green. The new file's reported duration: 1,092 ms on Test memory (Windows), 1,065 ms on Coverage memory, 719 ms on Validate memory (Node 24), against a 30 s setup timeout. The PR body's table carries these. |
Closes #5540
Description
Adds one new test file,
src/memory/__tests__/scale-round-trip.test.ts: a correctness pin at scale, not a benchmark. It writes 5,000 entities in ten batches of 500 (two observations each, one holding multi-byte characters) and 999 chained relations through an MCP client, then reads them back through a second connection (a second server with its ownKnowledgeGraphManager, so nothing the writer held in memory: the restart equivalent) and compares every record:read_graphwith no options returns exactly the 5,000 entities and 999 relations, in order.search_nodesfor one unique observation returns exactly that entity and the two relations that touch it.create_entities/create_relationscall reports exactly its own batch as created.Two departures from the test as the issue proposed it, both to make it prove what its title claims:
__tests__/helpers.ts, unchanged) instead ofKnowledgeGraphManagerdirectly. A default cap or page size would be added at the tool layer, which is also where a result this large meets the SDK's schema validation and serialization. The reasoning is in the file's purpose header.Server Details
Motivation and Context
The rest of the memory suite works on graphs of a few dozen records at most (the largest loops create 20 to 25), so on small files. Here the graph file is about 600 KB, several times a 64 KiB stream chunk, written by eleven full rewrites of a growing file. A change that only breaks past a size no small test reaches passes the rest of the suite; see the probes below.
How Has This Been Tested?
No client-observable surface changes, so the evidence is a targeted probe: two scale-only defects planted in
src/memory/index.ts(then reverted), each run against the existing suite and against the new file.readGraphreturns only the first 1,000 entities by defaultread_graph returns every entity and relation…failssaveGraphdrops the record straddling each 64 KiB boundary of the fileDurations (setup plus all three tests, vitest's
testsfigure):vitest run, 8 runsvitest run --coverage, 3 runsThe setup hook carries an explicit 30 s timeout, justified in a comment with the measured duration: the default 5 s is thin headroom for eleven locked rewrites on a slow Windows runner (#5570).
npm run local:gateexits 0.Breaking Changes
None.
Types of changes
None of the four: a test-only chore.
Checklist
npm run changeset) if this changes what a TypeScript server publishes (not applicable: tests are not published)finallyand the temp directory is removed inafterAll)🤖 Generated with Claude Code