FAILURE MAP
← Case archive

FA-85066 / Fantasy sports scoring / Open access

Captain also rostered as a flex player · case 01

A lineup lists the same quarterback as captain and flex and earns 2.5x his points.

Verified by executionVariant 1 · 7 checks per implementationDownload source bundle ↓JSON ↗

ROOT CAUSE

Uniqueness is checked only within the flex list.

THE FAILURE

Uniqueness is checked only within the flex list.

Unsuccessful approach: Checking only the first flex slot misses the captain repeated in later slots.

Case contract

A single-game lineup has one captain and five flex players. The captain costs 1.5x salary rounded up to the next 100 and scores 1.5x points (hundredths, rounded half away from zero). Validation order: exactly five flex players and six distinct names (roster), salary total at most the cap (cap), players from at least two teams (teams). Return validity, first failing reason, salary and points.

Why this case matters

Captain multipliers on both salary and points are where showdown contest lineups are mispriced or wrongly rejected.

1 / The failure

Exit 1
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(lineup, points, salaries, teams, cap):
    cpt, flex = lineup['CPT'], lineup['FLEX']
    names = [cpt] + flex
    cpt_salary = -(-salaries[cpt] * 3 // 200) * 100
    salary = cpt_salary + sum(salaries[p] for p in flex)
    c = points[cpt] * 3
    cpt_pts = (abs(c) + 1) // 2 * (1 if c >= 0 else -1)
    total = cpt_pts + sum(points[p] for p in flex)
    if len(flex) != 5 or len(set(flex)) != 5:
        return {'valid': False, 'reason': 'roster', 'salary': salary, 'points': total}
    if salary > cap:
        return {'valid': False, 'reason': 'cap', 'salary': salary, 'points': total}
    if len({teams[p] for p in names}) < 2:
        return {'valid': False, 'reason': 'teams', 'salary': salary, 'points': total}
    return {'valid': True, 'reason': None, 'salary': salary, 'points': total}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[('regression: captain duplicated in flex',
   [{'CPT': 'b', 'FLEX': ['h', 'f', 'a', 'b', 'e']},
    {'a': 666, 'b': 0, 'c': 1333, 'd': 2001, 'e': 225, 'f': 1333, 'g': 0, 'h': -45},
    {'a': 3300, 'b': 3300, 'c': 8700, 'd': 5300, 'e': 5500, 'f': 7100, 'g': 5500, 'h': 5300},
    {'a': 'H', 'b': 'A', 'c': 'H', 'd': 'H', 'e': 'H', 'f': 'H', 'g': 'H', 'h': 'H'}, 50000],
   {'points': 2179, 'reason': 'roster', 'salary': 29500, 'valid': False}),
  ('partial repair probe: captain duplicated in flex',
   [{'CPT': 'g', 'FLEX': ['b', 'a', 'f', 'g', 'c']},
    {'a': 2001, 'b': 1333, 'c': 225, 'd': 2001, 'e': 2001, 'f': 1795, 'g': -45, 'h': 2001},
    {'a': 5500, 'b': 10500, 'c': 8700, 'd': 9900, 'e': 3300, 'f': 3300, 'g': 8700, 'h': 5300},
    {'a': 'H', 'b': 'H', 'c': 'A', 'd': 'H', 'e': 'A', 'f': 'H', 'g': 'A', 'h': 'H'}, 49700],
   {'points': 5241, 'reason': 'roster', 'salary': 49800, 'valid': False}),
  ('second regression',
   [{'CPT': 'e', 'FLEX': ['d', 'h', 'a', 'c', 'e']},
    {'a': 2001, 'b': 1795, 'c': -50, 'd': -50, 'e': 1795, 'f': -45, 'g': -45, 'h': -45},
    {'a': 10500, 'b': 10500, 'c': 5500, 'd': 3300, 'e': 9900, 'f': 5300, 'g': 9900, 'h': 8700},
    {'a': 'A', 'b': 'H', 'c': 'H', 'd': 'H', 'e': 'H', 'f': 'H', 'g': 'H', 'h': 'H'}, 52800],
   {'points': 6344, 'reason': 'roster', 'salary': 52800, 'valid': False}),
  ('normal control 1',
   [{'CPT': 'g', 'FLEX': ['d', 'h', 'b', 'a', 'f']},
    {'a': 2869, 'b': 2001, 'c': 1795, 'd': 2001, 'e': 0, 'f': 225, 'g': -45, 'h': -50},
    {'a': 5300, 'b': 7100, 'c': 5500, 'd': 10500, 'e': 10500, 'f': 8700, 'g': 3300, 'h': 5500},
    {'a': 'A', 'b': 'H', 'c': 'A', 'd': 'A', 'e': 'H', 'f': 'A', 'g': 'A', 'h': 'A'}, 50000],
   {'points': 6978, 'reason': None, 'salary': 42100, 'valid': True}),
  ('normal control 2',
   [{'CPT': 'c', 'FLEX': ['a', 'f', 'e', 'b', 'g']},
    {'a': -50, 'b': 225, 'c': 2001, 'd': 1333, 'e': 0, 'f': 2001, 'g': 1333, 'h': 225},
    {'a': 5500, 'b': 3300, 'c': 3300, 'd': 5500, 'e': 8700, 'f': 3300, 'g': 9900, 'h': 5300},
    {'a': 'A', 'b': 'H', 'c': 'H', 'd': 'H', 'e': 'H', 'f': 'H', 'g': 'H', 'h': 'H'}, 50000],
   {'points': 6511, 'reason': None, 'salary': 35700, 'valid': True}),
  ('normal control 3',
   [{'CPT': 'e', 'FLEX': ['h', 'e', 'b', 'a', 'e']},
    {'a': 225, 'b': 225, 'c': 2001, 'd': 1795, 'e': 225, 'f': -50, 'g': -50, 'h': 225},
    {'a': 7100, 'b': 3300, 'c': 3300, 'd': 7100, 'e': 3300, 'f': 5300, 'g': 9900, 'h': 10500},
    {'a': 'H', 'b': 'H', 'c': 'A', 'd': 'H', 'e': 'A', 'f': 'A', 'g': 'H', 'h': 'A'}, 32600],
   {'points': 1463, 'reason': 'roster', 'salary': 32500, 'valid': False}),
  ('normal control 4',
   [{'CPT': 'h', 'FLEX': ['a', 'd', 'f', 'b', 'c']},
    {'a': 1333, 'b': 2746, 'c': 1795, 'd': 225, 'e': 0, 'f': 2571, 'g': 0, 'h': 0},
    {'a': 5500, 'b': 10500, 'c': 5500, 'd': 5500, 'e': 5500, 'f': 5500, 'g': 8700, 'h': 5300},
    {'a': 'H', 'b': 'A', 'c': 'H', 'd': 'H', 'e': 'H', 'f': 'H', 'g': 'A', 'h': 'H'}, 40600],
   {'points': 8670, 'reason': None, 'salary': 40500, 'valid': True})],
 [('regression: captain duplicated in flex',
   [{'CPT': 'a', 'FLEX': ['g', 'e', 'c', 'd', 'a']},
    {'a': 225, 'b': -50, 'c': 0, 'd': 1681, 'e': -45, 'f': -50, 'g': 0, 'h': -45},
    {'a': 3300, 'b': 9900, 'c': 7100, 'd': 9900, 'e': 5300, 'f': 3300, 'g': 5300, 'h': 3300},
    {'a': 'H', 'b': 'A', 'c': 'H', 'd': 'H', 'e': 'H', 'f': 'A', 'g': 'H', 'h': 'H'}, 36000],
   {'points': 2199, 'reason': 'roster', 'salary': 35900, 'valid': False}),
  ('partial repair probe: captain duplicated in flex',
   [{'CPT': 'f', 'FLEX': ['d', 'e', 'b', 'g', 'f']},
    {'a': 1795, 'b': 0, 'c': -45, 'd': 1333, 'e': 865, 'f': -50, 'g': 225, 'h': 2001},
    {'a': 5300, 'b': 10500, 'c': 8700, 'd': 9900, 'e': 7100, 'f': 5500, 'g': 9900, 'h': 9900},
    {'a': 'A', 'b': 'H', 'c': 'H', 'd': 'A', 'e': 'A', 'f': 'H', 'g': 'H', 'h': 'H'}, 50000],
   {'points': 2298, 'reason': 'roster', 'salary': 51200, 'valid': False}),
  ('second regression',
   [{'CPT': 'h', 'FLEX': ['e', 'c', 'b', 'h', 'a']},
    {'a': 2714, 'b': 2001, 'c': -45, 'd': 2001, 'e': 2001, 'f': -50, 'g': 2001, 'h': 1333},
    {'a': 9900, 'b': 5500, 'c': 5500, 'd': 10500, 'e': 5300, 'f': 5300, 'g': 3300, 'h': 9900},
    {'a': 'H', 'b': 'H', 'c': 'H', 'd': 'H', 'e': 'H', 'f': 'H', 'g': 'A', 'h': 'H'}, 51000],
   {'points': 10004, 'reason': 'roster', 'salary': 51000, 'valid': False}),
  ('normal control 1',
   [{'CPT': 'd', 'FLEX': ['a', 'e', 'h', 'c', 'g']},
    {'a': 225, 'b': 225, 'c': 225, 'd': 218, 'e': -50, 'f': 1795, 'g': 1795, 'h': 1740},
    {'a': 5300, 'b': 5300, 'c': 5500, 'd': 7100, 'e': 9900, 'f': 8700, 'g': 5500, 'h': 5300},
    {'a': 'H', 'b': 'A', 'c': 'A', 'd': 'H', 'e': 'A', 'f': 'H', 'g': 'A', 'h': 'H'}, 42300],
   {'points': 4262, 'reason': None, 'salary': 42200, 'valid': True}),
  ('normal control 2',
   [{'CPT': 'h', 'FLEX': ['f', 'g', 'c', 'b']},
    {'a': 1795, 'b': 225, 'c': 2001, 'd': -45, 'e': 180, 'f': -45, 'g': 0, 'h': 0},
    {'a': 7100, 'b': 5500, 'c': 5500, 'd': 9900, 'e': 7100, 'f': 10500, 'g': 8700, 'h': 3300},
    {'a': 'H', 'b': 'A', 'c': 'H', 'd': 'H', 'e': 'H', 'f': 'A', 'g': 'A', 'h': 'H'}, 35300],
   {'points': 2181, 'reason': 'roster', 'salary': 35200, 'valid': False}),
  ('normal control 3',
   [{'CPT': 'a', 'FLEX': ['h', 'c', 'e', 'g', 'd']},
    {'a': -45, 'b': 2001, 'c': 0, 'd': 16, 'e': 225, 'f': 2001, 'g': 0, 'h': -45},
    {'a': 7100, 'b': 7100, 'c': 5500, 'd': 8700, 'e': 3300, 'f': 5500, 'g': 10500, 'h': 10500},
    {'a': 'H', 'b': 'H', 'c': 'H', 'd': 'H', 'e': 'A', 'f': 'H', 'g': 'H', 'h': 'H'}, 49100],
   {'points': 128, 'reason': 'cap', 'salary': 49200, 'valid': False}),
  ('normal control 4',
   [{'CPT': 'g', 'FLEX': ['h', 'c', 'd', 'a', 'e']},
    {'a': 0, 'b': -50, 'c': 225, 'd': 2001, 'e': -50, 'f': 1795, 'g': 1795, 'h': -50},
    {'a': 5500, 'b': 7100, 'c': 5500, 'd': 8700, 'e': 5500, 'f': 10500, 'g': 8700, 'h': 5300},
    {'a': 'H', 'b': 'A', 'c': 'H', 'd': 'H', 'e': 'H', 'f': 'H', 'g': 'H', 'h': 'H'}, 43500],
   {'points': 4819, 'reason': 'cap', 'salary': 43600, 'valid': False})],
 [('regression: captain duplicated in flex',
   [{'CPT': 'f', 'FLEX': ['h', 'f', 'b', 'c', 'a']},
    {'a': 1333, 'b': -50, 'c': 0, 'd': -50, 'e': 225, 'f': 915, 'g': 2001, 'h': -50},
    {'a': 9900, 'b': 9900, 'c': 3300, 'd': 8700, 'e': 8700, 'f': 8700, 'g': 8700, 'h': 7100},
    {'a': 'A', 'b': 'A', 'c': 'A', 'd': 'H', 'e': 'H', 'f': 'A', 'g': 'A', 'h': 'A'}, 51900],
   {'points': 3521, 'reason': 'roster', 'salary': 52000, 'valid': False}),
  ('partial repair probe: captain duplicated in flex',
   [{'CPT': 'c', 'FLEX': ['h', 'g', 'f', 'c', 'd']},
    {'a': 2001, 'b': 2001, 'c': 225, 'd': 225, 'e': -45, 'f': 225, 'g': 1795, 'h': -45},
    {'a': 5500, 'b': 10500, 'c': 5500, 'd': 8700, 'e': 5500, 'f': 9900, 'g': 5500, 'h': 9900},
    {'a': 'H', 'b': 'H', 'c': 'H', 'd': 'H', 'e': 'H', 'f': 'H', 'g': 'H', 'h': 'A'}, 47800],
   {'points': 2763, 'reason': 'roster', 'salary': 47800, 'valid': False}),
  ('second regression',
   [{'CPT': 'c', 'FLEX': ['c', 'a', 'g', 'b', 'e']},
    {'a': -50, 'b': 1795, 'c': 0, 'd': 225, 'e': -50, 'f': 1795, 'g': -50, 'h': 1795},
    {'a': 7100, 'b': 3300, 'c': 10500, 'd': 10500, 'e': 7100, 'f': 5500, 'g': 9900, 'h': 7100},
    {'a': 'H', 'b': 'H', 'c': 'A', 'd': 'A', 'e': 'A', 'f': 'H', 'g': 'H', 'h': 'A'}, 53800],
   {'points': 1645, 'reason': 'roster', 'salary': 53700, 'valid': False}),
  ('normal control 1',
   [{'CPT': 'd', 'FLEX': ['c', 'e', 'f', 'a', 'h']},
    {'a': 2001, 'b': 1524, 'c': -60, 'd': -50, 'e': -50, 'f': 2001, 'g': 1795, 'h': -50},
    {'a': 7100, 'b': 9900, 'c': 5500, 'd': 7100, 'e': 5300, 'f': 5300, 'g': 3300, 'h': 9900},
    {'a': 'H', 'b': 'A', 'c': 'A', 'd': 'H', 'e': 'A', 'f': 'A', 'g': 'H', 'h': 'H'}, 43800],
   {'points': 3767, 'reason': None, 'salary': 43800, 'valid': True}),
  ('normal control 2',
   [{'CPT': 'b', 'FLEX': ['h', 'c', 'e', 'd', 'a']},
    {'a': 2001, 'b': -45, 'c': 1333, 'd': -54, 'e': 1264, 'f': 225, 'g': 1333, 'h': 1795},
    {'a': 7100, 'b': 3300, 'c': 9900, 'd': 7100, 'e': 8700, 'f': 5500, 'g': 9900, 'h': 9900},
    {'a': 'H', 'b': 'H', 'c': 'H', 'd': 'A', 'e': 'H', 'f': 'H', 'g': 'H', 'h': 'H'}, 47600],
   {'points': 6271, 'reason': 'cap', 'salary': 47700, 'valid': False}),
  ('normal control 3',
   [{'CPT': 'b', 'FLEX': ['c', 'a', 'e', 'h', 'f']},
    {'a': 2001, 'b': -45, 'c': 1795, 'd': 652, 'e': 225, 'f': -50, 'g': 843, 'h': 1795},
    {'a': 9900, 'b': 9900, 'c': 10500, 'd': 10500, 'e': 10500, 'f': 9900, 'g': 5300, 'h': 9900},
    {'a': 'H', 'b': 'H', 'c': 'A', 'd': 'H', 'e': 'H', 'f': 'H', 'g': 'H', 'h': 'H'}, 50000],
   {'points': 5698, 'reason': 'cap', 'salary': 65600, 'valid': False}),
  ('normal control 4',
   [{'CPT': 'a', 'FLEX': ['f', 'd', 'g', 'h', 'e']},
    {'a': -50, 'b': -50, 'c': 225, 'd': 1333, 'e': 2448, 'f': 0, 'g': 1795, 'h': 1769},
    {'a': 5300, 'b': 5300, 'c': 5500, 'd': 5300, 'e': 8700, 'f': 5300, 'g': 3300, 'h': 10500},
    {'a': 'H', 'b': 'H', 'c': 'A', 'd': 'H', 'e': 'H', 'f': 'H', 'g': 'H', 'h': 'H'}, 41000],
   {'points': 7270, 'reason': 'cap', 'salary': 41100, 'valid': False})],
 [('regression: captain duplicated in flex',
   [{'CPT': 'c', 'FLEX': ['e', 'c', 'a', 'd', 'g']},
    {'a': 2001, 'b': -45, 'c': -86, 'd': 0, 'e': 1837, 'f': 1795, 'g': -45, 'h': 1795},
    {'a': 8700, 'b': 9900, 'c': 8700, 'd': 10500, 'e': 10500, 'f': 5300, 'g': 7100, 'h': 5500},
    {'a': 'H', 'b': 'A', 'c': 'H', 'd': 'H', 'e': 'H', 'f': 'H', 'g': 'H', 'h': 'H'}, 58700],
   {'points': 3578, 'reason': 'roster', 'salary': 58600, 'valid': False}),
  ('partial repair probe: captain duplicated in flex',
   [{'CPT': 'b', 'FLEX': ['e', 'b', 'h', 'g', 'c']},
    {'a': 1333, 'b': 2001, 'c': 2001, 'd': 1795, 'e': 2001, 'f': 1795, 'g': 225, 'h': 2001},
    {'a': 10500, 'b': 9900, 'c': 3300, 'd': 8700, 'e': 7100, 'f': 3300, 'g': 7100, 'h': 5300},
    {'a': 'A', 'b': 'A', 'c': 'H', 'd': 'H', 'e': 'H', 'f': 'A', 'g': 'H', 'h': 'H'}, 47600],
   {'points': 11231, 'reason': 'roster', 'salary': 47600, 'valid': False}),
  ('second regression',
   [{'CPT': 'g', 'FLEX': ['f', 'd', 'g', 'e', 'c']},
    {'a': 1795, 'b': -50, 'c': 1795, 'd': 1795, 'e': -45, 'f': -45, 'g': 1795, 'h': 1333},
    {'a': 9900, 'b': 7100, 'c': 5500, 'd': 5500, 'e': 7100, 'f': 5300, 'g': 9900, 'h': 8700},
    {'a': 'H', 'b': 'H', 'c': 'H', 'd': 'H', 'e': 'H', 'f': 'H', 'g': 'H', 'h': 'A'}, 50000],
   {'points': 7988, 'reason': 'roster', 'salary': 48200, 'valid': False}),
  ('normal control 1',
   [{'CPT': 'e', 'FLEX': ['b', 'd', 'h', 'a', 'g']},
    {'a': 0, 'b': 1333, 'c': -50, 'd': 1795, 'e': -50, 'f': 0, 'g': -50, 'h': 0},
    {'a': 7100, 'b': 8700, 'c': 9900, 'd': 7100, 'e': 5300, 'f': 8700, 'g': 5300, 'h': 3300},
    {'a': 'A', 'b': 'A', 'c': 'H', 'd': 'H', 'e': 'A', 'f': 'A', 'g': 'A', 'h': 'H'}, 39400],
   {'points': 3003, 'reason': 'cap', 'salary': 39500, 'valid': False}),
  ('normal control 2',
   [{'CPT': 'g', 'FLEX': ['c', 'a', 'd', 'h']},
    {'a': 1795, 'b': 1795, 'c': 1333, 'd': 1333, 'e': -50, 'f': -45, 'g': 1333, 'h': 2001},
    {'a': 3300, 'b': 7100, 'c': 9900, 'd': 10500, 'e': 9900, 'f': 5300, 'g': 7100, 'h': 9900},
    {'a': 'A', 'b': 'A', 'c': 'H', 'd': 'H', 'e': 'A', 'f': 'A', 'g': 'A', 'h': 'H'}, 50000],
   {'points': 8462, 'reason': 'roster', 'salary': 44300, 'valid': False}),
  ('normal control 3',
   [{'CPT': 'h', 'FLEX': ['f', 'd', 'e', 'b', 'g']},
    {'a': -45, 'b': 225, 'c': 1795, 'd': 1333, 'e': -50, 'f': -45, 'g': 0, 'h': 0},
    {'a': 8700, 'b': 8700, 'c': 5500, 'd': 5300, 'e': 5300, 'f': 5500, 'g': 7100, 'h': 5500},
    {'a': 'H', 'b': 'A', 'c': 'H', 'd': 'A', 'e': 'H', 'f': 'H', 'g': 'A', 'h': 'A'}, 40200],
   {'points': 1463, 'reason': None, 'salary': 40200, 'valid': True}),
  ('normal control 4',
   [{'CPT': 'd', 'FLEX': ['c', 'a', 'h', 'b', 'e']},
    {'a': -50, 'b': 2001, 'c': 1333, 'd': 1333, 'e': 1333, 'f': 0, 'g': 1333, 'h': 2001},
    {'a': 5500, 'b': 5300, 'c': 8700, 'd': 10500, 'e': 3300, 'f': 10500, 'g': 8700, 'h': 3300},
    {'a': 'H', 'b': 'H', 'c': 'A', 'd': 'H', 'e': 'H', 'f': 'H', 'g': 'H', 'h': 'H'}, 42000],
   {'points': 8618, 'reason': None, 'salary': 41900, 'valid': True})],
 [('regression: captain duplicated in flex',
   [{'CPT': 'c', 'FLEX': ['a', 'h', 'b', 'f', 'c']},
    {'a': 1333, 'b': -50, 'c': 0, 'd': 225, 'e': -50, 'f': 2001, 'g': 2001, 'h': 1333},
    {'a': 3300, 'b': 3300, 'c': 9900, 'd': 8700, 'e': 5300, 'f': 7100, 'g': 9900, 'h': 3300},
    {'a': 'A', 'b': 'A', 'c': 'H', 'd': 'H', 'e': 'A', 'f': 'H', 'g': 'H', 'h': 'A'}, 41900],
   {'points': 4617, 'reason': 'roster', 'salary': 41800, 'valid': False}),
  ('partial repair probe: captain duplicated in flex',
   [{'CPT': 'g', 'FLEX': ['c', 'e', 'b', 'g', 'a']},
    {'a': 1795, 'b': 1795, 'c': -45, 'd': 2001, 'e': -45, 'f': 2001, 'g': 225, 'h': 225},
    {'a': 7100, 'b': 9900, 'c': 3300, 'd': 3300, 'e': 9900, 'f': 5500, 'g': 5500, 'h': 10500},
    {'a': 'A', 'b': 'A', 'c': 'A', 'd': 'A', 'e': 'A', 'f': 'H', 'g': 'A', 'h': 'H'}, 44000],
   {'points': 4063, 'reason': 'roster', 'salary': 44000, 'valid': False}),
  ('second regression',
   [{'CPT': 'd', 'FLEX': ['d', 'h', 'e', 'b', 'a']},
    {'a': 225, 'b': 2001, 'c': 1921, 'd': 1795, 'e': 225, 'f': -50, 'g': 1795, 'h': 1795},
    {'a': 3300, 'b': 5500, 'c': 5300, 'd': 10500, 'e': 9900, 'f': 5300, 'g': 10500, 'h': 5300},
    {'a': 'A', 'b': 'A', 'c': 'A', 'd': 'H', 'e': 'H', 'f': 'A', 'g': 'A', 'h': 'H'}, 50300],
   {'points': 8734, 'reason': 'roster', 'salary': 50300, 'valid': False}),
  ('normal control 1',
   [{'CPT': 'g', 'FLEX': ['g', 'e', 'd', 'b']},
    {'a': 2861, 'b': -45, 'c': 0, 'd': 2001, 'e': 0, 'f': -50, 'g': 1333, 'h': 1156},
    {'a': 3300, 'b': 3300, 'c': 9900, 'd': 8700, 'e': 9900, 'f': 7100, 'g': 7100, 'h': 9900},
    {'a': 'H', 'b': 'A', 'c': 'H', 'd': 'H', 'e': 'H', 'f': 'H', 'g': 'H', 'h': 'H'}, 39700],
   {'points': 5289, 'reason': 'roster', 'salary': 39700, 'valid': False}),
  ('normal control 2',
   [{'CPT': 'd', 'FLEX': ['b', 'c', 'a', 'f', 'g']},
    {'a': 0, 'b': -45, 'c': 1333, 'd': 1333, 'e': -50, 'f': -45, 'g': -50, 'h': 1795},
    {'a': 7100, 'b': 7100, 'c': 5500, 'd': 5300, 'e': 5500, 'f': 9900, 'g': 5300, 'h': 5500},
    {'a': 'H', 'b': 'H', 'c': 'H', 'd': 'A', 'e': 'A', 'f': 'H', 'g': 'H', 'h': 'H'}, 50000],
   {'points': 3193, 'reason': None, 'salary': 42900, 'valid': True}),
  ('normal control 3',
   [{'CPT': 'g', 'FLEX': ['c', 'h', 'b', 'e', 'a']},
    {'a': 1795, 'b': 0, 'c': 1333, 'd': 225, 'e': 2001, 'f': 1333, 'g': 1795, 'h': 1333},
    {'a': 8700, 'b': 5500, 'c': 3300, 'd': 5500, 'e': 10500, 'f': 5300, 'g': 9900, 'h': 9900},
    {'a': 'A', 'b': 'A', 'c': 'A', 'd': 'H', 'e': 'A', 'f': 'H', 'g': 'A', 'h': 'H'}, 52900],
   {'points': 9155, 'reason': None, 'salary': 52800, 'valid': True}),
  ('normal control 4',
   [{'CPT': 'a', 'FLEX': ['c', 'd', 'b', 'e', 'h']},
    {'a': 1333, 'b': -50, 'c': 1333, 'd': 2001, 'e': 1795, 'f': 2001, 'g': 2001, 'h': 225},
    {'a': 5500, 'b': 8700, 'c': 3300, 'd': 5500, 'e': 10500, 'f': 5500, 'g': 8700, 'h': 8700},
    {'a': 'H', 'b': 'A', 'c': 'H', 'd': 'A', 'e': 'A', 'f': 'H', 'g': 'H', 'h': 'H'}, 44900],
   {'points': 7304, 'reason': 'cap', 'salary': 45000, 'valid': False})]]
