Checkout-strings implemented and checked. The translation check exits 0. The full suite retains one pre-existing, out-of-scope failure; this is not certification of the whole payment-to-report workflow. No live payment was made. Changed files: | File | Why | | --- | --- | | `web/src/i18n-ui/checkout.ts` | 92 unique new keys and 9 aligned language rows (828 translations): fr, es, ru, ja, zh, pt, it, th, pcm. Covers the 14 missing checkout labels, checkout state messages, nested payment/body/storage errors, and client status reasons. Keeps placeholders; includes finite concrete helper errors and templates for variable numeric errors. | | `web/src/i18n-ui/index.ts` | Registers the new dictionaries before existing spreads so existing wording retains precedence, including French. | | `web/tests/native-i18n.test.mjs` | 12 offline tests discover 130 messages across checkout.tsx and all 6 native files using TypeScript AST/types. Covers errors, fallbacks, finite helper/terminal values and templates; checks nine-language registration, alignment, nonempty values, unique keys, placeholder multiplicity/interpolation, and English/en-NG behavior. | | `artifacts/goal/batches/native-mend/items/checkout-strings/result.md` | This evidence and limitation record; left untracked for upload. | Inspected merged sources before editing. Existing native.ts/rows, packages, lockfile, configuration and transaction behavior are unchanged. Installed existing locked dependencies only. Intake remains the purchase flow; no backend key requirement was added. Scratch work/builds are excluded from submission. Final checks: typecheck passed; new tests 12/12; full glob 158/159; i18n 605 source strings in 9 languages passed; Vite scratch build passed (1,367 modules). Vite warned about a chunk over 500 kB; the main JS chunk was 1,226.55 kB (437.16 kB gzip). No build configuration was changed. Out-of-scope defects found and left unfixed: 1. **Existing test fixture duplicates an export.** `web/tests/native-ui.test.mjs:27` appends a fixture export of fetchNativeReport to swarm.ts, which already exports it at `web/src/swarm.ts:789`. Reproduce from web with the full test-glob command below (or node --test tests/native-ui.test.mjs with the same TMPDIR). Esbuild reports `src/swarm.ts:789:22: Multiple exports with the same name "fetchNativeReport"`; Node reports `tests/native-ui.test.mjs:1:1`. Installed baseline: 146 pass/1 fail; final: 158 pass/1 fail, the same failure. This item does not repair peer-owned tests. 2. **Status reasons bypass translation.** `web/src/native/view.tsx:187` renders `s.reason` directly. In French, render NativeStatus with a matching pending confirmation and reason `awaiting-index`: the code appears verbatim although `tr("awaiting-index")` now has a French entry. Confirmed with offline SSR. 3. **Numeric validation errors are expanded before lookup.** `web/src/native/body.ts:92` and `:97` interpolate the actual size into the error; `web/src/checkout.tsx:51` stores errText(error) and `:200` translates that final string. `web/src/i18n.ts:108` only looks up exact keys. Reproduce in French by calling nativeJobBody with the first existing `tests/fixtures/native-body/games.mjs` game and feedback `"x".repeat(8000)`, then passing its caught errText to tr: the objective-limit error stays English. The new catalogue covers the parameterized forms and finite field/limit expansions; it cannot match every numeric runtime value without changing those source call sites. The objective case was reproduced offline; the byte-limit case follows the same inspected path. 4. **Report diagnostics bypass translation.** `web/src/native/view.tsx:191` renders report.issues verbatim. For a matching paid/verifying fixture with an incomplete report and issue `completion snapshot is not JSON` (produced at `web/src/swarm.ts:802`), French SSR still prints that English diagnostic. Confirmed offline. These report-reader strings originate outside the specified native source inventory. Scratch SSR forbids fetch: 3 assertions confirm defects 2–4. Its missing document.addEventListener shim was repaired after one startup failure. The new scanner's terminal-predicate mistake (native-i18n.test.mjs:89/99) was repaired. The expected missing-catalogue red run failed at lines 137/141 and 156/159; final tests pass. Unproven: real approval/payment, API admission, job execution, production CORS/hosting, deployed-browser artifact retrieval, report quality and the end-to-end workflow. No fork, deployment, signing or external job coordination was performed. Hosting access and release/paid-run authorization remain external requirements. Coverage concerns finite source messages/templates; arbitrary provider errors, downloaded content and the rendering gaps remain. No independent native-speaker or visual review. Command ledger: cwd root unless marked web; TMPDIR is inside test/scratch. N/A means no test counts. Repeated reads followed output truncation. apply_patch edits succeeded; Python extracted keys and validated/emitted the catalogue. Polls collected each running command's exit status. 1. root; exit 0; N/A. The shell returned 0 overall: pwd=0, rg=2 (test/scratch did not yet exist), git status=0; scratch was then created. ```sh pwd; rg --files -g '!node_modules' -g '!lib' -g '!artifacts' -g '!*lock*' web/src/i18n-ui web/src/native web/tests web/scripts test/scratch; git status --short (issued as separate lines) ``` 2. root; exit 0; N/A. ```sh cat web/src/i18n-ui/native.ts web/src/i18n-ui/index.ts ``` 3. root; exit 0; N/A. ```sh cat web/src/checkout.tsx web/src/native/payment.ts ``` 4. root; exit 0; N/A. ```sh cat web/src/native/body.ts web/src/native/client.ts web/src/native/orders.ts web/src/native/policy.ts web/src/native/view.tsx ``` 5. root; exit 0; N/A. ```sh cat web/scripts/i18n-check.mjs web/package.json web/tsconfig.json web/tests/native-checkout.test.mjs web/tests/native-ui.test.mjs ``` 6. root; exit 0; N/A. ```sh cat docs/IMD_NATIVE_FLOW.md web/src/i18n.ts web/src/i18n-ui/keys.ts ``` 7. root; exit 0; N/A. ```sh cat web/src/i18n-ui/index.ts web/src/checkout.tsx ``` 8. root; exit 0; N/A. ```sh cat web/src/native/payment.ts ``` 9. root; exit 0; N/A. ```sh cat web/src/native/orders.ts web/src/native/policy.ts web/src/native/view.tsx ``` 10. root; exit 0; N/A. ```sh cat web/src/native/client.ts web/src/native/body.ts ``` 11. root; exit 0; N/A. ```sh cat web/scripts/i18n-check.mjs web/package.json web/tsconfig.json ``` 12. root; exit 0; N/A. ```sh rg -n 'export|function|template|replace|dict|FR_UI|UI_DICTS' web/src/i18n.ts cat web/src/native/client.ts ``` 13. root; exit 0; N/A. ```sh sed -n '1,150p' web/tests/native-checkout.test.mjs sed -n '1,100p' web/tests/native-ui.test.mjs ``` 14. root; exit 0; N/A. ```sh sed -n '1,125p' web/src/i18n.ts cat docs/IMD_NATIVE_FLOW.md sed -n '355,395p' web/src/i18n-ui/native.ts ``` 15. root; exit 0; N/A. ```sh mkdir -p test/scratch/checkout-strings/tmp ``` 16. web; exit 1; 0 strings checked; dependency startup failure (missing TypeScript). ```sh TMPDIR="$PWD/../test/scratch/checkout-strings/tmp" node scripts/i18n-check.mjs --list ``` 17. web; exit 1; 30 pass / 9 fail (39 tests); dependencies absent. ```sh TMPDIR="$PWD/../test/scratch/checkout-strings/tmp" node --test tests/*.test.mjs > ../test/scratch/checkout-strings/baseline-tests.log 2>&1 ``` 18. root; exit 0; N/A. ```sh rg -n 'QUESTION_MAX|errText|native|i18n' web/src/prefs.ts web/src/config.ts web/tests/native-ui.test.mjs rg -n 'test\(|fetch\(' web/tests/*.test.mjs ``` 19. web; exit 0; 80 locked packages installed; test counts N/A. ```sh npm ci --no-audit --no-fund --cache "$PWD/../test/scratch/checkout-strings/npm-cache" ``` 20. root; exit 0; N/A. ```sh tail -n 24 test/scratch/checkout-strings/baseline-tests.log ``` 21. web; exit 0; 14 missing keys per language, 126 missing entries; --list intentionally exits 0. ```sh TMPDIR="$PWD/../test/scratch/checkout-strings/tmp" node scripts/i18n-check.mjs --list ``` 22. web; exit 1; 146 pass / 1 fail (147 tests). ```sh TMPDIR="$PWD/../test/scratch/checkout-strings/tmp" node --test tests/*.test.mjs > ../test/scratch/checkout-strings/baseline-installed-tests.log 2>&1 ``` 23. root; exit 0; N/A. ```sh rg -n 'tests |pass |fail |✖|Error \[ERR_MODULE_NOT_FOUND\]' test/scratch/checkout-strings/baseline-tests.log sed -n '175,195p' web/src/config.ts ``` 24. web; exit 1; 0 pass / 1 fail; new scanner bootstrap bug, repaired. ```sh TMPDIR="$PWD/../test/scratch/checkout-strings/tmp" node --test tests/native-i18n.test.mjs > ../test/scratch/checkout-strings/i18n-red.log 2>&1 ``` 25. root; exit 0; N/A. ```sh tail -n 55 test/scratch/checkout-strings/baseline-installed-tests.log ``` 26. root; exit 0; N/A. ```sh sed -n '1,420p' test/scratch/checkout-strings/i18n-red.log rg -n -C 4 'ERROR|Duplicate|already|export' test/scratch/checkout-strings/baseline-installed-tests.log ``` 27. web; exit 1; 2 pass / 10 fail (12 tests); expected red run before translations. ```sh TMPDIR="$PWD/../test/scratch/checkout-strings/tmp" node --test tests/native-i18n.test.mjs > ../test/scratch/checkout-strings/i18n-missing.log 2>&1 ``` 28. root; exit 0; N/A. ```sh sed -n '1,460p' test/scratch/checkout-strings/i18n-missing.log ``` 29. root; exit 0; N/A. ```sh python3 - <<'PY' import ast, json from pathlib import Path log = Path('test/scratch/checkout-strings/i18n-missing.log').read_text() line = next(line for line in log.splitlines() if line.startswith(' actual: [ [')) entries = ast.literal_eval(line.strip()[8:-1]) Path('test/scratch/checkout-strings/missing-keys.json').write_text(json.dumps([key for key, _ in entries], ensure_ascii=False, indent=2) + '\n') for i, (key, at) in enumerate(entries): print(f'{i}: {key}') print(f'{len(entries)} missing keys') PY ``` 30. root; exit 0; 828 translations checked / 0 failures. ```sh python3 - <<'PY' import json, re from pathlib import Path scratch = Path('test/scratch/checkout-strings') keys = json.loads((scratch / 'missing-keys.json').read_text()) langs = ['fr', 'es', 'ru', 'ja', 'zh', 'pt', 'it', 'th', 'pcm'] rows = {lang: (scratch / f'{lang}.txt').read_text().splitlines() for lang in langs} ph = lambda text: sorted(re.findall(r'\{\w+\}', text)) assert len(set(keys)) == len(keys) for lang, row in rows.items(): assert len(row) == len(keys), (lang, len(row), len(keys)) for key, value in zip(keys, row): assert value.strip() and ph(value) == ph(key), (lang, key, value) quote = lambda value: json.dumps(value, ensure_ascii=False) text = '''/** Checkout labels and native helper messages, aligned once per supported language. * Template expressions retain named placeholders; finite helper arguments also have exact entries. * IMD / Intake / Swarm / ESPN and protocol identifiers are unchanged. English uses the source text. */ export const CHECKOUT_KEYS = [ ''' text += ''.join(f' {quote(key)},\n' for key in keys) text += '] as const;\nexport const CHECKOUT_ROWS: Record = {\n' for lang, row in rows.items(): text += f' {quote(lang)}: [\n' + ''.join(f' {quote(value)},\n' for value in row) + ' ],\n' text += '''}; export const CHECKOUT_DICTS: Record> = Object.fromEntries( Object.entries(CHECKOUT_ROWS).map(([lang, row]) => [lang, Object.fromEntries(CHECKOUT_KEYS.map((key, i) => [key, row[i]]))]), ); ''' Path('web/src/i18n-ui/checkout.ts').write_text(text) print(f'{len(keys)} unique keys; {len(rows)} aligned rows; {len(keys) * len(rows)} nonempty translations with matching placeholders') PY ``` 31. web; exit 0; 12 pass / 0 fail; 130 messages across 7 files. ```sh TMPDIR="$PWD/../test/scratch/checkout-strings/tmp" node --test tests/native-i18n.test.mjs ``` 32. web; exit 0; typecheck pass / 0 diagnostics (no test runner counts). ```sh TMPDIR="$PWD/../test/scratch/checkout-strings/tmp" npx --no-install tsc --noEmit ``` 33. web; exit 0; 605 source strings x 9 languages = 5,445 checked entries; 0 failures. ```sh TMPDIR="$PWD/../test/scratch/checkout-strings/tmp" node scripts/i18n-check.mjs ``` 34. web; exit 0; build pass; 1,367 modules; 0 errors, one chunk-size warning. ```sh TMPDIR="$PWD/../test/scratch/checkout-strings/tmp" npx --no-install vite build --outDir ../test/scratch/checkout-strings/dist ``` 35. root; exit 0; N/A. ```sh git diff --check git diff --stat git status --short nl -ba web/tests/native-ui.test.mjs | sed -n '18,32p' rg -n 'fetchNativeReport|reason\}|issue\}|new RangeError' web/src/swarm.ts web/src/native/view.tsx web/src/native/body.ts ``` 36. web; exit 1; 158 pass / 1 fail (159 tests). ```sh TMPDIR="$PWD/../test/scratch/checkout-strings/tmp" node --test tests/*.test.mjs > ../test/scratch/checkout-strings/final-tests.log 2>&1 ``` 37. root; exit 0; N/A. ```sh git diff -- web/src/i18n-ui/index.ts sed -n '1,115p' web/src/i18n-ui/checkout.ts sed -n '100,215p' web/tests/native-i18n.test.mjs ``` 38. root; exit 0; N/A. ```sh rg -n 'unique messages|tests |pass |fail |ERROR|test at' test/scratch/checkout-strings/final-tests.log sed -n '1,60p' web/tests/fixtures/native-body/games.mjs sed -n '102,111p' web/src/i18n.ts sed -n '785,835p' web/src/swarm.ts ``` 39. root; exit 1; 0 reproduction checks completed; scratch DOM shim failed at startup. ```sh TMPDIR="$PWD/test/scratch/checkout-strings/tmp" node test/scratch/checkout-strings/render-gaps.mjs ``` 40. root; exit 0; 3 reproduction checks pass / 0 fail; defects confirmed. ```sh TMPDIR="$PWD/test/scratch/checkout-strings/tmp" node test/scratch/checkout-strings/render-gaps.mjs ``` 41. root; exit 0; scope and whitespace pass / 0 failures. ```sh git diff --check python3 - <<'PY' import subprocess from pathlib import Path allowed = {'web/src/i18n-ui/checkout.ts', 'web/src/i18n-ui/index.ts', 'web/tests/native-i18n.test.mjs'} changed = set(subprocess.check_output(['git', 'diff', '--name-only'], text=True).splitlines()) untracked = set(subprocess.check_output(['git', 'ls-files', '--others', '--exclude-standard'], text=True).splitlines()) extra = {p for p in changed | untracked if p not in allowed and not p.startswith('test/scratch/') and not p.startswith('artifacts/goal/batches/native-mend/items/checkout-strings/')} assert not extra, extra assert subprocess.check_output(['git', 'diff', '--', 'web/src/i18n-ui/native.ts', 'web/package.json', 'web/package-lock.json'], text=True) == '' for name in sorted(allowed): data = Path(name).read_bytes() assert data.endswith(b'\n') and b'\x00' not in data assert all(line.rstrip() == line for line in data.decode().splitlines()) print(f'{name}: {len(data)} bytes') print('Scope and whitespace: PASS; existing native catalogue and package files unchanged.') PY sed -n '47864,47871p' test/scratch/checkout-strings/render-gaps-bundle.mjs ``` 42. root; exit 0; final result size, untracked-output and allowed-path audit pass. ```sh python3 - <<'PY' from pathlib import Path import subprocess p = Path('artifacts/goal/batches/native-mend/items/checkout-strings/result.md') data = p.read_bytes() assert 0 < len(data) <= 16000, len(data) assert b'No live payment was made.' in data assert subprocess.run(['git', 'ls-files', '--error-unmatch', str(p)], stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL).returncode == 1 allowed = {'web/src/i18n-ui/checkout.ts', 'web/src/i18n-ui/index.ts', 'web/tests/native-i18n.test.mjs', str(p)} paths = set(subprocess.check_output(['git', 'diff', '--name-only'], text=True).splitlines()) paths |= set(subprocess.check_output(['git', 'ls-files', '--others', '--exclude-standard'], text=True).splitlines()) assert all(name in allowed or name.startswith('test/scratch/') for name in paths), paths print(f'Result audit: PASS; {len(data)} bytes; output untracked; all changes in scope.') print(subprocess.check_output(['git', 'status', '--short'], text=True)) PY ```