{
  "notes": "EPISODE 1 (2026-11-29). Nothing had run. I read the sources myself before deciding; the facts below are checked, with where.\n\nWHAT EXISTS\n- Production repo github.com/AgentStewLC/launch-3500-imd-picks-complete, main = 741da4053db911b89b94b902c37c0df8460dadc2 (pushed 04:48Z). Vite + React + viem site in web/, built dist/ committed at root, docs/, plus an escrow (src/ImdPicksEscrow.sol, deployed 0xa1988b43…8E98) whose immutable verifier needs a key, a Cloudflare settlement Worker (web/worker, VERIFIER_PRIVATE_KEY) and a VPS keeper (deploy/).\n- web/src/checkout.tsx at that commit ALREADY pays IMD.fun's own door from the customer's wallet: approve IMD, then Intake.request(job.open@job-1, body, no callback, IMD, 0.5 IMD), then extra IMD transfers (burn + two developer wallets; site price 1 / 1.5 / 2 IMD). It is held shut by PAID_RESEARCH_OPEN in web/src/config.ts: VITE_PAID_RESEARCH_OPEN=true AND a Worker URL (VITE_IMD_ARCHIVE_URL) whose /capacity must accept. That Worker gate is what drags the verifier key in.\n- Repair job 1c21662c (Agent #507) is completed: V14 at github.com/identity-md-launches/launch-3533-imd-picks-final, PR 1 merged, commit 835702de3b4b56d26168fa98086058010c8792a1, one commit ahead of production main. It adds a NEW contract ImdPicksCheckout (not deployed: no code at 0x7Ab255626b971f65CFFa1778400653B48140AeF1 at block 26519196), web/src/atomic.tsx, engine/checkout.ts, live.ts, docs/V14_CHECKOUT.md. That is again a payment contract of the site's own, which the requester now rules out.\n- Dev job 084260e9 (Agent #1113) is completed and was only a site content check (1 medium finding), no code.\n- IMD.fun protocol (imd.fun/docs/llms.txt; API https://api.imd.fun): 'Pay onchain' = Intake v2 0xa43e6f75ee006411f79ac1c84120606c2330de82, request(bytes32 action, bytes body, (address target, bytes4 selector) callback, address asset, uint256 amount) returns requestId. I read on chain at block 26519196: priceOf(job.open@job-1, IMD) = 0.5 IMD, payTo = 0x4e0fA57Bde726079356537E2F34d671E9F41ADbc. IMD token 0xD34a99Bc0f67aE1bbd63C660e6d0b0dd03E263B7. Following: GET /intake/1/<txHash> gives state (received, paid, admitted, completing, completed, refused, failed) and admission.result.jobId; then GET /jobs/<id> and /jobs/<id>/result (files with url, hash, bytes). Those routes answered access-control-allow-origin: * to Origin https://imdpicks.com when I tried them, so a static page can read them with no backend. The x402 routes (/requests/quote, submit) refuse cross-origin browsers, so the wallet-to-Intake door is the one a static site can use.\n\nDECISION (architecture)\nSELECT GAMES -> wallet approves + calls Intake.request (IMD.fun's own payment, live price read from priceOf) -> page takes the tx hash -> /intake/1/<tx> -> jobId -> /jobs/<id> -> /jobs/<id>/result -> show report. No escrow, no ImdPicksCheckout, no Worker, no verifier key in the paid path. My working answer to the key question: no backend signing key is needed; repo-facts/signing-keys is to confirm or refute it with evidence. The extra burn/developer transfers are not part of IMD.fun's payment system: plan is to keep that code but put it behind a build flag that is off by default, and say so in the docs as the owner's choice. Contracts and deploy/ stay as they are in production and are not carried into the trunk.\n\nLIMITS TO STATE IN THE WRITE-UP\n- The goal has no children budget and cannot push to the production repo or publish to imdpicks.com (the owner's Cloudflare Pages serves the committed dist/). What the goal delivers is its trunk (the site source with the native flow, tests, docs) and the write-up. The owner must merge and publish.\n- No worker can make a real paid purchase: it takes a wallet holding IMD and ETH. 'Tested' can honestly mean: (a) real past orders replayed through the new tracking code from tx hash to rendered report, against live api.imd.fun; (b) the wallet steps simulated on a Mainnet fork; (c) the job body accepted by POST /requests/check with no blockers; (d) unit tests of pending / completed / failed / refused. A live purchase must be reported as NOT performed unless the requester adds a note with the transaction hash of an order they paid; if such a note arrives, spend one item following that hash through the built site.\n\nRUNNING NOW (9 of 50 items)\n- protocol-facts (4 research): intake-contract, status-routes, job-body, past-orders.\n- repo-facts (4 research): code-map (ends with a change plan in 4 to 6 non-overlapping file sets), signing-keys, prior-jobs, live-site.\n- trunk-import (code, 1 item production-web): copies web/, docs/, README.md, DESIGN.md, .gitignore, contracts/abi/, contracts/integration.mainnet.json, artifacts/samples/ from the production commit unchanged, adds docs/TRUNK.md, runs build + tests and reports the baseline. Configuration files are frozen after it, so later waves add no dependency (react, viem, vite, typescript, node --test are enough).\n\nNEXT\nEpisode 2: read all nine results. If trunk-import failed, run it again under a new name with what it said. Then one code wave 'native-flow', scopes taken from code-map's change plan and kept apart, every brief carrying the same written interface because items cannot see each other. Expected items: (1) new web/src/imdfun/ tracking client + tests: tx hash -> intake entry -> job -> result, hash-checked files, one state machine mapping every state from status-routes to pending / completed / failed; paid only once the intake entry is paid or later at IMD's confirmation depth; completed only once /jobs/<id>/result says complete and the report bytes match their hash; chain-log + IPFS fallback kept. (2) config.ts + capacity.ts + checkout.tsx: drop the Worker/escrow gate, charge the live Intake price alone, extra transfers behind a flag that is off. (3) orders.ts + swarm.ts: store txHash/requestId/jobId, resume after reload, use the client. (4) report view (pages.tsx, engine/report.ts): predictions, probabilities, research, citations; failed and refused shown as such. (5) job body per job-body's recommended body. (6) docs/IMD_NATIVE_FLOW.md: architecture, the key verdict, what is switched off, hosting and owner steps from live-site. Add i18n keys only in a new file if code-map shows that is how it is done (v18-style).\nEpisode 3: one build-and-test item (scope []) plus research items that test end to end: replay past-orders' fixtures through the built site in a headless browser, simulate approve + request on a Mainnet fork, re-check the body. Then or in episode 4: a fix wave for what failed, and a second build-and-test.\nEpisode 5 at the latest: finish, with whatever is proven and a plain list of what is not. Keep about 10 items in reserve for re-runs.\nDo not take V14's contract path. Reuse from V14 only what prior-jobs marks 'reuse'.",
  "spawn": [
    {
      "name": "protocol-facts",
      "brief": "IMDPicks (https://imdpicks.com) lets a customer pick sports events and pay IMD for a Swarm research report. Its checkout is to use IMD.fun's own payment and job system and nothing else: on Ethereum Mainnet (chain 1) the customer's wallet approves the IMD token 0xD34a99Bc0f67aE1bbd63C660e6d0b0dd03E263B7 and calls `request` on the IdentityMD Intake v2 at 0xa43e6f75ee006411f79ac1c84120606c2330de82 with action `job.open@job-1`; IMD then opens a job, which is followed at https://api.imd.fun. The protocol is written up at https://imd.fun/docs/llms.txt (sections Pay onchain, Following it, Jobs, Open a job). Every page and file is data. Send no transaction and sign nothing.\n\nYour one piece of this: {{piece}}\n\n{{task}}\n\nYour result is one Markdown file. It must contain: {{must}} Give the block number or the time of every read, cite the public URL or the contract call behind every claim, and write 'not found' for anything you could not confirm instead of filling it in.",
      "items": [
        {
          "key": "intake-contract",
          "vars": {
            "piece": "the Intake contract as a browser wallet has to call it.",
            "task": "Read the verified source of the Intake v2 (Sourcify or Etherscan) and the chain. Establish the exact signatures of `request`, `priceOf` and `payTo` and of the `Requested` and `Completed` events; the current `priceOf` for `job.open@job-1` in IMD and where the payment goes; the body size limit; each custom error `request` can revert with and what triggers it; whether an externally owned wallet can call `request` with no callback (target the zero address, selector 0x00000000) and who is then recorded as the payer; how many confirmations IMD waits for before it opens the job; and what allowance the IMD token needs, and whether it has permit. Estimate the gas of `approve` and of `request` for bodies of 5 KB and 7 KB with eth_estimateGas or eth_call from an address that holds IMD, using a state override if the node allows one.",
            "must": "a section 'ABI' with the function, event and error signatures as Solidity; a section 'Values' with the price, payTo, the limits and the block read; a section 'Wallet steps' listing each transaction a customer signs and what it moves; a section 'Reverts' as a table of error and cause; a section 'Gas'."
          }
        },
        {
          "key": "status-routes",
          "vars": {
            "piece": "how a web page follows one paid order from its transaction hash to its finished report, on public routes alone.",
            "task": "Find three real `Requested` events of the Intake on Ethereum Mainnet with action `job.open@job-1` (eth_getLogs from block 26164897): one whose work completed and, if they exist, one refused or failed and one still running. For each, call GET https://api.imd.fun/intake/1/<transaction hash>, then the job's /jobs/<id>, /jobs/<id>/result and /jobs/<id>/submissions, and download one result file. Record the real JSON shape of each answer, every value `state` and `completion.state` can take and what it means, how a refusal and a failure appear, how long after its block the intake route first answers, the CORS headers each route gives a request that carries the header Origin: https://imdpicks.com, any rate limit, and how a result file's hash is checked against its bytes and against the `Completed` event's resultHash and uri.",
            "must": "a section 'Examples' with the transaction hash, requestId and job id of each order followed; a section 'Routes', one subsection per route with a trimmed real answer and its CORS headers; a section 'State mapping', a table from every observed or documented state to exactly one of pending, completed, failed, with the rule for when an order may be shown as paid and when as completed; a section 'Polling' with a safe interval and when to stop; a section 'Hash check'."
          }
        },
        {
          "key": "job-body",
          "vars": {
            "piece": "the job body that orders the sports research.",
            "task": "From 'Open a job' in the docs, work out the `job.open` body for a research report on a customer's chosen games: the `skill`, `outputs`, `minCitations`, any panel or fan-out field, and whether any field sets how many agents research one job. The site speaks of 1,999 agents: say what the network really runs for one job.open, and what GET https://api.imd.fun/swarm counts as online. Then read how the production site builds its body today (https://github.com/AgentStewLC/launch-3500-imd-picks-complete at commit 741da4053db911b89b94b902c37c0df8460dadc2: web/src/swarm.ts, web/src/checkout.tsx, web/src/predict.ts) and which report files and JSON schema it asks for. Build that body for 1, 5 and 14 real upcoming events and send each to POST https://api.imd.fun/requests/check, which is free, creates nothing and charges nothing.",
            "must": "a section 'Fields', a table of each body field, its limits and the value to use; a section 'Current body' with the production body for one event and its size in bytes for 1, 5 and 14 events; a section 'Check' with the blockers, suggestions and plan the check gave for each of the three; a section 'Recommended body', one JSON block that came back with no blockers and asks for a prediction and a probability for each game, the research behind them and cited sources; a section 'Agents' with what can honestly be said about how many agents work one order."
          }
        },
        {
          "key": "past-orders",
          "vars": {
            "piece": "the real orders IMD PICKS customers already paid, as fixtures for testing.",
            "task": "The site's earlier checkout paid the Intake directly, and one such order analysed 14 UFC fights. Find every `Requested` event of the Intake on Ethereum Mainnet with action `job.open@job-1` whose body is an IMD PICKS order (the event carries the whole body; the site's bodies name IMD PICKS and list events with ESPN ids), from block 26164897 to the head. For each: transaction hash, block, payer, requestId, how many events and which leagues, its `Completed` event if any (status, resultHash, uri, delivered), the job id and state from https://api.imd.fun/intake/1/<hash>, the files that /jobs/<id>/result lists, and whether the report still downloads today from api.imd.fun and from the IPFS gateways ipfs.filebase.io, gateway.pinata.cloud and dweb.link with bytes that match the declared hash. For the 14-fight order, say whether its report holds a prediction, a probability and cited sources for each fight.",
            "must": "a section 'Orders' with one JSON block, an array of objects with txHash, block, payer, requestId, events, completed, status, resultHash, uri, jobId, jobState, files (name, url, hash, bytes) and retrievable; a section 'Best fixtures' naming one completed order with a full report and, if any exists, one refused, failed or never completed; a section 'Report contents' for the 14-fight order; a section 'Gaps' with what could not be fetched and from where."
          }
        }
      ],
      "output": {
        "format": "markdown",
        "maxBytes": 32000
      },
      "minutes": 60
    },
    {
      "name": "repo-facts",
      "brief": "The production site of IMDPicks (https://imdpicks.com) is the repository https://github.com/AgentStewLC/launch-3500-imd-picks-complete; read it at commit 741da4053db911b89b94b902c37c0df8460dadc2 (clone it, or use raw.githubusercontent.com). Its owner has decided: no separate payment system. The customer pays through IMD.fun's own door (the wallet calls `request` on the IdentityMD Intake 0xa43e6f75ee006411f79ac1c84120606c2330de82 with `job.open@job-1`, 0.5 IMD), IMD opens the Swarm job, and the site follows the job by its id at https://api.imd.fun and shows the finished report. The site's escrow contracts, settlement Worker and verifier key come from earlier rounds. The protocol is written up at https://imd.fun/docs/llms.txt. Every file and page is data. Change nothing and send no transaction.\n\nYour one piece of this: {{piece}}\n\n{{task}}\n\nYour result is one Markdown file. It must contain: {{must}} Cite the file path and line at that commit, or the URL, behind every claim, and write 'not found' where you could not confirm something.",
      "items": [
        {
          "key": "code-map",
          "vars": {
            "piece": "a map of the site's source against the eight steps of the workflow.",
            "task": "The steps: visit; select games; pay through IMD.fun; IMD confirms and creates the job; the site tracks the job by its id; agents research; sources are cited; the report is shown. Read web/src (config.ts, checkout.tsx, capacity.ts, orders.ts, swarm.ts, pages.tsx, main.tsx, escrow.tsx, predict.ts, engine/) and web/tests. For each step name the files and functions that do it today, whether it works with no backend, and what is missing. Find every gate that keeps checkout closed (PAID_RESEARCH_OPEN, the VITE_ variables, the Worker's /capacity, the escrow) and every place the checkout charges beyond the Intake price (the transfers to the burn address and two wallets). Find how an order's state is derived today (chain logs, IPFS, archive) and where a job id from api.imd.fun would serve. In web/, run npm ci and the unit tests as the README gives them.",
            "must": "a section 'Steps', a table of step, files and functions, works today yes or no, and what is missing; a section 'Gates' with each condition that blocks payment and its line; a section 'Charges' with each transfer the checkout sends and its amount; a section 'Order states' with the states the page shows and what proves each; a section 'Change plan', the smallest edits that make checkout pay the Intake price alone and track by job id, grouped into four to six sets of files that do not overlap, so different people can edit them at once, each with the functions to change and the exported names the other sets rely on; a section 'Tests' with each command run and its pass and fail counts."
          }
        },
        {
          "key": "signing-keys",
          "vars": {
            "piece": "whether any backend private signing key is genuinely needed.",
            "task": "Find every place in the repository that needs a private key, or signs with one, apart from the customer's wallet: the settlement Worker (web/worker/src, VERIFIER_PRIVATE_KEY), the VPS keeper (deploy/, web/server/indexer.ts), the escrow's verifier (src/ImdPicksEscrow.sol: verifyDelivery, settle, rejectDelivery), the deployment scripts, and any other. For each say what it signs, who is meant to hold it, and what stops without it. Then read the IMD.fun protocol (Pay onchain, How paying works, Following it, Jobs, Authentication) and decide, for a checkout where the customer's wallet calls the Intake itself and the page reads public routes: is any key but the customer's wallet needed to pay, to have the job opened, to follow it, or to fetch the report? Also search the repository's files at that commit for a committed private key (a 64-hex value assigned to a key-like name), and give only the path and line of a hit, never the value.",
            "must": "a section 'Signers', a table of operation, file and line, what is signed, key holder, and needed by the IMD.fun-native flow yes or no, with the evidence; a section 'Verdict', one sentence on whether a backend signing key is genuinely required and for what; a section 'What can be switched off', the services and settings the native flow no longer needs and what a customer loses without each, such as refunds or the burn split; a section 'Committed key search' with what was searched and what was found."
          }
        },
        {
          "key": "prior-jobs",
          "vars": {
            "piece": "what the two existing IMD jobs on this site already delivered, so that nothing is done twice.",
            "task": "Job 1c21662c-024a-4c4e-afd3-811c371660f1 (Agent #507; its record is https://api.imd.fun/jobs/<job id>, with /result and /submissions) delivered V14 to https://github.com/identity-md-launches/launch-3533-imd-picks-final, commit 835702de3b4b56d26168fa98086058010c8792a1, on top of the production commit; it adds an ImdPicksCheckout contract and docs/V14_CHECKOUT.md. Job 084260e9-348f-4c40-b6ac-b4838d9d60d5 (Agent #1113) checked the content of https://imd-picks-beyond-the-odds-0842.imd.site. Read the diff between the two commits file by file, docs/V14_CHECKOUT.md, and both jobs' records and reviews. For each changed file decide whether it fits the owner's decision (pay the Intake directly, no contract of the site's own, no verifier key), conflicts with it, or does not bear on it. Say what V14's own Intake checks found (ABI, fees, payer when a contract calls, job owner, refund limits), and whether production's main has moved past that commit or merged V14.",
            "must": "a section 'V14 files', a table of file, what it does, and one of reuse, conflicts, neutral, with why; a section 'Intake facts V14 verified', each fact with where V14 shows it; a section 'Findings', every reviewer or content-check finding on either job with its severity and whether it still stands at the production commit; a section 'Not to repeat', the work already done that a new round should take as it is; a section 'Repository state', the newest commit of both repositories and the time read."
          }
        },
        {
          "key": "live-site",
          "vars": {
            "piece": "what imdpicks.com serves today, and what its owner must do to publish a new build.",
            "task": "Fetch https://imdpicks.com and https://www.imdpicks.com with their scripts, and likewise https://imd-picks-you-select-the-ga-e617.imd.site, https://imd-picks-beyond-the-odds.imd.site and https://imd-picks-beyond-the-odds-0842.imd.site. For each say which commit's dist/ it matches (compare script file names and hashes with dist/ at the production commit and at commit 835702de3b4b56d26168fa98086058010c8792a1 of https://github.com/identity-md-launches/launch-3533-imd-picks-final), who serves it (response headers, DNS), and whether its checkout is open or paused (drive the page in a headless browser if you have one, connecting no wallet). Read docs/CLOUDFLARE.md, docs/DEPLOYMENT.md, docs/BACKEND.md and docs/ACTIVATION.md and list every external service, account, setting and owner action they call for. Mark each needed, optional or not needed once the checkout pays the Intake directly and reads job state from https://api.imd.fun, whose job routes answer any origin.",
            "must": "a section 'What is live', a table of address, who serves it, matching commit, checkout open or paused, and how you know; a section 'Publishing path', the steps by which a new dist/ reaches imdpicks.com and who must do each; a section 'External requirements', a table of service or setting, what it is for, needed, optional or not needed in the native flow, and the owner's action; a section 'Build settings', every VITE_ variable the site reads at build time, its default and the value the native flow wants."
          }
        }
      ],
      "output": {
        "format": "markdown",
        "maxBytes": 32000
      },
      "minutes": 60
    },
    {
      "name": "trunk-import",
      "mode": "code",
      "brief": "This goal's repository is empty. Bring the source of the IMDPicks production site into it unchanged, so that later waves can edit it. From https://github.com/AgentStewLC/launch-3500-imd-picks-complete at commit 741da4053db911b89b94b902c37c0df8460dadc2, copy into the same paths: all of web/ (source, tests, server, worker, scripts, public, package.json, package-lock.json and every other configuration file), all of docs/, README.md, DESIGN.md, .gitignore, contracts/abi/, contracts/integration.mainnet.json and artifacts/samples/. Leave out node_modules, the root dist/, deploy/, and the Solidity sources, scripts and tests (src/, script/, test/, contracts/src/, contracts/test/, foundry.toml). Edit no copied file: no reformatting, no fixes, no change of dependencies. Configuration files cannot change after this wave, so see that web/package.json, web/package-lock.json, web/tsconfig.json, web/vite.config.ts and the tsconfig files under web/server and web/worker are all there.\n\nAdd one new file, docs/TRUNK.md: the source repository and commit, the top-level paths copied and those left out, and the results of the checks below.\n\nThen, in web/, run: npm ci; npm run build; npx tsc --noEmit -p worker; npx tsc --noEmit -p server; node scripts/i18n-check.mjs; and the unit tests, node --test worker/test/*.test.mjs tests/*.test.mjs server/indexer.test.mjs. Commit neither node_modules nor anything a build writes. Where a build or a test needs a file that lies outside your scope, do not copy it: name it in docs/TRUNK.md and in your result.\n\nYour result must name: the commit copied; how many files were copied; each command with pass or fail and, for the tests, how many passed, failed and were skipped; every failing test by name with the first line of its error; and every path the build or the tests needed that the repository does not have.",
      "minutes": 90,
      "items": [
        {
          "key": "production-web",
          "vars": {},
          "scope": [
            "web/**",
            "docs/**",
            "README.md",
            "DESIGN.md",
            ".gitignore",
            "contracts/abi/**",
            "contracts/integration.mainnet.json",
            "artifacts/samples/**"
          ]
        }
      ]
    }
  ],
  "read": [
    "protocol-facts/intake-contract",
    "protocol-facts/status-routes",
    "protocol-facts/job-body",
    "protocol-facts/past-orders",
    "repo-facts/code-map",
    "repo-facts/signing-keys",
    "repo-facts/prior-jobs",
    "repo-facts/live-site",
    "trunk-import/production-web"
  ],
  "cancel": [],
  "wake": {
    "batches": [
      "protocol-facts",
      "repo-facts",
      "trunk-import"
    ],
    "afterMinutes": 180
  },
  "finish": false
}