for label, args, expected in fixtures[N-1]:
    check(label, solve(*args), expected)
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)
Boundary fixtureActualExpectedOutcome
regression: captain duplicated in flex{'points': 2179, 'reason': None, 'salary': 29500, 'valid': True}{'points': 2179, 'reason': 'roster', 'salary': 29500, 'valid': False}Failed
partial repair probe: captain duplicated in flex{'points': 5241, 'reason': 'cap', 'salary': 49800, 'valid': False}{'points': 5241, 'reason': 'roster', 'salary': 49800, 'valid': False}Failed
second regression{'points': 6344, 'reason': None, 'salary': 52800, 'valid': True}{'points': 6344, 'reason': 'roster', 'salary': 52800, 'valid': False}Failed
normal control 1{'points': 6978, 'reason': None, 'salary': 42100, 'valid': True}{'points': 6978, 'reason': None, 'salary': 42100, 'valid': True}Passed
normal control 2{'points': 6511, 'reason': None, 'salary': 35700, 'valid': True}{'points': 6511, 'reason': None, 'salary': 35700, 'valid': True}Passed
normal control 3{'points': 1463, 'reason': 'roster', 'salary': 32500, 'valid': False}{'points': 1463, 'reason': 'roster', 'salary': 32500, 'valid': False}Passed
normal control 4{'points': 8670, 'reason': None, 'salary': 40500, 'valid': True}{'points': 8670, 'reason': None, 'salary': 40500, 'valid': True}Passed

