Repository navigation
docs(readme): the English README names the authoritative API list too - #318
Conversation
`cabe4c6` (#203) changed only the Chinese half of the sentence that says where the API list lives: `README.md` now reads "API 一览见 docs/architecture.md, 权威清单以 `src/routes/mod.rs` 的 `router()` 为准", while `README.en.md` kept its pre-#203 wording ("Full API reference: docs/architecture.md."). That sends the English reader to a document #203 was downgrading to an overview, and the Chinese reader to the code — two answers to one question, from one document whose two halves declare each other as translations on line 3. Fix the value and give the pair an enforcer: - `README.en.md`: say the same thing as the Chinese half — an overview link plus the authoritative source in code (`router()` in `src/routes/mod.rs`). - `src/readme_gate.rs` (test-only, `#[cfg(test)] mod readme_gate`): assert the two carriers hold the same facts. The compared positions are the language-independent ones only — inline code spans, markdown link targets, bare URLs, numeric literals — compared as sets, with the expected value derived from the files on both sides (no snapshot). Prose, headings, table headers, emphasis, line order and line count are deliberately not compared. Positive control: every family must be non-empty on both sides and the four together must yield enough items, so an extractor that returns empty sets cannot pass vacuously. Teeth: a fact dropped on one side is reported for each of the four families. Scope, stated where the gate is: it is lexical — it proves the two sides carry the same structural positions, not that the translation is faithful, and a "delete the Chinese sentence instead" fix would pass it. `cargo test`: 417 passed / 0 failed (baseline 413; +4 new).
|
Self-review (author is also the committer on this repo; Checked, in order:
Scope, restated so it is not over-read: the gate is lexical. It proves the two carriers |
Summary
README.mdandREADME.en.mdare one document in two languages — line 3 of eachdeclares the other as its translation. They had drifted on the sentence that says
where the API list lives.
cabe4c6(#203, docs(architecture): correct the ops method, the transaction typesand the API list scope) changed only the Chinese half:
README.mdnow readswhile
README.en.mdkept its pre-#203 wording (Full API reference: [docs/architecture.md](docs/architecture.md).). So the Chinese reader is sent to thecode and the English reader to a document that #203 was downgrading to an overview —
one question, two answers, from one pair of files that claim to be the same document.
git show --name-only cabe4c6lists noREADME.en.md.This PR fixes the value and gives the pair an enforcer.
Related Issue
None — found while scanning the repository's own documentation for cross-carrier
drift; the divergence is traceable to
cabe4c6and is not filed as an issue.Changes
README.en.mdnow says the same thing as the Chinese half — anoverview link plus the authoritative source in code (
router()insrc/routes/mod.rs).src/readme_gate.rs, a test-only gate (#[cfg(test)] mod readme_gateinmain.rs, so nothing enters the release binary): the two carriers must hold thesame facts.
- Compared positions are the language-independent ones only: inline code
spans, markdown link targets, bare URLs, numeric literals. Each family is
compared as a set; the expected value is derived from the files themselves
on both sides — no snapshot, no hard-coded list.
- Deliberately not compared (they legitimately differ between languages):
prose, headings, table headers, emphasis, line order, line count.
- Positive control: every family must be non-empty on both sides and the four
together must yield enough items, so an extractor that returns empty sets
cannot pass vacuously. Teeth: four synthetic arms, one fact dropped per
family, each reported.
- Scope, stated in the file: the gate is lexical. It proves the two sides
carry the same structural positions; it does not prove the translation is
faithful, and a competing fix that deletes the Chinese sentence would pass it —
that judgement belongs to review, not to a gate.
config/config.example.tomlneedsno update.
Tests
cargo test— 417 passed / 0 failed (baseline 413 one567fae; +4 new tests)cargo fmt --check— rc 0cargo clippy --all-targets -- -D warnings— rc 0src/readme_gate.rs)A/B on the gate, both legs run locally on this branch:
readme_gateresultREADME.en.mdas ofHEAD~1(pre-fix)the_two_readmes_carry_the_same_factsFAILED — exactly 2 divergences, both named:`router()`and`src/routes/mod.rs`仅中文版有; the other 3 gate tests stay greenChecklist
docs/…)docs(readme): …)plus one new test-only module and its registration)