Ralph Loop 2026-03-16: Recent Source Journal Coverage
Change
Added a bounded PRD 001 / PRD 004 diagnostic for current raw-journal quality.
Files changed:
research/prepare_replay.pyresearch/continuous_loop.pyresearch/status.pyresearch/discord_status.pyresearch/README.mdtests/test_prepare_replay.pytests/test_continuous_loop.pytests/test_research_status.py
Why
Replay diagnostics already showed that paired eventful metadata coverage was almost absent, but they did not answer a critical operator question:
Is the replay file still bad because of old legacy rows, or is the current journal still writing metadata-thin payloads right now?
The new source-journal profile makes that explicit by measuring eventful metadata
coverage directly on raw opportunity_scan_results.payload_json rows, with a
recent-run slice alongside the all-history totals.
What changed
research.prepare_replay.summarize_source_rows()now reports: - all-source metadata coverage - all-source positive eventful-score coverage - recent-run metadata coverage - recent-run positive eventful-score coverageresearch/continuous_loop.pynow carries that source profile through replay prep events and intoresearch/latest_state.jsonasreplay_source_profile.research/status.pyandresearch/discord_status.pynow show the current raw-journal coverage directly from the DB, even when the stored loop snapshot is stale.- Status notes now add
recent_source_eventful_metadata_missingwhen recent raw journal rows are present but none carry eventful metadata.
Validation
Commands run:
PYTHONPATH=. pytest -q tests/test_prepare_replay.py tests/test_continuous_loop.py tests/test_research_status.py
python3 research/prepare_replay.py --db data/unicorn.db --out /tmp/pam_replay_rows.jsonl
python3 main.py research-status
python3 main.py research-discord-status
Observed:
- Focused tests passed:
14 passed - Replay prep now emits a raw source profile alongside the replay-pair profile.
- Current status output shows:
current source journal coverage: all_metadata=68/1742 all_positive=60 recent_metadata=0/46 recent_positive=0 recent_runs=6
Conclusion
The current bottleneck is now explicit:
- some older rows do carry eventful metadata
- the recent raw journal does not
- replay quality is therefore still being degraded by an active payload-persistence gap, not just a legacy replay mix
The next bounded change should inspect why the latest scanner/journal path is still
writing truncated payload_json rows without eventful_score, eventful_reasons,
and related eventfulness fields.