SHA-256 / e288c8f8289fef00d117f5a14dfa35fdf32bd2fe43cf3ba3a6f5238b5dd22984

2 / The unsuccessful fix

Exit 1
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(lineup, points, salaries, teams, cap):
    cpt, flex = lineup['CPT'], lineup['FLEX']
    names = [cpt] + flex
    cpt_salary = -(-salaries[cpt] * 3 // 200) * 100
    salary = cpt_salary + sum(salaries[p] for p in flex)
    c = points[cpt] * 3
    cpt_pts = (abs(c) + 1) // 2 * (1 if c >= 0 else -1)
    total = cpt_pts + sum(points[p] for p in flex)
    if len(flex) != 5 or len(set(flex)) != 5 or cpt == flex[0]:
        return {'valid': False, 'reason': 'roster', 'salary': salary, 'points': total}
    if salary > cap:
        return {'valid': False, 'reason': 'cap', 'salary': salary, 'points': total}
    if len({teams[p] for p in names}) < 2:
        return {'valid': False, 'reason': 'teams', 'salary': salary, 'points': total}
    return {'valid': True, 'reason': None, 'salary': salary, 'points': total}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[('regression: captain duplicated in flex',
   [{'CPT': 'b', 'FLEX': ['h', 'f', 'a', 'b', 'e']},
    {'a': 666, 'b': 0, 'c': 1333, 'd': 2001, 'e': 225, 'f': 1333, 'g': 0, 'h': -45},
    {'a': 3300, 'b': 3300, 'c': 8700, 'd': 5300, 'e': 5500, 'f': 7100, 'g': 5500, 'h': 5300},
    {'a': 'H', 'b': 'A', 'c': 'H', 'd': 'H', 'e': 'H', 'f': 'H', 'g': 'H', 'h': 'H'}, 50000],
   {'points': 2179, 'reason': 'roster', 'salary': 29500, 'valid': False}),
  ('partial repair probe: captain duplicated in flex',
   [{'CPT': 'g', 'FLEX': ['b', 'a', 'f', 'g', 'c']},
    {'a': 2001, 'b': 1333, 'c': 225, 'd': 2001, 'e': 2001, 'f': 1795, 'g': -45, 'h': 2001},
    {'a': 5500, 'b': 10500, 'c': 8700, 'd': 9900, 'e': 3300, 'f': 3300, 'g': 8700, 'h': 5300},
    {'a': 'H', 'b': 'H', 'c': 'A', 'd': 'H', 'e': 'A', 'f': 'H', 'g': 'A', 'h': 'H'}, 49700],
   {'points': 5241, 'reason': 'roster', 'salary': 49800, 'valid': False}),
  ('second regression',
   [{'CPT': 'e', 'FLEX': ['d', 'h', 'a', 'c', 'e']},
    {'a': 2001, 'b': 1795, 'c': -50, 'd': -50, 'e': 1795, 'f': -45, 'g': -45, 'h': -45},
    {'a': 10500, 'b': 10500, 'c': 5500, 'd': 3300, 'e': 9900, 'f': 5300, 'g': 9900, 'h': 8700},
    {'a': 'A', 'b': 'H', 'c': 'H', 'd': 'H', 'e': 'H', 'f': 'H', 'g': 'H', 'h': 'H'}, 52800],
   {'points': 6344, 'reason': 'roster', 'salary': 52800, 'valid': False}),
  ('normal control 1',
   [{'CPT': 'g', 'FLEX': ['d', 'h', 'b', 'a', 'f']},
    {'a': 2869, 'b': 2001, 'c': 1795, 'd': 2001, 'e': 0, 'f': 225, 'g': -45, 'h': -50},
    {'a': 5300, 'b': 7100, 'c': 5500, 'd': 10500, 'e': 10500, 'f': 8700, 'g': 3300, 'h': 5500},
    {'a': 'A', 'b': 'H', 'c': 'A', 'd': 'A', 'e': 'H', 'f': 'A', 'g': 'A', 'h': 'A'}, 50000],
   {'points': 6978, 'reason': None, 'salary': 42100, 'valid': True}),
  ('normal control 2',
   [{'CPT': 'c', 'FLEX': ['a', 'f', 'e', 'b', 'g']},
    {'a': -50, 'b': 225, 'c': 2001, 'd': 1333, 'e': 0, 'f': 2001, 'g': 1333, 'h': 225},
    {'a': 5500, 'b': 3300, 'c': 3300, 'd': 5500, 'e': 8700, 'f': 3300, 'g': 9900, 'h': 5300},
    {'a': 'A', 'b': 'H', 'c': 'H', 'd': 'H', 'e': 'H', 'f': 'H', 'g': 'H', 'h': 'H'}, 50000],
   {'points': 6511, 'reason': None, 'salary': 35700, 'valid': True}),
  ('normal control 3',
   [{'CPT': 'e', 'FLEX': ['h', 'e', 'b', 'a', 'e']},
    {'a': 225, 'b': 225, 'c': 2001, 'd': 1795, 'e': 225, 'f': -50, 'g': -50, 'h': 225},
    {'a': 7100, 'b': 3300, 'c': 3300, 'd': 7100, 'e': 3300, 'f': 5300, 'g': 9900, 'h': 10500},
    {'a': 'H', 'b': 'H', 'c': 'A', 'd': 'H', 'e': 'A', 'f': 'A', 'g': 'H', 'h': 'A'}, 32600],
   {'points': 1463, 'reason': 'roster', 'salary': 32500, 'valid': False}),
  ('normal control 4',
   [{'CPT': 'h', 'FLEX': ['a', 'd', 'f', 'b', 'c']},
    {'a': 1333, 'b': 2746, 'c': 1795, 'd': 225, 'e': 0, 'f': 2571, 'g': 0, 'h': 0},
    {'a': 5500, 'b': 10500, 'c': 5500, 'd': 5500, 'e': 5500, 'f': 5500, 'g': 8700, 'h': 5300},
    {'a': 'H', 'b': 'A', 'c': 'H', 'd': 'H', 'e': 'H', 'f': 'H', 'g': 'A', 'h': 'H'}, 40600],
   {'points': 8670, 'reason': None, 'salary': 40500, 'valid': True})],
 [('regression: captain duplicated in flex',
   [{'CPT': 'a', 'FLEX': ['g', 'e', 'c', 'd', 'a']},
    {'a': 225, 'b': -50, 'c': 0, 'd': 1681, 'e': -45, 'f': -50, 'g': 0, 'h': -45},
    {'a': 3300, 'b': 9900, 'c': 7100, 'd': 9900, 'e': 5300, 'f': 3300, 'g': 5300, 'h': 3300},
    {'a': 'H', 'b': 'A', 'c': 'H', 'd': 'H', 'e': 'H', 'f': 'A', 'g': 'H', 'h': 'H'}, 36000],
   {'points': 2199, 'reason': 'roster', 'salary': 35900, 'valid': False}),
  ('partial repair probe: captain duplicated in flex',
   [{'CPT': 'f', 'FLEX': ['d', 'e', 'b', 'g', 'f']},
    {'a': 1795, 'b': 0, 'c': -45, 'd': 1333, 'e': 865, 'f': -50, 'g': 225, 'h': 2001},
    {'a': 5300, 'b': 10500, 'c': 8700, 'd': 9900, 'e': 7100, 'f': 5500, 'g': 9900, 'h': 9900},
    {'a': 'A', 'b': 'H', 'c': 'H', 'd': 'A', 'e': 'A', 'f': 'H', 'g': 'H', 'h': 'H'}, 50000],
   {'points': 2298, 'reason': 'roster', 'salary': 51200, 'valid': False}),
  ('second regression',
   [{'CPT': 'h', 'FLEX': ['e', 'c', 'b', 'h', 'a']},
    {'a': 2714, 'b': 2001, 'c': -45, 'd': 2001, 'e': 2001, 'f': -50, 'g': 2001, 'h': 1333},
    {'a': 9900, 'b': 5500, 'c': 5500, 'd': 10500, 'e': 5300, 'f': 5300, 'g': 3300, 'h': 9900},
    {'a': 'H', 'b': 'H', 'c': 'H', 'd': 'H', 'e': 'H', 'f': 'H', 'g': 'A', 'h': 'H'}, 51000],
   {'points': 10004, 'reason': 'roster', 'salary': 51000, 'valid': False}),
  ('normal control 1',
   [{'CPT': 'd', 'FLEX': ['a', 'e', 'h', 'c', 'g']},
    {'a': 225, 'b': 225, 'c': 225, 'd': 218, 'e': -50, 'f': 1795, 'g': 1795, 'h': 1740},
    {'a': 5300, 'b': 5300, 'c': 5500, 'd': 7100, 'e': 9900, 'f': 8700, 'g': 5500, 'h': 5300},
    {'a': 'H', 'b': 'A', 'c': 'A', 'd': 'H', 'e': 'A', 'f': 'H', 'g': 'A', 'h': 'H'}, 42300],
   {'points': 4262, 'reason': None, 'salary': 42200, 'valid': True}),
  ('normal control 2',
   [{'CPT': 'h', 'FLEX': ['f', 'g', 'c', 'b']},
    {'a': 1795, 'b': 225, 'c': 2001, 'd': -45, 'e': 180, 'f': -45, 'g': 0, 'h': 0},
    {'a': 7100, 'b': 5500, 'c': 5500, 'd': 9900, 'e': 7100, 'f': 10500, 'g': 8700, 'h': 3300},
    {'a': 'H', 'b': 'A', 'c': 'H', 'd': 'H', 'e': 'H', 'f': 'A', 'g': 'A', 'h': 'H'}, 35300],
   {'points': 2181, 'reason': 'roster', 'salary': 35200, 'valid': False}),
  ('normal control 3',
   [{'CPT': 'a', 'FLEX': ['h', 'c', 'e', 'g', 'd']},
    {'a': -45, 'b': 2001, 'c': 0, 'd': 16, 'e': 225, 'f': 2001, 'g': 0, 'h': -45},
    {'a': 7100, 'b': 7100, 'c': 5500, 'd': 8700, 'e': 3300, 'f': 5500, 'g': 10500, 'h': 10500},
    {'a': 'H', 'b': 'H', 'c': 'H', 'd': 'H', 'e': 'A', 'f': 'H', 'g': 'H', 'h': 'H'}, 49100],
   {'points': 128, 'reason': 'cap', 'salary': 49200, 'valid': False}),
  ('normal control 4',
   [{'CPT': 'g', 'FLEX': ['h', 'c', 'd', 'a', 'e']},
    {'a': 0, 'b': -50, 'c': 225, 'd': 2001, 'e': -50, 'f': 1795, 'g': 1795, 'h': -50},
    {'a': 5500, 'b': 7100, 'c': 5500, 'd': 8700, 'e': 5500, 'f': 10500, 'g': 8700, 'h': 5300},
    {'a': 'H', 'b': 'A', 'c': 'H', 'd': 'H', 'e': 'H', 'f': 'H', 'g': 'H', 'h': 'H'}, 43500],
   {'points': 4819, 'reason': 'cap', 'salary': 43600, 'valid': False})],
 [('regression: captain duplicated in flex',
   [{'CPT': 'f', 'FLEX': ['h', 'f', 'b', 'c', 'a']},
    {'a': 1333, 'b': -50, 'c': 0, 'd': -50, 'e': 225, 'f': 915, 'g': 2001, 'h': -50},
    {'a': 9900, 'b': 9900, 'c': 3300, 'd': 8700, 'e': 8700, 'f': 8700, 'g': 8700, 'h': 7100},
    {'a': 'A', 'b': 'A', 'c': 'A', 'd': 'H', 'e': 'H', 'f': 'A', 'g': 'A', 'h': 'A'}, 51900],
   {'points': 3521, 'reason': 'roster', 'salary': 52000, 'valid': False}),
  ('partial repair probe: captain duplicated in flex',
   [{'CPT': 'c', 'FLEX': ['h', 'g', 'f', 'c', 'd']},
    {'a': 2001, 'b': 2001, 'c': 225, 'd': 225, 'e': -45, 'f': 225, 'g': 1795, 'h': -45},
    {'a': 5500, 'b': 10500, 'c': 5500, 'd': 8700, 'e': 5500, 'f': 9900, 'g': 5500, 'h': 9900},
    {'a': 'H', 'b': 'H', 'c': 'H', 'd': 'H', 'e': 'H', 'f': 'H', 'g': 'H', 'h': 'A'}, 47800],
   {'points': 2763, 'reason': 'roster', 'salary': 47800, 'valid': False}),
  ('second regression',
   [{'CPT': 'c', 'FLEX': ['c', 'a', 'g', 'b', 'e']},
    {'a': -50, 'b': 1795, 'c': 0, 'd': 225, 'e': -50, 'f': 1795, 'g': -50, 'h': 1795},
    {'a': 7100, 'b': 3300, 'c': 10500, 'd': 10500, 'e': 7100, 'f': 5500, 'g': 9900, 'h': 7100},
    {'a': 'H', 'b': 'H', 'c': 'A', 'd': 'A', 'e': 'A', 'f': 'H', 'g': 'H', 'h': 'A'}, 53800],
   {'points': 1645, 'reason': 'roster', 'salary': 53700, 'valid': False}),
  ('normal control 1',
   [{'CPT': 'd', 'FLEX': ['c', 'e', 'f', 'a', 'h']},
    {'a': 2001, 'b': 1524, 'c': -60, 'd': -50, 'e': -50, 'f': 2001, 'g': 1795, 'h': -50},
    {'a': 7100, 'b': 9900, 'c': 5500, 'd': 7100, 'e': 5300, 'f': 5300, 'g': 3300, 'h': 9900},
    {'a': 'H', 'b': 'A', 'c': 'A', 'd': 'H', 'e': 'A', 'f': 'A', 'g': 'H', 'h': 'H'}, 43800],
   {'points': 3767, 'reason': None, 'salary': 43800, 'valid': True}),
  ('normal control 2',
   [{'CPT': 'b', 'FLEX': ['h', 'c', 'e', 'd', 'a']},
    {'a': 2001, 'b': -45, 'c': 1333, 'd': -54, 'e': 1264, 'f': 225, 'g': 1333, 'h': 1795},
    {'a': 7100, 'b': 3300, 'c': 9900, 'd': 7100, 'e': 8700, 'f': 5500, 'g': 9900, 'h': 9900},
    {'a': 'H', 'b': 'H', 'c': 'H', 'd': 'A', 'e': 'H', 'f': 'H', 'g': 'H', 'h': 'H'}, 47600],
   {'points': 6271, 'reason': 'cap', 'salary': 47700, 'valid': False}),
  ('normal control 3',
   [{'CPT': 'b', 'FLEX': ['c', 'a', 'e', 'h', 'f']},
    {'a': 2001, 'b': -45, 'c': 1795, 'd': 652, 'e': 225, 'f': -50, 'g': 843, 'h': 1795},
    {'a': 9900, 'b': 9900, 'c': 10500, 'd': 10500, 'e': 10500, 'f': 9900, 'g': 5300, 'h': 9900},
    {'a': 'H', 'b': 'H', 'c': 'A', 'd': 'H', 'e': 'H', 'f': 'H', 'g': 'H', 'h': 'H'}, 50000],
   {'points': 5698, 'reason': 'cap', 'salary': 65600, 'valid': False}),
  ('normal control 4',
   [{'CPT': 'a', 'FLEX': ['f', 'd', 'g', 'h', 'e']},
    {'a': -50, 'b': -50, 'c': 225, 'd': 1333, 'e': 2448, 'f': 0, 'g': 1795, 'h': 1769},
    {'a': 5300, 'b': 5300, 'c': 5500, 'd': 5300, 'e': 8700, 'f': 5300, 'g': 3300, 'h': 10500},
    {'a': 'H', 'b': 'H', 'c': 'A', 'd': 'H', 'e': 'H', 'f': 'H', 'g': 'H', 'h': 'H'}, 41000],
   {'points': 7270, 'reason': 'cap', 'salary': 41100, 'valid': False})],
 [('regression: captain duplicated in flex',
   [{'CPT': 'c', 'FLEX': ['e', 'c', 'a', 'd', 'g']},
    {'a': 2001, 'b': -45, 'c': -86, 'd': 0, 'e': 1837, 'f': 1795, 'g': -45, 'h': 1795},
    {'a': 8700, 'b': 9900, 'c': 8700, 'd': 10500, 'e': 10500, 'f': 5300, 'g': 7100, 'h': 5500},
    {'a': 'H', 'b': 'A', 'c': 'H', 'd': 'H', 'e': 'H', 'f': 'H', 'g': 'H', 'h': 'H'}, 58700],
   {'points': 3578, 'reason': 'roster', 'salary': 58600, 'valid': False}),
  ('partial repair probe: captain duplicated in flex',
   [{'CPT': 'b', 'FLEX': ['e', 'b', 'h', 'g', 'c']},
    {'a': 1333, 'b': 2001, 'c': 2001, 'd': 1795, 'e': 2001, 'f': 1795, 'g': 225, 'h': 2001},
    {'a': 10500, 'b': 9900, 'c': 3300, 'd': 8700, 'e': 7100, 'f': 3300, 'g': 7100, 'h': 5300},
    {'a': 'A', 'b': 'A', 'c': 'H', 'd': 'H', 'e': 'H', 'f': 'A', 'g': 'H', 'h': 'H'}, 47600],
   {'points': 11231, 'reason': 'roster', 'salary': 47600, 'valid': False}),
  ('second regression',
   [{'CPT': 'g', 'FLEX': ['f', 'd', 'g', 'e', 'c']},
    {'a': 1795, 'b': -50, 'c': 1795, 'd': 1795, 'e': -45, 'f': -45, 'g': 1795, 'h': 1333},
    {'a': 9900, 'b': 7100, 'c': 5500, 'd': 5500, 'e': 7100, 'f': 5300, 'g': 9900, 'h': 8700},
    {'a': 'H', 'b': 'H', 'c': 'H', 'd': 'H', 'e': 'H', 'f': 'H', 'g': 'H', 'h': 'A'}, 50000],
   {'points': 7988, 'reason': 'roster', 'salary': 48200, 'valid': False}),
  ('normal control 1',
   [{'CPT': 'e', 'FLEX': ['b', 'd', 'h', 'a', 'g']},
    {'a': 0, 'b': 1333, 'c': -50, 'd': 1795, 'e': -50, 'f': 0, 'g': -50, 'h': 0},
    {'a': 7100, 'b': 8700, 'c': 9900, 'd': 7100, 'e': 5300, 'f': 8700, 'g': 5300, 'h': 3300},
    {'a': 'A', 'b': 'A', 'c': 'H', 'd': 'H', 'e': 'A', 'f': 'A', 'g': 'A', 'h': 'H'}, 39400],
   {'points': 3003, 'reason': 'cap', 'salary': 39500, 'valid': False}),
  ('normal control 2',
   [{'CPT': 'g', 'FLEX': ['c', 'a', 'd', 'h']},
    {'a': 1795, 'b': 1795, 'c': 1333, 'd': 1333, 'e': -50, 'f': -45, 'g': 1333, 'h': 2001},
    {'a': 3300, 'b': 7100, 'c': 9900, 'd': 10500, 'e': 9900, 'f': 5300, 'g': 7100, 'h': 9900},
    {'a': 'A', 'b': 'A', 'c': 'H', 'd': 'H', 'e': 'A', 'f': 'A', 'g': 'A', 'h': 'H'}, 50000],
   {'points': 8462, 'reason': 'roster', 'salary': 44300, 'valid': False}),
  ('normal control 3',
   [{'CPT': 'h', 'FLEX': ['f', 'd', 'e', 'b', 'g']},
    {'a': -45, 'b': 225, 'c': 1795, 'd': 1333, 'e': -50, 'f': -45, 'g': 0, 'h': 0},
    {'a': 8700, 'b': 8700, 'c': 5500, 'd': 5300, 'e': 5300, 'f': 5500, 'g': 7100, 'h': 5500},
    {'a': 'H', 'b': 'A', 'c': 'H', 'd': 'A', 'e': 'H', 'f': 'H', 'g': 'A', 'h': 'A'}, 40200],
   {'points': 1463, 'reason': None, 'salary': 40200, 'valid': True}),
  ('normal control 4',
   [{'CPT': 'd', 'FLEX': ['c', 'a', 'h', 'b', 'e']},
    {'a': -50, 'b': 2001, 'c': 1333, 'd': 1333, 'e': 1333, 'f': 0, 'g': 1333, 'h': 2001},
    {'a': 5500, 'b': 5300, 'c': 8700, 'd': 10500, 'e': 3300, 'f': 10500, 'g': 8700, 'h': 3300},
    {'a': 'H', 'b': 'H', 'c': 'A', 'd': 'H', 'e': 'H', 'f': 'H', 'g': 'H', 'h': 'H'}, 42000],
   {'points': 8618, 'reason': None, 'salary': 41900, 'valid': True})],
 [('regression: captain duplicated in flex',
   [{'CPT': 'c', 'FLEX': ['a', 'h', 'b', 'f', 'c']},
    {'a': 1333, 'b': -50, 'c': 0, 'd': 225, 'e': -50, 'f': 2001, 'g': 2001, 'h': 1333},
    {'a': 3300, 'b': 3300, 'c': 9900, 'd': 8700, 'e': 5300, 'f': 7100, 'g': 9900, 'h': 3300},
    {'a': 'A', 'b': 'A', 'c': 'H', 'd': 'H', 'e': 'A', 'f': 'H', 'g': 'H', 'h': 'A'}, 41900],
   {'points': 4617, 'reason': 'roster', 'salary': 41800, 'valid': False}),
  ('partial repair probe: captain duplicated in flex',
   [{'CPT': 'g', 'FLEX': ['c', 'e', 'b', 'g', 'a']},
    {'a': 1795, 'b': 1795, 'c': -45, 'd': 2001, 'e': -45, 'f': 2001, 'g': 225, 'h': 225},
    {'a': 7100, 'b': 9900, 'c': 3300, 'd': 3300, 'e': 9900, 'f': 5500, 'g': 5500, 'h': 10500},
    {'a': 'A', 'b': 'A', 'c': 'A', 'd': 'A', 'e': 'A', 'f': 'H', 'g': 'A', 'h': 'H'}, 44000],
   {'points': 4063, 'reason': 'roster', 'salary': 44000, 'valid': False}),
  ('second regression',
   [{'CPT': 'd', 'FLEX': ['d', 'h', 'e', 'b', 'a']},
    {'a': 225, 'b': 2001, 'c': 1921, 'd': 1795, 'e': 225, 'f': -50, 'g': 1795, 'h': 1795},
    {'a': 3300, 'b': 5500, 'c': 5300, 'd': 10500, 'e': 9900, 'f': 5300, 'g': 10500, 'h': 5300},
    {'a': 'A', 'b': 'A', 'c': 'A', 'd': 'H', 'e': 'H', 'f': 'A', 'g': 'A', 'h': 'H'}, 50300],
   {'points': 8734, 'reason': 'roster', 'salary': 50300, 'valid': False}),
  ('normal control 1',
   [{'CPT': 'g', 'FLEX': ['g', 'e', 'd', 'b']},
    {'a': 2861, 'b': -45, 'c': 0, 'd': 2001, 'e': 0, 'f': -50, 'g': 1333, 'h': 1156},
    {'a': 3300, 'b': 3300, 'c': 9900, 'd': 8700, 'e': 9900, 'f': 7100, 'g': 7100, 'h': 9900},
    {'a': 'H', 'b': 'A', 'c': 'H', 'd': 'H', 'e': 'H', 'f': 'H', 'g': 'H', 'h': 'H'}, 39700],
   {'points': 5289, 'reason': 'roster', 'salary': 39700, 'valid': False}),
  ('normal control 2',
   [{'CPT': 'd', 'FLEX': ['b', 'c', 'a', 'f', 'g']},
    {'a': 0, 'b': -45, 'c': 1333, 'd': 1333, 'e': -50, 'f': -45, 'g': -50, 'h': 1795},
    {'a': 7100, 'b': 7100, 'c': 5500, 'd': 5300, 'e': 5500, 'f': 9900, 'g': 5300, 'h': 5500},
    {'a': 'H', 'b': 'H', 'c': 'H', 'd': 'A', 'e': 'A', 'f': 'H', 'g': 'H', 'h': 'H'}, 50000],
   {'points': 3193, 'reason': None, 'salary': 42900, 'valid': True}),
  ('normal control 3',
   [{'CPT': 'g', 'FLEX': ['c', 'h', 'b', 'e', 'a']},
    {'a': 1795, 'b': 0, 'c': 1333, 'd': 225, 'e': 2001, 'f': 1333, 'g': 1795, 'h': 1333},
    {'a': 8700, 'b': 5500, 'c': 3300, 'd': 5500, 'e': 10500, 'f': 5300, 'g': 9900, 'h': 9900},
    {'a': 'A', 'b': 'A', 'c': 'A', 'd': 'H', 'e': 'A', 'f': 'H', 'g': 'A', 'h': 'H'}, 52900],
   {'points': 9155, 'reason': None, 'salary': 52800, 'valid': True}),
  ('normal control 4',
   [{'CPT': 'a', 'FLEX': ['c', 'd', 'b', 'e', 'h']},
    {'a': 1333, 'b': -50, 'c': 1333, 'd': 2001, 'e': 1795, 'f': 2001, 'g': 2001, 'h': 225},
    {'a': 5500, 'b': 8700, 'c': 3300, 'd': 5500, 'e': 10500, 'f': 5500, 'g': 8700, 'h': 8700},
    {'a': 'H', 'b': 'A', 'c': 'H', 'd': 'A', 'e': 'A', 'f': 'H', 'g': 'H', 'h': 'H'}, 44900],
   {'points': 7304, 'reason': 'cap', 'salary': 45000, 'valid': False})]]
