Skip to content

test: 新增 Session/Memory/Summary 回放一致性测试框架#115

Open
xyxhhhhh wants to merge 1 commit into
trpc-group:mainfrom
xyxhhhhh:issue-89-session-memory-replay-consistency
Open

test: 新增 Session/Memory/Summary 回放一致性测试框架#115
xyxhhhhh wants to merge 1 commit into
trpc-group:mainfrom
xyxhhhhh:issue-89-session-memory-replay-consistency

Conversation

@xyxhhhhh

@xyxhhhhh xyxhhhhh commented Jul 3, 2026

Copy link
Copy Markdown

Closes #89

本 PR 针对 Issue #89 完成的内容

本 PR 实现了一个 Session / Memory / Summary 多后端回放一致性测试框架,用同一组标准化 replay case 驱动不同后端,验证事件、状态、记忆和摘要的回放一致性。

具体包括:

  • 新增 tests/sessions/test_replay_consistency.py,实现 replay harness、后端构建、快照归一化、差异比较、allowed_diff 和报告生成。
  • 新增 tests/sessions/replay_cases/session_memory_summary_replay_cases.jsonl,提供 18 条标准 replay case;在Issue 要求的至少 10 条基础上,额外补充了 8 条覆盖 metadata、多 part event、跨 session 隔离、summary 后 memory 读取、多结果 memory recall 等边界场景。
  • 覆盖单轮对话、多轮对话、工具调用、state 覆盖、memory 写入读取、summary 生成/更新、summary 与事件截断、异常恢复、重复写入、跨 session 隔离等场景。
  • 默认支持 InMemory 与 SQLite 持久化后端对比;有环境变量时可开启 SQL / Redis集成模式。
  • 对时间戳、summary 更新时间、memory 返回顺序等非业务字段做显式归一化或allowed_diff 说明。
  • 对 summary 区分文本语义和存储元数据,比较 summary 内容、版本链、session 归属、active/historical 覆盖关系和 service summary 读取结果。
  • 新增 session_memory_summary_diff_report.json,记录每个 case、每个后端的快照、差异、错误、覆盖信息和运行模式。
  • 新增中文设计说明 docs/mkdocs/zh/session_replay_consistency.md

@xyxhhhhh xyxhhhhh force-pushed the issue-89-session-memory-replay-consistency branch 2 times, most recently from f7c2d6c to 0e8ef83 Compare July 3, 2026 12:20
@xyxhhhhh xyxhhhhh force-pushed the issue-89-session-memory-replay-consistency branch from 0e8ef83 to bc6e1d0 Compare July 3, 2026 12:32
@codecov

codecov Bot commented Jul 3, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
⚠️ Please upload report for BASE (main@73655ab). Learn more about missing BASE report.

Additional details and impacted files
@@            Coverage Diff             @@
##             main        #115   +/-   ##
==========================================
  Coverage        ?   87.53096%           
==========================================
  Files           ?         467           
  Lines           ?       44005           
  Branches        ?           0           
==========================================
  Hits            ?       38518           
  Misses          ?        5487           
  Partials        ?           0           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

构建 Session / Memory 多后端回放一致性测试框架

1 participant