{
  "key": "f-fill-burst-pause",
  "mech": "fill burst pause",
  "approach": "Blind subclass overlay of incumbent N. On each side, two positive aggregate fill observations in a rolling three-callback window trigger a pause of P callbacks including the triggering callback. Further bursts extend the deadline. Suppress new orders and cancel resting orders on that side, respecting N cancellations. All spreads are eligible, fixed before tuning. Select P by overall paired tuning gain; freeze for holdout. This is a screen, not a promotion.",
  "tried": [
    {
      "P": 3,
      "spreads_acted": [
        1,
        2,
        3,
        4
      ]
    },
    {
      "P": 5,
      "spreads_acted": [
        1,
        2,
        3,
        4
      ]
    },
    {
      "P": 10,
      "spreads_acted": [
        1,
        2,
        3,
        4
      ]
    }
  ],
  "next": "Do not promote from this screen. Discard this overlay: the frozen holdout mean gain is nonpositive.",
  "spreads_acted": [
    1,
    2,
    3,
    4
  ],
  "off_equals_n": {
    "passed": true,
    "seeds": "310000..310009",
    "n": 10,
    "steps_compared": 20000,
    "method": "Independent N and disabled overlay instances receive the same state at every callback; exact action-list equality asserted. This check ran before the active-branch cancellation repair; disabled early return is unchanged."
  },
  "code": "from orderbook_pm_challenge.types import PlaceOrder as _FBPlace, CancelOrder as _FBCancel, Side as _FBSide, CancelAll as _FBAll\n\nclass Strategy(_N):\n    # Set to zero to disable; selected value is frozen after tuning.\n    PAUSE_STEPS = 3\n    SPREADS_ACTED = (1, 2, 3, 4)\n\n    def on_step(self, state):\n        actions = list(super().on_step(state))\n        if self.PAUSE_STEPS <= 0 or self.s not in self.SPREADS_ACTED:\n            return actions\n        if state.step == 0 or not hasattr(self, '_fb_history'):\n            self._fb_history = {_FBSide.BUY: [], _FBSide.SELL: []}\n            self._fb_until = {_FBSide.BUY: -1, _FBSide.SELL: -1}\n        for side, quantity in ((_FBSide.BUY, state.buy_filled_quantity),\n                               (_FBSide.SELL, state.sell_filled_quantity)):\n            recent = [t for t in self._fb_history[side] if t >= state.step - 2]\n            if quantity > 0:\n                recent.append(state.step)\n                if len(recent) >= 2:\n                    self._fb_until[side] = state.step + self.PAUSE_STEPS\n            self._fb_history[side] = recent\n        paused = {side for side in self._fb_until if state.step < self._fb_until[side]}\n        if not paused:\n            return actions\n        # Cancel first, including any resting order N would otherwise retain.\n        cancelled = {a.order_id for a in actions if isinstance(a, _FBCancel)}\n        clears_all = any(isinstance(a, _FBAll) for a in actions)\n        cancels = [] if clears_all else [_FBCancel(order.order_id) for order in state.own_orders\n                                        if order.side in paused and order.order_id not in cancelled]\n        return cancels + [a for a in actions if not (isinstance(a, _FBPlace) and a.side in paused)]\n",
  "code_sha256": "2a22a9a8b3c0d17c1f8e72625c012be77d77a60cc975b257b9e6496cfbea2999",
  "assembled_sha256": "ef974511c0fca4d786f58fc947b24d9fae223cbb70be92b29c6524ccfbaeae7c",
  "tuning": {
    "seeds": "320000..320199",
    "selected": {
      "P": 3,
      "spreads_acted": [
        1,
        2,
        3,
        4
      ],
      "criterion": "maximum overall mean paired difference; freeze before holdout"
    },
    "variants": {
      "3": {
        "overall": {
          "n": 200,
          "sum_d": -6333.8976556607995,
          "sum_d2": 670183.0571259571,
          "mean_diff": -31.669488278303998,
          "se": 3.434936379140737,
          "incumbent_mean": 98.47071831456549,
          "candidate_mean": 66.8012300362615,
          "retail_diff": -30.473723579839003,
          "arb_diff": -1.1957646985450001
        },
        "by_spread": {
          "1": {
            "n": 50,
            "sum_d": -686.1498348238,
            "sum_d2": 105644.05788934683,
            "mean_diff": -13.722996696476,
            "se": 6.267116186493521,
            "incumbent_mean": 25.711261479664,
            "candidate_mean": 11.988264783187999,
            "retail_diff": -11.564439499974,
            "arb_diff": -2.15855719658
          },
          "2": {
            "n": 50,
            "sum_d": -654.0766723019,
            "sum_d2": 27499.7791218188,
            "mean_diff": -13.081533446038,
            "se": 2.780651315336197,
            "incumbent_mean": 61.219908510538,
            "candidate_mean": 48.138375064499996,
            "retail_diff": -15.424235539298001,
            "arb_diff": 2.3427020931860003
          },
          "3": {
            "n": 48,
            "sum_d": -1670.4477545508,
            "sum_d2": 138877.63786930367,
            "mean_diff": -34.800994886475,
            "se": 5.982554206507631,
            "incumbent_mean": 130.8342429047854,
            "candidate_mean": 96.03324801831042,
            "retail_diff": -38.00927493015208,
            "arb_diff": 3.208280043408333
          },
          "4": {
            "n": 52,
            "sum_d": -3323.2233939843,
            "sum_d2": 398161.58224548784,
            "mean_diff": -63.90814219200577,
            "se": 8.369766865222841,
            "incumbent_mean": 174.37579815333268,
            "candidate_mean": 110.46765596132693,
            "retail_diff": -56.17049552609423,
            "arb_diff": -7.737646665825001
          }
        }
      },
      "5": {
        "overall": {
          "n": 200,
          "sum_d": -8255.7154071601,
          "sum_d2": 1130781.617272693,
          "mean_diff": -41.2785770358005,
          "se": 4.455242050659489,
          "incumbent_mean": 98.47071831456549,
          "candidate_mean": 57.192141278765,
          "retail_diff": -39.2934614801505,
          "arb_diff": -1.9851155557275004
        },
        "by_spread": {
          "1": {
            "n": 50,
            "sum_d": -545.0839634366,
            "sum_d2": 38901.631868175005,
            "mean_diff": -10.901679268732,
            "se": 3.667802618833018,
            "incumbent_mean": 25.711261479664,
            "candidate_mean": 14.809582210932001,
            "retail_diff": -11.320953428972,
            "arb_diff": 0.41927416024199987
          },
          "2": {
            "n": 50,
            "sum_d": -1057.8715584334,
            "sum_d2": 94459.97481560403,
            "mean_diff": -21.157431168667998,
            "se": 5.42398791961653,
            "incumbent_mean": 61.219908510538,
            "candidate_mean": 40.06247734187,
            "retail_diff": -23.536649879184,
            "arb_diff": 2.3792187105080003
          },
          "3": {
            "n": 48,
            "sum_d": -2312.675010598,
            "sum_d2": 254806.76556075035,
            "mean_diff": -48.180729387458335,
            "se": 7.97214779011323,
            "incumbent_mean": 130.8342429047854,
            "candidate_mean": 82.65351351732708,
            "retail_diff": -50.297965508718754,
            "arb_diff": 2.1172361210104165
          },
          "4": {
            "n": 52,
            "sum_d": -4340.0848746921,
            "sum_d2": 742613.2450281637,
            "mean_diff": -83.46317066715577,
            "se": 11.976220790067364,
            "incumbent_mean": 174.37579815333268,
            "candidate_mean": 90.91262748617692,
            "retail_diff": -71.18288050391924,
            "arb_diff": -12.280290163298078
          }
        }
      },
      "10": {
        "overall": {
          "n": 200,
          "sum_d": -11214.3508274945,
          "sum_d2": 2059035.1174692945,
          "mean_diff": -56.071754137472496,
          "se": 5.994609796268153,
          "incumbent_mean": 98.47071831456549,
          "candidate_mean": 42.398964177093006,
          "retail_diff": -56.887432458622996,
          "arb_diff": 0.8156783210929998
        },
        "by_spread": {
          "1": {
            "n": 50,
            "sum_d": -971.5870721652001,
            "sum_d2": 181479.1081077091,
            "mean_diff": -19.431741443304002,
            "se": 8.146602630613428,
            "incumbent_mean": 25.711261479664,
            "candidate_mean": 6.27952003636,
            "retail_diff": -22.291005998602,
            "arb_diff": 2.8592645552899993
          },
          "2": {
            "n": 50,
            "sum_d": -1704.2403157152,
            "sum_d2": 259098.2788998089,
            "mean_diff": -34.084806314304004,
            "se": 9.057854361995089,
            "incumbent_mean": 61.219908510538,
            "candidate_mean": 27.135102196234,
            "retail_diff": -37.297362862242,
            "arb_diff": 3.212556547932
          },
          "3": {
            "n": 48,
            "sum_d": -3116.0625905632,
            "sum_d2": 481421.12663652294,
            "mean_diff": -64.91797063673333,
            "se": 11.12335466516934,
            "incumbent_mean": 130.8342429047854,
            "candidate_mean": 65.91627226805208,
            "retail_diff": -71.43908196518957,
            "arb_diff": 6.521111328277083
          },
          "4": {
            "n": 52,
            "sum_d": -5422.4608490509,
            "sum_d2": 1137036.6038252537,
            "mean_diff": -104.27809325097884,
            "se": 14.68103204888592,
            "incumbent_mean": 174.37579815333268,
            "candidate_mean": 70.09770490235384,
            "retail_diff": -95.55754066064038,
            "arb_diff": -8.72055259038077
          }
        }
      }
    }
  },
  "paired": {
    "seeds": "430000..430499",
    "n": 500,
    "complete": true,
    "missing_seeds": [],
    "overall": {
      "n": 500,
      "sum_d": -17903.8776298552,
      "sum_d2": 2614495.5183643596,
      "mean_diff": -35.8077552597104,
      "se": 2.8123673693917803,
      "incumbent_mean": 95.54201511346659,
      "candidate_mean": 59.7342598537562,
      "retail_diff": -32.9534584382326,
      "arb_diff": -2.8542968215076003
    },
    "by_spread": {
      "1": {
        "n": 131,
        "sum_d": -1999.2488292099,
        "sum_d2": 410228.28890686075,
        "mean_diff": -15.26144144435038,
        "se": 4.721963461249037,
        "incumbent_mean": 38.277936657049615,
        "candidate_mean": 23.016495212699237,
        "retail_diff": -11.257537216320609,
        "arb_diff": -4.003904227987786
      },
      "2": {
        "n": 120,
        "sum_d": -3353.9731194349,
        "sum_d2": 477080.3811697522,
        "mean_diff": -27.949775995290835,
        "se": 5.181155142683668,
        "incumbent_mean": 77.8558643979175,
        "candidate_mean": 49.906088402626665,
        "retail_diff": -26.736898757901667,
        "arb_diff": -1.2128772374158343
      },
      "3": {
        "n": 133,
        "sum_d": -6595.9192586621,
        "sum_d2": 987978.7634447229,
        "mean_diff": -49.593377884677444,
        "se": 6.135409290397006,
        "incumbent_mean": 146.55140363646615,
        "candidate_mean": 96.95802575178872,
        "retail_diff": -47.81352381256015,
        "arb_diff": -1.7798540722390974
      },
      "4": {
        "n": 116,
        "sum_d": -5954.7364225483,
        "sum_d2": 739208.0848430239,
        "mean_diff": -51.33393467714051,
        "se": 5.70073270697963,
        "incumbent_mean": 120.02204692465259,
        "candidate_mean": 68.68811224751207,
        "retail_diff": -46.847976946203445,
        "arb_diff": -4.485957730945691
      }
    }
  },
  "failures": {
    "screen": [],
    "development": [
      {
        "seed": 320000,
        "strategy": "3",
        "s": 4,
        "total": -0.0013076645,
        "retail": 0.0,
        "arb": -0.0013076645,
        "failed": true,
        "error": "orderbook_pm_challenge.market.OrderBookError: Unknown participant order: order-102",
        "seconds": 0.0007689632475376129
      }
    ],
    "repair": "Initial P=3 attempt on tuning seed 320000 duplicated a cancellation already issued by N. Deduplicated against CancelOrder and CancelAll, then reran only that failed candidate. Its partial edge is excluded. Each successful (seed, strategy) run is unique; the already completed N run was reused. No holdout retries."
  },
  "check_values": [
    {
      "seed": 310000,
      "total_edge": 17.1160017503,
      "rounded_6dp": 17.116002,
      "expected": 17.116002,
      "matches": true
    },
    {
      "seed": 310001,
      "total_edge": 20.0171113118,
      "rounded_6dp": 20.017111,
      "expected": 20.017111,
      "matches": true
    },
    {
      "seed": 310002,
      "total_edge": 2.3903113616,
      "rounded_6dp": 2.390311,
      "expected": 2.390311,
      "matches": true
    },
    {
      "seed": 310003,
      "total_edge": 241.4847522404,
      "rounded_6dp": 241.484752,
      "expected": 241.484752,
      "matches": true
    }
  ],
  "python_version": "3.12.3",
  "seconds_per_simulation": 0.25430898156572773,
  "incumbent_code_sha256": "bf0d179f3e47d28819f6fa7e0d25548c2ced43374c216d36460b00a26a26ffae",
  "validation": {
    "simulator_commit": "b244530ee2a6247b5f930830eeca9dd950da0e7e",
    "default_config": true,
    "default_parameter_variance": true,
    "steps": 2000,
    "serial": true,
    "sandbox": false,
    "simulator_integrity": "All 18 downloaded simulator, docs, and package files match the pinned Git tree blob hashes.",
    "synthetic_tests": "Passed window inclusion/exclusion, exact pause expiry, side isolation, resting cancellations, disabled behavior, spread gate, N CancelAll and CancelOrder deduplication.",
    "limitations": "StepState aggregates same-step fills: two individual executions in one step cannot be distinguished from one. Burst uses two positive callback observations within steps t-2..t. No finalist seeds used."
  }
}
