Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
95 commits
Select commit Hold shift + click to select a range
aca94c4
test(transcription): send OpenAI diarization no part over 1400 s
chhoumann Nov 13, 2026
217b040
fix(transcription): cap OpenAI diarization chunks at 1400 s
chhoumann Nov 13, 2026
61c8c52
test(transcription): send a rejected OpenAI request once
chhoumann Nov 13, 2026
44947b5
fix(transcription): send a rejected OpenAI request once
chhoumann Nov 13, 2026
a9a3b07
fix(transcription): keep OpenAI diarization requests inside the timeout
chhoumann Nov 13, 2026
6958e09
test(credentials): pin key handling a credentials table will derive
chhoumann Nov 13, 2026
ff81dbd
refactor(credentials): derive API key handling from one table
chhoumann Nov 13, 2026
f128d4c
refactor(transcription): keep the speaker label format in the renderer
chhoumann Nov 13, 2026
6887b5a
feat(transcription): add one engine for transcription providers
chhoumann Nov 13, 2026
42b55a3
feat(transcription): transcribe through the engine with current models
chhoumann Nov 13, 2026
2f9cd67
test(verify): answer OpenAI and Deepgram as the engine reads them
chhoumann Nov 13, 2026
989185f
test(e2e): read the abort rejection through waitForLifecycle
chhoumann Nov 13, 2026
7d46678
fix(transcription): stop sooner after an abort or a long Retry-After
chhoumann Nov 13, 2026
d34a410
Merge remote-tracking branch 'origin/refactor/credentials-table' into…
chhoumann Nov 13, 2026
fcb830e
refactor(transcription): name providers from the credentials table
chhoumann Nov 13, 2026
f79a09a
feat(transcription): choose the provider and model in settings
chhoumann Nov 13, 2026
e1e9b29
feat(transcription): add ElevenLabs Scribe v3 and make it the default
chhoumann Nov 13, 2026
0b796cf
test(e2e): transcribe through the provider the settings choose
chhoumann Nov 13, 2026
b31e544
test(verify): answer ElevenLabs as the engine reads it
chhoumann Nov 13, 2026
8cae654
refactor(settings): read the provider and speaker labels through the …
chhoumann Nov 13, 2026
77201f7
test(settings): find the Transcripts rows by role and name
chhoumann Nov 13, 2026
19a96c5
build(size): raise the gzip budget by the 866 bytes the provider sett…
chhoumann Nov 13, 2026
4c09afa
fix(settings): export Deepgram to 2.24.0 importers only for a Deepgra…
chhoumann Nov 14, 2026
1eef3e6
fix(settings): let speaker labels be turned off for a model without them
chhoumann Nov 14, 2026
ccc2439
test(transcription): name a provider no PodNotes plans as the unknown…
chhoumann Nov 14, 2026
4b18cee
feat(transcription): transcribe with OpenRouter
chhoumann Nov 14, 2026
cb3b63d
feat(transcription): say when speaker labels are missing or restart a…
chhoumann Nov 14, 2026
d9886c9
feat(transcription): offer only the OpenRouter models its catalog sti…
chhoumann Nov 14, 2026
bfe28e5
test(e2e): transcribe through OpenRouter's Scribe v2 and Grok STT 2.0
chhoumann Nov 14, 2026
9764051
test(verify): answer OpenRouter and its model catalog as the engine r…
chhoumann Nov 14, 2026
a844ca7
build(size): raise the gzip budget by the 1,296 bytes OpenRouter meas…
chhoumann Nov 14, 2026
c46f215
fix(transcription): time words in a later part to the millisecond
chhoumann Nov 14, 2026
23a4d86
fix(transcription): ask OpenRouter for word times and upload when it …
chhoumann Nov 14, 2026
4b94a94
test(transcription): number each voice once across the parts of an ep…
chhoumann Nov 14, 2026
cefa1fe
feat(transcription): one speaker label per voice across the parts of …
chhoumann Nov 14, 2026
8b82f9a
build(size): raise the gzip budget by the 808 bytes the speaker reel …
chhoumann Nov 14, 2026
5eebf37
test(verify): hear Grok's MP3 uploads, so the speaker reel answers as…
chhoumann Nov 14, 2026
3cbd5d1
fix(transcription): name the model that does not label speakers
chhoumann Nov 14, 2026
df8361b
test(transcription): Voxtral Mini Transcribe 3 and Qwen3 ASR on OpenR…
chhoumann Nov 14, 2026
7e62c77
feat(transcription): offer Voxtral Mini Transcribe 3 and Qwen3 ASR on…
chhoumann Nov 14, 2026
0b032d8
test(e2e): Voxtral Mini Transcribe 3 and Qwen3 ASR upload as multipar…
chhoumann Nov 14, 2026
41089b7
build(size): raise the gzip budget by the 211 bytes Voxtral and Qwen3…
chhoumann Nov 14, 2026
979f2bb
test(verify): answer Voxtral Mini Transcribe 3 and Qwen3 ASR as they …
chhoumann Nov 14, 2026
8842b6c
fix(transcription): punctuate Qwen3 ASR words from its text
chhoumann Nov 14, 2026
92b5a19
build(size): raise the gzip budget by the 100 bytes Qwen3 ASR punctua…
chhoumann Nov 14, 2026
df5ea09
fix(transcription): cut MP3 parts without a one-frame tail or an unco…
chhoumann Nov 14, 2026
e76e4cc
fix(transcription): credit a reel clip only to the speakers heard in it
chhoumann Nov 14, 2026
0531b3c
fix(transcription): say labels restart while any part label is unmatched
chhoumann Nov 14, 2026
3a14c53
fix(transcription): drop the summed-seconds cap that split off one-fr…
chhoumann Nov 14, 2026
27d8958
fix(transcription): split MP3 parts equally even when the size cap binds
chhoumann Nov 14, 2026
da3baf9
fix(transcription): fill MP3 parts up to the size cap before adding one
chhoumann Nov 14, 2026
25470c3
fix(transcription): cut MP3 parts as few as fit, moving cuts either way
chhoumann Nov 14, 2026
520f2dd
fix(transcription): sum each MP3 frame's duration when cutting parts
chhoumann Nov 14, 2026
aea5d1a
fix(transcription): skip ID3v2 tags before, between and after MP3 frames
chhoumann Nov 14, 2026
7370a71
Merge remote-tracking branch 'origin/master' into feat/transcription-…
chhoumann Nov 14, 2026
d544390
fix(transcription): split long audio in other formats under the lengt…
chhoumann Nov 14, 2026
cc142ba
build(size): raise the gzip budget by the 118 bytes the length check …
chhoumann Nov 14, 2026
a8c8417
fix(transcription): upload episodes whose address is a signed URL
chhoumann Nov 14, 2026
7b64684
build(size): set the gzip budget to the 104,235 bytes the engine fixe…
chhoumann Nov 14, 2026
1f0b4c2
fix(transcription): upload episodes signed with an Akamai hdnea token
chhoumann Nov 14, 2026
37fdc08
build(size): set the gzip budget to the 104,238 bytes the engine fixe…
chhoumann Nov 14, 2026
79addc3
fix(transcription): stop waiting for audio metadata after 5 s or on u…
chhoumann Nov 14, 2026
3641fb8
build(size): set the gzip budget to the 104,290 bytes the engine fixe…
chhoumann Nov 14, 2026
73b5460
Merge commit '3641fb8b5aae2158b4c7250bdba5de92c6ac3fa5' into feat/tra…
chhoumann Nov 16, 2026
c6adf83
Merge remote-tracking branch 'origin/master' into feat/transcription-…
chhoumann Nov 16, 2026
53546f4
Merge commit 'c6adf836d8f442f32e31f366b09cd0e674e39718' into feat/tra…
chhoumann Nov 16, 2026
f60f448
Merge remote-tracking branch 'origin/master' into feat/transcription-…
chhoumann Nov 16, 2026
34d90f9
fix(transcription): upload an episode longer than the model takes by …
chhoumann Nov 16, 2026
df7e41c
build(size): set the gzip budget to the 106,562 bytes OpenRouter meas…
chhoumann Nov 16, 2026
b413df6
Merge commit 'df7e41c3bf760072c67851db05d575ce3327c3ae' into feat/tra…
chhoumann Nov 16, 2026
2ec86af
Merge remote-tracking branch 'origin/master' into feat/transcription-…
chhoumann Nov 16, 2026
c89708f
fix(transcription): end a speaker's turn at a pause over 2 s
chhoumann Nov 16, 2026
f597f71
build(size): set the gzip budget to the 107,399 bytes the speaker ree…
chhoumann Nov 16, 2026
5958579
Merge branch 'master' into feat/transcription-speaker-merge
chhoumann Nov 16, 2026
ddf52a8
Merge commit '5958579feddffeac2dc8f0c7cb29561e12c6f421' into feat/tra…
chhoumann Nov 16, 2026
113a9fe
Merge remote-tracking branch 'origin/master' into feat/transcription-…
chhoumann Nov 16, 2026
4814cc7
fix(transcription): find Qwen3 ASR's punctuation again after words di…
chhoumann Nov 16, 2026
ac0991e
build(size): set the budgets to the 330,011 raw and 107,829 gzip byte…
chhoumann Nov 16, 2026
221a751
fix(transcription): match Qwen3 ASR's words to its text letter by letter
chhoumann Nov 16, 2026
213f66e
build(size): set the budgets to the 330,198 raw and 107,901 gzip byte…
chhoumann Nov 16, 2026
936b948
fix(transcription): keep Qwen3 ASR's words as they are when adding pu…
chhoumann Nov 16, 2026
57f8ca6
build(size): set the budgets to the 330,265 raw and 107,973 gzip byte…
chhoumann Nov 16, 2026
128e3d2
fix(transcription): match Qwen3 ASR's words inside single quotes
chhoumann Nov 16, 2026
f5b57d3
fix(transcription): add no punctuation a Qwen3 ASR word already has
chhoumann Nov 16, 2026
5338662
fix(transcription): give Qwen3 ASR's words Chinese marks and dashes, …
chhoumann Nov 16, 2026
84beb09
fix(transcription): restore no punctuation to an answer that already …
chhoumann Nov 16, 2026
328fa27
fix(transcription): place Qwen3 ASR's Chinese and Japanese marks insi…
chhoumann Nov 16, 2026
d8099b5
fix(transcription): keep a run of CJK marks on one token
chhoumann Nov 16, 2026
c2b1c7c
fix(transcription): add marks only where a word ends in a letter or d…
chhoumann Nov 16, 2026
360cccb
fix(transcription): add marks only to plain words
chhoumann Nov 16, 2026
dea6eba
fix(transcription): restore punctuation after numbers, amounts and times
chhoumann Nov 16, 2026
474c515
fix(transcription): restore nothing when any word has a mark at eithe…
chhoumann Nov 16, 2026
648738c
fix(transcription): restore punctuation only when no word has any
chhoumann Nov 16, 2026
c245255
fix(transcription): count .,:/ as part of a plain word only between d…
chhoumann Nov 16, 2026
c69d365
fix(transcription): count combining marks as part of a plain word
chhoumann Nov 16, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .claude/skills/verify/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,8 @@ its profile. It keeps the vault and `.obsidian-e2e-artifacts/`. Delete
provider while it watches. It decodes Grok's MP3 uploads with Chromium's
decoder and hears a tone under 500 Hz as one speaker and a higher tone as
another, and logs each upload's `decodedSeconds` and `heardSpeakers`. Audio
it cannot decode is answered with a 400.
it cannot decode is answered with a 400. It answers Voxtral with segments, or
a 400 when asked for word times, and Qwen3 ASR with words and no speakers.

