Skip to content

feat(dataset-updater): #457 DNN UI strings localization infra (Enabled=false) - #487

Merged
jsboige merged 1 commit into
masterfrom
feat/457-dnn-ui-strings-datasetupdater
Jun 15, 2026
Merged

jsboige merged 1 commit into
masterfrom
feat/457-dnn-ui-strings-datasetupdater

Conversation

@jsboige

@jsboige jsboige commented Jun 15, 2026

Copy link
Copy Markdown
Contributor

What

DatasetUpdater config infrastructure for issue #457 — translate the DNN web-platform UI strings (docs/dnn-localization/dnn-ui-strings.csv) FR → all 7 languages (en/ru/pt/es/ar/fa/zh) via gpt-5.5. The task ships Enabled = false so the mechanics can be reviewed before the smoke/full run.

This is the config-infra PR (my ACK to ai-01, rqb5pm). The smoke test + full run → data PR is the next step.

Files (7, +320/-13)

File Change
Entities/DnnUiString.cs NEW — entity + DnnUiStringClassMap (key=PK, only required col)
WebBasedGenerator/KnownDataSets.cs + DnnUiStrings constant
AssetConverterConfig.cs + DataSetInfo (DebugFilePath → docs/dnn-localization/dnn-ui-strings.csv, CsvType=DnnUiString)
DatasetUpdater/DatasetUpdaterRootConfig.cs + task block (Enabled=false, gpt-5.5, OpenRouter key, ChunkSize=4, multi-lang single task)
Resources/PromptDnnUiStringsTranslateMultiUser.txt NEW prompt
Resources/PromptDnnUiStringsTranslateMultiAssistant.txt NEW prompt
Tests/Parsing/DnnUiStringClassMapRegressionTests.cs NEW +4 tests

Mechanics note for ai-01 (review)

  • DUAL CSV PATH. The engine reads the source via DataSetInfo.GetDictionaryFromCsv, which uses a plain CsvConfiguration (no PrepareHeaderForMatch, no ClassMap) → dictionary keys are the raw CSV header names. Therefore FieldsToInclude/FieldsToUpdate/PrimaryField use the literal headers (key, fr, en, source_file…), not property names. The DnnUiStringClassMap is only on the harvest/validation path (CsvBase.LoadFromContent) and is exercised by the 4 new tests. Verified by reading DataSetInfo.cs:396-410 + DatasetUpdaterConfig.cs:125-157.
  • Single multi-language task (mirrors PromptRulesPPTranslateMulti): FieldsToUpdate = [en,ru,pt,es,ar,fa,zh], model emits up to 70 parallel UpdateRecord calls (10 rows × 7 langs). UpdateRecord(primaryKey, fieldName, newValue) is one-field-per-call (RecordsUpdater.cs:18).
  • SelectEmptyTargets = true selects all 10 rows (all targets empty). The prompt instructs skipping rows whose fr is empty.
  • SkipConfigFile = true convention respected — C# defaults are the single source of truth.

Content-integrity flags for @jsboige (signalled, NOT declared PASS)

  1. res.RuleMemoInstructions has no FR source (CSV note: "DB-only — NOT inferred; export required before translation"). Its 7 cells will stay empty by design — the prompt instructs the model to skip empty-fr rows. A DB export is needed before this string can be translated.
  2. 6 rows are "INFERRED FR" (res.RuleSummary/Material/Installation/Variants/MemoCard/MemoCardFileNamePrefix/MemoCardDownload) — source FR values are guesses. Translations will be of inferred source and need export verification before final acceptance.

DoD (from dispatch uy6g62)

  • Config infra built, compiles (0 errors)
  • gpt-5.5 confirmed in task config (no 5.4-mini)
  • Smoke test (1-2 records) — next, pending this PR / key check
  • Full run → translated strings → data PR (separate)
  • jsboige content validation (ai-01 validates mechanics)

The full-run data PR stays in pending content validation by jsboige — I deliver + signal, I do not declare PASS.

Verification

  • dotnet build → 0 errors (16 pre-existing warnings, none from new code).
  • dotnet test → 252 pass / 0 fail / 5 skip, incl. +4 DnnUiStringClassMapRegressionTests.

