Skip to content

Phase EJ Step 5: Refresh-time proposal dedup #286

Description

@aberson

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions