pam ▸ docs/generated/ralph_loop_2026-03-16_pair_eventful_replay.md
updated 2026-03-28

Ralph Loop 2026-03-16: Pair-Level Eventful Replay Metadata

Change

Improved replay evaluation quality in research/prepare_replay.py by carrying eventful metadata from both observations in each replay pair instead of only the entry-side snapshot.

New replay fields:

Replay summaries now report:

This fixes undercounting when an eventful observation appears as the later side of a replay pair.

Why This Was The Smallest Useful Change

Current loop state showed replay prep producing many rows but almost no eventful coverage:

The journal already contained eventful observations, but replay metadata only preserved eventfulness from the current row in each pair. That made replay input quality look weaker than it really was.

Validation

Focused test:

PYTHONPATH=. pytest -q tests/test_prepare_replay.py

Result:

Smoke command:

python3 research/prepare_replay.py --db data/unicorn.db --out /tmp/replay_rows_check.jsonl

Observed profile after fix:

Remaining Bottleneck

This fix improves replay metadata honesty, but the larger issue remains upstream:

So the next useful change is likely in observation or sleeve generation, not replay pairing.