🤖 Generated with Claude Code

…d=false)

Add DatasetUpdater config infrastructure to translate the DNN web-platform
UI strings (docs/dnn-localization/dnn-ui-strings.csv) FR -> all 7 languages
(en/ru/pt/es/ar/fa/zh) via gpt-5.5. Config ships Enabled=false for review of
the mechanics before the smoke/full run.

- Entities/DnnUiString.cs: entity + DnnUiStringClassMap (key=PK, only required
  column; 7 target langs + context/source_file/notes Optional). Dual-path note:
  the engine reads raw CSV headers (DataSetInfo.GetDictionaryFromCsv uses a
  plain CsvConfiguration, no ClassMap) so task FieldsToInclude/FieldsToUpdate
  use literal header names; this ClassMap guards the harvest/validation path
  (CsvBase.LoadFromContent).
- KnownDataSets.DnnUiStrings + DataSetInfo (DebugFilePath -> docs/dnn-localization/
  dnn-ui-strings.csv, CsvType=DnnUiString).
- DatasetUpdaterRootConfig: new task (Enabled=false, gpt-5.5, OpenRouter key,
  SequentialChunks ChunkSize=4, SelectEmptyTargets=true, multi-lang single
  task mirroring PromptRulesPPTranslateMulti).
- Prompts: PromptDnnUiStringsTranslateMulti{User,Assistant}.txt — preserve
  {0}/{1} placeholders, skip empty-FR rows (res.RuleMemoInstructions), RTL for
  ar/fa, resolve HTML entities, concise UI style.
- Tests: DnnUiStringClassMapRegressionTests (+4) via real LoadFromContent path.

Content-integrity flags for jsboige (signalled, NOT declared PASS here):
- res.RuleMemoInstructions has NO FR source ("export required") -> 7 cells stay
  empty by design (prompt instruction skips empty-FR rows).
- 6 rows are "INFERRED FR" -> translated from inferred source, needs export
  verification before final acceptance.

Build: 0 errors. Tests: 252 pass / 0 fail / 5 skip (incl. +4 DnnUiString).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

@clusterManager-Myia clusterManager-Myia left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[NanoClaw]

Clean localization infra addition — Enabled = false keeps it inert until the CSV data and OpenAI key are in place.

Entity + ClassMap (DnnUiString.cs): well-structured. Only key is required, everything else Optional — correct for a dataset that starts empty and fills incrementally. The PrepareHeaderForMatch note on source_file (underscore stripping) is important and clearly documented in the DUAL PATH comments.

DatasetUpdater config: SelectEmptyTargets = true + DivisionMode.SequentialChunks + ChunkSize = 4 is a safe starting config. Function calling with MaxOutputTokens = 4096 for 7 languages x 4 entries = 28 parallel UpdateRecord calls per chunk — reasonable. MaxDegreeOfParallelismWebService = 4 prevents runaway API spend.

Prompt templates: thorough coverage — placeholder preservation, empty-FR skip rule, RTL handling, HTML entity resolution, game terminology invariance. The assistant prompt correctly echoes constraints back.

Regression tests (136 lines, 4 tests): cover the critical paths — full 12-column round-trip, GetId() returning key, optional columns absent (2-column CSV), and empty FR source. Inline CSV via Row() helper is clean and self-contained.

KnownDataSets: trailing newline fix is a minor whitespace cleanup bundled in — not a concern.

LGTM.

@jsboige
jsboige merged commit 39557ac into master Jun 15, 2026
3 checks passed
@jsboige
jsboige deleted the feat/457-dnn-ui-strings-datasetupdater branch June 15, 2026 23:08
jsboige added a commit that referenced this pull request Jun 17, 2026
…ure, Option C tooling) (#524)

Bricks 1 + 3 of the #457 dispatch (ai-01 msg-…141408). Brick 2 (DatasetUpdater
Option C config, gpt-5.5 ui.*/res.*) was ALREADY merged in #487 (Enabled=false) —
not rebuilt; this PR adds the missing tooling AROUND it.

