Ralph Loop 2026-03-16: Operator DB Path Fix
Change
Fixed a PRD 004 operator-path regression in research/continuous_loop.py.
The loop now resolves the configured research database path through a single
_resolve_db_path() helper and reuses that path for both:
- replay preparation
- live candidate review handoff generation
Why
main() was calling build_live_candidate_review(db_path, ...) without defining
db_path in that scope. That left Ralph’s latest-state handoff vulnerable to a
runtime failure after an otherwise successful replay/search cycle.
This was a signal-quality problem, not just a crash bug: if candidate review fails at handoff time, Ralph loses the live explanation for why there is or is not a smart trade.
Validation
Commands run:
pytest -q tests/test_continuous_loop.py tests/test_candidate_review.py
python3 -m py_compile research/continuous_loop.py research/candidate_review.py research/status.py
Observed results:
6 passed in 0.11spy_compilecompleted without errors
Result
The continuous operator loop now uses one consistent configured DB path across
replay prep and candidate review, and the regression is covered by a focused
test in tests/test_continuous_loop.py.