Skip to content

test(sessions): add replay consistency harness for sessions memory and summaries#116

Open
coder-mtj wants to merge 2 commits into
trpc-group:mainfrom
coder-mtj:feat/replay-consistency-test
Open

test(sessions): add replay consistency harness for sessions memory and summaries#116
coder-mtj wants to merge 2 commits into
trpc-group:mainfrom
coder-mtj:feat/replay-consistency-test

Conversation

@coder-mtj

Copy link
Copy Markdown

Description

Add a multi-backend replay consistency test framework for Session/Memory/Summary. Drives InMemory and SQLite backends with the same 10 deterministic replay cases, normalizes non-business differences, compares snapshots, and writes a structured diff report.

Related Issue

Fix #89

Change Type

  • New feature

Key Features

  • 10 replay cases: single/multi-turn, tool calls, state updates, memory write/read, summary generation/overwrite/truncation, track events, concurrent writes, error recovery
  • Normalized snapshot comparison for events, state, memory, summaries, and tracks
  • Structured JSON diff report
  • Mirrors Go implementation in trpc-agent-go for cross-language verification

Test Coverage

3 tests all passing: full replay matrix, summary injection detection, state/memory injection detection

Self-test Checklist

  • Verified locally
  • No existing features affected

coder-mtj added 2 commits July 4, 2026 13:45
…d summaries

Add a multi-backend replay consistency test framework that drives
InMemory and SQLite backends with the same deterministic replay
cases, normalizes non-business differences, compares snapshots,
and writes a structured diff report.

Key features:
- 10 replay cases: single/multi-turn, tool calls, state updates,
  memory write/read, summary generation/overwrite/truncation,
  track events, concurrent writes, error recovery.
- Normalized snapshot comparison for events, state, memory,
  summaries, and tracks.
- Structured diff report (session_memory_summary_diff_report.json).
- Supports InMemory and SQLite backends.
- Mirrors the Go implementation in trpc-agent-go/session/replaytest/
  for shared fixtures and cross-language verification.

Resolves trpc-group#89
Fix the summary injection test and state/memory injection test
assertions to correctly extract top-level sections from diff paths
containing array indices (e.g., 'events[0].text' -> 'events').
@codecov

codecov Bot commented Jul 4, 2026

Copy link
Copy Markdown

Codecov Report

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

Additional details and impacted files
@@            Coverage Diff             @@
##             main        #116   +/-   ##
==========================================
  Coverage        ?   87.51506%           
==========================================
  Files           ?         467           
  Lines           ?       44005           
  Branches        ?           0           
==========================================
  Hits            ?       38511           
  Misses          ?        5494           
  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.

@github-actions

github-actions Bot commented Jul 4, 2026

Copy link
Copy Markdown

CLA Assistant Lite bot:
Thank you for your submission, we really appreciate it. Like many open-source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution. You can sign the CLA by just posting a Pull Request Comment same as the below format.


I have read the CLA Document and I hereby sign the CLA


You can retrigger this bot by commenting recheck in this Pull Request

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