- `.claude/skills/verify/ui.mjs` sends trusted input through
`obsidian dev:cdp`. Its verbs are `click <css> [--text <s>] [--right]`,
Expand Down
7 changes: 4 additions & 3 deletions .claude/skills/verify/features/transcripts.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ from `Transcript template`, and opens.
- `transcript-settings` shows `Transcription provider`, the chosen provider's API key row alone, `Model`, `Speaker labels` and, while those are on, `Speaker label format`. `Speaker labels` is disabled for a model without them.
- `transcript-elevenlabs` writes timestamped paragraphs with numbered speakers from one `scribe_v3` request. ElevenLabs gets the address of an episode a saved public feed lists, and the audio itself for a private feed's episode, a local file, and an address that carries a credential or is not public.
- `transcript-deepgram` does the same with `nova-3`.
- `transcript-openrouter` offers `Grok STT 2.0` (recommended), `ElevenLabs Scribe v2` and `MAI-Transcribe 2`, filtered by OpenRouter's public model catalog. Grok gets uploads as base64 JSON routed to xAI, Scribe v2 the address of a public episode, and an upload goes in parts of at most 18 MB and 1,800 s.
- `transcript-openrouter` offers `Grok STT 2.0` (recommended), `ElevenLabs Scribe v2`, `MAI-Transcribe 2`, `Voxtral Mini Transcribe 3` and `Qwen3 ASR 1.7B`, filtered by OpenRouter's public model catalog. Grok gets uploads as base64 JSON routed to xAI, Scribe v2 the address of a public episode, and an upload goes in parts of at most 18 MB and 1,800 s, or 12 MB and 900 s for Voxtral and Qwen3 ASR, which label no speakers.
- `transcript-openai` sends OpenAI the audio as `gpt-transcribe` uploads of at most 24 MB and 2,070 s, one at a time, and writes paragraphs without timestamps or speaker labels.
- `transcript-existing` refuses a second run while the note exists.

