|
| 1 | +# Replay Consistency Design |
| 2 | + |
| 3 | +The replay harness models each case as a normalized stream of operations: |
| 4 | +session creation, ordinary or tool events, state deltas, memory store/search, |
| 5 | +and summary creation/update. Lightweight CI has an InMemory-only path and an |
| 6 | +InMemory-vs-SQLite path, so contributors do not need Redis or MySQL locally. |
| 7 | +External SQL and Redis backends are explicit opt-in paths through |
| 8 | +`TRPC_AGENT_REPLAY_SQL_URL` and `TRPC_AGENT_REPLAY_REDIS_URL`. |
| 9 | + |
| 10 | +Normalization is intentionally narrow. Timestamps become a placeholder, |
| 11 | +generated summary event ids become a stable marker, JSON objects are key sorted, |
| 12 | +memory hits are sorted after timestamp normalization, and summary text only gets |
| 13 | +whitespace folding. Business data remains strict: event order, authors, content, |
| 14 | +state, memory content, summary ownership, summary version/update, and overwrite |
| 15 | +semantics are all compared. |
| 16 | + |
| 17 | +The diff report uses InMemory as the baseline and recursively compares each |
| 18 | +other backend. Every difference records the case id, expected backend, actual |
| 19 | +backend, field path, and both values. Summary comparison is split into semantic |
| 20 | +text and storage metadata: `session_id`, `summary_id`, version, updated-at |
| 21 | +placeholder, and compressed/original event counts remain independent fields. |
| 22 | +`allowed_diff` only accepts explicit rules; the lightweight mode currently has |
| 23 | +no default allowed differences, so real mismatches cannot disappear silently. |
0 commit comments