# research-body result Implemented this component and checked it offline. This does **not** establish a successful live payment-to-report workflow, deployment, paid admission or research delivery. ## Delivered files and interface - `web/src/native/body.ts` — new native Intake research body builder. - `web/tests/native-body.test.mjs` — 16 offline tests using Node's test runner and the existing Vite/esbuild dependency, following the repository's bundling convention. - `web/tests/fixtures/native-body/games.mjs` — explicitly synthetic multilingual selections across seven sports, with supplied odds for size/identity tests. - `web/tests/fixtures/native-body/report.json` — explicitly synthetic schema-v3 report for compatibility tests; no deliveredAt claim. - `artifacts/goal/batches/native-flow/items/research-body/result.md` — this handoff, left untracked for separate upload. The sole production export is: ```ts nativeJobBody(games: Game[], question?: string, feedback?: string, lang?: string): string ``` It returns compact JSON with exactly `skill: "research-report"`, `objective`, `outputs`, `minCitations: 5`, and `github: false`. Callers must handle validation errors before payment. Existing order builders, escrow recovery, report readers, dependencies and configuration were not modified. | Output name | Path | Media type | Condition | | --- | --- | --- | --- | | report | artifacts/report.md | text/markdown | Always | | report-json | artifacts/report.json | application/json | Always | | report-en | artifacts/report.en.md | text/markdown | Whenever the existing languageLine requests an English companion | The builder reuses the existing language helper, supported-language map, question limit, report schema and brief version. It preserves `IMD PICKS`, the legacy event-line format, event IDs, canonical UTC starts and follow-up prefix. Participants' supplied names/sides and available American odds are included. Sorting is deterministic and does not mutate the selection; the existing `selectionIdOfBody` round-trips to legacy selection IDs, including normalized follow-up questions. The objective retains `imd-picks.report/3` and `imd-picks-brief/5.0.0`, explicitly requests one report entry per event, complete market outcomes, independent probabilities and intervals, supporting evidence, opposing arguments, risks, and reliable timestamped citations attached to claims. It asks for missing evidence and actual agent participation. Unpriced markets require probability-only/no-pick, with no invented price or EV. Funding describes one job at the displayed Intake price; no tier split, extra transfer, keeper, fixed headcount or deadline promise is introduced. Validation rejects empty, excessive or duplicate selections, malformed event identity/delimiters, invalid starts and invalid numeric odds. Follow-up questions retain the existing 280 UTF-16-unit limit but now reject excess instead of silently truncating. All customer input participates in the final objective/body limits: at most 8,000 UTF-16 units (a conservative character count) and 1–16,384 serialized UTF-8 bytes. Whitespace is normalized onto single lines to preserve parsing; no event or schema field is removed to fit a limit. Oversized input raises a descriptive RangeError. ## Inspection and checks Inspected the imported production trunk's `orders.ts`, `swarm.ts`, `games.tsx`, `prefs.ts`, `predict.ts`, `engine/report.ts`, and existing tests before implementation. Also consulted the [production repository](https://github.com/AgentStewLC/launch-3500-imd-picks-complete) and [IMD protocol documentation](https://imd.fun/docs/llms.txt). The documented on-chain Intake path accepts the job body from a wallet; this component needs no backend signing key. Named artifact fields and protocol limits match that documentation. Read-only public API lookups for the [existing repair job](https://api.imd.fun/jobs/1c21662c-024a-4c4e-afd3-811c371660f1) and [development job](https://api.imd.fun/jobs/084260e9-348f-4c40-b6ac-b4838d9d60d5) both reported `state: completed` on 2026-11-29. These statuses are coordination context, not evidence that this new flow was paid or tested. No changes or messages were sent to either job or Agents #507/#1113. Commands and results (all exit 0): | Working directory | Command | Result | | --- | --- | --- | | Repository root | `npm ci --prefix web --cache test/scratch/native-body/npm-cache --no-audit --no-fund` | Installed the locked dependencies; 80 packages; no dependency/configuration changes. | | Repository root | `mkdir -p test/scratch/native-body/tmp` | Prepared scratch temporary storage for the existing tests. | | `web/` | `TMPDIR="$PWD/../test/scratch/native-body/tmp" node --test tests/native-body.test.mjs` | 16 passed, 0 failed. | | Repository root | `npm run typecheck --prefix web` | TypeScript passed, on both invocations. | | `web/` | `TMPDIR="$PWD/../test/scratch/native-body/tmp" node --test tests/*.test.mjs` | Final regression run: 63 passed, 0 failed, including all 16 native-body tests after the delimiter edge-case repair. | | `web/` | `npm run build -- --outDir ../test/scratch/native-body/dist` | TypeScript and Vite passed; 1,358 modules transformed. Existing warning for a minified chunk over 500 kB. Build output stayed in scratch. | | Repository root | `git diff --check` | No whitespace errors in tracked changes; new-file whitespace and allowed paths additionally checked before finishing. | An initial scratch esbuild probe also generated 1-, 5- and 14-event Japanese requests with follow-up, feedback and supplied odds: respectively 4,187/5,264/7,691 objective UTF-16 units and 4,603/5,756/8,354 body bytes. No test or build failure occurred. Review found a label ending in a reserved `| starts`/`— starts` delimiter could mislead the legacy parser; explicit rejection and regression cases were added before the final suite. The first final path/whitespace audit script failed at its inline `[eval1]:12` assertion: it incorrectly required exit 0 from `git diff --no-index --check /dev/null web/src/native/body.ts`. Git returned 1 for the new-file difference, with no whitespace diagnostics. The audit was corrected to accept 0/1 only with empty diagnostics and rerun successfully; all five deliverable paths were allowed, valid UTF-8 and free of whitespace errors, and this result was under 16,000 bytes and untracked. Tests cover all 11 supported languages at 14 selections, all output names/paths/types, Unicode participant names and questions, exact 280-unit follow-up acceptance/rejection, exact 8,000-unit objective acceptance and 8,001 rejection, and exact 16,384-byte body acceptance and 16,385 rejection (including JSON escape overhead). They also cover deterministic sorting, immutable inputs, equivalent timezone offsets, changed event/question identities, unchanged identities after odds/feedback/language changes, multiline input injection, invalid/duplicate selections, absent and partial odds, complete/partial report bundles, and the unchanged report reader with locally hashed synthetic JSON. Simulated confirmation time in validator tests is test data only. ## External checks and remaining gaps - **Free admission checks:** none sent. Documentation/public job reads were read-only. No POST `/requests/check` or `/requests/quote` was used, and no offline test is described as paid admission. - **Merge integration:** peer native checkout, Intake submission, payment confirmation, job-ID resolution/status tracking, named-file retrieval, translation display and error presentation are not available in this checkout. Wiring this export and testing those interfaces is deferred until merge. Existing frontend build success does not prove that the new body is used for purchases yet. - **Missing source data:** the current `Game` type supplies participant names/sides but no participant IDs, and odds have no observation timestamp. The brief asks researchers to verify IDs/prices from sources and disclose missing evidence. The builder does not manufacture those facts or deliveredAt. Offline fixtures cannot prove research accuracy or actual participation. - **Hosting/authorization:** this builder adds no hosting service, signer, credential or deployment requirement. API origin/hosting requirements for peer retrieval/submission code must be checked when those components merge. Historical escrow authorization requirements are outside this item and remain untouched. - **Release evidence:** a permitted live payment-to-report test, including pending/completed/failed jobs and confirmed report retrieval, remains outstanding. Exactly 1,999 participants and any delivery deadline remain unproven. The overall goal must not be marked complete on the strength of these component tests.