{
  "notes": "Episode 4/10. Read goal state, schema and all five handed results; checked their supplied artifact digests and A1 code hash. No refusals. 21/400 items used before this episode; add 4 in 3 small research batches, total 25, leaving 375 if accepted. No confirmed candidate gain, no submission, no trunk.\n\nLATEST REQUESTER NOTE (02:36Z): the corrected gas rule must appear verbatim in EVERY new brief:\nOOG rule (overrides the objective): V2 itself has rare OOG halts (about 1 per 300k calls). Count OOG for V2 and the candidate on the same seeds and report both; the result is valid when the candidate has no more OOG than V2, so do not stop on V2's OOG and go on to the paired measurement.\nThis supersedes the objective's strict-OOG sentence. Experimental comparisons may have OOG <= exact V2 on identical seeds. Other failures remain invalid. Submission still requires candidate OOG=0, gain >=+0.3 and >2 SE on 4000 fresh seeds. Never substitute a slim baseline for the exact V2 when measuring improvement.\n\nHANDED EVIDENCE:\nb03-board = e02-decomp-board/board, artifact 0213d3489bd92a4b4ae8ffb8e97fd7e444ce296d89c647243298a182823feb97. Snapshot V2 519.6816729770098, first 528.3992637207809, tenth 524.6579809037318; IDs are in b03-board. Paired gaps across 1000 indexed runs: first +8.7176 SE .0631; tenth +4.9763 SE .0471. V2-volume terciles low/mid/high: first targets +7.293/+8.7183/+10.1415; tenth +4.1639/+5.0149/+5.7501. First's retail-volume increases +969.7108/+2320.3221/+3865.4513 Y; mean-fee changes -.531/-1.331/-2.162 bps. Fee slope versus V2 retail volume: V2 1.8299, first 1.1135, tenth 1.0288 bps/10k Y; slopes using each entry's OWN volume are different (.9359 first, .8911 tenth).\nCRITICAL LIMITATION: API publishes total edge and volumes, NOT retail/arb edge or realised sigma. fee*time-averaged-quote volume is only a proxy; total minus that proxy is NOT arb edge. Do not turn residual gains into an arb-saving claim. Means of per-run ratios do not exactly decompose mean edge; the volume/margin table is not causal evidence. Lower fee slope is a symptom, not license to retry failed flow damping.\n\nb04-local = e02-decomp-local/local, artifact 27b38b4fd30bae05991e8f1925f83d2fe75ec097a7a93d3ac0af270cce06d5ad. Top-level n=0/blocked only because the OLD OOG gate; it actually completed all 1000 seeds 10000..10999. Its diagnostic summaries are usable baseline observations under the corrected policy, pending reproduction, not a candidate confirmation. Total 527.1557872684889 SE 2.91401927422812 = retail 555.2406088751605 + arb -28.08482160667154. Rounded low/mid/high (334/333/333): total 433.357/524.809/623.584; retail 457.364/552.461/656.191; arb -24.007/-27.652/-32.607. Fees 34.928/36.932/38.883 bps. All rows reconciled; max |retail+arb-total| 1.3642420526593924e-11. V2 max_ok 243701, OOG 19 over 12 seeds, other_halts 0; Vanilla max_ok 22592, OOG 0. Never discard those 12 seeds. Local mean is 7.4741 above board on different samples; rely on paired gains. Local terciles use different sample sizes from board (333/334/333). Artifact includes engine/type attribution patch and measurement script, not raw rows.\n\nb05-a1 = e02-design-a-position/a1, artifact 372e7282ee336f557b6861ecc8ef6730b4e65b637c6f8018c1d3127c1ecabc9f. Compiling source hash 68cc95b39e04f78af6975f5fbc0781e2edbf644d4fc427ab192d64723bc33f0a, verified here. Blocked on baseline 7 OOG/256 seeds 10000..10255, max 243554; candidate unmeasured, no holdout. First/later predicts next-position badly: observed heuristic error .47823 in V2, not candidate evidence. Recover source; keep uncertainty about first print and prospective last print.\nb05-a2 = e02-design-a-position/a2, artifact bf4c55da9c1f3f7fdf3d3e28c8dc95b77acb63ac4cbc8e1e07bd2073e56aec9e. Baseline-only 1 OOG/256 on 20000..20255, max242807. Counter mixed both contracts. NO code/hash emitted; reconstruct proposal rather than invent a recoverable build. No holdout. Both A ideas remain untested, not losing.\nb06-b1 = e02-design-b-edge/b1, artifact 3114b7dc7d9fdf46e39f8ec85571819a5ac788e3871948a75f6c74d669a9a9fb. Baseline 3 OOG/256 on 30000..30255, max243625. Prototype had 204063 OOG in first 96 seeds, max245494: fundamentally too costly, not rescued by the corrected rule. Eight fee grid points plus five-node arb quadrature/square roots ran inside callbacks. No source/hash or measured economic gain; rebuild as cheap offline table. Do not scale this implementation.\n\nCOMMON HARNESS FINDING: fetched and hash-checked audit artifact 02c134d9ed51858f06d02b6dec25e6922016490f11e3a8174af512a6a77b6569. Its source_files is [{path,content}], not a path-keyed object. harness.py still sets valid=false/exit2 on ANY OOG; merely reusing it can repeat the block. It also builds configs 0..seed_end and slices, allocating millions for holdouts. New briefs repair both: requested configs only; run both markets, compare OOG, retain all rows, reject other errors. The new control independently tests this plus attribution without consuming holdouts. Re-read prior write-up f5de2d1e4002e37761d90e15463ba72b437ee3a948eb8d142f18f0f7740d92a1 sections2/3/6 and simulator rules ddbbaac58282566e0505d895c83daf348487cc322e8c482e61d4d87e6e4628de. Oracle family ceiling +1.19/NP2 remains; replace the mapping.\n\nDECISIONS:\nKeep all 9 queued e03 items: pilot-rerun phase/routing/corridor, position a1/a2/a3, edge b1/b2, pos-scale s1. Their briefs already contain the corrected gas policy; waiting is not failure. No cancel/respawn cycle just for queue latency. e02-gas-room/slim and cancelled e02-design-b-edge/b2 are already running; collect both.\nAdd e04-harness-repair/control (one tested reusable control harness); e04-position-recovery/a1,a2 (the specifically blocked threshold designs, distinct from e03's Poisson blends; reuse A1, reconstruct absent A2); e04-edge-table/table (offline compact optimizer using full estimated retail execution edge, not fee income alone). Each works independently and carries the verbatim override; new designs do NOT wait for the repair item's result. Small pilots, no wide batch before a valid gain. Interaction was actually measured in episode1: best -13.67 SE .40 on 256 training seeds; do not rerun just because the requester listed it among possibly blocked items.\n\nSEED LEDGER: retire 4000000..4079999 permanently, even unused. e03 reserve whole 10k blocks: phase4080000, routing4090000, corridor4100000, a1=4110000, a2=4120000, a3=4130000, b1=4140000, b2=4150000, s1=4160000; each confirms first2000 only. New a1=4170000..4171999 (reserve through4179999); a2=4180000..4181999 (through4189999); table=4190000..4191999 (through4199999). NEXT FREE=4200000. Never reuse any reserved block for a new hash. New training: a1 10000..10255/12000..12511; a2 20000..20255/22000..22511; table 30000..30255/32000..32511. Harness repeats 10000..10255 only; zero-difference control is not a gain.\n\nNEXT: read all 15 pending results listed. Check blocked before assessing an idea; require exact V2 hash, configs, frozen candidate source/hash, separate markets, full paired n=2000, all errors and OOG comparison. Inspect the new control's evidence. If e03 stopped solely on V2 OOG or inherited harness exit logic, rerun only those stopped items using their returned code and the repaired harness, with the exact override and fresh blocks. If candidate OOG exceeds V2, gas repair first. Distinguish missing code from reusable builds. Use slim gas work only after behavior checks; comparator stays V2. Promote only gain>2SE; a credible >+1 family earns independent fresh confirmation and 10-25 training variants. Later freeze a submission candidate and run independent 4000-seed confirmation, no retuning on it, zero candidate OOG. Preserve room for final confirmation/write-up. finish=false; no local simulation or board submission claimed by this episode. Wake on listed batches or 90min; this schedules work and does not sleep.",
  "spawn": [
    {
      "name": "e04-harness-repair",
      "mode": "research",
      "brief": "ONE reusable corrected measurement harness, <60min; this is a control, not a fee-rule search. Clone github.com/benedictbrady/amm-challenge at 6b6921f8d463314aa7c96234e1be25a25245f704 in workspace, never /tmp. Audit https://api.imd.fun/artifacts/02c134d9ed51858f06d02b6dec25e6922016490f11e3a8174af512a6a77b6569: code is exact V2, sha256 28417e116f57f1029fdd1803832e852574902c1ae7253c05657f317db76da4ab; source_files is a list of {path,content}. Extract scratch/setup.sh, instrumentation.patch and harness.py. Run sh scratch/setup.sh once at checkout root; prefix later commands with '. scratch/env.sh && '. Apply instrumentation and rebuild release.\nOOG rule (overrides the objective): V2 itself has rare OOG halts (about 1 per 300k calls). Count OOG for V2 and the candidate on the same seeds and report both; the result is valid when the candidate has no more OOG than V2, so do not stop on V2's OOG and go on to the paired measurement.\nReplace old harness validity/exit logic with paired OOG comparison and complete-seed checks. Reverts, tx errors, bad returns and other halts remain failures. Preserve normal 250000 limits and failure fallback; count candidate/V2 and Vanilla separately, per callback.\nReplace build_configs' 0..seed_end allocation with direct per-seed default_rng draws size U(19,21), rate U(.6,1), sigma U(.000882,.001008), then build_config; price seed=seed, retail seed+1. Verify equality to MatchRunner on a small training slice and verify allocation scales with requested n.\nRecover exact retail/arb attribution from the engine/types hunks of https://api.imd.fun/artifacts/27b38b4fd30bae05991e8f1925f83d2fe75ec097a7a93d3ac0af270cce06d5ad (do not duplicate its competing gas patch). Reconcile retail+arb with total per seed; time-mean fee times volume is not retail edge.\nRun V2 twice independently vs Vanilla on 10000..10255, run_batch(...,8), 10000 steps. Expect bit-identical edges, paired mean 0, and matching OOG (prior result 7); report discrepancies, never overwrite them. Retain forced-failure counter checks as separately labelled diagnostics excluded from scored runs. No confirmation seeds.\nReturn JSON with V2 code/sha256, source_files[{path,content}] for corrected harness/config builder/instrumentation/setup, tests and commands, paired{n,mean_diff,se,worst} labelled control, per-role/callback gas{max_ok,oog,other_errors}, real retail/arb/total summaries and reconciliation error. Include the unchanged setup script so later items can reproduce. Report blocked{step,error}, paired.n=0 only on actual setup/runtime failure; V2 OOG alone is not blocked.",
      "items": [
        {
          "key": "control",
          "vars": {}
        }
      ],
      "output": {
        "format": "json",
        "maxBytes": 64000
      }
    },
    {
      "name": "e04-position-recovery",
      "mode": "research",
      "brief": "ONE experiment, <60min. {{task}}\nRead rules https://api.imd.fun/artifacts/ddbbaac58282566e0505d895c83daf348487cc322e8c482e61d4d87e6e4628de and prior report https://api.imd.fun/artifacts/f5de2d1e4002e37761d90e15463ba72b437ee3a948eb8d142f18f0f7740d92a1 sections 2,3,6. Runtime uses observable inputs only.\nClone github.com/benedictbrady/amm-challenge at 6b6921f8d463314aa7c96234e1be25a25245f704 in workspace, never /tmp. Audit https://api.imd.fun/artifacts/02c134d9ed51858f06d02b6dec25e6922016490f11e3a8174af512a6a77b6569: code is exact V2, sha256 28417e116f57f1029fdd1803832e852574902c1ae7253c05657f317db76da4ab; source_files is a list of {path,content}. Extract scratch/setup.sh, instrumentation.patch and harness.py. Run sh scratch/setup.sh once at checkout root; prefix later commands with '. scratch/env.sh && '. Apply instrumentation and rebuild release.\nOOG rule (overrides the objective): V2 itself has rare OOG halts (about 1 per 300k calls). Count OOG for V2 and the candidate on the same seeds and report both; the result is valid when the candidate has no more OOG than V2, so do not stop on V2's OOG and go on to the paired measurement.\nFix the audit's strict valid/exit tests: compare OOG after BOTH runs; other errors invalidate. Build only requested configs, not 0..seed_end: default_rng(seed), draws size/rate/sigma as MatchRunner._build_configs; price seed=seed, retail seed+1. Separate amm_sim_rs.run_batch(X,VanillaStrategy,configs,8) for candidate and V2, never head-to-head. Keep 10000 steps and 250000 gas; count all callbacks by role, including swallowed failures.\nTune <=6 variants on {{train}}, top two on {{screen}}, all within 10000..99999. Trim gas if candidate OOG exceeds V2; remove unused updates. Freeze ONE code/hash before exactly one confirmation on {{holdout}} (2000 seeds); no retuning/reselection afterward. Reserve 20min for confirmation.\nTargets by V2-retail-volume tercile: +4.1639/+5.0149/+5.7501 for top10; +7.293/+8.7183/+10.1415 for first. Board fee*volume is NOT retail edge. Report true retail/arb edge via engine accumulators and paired total gains by V2 volume tercile.\nReturn JSON: full code, sha256, tuning, freeze record, seed ranges, paired{n,mean_diff,se,worst}, gas for candidate/V2{max_ok,oog,other_errors,init_max,call_counts}, method/patches. se=sampleSD(d)/sqrt(n); worst=5 seed/diff rows. Setup/runtime failure: blocked{step,error}, paired.n=0; retain partial diagnostics and code.",
      "items": [
        {
          "key": "a1",
          "vars": {
            "task": "Recover blocked e02 A1 from https://api.imd.fun/artifacts/372e7282ee336f557b6861ecc8ef6730b4e65b637c6f8018c1d3127c1ecabc9f, code sha256 68cc95b39e04f78af6975f5fbc0781e2edbf644d4fc427ab192d64723bc33f0a. Screen its original first/later mapping plus midpoint/skew pairs (28bps,0.6),(28,0.8),(32,0.6),(32,0.8),(36,0.8). Keep estimators; a first callback can be retail and the last cannot be known prospectively.",
            "train": "10000..10255",
            "screen": "12000..12511",
            "holdout": "4170000..4171999"
          }
        },
        {
          "key": "a2",
          "vars": {
            "task": "Recover blocked e02 A2; it emitted NO code, so reconstruct its proposal from V2. First one or two observed prints: retailFee=15bps+k*sizeHat, k in {0.5,0.75,1}; later: BASE_FEE+sigmaHat+FLOW_SIZE_COEF*lambdaHat*sizeHat. Keep V2 side displacement. This tests a count threshold, not the queued Poisson blend; first/last trade type is unobservable.",
            "train": "20000..20255",
            "screen": "22000..22511",
            "holdout": "4180000..4181999"
          }
        }
      ],
      "output": {
        "format": "json",
        "maxBytes": 64000
      }
    },
    {
      "name": "e04-edge-table",
      "mode": "research",
      "brief": "ONE experiment, <60min. {{task}}\nRead rules https://api.imd.fun/artifacts/ddbbaac58282566e0505d895c83daf348487cc322e8c482e61d4d87e6e4628de and prior report https://api.imd.fun/artifacts/f5de2d1e4002e37761d90e15463ba72b437ee3a948eb8d142f18f0f7740d92a1 sections 2,3,6. Runtime uses observable inputs only.\nClone github.com/benedictbrady/amm-challenge at 6b6921f8d463314aa7c96234e1be25a25245f704 in workspace, never /tmp. Audit https://api.imd.fun/artifacts/02c134d9ed51858f06d02b6dec25e6922016490f11e3a8174af512a6a77b6569: code is exact V2, sha256 28417e116f57f1029fdd1803832e852574902c1ae7253c05657f317db76da4ab; source_files is a list of {path,content}. Extract scratch/setup.sh, instrumentation.patch and harness.py. Run sh scratch/setup.sh once at checkout root; prefix later commands with '. scratch/env.sh && '. Apply instrumentation and rebuild release.\nOOG rule (overrides the objective): V2 itself has rare OOG halts (about 1 per 300k calls). Count OOG for V2 and the candidate on the same seeds and report both; the result is valid when the candidate has no more OOG than V2, so do not stop on V2's OOG and go on to the paired measurement.\nFix the audit's strict valid/exit tests: compare OOG after BOTH runs; other errors invalidate. Build only requested configs, not 0..seed_end: default_rng(seed), draws size/rate/sigma as MatchRunner._build_configs; price seed=seed, retail seed+1. Separate amm_sim_rs.run_batch(X,VanillaStrategy,configs,8) for candidate and V2, never head-to-head. Keep 10000 steps and 250000 gas; count all callbacks by role, including swallowed failures.\nTune <=6 variants on {{train}}, top two on {{screen}}, all within 10000..99999. Trim gas if candidate OOG exceeds V2; remove unused updates. Freeze ONE code/hash before exactly one confirmation on {{holdout}} (2000 seeds); no retuning/reselection afterward. Reserve 20min for confirmation.\nTargets by V2-retail-volume tercile: +4.1639/+5.0149/+5.7501 for top10; +7.293/+8.7183/+10.1415 for first. Board fee*volume is NOT retail edge. Report true retail/arb edge via engine accumulators and paired total gains by V2 volume tercile.\nReturn JSON: full code, sha256, tuning, freeze record, seed ranges, paired{n,mean_diff,se,worst}, gas for candidate/V2{max_ok,oog,other_errors,init_max,call_counts}, method/patches. se=sampleSD(d)/sqrt(n); worst=5 seed/diff rows. Setup/runtime failure: blocked{step,error}, paired.n=0; retain partial diagnostics and code.",
      "items": [
        {
          "key": "table",
          "vars": {
            "task": "Replace B1's costly runtime grid with an OFFLINE-generated per-side lookup table over signed spot/pHat gap, sigmaHat and print-count bucket. Use exact router equation with stated normalizer-state assumptions; optimize expected total retail edge (gross flows at estimated fair value, not fee revenue alone) minus expected arb loss. Tune <=6 table calibrations; runtime <=4 lookups, no fee-grid/quadrature loops. Ship table generator and embedded constants; no runtime true price.",
            "train": "30000..30255",
            "screen": "32000..32511",
            "holdout": "4190000..4191999"
          }
        }
      ],
      "output": {
        "format": "json",
        "maxBytes": 64000
      }
    }
  ],
  "read": [
    "e02-design-b-edge/b2",
    "e02-gas-room/slim",
    "e03-pilot-rerun/phase",
    "e03-pilot-rerun/routing",
    "e03-pilot-rerun/corridor",
    "e03-design-a-position/a1",
    "e03-design-a-position/a2",
    "e03-design-a-position/a3",
    "e03-design-b-edge/b1",
    "e03-design-b-edge/b2",
    "e03-pos-scale/s1",
    "e04-harness-repair/control",
    "e04-position-recovery/a1",
    "e04-position-recovery/a2",
    "e04-edge-table/table"
  ],
  "cancel": [],
  "wake": {
    "batches": [
      "e02-design-b-edge",
      "e02-gas-room",
      "e03-pilot-rerun",
      "e03-design-a-position",
      "e03-design-b-edge",
      "e03-pos-scale",
      "e04-harness-repair",
      "e04-position-recovery",
      "e04-edge-table"
    ],
    "afterMinutes": 90
  },
  "finish": false
}
