# native-mend / guide: result **No live payment was made.** I signed, sent and published nothing, and used no key. ## Files changed | File | Why | | --- | --- | | `docs/IMD_NATIVE_FLOW.md` | Rewritten to match the merged source and the facts established on 2026-11-29. Changes: (1) The customer flow now describes what `body.ts`, `payment.ts`, `client.ts`, `view.tsx` and `fetchNativeReport` actually do. The old step 1 told users to "review the body with IMD's free validation endpoints", which the page cannot do. (2) A new **Observed facts (2026-11-29)** table covers facts A–F from the brief. Each row gives the observation, its limit and what the site does about it. (3) A new **Owner's acceptance run** section: build with `VITE_PAID_RESEARCH_OPEN=true`, publish, buy one report with a wallet holding IMD and ETH, and record the transaction hash, request ID, job ID, each state seen and the rendered report, in a table that is still empty. It states that until this is recorded the workflow is not fully tested and the switch stays off. (4) The verification table and closing line now point to that run. (5) A note that the native checkout needs only `VITE_PAID_RESEARCH_OPEN`, while the escrow switch also needs `VITE_IMD_ARCHIVE_URL` (`web/src/config.ts:100` vs `web/src/native/policy.ts:2`). | | `README.md` | The status paragraph at the top is replaced with a dated status (merged, typechecks and builds, 146/147 offline tests pass, not fully tested, no payment made, switch off until the acceptance run is recorded). Five observed-fact bullets (A–F, shortened) link to the guide's anchors for their limits. The rest of the README is unchanged. | I did not change package files, the lockfile, build configuration or source code, and I added no dependency. ## How I checked it The merged source I read first: `web/src/native/{body,client,orders,payment,policy}.ts`, `view.tsx`, `checkout.tsx` (lines 40–225), `swarm.ts` `fetchNativeReport` (line 789), and `config.ts`. Every behaviour the guide describes comes from that code, for example: 3 confirmations, matching `Requested` and `Transfer` logs, `admission.result.jobId`, the separate refused, failed and blocked phases, Keccak-256 of the snapshot, then SHA-256 and length per artifact. Read-only re-observation of the brief's facts on 2026-11-29 (curl, no wallet, no payment): - `GET /jobs/3be0bfc6-…`, `/jobs/3be0bfc6-…/result` and `/artifacts/c46e9a75…` with `Origin: https://imdpicks.com` all returned 200 with `access-control-allow-origin: *` (fact B). I did not re-probe `/intake/1/`; the guide relies on the brief for that one. - `OPTIONS /requests/check` → 404. `POST /requests/check` with the imdpicks.com Origin → 403 (fact A). My server-side POST used a guessed body shape and got 400 `invalid_request`, so the 200-from-server part comes from the brief, not from my check. - The job has one node (`research_report`, state `accepted`), and the result's `files` has exactly one entry, `artifacts/report.md`, 44,037 bytes (facts D, E). The panel limit of 9 comes from the brief; I did not re-read IMD's docs for it. - `https://www.imdpicks.com` → 525 and `https://imdpicks.com` → 200. The served `index.html` names `assets/index-rp56MwCp.js` and `assets/index-DFFF40-6.css`, the same as `dist/index.html` at production commit `741da4053db9…` (fact F). ## Commands and results Run from `web/` with `TMPDIR` set to `test/scratch/tmp`. I ran each one before and after the doc edits, with identical results (no source was changed). | Command | Exit | Result | | --- | --- | --- | | `npm ci` | 0 | installed | | `npx tsc --noEmit` | 0 | clean | | `node --test tests/*.test.mjs` | 1 | **147 tests, 146 pass, 1 fail** (`tests/native-ui.test.mjs`) | | `node scripts/i18n-check.mjs` | 1 | 605 strings checked; **FAIL in all 9 languages (fr, es, ru, ja, zh, pt, it, th, pcm), 14 missing each** | | `npx vite build --outDir ../test/scratch/dist2 --emptyOutDir` | 0 | built (only the existing chunk-size warning) | | `node test/scratch/links.mjs docs/IMD_NATIVE_FLOW.md README.md` (from root; checks files and `#anchor` headings) | 0 | **24 relative links, 0 broken** | ## Defects outside my scope (left unfixed) 1. **`web/tests/native-ui.test.mjs:27`: test harness duplicates an export.** The esbuild `onLoad` plugin appends `export { fetchNativeReport } from "tests/fixtures/native-ui/report.ts"` to `src/swarm.ts`. Since the last wave, `swarm.ts:789` exports a real `fetchNativeReport`, so esbuild stops with `src/swarm.ts:789:22: ERROR: Multiple exports with the same name "fetchNativeReport"`, and the whole file fails at `native-ui.test.mjs:1:1`. Reproduce: `cd web && TMPDIR=$PWD/../test/scratch node --test tests/native-ui.test.mjs`. Likely fix: drop the append, or strip the real export before appending the fixture. Line 326 ("swarm.ts", "fetchNativeReport") should then check the real export. 2. **`web/src/checkout.tsx` lines 180–221: 14 strings untranslated in 9 languages.** They are "Research checkout", "Swarm research fee", "Unavailable", "Earlier requests from this wallet", "Open request {x}", "An earlier order exists for this selection.", "Open earlier order", "New research purchases are paused.", "Select 1 to 14 events that are still open for research.", "Your wallet has insufficient IMD.", "Your wallet has insufficient ETH for estimated gas.", "Your wallet will first ask you to approve the quoted IMD amount.", "Checking Ethereum and waiting for your wallet…" and "Pay {p} IMD and start research". Reproduce: `cd web && node scripts/i18n-check.mjs --list`. They likely belong in `web/src/i18n-ui/native.ts`. 3. **Declared outputs vs. observed delivery (risk, not proven a bug).** `web/src/native/body.ts:71-73` declares `report.md` and `report.json`, and `fetchNativeReport` treats a missing `report-json` as incomplete. The only past sports order delivered only `report.md` (fact E). If IMD does this again, a paid order renders as readable but incomplete. Only the acceptance run can show it. 4. **`README.md:5` (my file, not changed):** the pitch line still quotes the escrow tiers (1 / 1.5 / 2 IMD). The native checkout charges the live Intake `priceOf` quote. I left it as it was because the brief limited README changes to the status lines. A later item should reword it. ## What remains unproven - The whole payment-to-report workflow: no payment, admission, Swarm run or rendered native report has been observed through this site. The owner's acceptance run table in the guide is empty, and the switch must stay off. - That IMD admits the bodies `nativeJobBody` builds (the free check is unavailable from the page and was not run from a server for the current body), and that it delivers `report.json`. - CORS from a real browser on the published origin, including any artifact host other than `api.imd.fun`. - Who controls publication to imdpicks.com, and the fix for the `www` 525. Both are the owner's decision.