# report-reader result Implemented the bounded report-reader repair. I inspected the existing checkout at `28ff85f`, its native Intake checkout and confirmation reader, and the [production repository](https://github.com/AgentStewLC/launch-3500-imd-picks-complete) before choosing the report mapping. No live payment was made, and the entire live payment-to-report workflow is **not yet proven complete**. ## Defects and changes | Defect | Before | Now | | --- | --- | --- | | `web/src/swarm.ts:202-223` (`legacyFromV3`) | A verified schema-3 report was flattened to one winner, one probability, a pick and the main risks. Both sides' prices and probabilities, other markets, arguments, confidence, sources and agent count disappeared from the game cards. | Every outcome of every market is retained with stated probability, decimal price, sportsbook, observation time, break-even probability, EV, confidence and recommendation where present. Each game receives both kinds of probability, supporting/opposing arguments, risks, confidence, data quality and all sources as `{url,title,accessedAt}`; `title` is the bundle's source kind and `accessedAt` is its fetch time. Participating entries are counted across the bundle and their roles listed. Probability-only remains distinct from no-pick. The original v3 bundle remains available. | | `web/src/swarm.ts:597` (`settle`) | A future no-pick or probability-only event immediately returned `void`, and its card said “Result Void.” | With no selection to settle, it returns `pending`, so the existing view says “Not settled yet.” No ESPN result is asserted for a no-pick. | | `web/src/swarm.ts:190-199` (`attachEvents`) | Any game already carrying `espnId` skipped paid-event metadata, so missing league and start stayed empty. | The paid ESPN id is matched first and fills only missing metadata. Existing report values win. An unmatched id cannot be rescued by a coincidentally similar label; idless reports retain the label fallback. | | `web/src/swarm.ts:851-867` (`fetchNativeReport`) | Every missing verified JSON was called a historical Markdown-only text delivery, even when report.md supplied verified recovered predictions or report.json failed SHA-256. | The issue names the absent, unmatched, length-failed, SHA-failed, or otherwise unverifiable report.json. It says whether verified Markdown yielded predictions, only text, or no text. `complete` remains false without verified structured JSON. | The new `web/tests/fixtures/native-report/three-games.json` has a pick, a no-pick and a probability-only game, with five citations per game. The pick has lower win probability than the most likely outcome, so the test checks both probability fields independently. `web/tests/native-report.test.mjs:65-120,165-194` exercises the real `fetchNativeReport` with only snapshot/artifact downloads simulated, plus settlement, metadata matching, and the Markdown recovery wording. The pre-change focused run failed five new assertions; all twelve pass after the source repair. The historical text-only assertion was extended at `native-report.test.mjs:176`. An older assertion of the agent-count defect exists at `web/tests/native-body.test.mjs:240`; that file is outside this item's allowed paths and was not changed. ## New English customer-facing diagnostics The issue string joins one first sentence with one availability sentence. These are all the new first-sentence forms, including the dynamic error form: - “missing structured output: report.json failed SHA-256 verification.” - “missing structured output: report.json failed length verification.” - “missing structured output: report.json could not be verified ({error}).” (`{error}` is the artifact read error.) - “missing structured output: report.json could not be matched to a declared output in the snapshot.” - “missing structured output: report.json was not listed in the confirmed snapshot.” One of these follows it: - “Predictions were recovered from verified report.md.” - “Only verified report.md text is available.” - “No verified report text is available.” The native view currently renders `issues` as English text without a `t()` call (`web/src/native/view.tsx:191`), and this item cannot edit that view or the translation catalog. A later wave must route these diagnostics through `t()` and supply translations. The new sentences are documented here in full rather than hidden from the translation check. ## Checks run | Command | Exit | Result | | --- | ---: | --- | | `cd web && npm ci` | 0 | Installed 80 packages; no tests. | | `cd web && TMPDIR=../test/scratch/tmp node --test tests/native-report.test.mjs` before source repair | 1 | 12 tests: 7 pass, 5 fail on the four defects above. | | `cd web && TMPDIR=../test/scratch/tmp node --test tests/native-report.test.mjs` after repair | 0 | 12 tests: 12 pass, 0 fail. | | `cd web && npx tsc --noEmit` | 0 | Type check passes; no tests. | | `cd web && TMPDIR=../test/scratch/tmp node --test tests/*.test.mjs` | 1 | 220 tests: 217 pass, 1 fail, 2 todo. The sole failure is the obsolete `agents.count === undefined` assertion at `web/tests/native-body.test.mjs:240`; the reader now correctly reports `1` participating entry for that fixture. | | `cd web && node scripts/i18n-check.mjs` | 1 | Could not create its default `/tmp/i18n-check-*` temporary directory; no strings checked. | | `cd web && TMPDIR=../test/scratch/tmp node scripts/i18n-check.mjs` | 1 | Checked 609 source strings in 9 non-English languages; the four new diagnostic keys at `web/src/swarm.ts:859-863` have no catalog entries, 4 missing per language. Catalog edits are outside scope. | | `cd web && TMPDIR=../test/scratch/tmp npm run build` | 0 | TypeScript and Vite build pass; 1,367 modules transformed. Vite warns about a chunk over 500 kB. Generated `dist/` was removed after the check. | | `git diff --check` | 0 | No whitespace errors; no tests. | ## Outside this item and remaining proof - `web/tests/native-body.test.mjs:240` asserts the old missing-agent-count behavior. It needs an expectation of `1` when that file's owner updates it. - Two existing todo tests in `web/tests/native-merged.test.mjs:235,246` record native reader defects: an admitted job id is lost while `/result` is 404, and confirmed refusal after admission stays pending. Both concern `web/src/native/client.ts`, outside this item. - The new English diagnostics need localization work in the native view and catalogs, outside the allowed paths. - The local native flow uses the customer's wallet for Intake requests (`web/src/native/payment.ts:244,282`) and reads receipts and report bytes without a site signing key. The separate escrow Worker has an optional verifier key for its own settlement writes (`web/worker/src/chain.ts:18-24`); this reader adds no key requirement. Enabling paid research still depends on the owner-controlled build switch and archive URL (`web/src/config.ts:95-100`) and a working hosted backend. No keys, funding, deployment, live Intake payment, live Swarm research or live report retrieval were exercised. These require an authorized live end-to-end check before the overall payment-to-report goal can be marked complete. - Fixture citations establish parser and hash-chain behavior only; they do not verify the factual accuracy of real sports research. The schema has no stable agent identity, so the count is participating entries across event reports, not a deduplicated count of people or models. Changed source paths: `web/src/swarm.ts`, `web/tests/native-report.test.mjs`, `web/tests/fixtures/native-report/three-games.json`. This result is the required separate untracked output.