Add cold-start first-10 quality readout - #330
Conversation
|
STAFF ENGINEER REVIEW: CHANGES REQUESTED — two verified script-entrypoint bugs need fixing before merge. [P2] scripts/cold_start_first10_quality_readout.py:29 - The script only uses ANALYST_DATABASE_URL when DATABASE_URL is absent. Analyst docs say this readout should use the read-only analyst DB, but a normal sourced .env can contain both variables; in that case the script keeps DATABASE_URL and may connect to the wrong DB. Verified with both vars set: DATABASE_URL stayed on the primary DSN. [P2] scripts/cold_start_first10_quality_readout.py:64 - The documented command Other checks: CI is green; ruff check, compileall, git diff --check, and /cso diff review passed. Raw SQL uses fixed templates plus bound params; no secrets found. Auto-merge was disabled before posting this change request. |
|
STAFF ENGINEER REVIEW: APPROVED — Cold-start first-10 quality readout reviewed clean after the entrypoint fixes. Verified the prior blockers are fixed: ANALYST_DATABASE_URL takes priority over DATABASE_URL, and the script can import repo modules when run from repo root. Local checks: ruff check, ruff format --check, compileall, git diff --check; /cso diff review found no SQL injection or secret exposure; /codex review found no blocking correctness issues. CI lint and test are green. |
|
✅ Approved + merged. |
Fixes FFM-1869.
What changed
src/stats/cold_start_quality.py.scripts/cold_start_first10_quality_readout.pyfor Analyst/ops execution withANALYST_DATABASE_URLsupport.docs/analyst/README.md.sent_atordering, skip scoring, continuation, engine/segment splits, and top/bottom candidate meme output.Readout coverage
The readout reports first-meme LR/continuation, first-10 LR/continuation, reached-5, reached-10, second-session, per-position quality, per-engine split, source/type/language segments, and top/bottom first-10 candidate memes.
Guardrails
recently_liked_blender_v2logic or readout rules.user_meme_reaction.sent_atto be a cold-start engine send.Verification
ruff check --fix src/ tests/ruff format src/ tests/ruff check --fix scripts/cold_start_first10_quality_readout.py && ruff format scripts/cold_start_first10_quality_readout.pypython3 -m compileall -q src/stats/cold_start_quality.py scripts/cold_start_first10_quality_readout.py tests/stats/test_cold_start_quality.pyFocused pytest was attempted locally with normalized
DATABASE_URL, but this workspace DB is not in a clean migrated test state: Alembic hit an existingusertable and the fixture then failed becausememe_sourcewas absent. CI should run this against its clean test DB.Post-merge handoff
After merge/deploy, Analyst should run:
source .env python scripts/cold_start_first10_quality_readout.py --lookback-days 14Then recommend whether the next step should be a cold-start candidate/filter experiment, continued measurement, or rejecting the quality-score hypothesis.