Expand All @@ -39,7 +39,7 @@ Preconditions:

- **Published.** Play `VTT Episode` ([player.md](./player.md)), then run `UI key Ctrl+p`, `UI type .prompt-input 'Transcribe current episode'` and `UI key Enter`. The exact command is the first suggestion; `--text 'Transcribe current episode'` matches both transcribe commands. The notices read `Queued "VTT Episode" for transcription. It will start automatically.` and, in the progress notice headed `Transcription: VTT Episode (00:00:00):`, `Saved the transcript the feed publishes.` `transcripts/PodNotes Transcripts/VTT Episode.md` opens. Its body starts `[00:00:00](obsidian://podnotes?episodeName=VTT%20Episode&url=...&time=0.48) From Potsdam in Brandenburg, Germany,`. `$NET log` lists `GET .../t/podnews.vtt` and nothing at `api.elevenlabs.io`, `api.deepgram.com` or `api.openai.com`. `node .claude/skills/verify/fixtures.mjs requests` has `/t/podnews.vtt`, not `/t/buzzcast.html`. Repeat with `SRT Episode` and `JSON Episode`.
- **Seek.** Switch to Reading view and click a timestamp. `api.currentTime` lands on its time.
- **Settings.** Open Settings > PodNotes. Under `Transcripts` a new vault shows `Transcription provider` on `ElevenLabs`, `ElevenLabs API key`, `Model` on `Recommended (Scribe v3)`, `Speaker labels` on, `Speaker label format`, then the path and template. Choosing `Deepgram`, `OpenRouter` or `OpenAI` swaps the key row for that provider's and the model list for its models. On `OpenRouter` the `Model` row offers `Recommended (Grok STT 2.0)`, `Grok STT 2.0`, `ElevenLabs Scribe v2` and `MAI-Transcribe 2`, and `$NET log` shows one `GET https://openrouter.ai/api/v1/models` with no `Authorization`. A model the catalog dates reads `<label>, ends <date>`, and a chosen model it no longer lists reads `<label>, no longer offered`. On `OpenAI` the `Speaker labels` row is disabled and reads `GPT Transcribe does not label speakers.`
- **Settings.** Open Settings > PodNotes. Under `Transcripts` a new vault shows `Transcription provider` on `ElevenLabs`, `ElevenLabs API key`, `Model` on `Recommended (Scribe v3)`, `Speaker labels` on, `Speaker label format`, then the path and template. Choosing `Deepgram`, `OpenRouter` or `OpenAI` swaps the key row for that provider's and the model list for its models. On `OpenRouter` the `Model` row offers `Recommended (Grok STT 2.0)`, `Grok STT 2.0`, `ElevenLabs Scribe v2`, `MAI-Transcribe 2`, `Voxtral Mini Transcribe 3` and `Qwen3 ASR 1.7B`, and `$NET log` shows one `GET https://openrouter.ai/api/v1/models` with no `Authorization`. A model the catalog dates reads `<label>, ends <date>`, and a chosen model it no longer lists reads `<label>, no longer offered`. On `OpenAI` the `Speaker labels` row is disabled and reads `GPT Transcribe does not label speakers.`
- **No published transcript.** Play `Untranscribed Episode` and run the command with no key. The notice is `Select or create an ElevenLabs API key in the transcript settings on this device.` and no note appears.
- **ElevenLabs.** With the fake ElevenLabs key, the fixture provider answers with two speakers, the second 12 s in, so the note reads `[00:00:00](...) **1:** This text came from the fixture provider.` and `[00:00:12](...) **2:** A second speaker answers.`
- Public. Play `Fixture Episode 1` of `PodNotes Fixture` and run the audio command. `$NET log` shows one `POST https://api.elevenlabs.io/v1/speech-to-text` with a `multipart/form-data` `contentType`, under 1,000 `uploadBytes` and the episode's address as `sourceUrl`, and no request for `/episode-1.wav` after the command.
Expand All @@ -55,9 +55,10 @@ Preconditions:
- Scribe v2, public. Choose `ElevenLabs Scribe v2`, play `Fixture Episode 1` of `PodNotes Fixture` and run the audio command. `$NET log` shows the catalog `GET`, then one `POST https://openrouter.ai/api/v1/audio/transcriptions` with `contentType` `application/json`, under 1,000 `uploadBytes` and the episode's address as `sourceUrl`, and no request for `/episode-1.wav` after the command.
- Grok STT 2.0. On `Recommended (Grok STT 2.0)`, play `Fixtures/Local Fixture.wav` and run the audio command. The `POST` is `application/json` with about 4/3 of the file's bytes, its audio in base64, and no `sourceUrl`.
- In parts. Write a 70 min MP3 of two voices, a 300 Hz tone and a 700 Hz tone that take turns every 45 s: `ffmpeg -f lavfi -i "aevalsrc='0.5*sin(2*PI*if(lt(mod(t\,90)\,45)\,300\,700)*t)':s=8000:d=4200" -ac 1 -ar 8000 -b:a 8k "$VAULT/Fixtures/Two Voices.mp3"`. Play it and run the audio command on Grok. `$NET log` shows three `POST https://openrouter.ai/api/v1/audio/transcriptions` entries of about 1.9 MB each, one after the other, then the speaker reel, one of about 82 KB whose `decodedSeconds` is `61.56`: six 9 s clips with 1.5 s of silence between two. The fixture numbers the voices in the order they sound in each request, so the second part, which starts with the high tone, numbers them the other way. The note still numbers the low voice `1` and the high voice `2` throughout, the paragraph at `00:23:15` runs on across the first part boundary, and the progress notice ends with `Transcription completed and saved.` With `ElevenLabs Scribe v2` the parts go as multipart, no reel follows, each part's fixed answer numbers two more speakers, and the notice ends with `OpenRouter transcribed this episode in 3 parts, and speaker labels restart in each, so one person can have several labels.`
- Voxtral Mini Transcribe 3 and Qwen3 ASR 1.7B. With `Speaker labels` on, choose each in `Model`. The `Speaker labels` row reads `<model> does not label speakers.` Play `Two Voices.mp3` and run the audio command. `$NET log` shows five `multipart/form-data` `POST https://openrouter.ai/api/v1/audio/transcriptions` entries of about 840 KB, one after the other, and no reel. Qwen3 ASR's are about 98 bytes larger, its `timestamp_granularities[]` field. The fixture answers Voxtral with segments, and with a 400 if it asks for word times. The note has `[00:00:00](...) This text came from the fixture provider.` and `[00:00:12](...) A second speaker answers.` for each part, at `00:14:00`, `00:28:00`, `00:42:00` and `00:56:00` with links to `time=840.096` and on, with no `**1:**`. The progress notice ends with `Saved without speaker labels, because <model> does not label speakers. These providers do: ElevenLabs, Deepgram, OpenRouter.`
- **OpenAI.** Choose `OpenAI` with its fake key. `Untranscribed Episode` downloads its WAV and `$NET log` shows a `POST https://api.openai.com/v1/audio/transcriptions` answered by the fixture provider. The note holds the fixture text with no timestamps.
- In parts. Write an MP3 longer than 2,070 s into the vault, for example 70 min in 4 MB: `ffmpeg -f lavfi -i sine=frequency=440:duration=4200 -ac 1 -ar 8000 -b:a 8k "$VAULT/Fixtures/Long Fixture.mp3"`. Play it ([local-files.md](./local-files.md)) and run the audio command. `$NET log` shows three `POST https://api.openai.com/v1/audio/transcriptions` entries of about 1.4 MB each, one after the other, and the note holds the fixture text three times with no timestamps.
- Speaker labels. With `Speaker labels` on, as in a library that labelled speakers with OpenAI on 2.24.0, the progress notice ends with `Saved without speaker labels, because OpenAI does not label speakers. These providers do: ElevenLabs, Deepgram, OpenRouter.` and stays until clicked.
- Speaker labels. With `Speaker labels` on, as in a library that labelled speakers with OpenAI on 2.24.0, the progress notice ends with `Saved without speaker labels, because GPT Transcribe does not label speakers. These providers do: ElevenLabs, Deepgram, OpenRouter.` and stays until clicked.
- **A 2.24.0 library.** Write a 2.24.0 `data.json` state into the vault (`transcript.diarization` with `enabled` and `provider`, no `transcript.provider`), run `CLI --reload`, and read `app.plugins.plugins.podnotes.settings.transcript.provider`: `deepgram` for speaker labels with Deepgram, `openai` for speaker labels with OpenAI or a linked OpenAI key, `elevenlabs` otherwise. `data.json` is unchanged until the next save, which adds `transcript.provider`, `transcript.model`, `elevenLabsSecretId` and `openRouterSecretId` and leaves `transcript.diarization.provider` as it was.
- **Proof.** Screenshot the opened note (`npm run capture:e2e-obsidian -- screenshot .obsidian-e2e-artifacts/transcripts/note.png`), keep the note text, `$NET log` and `fixtures.mjs requests` for every run, and read `data.json` to show no new field.

