{
  "notes": "Credit: Taylor (gtmcknight), github.com/gtmcknight/amm-sim@4812a6382311624e1506aca131ca35c378f930d9, research/solved.\n\nEPISODE4 FACTS. Trunk https://github.com/identity-md-launches/goal-3178-build-shared-evaluation-kit.git at P=79f068cef81dadee171531f3381e207c193c959a (e03 merged, 4/4 accepted; branch main; 95 tracked files, no submodule). 11/20 items used before this decision, 16 after. No requester notes or refusals. Read the four b03 reports, cloned P into scratch and ran it (my own check, no independent authority). P holds every piece the goal names: ammfast/{__init__,_head,_kernel,_reference}.py; baselines/replica 9 banks + generate.py, validate.py, validation.json; baselines/ha/HA-10000-12047.json; baselines/engine/qt1-9700000-9700511.json + qt1-audit.json, validation.json; score.py; engine_eval.py; setup_fast.sh + bootstrap/; gatep.py; reference/ (35 envelopes); validate_kit.py; docs/; 10 test files. Every tracked file has gtmcknight in its head.\n\nWorker-reported (b03-replica-kit): gate 384/384 within 1e-9, max 1.19e-11, 343 bit-identical; 12288/12288 bank rows; spots 576/576 (first 64 seeds of each bank; 384 reuse gate rows, 192 new); warm one-worker runs/s/core 102.3 qt1-ref, 88.4 TwoComp, 77.9 COMBO; cold JIT 13.86s; residual head 18 weights, 8e-4*tanh per side before the clamp, zero == COMBO bit for bit, no weights shipped; bank means reproduce reference/combo/README (COMBO-qt1-ref +0.597391+-0.013388). That worker ran the whole tests dir once, hence the old installer's uname probe; nothing from it is in delivered files. b03-setup-repair: uname removed, D1 deadline (exit 75, resume) and D2 env unset fixed, pins and manifest byte-identical; cold engine setup 13.1s, replica-only 9.5s, cached 1.6s. b03-score-integration: score.py unchanged; live engine round of 128 Vanilla seeds vs qt1 bank stopped 'worse' after exactly one request (mean -181.08, se 3.92), 3 qt1 seeds rerun exact. b03-kit-validator: validate_kit.py, 57 tests.\n\nMy run at P, Linux x86_64, explicit scratch cache: setup_fast.sh --smoke cold exit 0 (16 downloads, 135768787 bytes), --offline rerun reused; materialize 35 originals; gatep PASS fresh then verified cache hit; test_ammfast 23 OK; test_replica_banks 14 OK; test_engine_eval 16 OK; test_gatep 24 OK; test_score 35 OK; test_setup_deadline 13 OK; test_setup_fast 28 OK (1 macOS skip); test_validate_kit 57 OK; test_ha 15 OK; test_score_integration live 3 OK; baselines/replica/validate.py --recompute 8 ok (72 rows); baselines/engine/validate.py complete, 5 reruns.\n\nDEFECTS FOUND AT P.\n(1) `python3 -B validate_kit.py` exits 1: status FAIL, one finding, replica bad-validation 'gates must be a list', coverage 2560/14848. Cause: my episode-3 schema wording; evidence, baselines/replica/validate.py and docs/replica-banks.md use keys gates384/spots576, validate_kit.py line 600-601 reads gates/spots. In a scratch copy with only those two reads changed it exits 0: PASS, six parts pass, 14848/14848, 384 gates, 576 spots, worst error 1.19e-11, no findings. The evidence is right, so this wave repairs the validator and leaves the banks untouched.\n(2) `python -B baselines/engine/validate.py` with its default --output rewrites the tracked baselines/engine/validation.json (only rerun_seconds and validation_seconds differ; validate_kit engine part still passes). Not repaired, to keep the engine payload byte-identical: documented as `--output scratch/engine-validation.json`.\n(3) Stale docs: README.md (pieces 'pending'), docs/contracts.md ('does not implement'), docs/reference.md (URLs pending), docs/score.md (copy-and-patch uname block whose assert now fails; 'no real replica integration'), docs/validation.md (wave-2 status).\n\nDECISION: one code wave e04-seal, 5 items, disjoint scopes: validator-fix (validate_kit.py, tests/test_validate_kit.py, docs/validation.md); readme (README.md); docs-refresh (docs/contracts.md, docs/reference.md, docs/score.md); audit-replica (scope []: own 384-pair gate rerun, 64 further seeds per bank vs CPython, all 12288 rows recomputed, rates, real replica scorer runs); audit-engine (scope []: setup cold/cached/offline/deadline, gatep, all suites, 24 qt1 reruns, validate_kit before/after a scratch patch, git status). Audits see P only, never this wave's edits. No ammfast, bank, score.py, setup_fast.sh, gatep.py or engine file is in any scope, so those stay byte-identical to P.\n\nPUBLICATION DESIGN. A README cannot contain its own commit. README.md pins every unchanged file to raw URLs at P with its sha256, and lists the seven files changed in its own commit (README.md, validate_kit.py, tests/test_validate_kit.py, docs/validation.md, docs/contracts.md, docs/reference.md, docs/score.md) with <trunk-commit> to be named by the write-up. The write-up names BOTH: the final trunk commit X from goal.json (the deliverable's pin; give raw URLs at X for every piece: https://raw.githubusercontent.com/identity-md-launches/goal-3178-build-shared-evaluation-kit/X/<path>) and P, where code and banks are byte-identical.\n\nEPISODE5 (the last). Read goal.json trunk.commit X and e04-seal's state, then the five results. Check as data at raw URLs for X (or a scratch clone; run only `python3 -I -B validate_kit.py`, expect exit 0 PASS 14848/14848): README has no 'pending', carries the URL table at P and the seven-file note; validate_kit.py reads gates384/spots576; git diff P..X touches only the seven files. Then set finish true: a wave spawned in the last episode can never be inspected, so do not spawn one unless goal.json shows more episodes were granted. If the wave did not merge or an item failed, still finish and say exactly what is missing: P already holds (a)-(e) complete, and the validator's two-key mismatch and the stale README are then the stated gaps (give the two-line fix). If audits report mismatches, put them in the write-up with seeds and values; do not soften them.\n\nWRITE-UP MUST STATE: credit to Taylor; X and P; what each piece does and exact commands; bank sha256 (below); gate and spot counts; rates; test totals (worker and audit); limits: only Linux x86_64 executed, macOS arm64 replica-only fetched and hash-checked but never run; CPython spot checks cover the first 64 seeds of each bank (plus whatever audit-replica adds); engine seeds 9700000..9700511 are screening only, no holdout claim; validate_kit is structural, not parity proof; a policy scored against its own 6-decimal bank shows up to 5e-7 rounding and can trip the 'worse' stop; engine validate.py default output path; residual head ships no weights; my own checks are not independent. Cite b03-replica-kit, b03-setup-repair, b03-score-integration, b03-kit-validator, the e02 results named in earlier notes and the five e04 results.\n\nBANK SHA256 AT P: COMBO-10000-12047 f707434285c5a067fee11cac983bfcb7b1301e47bf5a2c1f55e4984207d6739b; COMBO-60000-61023 8256bba9edd0b5696c850f81447edd0ee24b1783c4f3b9d2390a90eaa0ef8cc1; COMBO-64000-65023 9d59118d213f1f7a811b91a27ab625a6c732789d53b215f6226e58acec8aad95; TwoComp-10000-12047 2fde9032094837e6c32728b0a160d25e78e382f31ebd67318ab8f5efad629b25; TwoComp-60000-61023 03723f9a1e827ff615d48b001c3181312618a9d31c52ff2109fdc4f0398dcb88; TwoComp-64000-65023 7c37b73ac7f16c4276f673c8ecfb326ab4421cab3ae9ab2f87db4f27e7d319f2; qt1-ref-10000-12047 6687dab88e27f2f6c37511d6328164eafd371fa640d85be353b74c47b98f511c; qt1-ref-60000-61023 e98ecaa2c9a7ee36307971d28d6c3de845f5a10c034aea7d152288536e6fe72e; qt1-ref-64000-65023 89675529770b1bc2e8ba584067d7ce776cd6ab88e79b58b3000852aa3d333f37; replica validation.json 84fe88b056f389d9620be650e646fd5ed2fa880d72f9764ad2a6505b03e6e8af; HA 09719da22be28598e9c1d0bb1eb935d7b0b4eeafef3321e0fabe4f3ec9e2b7a9; engine qt1 f1031aae649d2ad8e871ee1cc055770a4c6b329ff3e71afb4500fca3c8621f90. Code at P: score.py 7b9fa5e37695a5d1b048efe91a8b6c45d31bd4245a733261774c871fe9105a43; setup_fast.sh 48e150d165ea3b385fb92e0e3a7aefbbe0d97c38c53efa737a587ed62c308d20.",
  "spawn": [
    {
      "name": "e04-seal",
      "mode": "code",
      "brief": "Credit Taylor (gtmcknight), amm-sim@4812a6382311624e1506aca131ca35c378f930d9 research/solved in every file header you write. One item of the goal trunk at commit 79f068cef81dadee171531f3381e207c193c959a (P). Total<=50min, each command<=470s, state only under scratch/. No home or host inspection, secrets, Rust, tuning or changed pins. Engine seeds only 9700000..9700511, screening only. This wave's other items are invisible to you: claim nothing about them. Runtime: `bash setup_fast.sh --platform linux-x86_64 --cache \"$PWD/scratch/cache\" --scratch \"$PWD/scratch\"` (--replica-only for replica work), `. scratch/env.sh`, `python3 -B reference/materialize.py --out scratch/reference`.\n{{task}}{{task2}}{{task3}}\nYour result must contain: {{result}}",
      "items": [
        {
          "key": "validator-fix",
          "scope": [
            "validate_kit.py",
            "tests/test_validate_kit.py",
            "docs/validation.md"
          ],
          "vars": {
            "task": "Piece: repair validate_kit.py. At P `python3 -B validate_kit.py` exits 1, status FAIL, with one finding: replica bad-validation 'gates must be a list', coverage 2560/14848. Cause: baselines/replica/validation.json, baselines/replica/validate.py and docs/replica-banks.md name the comparison arrays `gates384` and `spots576`; validate_kit.py (near line 600) reads `gates` and `spots`. The evidence is right and stays as it is: touch no bank, evidence or ammfast file. Make part_replica read `gates384` and `spots576`, those names only, and keep every other check, the 1e-9 bound and the summary keys unchanged. ",
            "task2": "In tests/test_validate_kit.py move the fixtures to those names; make test_real_trunk_reports_honestly, which today accepts either outcome, assert that the real tree gives exit 0, status PASS, all six parts pass, no findings, coverage 14848/14848 (replica 12288, HA 2048, engine 512), 384 gates and 576 spots; add a negative test that evidence under the old names fails. ",
            "task3": "In docs/validation.md correct the schema lines and rewrite 'Status on the wave-2 trunk' as the status you measure now; in its command list write `python -B baselines/engine/validate.py --output scratch/engine-validation.json` and say why: the default --output rewrites the timing fields of the committed baselines/engine/validation.json.",
            "result": "what you changed, line by line in words; the validator's exit code, status, per-part status, coverage and worst gate and spot error on the real tree; test totals with their command lines; sha256 of the three files; anything still failing; and `git status --short` showing no other tracked file changed."
          }
        },
        {
          "key": "readme",
          "scope": [
            "README.md"
          ],
          "vars": {
            "task": "Piece: rewrite README.md as the kit's front page; read docs/ and the code first. Per piece: what it does and exact commands you ran here with exit codes: setup_fast.sh (one command, default cache $HOME/.cache/imd-amm, timing line cold and cached, --replica-only; macOS arm64 replica-only, never executed), reference/materialize.py, gatep.py, ammfast (run, run_batch, 18-weight residual-head hook; gate 384/384 within 1e-9; runs/s/core and cold JIT from baselines/replica/validation.json), baselines (9 replica banks, 12288 rows, 576 CPython spot checks; HA 2048 rows from Taylor's calib_out_2048.json; engine qt1 512 rows with afterSwap peak gas, screening only), score.py (--rows, --replica, --engine, --bar; one real replica and one real engine run, under 8 minutes each), engine_eval.py, validate_kit.py, tests. ",
            "task2": "Raw URLs: a table of every tracked file outside reference/envelopes/ (path, sha256 you compute, URL) and one row for that directory, as https://raw.githubusercontent.com/identity-md-launches/goal-3178-build-shared-evaluation-kit/79f068cef81dadee171531f3381e207c193c959a/<path>. Fetch all 11 bank URLs and 6 code URLs and confirm each sha256 equals your checkout. Seven files change in this README's own commit: README.md, validate_kit.py, tests/test_validate_kit.py, docs/validation.md, docs/contracts.md, docs/reference.md, docs/score.md. List them apart with no hash (a file cannot name its own commit) and give the URL shape with <trunk-commit>, which the goal's write-up names. ",
            "task3": "State: at P validate_kit.py reports one finding (a key-name mismatch with the replica evidence); its repair is due in this README's commit, PASS 14848/14848 expected. baselines/engine/validate.py needs `--output scratch/engine-validation.json`: its default rewrites committed timing fields. A policy scored against its own 6-decimal bank shows up to 5e-7 of rounding. CPython checked only the first 64 seeds of each bank. Only Linux x86_64 was executed. Drop every 'pending' line; keep the upstream links and both required sha256s.",
            "result": "README.md's sha256 and sections; each command run with exit code and seconds; each URL fetched with its sha256 comparison; table rows against `git ls-files`; statements you could not verify; `git status --short`."
          }
        },
        {
          "key": "docs-refresh",
          "scope": [
            "docs/contracts.md",
            "docs/reference.md",
            "docs/score.md"
          ],
          "vars": {
            "task": "Piece: bring three stale documents up to the merged tree; change no code. Read ammfast/, baselines/, score.py, setup_fast.sh, docs/ammfast.md, docs/replica-banks.md and docs/setup.md first. docs/contracts.md still says the foundation 'does not implement ammfast, the banks, the scorer, or the installer' and calls banks and scorer 'planned': state what exists, keep every interface definition as it is (signatures, bank schema, the .6f rule, the stop rules), and add the replica evidence keys as committed: gates384 (384 records) and spots576 (576). docs/reference.md (near line 112) says final raw URLs are pending: say README.md carries the pinned URL table, and write no commit hash for this wave. ",
            "task2": "docs/score.md (near lines 195-210) tells the reader to copy setup_fast.sh and patch a `uname` line that is gone, so its assert now fails, and says no real replica integration exists 'at starting trunk 57ce0df': replace the block with the direct setup command and correct the status. ",
            "task3": "Add to docs/score.md two real replica examples that you run with the --replica-only runtime, and quote their actual round lines, stop reason, seeds requested and seconds: `python -B score.py --baseline baselines/replica/qt1-ref-64000-65023.json --replica --policy COMBO --bar 0.1` and `python -B score.py --baseline baselines/replica/TwoComp-64000-65023.json --replica --policy qt1-ref`.",
            "result": "per file, what changed and why; each command with exit code and the scorer lines you quoted; sha256 of the three files; statements left that you could not verify; `git status --short`."
          }
        },
        {
          "key": "audit-replica",
          "scope": [],
          "vars": {
            "task": "Piece: independent replica audit of P; change no file. With the --replica-only runtime write your own scratch script (not baselines/replica/generate.py) that for qt1-ref, TwoComp and COMBO: (1) reruns the gate, ammfast.run against CPython replica2.run with the materialized policy references, on seeds 10000..10063 and 64000..64063: 384 pairs, full precision, |diff|<=1e-9; (2) for each of the 9 banks takes 64 seeds outside its first 64 by a fixed rule you state, runs both sides, checks 1e-9 and that format(ammfast edge, '.6f') equals the bank row; (3) recomputes all 12288 bank rows with ammfast against the bank strings; (4) measures warm one-worker runs per second per policy through run_batch, and the cold first call; (5) checks zero head weights equal COMBO bit for bit on 16 seeds. Benchmark first and checkpoint CPython rows under scratch/. ",
            "task2": "Then run the real scorer: `python -B score.py --baseline baselines/replica/qt1-ref-64000-65023.json --replica --policy COMBO --bar 0.1`, the same without --bar, and `--baseline baselines/replica/TwoComp-64000-65023.json --replica --policy qt1-ref`. ",
            "task3": "Run tests/test_ammfast.py, tests/test_replica_banks.py and `python -B baselines/replica/validate.py --recompute 8`, and end with `git status --short`.",
            "result": "passed/total and max abs error per policy for (1), (2), (3) and (5), with every mismatch (seed and both values); the seed rule of (2); the measured rates; each scorer run's round lines, stop reason and seeds actually run; test totals; every command with exit code and seconds; failures verbatim; what you did not cover; no machine details."
          }
        },
        {
          "key": "audit-engine",
          "scope": [],
          "vars": {
            "task": "Piece: independent setup, gate and engine audit of P; change no file. (1) setup_fast.sh into fresh scratch directories: cold with --smoke, cached, --offline, --replica-only, `--offline --deadline 1` and `--offline --fetch-only --deadline 0` (both should exit 75); source the engine env.sh and then a replica one and show the engine variables are unset; quote each timing line. (2) gatep.py fresh, then again: cache hit, same stdout. (3) every file under tests/, one command each, with IMD_TEST_PLATFORM=linux-x86_64 for test_setup_fast.py and IMD_SCORE_ENGINE=1 for test_score_integration.py. (4) `python -B baselines/engine/validate.py --output scratch/engine-validation.json`, and the HA exporter's check mode from docs/ha.md. ",
            "task2": "(5) With engine_eval.run_batch and scratch/reference/qt1/Strategy.sol (verify sha256 c68887cff61180e12ba2b1ceb333edf76a830f91f63b5d775a8806fb9ec08aca) rerun 24 evenly spread seeds of 9700000..9700511: benchmark one first and cap the count to fit; compare the unrounded edge and after_swap_peak_gas with baselines/engine/qt1-audit.json and the bank's .6f rows. ",
            "task3": "(6) `python3 -B validate_kit.py`: at P expect exit 1 with one finding, replica 'gates must be a list' (it reads `gates`/`spots`; the evidence says `gates384`/`spots576`). Report what you get, then in a scratch copy of the tree change only those two reads and report that run. (7) End with `git status --short` and name any tracked file a documented command modified.",
            "result": "for each numbered step the commands, exit codes, seconds and outcome; test totals per file; the rerun seeds with passed/total and each mismatch; the validator's findings before and after the scratch change with its coverage; failures verbatim; what you did not cover; no machine details."
          }
        }
      ],
      "output": {
        "format": "markdown",
        "maxBytes": 24000
      }
    }
  ],
  "read": [
    "e04-seal/validator-fix",
    "e04-seal/readme",
    "e04-seal/docs-refresh",
    "e04-seal/audit-replica",
    "e04-seal/audit-engine"
  ],
  "cancel": [],
  "wake": {
    "batches": [
      "e04-seal"
    ],
    "afterMinutes": 1440
  },
  "finish": false
}
