fix(web): honor model load options and backend routing

SH
5h ago
+771-67

What

Web model loading rejected contextLength, dropped backend preferences, and could route loads or embedding calls to the wrong WASM module or worker.

This PR forwards supported load options, selects a registered backend that supports the model type, and keeps runtime ownership consistent.

Changes

  • Forward contextLength, ordered backend preferences, and forceReload, including the deprecated framework alias.
  • Reject retired threads and unsupported required: true preferences with structured configuration errors.
  • Check backend capabilities before selecting a route, retaining the catalog backend as a fallback candidate.
  • Use consistent routing across synchronous loads, asynchronous loads, OPFS hydration, retries, and workers.
  • Preserve the actual worker framework for model lookups and embedding reloads.
  • Clear stale worker ownership after successful main-thread loads, including retries.
  • Add regression coverage for backend fallback, embedding reloads, ownership transitions, and failed loads.

Verification

  • 310 tests passed across 60 Web test files.
  • Full Web workspace typecheck, build, and lint passed, including browser, NodeNext, and Node ESM checks.
  • TypeScript protobuf regeneration produced no tracked changes.
  • git diff --check passed.
  • All 23 GitHub checks passed, including swift-spm.