test(sessions): add replay consistency harness for session memory summaries#120
Open
YAO-001 wants to merge 9 commits into
Open
test(sessions): add replay consistency harness for session memory summaries#120YAO-001 wants to merge 9 commits into
YAO-001 wants to merge 9 commits into
Conversation
Author
|
I have read the CLA Document and I hereby sign the CLA |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #120 +/- ##
==========================================
Coverage ? 87.53323%
==========================================
Files ? 467
Lines ? 44005
Branches ? 0
==========================================
Hits ? 38519
Misses ? 5486
Partials ? 0 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #89
English
Summary
This PR adds a replay consistency harness for Session / Memory / Summary backends.
It replays the same normalized Session / Memory / Summary trajectories across multiple backends, compares the persisted snapshots, and emits structured diff reports for backend-specific drift. The default lightweight matrix runs InMemory against temporary SQLite. Optional integration paths are available through
TRPC_AGENT_REPLAY_SQL_URLandTRPC_AGENT_REPLAY_REDIS_URL; when those environment variables are absent, the external backends are skipped instead of failing local or CI runs.What changed
tests/sessions/replay_consistency/.tests/sessions/replay_cases/session_memory_summary_replay_cases.jsonl.Reports
Checked-in examples:
session_memory_summary_diff_report.jsontests/sessions/replay_consistency/session_memory_summary_mutation_report.jsonBackend behavior
Default mode:
Optional integration mode:
TRPC_AGENT_REPLAY_SQL_URLTRPC_AGENT_REPLAY_REDIS_URLExternal SQL / Redis are not required for default local runs or CI. If the environment variables are absent, the report records them as skipped.
Validation
Validated locally:
中文
摘要
本 PR 为 Session / Memory / Summary 后端新增 replay consistency harness。
它会在多个后端上回放同一组经过规范化的 Session / Memory / Summary 轨迹,比较持久化后的 snapshot,并输出结构化 diff report,用于发现后端间的行为漂移。默认轻量矩阵运行 InMemory 与临时 SQLite。外部 SQL 和 Redis 可通过
TRPC_AGENT_REPLAY_SQL_URL与TRPC_AGENT_REPLAY_REDIS_URL启用;当这些环境变量不存在时,外部后端会被记录为 skipped,而不会导致本地或 CI 失败。变更内容
tests/sessions/replay_consistency/下新增可复用 replay consistency 测试框架。tests/sessions/replay_cases/session_memory_summary_replay_cases.jsonl。报告
已提交示例:
session_memory_summary_diff_report.jsontests/sessions/replay_consistency/session_memory_summary_mutation_report.json后端行为
默认模式:
可选集成模式:
TRPC_AGENT_REPLAY_SQL_URLTRPC_AGENT_REPLAY_REDIS_URL默认本地运行和 CI 不要求外部 SQL / Redis。环境变量缺失时,report 会将它们记录为 skipped。
验证
本地已验证: