QVAC-21937 fix: harden embed-llamacpp model cache integrity#3196
Conversation
Review StatusCurrent Status: ✅ APPROVED |
- add test/integration/models.manifest.json as the single source of truth for model URLs + integrity; actions/cache-models folds it into the cache key so unrelated test-logic edits no longer churn the key or force a re-save - wire ensureModel to resolve URL/sha256/bytes from the manifest, keeping the MODEL_CONFIGS download url as a fallback; lazy-load the native addon so the download/integrity helpers are usable without a compiled binding - add offline unit tests (test/unit/ensure-model-manifest.test.js) covering manifest resolution, integrity re-download, fallback, and manifest shape - add scripts/pin-model-manifest.mjs to pin sha256/bytes later - run the darwin-arm64 integration leg on qvac-macos26-arm64-gpu Ref: QVAC-21937
Make the integration-test model tooling uniform with diffusion-cpp:
- ensureModel now takes an object ({ modelName, modelDir, manifest, download }),
matching diffusion-cpp/llm-llamacpp; update all callsites
- log the "no sha256/bytes pinned — integrity check SKIPPED" hint pointing at
scripts/generate-model-manifest.mjs, same as diffusion
- rename the pinning script to scripts/generate-model-manifest.mjs (verbatim
diffusion copy) and the unit suite to test/unit/ensure-model-integrity.test.js
- manifest integrity stays null until pinned in CI (HF_TOKEN + network); the
suite tolerates null now and enforces shape once pinned
Ref: QVAC-21937
Co-authored-by: Cursor <cursoragent@cursor.com>
3fd25b2 to
7941d0f
Compare
Mobile integration tests — @qvac/translation-nmtcpp (Android)Result: passed
|
Mobile integration tests — @qvac/transcription-parakeet (iOS)Result: passed
|
Mobile integration tests — @qvac/embed-llamacpp (Android)Result: passed
|
Mobile integration tests — @qvac/diffusion-cpp (Android)Result: passed
|
Mobile integration tests — @qvac/tts-ggml (iOS)Result: passed
|
|
Manual workflow-dispatch validation passed on the final pinned head: https://github.com/tetherto/qvac/actions/runs/29245647708
|
Mobile integration tests — @qvac/llm-llamacpp (iOS)Result: passed
|
Mobile integration tests — @qvac/vla-ggml (Android)Result: passed
|
Mobile integration tests — @qvac/ocr-onnx (Android)Result: passed
|
Mobile integration tests — @qvac/llm-llamacpp (Android)Result: passed
|
Mobile integration tests — @qvac/ocr-onnx (iOS)Result: passed
|
Mobile integration tests — @qvac/tts-ggml (Android)Result: failed
|
|
Could we move |
|
There is still a fail-open path when the model manifest cannot be loaded or does not contain the requested model.
This means a packaging mistake, malformed manifest, or missing entry silently disables the integrity guarantees introduced by this PR. Could the default manifest and every configured integration model entry be required, with a clear error instead of falling back? Any fallback needed by tests could remain explicit and test-only. |
Fail closed when manifest data is unavailable, keep test-only crypto out of production dependencies, and run immutable pre-stage coverage in the unit command. Co-authored-by: Cursor <cursoragent@cursor.com>
This comment has been minimized.
This comment has been minimized.
|
Addressed both follow-up findings on the latest head.
Final workflow-dispatch validation is running here: https://github.com/tetherto/qvac/actions/runs/29272850432 |
Co-authored-by: Cursor <cursoragent@cursor.com>
This comment has been minimized.
This comment has been minimized.
Co-authored-by: Cursor <cursoragent@cursor.com>
This comment has been minimized.
This comment has been minimized.
QVAC E2E —
|
🎯 What problem does this PR solve?
embed-llamacppintegration-model cache deterministic and integrity-checked.Part of QVAC-21937.
📝 How does it solve it?
.ggufartifacts even when Hugging Face responds directly with HTTP 200.🧪 How was it tested?
Final head:
7ed2d24a88c123f24deeba6785dbea1f7d88cddc7ed2d24a8:.ggufURLs can no longer establish trusted pins without canonicalx-linked-etagandx-linked-size;CanonicalMetadataError;config.jsonremain supported..ggufregression passed.npm run test:unit,npm run lint, andgit diff --check.The current-head proof workflow was force-cancelled only after its targeted
ts-checksjob passed, avoiding unrelated duplicate native builds. The final commit changes manifest-pin generation and its regression test, not runtime model loading, so the prior seven-platform integration proof remains applicable.🚦 Review and merge notes