ReMe/reme/steps
celanwang 681cc85fb5
fix(auto-memory): serialize session transcript writes per session (#633)
* fix(auto-memory): serialize session transcript writes per session

_save_session_messages ran its read-merge-write on the per-session
JSONL transcript without any lock. Concurrent HTTP requests saving the
same session could interleave: two writers both appending against a
stale snapshot write overlapping history twice, and an append racing
a full rewrite can be overwritten by the rewriter's stale merge,
losing messages.

Hold get_path_lock(path) across the whole read, merge, and write,
consistent with the existing session image handling in the same file.
Merge, ordering, and can_append logic are unchanged.

Add deterministic regression tests that gate one writer's read between
snapshot capture and write: concurrent appends must merge disjoint
messages in created_at order, and an appended message must survive a
concurrent full rewrite. Both tests fail without the lock.

Closes #622

* test(auto-memory): make session-lock regression tests deterministic

Replace fixed sleeps with explicit synchronization: a shared operation
log records lock/read/write progress per writer, and writer A holds its
post-read pause until writer B is queued on the transcript lock. The
tests now assert the serialization order from the log (B reads only
after A's write completed) in addition to transcript content, so they
no longer depend on IO timing.

Also fix pylint findings from CI: use from-import for the auto_memory
module and drop unused tmp_path parameters.
2026-10-19 16:13:42 +08:00
..
common feat(classifier): add optional Jev component and service demo (#619) 2026-10-14 17:49:49 +08:00
evolve fix(auto-memory): serialize session transcript writes per session (#633) 2026-10-19 16:13:42 +08:00
file_io refactor(stat): consolidate answer assertions and shorten docs (#627) 2026-10-15 21:04:27 +08:00
index fix(search): accept CLI queries that look like numbers (#612) 2026-10-16 10:36:05 +08:00
transfer feat(benchmark): add lme benchmark steps (#326) 2026-07-07 18:53:39 +09:00
__init__.py refactor(plugins): move BaseAgenticAnswerStep out of the core benchmark steps package into the lme/beam plugins (#576) 2026-09-30 12:19:32 +08:00
base_step.py feat: auto-tag plugin-generated reports (#534) 2026-09-11 11:52:52 +08:00