for label, args, expected in fixtures[N-1]:
    check(label, solve(*args), expected)
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)
Boundary fixtureActualExpectedOutcome
regression: captain duplicated in flex{'points': 2179, 'reason': None, 'salary': 29500, 'valid': True}{'points': 2179, 'reason': 'roster', 'salary': 29500, 'valid': False}Failed
partial repair probe: captain duplicated in flex{'points': 5241, 'reason': 'cap', 'salary': 49800, 'valid': False}{'points': 5241, 'reason': 'roster', 'salary': 49800, 'valid': False}Failed
second regression{'points': 6344, 'reason': None, 'salary': 52800, 'valid': True}{'points': 6344, 'reason': 'roster', 'salary': 52800, 'valid': False}Failed
normal control 1{'points': 6978, 'reason': None, 'salary': 42100, 'valid': True}{'points': 6978, 'reason': None, 'salary': 42100, 'valid': True}Passed
normal control 2{'points': 6511, 'reason': None, 'salary': 35700, 'valid': True}{'points': 6511, 'reason': None, 'salary': 35700, 'valid': True}Passed
normal control 3{'points': 1463, 'reason': 'roster', 'salary': 32500, 'valid': False}{'points': 1463, 'reason': 'roster', 'salary': 32500, 'valid': False}Passed
normal control 4{'points': 8670, 'reason': None, 'salary': 40500, 'valid': True}{'points': 8670, 'reason': None, 'salary': 40500, 'valid': True}Passed

SHA-256 / 10d14f744d7250f98cbc4d6856ffbbd543b77208d0196b296cc8656faaa260c4

HELD IN THE MEMBER ARCHIVE

The verified repair and its recorded checks are member-only.

This mechanism has 7 recorded checks per implementation. The open-access tier publishes the failure and the unsuccessful fix; the repaired source that passes every check, and the observations that prove it, are available to members.

Every case sharing this mechanism uses the same contract and the same repair, so this one record is held back for all of them.

Member access is invitation-based. Sign in with your invited account to inspect the repair.

Sign in to the archive ↗

Verification & scope

A deterministic toy scoring contract stipulated for this example; it is not the rulebook of any real fantasy platform. This reproducer isolates one failure mechanism. Results cover the supplied fixtures. Variants within a family share a test contract and should remain grouped when constructing evaluation splits. Related mechanisms with a shared evaluation_group must also remain together; these controlled models are not independent production incidents.

Observations recorded using Python 3.12.14 at 2026-09-29T14:50:37.017397+00:00.

Case digest / beeb35167e562c2795cd9134d87c4c7c2e603aff727e25864bb8fbf8391e0343