mirror of
https://github.com/NousResearch/hermes-agent.git
synced 2026-07-08 13:12:08 +00:00
test(journey): lock memory write format-parity with the memory tool
Assert a journey edit leaves MEMORY.md byte-identical to MemoryStore's own §-join (no trailing-newline drift) and round-trips through MemoryStore._read_file, so the two surfaces can never diverge on format.
This commit is contained in:
parent
2fc67a3a5b
commit
6241cc54e3
1 changed files with 14 additions and 0 deletions
|
|
@ -112,3 +112,17 @@ def test_edit_skill_rewrites_and_validates(home):
|
|||
|
||||
def test_missing_skill_detail(home):
|
||||
assert not lm.node_detail("nonexistent-skill")["ok"]
|
||||
|
||||
|
||||
def test_memory_writes_match_memory_tool_format(home):
|
||||
"""A journey mutation must leave the file byte-identical to what the memory
|
||||
tool itself writes — same §-join, no trailing-newline drift — so the two
|
||||
surfaces never fight over format and indices stay aligned."""
|
||||
from tools.memory_tool import ENTRY_DELIMITER, MemoryStore
|
||||
|
||||
assert lm.edit_node("memory:memory:0", "alpha rewritten")["ok"]
|
||||
path = home / "memories" / "MEMORY.md"
|
||||
entries = MemoryStore._read_file(path)
|
||||
|
||||
assert entries == ["alpha rewritten", "beta note"]
|
||||
assert path.read_text(encoding="utf-8") == ENTRY_DELIMITER.join(entries)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue