Skip to content

Issue on Translate page: Hawaii is a state. (#128)#129

Merged
konard merged 5 commits into
mainfrom
issue-128-41095a0f356d
May 29, 2026
Merged

Issue on Translate page: Hawaii is a state. (#128)#129
konard merged 5 commits into
mainfrom
issue-128-41095a0f356d

Conversation

@konard
Copy link
Copy Markdown
Contributor

@konard konard commented May 29, 2026

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.

# Requirement Status
R1 Version readout (App version: unknown) + auto-bump ✅ display fixed + changeset added (pipeline gate was fixed in #126)
R2 Remove "Report Notes" / "Reproduction Steps" from reports
R3 Wikipedia link for English (parity with Russian)
R4 Merged entity definition in links notation
R5 Selected contexts (priority + exact probability + word count) in formalization and translation links notation
R6 Quality gate on top-viewed articles + .lino API cache in data/
R7 Case study under docs/case-studies/issue-128/
R8 Debug/verbose output where root cause unclear ✅ (root cause was visible; R4/R5 add disambiguation detail)
R9 File issues in related repos ✅ assessed — none warranted (all defects are in-repo)
R10 Apply across the whole codebase ✅ shared renderers cover every entry point
R11 One PR, changeset, CI green

Reproduction

  1. Open the Translate page (web/#/translate), translate Hawaii is a state. en→ru with all sources enabled.
  2. Before: debug log shows App version: unknown; English Hawaii links to Wikidata while Russian Гавайи links to Wikipedia; links notation lacks a merged definition and the elected contexts; the report carries "Report Notes" / "Reproduction Steps".
  3. After: version reflects the deployed build; English resolves an en.wikipedia.org article (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 deployed app-version.json via loadAppVersionInfo()/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.jsrenderMergedDefinitionLines/mergeEntityDefinition (R4) and renderContextLines (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 into npm run check) + web/persistent-cache.js seeding + js/src/lino.js/formalize-snapshots.js .lino codec (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.".
  • 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 check (lint, prettier, jscpd, formalize docs, JS/Rust parity, cache freshness) passes.

Adding .gitkeep for PR creation (default mode).
This file will be removed when the task is complete.

Issue: #128
@konard konard self-assigned this May 29, 2026
konard added 4 commits May 29, 2026 17:03
…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.
@konard konard changed the title [WIP] Issue on Translate page: Hawaii is a state. Issue on Translate page: Hawaii is a state. (#128) May 29, 2026
@konard konard marked this pull request as ready for review May 29, 2026 17:26
@konard
Copy link
Copy Markdown
Contributor Author

konard commented May 29, 2026

Working session summary

All requirements are complete and PR #129 is finalized.

Done — PR #129 is ready for review

#129 — title Issue on Translate page: Hawaii is a state. (#128), out of draft, MERGEABLE, all CI green.

What shipped (all on branch issue-128-41095a0f356d)

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 check passes (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.

@konard
Copy link
Copy Markdown
Contributor Author

konard commented May 29, 2026

🤖 Solution Draft Log

This 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)

  1. 116.6K / 1M (12%) input tokens, 21.2K / 128K (17%) output tokens
  2. 116.6K / 1M (12%) input tokens, 28.2K / 128K (22%) output tokens
  3. 114.4K / 1M (11%) input tokens, 26.7K / 128K (21%) output tokens
  4. 116.2K / 1M (12%) input tokens, 23.4K / 128K (18%) output tokens
  5. 116.6K / 1M (12%) input tokens, 34.4K / 128K (27%) output tokens
  6. 49.9K / 1M (5%) input tokens, 6.3K / 128K (5%) output tokens

Total: (67.4K new + 601.3K cache writes + 19.1M cache reads) input tokens, 177.7K output tokens, $18.082089 cost

🤖 Models used:

  • Tool: Anthropic Claude Code
  • Requested: opus
  • Model: Claude Opus 4.8 (claude-opus-4-8)

📎 Log file uploaded as Gist (8119KB)


Now working session is ended, feel free to review and add any feedback on the solution draft.

@konard
Copy link
Copy Markdown
Contributor Author

konard commented May 29, 2026

✅ Ready to merge

This pull request is now ready to be merged:

  • All CI checks have passed
  • No merge conflicts
  • No pending changes

Monitored by hive-mind with --auto-restart-until-mergeable flag

@konard konard merged commit 09b9367 into main May 29, 2026
21 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Issue on Translate page: Hawaii is a state.

1 participant