Home

dev / openkara

publicthedavidweng/OpenKara· sync paused
Overview Code History Branches Pull requestsIssuesInsights
main
HomeOverview Code PRsIssues

feat(model): consume the openkara-models stable catalog with installed identity (#179)

2 months ago

037a6e6
Authored
Davy7/25/2026, 12:50:45 AM
* feat(model): consume the openkara-models stable catalog with installed identity

Implements #167: model URLs, digests, and versions now come from the
openkara-models two-layer catalog (stable pointer + immutable release
manifest) instead of hand-maintained constants.

Rust:
- Add separator::catalog — typed pointer/manifest parsing, byte-level
  verification (size + SHA-256 before parse), structural validation
  (unique artifact ids, HTTPS URLs, waveform tensor interface, non-empty
  reciprocal runtime compatibility), and monotonic-generation enforcement.
- Embed a verbatim snapshot of catalog generation 3 as the offline trust
  anchor; descriptors resolve from it with no network and no config.
- Record installed identity (<model>.identity.json) on every verified
  install; readiness accepts pin-matching or identity-verified files so a
  model from a newer generation stays usable offline or under an older
  binary, and catalog refresh failure can never invalidate an install.
- Add check_model_updates: fetches + verifies the stable catalog,
  compares installed identity per variant, caches the verified catalog
  so download_model installs the newer artifact. Implicit downgrades are
  rejected at both comparison and download.
- Model pin moves from model-v2.0.1 to model-v2.1.0 via the snapshot.

Parity:
- scripts/resolve-model.mjs resolves artifacts from the same snapshot;
  scripts/setup.sh and the CI model-preparation job consume it, deleting
  all hardcoded MODEL_URL/MODEL_SHA256 values.

Frontend:
- Settings model section shows installed versions, adds Check for
  updates / Update actions, and distinguishes runtime corrupt/failed
  states with the underlying error instead of a generic install CTA.
- The per-song Separate button is disabled with a hint while the model
  is still downloading on first run.
- New en/zh-CN copy; tests for the catalog module, identity resolution,
  update comparison, resolver parity, and the new UI states.

Refs #166.

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

* style(scripts): format resolve-model.mjs

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

---------

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>

Parentc3eebe1

38 files changed
  • .github/workflows/ci.yml+15−3
  • README.md+1−1
  • docs/references/contracts/model-bootstrap.md+85−19
  • scripts/resolve-model.mjs+81−0
  • scripts/setup.sh+7−4
  • src-tauri/catalog/release-manifest.json+922−0
  • src-tauri/catalog/stable-pointer.json+11−0
  • src-tauri/models/README.md+3−1
  • src-tauri/src/app_runtime.rs+3−4
  • src-tauri/src/commands/bootstrap.rs+148−23
  • src-tauri/src/lib.rs+1−0
  • src-tauri/src/separator/bootstrap.rs+87−27
  • src-tauri/src/separator/catalog.rs+941−0
  • src-tauri/src/separator/mod.rs+1−0
  • src-tauri/src/smoke.rs+1−1
  • src-tauri/src/state/shell.rs+8−2
  • src-tauri/tests/phase6_catalog.rs+225−0
  • src-tauri/tests/phase6_model_bootstrap.rs+27−25
  • src/components/Library/SongListItem.test.tsx+79−0
  • src/components/Library/SongListItem.tsx+9−1
  • src/components/Settings/SettingsModelVariantSection.test.tsx+166−0
  • src/components/Settings/SettingsModelVariantSection.tsx+101−6
  • src/components/Settings/SettingsOverlay.context.ts+2−0
  • src/components/Settings/SettingsOverlay.controller.test.ts+41−0
  • src/components/Settings/SettingsOverlay.controller.tsx+1−0
  • src/components/Settings/SettingsOverlay.state.test.ts+18−0
  • src/components/Settings/SettingsOverlay.state.ts+7−0
  • src/components/Settings/SettingsOverlay.test.tsx+18−0
  • src/components/Settings/settings-overlay.integrity-actions.test.ts+2−0
  • src/components/Settings/settings-overlay.library-actions.test.ts+2−0
  • src/components/Settings/settings-overlay.model-actions.test.ts+106−0
  • src/components/Settings/settings-overlay.model-actions.ts+56−1
  • src/components/Settings/settings-overlay.types.ts+15−0
  • src/lib/tauri/settings.ts+5−0
  • src/locales/en.json+14−2
  • src/locales/zh-CN.json+14−2
  • src/types/ipc.ts+24−0
  • tests/model-resolver-parity.test.ts+72−0