Skip to content
This repository was archived by the owner on Sep 23, 2025. It is now read-only.

Commit 7b91fbc

Browse files
nikomatsakisclaude
andcommitted
Add simulated mode testing for memory bank with dialectic
- Add --simulated flag to memory-bank server config in dialectic - Create focused test files for write-memory operations: * create-memory-test.yaml - tests new memory creation * read-before-update-test.yaml - tests concurrency control rule - Both tests pass, confirming simulated mode works correctly Tests verify that write-memory tool properly creates memories and enforces the "must read before update" rule for optimistic concurrency. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
1 parent 2df1d27 commit 7b91fbc

File tree

3 files changed

+26
-1
lines changed

3 files changed

+26
-1
lines changed

dialectic/dialectic.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,7 @@ async def run_conversation_step(self, step: ConversationStep) -> TestResult:
225225
mcp_servers={
226226
"memory-bank": {
227227
"command": "uv",
228-
"args": ["--directory", "/home/nikomatsakis/dev/socratic-shell/memory-bank", "run", "python", "-m", "memory_bank", "--memories-dir", "/home/nikomatsakis/dev/socratic-shell/dialectic/tests/memory-basic"],
228+
"args": ["--directory", "/home/nikomatsakis/dev/socratic-shell/memory-bank", "run", "python", "-m", "memory_bank", "--memories-dir", "/home/nikomatsakis/dev/socratic-shell/dialectic/tests/memory-basic", "--simulated"],
229229
"env": {"SOCRATIC_SHELL_LOG": "/tmp/socratic-debug.log"}
230230
},
231231
"dialectic-auth": {
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
name: "Create New Memory"
2+
description: "Test creating new memories with write-memory tool"
3+
4+
conversation:
5+
- user: "Store this insight: 'When debugging race conditions, always check the happens-before relationship between operations'"
6+
expected_response:
7+
should_contain: ["stored"]
8+
expected_tools:
9+
- tool: "mcp__memory-bank__write-memory"
10+
parameters:
11+
content:
12+
should_contain: ["happens-before", "race conditions"]
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
name: "Read Before Update Rule"
2+
description: "Test that memories must be read before they can be updated"
3+
4+
conversation:
5+
- user: "Try to update memory ID 'fake-memory-id-123' with content 'This should fail because the memory was never read'"
6+
expected_response:
7+
should_contain: ["Error", "must be read before updating"]
8+
expected_tools:
9+
- tool: "mcp__memory-bank__write-memory"
10+
parameters:
11+
id: "fake-memory-id-123"
12+
content:
13+
should_contain: ["should fail"]

0 commit comments

Comments
 (0)