# IMDPicks native IMD.fun flow — root merge 2 of 2 (11 results) Merged from these result files under `.imd/reads/artifacts/`: `b07-body-precheck`, `b08-purchase-to-report`, `b08-failures-and-recovery`, `b09-report-reader`, `b09-report-view`, `b09-tracking`, `b09-status-view`, `b09-payment`, `b09-checkout-ui`, `b09-guide`, `b09-page-meta`. All 11 were present and non-empty. Each claim below is tagged with the result it comes from, e.g. **[b08-purchase]**. Nothing here was re-run by the merger. ## 0. Bottom line - **The payment-to-report workflow has NOT been tested live end to end. No result made a Mainnet payment.** Every result says this. Live Intake admission, Swarm research, artifact delivery and production rendering remain unproven [all]. - **Candidate repository:** https://github.com/identity-md-launches/goal-3534-imdpicks-critical-payment. - The browser and precheck tests ran on commit `40669c610dc527649625874cc0bca769ae6b1b2e` [b07, b08-purchase, b08-failures]. - The repair wave (b09-*) ran on base `28ff85f`. Each item worked in its **own separate checkout**. The repairs have not been merged or integration-tested together [b09-status-view: "Changes by other concurrent items were not present in this checkout and still need a merged integration check"; b09-report-view]. - **Architecture (reuses IMD.fun, no separate payment system):** - The customer's own wallet on Ethereum chain 1 optionally approves IMD, then calls Intake `request` with action `job.open@job-1`. - The site then reads public RPC, the IMD APIs (`api.imd.fun/intake/1/`, `/jobs/`, `/jobs//result`) and IPFS gateways. - The figures: Intake `0xa43e6f75ee006411f79ac1c84120606c2330de82`, IMD token `0xD34a99Bc0f67aE1bbd63C660e6d0b0dd03E263B7` [b07 §6; b08-failures]. - The production baseline `741da4053db911b89b94b902c37c0df8460dadc2` of https://github.com/AgentStewLC/launch-3500-imd-picks-complete still mounts escrow checkout (`web/src/main.tsx#L204`) [b08-failures]. - **Private key:** none is needed for native checkout or the report reader [b08-failures, b09-payment, b09-report-reader, b09-guide]. - `VERIFIER_PRIVATE_KEY` is used only by the legacy escrow Worker, for historical escrow settlement (`web/worker/src/chain.ts:18-24`, which b09-report-reader calls "optional verifier key") [b09-payment, b09-report-reader]. - None of the repairs adds a key requirement [b09-*]. - **Confirmation gates held in every simulated run.** No early paid badge, no early report, and no second wallet send were recorded [b08-purchase, b08-failures]. - **The candidate had one blocking defect: the delivered report did not display fully (D1).** b09-report-reader repaired it in a separate checkout [b08-purchase; b09-report-reader]. No re-run of the browser walk after the repairs was reported. ## 1. Body precheck against live IMD.fun `/requests/check` [b07-body-precheck] **Setup** - Commit `40669c6…`, unmodified. Run at 2026-11-29T07:45:01.051Z on Node v24.22.1. - Games came from the site's own `loadGames()`, run against ESPN's public scoreboard: 181 upcoming games, no failed leagues. - The bodies were built by `nativeJobBody`, then checked with `validateNativeBody`, `selectionIdOfBody` and `liveSlip`. - They were POSTed to `https://api.imd.fun/requests/check` as `{"action":"job.open","input":…}`. The `input` was byte-identical to what `payment.ts` would put on-chain. **Result: all 6 required cases passed.** Each returned HTTP 200, `blockers: []`, `suggestions: []`, and a single planned stage `research-report`. | case | games | objective chars | body bytes | sent bytes | |---|---|---|---|---| | n1-en | 1 | 3487 | 3815 | 3845 | | n1-ja (+question) | 1 | 3989 | 4488 | 4518 | | n5-en | 5 | 4518 | 4914 | 4944 | | n5-ja | 5 | 5020 | 5587 | 5617 | | n14-en | 14 | 6520 | 7055 | 7085 | | n14-ja | 14 | 7022 | 7728 | 7758 | - **Body fields.** Every body carried `skill:"research-report"`, `minCitations:5` and `github:false`. Outputs were `report` → `artifacts/report.md` and `report-json` → `artifacts/report.json`. The Japanese bodies also had `report-en` → `artifacts/report.en.md`. - **Stress case.** 14 games, `ja`, and a 280-character question gave objective 7114 chars, body 8308 B, HTTP 200, no blockers. A 281-character question is rejected locally. Headroom is about 886 chars under the 8,000-char cap and about 8 KB under the 16,384-byte cap. - **Negative controls (what the check enforces).** - Bad output path → 400. - Duplicate output name → 200 with blocker `invalid_artifacts`. - `minCitations` as a string → 400. - Objective over 8000 → 400. - No skill → 200 with blocker `missing_plan`. - `github:true` → 200, no blocker. An unknown field → 200, no blocker. **So a 200 does not show that `github:false` is honoured.** - **Observations (not site defects).** - The facts judge is inconsistent: `report_format` came back `unknown` for n1-en but `stated` for n5-en with the same wording. `report_period` was `unknown` everywhere. - Feedback history is included whole and is never truncated (`body.ts` lines 55, 63, 91–98). A long history could make a 14-game slip unbuyable, with a clear error. This was not exercised. - **Not proven by this test:** - paid admission (no approve, request or transaction; no price read; no job id); - a job run or its outputs; - the browser byte path, CORS or the wallet; - other leagues or languages; - stability over time. ## 2. Purchase-to-report browser walk [b08-purchase-to-report] **Setup** - Headless Chromium 159.0.8154.6 via Playwright, real clock, English, 1280×900. - `tsc` and both Vite builds passed: `VITE_PAID_RESEARCH_OPEN=true` (on) and unset (off). - **Everything remote was simulated.** Fixture price 0.5 IMD. The quoted gas of 0.0005295 ETH is a fixture figure, not a real one. **Result: 29 rows pass, 7 fail, 1 not run (37 rows).** The scenario does **not** pass end to end. **What passed** - Pending, not paid, at each of these points: no receipt (`read-unavailable`); 1 and 2 of 3 blocks deep, even while the API already said paid; Intake entry 404; and an entry with a mismatched amount. - The paid badge appears only once the entry matches. The page then polls to `#/job/?tx=` after about 34 s without a click. - No report is shown until completion is confirmed 3 blocks deep and the bytes verify. Altered report.json bytes are withheld. - "Report ready" appears on true bytes. - Reload, the dashboard, and a second browser holding only the job URL with `?tx=` all recover the report without a wallet. - Paying again for the same selection reopens the order with no new transaction. - With the switch off, there is no way to pay and no quote. **What failed** | Step | What happened | Defect | |---|---|---| | 2b | Sport tile NHL lands on "All" | D8 | | 13c | Paid badge vanished while completion confirmed | D5 | | 16 | Cards missing probabilities, arguments, risk and 5 source links | D1 | | 16d | Page says agents not stated, although they are | D4 | | 16e | Future games shown as "Result Void" | D3 | | 18b | Dashboard shows "0 Total IMD spent" | D7 | | 20 | Browser Back trapped on the job page | D6 | **Defects at `40669c6` (paths under `web/`)** - **D1, blocking.** `swarm.ts:200-208` (`legacyFromV3`) drops markets, supporting, opposing, confidence, winnerProbability and sources. A scratch patch proved the cause; it was not submitted. - **D2, high.** Citations in arguments render as raw Markdown (`pages.tsx:427-428`), and `risks` are not rendered. - **D3.** `swarm.ts:582` returns `void` for no-pick. - **D4.** `swarm.ts:200` sets `agents.count: undefined`. - **D5.** `client.ts:203` throws before `jobId` is set at line 232, and `view.tsx:163` treats an absent job id as a different one. - **D6.** `view.tsx:149` assigns `location.hash`. - **D7.** `pages.tsx:926` sums only legacy and escrow orders. - **D8.** `main.tsx:97`: every sport tile links to `#/sports`. - **D9.** `index.html:7,15,21` carries the old 1/1.5/2 IMD tiers and "paused". `index.html:10` sets the canonical address to `imd-picks-you-select-the-ga-e617.imd.site`, not imdpicks.com. - **D10.** `view.tsx:187` shows raw reason codes. `read-unavailable` was the normal message for an unmined transaction (`client.ts:275`). **Console and live reads** - The only console error was the expected 404 at step 9. - One live read: `GET https://api.imd.fun/jobs/084260e9-348f-4c40-b6ac-b4838d9d60d5` and its `/result` both returned 200, in the shapes the client expects. That job is a site-content-check with `"files":[]`. - No live intake entry, admission or paid completion was compared, and `/result` was not observed for a running job. ## 3. Failure and recovery browser walk [b08-failures-and-recovery] **Setup:** Playwright 1.65.1 and Chromium 159.0.8154.6, fixture price 1 IMD. **Result: 15 rows, 11 pass, 4 fail.** **Passed** - Rejecting the approval. - A reverted Intake transaction gives `request-reverted`, with no Pay button. - A refused entry gives `request-refused`. - An entry that failed after payment shows paid plus `request-failed`. - A job that fails after admission gives `job-failed`, keeping the original transaction. - A 429 response honours `Retry-After: 45`. - Two 500 responses give `api-unavailable` with "do not pay again". - Automatic recovery to the admitted job. - Wrong report.json SHA-256 gives a verified partial report and no predictions. - `#/job/` without a transaction asks for the Intake hash and makes no API call. - An unknown transaction gives `read-unavailable`. **Failed** 1. Approve, then reject the Intake request: the stale approval copy stayed (`checkout.tsx:63`). 2. Reopening checkout while research was running: an enabled Pay sat beside "Open request". The click was protected by `earlierOrder` and made no duplicate send (`checkout.tsx:77`). 3. A completion snapshot naming a different job still showed "Verified: the report's bytes match…" (`swarm.ts:798`, `view.tsx:193`, `pages.tsx:290`). 4. A failed Intake entry with a still-running job showed as ordinary pending, `job-completion-disagreement` (`client.ts:219`). **Also found:** defect 5. A corrupt modern JSON got the "historical Markdown-only" hint (`swarm.ts:836`). **No row showed "Report ready".** A verified full report and a live run were not part of this item. ## 4. Repair wave (base `28ff85f`, separate checkouts, offline only) | Item | Files changed | Repairs | Own tests | |---|---|---|---| | **b09-report-reader** | `web/src/swarm.ts`, `tests/native-report.test.mjs`, `fixtures/native-report/three-games.json` | **D1:** keeps every market outcome, both probabilities, arguments, risks, confidence, data quality, sources `{url,title,accessedAt}` and the participating-entry count (fixes D4). **`settle` (`swarm.ts:597`):** no-pick → `pending` (fixes D3). **`attachEvents`:** ESPN id metadata fill. **`fetchNativeReport`:** specific report.json diagnostics (fixes failures #5). `complete` stays false without verified JSON. | 12/12 (5 failed before the fix) | | **b09-report-view** | `web/src/pages.tsx`, `tests/native-cards.test.mjs`, `fixtures/native-cards/games.mjs` | Compare shown whenever an estimate exists. Arguments and risks rendered through the Markdown component (fixes D2). League span omitted when missing. No result row for no-pick (D3, card side). Recovered-predictions verify note. Dashboard relabelled "IMD spent on earlier orders, confirmed" (D7, by relabelling). Language read from `objectiveOf`. | 10/10 (9 failed before the fix) | | **b09-tracking** | `web/src/native/client.ts`, `tests/native-client.test.mjs`, `fixtures/native-client/unrelated-revert.json` | Job id kept once the order is paid and admitted (D5, reader side; fixes the todo at `native-merged.test.mjs:235`). Confirmed refusal after admission → `refused` (todo `:246`). An unrelated revert → `not-an-intake-request`; real mainnet tx `0x4a94111a…039c` used. A request via another contract → `unsupported-transaction`. No receipt → `awaiting-receipt` (fixes D10's `read-unavailable` misuse). | 79/79 (11 failed before the fix) | | **b09-status-view** | `web/src/native/view.tsx`, `tests/native-view.test.mjs`, `fixtures/native-view/*` | Absent job id accepted, a different one still rejected (D5, view side). `location.replace` (D6). Plain-English text for 45 reason codes plus a fallback, with the code in small print (D10). Disagreements labelled "IMD records disagree" (failures #4). Issues passed through `t()`. ReportView mounted only with verified content (failures #3). | 72/72 (65 failed before the fix) | | **b09-checkout-ui** | `web/src/checkout.tsx`, `web/src/native/body.ts`, two tests | Pay disabled while an unresolved same-selection order exists (failures #2). Quote reloaded in `pay()`'s `finally` (failures #1). New `NativeBodyLimitError`, so limit errors are translated. | 6 new UI tests plus 1 body test | | **b09-payment** | `web/src/native/payment.ts`, `tests/native-checkout.test.mjs` | Gas preflight fixed. It previously quoted 314,800 units while a fork run used 327,414, so it was 12,614 short for 14 games (shortfall also stated in b09-guide). Now: estimated gas, fallbacks of 55,000 for approve and 30,000 + 40 per body byte for request, +20%, `maxFeePerGas`. A hashless failed write is recovered using pending-nonce evidence. | 22/22 (5 failed before the fix) | | **b09-page-meta** | `web/index.html` lines 7, 10, 13, 15, 21; `tests/page-meta.test.mjs` | Descriptions now state the Intake quote plus gas and drop the tiers and "paused". Canonical and og:url set to `https://imdpicks.com/` (D9). | 8/8 (8 failed before the fix) | | **b09-guide** | `README.md`, `docs/IMD_NATIVE_FLOW.md` | Stale "146 of 147" replaced with 214/216 (2 todo); this figure came from the brief and was not re-run. The price is now described as the live Intake quote, with the tiers kept for history only. Verification records added (live vs simulated). States that no signing key is needed and that 1,999 agents per order "is not an option IMD.fun documents". States that merging, publishing and the www 525 error are the owner's. | Link check, exit 0 | **New customer-visible English strings, needing translation in a later wave** - b09-report-reader: 8 diagnostic sentence forms. Its i18n check found 4 keys missing per language. - b09-report-view: 3 strings, 27 missing entries in total. - b09-status-view: 47 strings. - b09-tracking: 3 reason codes. - b09-checkout-ui, b09-payment and b09-guide: none. b09-page-meta: 3 sentences in static HTML only. ## 5. Where the results disagree or overlap - **Full-suite counts differ** because each item ran in its own checkout. The baseline was 216 tests, 214 pass, 2 todo [b09-checkout-ui, b09-status-view]. After each item's own change: | Item | Tests | Pass | Fail | Todo | Note | |---|---|---|---|---|---| | b09-checkout-ui | 223 | 221 | 0 | 2 | | | b09-page-meta | 224 | 222 | 0 | 2 | | | b09-report-view | 226 | 224 | 0 | 2 | | | b09-report-reader | 220 | 217 | 1 | 2 | obsolete assertion `native-body.test.mjs:240` | | b09-tracking | 237 | 226 | 9 | 2 | missing i18n entries | | b09-status-view | 288 | 273 | 13 | 2 | 1 obsolete assertion `native-ui.test.mjs:137`, 10 i18n failures, 2 language-leak cascades from `native-ui.test.mjs:271` | | b09-payment | 221 | 193 | 26 | 2 | strict RPC hook `native-merged.test.mjs:83`; the fixture `fixtures/native-merged/edges.mjs:90-113` lacks `eth_maxPriorityFeePerGas` and `eth_estimateGas` | | b09-payment (scratch fixture copy) | 221 | 219 | 0 | 2 | | **No merged suite result exists.** - **i18n-check counts:** - 605 strings, PASS [checkout-ui, tracking, status-view, page-meta, payment]. - 607 strings, 3 keys missing [report-view]. - 609 strings, 4 keys missing [report-reader]. - b09-status-view notes the script scans only top-level `src` files (`scripts/i18n-check.mjs:23`), so its PASS does not cover nested native strings. - **D3 (no-pick shown as "Result Void") was fixed twice, differently.** b09-report-reader changes `settle` to return `pending`. b09-report-view removes the result row for no-pick and keeps `settle` unchanged; it cites `swarm.ts:582` as still returning void in its checkout. These are compatible, but the merged behaviour is untested. - **D7 (dashboard total) was relabelled, not recomputed.** b08-purchase asked for native payments to be included or the label changed. b09-report-view chose the relabel, so native spend is still not totalled. - **D5 (paid badge lost) was fixed on both sides.** b09-tracking fixes it in the reader and b09-status-view in the view. They are complementary; neither saw the other's change. - **Tracking test numbering.** b09-report-view and b09-page-meta cite the todo defects at `client.ts:226-232` and `:212`, both fixed by b09-tracking. b08-purchase cites the same area as `client.ts:203/232/275` at commit `40669c6`. - **Walk figures in b09-guide** ("29/37 and 11/15 walk steps passed") are consistent with b08-purchase (29 pass, 7 fail, 1 not run) and b08-failures (11 pass, 4 fail). - **Pay-blocking rule is duplicated.** b09-checkout-ui copies `reconcile()`'s retry rule from `payment.ts`. b09-payment changed `reconcile` for hashless entries. b09-checkout-ui warns that `checkout.tsx` must follow any `reconcile()` change, so these two need reconciling at merge. ## 6. Still open (not repaired by any result) - **D8:** the sport tiles preselect no sport (`main.tsx:97`) [b08-purchase]. - **Obsolete assertions** need updating by the test files' owners: `native-body.test.mjs:240` [b09-report-reader] and `native-ui.test.mjs:137` [b09-status-view]. The `native-merged` RPC fixture also needs two RPC responses [b09-payment]. - **Translations** for all new strings [report-reader, report-view, status-view, tracking]. - **Unaddressed areas:** - the social image URLs at `index.html:16,22` still use the old host [b09-page-meta]; - npm reports 2 dependency vulnerabilities (1 moderate, 1 high), not investigated [b09-payment, b09-page-meta, b09-report-view, b09-status-view]; - the >500 kB chunk warning. - **"1,999 agents" cannot be verified.** It is not a documented IMD.fun option [b09-guide]. The agent count is participating entries, not unique agents [b09-report-reader]. - **`complete` is false** whenever report.json is not verified, by design [b09-guide, b09-report-reader]. ## 7. External requirements for the owner - **Merge and integrate.** Merge the repair items and run one integrated test after the merge [b09-report-view, b09-status-view]. - **Deploy.** Identify and authorize the static deployment or test origin, set `VITE_PAID_RESEARCH_OPEN` and the archive URL (`web/src/config.ts:95-100`), and handle publishing and the www 525 error [b08-failures, b09-report-reader, b09-guide, b09-payment]. - **Fund an acceptance run.** Provide a wallet funded with IMD and ETH and authorize the payer and spend for a controlled live paid run [b08-failures, b09-payment]. - **Things a live run must establish:** - the live Intake price and admission of the body; - indexer, admission and writer response shapes; - real wallets; - CORS, rate limits and gateways; - reorgs; - Swarm delivery, citation quality and agent staffing [b08-purchase, b08-failures]. - **Explorer jobs were not inspected.** The two Explorer job pages and the production site could not be reached through b09-payment's browser tool. No result inspected job `1c21662c-…` or coordinated with Agents #507 and #1113 beyond reading the production repository [b09-payment]. This was not found in any result.