Repository navigation
test(memory): pin a save's behavior when the graph file path is a symlink - #5705
Conversation
Reads follow the link to its target; a save's atomic rename replaces the link itself with a regular file holding the whole graph, and the link's former target is left byte-for-byte unchanged. Characterization only, no behavior change. POSIX only, like the other symlink tests in the suite. 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 d104316e8e3b70402c60a395d076097a6aed8551.
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues were identified for the graph-path symlink characterization tests.
No open issues 🎉
What changed in this PR
Adds characterization tests for the memory server’s existing graph-path symlink behavior, addressing #5644 without changing production code.
Changes:
- Verifies that reads follow the symlink and leave it pointing at the same target.
- Verifies that saves replace the symlink with a regular file containing both entities, leave the former target unchanged, and remain readable by a fresh server.
- Uses the shared protocol-level test harness and skips Windows, matching existing symlink tests.
| File | Description |
|---|---|
src/memory/__tests__/graph-path-symlink.test.ts |
Adds two tests pinning read and save behavior when the graph path is a symlink. |
Review effort: Balanced
|
Copilot round 1: clean (no findings, no suppressed comments). The review loop stops on this first clean round; nothing was changed in response. |
Closes #5644
Description
Adds characterization tests for a memory graph file path that is itself a symlink, in a new file,
src/memory/__tests__/graph-path-symlink.test.ts. They pin two current behaviors, driven through an SDKClientover the in-memory transport (the sharedhelpers.tsharness):read_graph, and the link stays in place pointing at the same target.create_entitiesthrough the link path, the path is a regular file holding the whole graph (old and new, also when read by a fresh server), and the link's former target is byte-for-byte unchanged. The atomic rename lands on the path itself.No behavior change. The tests pin what the server does today and do not endorse it; whether a save should write through the link is a separate decision (the triage comment on the issue notes it may deserve one).
Adapted from the tests proposed in the issue by @reservoir-cmyk, with thanks: protocol-level through
connect/callrather thanKnowledgeGraphManagerdirectly, usingmakeTempGraphfor the temp directory, a purpose header, and the suite's existingdescribe.skipIf(process.platform === "win32")guard for symlink creation (as inpersistence.test.ts). It also checks the link'sreadlinkafter a read and that a fresh server reads the replaced file back.Server Details
__tests__/graph-path-symlink.test.ts). No tools, resources, prompts, configuration or docs change.Motivation and Context
The README sets
MEMORY_FILE_PATHto an absolute path and promises atomic saves by rename, but nothing pinned what happens when that path is a symlink, a routine setup for pointing the file at another volume. See #5644.How Has This Been Tested?
Test-only change with no client-observable surface, so the evidence is a targeted probe: the new suite against the current
v2/maincode.npm run local:gateexited 0 on the pushed head (it includes the memory suite and its per-file coverage gate).Breaking Changes
None.
Types of changes
(Tests only.)
Checklist
npm run changeset) if this changes what a TypeScript server publishes (not applicable: tests are not published)🤖 Generated with Claude Code