Build step 5 of 8 — Phase EJ (umbrella #281)
Build doc: documentation/plans/evolve-judging-plan.md §7 Step EJ.5
What to build
The pool-refresh site appends generate_pool output with zero dedup (scripts/evolve.py L4128-4132) — near-duplicate titles re-enter and burn ~4-6 games each.
Behind --refresh-dedup: normalize titles (casefold, strip punctuation/whitespace) and drop any fresh imp that:
- (a) exact-matches an in-run promoted/stacked title,
- (b) has
difflib.SequenceMatcher ratio ≥ 0.85 vs any existing pool title, or
- (c) duplicates another imp within the same fresh batch.
One audit row per drop (phase: "pool_dedup", the matched title + ratio in reason). Accept-short after dedup — never re-call generate_pool to top up (short-pool retry raises on persistent shortfall, evolve.py L1740-1744; the pool-exhausted stop only triggers at 0 active, so a short pool is safe).
Existing context
- Refresh append: scripts/evolve.py L4128-4132 —
for offset, imp in enumerate(fresh_imps): pool.append(imp); per_item_state[start_idx+offset] = PerItemState(). No dedup.
- Dedup is mechanical, not LLM: stdlib-only (
difflib.SequenceMatcher), deterministic, auditable. The local_judge semantic pre-filter scored 6/10 in the investigation and is deferred.
generate_pool short-pool retry raises (L1740-1744) — accept-short is mandatory.
Files to modify/create
scripts/evolve.py (_normalize_title + dedup filter + --refresh-dedup flag; pool_dedup audit rows)
- tests
Done when
Unit tests cover: exact promoted-title drop; 0.85-similar drop; sub-threshold survives; intra-batch duplicate drop; audit row shape; flag OFF → byte-identical append. uv run pytest / mypy src bots --strict / ruff check . clean; test count ≥ baseline.
Flags (recommended)
--reviewers code
Depends on
none
Parallel-safe with
none — strictly sequential (edits scripts/evolve.py argparse+loop shared with sibling EJ steps; plan §4 mandates serial execution)
Produces
_normalize_title + dedup filter + --refresh-dedup flag in scripts/evolve.py; pool_dedup audit rows; tests
Operator workflow notes (autonomous + UI-bundle + parallel)
- Runs end-to-end via
/build-step; the Done when is the gate.
- No
--ui — backend + tests.
- Serial: shared
scripts/evolve.py.
Synced from documentation/plans/evolve-judging-plan.md by /repo-sync at c6099d9
Build step 5 of 8 — Phase EJ (umbrella #281)
Build doc: documentation/plans/evolve-judging-plan.md §7 Step EJ.5
What to build
The pool-refresh site appends
generate_pooloutput with zero dedup (scripts/evolve.py L4128-4132) — near-duplicate titles re-enter and burn ~4-6 games each.Behind
--refresh-dedup: normalize titles (casefold, strip punctuation/whitespace) and drop any fresh imp that:difflib.SequenceMatcherratio ≥ 0.85 vs any existing pool title, orOne audit row per drop (
phase: "pool_dedup", the matched title + ratio inreason). Accept-short after dedup — never re-callgenerate_poolto top up (short-pool retry raises on persistent shortfall, evolve.py L1740-1744; the pool-exhausted stop only triggers at 0 active, so a short pool is safe).Existing context
for offset, imp in enumerate(fresh_imps): pool.append(imp); per_item_state[start_idx+offset] = PerItemState(). No dedup.difflib.SequenceMatcher), deterministic, auditable. The local_judge semantic pre-filter scored 6/10 in the investigation and is deferred.generate_poolshort-pool retry raises (L1740-1744) — accept-short is mandatory.Files to modify/create
scripts/evolve.py(_normalize_title+ dedup filter +--refresh-dedupflag;pool_dedupaudit rows)Done when
Unit tests cover: exact promoted-title drop; 0.85-similar drop; sub-threshold survives; intra-batch duplicate drop; audit row shape; flag OFF → byte-identical append.
uv run pytest/mypy src bots --strict/ruff check .clean; test count ≥ baseline.Flags (recommended)
--reviewers codeDepends on
none
Parallel-safe with
none — strictly sequential (edits
scripts/evolve.pyargparse+loop shared with sibling EJ steps; plan §4 mandates serial execution)Produces
_normalize_title+ dedup filter +--refresh-dedupflag inscripts/evolve.py;pool_dedupaudit rows; testsOperator workflow notes (autonomous + UI-bundle + parallel)
/build-step; theDone whenis the gate.--ui— backend + tests.scripts/evolve.py.Synced from documentation/plans/evolve-judging-plan.md by /repo-sync at c6099d9