Skip to content

Restore zh-CN locale mapping for the canonical CTF settings mode #141

Description

@Teakowa

Blocks: wrightkit/wright#245
Related: #108, #110
Evidence: Wright #245 real-project compile verification on pinned Bastion e1a0435d84f0fd1ae5192e5088e7321bcb547ab6

Goal

Restore the canonical mode.ctf (Capture The Flag / 勇夺锦旗) settings locale mapping needed to emit valid zh-CN Workshop from the pinned Bastion project, by fixing the settings locale corpus generation path rather than adding a project-specific exception.

Context

Independent Wright #245 verification now uses Bastion's real project entry point, src/main.opy, with released opy-provider v0.1.17. wright check succeeds with zero diagnostics, but wright compile --locale zh-CN fails during canonical Workshop emission with:

missing setting mapping for locale 'zh-cn': 'mode.ctf'

The repository already contains the reviewed canonical mapping in the Workshop inventory:

  • id: ctf
  • en-US: Capture The Flag
  • zh-CN: 勇夺锦旗
  • provenance: data.gamemodes.ctf

The general catalog likewise carries CTF aliases Capture The Flag / 勇夺锦旗. However, the committed settings locale corpus has no CTF entry in its modes map.

Root cause

settings_corpus() currently builds its gamemodes lookup only from localized entries:

localized_index(export, &["gamemodes.", "customGameSettings.gamemodes."])

The same reviewed export also carries direct data.gamemodes.* entries, and data.gamemodes.ctf is already used elsewhere as canonical inventory evidence. Because the settings locale generator does not merge that direct-data index, CTF is omitted even though its reviewed locale mapping already exists.

This is a canonical Workshop settings locale-data pipeline gap, not an OPY/Wright semantic gap.

Scope

  • Extend the settings locale corpus generation path to consume the reviewed direct data.gamemodes locale evidence in addition to the existing localized/custom-game mode sources.
  • Regenerate the committed settings locale corpus so canonical mode.ctf resolves to Capture The Flag / 勇夺锦旗 with provenance from the normal data pipeline.
  • Ensure parser/emitter resolution uses the same canonical mode.ctf identity across supported locales.
  • Add focused regression evidence that would fail if the generated CTF mode mapping is removed again.
  • Rerun the motivating pinned Bastion zh-CN Workshop emission/parse path.
  • Preserve explicit failure for genuinely missing locale mappings; do not introduce a generic fallback that hides catalog gaps.

Non-goals

Acceptance criteria

  • The settings locale corpus generation path includes reviewed data.gamemodes evidence and deterministically retains the CTF mapping on regeneration.
  • Canonical mode.ctf resolves/emits as Capture The Flag in en-US and 勇夺锦旗 in zh-CN through the normal Workshop settings data path.
  • A focused CTF settings fixture emits in zh-CN and reparses without a missing-mapping diagnostic.
  • The pinned Bastion src/main.opy zh-CN compile path no longer fails on mode.ctf when consumed through a released/candidate workshop-rs implementation.
  • The fix does not add Wright/OPY/Bastion-specific semantic branches or weaken missing-locale diagnostics.
  • Existing settings/catalog/parser/emitter tests remain green.
  • Independent implementation ablation removing the direct data.gamemodes contribution (or the generated CTF mapping) makes the focused CTF regression fail again.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions