# report-view result Implemented the assigned report-card repairs and checked them offline. This item is locally verified; the full production payment-to-report workflow is **not** certified complete. No live payment was made. ## Defects and repairs Line references below name the final `web/src/pages.tsx`. | Defect | File and line | Before | Now | | --- | --- | --- | --- | | Probabilities disappeared without a pick | `web/src/pages.tsx:416` | Compare was gated on a pick, hiding available Swarm/bookmaker probabilities for no-pick and probability-only games. | Compare appears whenever either estimate exists, including zero. Missing estimates remain n/a. Existing market tables preserve each outcome's probability; fixtures verify Home 62% and Away 38%, alongside Swarm 62% and bookmaker 55%. | | Raw Markdown arguments | `web/src/pages.tsx:428`, `:429` | Supporting and opposing strings appeared literally, including `[stats](https://...)`. | Each uses the existing public Markdown component, which invokes markdown.tsx's private inline renderer. HTTP(S) citations become anchors with the shared renderer's safety behavior. No shared renderer file or export changed. | | Missing risks | `web/src/pages.tsx:431` | ReportGame.risks never appeared on the card. | Risks appear in a labelled list using the same Markdown rendering, including citation anchors. | | Empty league element | `web/src/pages.tsx:414` | Missing league produced an empty span. | The league span is omitted when no league is supplied. | | Misleading no-pick settlement | `web/src/pages.tsx:425` | No-pick cards initially said checking and could later display Void because settle returns void for no pick. | No result row is rendered for no-pick/insufficient-evidence/no-pick-object games. Actual pick settlement behavior is preserved. | | Incorrect verification explanation for recovered predictions | `web/src/pages.tsx:294` | Verified manifest plus embedded predictions used wording implying a separately hashed predictions file. | The note explicitly identifies recovery from verified report.md and says no separate predictions file was delivered. Existing hash-warning checks and jsonOk gating remain. | | Spending subtotal described as a total | `web/src/pages.tsx:941` | Escrow/legacy-only spending appeared as “Total IMD spent here, confirmed” beside native orders. | The label explicitly limits the number to earlier orders. Accounting and confirmation rules are unchanged. | | Job-envelope language parsing | `web/src/pages.tsx:305` | Language matching searched serialized JSON, including unrelated fields, rather than the actual objective. | Uses existing objectiveOf to read native JSON objectives, retaining legacy plain-text support and English fallback. Tests cover native ja, pt, en-NG and en bodies, unrelated JSON metadata and malformed/non-object bodies. | ## Files changed - `web/src/pages.tsx` - `web/tests/native-cards.test.mjs` (new) - `web/tests/fixtures/native-cards/games.mjs` (new synthetic offline data) - `artifacts/goal/batches/native-repair/items/report-view/result.md` (this required output, untracked) No existing test assertion was changed. New assertions require corrected behavior; no baseline defect was preserved as an expected result. During development, the new card extraction helper was corrected to retain nested list contents, and the new language fixture changed from unsupported pt-BR to supported pt (plus en-NG). All exported names/types are preserved. No dependency, package/build configuration, translation catalogue, contract, transfer, signing-key requirement or payment-confirmation mechanism changed. Inspected the checkout's existing report, native body/client and test architecture before implementation; reused its components. No external service was written to, and no messages were sent to other workers. ## Checks and command results Validation ran from `web/` unless a repository-root command is explicitly shown. Scratch outputs are under the expressly permitted, ignored `test/scratch/` and are not delivered. | Command | Exit | Result | | --- | --- | --- | | `npm ci --cache /tmp/imd-report-npm-cache` | 0 | 80 packages installed; 81 audited. npm reported 2 dependency vulnerabilities (1 moderate, 1 high). No dependency changes made. | | Root: `TMPDIR="$PWD/test/scratch" node --test --test-reporter=tap web/tests/native-cards.test.mjs` before source repair | 1 | 10 tests: 1 pass, 9 fail, 0 TODO. Reproduced the assigned defects. Output captured in scratch. The earlier default-reporter invocation had the same counts; its wrapper returned 0 because it ended with tail, so the TAP rerun explicitly propagated the test exit code. | | Same focused command, first source-repair run | 1 | 10 tests: 9 pass, 1 fail at `web/tests/native-cards.test.mjs:68`: fixture incorrectly requested unsupported pt-BR and expected it back. Corrected the fixture to the supported language codes rather than changing production language policy. | | Same focused command, final | 0 | 10 tests: 10 pass, 0 fail, 0 TODO. | | `npx tsc --noEmit` | 0 | TypeScript compilation passed; no diagnostics. No test count. | | `TMPDIR="$PWD/../test/scratch" node --test --test-reporter=tap tests/*.test.mjs` | 0 | 226 tests: 224 pass, 0 fail, 2 TODO, 0 skipped. Both TODOs are existing native/client defects detailed below. | | `node scripts/i18n-check.mjs` | 1 | Runtime could not create `/tmp/i18n-check-XXXXXX`; ENOENT at `web/scripts/i18n-check.mjs:45`. Retried using the required scratch TMPDIR. No strings checked on this attempt. | | `TMPDIR="$PWD/../test/scratch" node scripts/i18n-check.mjs` | 1 | 607 translatable source strings checked across 9 non-English languages. Exactly the 3 new keys below are missing in each of fr, es, ru, ja, zh, pt, it, th, pcm (27 missing entries). Diagnostics name `pages.tsx:294`, `:431`, `:941`. Translation is explicitly assigned to a later wave; i18n-ui was left untouched. | | Root: `git diff --check` | 0 | No whitespace errors. No test count. | | Root: `git status --short` and `git diff -- web/src/pages.tsx` | 0 | Source changes confined to assigned paths; reviewed the complete source diff. Output report subsequently created at its assigned path. | Read-only inspection used git status/diff, sed, rg, nl and package/source/test reads. An initial dependency-presence probe (`ls web/node_modules/esbuild`) returned 2 because node_modules was not yet installed; npm ci resolved it. No production build output was generated. The new tests render the real ReportView to static markup through esbuild with React's browser SSR entry. Network access is rejected by the test harness. Four fixture verdicts (pick, no-pick, probability-only, insufficient-evidence) each assert both comparison estimates, both market outcome probabilities, winnerProbability, confidence, argument and risk anchors, exactly five source anchors, and no Void. No-pick fixtures additionally assert no Result row and no empty league span. Other tests cover missing/zero estimates, verified-manifest recovery wording, retained hash warnings, language parsing, and the earlier-orders label. SSR does not execute effects; the result-row absence assertion guarantees no later settlement value can occupy that row for these no-pick fixtures. ## New customer-visible English text All new keys use existing t() calls (the verification note is passed through ReportView's existing t(verifyNote(f))). Exact new copy: - “Verified: the delivery manifest matches the hash the Swarm wrote on Ethereum, and the predictions were recovered from the verified report.md. No separate predictions file was delivered.” - “Risks” - “IMD spent on earlier orders, confirmed” Report-provided arguments and risks are displayed as delivered, not translated or invented by the application. ## Defects seen outside assigned files The full suite reports two existing TODOs, which do not make its exit code fail: 1. `web/src/native/client.ts:226-232`: readNative assigns snapshot.jobId only after both the job and result requests succeed. A result endpoint still returning 404 loses the admitted job ID, preventing the view from saving it. 2. `web/src/native/client.ts:212`: the admission-refusal-disagreement check rejects an already-admitted job even when confirmed Completed status 1 establishes refusal. Those paths belong to other items and were not changed. `web/src/swarm.ts:582` returns void when no pick exists; this item repairs its misleading card presentation without changing shared settlement semantics. Report-reader flattening of verified report.json fields is assigned to another item: these tests start with existing ReportGame fields and do not claim to verify that reader repair. ## What stays unproven / external requirements - No live wallet transaction, Intake payment, production admission, Swarm execution or automatic production delivery was attempted. The full end-to-end goal remains unproven pending an authorized integrated payment-to-report test after all wave items merge. - The offline suite's simulated confirmations are not evidence of production payment or completed research. The card changes do not relax hash/payment/completion confirmation checks. - Visual layout in a live browser and post-mount settlement network effects were not exercised by the new static-markup tests. - The 27 translation entries remain for the later translation wave, as requested. - This item introduces no hosting, backend authorization or private-signing-key requirement. It does not establish whether any unrelated existing backend operation needs a key. Existing deployed IMD/Intake endpoints, report hosting availability and wallet authorization still need validation in the integrated production workflow; this bounded UI repair requires no new secrets.