Issue on Translate page: Hawaii is a state. (#128)#129
Conversation
Adding .gitkeep for PR creation (default mode). This file will be removed when the task is complete. Issue: #128
…tation (#128) - R2: drop Report Notes / Reproduction Steps from page issue reports - R3: default Translate link target to Wikipedia so English phrases get en.wikipedia links like Russian does - R4: render a merged entity definition per phrase enumerating every sense matched across Wikidata / Wikipedia / Wiktionary - R5: report selected contexts (priority, exact probability, shared-word count) in both formalization and translation links notation - Add issue-128 reproduction test and align issue-29 / issue-37 tests
Issue #128 (R6) asks the quality gate to run on the top-viewed articles and, when merged to main, refresh an API request/response cache so the next run — in the test suite or the web app — replays offline and is faster. The cache must live "in data folder and in .lino format, as we usually do". - Consolidate the recorded Wikimedia JSON snapshots into a single deterministic js/data/wikimedia-cache.lino (sorted by URL, no wall-clock timestamp) so a git-diff freshness check is meaningful. - formalize-snapshots.js: serialize/parse/load/write the .lino cache and load .lino caches alongside the per-URL JSON snapshots; factor the browser-safe decoder into lino.js (parseLinoCacheEntries) so it is shared without duplication. - scripts/refresh-wikimedia-cache.mjs (+ cache:refresh / cache:check npm scripts, wired into npm run check) regenerates the cache offline and fails CI when it drifts from the recorded snapshots. - web/persistent-cache.js seeds the in-memory Wikimedia cache from the deployed .lino on first load so the web app replays offline too. - issue-128-cache.test.js pins lossless round-trip, deterministic ordering, committed-cache freshness, and an offline replay of "Hawaii is a state." from the .lino cache alone. Also drop a stray root .gitkeep and regenerate docs/FORMALIZE.md.
Compile the issue data and a deep analysis under docs/case-studies/issue-128/: requirements, reconstructed timeline, per-problem root causes backed by the captured debug log, solution plans, and the online/library research behind the fix.
Working session summaryAll requirements are complete and PR #129 is finalized. Done — PR #129 is ready for review#129 — title What shipped (all on branch
|
| Req | Resolution |
|---|---|
| R1 version | web/translate-ui.js now reads the deployed app-version.json (loadAppVersionInfo/formatAppVersion) instead of printing unknown; added the changeset the (already-fixed-in-#126) release pipeline needs to bump on merge. |
| R2 sections | web/page-report.js no longer emits "Report Notes" / "Reproduction Steps". |
| R3 en Wikipedia link | Translate link target defaults to Wikipedia (fallback Wikidata), resolving en.wikipedia.org from Wikidata sitelinks — symmetric with Russian. |
| R4 merged definition | renderMergedDefinitionLines/mergeEntityDefinition union Wikidata/Wikipedia/Wiktionary per phrase. |
| R5 contexts | renderContextLines emits priority-ordered contexts with exact probability + word count, in both formalization and translation links notation. |
| R6 quality gate + cache | js/data/wikimedia-cache.lino (deterministic, .lino), scripts/refresh-wikimedia-cache.mjs (cache:refresh/cache:check, wired into npm run check), web seeding via web/persistent-cache.js. |
| R7 case study | docs/case-studies/issue-128/ — timeline, requirements, root causes, solution plan, online research, data. |
| R8/R9/R10/R11 | verbose detail added via R4/R5; no upstream issue warranted (all defects in-repo); shared renderers cover every entry point; one PR, one changeset. |
Verification
- Full suite green locally: unit 63/0, integration 295/0 (10 skipped), e2e 82/0 — including the issue-43 top-views quality gate ("passes the quality bar for every captured article") and issue-96.
npm run checkpasses (lint, prettier, jscpd, formalize docs, JS/Rust parity, cache freshness).- All 3 CI workflows succeed on the head commit
4a67b5e(JS Checks and release, Rust Checks, Broken Link Checker). main(0.10.0) is already an ancestor of HEAD; working tree clean.
The single changeset (minor) will move the published version 0.10.0 → 0.11.0 on the next merge to main.
This summary was automatically extracted from the AI working session output.
🤖 Solution Draft LogThis log file contains the complete execution trace of the AI solution draft process. 💰 Cost: $18.082089📊 Context and tokens usage:Claude Opus 4.8: (6 sub-sessions)
Total: (67.4K new + 601.3K cache writes + 19.1M cache reads) input tokens, 177.7K output tokens, $18.082089 cost 🤖 Models used:
📎 Log file uploaded as Gist (8119KB)Now working session is ended, feel free to review and add any feedback on the solution draft. |
✅ Ready to mergeThis pull request is now ready to be merged:
Monitored by hive-mind with --auto-restart-until-mergeable flag |
Summary
Resolves #128 — the multi-requirement Translate-page report for "Hawaii is a state." (en→ru, all 3 sources). Everything below lands in this single PR with one changeset.
App version: unknown) + auto-bump.linoAPI cache indata/docs/case-studies/issue-128/Reproduction
web/#/translate), translateHawaii is a state.en→ru with all sources enabled.App version: unknown; EnglishHawaiilinks to Wikidata while RussianГавайиlinks to Wikipedia; links notation lacks a merged definition and the elected contexts; the report carries "Report Notes" / "Reproduction Steps".en.wikipedia.orgarticle (fallback Wikidata); links notation carries the merged definition and the priority-ordered contexts; the report drops both boilerplate sections.Key changes
web/translate-ui.js— read the deployedapp-version.jsonvialoadAppVersionInfo()/formatAppVersion()(R1).web/page-report.js— remove the two boilerplate sections and their plumbing (R2).web/index.html,web/i18n.js— default link target to Wikipedia (fallback Wikidata) (R3).js/src/formalize-renderers.js—renderMergedDefinitionLines/mergeEntityDefinition(R4) andrenderContextLines(R5).js/src/translation-renderers.js— carry contexts into the translation links notation (R5).js/data/wikimedia-cache.lino+scripts/refresh-wikimedia-cache.mjs(npm run cache:refresh/cache:check, wired intonpm run check) +web/persistent-cache.jsseeding +js/src/lino.js/formalize-snapshots.js.linocodec (R6).docs/case-studies/issue-128/— timeline, requirements, root causes, solution plan, online research (R7).Tests
js/tests/integration/issue-128.test.js— R3/R4/R5 rendering assertions.js/tests/integration/issue-128-cache.test.js— lossless round-trip, deterministic ordering, committed-cache freshness, offline replay of "Hawaii is a state.".npm run check(lint, prettier, jscpd, formalize docs, JS/Rust parity, cache freshness) passes.