{
  "key": "f5-fill-streak",
  "mechanism": "Consecutive same-side own fills trigger side cancellation and no placements on that side for a callback cooldown.",
  "approach": "Blind subclass of verified RC. Infer spread once from first rival quotes. Track positive own-fill streaks independently by side; on threshold drop same-side PlaceOrder actions and add CancelOrder for live same-side orders. Four fixed streak/cooldown variants screened on all target spreads, then one frozen holdout.",
  "tried": [
    {
      "name": "s2c1",
      "streak": 2,
      "cooldown": 1,
      "code_sha256": "99fb8530f0049eb3184b34d484f278d5af068ed20857009ae1c5aaa265014202",
      "mean_diff": -21.842599472377,
      "se": 3.083672540774425,
      "tuning": {
        "mean_diff": -21.842599472377,
        "se": 3.083672540774425,
        "n": 200
      }
    },
    {
      "name": "s2c2",
      "streak": 2,
      "cooldown": 2,
      "code_sha256": "2c09224be6e76672e4215b925a5f6c2b5f7d10489f90d8418e0fdba87750f417",
      "mean_diff": -23.1122960577795,
      "se": 3.515926263803514,
      "tuning": {
        "mean_diff": -23.1122960577795,
        "se": 3.515926263803514,
        "n": 200
      }
    },
    {
      "name": "s3c1",
      "streak": 3,
      "cooldown": 1,
      "code_sha256": "46d640af8edb010244c9ea1e7b6a70ab8e9c4bb544e0a62fec767d534769abac",
      "mean_diff": -14.666636348272,
      "se": 2.382503656151482,
      "tuning": {
        "mean_diff": -14.666636348272,
        "se": 2.382503656151482,
        "n": 200
      }
    },
    {
      "name": "s3c2",
      "streak": 3,
      "cooldown": 2,
      "code_sha256": "0c800a05945c3e1ef2e1730cfe81f0d6bac04c85df527691e602ec5deab4009b",
      "mean_diff": -18.1504273771395,
      "se": 5.27360813245267,
      "tuning": {
        "mean_diff": -18.1504273771395,
        "se": 5.27360813245267,
        "n": 200
      }
    }
  ],
  "next": "Retain RC; this is a screen, not a promotion. Do not retune on these holdout seeds.",
  "spreads_acted": [
    1,
    2,
    3,
    4
  ],
  "off_equals_rc": true,
  "code": "from orderbook_pm_challenge.types import PlaceOrder, CancelOrder, Side\n\nclass Strategy(_RC):\n    \"\"\"Cancel a repeatedly filled side for a short callback cooldown.\"\"\"\n    fill_streak_threshold = 3\n    fill_cooldown_callbacks = 1\n    fill_streak_enabled = True\n\n    def on_step(self, state):\n        actions = super().on_step(state)\n        if not self.fill_streak_enabled:\n            return actions\n        if not hasattr(self, '_fs_spread'):\n            bid = state.competitor_best_bid_ticks\n            ask = state.competitor_best_ask_ticks\n            if bid is None or ask is None:\n                return actions\n            self._fs_spread = max(1, (ask - bid + 1) // 2)\n            self._fs_counts = {Side.BUY: 0, Side.SELL: 0}\n            self._fs_until = {Side.BUY: -1, Side.SELL: -1}\n            self._fs_previous_step = state.step - 1\n        if self._fs_spread not in (1, 2, 3, 4):\n            return actions\n        if state.step != self._fs_previous_step + 1:\n            self._fs_counts = {Side.BUY: 0, Side.SELL: 0}\n        self._fs_previous_step = state.step\n        for side, filled in ((Side.BUY, state.buy_filled_quantity),\n                             (Side.SELL, state.sell_filled_quantity)):\n            self._fs_counts[side] = self._fs_counts[side] + 1 if filled > 0 else 0\n            if self._fs_counts[side] >= self.fill_streak_threshold:\n                self._fs_until[side] = state.step + self.fill_cooldown_callbacks - 1\n                self._fs_counts[side] = 0\n        blocked = {side for side in (Side.BUY, Side.SELL)\n                   if state.step <= self._fs_until[side]}\n        if not blocked:\n            return actions\n        result = [action for action in actions\n                  if not (isinstance(action, PlaceOrder) and action.side in blocked)]\n        canceled = {action.order_id for action in result if isinstance(action, CancelOrder)}\n        for order in state.own_orders:\n            if order.side in blocked and order.order_id not in canceled:\n                result.append(CancelOrder(order.order_id))\n        return result\n",
  "code_sha256": "46d640af8edb010244c9ea1e7b6a70ab8e9c4bb544e0a62fec767d534769abac",
  "assembled_sha256": "836bde64e6ccc94aa668b6c3625704ceeba9097e2f1863cc5919204a2b4c2da2",
  "comparator_sha256": "3c07bdcd221ac25729c3ebc92b21ac9e2014510ecb85816c4391ed81e933291f",
  "tuning": {
    "seeds": {
      "start": 330000,
      "end": 330199
    },
    "n": 200,
    "complete": true,
    "missing_seeds": [],
    "overall": {
      "n": 200,
      "sum_d": -2933.3272696544,
      "sum_d2": 268939.7264831828,
      "mean_diff": -14.666636348272,
      "se": 2.382503656151482,
      "comparator_mean": 97.4672213329115,
      "candidate_mean": 82.8005849846395,
      "retail_diff": -10.898288641693998,
      "arb_diff": -3.7683477065615
    },
    "by_spread": {
      "1": {
        "n": 54,
        "sum_d": -609.4383653364,
        "sum_d2": 147030.94427240617,
        "mean_diff": -11.285895654377779,
        "se": 6.997875450614123,
        "comparator_mean": 46.182844338938885,
        "candidate_mean": 34.89694868456111,
        "retail_diff": -7.164291741968516,
        "arb_diff": -4.121603912427777
      },
      "2": {
        "n": 57,
        "sum_d": -559.4350653534999,
        "sum_d2": 27273.272263330753,
        "mean_diff": -9.814650269359648,
        "se": 2.612302968818712,
        "comparator_mean": 87.23571902150526,
        "candidate_mean": 77.42106875214562,
        "retail_diff": -7.588518035238596,
        "arb_diff": -2.2261322340561396
      },
      "3": {
        "n": 49,
        "sum_d": -718.0460613798,
        "sum_d2": 40980.86706660317,
        "mean_diff": -14.65400125264898,
        "se": 3.598623791165423,
        "comparator_mean": 112.87398754092447,
        "candidate_mean": 98.2199862882755,
        "retail_diff": -12.944759973046937,
        "arb_diff": -1.7092412795877556
      },
      "4": {
        "n": 40,
        "sum_d": -1046.4077775847,
        "sum_d2": 53654.64288084271,
        "mean_diff": -26.1601944396175,
        "se": 4.104438807020546,
        "comparator_mean": 162.4077324637125,
        "candidate_mean": 136.247538024095,
        "retail_diff": -18.148680189615,
        "arb_diff": -8.011514250005
      }
    }
  },
  "tuning_score": -14.666636348272,
  "selection": {
    "variant": "s3c1",
    "rule": "Maximum paired mean on tuning seeds 330000..330199; all spreads 1..4; tie order s2c1,s2c2,s3c1,s3c2.",
    "frozen_before_holdout": true
  },
  "paired": {
    "seeds": {
      "start": 440000,
      "end": 440499
    },
    "n": 500,
    "complete": true,
    "missing_seeds": [],
    "overall": {
      "n": 500,
      "sum_d": -6268.6318451217,
      "sum_d2": 504783.3263799744,
      "mean_diff": -12.537263690243401,
      "se": 1.3069750231986212,
      "comparator_mean": 101.4369248623788,
      "candidate_mean": 88.8996611721354,
      "retail_diff": -10.679297445304401,
      "arb_diff": -1.8579662449586
    },
    "by_spread": {
      "1": {
        "n": 142,
        "sum_d": -665.2655157877999,
        "sum_d2": 82368.37706173873,
        "mean_diff": -4.684968421040844,
        "se": 1.989529443432883,
        "comparator_mean": 28.7146791778493,
        "candidate_mean": 24.02971075680845,
        "retail_diff": -5.031696567379578,
        "arb_diff": 0.3467281462971832
      },
      "2": {
        "n": 110,
        "sum_d": -856.7043690399001,
        "sum_d2": 43090.96738704888,
        "mean_diff": -7.788221536726365,
        "se": 1.7428219035843586,
        "comparator_mean": 88.78927784058273,
        "candidate_mean": 81.00105630385636,
        "retail_diff": -8.055513243273635,
        "arb_diff": 0.26729170649636363
      },
      "3": {
        "n": 119,
        "sum_d": -1709.8869330522998,
        "sum_d2": 137486.5581687409,
        "mean_diff": -14.368797756742016,
        "se": 2.8357387453094285,
        "comparator_mean": 143.37780997585293,
        "candidate_mean": 129.00901221911093,
        "retail_diff": -15.824319237988236,
        "arb_diff": 1.455521481237815
      },
      "4": {
        "n": 129,
        "sum_d": -3036.7750272417,
        "sum_d2": 241837.42376244586,
        "mean_diff": -23.540891684044187,
        "se": 3.2119590133701026,
        "comparator_mean": 153.5829305298,
        "candidate_mean": 130.0420388457558,
        "retail_diff": -14.38718886824496,
        "arb_diff": -9.153702815778294
      }
    }
  },
  "failures": [],
  "check_values": {
    "310000": 17.5126554022,
    "310001": 20.6298693268,
    "310002": 2.3903113616,
    "310003": 248.006347259
  },
  "python_version": "3.12.3",
  "seconds_per_simulation": 0.5381892367664595,
  "validation": {
    "simulator_commit": "b244530ee2a6247b5f930830eeca9dd950da0e7e",
    "simulator_unmodified": true,
    "default_ChallengeConfig": true,
    "default_ParameterVariance": true,
    "steps": 2000,
    "single_process": true,
    "sandbox": false,
    "max_seeds_per_command": 50,
    "off_action_equality": {
      "start": 320000,
      "end": 320002,
      "all_callbacks": true
    },
    "off_full_result_equality": true,
    "assembled_result_equality": {
      "start": 320000,
      "end": 320002,
      "equal": true
    },
    "synthetic_checks": [
      "both sides for all four variants",
      "cooldown duration and expiry",
      "disabled action identity",
      "out-of-target spread action identity",
      "interrupted fill streak and nonconsecutive callback reset",
      "all four target spreads and simultaneous side triggers",
      "existing cancellation deduplication"
    ],
    "off_target_d_exactly_zero": true,
    "off_target_sampled_n": 0,
    "assembly_rename": "Final exported class Strategy declaration renamed _RC; earlier declarations preserved.",
    "assembly_separator": "\n",
    "seed_record_uniqueness": true,
    "one_record_per_strategy_per_seed": true,
    "tuning_holdout_disjoint": true,
    "finalist_seeds_used": false
  },
  "notes": [
    "Cooldown includes the triggering callback; length two also suppresses the next callback.",
    "Streak counters reset on a zero-fill callback or a triggered cooldown.",
    "Retail and arbitrage differences are paired means. Spread groups use sampled config spread.",
    "Sources support simulator API and setup; scores, hashes and equality checks are local measurements."
  ]
}
