{
  "notes": "EPISODE 9 (goal: lift NP2 on Paradigm AMM fee challenge; need paired +5.8 for top 10, +9.6 for 1st vs NP2 526.1156 on seeds 0..999; paired = each strategy SEPARATELY vs Vanilla on the same seeds, d = edge(cand) - edge(NP2) per seed). Episode 10 is the LAST: it reads, sets finish true and writes the deliverable; it cannot spawn readable work.\nSTATE AT START (~19:40Z): handed ep7-stack/stack-a, stack-b, ep7-mix/mix-a, mix-b, ep7-late/unc-b, ep6-oracle/ceil-b, ep3-base/decomp, ep3-mech/merge-01, ep4-lean/lean-a. ep8's four batches (15 sweep items on NP2 + 4 stack items on NP2) had NOT started. Still running: ep5-mech x6, ep6-oracle/ceil-a, ep7-late/later-a, ep5-err/err-a. No refusals, no stalls. Items 83 used before this episode; cancel 14 waiting (ep8-stack 4, ep8-sweep-f22 5, ep8-sweep-f32 5), spawn 16 => 85 of 400.\nRESULTS (all valid separate-vs-Vanilla, confirm n 2000):\n- ep7-stack/stack-b: +0.477 se 0.017 (block 2850000; arb +3.96, retail -3.49). Code sha256 218426004abed3b6cb69f4ef133fea8e4789ddbeae37bd11e94e5ffc5f2a77cb, full source in the result (fetchable at https://api.imdnotdead.fun/artifacts/5839483d4df69854030fd68b224659b379af881cd229df40a8bab825c2fa7db1). Design: NP2's slow pHat untouched for sigma/activity/tox/flow; a second fast estimate (slots 13-15: first-print mixture alpha = P*0.6+(1-P)*0.08, same-direction later updates 0.06, variance grown by sigmaHat^2*elapsed) feeds ONLY the stale shift via staleHat = 0.7*pHat + 0.3*fastHat. Tuned on 80-240 seeds. Requester 19:15Z promoted it as the base (B).\n- ep7-stack/stack-a (single-estimator variant): +0.100 se 0.024; not used.\n- ep7-mix mix-a -0.305 se 0.027, mix-b -1.25 se 0.032; ep7-late/unc-b -4.55 se 0.068. Replacing the slow estimator loses every time; only the two-estimator route works.\n- ep6-oracle/ceil-b (TRUE price as pHat + coordinate re-tune of the fee mapping; needs assembly, not submittable): +1.19 se 0.051 (arb +5.98, retail -4.79; TOX_QUAD at the grid edge). Requester 19:18Z: inside NP2/CH's fee family even a perfect price is worth ~+1.2, while 1st is +9.6: the leaders use a different fee rule. Say this plainly in the write-up; 'design a new fee rule' is the first item for the next run.\n- ep4-lean/lean-a: zeroing the lean -0.035 se 0.003 (dead). ep3-base/decomp: 98.1% of arb loss is at gap=1; displacement >200 bps carries 35.6% of arb loss from 4.7% of arb prints.\n- Known confirmed gains on NP2 (requester 19:22Z, 19:38Z): stack-b +0.477 se 0.017; silence-a +0.219 se 0.011 (seat 534: after g silent steps, cap 4, move slow pHat toward the centre of the previous fee band by w=1-(1-0.075)^g and scale that print's alpha and gate by 1-0.30w; its result file hash is only known as 026979bc..., so ep9 briefs re-implement it from this description); next-mix-a +0.170 se 0.007 on 4,000 seeds (code in ep3-mech/merge-01, https://api.imdnotdead.fun/artifacts/8632a51305fc2b7fbd61b754534bfe89f487a6dfd2fec3eea9801e621c77f4e9: blend the exposed side with a break-even fee weighted by the Poisson chance the next trade is retail, MIX_M 0.625, MIX_E 1/8); later-b +0.105 se 0.010 (slow PHAT_ALPHA_RETAIL 0.03). About +0.97 if additive; silence-a may overlap stack-b's silence variance. Losers never to retry: router -26.7, unc -4.5, kalman -3.2, mixture/hard cutoff on the slow path, shrink, sitshift, flow flattening, lean, cap, affine oracle fees (-5.1), gap+g fees (-33.5).\nDECIDED (16 items, 5 batches, every brief = NP2 by the objective's definition + B def with URL + SETUP with the requester's 1159-char no-gate script word for word + MEASURE (separate run_batch vs Vanilla for cand, NP2 and B, 20 seeds a call) + delta defs L/N/S + TASK var + RETURN json; filled briefs 2,7xx-2,9xx chars, checked mechanically):\n- ep9-stack: full-a/b = B+S+N+L; nos-a/b = B+N+L. ep9-loo: non-a/b = B+S+L; nol-a/b = B+S+N. ep9-pair: onlyl-a/b = B+L; onlyn-a/b = B+N. ep9-single: onlys-a/b = B+S. Each: no tuning, one measurement of cand, NP2 and B on its own fresh 4,000-seed block (2,000 if the machine is slower than 0.2 s/sim), returning paired_np2 and paired_b.\n- ep9-tune: tune-a = B's stale blend fast weight {0.1,0.2,0.4,0.5} (B 0.3); tune-b = first-print wA/wR cross (0.5,.08),(0.7,.08),(0.6,.04),(0.6,.12) around B's (0.6,0.08); each cell vs B on seeds 10000..11023; best cell (or B) confirmed vs NP2 and B on a fresh 2,000-seed block.\n- L in B is the SLOW path only (the fast estimator reuses the PHAT_ALPHA_RETAIL constant for its later update, so briefs change the slow line to 30000000000000000 and keep the fast 0.06). N uses the slow pHat for spot>=pHat as in next-mix-a. S moves the slow pHat only.\n- Cancelled ep8-stack and ep8-sweep-f22/f32 (NP2-based, superseded by B and unreadable in time); kept ep8-sweep-f27 (RETAIL {0,.01,.02,.03,.04} x SAME {.09,.12,.16} at first-print 0.27 on NP2, common seeds 10000..11999) because it says whether 0.03 is the right slow cell for the write-up.\nCONFIRM SEED BLOCKS (never reuse): ep1-mech 2000000..2229999; harness ep1 2900000..2909999; ep2-oracle 2230000..2249999; ep3-base 2250000..2263999; ep3-oracle 2270000..2289999; ep3-mech 2300000..2459999; ep4-flow 2460000..2499999; ep4-lean 2500000..2539999; ep5-oracle 2540000..2551999; ep5-mech 2560000..2679999; ep6-oracle 2680000..2719999; ep6-mech 2720000..2759999; ep7-mix 2760000..2799999; ep7-late 2800000..2839999; ep7-stack 2840000..2859999; ep8-stack 2860000..2899999 (cancelled); ep9 (each ..+9999, items use ..+3999 or ..+1999): full-a 2910000, full-b 2920000, nos-a 2930000, nos-b 2940000, non-a 2950000, non-b 2960000, nol-a 2970000, nol-b 2980000, onlyl-a 2990000, onlyl-b 3000000, onlyn-a 3010000, onlyn-b 3020000, onlys-a 3030000, onlys-b 3040000, tune-a 3050000, tune-b 3060000. NEXT FREE BLOCK: 3070000. Tuning seeds 10000..99999 (ep8 sweep uses 10000..11999, ep9-tune 10000..11023).\nREADS REQUESTED for ep10 (30): all 16 ep9 items; ep8-sweep-f27 r0, r01..r04; ep7-stack/stack-b; ep3-mech/next-mix-a; ep5-mech/silence-a; ep7-late/later-b; ep6-oracle/ceil-b; ep5-err/err-b; ep3-oracle/oracle-price; ep3-mech/merge-01; ep2-board/top20-regimes.\nEP10 PLAN (last episode; set finish true whatever has landed): (a) Check method and `blocked` on every ep9 item; an item is valid only with separate run_batch vs Vanilla and a b_sha256 equal to 21842600... (b) Rank configurations by paired_np2 mean_diff; the increments paired_b show which deltas add on B (S may overlap B's silence variance; L touches a constant B's fast path also reads). Take as FINAL the configuration with the highest paired_np2 whose two copies agree within 2 combined se; if copies disagree, prefer the one measured on 4,000 seeds and say so. Expected: FULL about +0.8 to +1.0 if additive, B alone +0.48; the requester submits any file >= +0.8 over NP2 on 4,000 fresh seeds and checks it on the board (+0.8 local = about 519.6 on the board, still ~35th; top 10 needs +5.8). (c) Fold in ep9-tune only if its best cell beats B by >= 2 se on the fresh block and is confirmed vs NP2; otherwise keep B's 0.3 / 0.6 / 0.08. (d) Write-up: FINAL's full code (copy from the winning item's `code`), sha256, paired{n,mean_diff,se,worst} vs NP2 and vs stack-b, the per-delta increments, the lesson (every estimator rewrite on the slow path lost by 0.1 to 5; the gains are small changes to NP2's own gains and a second fast estimate used only for the stale shift), and the ceiling figures as what is missing: true price alone -5.4 (ep3-oracle), true price + re-tuned mapping +1.19 se 0.05 (ceil-b), affine gap fees -5.1, gap+g fees -33.5; the board gap (+9.6 to 1st, every run, scaling with retail flow; #10 -> #1 is an arb rung) cannot be closed inside this fee family, so the next run's first item is a new fee rule designed from the top-20 per-run board data (ep2-board). Cite results by batch/item. CH = ChengHua926/amm-challenge Strategy.sol @d34a5199 (525.525882178); NP2 sha256 51f1c1a9d4999ee460eb8bbc66880da8074b173399a4f5d71f96671482e18ac0; later-b 91fe9cb4...; next-mix-a 1e8a7601...; stack-b 21842600...; stack-a f54f9db7...",
  "spawn": [
    {
      "name": "ep9-stack",
      "brief": "NP2 as the objective defines it (TWO + NP's routing block; sha256 51f1c1a9...; 526.1156 on seeds 0..999).\nB = the ```solidity block of https://api.imdnotdead.fun/artifacts/5839483d4df69854030fd68b224659b379af881cd229df40a8bab825c2fa7db1 (stack-b, sha256 21842600...); read its Method section.\nSETUP (this script, not the objective's): clone the objective's simulator commit into the workspace, save this as scratch/setup.sh, run `sh scratch/setup.sh` once at the checkout root, then `. scratch/env.sh && ` before commands; blocked={step,error} on failure:\nset -eu;R=$PWD/scratch;mkdir -p $R/tmp $R/bin $R/solcx\necho \"export TMPDIR=$R/tmp XDG_CACHE_HOME=$R/xc UV_CACHE_DIR=$R/uvc UV_PYTHON_INSTALL_DIR=$R/uvpy RUSTUP_HOME=$R/rustup CARGO_HOME=$R/cargo SOLCX_BINARY_PATH=$R/solcx VIRTUAL_ENV=$PWD/.venv PATH=$PWD/.venv/bin:$R/bin:$R/cargo/bin:\\$PATH\" >$R/env.sh;. $R/env.sh\ncommand -v uv >/dev/null||{ curl -LsSf https://github.com/astral-sh/uv/releases/latest/download/uv-x86_64-unknown-linux-gnu.tar.gz|tar --no-same-owner -xz -C $R/tmp;cp $R/tmp/uv-*/uv $R/bin/;}\ncc --version >/dev/null 2>&1||{ curl -Ls https://micro.mamba.pm/api/micromamba/linux-64/latest -o $R/tmp/mm.tbz;python3 -c \"import sys,tarfile;tarfile.open(sys.argv[1]).extract('bin/micromamba',sys.argv[2])\" $R/tmp/mm.tbz $R;MAMBA_ROOT_PREFIX=$R/mamba $R/bin/micromamba create -yq -p $R/cenv -c conda-forge gcc;ln -sf $(ls $R/cenv/bin/*gcc|head -n1) $R/bin/cc;}\ncommand -v cargo >/dev/null||{ curl -sSf https://sh.rustup.rs|sh -s -- -y --profile minimal --no-modify-path;}\nuv venv --python 3.12 .venv;uv pip install -e . maturin\nmaturin develop --release --uv --manifest-path amm_sim_rs/Cargo.toml\namm-match validate contracts/src/StarterStrategy.sol\nMEASURE exactly as B's Method section: run_batch(X, vanilla, cfgs, 8) SEPARATELY for X in {cand, NP2, B}, 20 seeds a call, NEVER run_batch(cand, np2); se=sd/sqrt(n). `amm-match validate` must pass.\nL = slow-path PHAT_ALPHA_RETAIL 0.03: only the line `uint256 alpha = firstInStep ? PHAT_ALPHA : PHAT_ALPHA_RETAIL;` gets 30000000000000000; the fast estimator keeps 0.06.\nN = next-mix-a's mix: copy MIX_M, MIX_E_SIXTEENTHS, the `// Mix the next retail quote` block (after the tail compression, slow pHat) and its 3 helpers from the only `code` in https://api.imdnotdead.fun/artifacts/8632a51305fc2b7fbd61b754534bfe89f487a6dfd2fec3eea9801e621c77f4e9.\nS = silence-a (re-implement; note how you read it): keep our post-trade spot s in a free slot; at a step's first print after g=min(elapsed-1,4)>=1 silent steps, before the slow update, pHat += w(c-pHat), c=(s(1-prevBid)+s/(1-prevAsk))/2, w=1-(1-0.075)^g; multiply that print's slow alpha and gate by 1-0.30w.\nTASK: {{task}} No tuning. Measure cand, NP2 and B once on seeds {{block}}..{{block}}+3999 (+1999 if over 0.2 s/sim; say so).\nRETURN json: config, code (full Strategy.sol), sha256, b_sha256 as built, paired_np2{n,mean_diff,se,worst 5}, paired_b{n,mean_diff,se}, seconds_per_sim, blocked, notes.",
      "items": [
        {
          "key": "full-a",
          "vars": {
            "task": "Build B + S + N + L (the full stack).",
            "block": "2910000"
          }
        },
        {
          "key": "full-b",
          "vars": {
            "task": "Build B + S + N + L (the full stack).",
            "block": "2920000"
          }
        },
        {
          "key": "nos-a",
          "vars": {
            "task": "Build B + N + L (the full stack without S).",
            "block": "2930000"
          }
        },
        {
          "key": "nos-b",
          "vars": {
            "task": "Build B + N + L (the full stack without S).",
            "block": "2940000"
          }
        }
      ],
      "output": {
        "format": "json",
        "maxBytes": 64000
      }
    },
    {
      "name": "ep9-loo",
      "brief": "NP2 as the objective defines it (TWO + NP's routing block; sha256 51f1c1a9...; 526.1156 on seeds 0..999).\nB = the ```solidity block of https://api.imdnotdead.fun/artifacts/5839483d4df69854030fd68b224659b379af881cd229df40a8bab825c2fa7db1 (stack-b, sha256 21842600...); read its Method section.\nSETUP (this script, not the objective's): clone the objective's simulator commit into the workspace, save this as scratch/setup.sh, run `sh scratch/setup.sh` once at the checkout root, then `. scratch/env.sh && ` before commands; blocked={step,error} on failure:\nset -eu;R=$PWD/scratch;mkdir -p $R/tmp $R/bin $R/solcx\necho \"export TMPDIR=$R/tmp XDG_CACHE_HOME=$R/xc UV_CACHE_DIR=$R/uvc UV_PYTHON_INSTALL_DIR=$R/uvpy RUSTUP_HOME=$R/rustup CARGO_HOME=$R/cargo SOLCX_BINARY_PATH=$R/solcx VIRTUAL_ENV=$PWD/.venv PATH=$PWD/.venv/bin:$R/bin:$R/cargo/bin:\\$PATH\" >$R/env.sh;. $R/env.sh\ncommand -v uv >/dev/null||{ curl -LsSf https://github.com/astral-sh/uv/releases/latest/download/uv-x86_64-unknown-linux-gnu.tar.gz|tar --no-same-owner -xz -C $R/tmp;cp $R/tmp/uv-*/uv $R/bin/;}\ncc --version >/dev/null 2>&1||{ curl -Ls https://micro.mamba.pm/api/micromamba/linux-64/latest -o $R/tmp/mm.tbz;python3 -c \"import sys,tarfile;tarfile.open(sys.argv[1]).extract('bin/micromamba',sys.argv[2])\" $R/tmp/mm.tbz $R;MAMBA_ROOT_PREFIX=$R/mamba $R/bin/micromamba create -yq -p $R/cenv -c conda-forge gcc;ln -sf $(ls $R/cenv/bin/*gcc|head -n1) $R/bin/cc;}\ncommand -v cargo >/dev/null||{ curl -sSf https://sh.rustup.rs|sh -s -- -y --profile minimal --no-modify-path;}\nuv venv --python 3.12 .venv;uv pip install -e . maturin\nmaturin develop --release --uv --manifest-path amm_sim_rs/Cargo.toml\namm-match validate contracts/src/StarterStrategy.sol\nMEASURE exactly as B's Method section: run_batch(X, vanilla, cfgs, 8) SEPARATELY for X in {cand, NP2, B}, 20 seeds a call, NEVER run_batch(cand, np2); se=sd/sqrt(n). `amm-match validate` must pass.\nL = slow-path PHAT_ALPHA_RETAIL 0.03: only the line `uint256 alpha = firstInStep ? PHAT_ALPHA : PHAT_ALPHA_RETAIL;` gets 30000000000000000; the fast estimator keeps 0.06.\nN = next-mix-a's mix: copy MIX_M, MIX_E_SIXTEENTHS, the `// Mix the next retail quote` block (after the tail compression, slow pHat) and its 3 helpers from the only `code` in https://api.imdnotdead.fun/artifacts/8632a51305fc2b7fbd61b754534bfe89f487a6dfd2fec3eea9801e621c77f4e9.\nS = silence-a (re-implement; note how you read it): keep our post-trade spot s in a free slot; at a step's first print after g=min(elapsed-1,4)>=1 silent steps, before the slow update, pHat += w(c-pHat), c=(s(1-prevBid)+s/(1-prevAsk))/2, w=1-(1-0.075)^g; multiply that print's slow alpha and gate by 1-0.30w.\nTASK: {{task}} No tuning. Measure cand, NP2 and B once on seeds {{block}}..{{block}}+3999 (+1999 if over 0.2 s/sim; say so).\nRETURN json: config, code (full Strategy.sol), sha256, b_sha256 as built, paired_np2{n,mean_diff,se,worst 5}, paired_b{n,mean_diff,se}, seconds_per_sim, blocked, notes.",
      "items": [
        {
          "key": "non-a",
          "vars": {
            "task": "Build B + S + L (the full stack without N).",
            "block": "2950000"
          }
        },
        {
          "key": "non-b",
          "vars": {
            "task": "Build B + S + L (the full stack without N).",
            "block": "2960000"
          }
        },
        {
          "key": "nol-a",
          "vars": {
            "task": "Build B + S + N (the full stack without L).",
            "block": "2970000"
          }
        },
        {
          "key": "nol-b",
          "vars": {
            "task": "Build B + S + N (the full stack without L).",
            "block": "2980000"
          }
        }
      ],
      "output": {
        "format": "json",
        "maxBytes": 64000
      }
    },
    {
      "name": "ep9-pair",
      "brief": "NP2 as the objective defines it (TWO + NP's routing block; sha256 51f1c1a9...; 526.1156 on seeds 0..999).\nB = the ```solidity block of https://api.imdnotdead.fun/artifacts/5839483d4df69854030fd68b224659b379af881cd229df40a8bab825c2fa7db1 (stack-b, sha256 21842600...); read its Method section.\nSETUP (this script, not the objective's): clone the objective's simulator commit into the workspace, save this as scratch/setup.sh, run `sh scratch/setup.sh` once at the checkout root, then `. scratch/env.sh && ` before commands; blocked={step,error} on failure:\nset -eu;R=$PWD/scratch;mkdir -p $R/tmp $R/bin $R/solcx\necho \"export TMPDIR=$R/tmp XDG_CACHE_HOME=$R/xc UV_CACHE_DIR=$R/uvc UV_PYTHON_INSTALL_DIR=$R/uvpy RUSTUP_HOME=$R/rustup CARGO_HOME=$R/cargo SOLCX_BINARY_PATH=$R/solcx VIRTUAL_ENV=$PWD/.venv PATH=$PWD/.venv/bin:$R/bin:$R/cargo/bin:\\$PATH\" >$R/env.sh;. $R/env.sh\ncommand -v uv >/dev/null||{ curl -LsSf https://github.com/astral-sh/uv/releases/latest/download/uv-x86_64-unknown-linux-gnu.tar.gz|tar --no-same-owner -xz -C $R/tmp;cp $R/tmp/uv-*/uv $R/bin/;}\ncc --version >/dev/null 2>&1||{ curl -Ls https://micro.mamba.pm/api/micromamba/linux-64/latest -o $R/tmp/mm.tbz;python3 -c \"import sys,tarfile;tarfile.open(sys.argv[1]).extract('bin/micromamba',sys.argv[2])\" $R/tmp/mm.tbz $R;MAMBA_ROOT_PREFIX=$R/mamba $R/bin/micromamba create -yq -p $R/cenv -c conda-forge gcc;ln -sf $(ls $R/cenv/bin/*gcc|head -n1) $R/bin/cc;}\ncommand -v cargo >/dev/null||{ curl -sSf https://sh.rustup.rs|sh -s -- -y --profile minimal --no-modify-path;}\nuv venv --python 3.12 .venv;uv pip install -e . maturin\nmaturin develop --release --uv --manifest-path amm_sim_rs/Cargo.toml\namm-match validate contracts/src/StarterStrategy.sol\nMEASURE exactly as B's Method section: run_batch(X, vanilla, cfgs, 8) SEPARATELY for X in {cand, NP2, B}, 20 seeds a call, NEVER run_batch(cand, np2); se=sd/sqrt(n). `amm-match validate` must pass.\nL = slow-path PHAT_ALPHA_RETAIL 0.03: only the line `uint256 alpha = firstInStep ? PHAT_ALPHA : PHAT_ALPHA_RETAIL;` gets 30000000000000000; the fast estimator keeps 0.06.\nN = next-mix-a's mix: copy MIX_M, MIX_E_SIXTEENTHS, the `// Mix the next retail quote` block (after the tail compression, slow pHat) and its 3 helpers from the only `code` in https://api.imdnotdead.fun/artifacts/8632a51305fc2b7fbd61b754534bfe89f487a6dfd2fec3eea9801e621c77f4e9.\nTASK: {{task}} No tuning. Measure cand, NP2 and B once on seeds {{block}}..{{block}}+3999 (+1999 if over 0.2 s/sim; say so).\nRETURN json: config, code (full Strategy.sol), sha256, b_sha256 as built, paired_np2{n,mean_diff,se,worst 5}, paired_b{n,mean_diff,se}, seconds_per_sim, blocked, notes.",
      "items": [
        {
          "key": "onlyl-a",
          "vars": {
            "task": "Build B + L only.",
            "block": "2990000"
          }
        },
        {
          "key": "onlyl-b",
          "vars": {
            "task": "Build B + L only.",
            "block": "3000000"
          }
        },
        {
          "key": "onlyn-a",
          "vars": {
            "task": "Build B + N only.",
            "block": "3010000"
          }
        },
        {
          "key": "onlyn-b",
          "vars": {
            "task": "Build B + N only.",
            "block": "3020000"
          }
        }
      ],
      "output": {
        "format": "json",
        "maxBytes": 64000
      }
    },
    {
      "name": "ep9-single",
      "brief": "NP2 as the objective defines it (TWO + NP's routing block; sha256 51f1c1a9...; 526.1156 on seeds 0..999).\nB = the ```solidity block of https://api.imdnotdead.fun/artifacts/5839483d4df69854030fd68b224659b379af881cd229df40a8bab825c2fa7db1 (stack-b, sha256 21842600...); read its Method section.\nSETUP (this script, not the objective's): clone the objective's simulator commit into the workspace, save this as scratch/setup.sh, run `sh scratch/setup.sh` once at the checkout root, then `. scratch/env.sh && ` before commands; blocked={step,error} on failure:\nset -eu;R=$PWD/scratch;mkdir -p $R/tmp $R/bin $R/solcx\necho \"export TMPDIR=$R/tmp XDG_CACHE_HOME=$R/xc UV_CACHE_DIR=$R/uvc UV_PYTHON_INSTALL_DIR=$R/uvpy RUSTUP_HOME=$R/rustup CARGO_HOME=$R/cargo SOLCX_BINARY_PATH=$R/solcx VIRTUAL_ENV=$PWD/.venv PATH=$PWD/.venv/bin:$R/bin:$R/cargo/bin:\\$PATH\" >$R/env.sh;. $R/env.sh\ncommand -v uv >/dev/null||{ curl -LsSf https://github.com/astral-sh/uv/releases/latest/download/uv-x86_64-unknown-linux-gnu.tar.gz|tar --no-same-owner -xz -C $R/tmp;cp $R/tmp/uv-*/uv $R/bin/;}\ncc --version >/dev/null 2>&1||{ curl -Ls https://micro.mamba.pm/api/micromamba/linux-64/latest -o $R/tmp/mm.tbz;python3 -c \"import sys,tarfile;tarfile.open(sys.argv[1]).extract('bin/micromamba',sys.argv[2])\" $R/tmp/mm.tbz $R;MAMBA_ROOT_PREFIX=$R/mamba $R/bin/micromamba create -yq -p $R/cenv -c conda-forge gcc;ln -sf $(ls $R/cenv/bin/*gcc|head -n1) $R/bin/cc;}\ncommand -v cargo >/dev/null||{ curl -sSf https://sh.rustup.rs|sh -s -- -y --profile minimal --no-modify-path;}\nuv venv --python 3.12 .venv;uv pip install -e . maturin\nmaturin develop --release --uv --manifest-path amm_sim_rs/Cargo.toml\namm-match validate contracts/src/StarterStrategy.sol\nMEASURE exactly as B's Method section: run_batch(X, vanilla, cfgs, 8) SEPARATELY for X in {cand, NP2, B}, 20 seeds a call, NEVER run_batch(cand, np2); se=sd/sqrt(n). `amm-match validate` must pass.\nS = silence-a (re-implement; note how you read it): keep our post-trade spot s in a free slot; at a step's first print after g=min(elapsed-1,4)>=1 silent steps, before the slow update, pHat += w(c-pHat), c=(s(1-prevBid)+s/(1-prevAsk))/2, w=1-(1-0.075)^g; multiply that print's slow alpha and gate by 1-0.30w.\nTASK: {{task}} No tuning. Measure cand, NP2 and B once on seeds {{block}}..{{block}}+3999 (+1999 if over 0.2 s/sim; say so).\nRETURN json: config, code (full Strategy.sol), sha256, b_sha256 as built, paired_np2{n,mean_diff,se,worst 5}, paired_b{n,mean_diff,se}, seconds_per_sim, blocked, notes.",
      "items": [
        {
          "key": "onlys-a",
          "vars": {
            "task": "Build B + S only.",
            "block": "3030000"
          }
        },
        {
          "key": "onlys-b",
          "vars": {
            "task": "Build B + S only.",
            "block": "3040000"
          }
        }
      ],
      "output": {
        "format": "json",
        "maxBytes": 64000
      }
    },
    {
      "name": "ep9-tune",
      "brief": "NP2 as the objective defines it (TWO + NP's routing block; sha256 51f1c1a9...; 526.1156 on seeds 0..999).\nB = the ```solidity block of https://api.imdnotdead.fun/artifacts/5839483d4df69854030fd68b224659b379af881cd229df40a8bab825c2fa7db1 (stack-b, sha256 21842600...); read its Method section.\nSETUP (this script, not the objective's): clone the objective's simulator commit into the workspace, save this as scratch/setup.sh, run `sh scratch/setup.sh` once at the checkout root, then `. scratch/env.sh && ` before commands; blocked={step,error} on failure:\nset -eu;R=$PWD/scratch;mkdir -p $R/tmp $R/bin $R/solcx\necho \"export TMPDIR=$R/tmp XDG_CACHE_HOME=$R/xc UV_CACHE_DIR=$R/uvc UV_PYTHON_INSTALL_DIR=$R/uvpy RUSTUP_HOME=$R/rustup CARGO_HOME=$R/cargo SOLCX_BINARY_PATH=$R/solcx VIRTUAL_ENV=$PWD/.venv PATH=$PWD/.venv/bin:$R/bin:$R/cargo/bin:\\$PATH\" >$R/env.sh;. $R/env.sh\ncommand -v uv >/dev/null||{ curl -LsSf https://github.com/astral-sh/uv/releases/latest/download/uv-x86_64-unknown-linux-gnu.tar.gz|tar --no-same-owner -xz -C $R/tmp;cp $R/tmp/uv-*/uv $R/bin/;}\ncc --version >/dev/null 2>&1||{ curl -Ls https://micro.mamba.pm/api/micromamba/linux-64/latest -o $R/tmp/mm.tbz;python3 -c \"import sys,tarfile;tarfile.open(sys.argv[1]).extract('bin/micromamba',sys.argv[2])\" $R/tmp/mm.tbz $R;MAMBA_ROOT_PREFIX=$R/mamba $R/bin/micromamba create -yq -p $R/cenv -c conda-forge gcc;ln -sf $(ls $R/cenv/bin/*gcc|head -n1) $R/bin/cc;}\ncommand -v cargo >/dev/null||{ curl -sSf https://sh.rustup.rs|sh -s -- -y --profile minimal --no-modify-path;}\nuv venv --python 3.12 .venv;uv pip install -e . maturin\nmaturin develop --release --uv --manifest-path amm_sim_rs/Cargo.toml\namm-match validate contracts/src/StarterStrategy.sol\nMEASURE exactly as B's Method section: run_batch(X, vanilla, cfgs, 8) SEPARATELY for X in {cand, NP2, B}, 20 seeds a call, NEVER run_batch(cand, np2); se=sd/sqrt(n). `amm-match validate` must pass.\nTASK: {{task}} Tune vs B on seeds 10000..11023 (B's edges computed once); then measure the best cell (B itself if none beats B by 2 se), NP2 and B once on fresh seeds {{block}}..{{block}}+1999.\nRETURN json: cells[{params,n,mean_diff_vs_b,se}], best, code (full Strategy.sol of the best), sha256, b_sha256 as built, paired_np2{n,mean_diff,se,worst 5}, paired_b{n,mean_diff,se}, seconds_per_sim, blocked, notes.",
      "items": [
        {
          "key": "tune-a",
          "vars": {
            "task": "Sweep B's stale blend `staleHat = wmul(pHat, 700000000000000000) + wmul(fastHat, 300000000000000000)`: fast weight {0.1, 0.2, 0.4, 0.5} (0.3 is B; slow weight = 1 - fast).",
            "block": "3050000"
          }
        },
        {
          "key": "tune-b",
          "vars": {
            "task": "Sweep B's first-print weights in `alpha = wmul(probArb, 600000000000000000) + wmul(WAD - probArb, 80000000000000000)` (wA 0.6, wR 0.08 is B): cells (0.5,0.08), (0.7,0.08), (0.6,0.04), (0.6,0.12); add the four corners if time permits.",
            "block": "3060000"
          }
        }
      ],
      "output": {
        "format": "json",
        "maxBytes": 64000
      }
    }
  ],
  "read": [
    "ep9-stack/full-a",
    "ep9-stack/full-b",
    "ep9-stack/nos-a",
    "ep9-stack/nos-b",
    "ep9-loo/non-a",
    "ep9-loo/non-b",
    "ep9-loo/nol-a",
    "ep9-loo/nol-b",
    "ep9-pair/onlyl-a",
    "ep9-pair/onlyl-b",
    "ep9-pair/onlyn-a",
    "ep9-pair/onlyn-b",
    "ep9-single/onlys-a",
    "ep9-single/onlys-b",
    "ep9-tune/tune-a",
    "ep9-tune/tune-b",
    "ep8-sweep-f27/r0",
    "ep8-sweep-f27/r01",
    "ep8-sweep-f27/r02",
    "ep8-sweep-f27/r03",
    "ep8-sweep-f27/r04",
    "ep7-stack/stack-b",
    "ep3-mech/next-mix-a",
    "ep5-mech/silence-a",
    "ep7-late/later-b",
    "ep6-oracle/ceil-b",
    "ep5-err/err-b",
    "ep3-oracle/oracle-price",
    "ep3-mech/merge-01",
    "ep2-board/top20-regimes"
  ],
  "cancel": [
    "ep8-stack",
    "ep8-sweep-f22",
    "ep8-sweep-f32"
  ],
  "wake": {
    "batches": [
      "ep9-stack",
      "ep9-loo",
      "ep9-pair",
      "ep9-single",
      "ep9-tune"
    ],
    "afterMinutes": 300
  },
  "finish": false
}