Brick 1 — extract_dnn_ui_strings.py: reusable content-type -> CSV extractor that
codifies the manual PHASE1 audit. ui.* = anchor-based (fails loud if a hardcoded
string disappears, never invents rows); res.* = @Resources.* references with DB-only
fr flagged honestly. Regex @?Resources. captures both directive (@Resources.X) and
nested-expression (@Html.Raw(Resources.X)) forms — recovers RuleMemoInstructions.

Brick 3 — reimport_dnn_ui_strings.py: `verify` (key-set HARD diff vs reference) +
`reimport` (render canonical payload to stdout, NEVER writes). res.* fr empty-in-extract
by design (DB-only values); KEY-SET match is the hard contract.

DoD: test_roundtrip.py proves extract -> verify -> reimport on a committed fixture,
zero prod mutation (PASS, exit 0). Cross-validated vs REAL prod templates: 10/10 keys
match docs/dnn-localization/dnn-ui-strings.csv.

Anti-fab: anchor-based ui.* (negative test proven exit 2), no free-text fabrication,
honest DB-only flagging. Gate-safe: pure tooling, no prod/DB/CSV/config mutation, does
NOT touch dnn-ui-strings.csv (po-2024 lane #490). Stdlib Python only.

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
jsboige added a commit that referenced this pull request Jun 20, 2026
docs(dnn): #457 document-tier translation workflow (Phase 2-4 design)

The Phase 1 inventory (457-site-content-type-inventory.md) named WHAT to
translate but deferred the HOW for content-type C (the 2 standalone FR
HTML pages, ~37k chars of prose). The string-tier toolchain
(tools/dnn_i18n/, PRs #524/#487) handles ui.*/res.* keys but does not
fit prose. This doc designs the document-tier lane: extraction ->
DatasetUpdater -> re-import.

Scope: DNNPlatform/fallacies/fallacies.html (81 KB, structured charte)
+ MariagePourTous.html (38 KB, prose).

Design:
- Phase 2 CSV schema: segment-oriented (segment_id = file#element-index),
  source_path + selector for deterministic re-import, inner-text fields
  per language. NOT the key->value string-tier dialect.
- Phase 2 DatasetUpdater task shape: document-tier variant vs string-tier
  (prose prompt, char-budget chunking, gpt-5.5, reasoning effort low,
  max_output_tokens >=7000, Enabled=false until GO).
- Phase 1.5 extractor: the net-new gating tool (html.parser stdlib,
  file-specific selectors h2/h3/li vs p/h2/h3, inner-text extract +
  selector store for re-wrap). Nothing translates until this exists.
- Phase 4 re-import: selector-based patch, dry-run verifier (same DoD as
  string-tier round-trip), localized HTML files per language.
- RTL/CJK (ar/fa/zh): reuse PR #359 font stacks at page level
  (dir=rtl/lang), template variant decision for jsboige.
- Sequencing: extractor is critical path.
- 4 open questions for jsboige (inner-text vs outer-HTML, one-template vs
  per-lang, are pages still served, GO to build extractor).

Index README #554 updated to reference the new doc in supporting-docs
table. Pure design/references -- no prod mutation, no extraction
executed, no DatasetUpdater enabled.


@

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
jsboige added a commit that referenced this pull request Jul 3, 2026
Investigate the mechanism for publishing DNN site content in the 7 non-FR
languages (coupled-release critical path, ai-01 dispatch 8b3ymj). Builds on
prod coverage audit #662 (site FR-only).

Key findings:
- Two bespoke apps at different i18n maturity: FallacyExplorer is
  multilingual-ready post-#490 (loc() helper, CmsContext.Culture cascade,
  lang-suffixed fields text_fr/text_en/...); RulesExplorer is FR-only
  (generic fields ruleEntity.Summary/.Material/..., no culture logic,
  hardcoded FR) — the direct cause of the #662 FR-only verdict.
- The site Rules content (Summary/Material/Installation/Content/Variants/
  Memo) is DB-only, manually-authored — it does NOT match the Rules CSV
  columns (Text/Text_en/...). The CSV translations are not reusable as-is;
  porting is prose translation of DB content.
- 3 localization layers: L1 UI strings (#487 rail built, gated on portal
  export for res.* values), L2 static HTML (not wired), L3 content items
  (DB-only bulk — the dominant cost).

DoD met: mechanism + per-language effort estimate + step plan.
Read-only: 0 prod write, 0 DB mutation. Portal/2sxc export (jsboige) is the
single hard unblocker. Highest-leverage worker-able prep = RulesExplorer
view refactor (mirror the proven FallacyExplorer loc() pattern).

Relates: #457 #487 #490 #662 #134 #140.

Co-authored-by: Claude-Code <noreply@anthropic.com>
jsboige added a commit that referenced this pull request Jul 25, 2026
… (0 run, 0 prod CSV) (#903)

Prepares the worker-side translation harness for #684 (DNN Rule prose, 7 langs × ~30 entities)
ahead of the #681 (2sxc App export) artefact, per ai-01 dispatch. Turns the export wait into
concrete readiness.

Design doc + draft prompt:
- docs/dnn-localization/684-rule-prose-translation-harness.md — the harness design: Option C
  task config (ready-to-paste C# snippet: UseResponsesApi=true, ReasoningEffort="low",
  MaxOutputTokens=7000, gpt-5.5, UseFunctionCalling=true, Enabled=false), Option C 5-record
  pilot protocol (#855 reco), cell-by-cell verification (3 dimensions: non-empty / not-FR-
  contaminated / language-correct — lessons #803 r7 false-0, #656 matcher-no-match), 7-language
  acceptance grid (DoD from #684), report format, serialization gate.
- DatasetUpdater/Resources/PromptDnnRuleProseTranslateEnUser.txt — draft EN user prompt adapting
  the #487 DNN UI-strings pattern to Rule prose (function calling, HTML preservation,
  placeholders {0}/{1}, RTL/CJK, zero-FR-contamination).

Closes the gap #855 flagged: every gpt-5.5 task today is wired to legacy Chat Completions
(UseResponsesApi unset on 0/48) → latent empty-Content on reasoning models. The harness
specifies the Option C routing for the Rule-prose task so the first Enabled=true flip doesn't
silently produce empty output.

Honest scope — no compiled config entry added: the source prose is DB-only (arrives via #681
export, no KnownDataSets.DnnRuleProse today) and the field model is pending #682. A compiled
entry with guessed field names would be dead code that looks ready. The snippet is the
ready-to-paste form, instantiated once the export format is known.

0 run, 0 prod CSV, 0 DB mutation. Enabled=false held until #681 + #682 + pilot PASS + T&A #802.
Re-import is jsboige-side; visual QA verdict is ai-01-only.

Co-authored-by: Your <your.email@example.com>
Co-authored-by: Claude-Code <noreply@anthropic.com>
jsboige added a commit that referenced this pull request Sep 15, 2026
…ulture cascade (#674)

* feat(dnn): #649 RulesExplorer i18n — mirror loc() culture cascade (runtime pending)

Refactor the 2 RulesExplorer views to be culture-aware, mirroring the
FallacyExplorer pattern established in #490. This is the concrete
worker-able step (reco from investigation #669) to take the rules page
from FR-only (1/8 langs, audit #662) toward 8/8.

Changes (source-level, .cshtml interpreted by 2sxc at runtime):
- _RulesExplorer_RuleList.cshtml: add lang detection (CmsContext.Culture)
  + Loc() helper; route EntityTitle + Summary through Loc().
- _RulesExplorer_RuleDetail.cshtml: same helper; route EntityTitle (x3),
  Summary, Material, Installation, Content, Variants (cond + raw), Memo
  (cond + raw) through Loc().

Loc() cascade: <field>_<lang> -> <field>_en -> <field>_fr -> <field>
(generic). The 4th fallback is the key difference from FallacyExplorer:
the Rule content-type currently exposes generic fields (Summary, Material,
...) holding the FR canonical value, with NO language dimensions wired.
Without the generic fallback, Loc() would return '' until the DB gains
suffixed fields — breaking the current FR rendering. The generic fallback
preserves FR during the DB-migration transition.

Runtime validation PENDING (gated like #596): these templates are not
compiled by dotnet build; they are interpreted by 2sxc in DNN. Validation
requires (a) the 2sxc sandbox, AND (b) the Rule content-type to gain the
suffixed fields (DB change, gated on the 2sxc portal export — jsboige).
Not for merge until sandbox runtime validation (same garde-fou as #596).

Numeric fields (MinNbPlayers/MaxNbPlayers) and UrlKey left intact
(non-localizable). 'de X a Y joueurs' hardcoded FR left for the UI-strings
rail (#457 L1 / #487) — separate lane, out of this refactor scope.

Relates: #669 #490 #662 #596 #458. ai-01 dispatch tbxfhu (primary).

Co-Authored-By: Claude-Code <noreply@anthropic.com>

* test(dnn): #674 source-level Loc() cascade contract tests (deterministic, DB-free)

Grain 3 of dispatch izoeru: add the tests that ARE possible without DB and
record the blocker that keeps the rest impossible.

The two .cshtml views are interpreted by 2sxc at DNN runtime (never compiled
by dotnet build), so the Loc() cascade cannot be executed outside the 2sxc
sandbox + Rule content-type DB. What a source-level test can pin honestly:
helper presence, cascade order (<field>_<lang> -> _en -> _fr -> generic),
the FR-preserving generic fallback, the bounded lang source
(CmsContext.Culture + 8-language supported set + fr fallback), and the exact
call-site routing per view. Line endings are normalized before matching
(RuleDetail is CRLF, RuleList is LF - the normalization already bit this PR
once in review).

These tests deliberately claim NO runtime validation - the merge gate stays
[sandbox runtime validation], unchanged.

6/6 green, 28 ms, no DB. Parent e83f26d (PR head, fast-forward).

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>

* feat(dnn): #674 retarget Loc() cascade to the real Title attribute

Owner decision 14/09 (#682 c.5665864947, stamped in the merged dossier
#1373): the Rule content-type's title attribute is Title (IsTitle=true,
setID 377) — EntityTitle is a non-provisionable 2sxc alias. The cascade
becomes Title_<lang> -> Title_en -> Title_fr -> Title, so provisioning
and reading use the same name; no delivered path reads EntityTitle
anymore.

- RuleDetail: 3 call sites (h1, memo cardName, memo em)
- RuleList: 1 call site (h2)
- DnnRulesExplorerLocContractTests: expected fragments updated
  (6/6 green, 24 ms, DB-free)

Sits on the merge of origin/master c089d52, whose deliberate conflict
resolution in _RulesExplorer_RuleDetail.cshtml keeps #772's
<h2>@Resources.RuleContent</h2> (the sole master-side addition) together
with the Loc()-routed Content/Variants forms. Zero EntityTitle residual
in both views (verified by grep).

Runtime validation remains [runtime pending] (2sxc sandbox + Title_<lang>
provisioning on setID 377 — jsboige window, dossier #1373 etape 2).

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>

---------

Co-authored-by: Claude-Code <noreply@anthropic.com>
jsboige added a commit that referenced this pull request Oct 9, 2026
…te, tâche #487 no-op) (#1842)

T3 est un nom dans le plan, pas un geste. Mesure seule, 0 écriture, 0 appel payé.

- Tranche dépôt DÉJÀ livrée (#490) : 11 rangées (2 ui.* + 9 res.*), 11×7 = 77 cellules
  cibles, 0 vide, fr compris ⇒ rien à dispatcher.
- La tâche #487 (SelectEmptyTargets = true, « empty-only multi ») sélectionne 0 rangée
  sur ce corpus : un dispatch « exécuter T3 » serait un no-op payé.
- Reste 3(a) les VALEURS res.* — DB-only, bloquées sur le MÊME export que T2 ;
  3(b) GlobalResources.<culture>.resx — nommé par le plan, volume mesuré (1 386 entrées
  × 6 = 8 316 cellules), outillage absent, arbitrage à router (paquets de langue DNN
  amont vs production LLM ; 1 fichier nommé vs 6 familles observées).
- Piège de chemin signalé : ReleaseFilePath = URL raw.githubusercontent master
  (famille #1225/#1228) — une correction sur branche serait invisible en Release.

Déclaré non mesuré : le besoin des 6 cultures, la couverture des paquets amont, le rendu.

Co-authored-by: Claude Sonnet 5.5 <noreply@anthropic.com>
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.

2 participants