Task Spec: t-diversity-bonus — Diversity Bonus in Resource Allocation

← All Specs

Task Spec: t-diversity-bonus — Diversity Bonus in Resource Allocation

Goal

Modify compute_allocation_weight() in exchange.py to include a diversity_bonus factor that rewards hypotheses targeting underexplored mechanisms.

Approach

  • Add a _compute_diversity_bonus() helper function that:
  • - Counts existing hypotheses targeting the same gene and pathway
    - Returns a bonus multiplier in range 0.4–1.2
    - Unexplored mechanisms (0 existing) get 1.2x bonus
    - Heavily studied mechanisms (6+ existing) get 0.4x penalty

  • Update compute_allocation_weight() to multiply in the diversity bonus:
  • - Formula: allocation_weight = composite_score evidence_freshness gap_coverage * diversity_bonus
    - Bonus schedule:
    - 0 existing hypotheses: 1.2 (completely unexplored)
    - 1 existing: 1.1 (barely explored)
    - 2-3 existing: 1.0 (moderately explored, neutral)
    - 4-5 existing: 0.8 (well-studied)
    - 6+ existing: 0.4 (heavily explored, deprioritized)

    Acceptance Criteria

    compute_allocation_weight() includes diversity_bonus factor in final calculation
    _compute_diversity_bonus() correctly computes bonus based on existing hypothesis count
    ☑ Bonus is higher for underexplored mechanisms (gene/pathway with few or no existing hypotheses)
    ☑ Bonus is lower for well-studied mechanisms
    ☑ Code follows existing patterns in the codebase

    Work Log

    • 2026-04-20 12:35Z: Re-implemented after task reopen audit. The original commit 41579dcc6 was lost during squash merge 1fe00aba0. Re-applied _compute_diversity_bonus() and integrated it into compute_allocation_weight(). Committed as 5dcf7f478.
    • 2026-04-17: Implemented _compute_diversity_bonus() helper function and integrated it into compute_allocation_weight(). The diversity bonus multiplier (0.4–1.2) is applied as a 4th factor in the allocation weight formula, rewarding hypotheses targeting underexplored mechanisms and penalizing those targeting already-heavily-studied areas.

    Tasks using this spec (1)
    Diversity bonus in resource allocation
    File: t_diversity_bonus_spec.md
    Modified: 2026-04-24 07:15
    Size: 2.0 KB