Skip to content

fix(catalog): select international catalogs by resource version - #13

Merged
nichinichisou0609 merged 1 commit into
MetaSekaiLab:mainfrom
StarMoe-org:codex/upstream-versioned-catalog
Sep 30, 2026
Merged

nichinichisou0609 merged 1 commit into
MetaSekaiLab:mainfrom
StarMoe-org:codex/upstream-versioned-catalog

Conversation

@luoxiadesu

Copy link
Copy Markdown
Contributor

International catalog_main_<language>.bin can remain unchanged after MasterdataService/Version publishes a newer resource_version. This leaves new stories unavailable to story/web and prevents their Live2D pre-pass from discovering the referenced models. catalogs fetch also downloaded main before querying Version, so it could label old bytes as the new release.

This change selects catalog_<resource_version>_<language>.bin before downloading. With a configured international API, catalog-based commands discover the resource version first. Builds can pin it with --catalog-release, [catalog] version, or [servers.<region>] catalog_version. The existing asset-store --catalog-version LABEL|SHA option keeps its separate meaning.

  • Apply the selector to catalog, story/Live2D/web commands through open_catalog, catalogs fetch, and browse.
  • Isolate versioned caches by CDN root and resource version; validate catalogs before caching and never fall back to main after discovery/download failure.
  • Record the version used for the actual bytes in catalog imports and music-data provenance.
  • Keep explicit local catalog files offline, support explicit main, preserve legacy main behavior when neither an API nor a pin is configured, and retain JP's existing version/hash discovery.

Observed on 2026-09-30: at the same TW CDN root, catalog_main_zh-Hant.bin still had 44,630 keys, while catalog_1.0.0.201_zh-Hant.bin had 45,696. Episode IDs 10946–10954 were absent from main and present in the versioned catalog. Both contained 239 Live2D model keys; the failure was the missing episode scripts, not a demonstrated loss of model keys.

Validation:

  • python -m pytest -q: 1,341 passed.
  • GOLDENS_STRICT=1 python -m pytest -q tests/test_goldens.py tests/test_objexport.py: 45 passed.
  • Pyflakes, diff checks, and a scan of the exact staged files passed.
  • Synthetic regressions cover discovery order, version changes at one CDN root, stale main caches, region/CDN isolation, explicit pins and files, worker environment inheritance, unavailable catalogs/API, unsafe selectors, matching bin/hash paths, import labels, browser selection, and CLI option compatibility.
  • A bounded live run using this branch automatically selected resource version 1.0.0.201, found all nine episode keys, discovered ten models from episode 10948, and exported one referenced Live2D runtime model. Its moc3, prefab JSON, and two textures matched the independently validated workflow-fix output byte for byte. No game files or credentials are included in this PR; full story/audio/site publication was not part of this check.

Based on current upstream main (e65e783); this PR contains only the core fix, tests, and documentation, with no StarMoe-specific workflows or endpoints.

@nichinichisou0609
nichinichisou0609 merged commit 15cb3bf into MetaSekaiLab:main Sep 30, 2026
6 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.

2 participants