Expand Down
21 changes: 18 additions & 3 deletions .claude/skills/verify/net.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@ const OPENROUTER_MODELS = [
"x-ai/grok-stt-2.0",
"elevenlabs/scribe-v2",
"microsoft/mai-transcribe-2",
"mistralai/voxtral-mini-transcribe-3-0",
"qwen/qwen3-asr-1.7b",
];

/** @param {string} code */
Expand Down Expand Up @@ -109,12 +111,24 @@ const WATCH = `(() => {
// OpenRouter's verbose_json words, at the same times, with numbered speakers.
const openRouterWords = (sentence, speaker, from) => words(sentence, speaker, from).map(({ punctuated_word, start, end }) => ({ word: punctuated_word, start, end, speaker, speaker_label: "speaker_" + speaker, confidence: 0.99 }));
const openrouter = { text: text + " " + reply, words: [...openRouterWords(text, 0, 0), ...openRouterWords(reply, 1, 12)] };
// Voxtral times segments and refuses word times; Qwen3 ASR times words and labels no speaker.
const plainOpenRouter = {
"mistralai/voxtral-mini-transcribe-3-0": (form) =>
form.has("timestamp_granularities[]")
? Promise.reject({ status: 400, json: { error: { message: "Provider returned 400", code: 400 } } })
: { text: openrouter.text, segments: [{ id: 0, start: 0, end: 2.7, text: " " + text }, { id: 1, start: 12, end: 13.5, text: " " + reply }] },
"qwen/qwen3-asr-1.7b": () => ({ text: openrouter.text, words: openrouter.words.map(({ word, start, end }) => ({ word, start, end })) }),
};
const openrouterCatalog = { data: ${jsLiteral(OPENROUTER_MODELS)}.map((id) => ({ id, expiration_date: null })) };
// Grok's MP3 uploads are heard as a diarizing model hears them: a tone under 500 Hz is one
// voice and a higher one another, labeled in the order they first sound in the request, with
// a word for each turn. Other OpenRouter requests get the fixed answer.
// a word for each turn. Voxtral and Qwen3 ASR answer as above, and other OpenRouter requests
// get the fixed answer.
const hearOpenRouter = async (request, entry) => {
if (request.contentType !== "application/json") return openrouter;
if (request.contentType !== "application/json") {
const form = await new Response(request.body, { headers: { "content-type": request.contentType } }).formData();
return plainOpenRouter[form.get("model")]?.(form) ?? openrouter;
}
const audio = JSON.parse(new TextDecoder().decode(request.body)).input_audio ?? {};
if (audio.format !== "mp3" || !audio.data) return openrouter;
const bytes = Uint8Array.from(atob(audio.data), (char) => char.charCodeAt(0));
Expand Down Expand Up @@ -182,7 +196,8 @@ const WATCH = `(() => {
entries.push(Object.assign(entry, { answeredBy: "fixture provider", contentType: request.contentType, uploadBytes: request.body?.byteLength ?? 0, sourceUrl: namedAddress(request) }));
// Audio the decoder refuses is answered as OpenRouter answers audio it cannot read.
Promise.resolve(answer)
.then((json) => ({ status: 200, json }), () => {
.then((json) => ({ status: 200, json }), (refused) => {
if (refused?.status) return refused;
entry.decodedSeconds = "undecodable";
return { status: 400, json: { error: { message: "Invalid audio file", code: 400 } } };
})
Expand Down
2 changes: 1 addition & 1 deletion AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ svelte-check's native API path passes when a tsconfig matches no files, which
`check:a11y` in temporary workspaces and requires it to fail on that case and
when the native compiler cannot start.

After `npm run build`, `npm run size` enforces 330,000 raw bytes and 107,399 gzip bytes at level 9 for root `main.js` in the Test workflow's Build and sizes worker. `npm run size:data` reports a synthetic v2 stress library with 50 feeds, 2,000 history entries, and 200 saved episodes from frozen NPR metadata, including duplicated snapshots. Its 1.5 MB document goal is advisory. Pass an additive candidate JSON path to report optional-field overhead without changing existing data. In the isolated Obsidian instance, `npm run count:writes -- start`, `report`, and `stop` record writes to PodNotes' exact `data.json` path. Stop the recorder before stopping the instance, because recorder commands start a stopped instance; plugin reloads invalidate its counts.
After `npm run build`, `npm run size` enforces 330,546 raw bytes and 108,180 gzip bytes at level 9 for root `main.js` in the Test workflow's Build and sizes worker. `npm run size:data` reports a synthetic v2 stress library with 50 feeds, 2,000 history entries, and 200 saved episodes from frozen NPR metadata, including duplicated snapshots. Its 1.5 MB document goal is advisory. Pass an additive candidate JSON path to report optional-field overhead without changing existing data. In the isolated Obsidian instance, `npm run count:writes -- start`, `report`, and `stop` record writes to PodNotes' exact `data.json` path. Stop the recorder before stopping the instance, because recorder commands start a stopped instance; plugin reloads invalidate its counts.

Before opening a PR or cutting a release, run the CI-equivalent checks locally:

Expand Down
12 changes: 11 additions & 1 deletion scripts/size-baseline.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ main.js raw: 307131 bytes; budget 330000 bytes; 22869 bytes remaining
main.js gzip (level 9): 97161 bytes; budget 100000 bytes; 2839 bytes remaining
```

The gzip budget is now 107,399 bytes. On 2026-10-14 it rose from 100,000 for
The gzip budget is now 108,180 bytes, and the raw budget 330,546. On 2026-10-14 it rose from 100,000 for
the full player's Transcript panel, which the owner approved at about 1.9 KB
and which measured 2,576 bytes. The coordinator set 103,000 to keep the
panel's Find and Follow chip and to leave room for fixes in flight. The
Expand Down Expand Up @@ -80,6 +80,16 @@ main.js raw: 328677 bytes; budget 330000 bytes; 1323 bytes remaining
main.js gzip (level 9): 107399 bytes; budget 107399 bytes; 0 bytes remaining
```

On 2026-11-16 the gzip budget rose from 107,399 by 781 bytes, and the raw budget
from 330,000 by 546, for Voxtral Mini Transcribe 3 and Qwen3 ASR on OpenRouter,
with Qwen3 ASR's punctuation restored from its text letter by letter, so split
words and stretches of text the words leave out keep it. With them:

```text
main.js raw: 330546 bytes; budget 330546 bytes; 0 bytes remaining
main.js gzip (level 9): 108180 bytes; budget 108180 bytes; 0 bytes remaining
```

Gzip uses Node's `gzipSync` at level 9, without a filename or timestamp.
Budgets use decimal bytes. The brief's 96,533-byte reference is unexplained.
This report fixes the compressor instead of comparing compressed sizes across
Expand Down
4 changes: 2 additions & 2 deletions scripts/size.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ try {
const bundle = readFileSync(path);
if (!bundle.length) throw new Error(`${path} is empty. Run npm run build first.`);
const measurements = [
{ name: "raw", bytes: bundle.length, budget: 330_000 },
{ name: "gzip (level 9)", bytes: gzipSync(bundle, { level: 9 }).length, budget: 107_399 },
{ name: "raw", bytes: bundle.length, budget: 330_546 },
{ name: "gzip (level 9)", bytes: gzipSync(bundle, { level: 9 }).length, budget: 108_180 },
];
const rows = measurements.map(({ name, bytes, budget }) => {
const overage = Math.max(0, bytes - budget);
Expand Down
10 changes: 5 additions & 5 deletions scripts/size.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,19 +20,19 @@ function check(name: string, contents: string | Buffer) {

describe("bundle budget CLI", () => {
it("allows the raw budget boundary and rejects one extra byte", () => {
expect(check("boundary.js", "a".repeat(330_000)).status).toBe(0);
const result = check("over.js", "a".repeat(330_001));
expect(check("boundary.js", "a".repeat(330_546)).status).toBe(0);
const result = check("over.js", "a".repeat(330_547));
expect(result.status).toBe(1);
expect(result.stdout).toContain("budget 330000 bytes; OVER by 1 bytes");
expect(result.stdout).toContain("budget 330546 bytes; OVER by 1 bytes");
});

it("rejects gzip growth even when raw bytes fit", () => {
const result = check("gzip.js", randomBytes(110_000));
expect(result.status).toBe(1);
expect(result.stdout).toMatch(
/gzip \(level 9\): \d+ bytes; budget 107399 bytes; OVER by \d+ bytes/,
/gzip \(level 9\): \d+ bytes; budget 108180 bytes; OVER by \d+ bytes/,
);
expect(result.stdout).toContain("budget 330000 bytes; 220000 bytes remaining");
expect(result.stdout).toContain("budget 330546 bytes; 220546 bytes remaining");
});

it("fails on absent or empty artifacts instead of reporting a small build", () => {
Expand Down
Loading
Loading