# IMDPicks source-to-workflow map Pinned commit: **741da4053db911b89b94b902c37c0df8460dadc2**. “Works today” means source support without an **IMDPicks backend**, assuming static hosting/public feeds/RPC/IPFS, not live acceptance. Read-only inspection; no transaction sent. **Architecture finding:** `App` mounts `EscrowCheckout` when `ESCROW` exists, otherwise `EscrowPreview`; it does **not** mount the legacy `Checkout`. `ESCROW` is derived from a hard-coded deployment, not a live build-time escrow variable. Thus merely editing `checkout.tsx`, or setting `VITE_IMD_ESCROW`, cannot switch the active payment route. [web/src/main.tsx:203–204][M] [web/src/config.ts:110–124][C] The intended door is wallet → Intake `request` → IMD admission → job: 0.5 IMD and public status/result reads. The old verifier signs escrow artifact attestations. [Protocol][DOC] [web/worker/src/chain.ts:18–46][WC] [contracts/src/ImdPicksEscrow.sol:411–434][CT] ## Steps | Step | Files and functions today | Works today yes or no (no site backend) | What is missing | | --- | --- | --- | --- | | 1. Visit | `web/src/main.tsx`: `Home`, `App`, `createRoot`, hash routes and wallet provider. [main.tsx:45–120,153–209][M] | **Yes**, static React entry and routes exist. | Hosting/DNS is external. Live-site equivalence to this commit: **not found**; no browser check. [main.tsx:209][M] | | 2. Select games | `games.tsx`: `loadLeague`, `loadGames`, `refreshSchedule`, `useSchedule`, `toggle`, `useSlip`, `liveSlip`, `GameCard`, `GamesList`, `Slip`; `main.tsx`: `Picks`; `orders.ts`: `selectionId`, `jobBody`. ESPN feed; localStorage selection. [games.tsx:118–209,348–401,445–468][G] [main.tsx:122–147][M] [orders.ts:49–61,80–107][O] | **Yes**, subject to feed availability and deadlines. | Preserve fresh schedule checks, 1–14 bound and stable identities. Remove tier-payment/depth promises from `fundingLine` when using the single Intake price. No agent research occurs during selection. [games.tsx:188–209][G] [orders.ts:70–107][O] | | 3. Pay through IMD.fun | Active `EscrowCheckout` → `sdk.approveExact` / `sdk.pay` → escrow `pay` → `_submit` / `requestWithFailure`. Legacy `Checkout.run` directly approves Intake and calls `request`, then sends three extra transfers. [escrow.tsx:174–192][E] [engine/sdk.ts:189–227][SDK] [ImdPicksEscrow.sol:323–362,539–554][CT] [checkout.tsx:137–174][K] | **No**, current active path requires site Worker capacity and pays a separate escrow tier; the legacy direct path is unmounted and still overcharges. | Mount a single direct Intake checkout, approve/pay only 0.5 IMD, and remove all developer/burn sends for new orders. Keep wallet/chain/receipt checks; separate approval from actual payment. [main.tsx:203–204][M] [config.ts:41–65,100][C] [escrow.tsx:139–141,181–191][E] | | 4. IMD confirms and creates job | `paidFromReceipt` proves escrow `OrderPaid`; legacy `requestedIn`, `requestReceiptOk`, `reconcileOrder` recover Intake request evidence. IMD itself runs admission; no frontend function creates the UUID job directly. [engine/sdk.ts:217–227][SDK] [orders.ts:116–117,208–240][O] | **No**, not as a confirmed payment→API-job handoff. Chain confirmation helpers exist without a site backend; job admission tracking is absent. | Poll `GET /intake/1/:transactionHash`, match the exact Intake event/request/payer/action, then persist `admission.result.jobId`. Receipt ≠ admission/completion; unknown/received/paid stays pending; refused/failed stays failed. [Protocol, “Following it”][DOC] | | 5. Track by job ID | `swarm.ts`: `scanAnalyses`, `analysisById`; `orders.ts`: `outcomeOf`; `pages.tsx`: `ResearchView`, `Dashboard`; `escrow.tsx`: `load` / `useEscrowOrders`; SDK `getOrder`, `ordersByPayer`, `phaseOf`. These use request IDs, blocks and escrow order IDs. [swarm.ts:373–440,497–504][S] [orders.ts:250–261][O] [pages.tsx:135–157,891–904][P] [escrow.tsx:98–118,261–270][E] [engine/sdk.ts:140–142,406–433][SDK] | **No** for API job-ID tracking. Existing request-log tracking can run in a tab without a site backend. | API job ID field, receipt→admission resolution, UUID route, persistent mapping, retry/backoff and explicit pending/completed/failed/unknown states. Job API calls/UUID storage were **not found** by searching `web/src` and `web/tests` for `api.imd.fun`, `/intake/`, `/jobs/`, `jobId`, `job_id`. Route requires request hash/block. [main.tsx:159–160,185][M] [orders.ts:17–28][O] [Protocol, “Jobs”][DOC] | | 6. Agents research | `orders.ts`: `jobBody` emits `{skill:"research-report", objective}` with per-sport research, probabilities, critique and real-participation instructions. `engine/report.ts`: `validate`, `validateBundle` check delivered structure. [orders.ts:80–107][O] [engine/report.ts:47–94,174–186][R] | **No**, agent execution is IMD's external service, not a browser capability. | Correct handoff to IMD and job progress display. Proof that exactly 1,999 agents ran: **not found**; the brief says report actual roles/count, not a fabricated count. Source validation only checks recorded participation, not orchestration truth. [orders.ts:92,100][O] [engine/report.ts:54][R] | | 7. Sources cited | `jobBody` requests URL/access-time citations; report schema contains `sources`; `validate` requires nonempty sources. `swarm.ts`: `enrichFromSections` recovers section links; `pages.tsx`: `PickCard` renders source URLs/access times and `ReportView` renders delivered Markdown. [orders.ts:97,101][O] [engine/report.ts:19,55][R] [swarm.ts:154–186][S] [pages.tsx:424–427,388–389][P] | **Yes**, for citations present in a retrieved report; **not** independent confirmation of their reliability. | Source credibility/access-time verification: **not found**. Nonempty citations/hashes do not prove research truth; preserve citations in API adapter. [engine/report.ts:47–94][R] [swarm.ts:83–85][S] | | 8. Report shown | `ResearchView` waits for `Completed` status 0, calls `fetchReport`, retries downloads/missing files; `swarm.ts`: `download`, `hashMatches`, `fromManifest`, `retryMissing`, `fetchReport`; `pages.tsx`: `ReportView`, `PickCard`, `MarketTable`; `predict.ts`: `toV2`, `validate`, `finishMarket`; engine `validateBundle` checks report/timing. [pages.tsx:135–209,299–389,400–499][P] [swarm.ts:53–85,240–304][S] [predict.ts:170–214,293–341][V] [engine/report.ts:174–186][R] | **Yes** for a reachable existing chain-delivered report; **no** for the requested automatic API-job-result route. | Read `/jobs/:id/result`, require accepted/complete output, verify downloaded files, adapt report.json/report.md to existing views, and distinguish delivery from verified rendering. `/jobs/:id/report.md` is audit-specific, not the generic research-report download. [Protocol, “Jobs”][DOC] | ## Gates Live build settings/Worker health: **not found**. These gates describe source behavior. | Gate / blocking condition | Exact source location | | --- | --- | | `PAID_RESEARCH_OPEN` requires **both** `VITE_PAID_RESEARCH_OPEN === "true"` and `VITE_IMD_ARCHIVE_URL` matching an HTTPS URL with no whitespace. Absent/invalid values close payment. The nearby release comment requires recorded 1-, 5-, 14-event payment/delivery/recovery/failure runs; that prose is not a runtime test. | [config.ts:87–100][C] | | `ARCHIVE_URL` separately parses the same HTTPS variable and strips trailing slashes. No configured archive means no capacity fetch; `capacityOpen(null)` is false. | [config.ts:128–134][C] [capacity.ts:15–28][A] | | `/capacity` must return an OK JSON object with boolean `accepting:true`; HTTP error, invalid JSON/shape, timeout (8 seconds) or unreachable host closes it. Answer must be younger than 120,000 ms; refresh every 60,000 ms, plus charge-boundary recheck. | [capacity.ts:15–30][A] [escrow.tsx:139–141,181][E] | | Worker switch must be `PAYMENTS_OPEN=true` after trimming/lowercasing. Missing/invalid/foreign verifier key closes it. Last keeper pass must exist and be no older than `STALE_MS` (default 600,000 ms). Verifier balance must reach `MIN_VERIFIER_WEI` (default 2e15 wei). Open count must be below `MAX_OPEN_ORDERS` (default 8). Any reason means not accepting. | [worker/src/index.ts:103–116][W] [worker/src/chain.ts:18–25][WC] | | `ESCROW` chooses escrow checkout; null chooses preview, **not** legacy `Checkout`. `VITE_IMD_ESCROW` and `VITE_IMD_ESCROW_BLOCK` appear in stale comments, but active `ESCROW` and `ESCROW_FROM_BLOCK` use `DEPLOYMENT` constants. They are **not active build-variable gates** at this commit. | [main.tsx:203–204][M] [config.ts:110–124][C] [escrow.tsx:1–7][E] [engine/sdk.ts:402–408][SDK] | | Escrow `verified` requires the async `verifyEscrow` result to be non-null and empty. It checks deployed code, every `EXPECTED` getter (including verifier/recipients), tier price boundaries, split boundaries, delivery windows, token decimals and pinned Intake treasury. Unreadable/mismatched values close payment. | [escrow.tsx:97,136–141][E] [engine/sdk.ts:22–43,86–125][SDK] | | Escrow `canPay` also requires `escrowPayGate === "ok"`, a quote with `priceFits` and `enoughImd`, age checkbox, and 1–14 live events. `priceFits` requires positive Intake price ≤0.5 IMD; enough balance means the entire 1/1.5/2 tier. Missing quote disables payment. | [escrow.tsx:135–141][E] [engine/sdk.ts:169–180][SDK] | | Duplicate lookup pending/error, existing active escrow order, legacy direct payment, or eight exhausted attempts prevents another payment. Refunded escrow has an explicit new-attempt path. Lookups are repeated immediately before approve/pay. | [engine/sdk.ts:149–160,303–308][SDK] [escrow.tsx:98–109,120–127,174–178][E] | | Wallet absent, wrong chain (Ethereum 1), busy action, or missing wallet client: no payment control/send. An unmet allowance offers exact tier approval first. | [config.ts:11–12][C] [escrow.tsx:165–176][E] [engine/sdk.ts:183–196][SDK] | | At payment: fresh capacity failure; schedule unavailable for a selected league; moved/removed/deadline-expired selection; empty eligible selection; no valid `deliverBy`; recomputed tier different from shown quote—all stop before `sdk.pay`. | [escrow.tsx:178–191][E] [games.tsx:195–209][G] [engine/deadline.ts:120–146][D] | | SDK refuses event count outside 1–14, body length outside 1–16,384 bytes, unexpected displayed tier price, simulation failure or reverted receipt/no `OrderPaid`. Contract also rejects duplicate order ID, bad deadline, empty/oversized body, Intake price 0 or >0.5, treasury change, transfer mismatch and token failure. Receipt failure means unconfirmed; it can occur after sending. | [engine/sdk.ts:203–227][SDK] [ImdPicksEscrow.sol:323–362,539–560][CT] | | Legacy-only: `blocked` includes invalid split, no schedule, changed events, ambiguous legacy transfers, closed release switch, failed/unresolved budget verification, no address, wrong chain, insufficient remaining balance, unchecked age, empty live slip. `run` also refuses lock/client absence. Budget reads timeout after 25 s; wrong token decimals/symbol, price 0 or >0.5, RPC error closes it. | [checkout.tsx:13–25,79–90,108–109][K] | | Legacy-only: saved pending/unknown/unseen hashes stop further sends; duplicate scan error stops; ambiguous unbound transfers require reconciliation; approval/request/leg receipt mismatch stops; request must confirm before extra sends. UI disables while busy. This is dormant code, not the production-mounted path. | [checkout.tsx:94–100,114–174,205][K] [orders.ts:164–240][O] [main.tsx:203–204][M] | | Selection entry gates: `toggle` rejects additions at 14 or too close to start; `Slip`/dock disable checkout when no eligible live events. These can block entering checkout before the payment checks above. | [games.tsx:183–193,445–490][G] [main.tsx:196][M] | **Private key distinction.** The old Worker signs escrow maintenance calls; `keeperAccount` requires the immutable verifier's account. `verifyDelivery`/`rejectDelivery` require that address; permissionless settlement still requires its attestation. No key makes Worker read-only and capacity closed. Direct Intake uses the customer's wallet and public API reads, so no site backend verifier is required for that new path. Keep old-order maintenance separate. [worker/src/chain.ts:18–46][WC] [worker/src/index.ts:105–116][W] [ImdPicksEscrow.sol:388–434][CT] [Protocol][DOC] ## Charges Amounts are **IMD**; addresses are source constants, not live-verified transfers. ETH gas is additional network cost. [config.ts:9–18,28,35][C] [engine/pricing.ts:6–17][PR] | Path / transfer | Amount and destination | Source | | --- | --- | --- | | Intended direct Intake payment | **0.5** (500000000000000000 token units) to Intake `0xa43e6f75ee006411f79ac1c84120606c2330de82`, forwarded to its treasury. | [Protocol, “What it sells”][DOC] [config.ts:35,43][C] | | Active escrow checkout: initial pull | Customer approves `0xa1988b43dafb75f25adfaa6752bdc5d966038e98`; its `pay` pulls **1** for 1–4 events, **1.5** for 5–9, **2** for 10–14. This pull includes, rather than adds to, the allocations below. | [config.ts:110–122][C] [engine/pricing.ts:25–36][PR] [engine/sdk.ts:189–212][SDK] [ImdPicksEscrow.sol:347–360,571–575][CT] | | Active escrow: Intake allocation | Escrow approves and submits **0.5** in every tier via `requestWithFailure`, with its own callbacks. Remainder **0.5 / 1 / 1.5** stays escrowed pending outcome. | [ImdPicksEscrow.sol:347–360,539–562][CT] | | Active escrow: burn transfer on settlement | **0.25 / 0.5 / 0.75** (tiers 1/2/3) to `0x000000000000000000000000000000000000dEaD`. | [config.ts:28][C] [engine/pricing.ts:11–16,41–46][PR] [ImdPicksEscrow.sol:388–408][CT] | | Active escrow: wallet 1 on settlement | **0.125 / 0.25 / 0.375** to `0x83027AD9d0D5374335086c539dADD1db983441B0`. | [config.ts:15–16][C] [engine/pricing.ts:11–16,41–46][PR] [ImdPicksEscrow.sol:405–407][CT] | | Active escrow: wallet 2 on settlement | **0.125 / 0.25 / 0.375** to `0xA02c46e76283677Ca4cB7cf152474477C0f40A88`. | [config.ts:18][C] [engine/pricing.ts:11–16,41–46][PR] [ImdPicksEscrow.sol:405–407][CT] | | Dormant direct checkout v2 | First **0.5** through Intake `request`; then ERC-20 transfers **0.125** wallet 1, **0.125** wallet 2, **0.25** burn, in that order. Total **1** plus gas regardless of event count. Each extra transfer appends request ID in calldata. | [config.ts:41–61][C] [checkout.tsx:150–174][K] | | Dormant direct checkout v1 recovery | First **0.5** Intake; **0.25** wallet 1 and **0.25** burn. No wallet-2 leg. `legsFor` chooses by explicit split, otherwise old dev transaction/flag. | [config.ts:47–48,62–73][C] [checkout.tsx:127–134,161–174][K] | | ERC-20 approval | Sets allowance only; it is **not** an extra IMD transfer. Legacy grants **0.5** to Intake; active escrow grants exact tier price. | [checkout.tsx:138–145][K] [engine/sdk.ts:189–197][SDK] | Burn/rewards wait for verified delivery/settlement. Failed/late/timed-out old orders may refund the held remainder. Keep old-tier accounting distinct from new 0.5-only orders. [ImdPicksEscrow.sol:365–408][CT] [escrow.tsx:25–30,62–67][E] ## Order states Proofs today: browser flags, Intake logs and escrow state; none stores API job UUID. [orders.ts:17–47][O] [swarm.ts:373–375][S] [engine/sdk.ts:58–64][SDK] | State/page wording | Evidence used today and its limits | | --- | --- | | Legacy “Not paid”, “Payment unfinished”, “Paid 1 IMD” | `OrderList` uses `anySent` / `fullyPaid`: request verified flag plus all split-version leg flags. `paymentRows` displays each saved hash/flag; approval has no confirmation flag. Data is localStorage per wallet/slip. The flags' intended proof is receipt reconciliation, not mere transaction hash. `OrderList` itself does not revalidate flags before displaying the badge, so this badge is not an independent live chain proof. [pages.tsx:81–129][P] [orders.ts:29–47,221–240][O] | | Transaction `ok`, `pending`, `failed`, `dropped`, `unknown`, `unseen` | `txState`: successful receipt plus expected effect ⇒ ok; revert/effect mismatch ⇒ failed; node-held transaction ⇒ pending; absent transaction plus consumed nonce and second absent receipt ⇒ dropped; RPC failure ⇒ unknown; absent without proof of replacement ⇒ unseen. Last two retain hashes and block retries. `reconcileOrder` sets verified flags, clears proven failures/drops, retains uncertain hashes. [orders.ts:164–240][O] | | Legacy request confirmation | `requestedIn` checks Intake log address; `requestReceiptOk` looks for it and sums payer token transfers to Intake/`payTo`, requiring at least 0.5. It does **not** itself compare expected body/action/request payer to the event or bind each extra leg's calldata when reconciling saved receipts. This is narrower evidence than a full order/admission confirmation. [orders.ts:110–117,208–212,225–227][O] | | Public “Paid on Ethereum” / “Researching” | `analysisById` reads `Requested` in the route's exact block and scans subsequent `Completed`; `ResearchView` sets paid stage true once that request exists. No outcome means researching, not evidence agents have actually started. `AnalysisRow` uses the same outcome absence. [swarm.ts:497–504][S] [pages.tsx:71–78,135–180][P] | | Public “Report delivered”, “Refused by the Swarm”, “Ended without a result” | `Completed.status` is mapped as 0,1,2; unknown nonzero statuses use a generic ended fallback in list rows. Status 0 starts report retrieval, separately from successful byte verification. `ResearchView` marks delivery stage done for **any** outcome, but uses failure wording for nonzero status. [swarm.ts:377,501–503][S] [pages.tsx:71–78,143,177–209][P] | | Escrow `None` → `unpaid` (“Not paid”) | `getOrder` decodes on-chain enum; no order/None ⇒ unpaid. An RPC read error is not used as a fabricated paid order. [engine/sdk.ts:58–64,140–142,266–267][SDK] [escrow.tsx:97–109,243][E] | | `Submitted` → `researching` | Escrow `pay` stored payer, submitted time, request ID and held remainder; SDK reads it. SDK UI switches to `refund-available` only when remainder >0 and local now >deliverBy; the contract is final authority for refund success. [ImdPicksEscrow.sol:341–362][CT] [engine/sdk.ts:268–270][SDK] | | `Delivered` → `report-ready`; `checking` / `verified` / `expired` | Callback records nonempty URI/hash and on-time delivery. SDK returns `report-ready` even while `verifiedAt` is absent; `verificationOf` says checking, or expired after reportedAt +6h. Expired unattested order with held funds becomes refund-available. `EscrowStatus` says files are being checked, but the list badge already says “Report delivered”; neither wording proves successful report rendering. [ImdPicksEscrow.sol:472–489][CT] [engine/sdk.ts:69,272–289][SDK] [escrow.tsx:48–66,242–244][E] | | `Settled` → `complete` | Contract only settles Delivered with nonzero verifiedAt, then transfers allocations and sets Settled. This is old escrow completion evidence, not API job completion. [ImdPicksEscrow.sol:388–408][CT] [engine/sdk.ts:277][SDK] | | `Failed` → `failed`; `Late` → `late`; UI “Refund available” | Intake failure callback or verifier rejection produces Failed; empty result becomes Failed; callback after deadline becomes Late. SDK phases expose refund controls; list merges failed/late/refund-available to the same badge. Late result is explicitly not pre-event. [ImdPicksEscrow.sol:425–434,472–517][CT] [engine/sdk.ts:278–280][SDK] [escrow.tsx:62–66,242–250][E] | | `Refunded` → `refunded` | Contract clears escrow, sets Refunded, transfers the remainder to original payer and emits OrderRefunded. SDK payer recovery reads OrderPaid/OrderRefunded then current getOrder. Optional reserve status/controls are displayed separately; they are not proof the original job succeeded. [ImdPicksEscrow.sol:367–383][CT] [engine/sdk.ts:406–433][SDK] [escrow.tsx:209–252][E] | | “Delivery manifest verified”, “Report files verified”, hash mismatch/no hash/unverified sibling | `fetchReport` verifies root bytes against Completed.resultHash, parses a hashed manifest, verifies files, and reports missing required files. Up to 32 files, report.json/report.md prioritized. Unhashed sibling JSON is explicitly jsonOk:false. `toV2` requires a result hash plus verified flag; Track Record excludes unverified predictions. Rendered warnings do not turn an unreadable/mismatched result into a verified report. [swarm.ts:226–304][S] [pages.tsx:181–184,283–294,508–516][P] [predict.ts:317–320][V] | **Logs/IPFS/archive.** `scanAnalyses` caches incremental Requested/Completed logs in memory, filtered by action and “IMD PICKS slip”; it starts at Intake deployment and joins by request ID. First failure rejects; later failures return a possibly stale last-good snapshot. `rescan` resets it. ResearchView polls every minute; escrow checkout every 20 seconds while working/verifying; Dashboard every two minutes. [swarm.ts:404–443,497–504][S] [pages.tsx:138–157,901–904][P] [escrow.tsx:110–118][E] The HTTP archive is different: on-chain URI → four IPFS gateways → optional `ARCHIVE_URL/reports//`. It is fallback storage, not paid/completed authority; root/file hashes still apply (Keccak-256 or SHA-256). Escrow recovery uses chain events; legacy receipts remain browser-local, with public chain history available. [swarm.ts:53–85,240–304][S] [engine/sdk.ts:406–433][SDK] [orders.ts:29–47][O] **Job-ID seam:** persist `admission.result.jobId` beside payer/requestId/tx/selection after matching `/intake/1/`, then poll job/result endpoints. Keep old request hashes/routes for history. No bridge exists today. A pasted UUID, local record or HTTP 200 must never imply paid; payment alone must never imply report ready. These are proposed acceptance rules. [Protocol][DOC] [orders.ts:17–28][O] [main.tsx:159–160][M] ## Change plan Six disjoint file ownership sets, **proposed edits only**. Keep old readers/routes/refunds, but remove escrow and its capacity Worker from new payments. No contract redeployment is needed. Existing seams: [main.tsx:159–204][M] [checkout.tsx:108–178][K] [orders.ts:17–47][O] [swarm.ts:240–304][S]. New names below are interface proposals. | Set / exclusive files | Functions and edits | Exports / dependencies | | --- | --- | --- | | **1. Payment policy** — `web/src/config.ts`, `web/src/engine/pricing.ts`, `web/src/tiers.tsx`, `web/src/capacity.ts` | Separate direct-door release switch from archive/capacity. Change `priceText`, `TierTable`, `PayTerms` for new purchases to 0.5; retain historical split/refund math. Keep release closed until acceptance evidence. Existing coupling: [config.ts:41–100,128–134][C] [pricing.ts:25–46,80–84][PR] [capacity.ts:15–30][A]. | Add `DIRECT_INTAKE_PRICE=500000000000000000n`, `IMD_API_URL`, `DIRECT_RESEARCH_OPEN`, `intakePriceText()`. Retain token/Intake/action/chain/client/ABIs and historical pricing exports. Sets 2/3/5 consume these. | | **2. Orders/API transport** — `web/src/orders.ts`, new `web/src/imd-job.ts` | Change `fundingLine`/`jobBody` to honest flat funding. Add versioned direct orders, exact expected payer/action/body/asset/amount receipt verification, nonce recovery and duplicate lookup. Do not resume old developer/burn debts in new checkout. Resolve transaction → admission UUID; persist mapping; retry transient errors without declaring failure/completion. Existing seam: [orders.ts:17–47,70–107,208–240][O]; public bridge: [Protocol][DOC]. | Add `IntakeOrder` (selection, payer, chain, tx, requestId, logIndex, bodyHash, amount, jobId, separate payment/admission/job states); `saveIntakeOrder`, `intakeOrdersOf`, `recoverIntakeOrder`, `confirmIntakePayment`, `findIntakeDuplicate`; `resolveIntakeJob`, `readJob`, `readJobResult`, `preflightJob`, `JobSnapshot`, `JobResult`. Sets 3/4/5 consume these; preserve legacy helpers. | | **3. Wallet checkout** — `web/src/checkout.tsx` | Rework `Checkout`, `verifySwarmBudget`, `run`: keep wallet/chain/age/balance/fresh selection/duplicate guards; preflight body; approve/request exactly 0.5; confirm receipt then await admission. Delete leg loop, split/owed calculations and multi-transfer copy. If live price differs, pause/requote. Current sends: [checkout.tsx:13–25,79–90,108–178][K]. | Retain `Checkout` and `onPaid(selectionId)` (payment navigation, not job completion). Consume sets 1/2; use existing `recheckForPayment` [games.tsx:202–209][G]. No escrow SDK/capacity dependency. | | **4. Accepted-artifact adapter** — `web/src/swarm.ts`, `web/src/predict.ts`, `web/src/engine/report.ts` | Add accepted API file loading with hashes, completeness/citation preservation and retry; preserve legacy chain loader/math. Change `toV2` provenance support: never fabricate an on-chain hash for API output. Require complete purchased-event coverage. Existing seams: [swarm.ts:83–85,240–304][S] [predict.ts:317–320][V] [report.ts:156–186][R]. | Add `fetchJobReport(result: JobResult, order: IntakeOrder)` and `JobReport` (content, provenance, accepted/hash-checked/complete flags, missing files). Retain `Fetched`, `fetchReport`, `hashMatches`, `validateBundle`, `toV2`. Set 5 consumes new report shape. | | **5. Routes/UI/copy** — `web/src/main.tsx`, `web/src/pages.tsx`, `web/src/games.tsx`, `web/src/escrow.tsx`, `web/src/i18n-pay.ts`, `web/src/i18n-flow.ts`, `web/src/i18n-ui/**` | Mount set 3 Checkout; add UUID route and `JobResearchView`. Update Dashboard/MyResearch/ReportView for awaiting payment/admission, researching, failed/blocked, completed-but-downloading, verified report. Remove new tier/escrow/refund promises from Home/Slip/footer/How/translations. Preserve old report routes and escrow recovery/refunds. Consumers: [main.tsx:159–204][M] [pages.tsx:81–209,299–389,981–1004][P] [games.tsx:445–490][G] [escrow.tsx:237–294][E]. | Add `jobHref(jobId)`, `JobResearchView`; retain `ResearchView`, `ReportView`, `shareHash`. Consume sets 1/2/4. Pasted UUID/public report access alone never yields paid badge. | | **6. Tests/evidence** — `web/tests/**` (including new `payment-to-report.test.mjs`), `web/server/indexer.test.mjs`, `web/worker/test/**`, `README.md` | Add direct-RPC/API fixtures: exact price, no extra sends, concurrent clicks, mismatched/reverted/replaced receipt, reload, admission delay/404/refusal, failed/blocked job, incomplete/tampered/missing artifacts, citations/probabilities; cover 1/5/14 events and reconnect. Preserve historical tier/escrow regressions. Record separately authorized live acceptance before opening release. Current recipes/fixture limits: [README.md:29–33,72–88][README] [revision-v11.test.mjs:1–3][T]. | Consume sets 1–5; no production exports. README owns acceptance evidence/hosting handoff. This map task authorizes no funded test. | Coordination: agree interfaces and allocate each set once. Agents #507/#1113 ownership/branches and existing-job progress: **not found** in this inspection. No source implementation was changed. External needs: static-site deployment/DNS authorization and browser access to wallet, RPC, ESPN, IMD API/artifacts. Production-origin API/artifact CORS: **not found/tested**. Public reads need no site signing service; legacy escrow operations retain their existing authorization. [config.ts:136–138][C] [games.tsx:118–136][G] [worker/src/chain.ts:18–46][WC] [Protocol][DOC] ## Tests Executed in pinned scratch `web/` unless noted. Counts are **local observations**; recipes come from README. [README.md:29–33,72–88][README] | Command run | Result | Pass / fail counts | | --- | --- | --- | | `npm ci --cache ../npm-cache` | Exit 0; 80 packages added. Installer reported 2 dependency vulnerabilities (1 moderate, 1 high); no audit-fix mutation performed. Cache was scratch-only. | 1 command succeeded / 0 failed; test cases N/A. | | `node --test tests/*.test.mjs server/indexer.test.mjs` | Exit 0. | **69 passed / 0 failed**, 0 skipped/cancelled/todo. | | `node --test worker/test/*.test.mjs tests/*.test.mjs server/indexer.test.mjs` | Exit 0. Superset; counts overlap. | **101 passed / 0 failed**, 0 skipped/cancelled/todo. | | `python3 test/scratch/validate.py` (root; scratch-only validator) | Final check: remote quotes, JSON, sections, references, byte limit. Initial size check failed and was repaired by shortening prose. | **20 quotes passed / 0 failed**; final structural checks passed. | These cover existing engine/pricing/knowledge/revision/indexer/Worker behavior; report-loader fixtures are simulated, not live delivery. [README.md:32,87][README] [web/tests/revision-v11.test.mjs:1–3][T] No build, browser, funded end-to-end test or deployment was performed. Full payment→admitted UUID→accepted report evidence: **not found** in these checks. Workflow remains **unverified**. [C]: https://github.com/AgentStewLC/launch-3500-imd-picks-complete/blob/741da4053db911b89b94b902c37c0df8460dadc2/web/src/config.ts#L100 [K]: https://github.com/AgentStewLC/launch-3500-imd-picks-complete/blob/741da4053db911b89b94b902c37c0df8460dadc2/web/src/checkout.tsx#L108 [A]: https://github.com/AgentStewLC/launch-3500-imd-picks-complete/blob/741da4053db911b89b94b902c37c0df8460dadc2/web/src/capacity.ts#L15 [O]: https://github.com/AgentStewLC/launch-3500-imd-picks-complete/blob/741da4053db911b89b94b902c37c0df8460dadc2/web/src/orders.ts#L17 [S]: https://github.com/AgentStewLC/launch-3500-imd-picks-complete/blob/741da4053db911b89b94b902c37c0df8460dadc2/web/src/swarm.ts#L286 [P]: https://github.com/AgentStewLC/launch-3500-imd-picks-complete/blob/741da4053db911b89b94b902c37c0df8460dadc2/web/src/pages.tsx#L135 [M]: https://github.com/AgentStewLC/launch-3500-imd-picks-complete/blob/741da4053db911b89b94b902c37c0df8460dadc2/web/src/main.tsx#L153 [E]: https://github.com/AgentStewLC/launch-3500-imd-picks-complete/blob/741da4053db911b89b94b902c37c0df8460dadc2/web/src/escrow.tsx#L73 [V]: https://github.com/AgentStewLC/launch-3500-imd-picks-complete/blob/741da4053db911b89b94b902c37c0df8460dadc2/web/src/predict.ts#L317 [G]: https://github.com/AgentStewLC/launch-3500-imd-picks-complete/blob/741da4053db911b89b94b902c37c0df8460dadc2/web/src/games.tsx#L188 [SDK]: https://github.com/AgentStewLC/launch-3500-imd-picks-complete/blob/741da4053db911b89b94b902c37c0df8460dadc2/web/src/engine/sdk.ts#L266 [PR]: https://github.com/AgentStewLC/launch-3500-imd-picks-complete/blob/741da4053db911b89b94b902c37c0df8460dadc2/web/src/engine/pricing.ts#L25 [R]: https://github.com/AgentStewLC/launch-3500-imd-picks-complete/blob/741da4053db911b89b94b902c37c0df8460dadc2/web/src/engine/report.ts#L174 [D]: https://github.com/AgentStewLC/launch-3500-imd-picks-complete/blob/741da4053db911b89b94b902c37c0df8460dadc2/web/src/engine/deadline.ts#L120 [CT]: https://github.com/AgentStewLC/launch-3500-imd-picks-complete/blob/741da4053db911b89b94b902c37c0df8460dadc2/contracts/src/ImdPicksEscrow.sol#L388 [W]: https://github.com/AgentStewLC/launch-3500-imd-picks-complete/blob/741da4053db911b89b94b902c37c0df8460dadc2/web/worker/src/index.ts#L103 [WC]: https://github.com/AgentStewLC/launch-3500-imd-picks-complete/blob/741da4053db911b89b94b902c37c0df8460dadc2/web/worker/src/chain.ts#L19 [README]: https://github.com/AgentStewLC/launch-3500-imd-picks-complete/blob/741da4053db911b89b94b902c37c0df8460dadc2/README.md#L32 [T]: https://github.com/AgentStewLC/launch-3500-imd-picks-complete/blob/741da4053db911b89b94b902c37c0df8460dadc2/web/tests/revision-v11.test.mjs#L1 [DOC]: https://imd.fun/docs/llms.txt