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

Ralph Loop 2026-03-16: Replay Ticker Concentration Gate

Change

Added replay concentration metrics to the shared research evaluation path:

  1. top_ticker
  2. top_ticker_action_count
  3. top_ticker_share
  4. top_two_ticker_share

These metrics now flow through:

  1. research/run_replay.py
  2. research/search.py
  3. research/continuous_loop.py
  4. research/status.py
  5. research/discord_status.py

The confidence gate now blocks ticker-clustered replays with:

  1. research_loop.max_top_ticker_share
  2. research_loop.max_top_two_ticker_share

Default bounds:

  1. max_top_ticker_share: 0.5
  2. max_top_two_ticker_share: 0.85

Why

The persisted replay currently reports non-zero actions, but they are not diversified signal:

  1. 72 actions
  2. 3 unique tickers
  3. top ticker share 0.5
  4. top two ticker share 0.9861

Without an explicit concentration check, repeated actions on one or two names can look stronger than they are.

Validation

Focused tests:

pytest -q tests/test_research_search.py tests/test_research_status.py

Result:

13 passed in 0.62s

Replay smoke check:

python3 - <<'PY'
from research.run_replay import run_replay
summary = run_replay('research/replay_rows.jsonl', 'research/strategy.py')
print(summary)
PY

Observed:

ReplaySummary(strategy_name='strategy', score=0.0193, avg_realized_bps=1.3889, hit_rate=0.0139, action_count=72, unique_tickers=3, top_ticker='KXPERSONPRESFUENTES-45', top_ticker_action_count=36, top_ticker_share=0.5, top_two_ticker_share=0.9861, total_rows=1280)

Status smoke check:

python3 main.py research-status

Relevant line:

- current persisted replay: rows=1280 score=0.0193 hit_rate=0.0139 actions=72 tickers=3 top=KXPERSONPRESFUENTES-45 top_share=0.5 top2_share=0.9861

Outcome

This improves replay evaluation quality by making ticker-clustered sleeves visible and confidence-gated instead of letting raw action count overstate signal quality.