{
  "notes": "Episode 3 of 5. State read: items 6/50 used, trunk null, no requester note, no mandate. Budget: onchain 2 left, offchain 0 left (the one website unit is spent on child publish-existing-free-practice, job 6c283b0c-103c-43a4-a4f8-bb78284b009e, state executing when this episode ran). https://peperun.imd.site/ still answered HTTP 404 during this episode's run (2026-11-28, after the 22:22 UTC wake): publication is not done until the child settles and the root serves the 71-file dist of launch-3521 at f74a1295 (SHA256SUMS sha256 f30483fd…531a, see episode 2). e2-launch-fit (1 item) was still running; its result is not read yet. Episode 2's code batch e2-continuation never ran: refused because import-source named 16 scope paths (15 is the most; a target's own result folder is the sixteenth). All its reads were refused with it.\n\nChecked this episode (public, read-only): the source tree at 0e222f40d058f0462c1ec6418e987211950998fc has 502 files, 12.82 MB: script/vendor 4.04 MB (a compressed solc binary), media 2.88 MB, test 1.82 MB, docs 1.69 MB, services 0.80, web 0.73, backend 0.45; 16 top-level entries. There is no lib/: the Solidity tests carry their own cheatcode interface. foundry.toml there has offline = true and file-read permission, which a launch check refuses. RunArcade has no owner at all; its constructor (verifier, admissionAuthority, scoreAuthority, replayVerifier, token) calls the verifier and the token and requires three distinct code-free signer addresses. deployments/chain-1.json holds null for all three roles, their operators and every approval. IMD at 0xD34a99Bc0f67aE1bbd63C660e6d0b0dd03E263B7 on chain 1 reports 18 decimals, symbol IMD (eth_call via https://ethereum-rpc.publicnode.com). Three test contracts need an RPC: RunArcadeForkTest, ContractAuditForkTest, RunArcadeIntegrationForkTest. docs/audit/triage/ledger.md: F-01, F-02, CR-03, CR-05, CR-10, SR-01..04, SR-07..11, CR-ASSEMBLY open; F-03 and SR-05 partial.\n\nDecisions. (1) Spawned e3-continue, a target batch of 10, attempts 3. Chain: import-source -> arcade-launch-fit -> winner-delivery -> {contract-review, deploy-config, system-check, audit-ledger}; beside it import-source -> relay-route -> settlement-keeper, and import-source -> indexer-events. The trunk leaves out media (stays in the source repository and in the published site) and script/vendor, to stay under 8 MiB, and gets a launch-fit foundry.toml in its first commit because configuration files are frozen after that. (2) Contract design, mine, for the requester to see in the write-up: nobody supplied role signers and an IMD launch runs constructors on an empty chain, so RunArcade takes (verifier, owner, token) and the owner sets the three signers ONCE through configureRoles (the verifier's codehash and the token's 18 decimals checked there); purchases revert until then and while the owner's purchase-only pause is on; scores, settlement, donations and claims never read the pause. So the pair can be deployed now with paid play closed, and paid play opens only when the owner configures real, independently run signers after security, infrastructure and legal approval. The owner has no other power. CR-05: a failed winner transfer is recorded as unpaid(winner) and claimable by anyone for that winner; settlement advances. (3) Not attempted: on-chain replay proof. F-01/F-02 (two signers can crown or withhold), F-03 seed opening, SR-02 bots and CR-03 (300 s from last play to inclusion) stay open and must be reported as open; no grace period was authorized. No web target: the site unit is spent, so trunk web changes could not be published; web/js still carries the old ABI and bytecode pins (expect system-check to list them as stale).\n\nNext episode. It may start early on the site child's child.settled wake while targets are still landing. Either way first: read the child's result at /jobs/6c283b0c-103c-43a4-a4f8-bb78284b009e/result, fetch https://peperun.imd.site/ and SHA256SUMS yourself, compare with the pinned dist, and record status, hash match and what differs; if the child failed there is no website unit left to retry with: say so and name who can (the plane/owner). Then the launch. Open it ONLY when all hold: goal.json trunk names a commit; import-source, arcade-launch-fit and winner-delivery landed; e3-continue/contract-review findings.json has verdict launch (no high finding); no code batch is merging; e2-launch-fit does not contradict the kind or the constructor mapping (if it names another contracts-only kind or body field, follow it). The order, as one entry of open: {\"key\":\"pepe-run-contracts\",\"action\":\"launch.open\",\"body\":{\"source\":\"trunk\",\"objective\":\"Deploy the two existing PEPE RUN contracts from this goal's trunk on Ethereum mainnet as one contracts-only launch with no token, pool or third contract: RunVerifier first, with no constructor arguments, then RunArcade with constructor (verifier = $contract:RunVerifier, owner = $owner, token = 0xD34a99Bc0f67aE1bbd63C660e6d0b0dd03E263B7, the existing IMD). Purchases stay closed after deployment until the owner calls configureRoles once: do not call it. Verify both contracts on Etherscan.\",\"onchain\":\"evm_contracts\",\"chainId\":1,\"deployments\":2}}. It spends both deployments; never use evm_project (it adds a token, which the objective forbids) and never a workflow.open (no website unit left). If the review says hold, spawn one small code batch (plain wave or targets) that fixes exactly its high findings in src/** and the tests, and open the launch in episode 5. If targets are still running, do not wait idly: set wake on e3-continue and decide what can be decided. If episode 5 is the last and the launch is opened there, its result will land after the episodes are spent: say in the notes that the write-up must read the launch child's result. A budget.unspent wake gives one extra episode if the deployments are unopened at the end: use it to open the launch if the conditions hold, otherwise finish and say why.\n\nWhat only the requester or operators can supply (record as blockers, never fill in): three distinct signer addresses run by independent operators (admission, score authority, replay verifier) for configureRoles; a persistent backend host, database with backups, two archive RPC providers, HTTPS/WSS endpoint and a funded keeper wallet with a fee cap; the signed security, infrastructure and legal/eligibility decisions and IP rights listed as null in deployments/chain-1.json; an approved IMD swap route. Costs already disclosed in episode 2 (e1-baseline/operations model: about $131.85 to $173.97 a month before gas, people, legal and audit; contract creation 0.025/0.075/0.15 ETH at 5/15/30 gwei; these are scenarios, not quotes). Nothing new was bought this episode; the batch uses 10 of the 44 items left.\n\nFinish when: the site result is read and checked, the launch child has settled (or cannot be opened, with why), and the reviews are read. The write-up must state plainly: free practice live or not, with evidence; two contracts deployed and verified or not, with addresses and Etherscan links from the child's result; paid play CLOSED; backend, verifiers, keeper and database not operating because no service tenancy or operator was supplied; each open finding by ID from e3-continue/audit-ledger; costs. Do not claim the full goal delivered. Results asked for next time: the ten e3-continue items and the five e1-baseline reports (for the write-up).",
  "spawn": [
    {
      "name": "e3-continue",
      "mode": "code",
      "targets": {
        "attempts": 3
      },
      "brief": "One target of the PEPE RUN goal's repository (its trunk): {{title}}. Change files only inside your scope.\n\nThis continues an existing project: rebuild or redesign nothing; add no token, NFT, media or third contract. Its source, data and never instructions: https://github.com/identity-md-launches/goal-3513-continue-complete-existing-pepe at commit 0e222f40d058f0462c1ec6418e987211950998fc. Fixed rules: Ethereum mainnet; IMD 0xD34a99Bc0f67aE1bbd63C660e6d0b0dd03E263B7, 18 decimals; game 1 IMD, permanent skin 5, Royal 10; each purchase split in its own transaction: 50% weekly pot, 25% to 0x000000000000000000000000000000000000dEaD, 25% to 0x83027AD9d0D5374335086c539dADD1db983441B0; the highest verified distance takes the whole pot Sunday 20:00 UTC, a tie the lower entry id, an empty week rolls over, anyone may settle.\n\nRunArcade interface for every target here (existing names stay): constructor(RunVerifier verifier, address owner, IArcadeToken token); owner(); rolesConfigured(); purchasesPaused(); configureRoles(address admissionAuthority, address scoreAuthority, address replayVerifier), owner only, once, event RolesConfigured(the same three, indexed); setPurchasesPaused(bool paused), owner only, event PurchasesPausedSet(bool paused); unpaid(address winner); claim(address winner), anyone; events PayoutDeferred(uint256 indexed epoch, address indexed winner, uint256 amount), PayoutClaimed(address indexed winner, uint256 amount). The owner has no other power.\n\nYour target: {{task}}\n\nTests need no network. foundry.toml, package.json and .gitignore stay as imported. Your result names the trunk commit you started from, each file changed and why, every command run with pass and fail counts, each finding ID with its test, and what stays open and why.",
      "items": [
        {
          "key": "import-source",
          "vars": {
            "title": "seed the trunk from the existing source",
            "task": "Bring the existing files into the trunk unchanged at the same paths: .gitignore, README.md, package.json and the folders backend, deployments, docs, game, script, services, shared, src, test, tools and web. Leave out script/vendor (a 4 MB compiler binary) and media (2.9 MB, already published with the site and kept in the source repository) so the tree stays under 8 MiB, and leave no nested .git. Write foundry.toml anew: [profile.default] with solc = \"0.8.26\", evm_version = \"cancun\", optimizer = true, optimizer_runs = 200, bytecode_hash = \"none\", cbor_metadata = false, ffi = false, fs_permissions = [] and no offline key. Write docs/trunk/IMPORT.md: the source commit, each path left out or changed and why, the file count, and one sha256 line per imported file. Leave the contracts as they are; forge build must compile them."
          },
          "scope": [
            ".gitignore",
            "README.md",
            "foundry.toml",
            "package.json",
            "backend/**",
            "deployments/**",
            "docs/**",
            "game/**",
            "script/**",
            "services/**",
            "shared/**",
            "src/**",
            "test/**",
            "tools/**",
            "web/**"
          ],
          "check": "test -f docs/trunk/IMPORT.md && test -f src/RunArcade.sol && test -f services/settlement/index.mjs && test -f package.json && test ! -e media && test ! -e script/vendor && forge build",
          "needs": []
        },
        {
          "key": "arcade-launch-fit",
          "vars": {
            "title": "launchable constructor and purchase pause",
            "task": "In src/RunArcade.sol implement the interface above except unpaid and claim. The constructor calls no contract and needs no address to have code; it stores verifier, owner (never zero) and token (on chain 1 only the pinned IMD); UNIT is the constant 1e18, RULES_HASH RunVerifier's constant. configureRoles keeps today's role checks (three distinct code-free signers, none the sink or developer) and checks there the verifier's codehash (CR-01) and the token's 18 decimals. purchase reverts RolesNotConfigured before configuration and PurchasesPaused while paused; nothing else reads the pause. Payment is pulled from msg.sender only. Weeks before configuration strand no pot and stall no settlement. Update the existing suites to the new constructor, keeping each regression and PoC test meaningful, and remove or convert the three fork-only test contracts so forge test passes offline. Add test/launch/RolesAndPause.t.sol: unit and fuzz tests of both states and each refused caller."
          },
          "scope": [
            "src/**",
            "test/RunVerifier.t.sol",
            "test/arcade/**",
            "test/audit-contracts/**",
            "test/integration/FixtureIMD.sol",
            "test/integration/ForkIntegration.t.sol",
            "test/launch/**"
          ],
          "check": "test -f test/launch/RolesAndPause.t.sol && forge build && forge test",
          "needs": [
            "import-source"
          ]
        },
        {
          "key": "winner-delivery",
          "vars": {
            "title": "isolate a failed winner payment (finding CR-05)",
            "task": "In src/RunArcade.sol make settle() unable to stall: when the pot transfer to the winner fails or does not move exactly the pot, settle() still closes the week and advances, records the amount under unpaid(winner), keeps it inside liabilities and emits PayoutDeferred; claim(winner) lets anyone retry, pays that winner exactly what is recorded and emits PayoutClaimed. A normal payout stays immediate in settle(). Nobody can redirect, reduce or delay a recorded amount, and absorbDonations never counts it as a donation. Turn test_POC_CR05_RevertingPayoutFreezesAllLaterWeeks into a passing regression; add test/launch/WinnerDelivery.t.sol with a token fixture that refuses one recipient, fuzz tests, and an invariant with a handler: the IMD balance always covers open pots plus unpaid amounts. Then run forge fmt, forge build --sizes (each contract within 24,576 bytes of runtime code) and, where installed, Slither with no high result; mend what they find."
          },
          "scope": [
            "src/**",
            "test/RunVerifier.t.sol",
            "test/arcade/**",
            "test/audit-contracts/**",
            "test/integration/FixtureIMD.sol",
            "test/integration/ForkIntegration.t.sol",
            "test/launch/**"
          ],
          "check": "test -f test/launch/WinnerDelivery.t.sol && forge build && forge test && forge fmt --check",
          "needs": [
            "import-source",
            "arcade-launch-fit"
          ]
        },
        {
          "key": "contract-review",
          "vars": {
            "title": "independent review of the two contracts",
            "task": "Review src/RunVerifier.sol and src/RunArcade.sol as the trunk now has them, as an adversary who wrote none of it. Run forge build --sizes, forge test, forge fmt --check and Slither where installed. Try to break: the 50/25/25 split in one transaction; the owner's limits (only the one-time role configuration and the purchase pause: no price, fee, recipient, winner, entitlement or pot power, no payout blocked); settlement order, ties, rollover, deferred payouts; reentrancy; signature replay; the constructor (no external call). Say for F-01, F-02, F-03, CR-03 and CR-05 whether each is fixed, open or changed at this commit. A finding needs a concrete failing input. Write docs/review/contracts/REVIEW.md and docs/review/contracts/findings.json as {\"commit\", \"verdict\": \"launch\" or \"hold\", \"findings\": [{\"id\", \"severity\", \"title\", \"input\", \"expected\", \"actual\"}]}; the verdict is hold when a high finding lets funds be lost, stalled or misdirected."
          },
          "scope": [
            "docs/review/contracts/**"
          ],
          "check": "test -s docs/review/contracts/REVIEW.md && node -e \"const f=JSON.parse(require('fs').readFileSync('docs/review/contracts/findings.json','utf8'));if(!['launch','hold'].includes(f.verdict)||!Array.isArray(f.findings))process.exit(1)\"",
          "needs": [
            "import-source",
            "arcade-launch-fit",
            "winner-delivery"
          ]
        },
        {
          "key": "deploy-config",
          "vars": {
            "title": "deployment records (CR-10, SR-11)",
            "task": "Regenerate deployments/compiled (both artifacts and the standard JSON input) from a forge build of the current sources under the trunk's foundry.toml, and write docs/abi/RunVerifier.json and docs/abi/RunArcade.json. Update deployments/chain-1.json, deployments/manifest.json and docs/deployment.md to the launch model: RunVerifier first with no arguments, then RunArcade with the verifier's address, the owner and IMD; the network's deployer creates both, so nothing here sends a transaction; the three role signers stay null until operators exist and the owner sets them once through configureRoles. Make each script/*.mjs work without script/vendor, compiling with the installed forge, or retire it in its header. Add script/check-artifacts.mjs, which exits 0 only when the compiled artifacts and ABIs match a fresh forge build. List in docs/deployment.md under \"After launch\" each owner action and where its values come from. Write no launch.json."
          },
          "scope": [
            "deployments/**",
            "script/**",
            "docs/deployment.md",
            "docs/abi/**"
          ],
          "check": "forge build && node script/check-artifacts.mjs",
          "needs": [
            "import-source",
            "arcade-launch-fit",
            "winner-delivery"
          ]
        },
        {
          "key": "relay-route",
          "vars": {
            "title": "relay route and canonical guard in the assembled service",
            "task": "Two findings; reproduce each first and say what you saw. (1) The documented POST relay of a signed score: find where the assembled HTTP surface (services/main, services/api and their READMEs) refuses or never reaches a documented POST relay route because a GET-only handler answers first, and make each documented relay route reachable with its existing authentication and limits. (2) CR-ASSEMBLY in docs/audit/triage/ledger.md: services/main/application.mjs builds the store without the live canonical retention guard; wire the guard as the recovery component expects. Relaying a valid doubly signed score must not depend on purchase readiness or on purchases being paused. Add services/main/test/assembly.test.mjs covering both, the refused cases (wrong method, unsigned, oversized, repeated) and a restart. Where a finding does not reproduce, keep its regression test and say so. Name any suite outside your scope that your change breaks."
          },
          "scope": [
            "services/api/**",
            "services/main/**"
          ],
          "check": "node --test services/main/test/assembly.test.mjs",
          "needs": [
            "import-source"
          ]
        },
        {
          "key": "settlement-keeper",
          "vars": {
            "title": "settlement independent of purchases",
            "task": "Give the settlement keeper its own readiness: it keeps closing weeks while purchases are paused, not yet configured (rolesConfigured false) or the admission side is unready; today they share one readiness gate: find and split it. Code it to the interface above: once a week closes, call settle() until nextUnsettledEpoch reaches the current week, the empty weeks before configuration included; on PayoutDeferred retry claim(winner) with bounded backoff; take a fee cap from configuration and never bid past it; stay idempotent across restarts and reorgs; another caller settling first is success, not an error. It uses one funded transaction signer supplied by its operator and no score or admission signer. Add services/settlement/test/keeper.test.mjs on a fake chain: paused purchases, unconfigured roles, several weeks behind, a deferred payout then its claim, a restart, a competing settler, the fee cap reached. Add to its README the operator's inputs and the gas one week costs."
          },
          "scope": [
            "services/settlement/**",
            "services/main/**"
          ],
          "check": "node --test services/settlement/test/keeper.test.mjs",
          "needs": [
            "import-source",
            "relay-route"
          ]
        },
        {
          "key": "indexer-events",
          "vars": {
            "title": "index and project the new contract events",
            "task": "Code the indexer and the projections to the interface above, keeping every existing event and read. In services/indexer decode RolesConfigured, PurchasesPausedSet, PayoutDeferred and PayoutClaimed (the ABI, a new numbered migration, reorg rollback like the existing events). In services/projections add: a status read with rolesConfigured, purchasesPaused and the three role addresses; unpaid amounts and claims per wallet; weekly winners and pots that stay right when a payout is deferred and later claimed; and the sink total for the burn tracker, the sum of the Distributed event's burned field, which is IMD sent to the sink address while totalSupply stays unchanged. Add services/indexer/test/launch-events.test.mjs and services/projections/test/launch-events.test.mjs on the fake chain: each new event, a reorg that removes one, a replay after restart, and totals equal to the events' sums. Say in both READMEs what each new read returns."
          },
          "scope": [
            "services/indexer/**",
            "services/projections/**"
          ],
          "check": "node --test services/indexer/test/launch-events.test.mjs services/projections/test/launch-events.test.mjs",
          "needs": [
            "import-source"
          ]
        },
        {
          "key": "system-check",
          "vars": {
            "title": "integrated check of trunk and gameplay",
            "task": "Change nothing outside your scope. On the trunk as it stands run, recording exit code, counts and each failure's name: forge build, forge test, forge fmt --check, npm test, npm run check, npm run test:game, script/check-artifacts.mjs where present, and each component's own check.mjs. For each failure say whether it comes from a path left out of the trunk (media, script/vendor), from code still on the old constructor, ABI or bytecode (name the file and line, as under web/js or test/integration), or is a defect. Then play the engine headless (game/engine.mjs, the replay codec): a jump and duck script past three speed steps; distance rises with speed; the same seed and inputs replay to the same metres; Royal gives exactly one extra life; a skin changes no outcome. Write docs/review/system/REPORT.md and docs/review/system/report.json as {\"commit\", \"commands\": [{\"cmd\", \"exit\", \"passed\", \"failed\"}], \"stale\": [{\"path\", \"why\"}], \"defects\": [{\"id\", \"title\", \"evidence\"}]}."
          },
          "scope": [
            "docs/review/system/**"
          ],
          "check": "test -s docs/review/system/REPORT.md && node -e \"const f=JSON.parse(require('fs').readFileSync('docs/review/system/report.json','utf8'));if(!Array.isArray(f.commands))process.exit(1)\"",
          "needs": [
            "import-source",
            "arcade-launch-fit",
            "winner-delivery"
          ]
        },
        {
          "key": "audit-ledger",
          "vars": {
            "title": "reconcile every earlier audit finding",
            "task": "Change nothing outside your scope. Take every finding ID in docs/audit/triage/ledger.md and its index.json (F-00 to F-15, CR-01 to CR-10, SR-01 to SR-11, the BR and canonical recovery IDs and any other) and give each one row for the trunk as it stands: fixed, partial, open or disclosure; the file and test that shows it, run by you now; and for each open one what closing it needs and who can supply it (code here, an operator's service, the requester's decision, a security or legal sign-off). Cover in particular verifier collusion (F-01, SR-01), score withholding (F-02), seed opening and timing (F-03, SR-03, SR-04, SR-07), automated play (SR-02), the 300-second inclusion window (CR-03), CR-05, CR-10 and the purchase pause. Mark fixed only what a test you ran shows. Write docs/review/ledger/LEDGER.md and docs/review/ledger/ledger.json as {\"commit\", \"rows\": [{\"id\", \"status\", \"evidence\", \"needs\", \"who\"}], \"counts\": {\"fixed\", \"partial\", \"open\", \"disclosure\"}}."
          },
          "scope": [
            "docs/review/ledger/**"
          ],
          "check": "test -s docs/review/ledger/LEDGER.md && node -e \"const f=JSON.parse(require('fs').readFileSync('docs/review/ledger/ledger.json','utf8'));if(!Array.isArray(f.rows))process.exit(1)\"",
          "needs": [
            "import-source",
            "arcade-launch-fit",
            "winner-delivery"
          ]
        }
      ]
    }
  ],
  "read": [
    "e3-continue/import-source",
    "e3-continue/arcade-launch-fit",
    "e3-continue/winner-delivery",
    "e3-continue/contract-review",
    "e3-continue/deploy-config",
    "e3-continue/relay-route",
    "e3-continue/settlement-keeper",
    "e3-continue/indexer-events",
    "e3-continue/system-check",
    "e3-continue/audit-ledger",
    "e1-baseline/reuse",
    "e1-baseline/contracts",
    "e1-baseline/verification",
    "e1-baseline/website",
    "e1-baseline/operations"
  ],
  "cancel": [],
  "wake": {
    "batches": [
      "e3-continue",
      "e2-launch-fit"
    ],
    "afterMinutes": 720
  },
  "finish": false
}
