Repository navigation
feat(server): checksum-verified downloads + pinned whisper runtime/model manifest (WSP-1) - #381
Merged
Merged
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Local transcription depends on hand-installed whisper-cli/ffmpeg, and the whisper model download has no checksum and no update path (
exists → done). Epic WSP (zero-setup local transcription); board: OB WSP-1.Solution
Foundation layer in
packages/server:ai/download.ts— shared verified streamer: stream to.partwhile hashing, size + SHA-256 checks, fsync, atomic rename; every failure path (HTTP, transport, overrun, short, hash, disk) unlinks the partial and preserves the old destination.ai/runtimeManifest.ts— per-target pins (4 release triples) for whisper-cli + ffmpeg with self-computed SHA-256s from actually-downloaded artifacts, typedunsupportedentries where no trustworthy upstream prebuilt exists,extractDircapturing the Windows companion-DLL requirement, plus the model pin (HF commit-sha URL).ai/pinnedDownload.ts— receipt-based version-aware skip/re-download (crash-safe ordering: unlink receipt → download → rename dest → write receipt); legacy files re-download; failed upgrades keep old bytes usable.Alternative considered: verifying only the model — rejected; the binary manifest is the contract WSP-2 (provisioning) and WSP-6 (own signed builds) build on.
Before / After
exists → done).partcould strand; corrupt file keptTest procedure
pnpm verify— full suite green (server 105 files / 1418 passed; foreground, outside sandbox)pnpm --filter @book.dev/server exec vitest run src/ai/download.test.ts src/ai/runtimeManifest.test.ts src/ai/pinnedDownload.test.ts src/ai/serviceDownload.test.ts— 20 testscurl -fL <pinned url> | shasum -a 256matches the manifest for all 5 artifacts (table in the manifest file).Operational notes
AiStatus/progress shapes unchanged;transcription.downloadUrlnow returns the pinned URL (UI already round-trips it).Verify status: full
pnpm verifygreen at 043faae + focused suites green at 81bbcf8 · Reviews cleared: code (Quinn — CLEAR-with-nits; F1/F2/F4 applied via pre-endorsed fixes @ 81bbcf8; F3/F5/F6 tracked on WSP-2/WSP-6 cards)🤖 Generated with Claude Code