docs(reports): English edition — design, voice, glossary, changelog, progress, device checklist; golden pair test

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01N4f2nya58RoRu4yEmJgRGE
This commit is contained in:
Jesse_Chen
2026-09-29 19:26:00 +08:00
co-authored by Claude Opus 5.5
parent 419e1f4d37
commit ed3b223b1c
8 changed files with 94 additions and 3 deletions
@@ -189,3 +189,26 @@ test("the export drawer suggests English for AI only when it can switch", async
assert.ok(h.container.text.includes("重新生成即可获得中英两版"));
} finally { await h.close(); }
});
test("the real engine English golden is accepted whole and matches its Chinese pair", () => {
const en = JSON.parse(readFileSync(new URL("./fixtures/report-reader-main-fictional-en.json", import.meta.url), "utf8"));
const zh = JSON.parse(readFileSync(new URL("./fixtures/report-reader-main-fictional-zh-pair.json", import.meta.url), "utf8"));
assert.equal(en.fixtureProvenance.fictional, true);
assert.equal(en.fixtureProvenance.language, "en");
const accepted = acceptEnglishEdition(en.markdown, undefined, engine);
assert.ok(accepted.english, accepted.englishUnavailable);
// Nothing for the projection to cut, so the reader sees the whole edition.
assert.equal(projectOrdinaryReportMarkdown(en.markdown, "en"), en.markdown);
const zhLines = (zh.markdown as string).split("\n");
const enLines = (en.markdown as string).split("\n");
assert.equal(enLines.length, zhLines.length, "line-aligned editions");
const mismatched = zhLines.flatMap((line, index) => (
JSON.stringify(numericTokens(line)) === JSON.stringify(numericTokens(enLines[index])) ? [] : [enLines[index]]
));
// The one known difference is a label, not a value: the English yoga name
// spells out the houses (「婚姻障碍(7宫主在凶宫)」 / "Kalatra Dosha (7th Lord in 6/8/12)").
assert.deepEqual(mismatched.map(line => line.split("|")[1]?.trim()), ["Kalatra Dosha (7th Lord in 6/8/12)"]);
const h2 = (markdown: string) => buildReportExportBlocks({ markdown }).filter(block => block.group === "body").length;
assert.equal(h2(en.markdown), h2(zh.markdown), "same chapters");
assert.equal(containsHan(JSON.stringify(buildReportExportBlocks({ markdown: en.markdown, language: "en" }))), false);
});