Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
126 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
7d08923
feat(network): let a request reach a private host when the caller asks
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
444938f
feat(transcription): transcribe with any OpenAI-compatible server
chhoumann Nov 14, 2026
325c115
test(e2e): transcribe through an OpenAI-compatible server on this mac…
chhoumann Nov 14, 2026
ed3bfa4
test(verify): serve an OpenAI-compatible transcription route from the…
chhoumann Nov 14, 2026
0140c5f
build(size): raise both budgets by the bytes the OpenAI-compatible pr…
chhoumann Nov 14, 2026
4b04909
Merge branch 'feat/transcription-openrouter-models' into feat/transcr…
chhoumann Nov 14, 2026
c78a331
fix(transcription): read verbose_json one way and fall back to json o…
chhoumann Nov 14, 2026
3fe2dab
build(size): set both budgets to the merged branch's size plus the ke…
chhoumann Nov 14, 2026
8997d44
fix(transcription): join Whisper word pieces back into words
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
710c78c
fix(transcription): find the text's punctuation again after words div…
chhoumann Nov 14, 2026
b961dd4
fix(transcription): keep a server address's query after the transcrip…
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
737b962
Merge commit '113a9fef2e8948797acb3a65e1f170fa723a509f' into feat/tra…
chhoumann Nov 16, 2026
4309bd4
test(tooling): leave out the OpenAI-compatible server's unnamed model
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
5aa6017
Merge commit 'ac0991e551883255d77c880f8058090d4f65adbe' into feat/tra…
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
77edc57
Merge commit '213f66ee' into feat/transcription-openai-compatible
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
e92c4f2
Merge commit '57f8ca64' into feat/transcription-openai-compatible
chhoumann Nov 16, 2026
128e3d2
fix(transcription): match Qwen3 ASR's words inside single quotes
chhoumann Nov 16, 2026
962e07b
Merge commit '128e3d25' into feat/transcription-openai-compatible
chhoumann Nov 16, 2026
f5b57d3
fix(transcription): add no punctuation a Qwen3 ASR word already has
chhoumann Nov 16, 2026
282df7e
Merge commit 'f5b57d3f' into feat/transcription-openai-compatible
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
40b24f5
Merge commit '84beb095' into feat/transcription-openai-compatible
chhoumann Nov 16, 2026
328fa27
fix(transcription): place Qwen3 ASR's Chinese and Japanese marks insi…
chhoumann Nov 16, 2026
ba18820
Merge commit '328fa27c' into feat/transcription-openai-compatible
chhoumann Nov 16, 2026
d8099b5
fix(transcription): keep a run of CJK marks on one token
chhoumann Nov 16, 2026
50e6c58
Merge commit 'd8099b54' into feat/transcription-openai-compatible
chhoumann Nov 16, 2026
c2b1c7c
fix(transcription): add marks only where a word ends in a letter or d…
chhoumann Nov 16, 2026
3998cb1
Merge commit 'c2b1c7c4' into feat/transcription-openai-compatible
chhoumann Nov 16, 2026
360cccb
fix(transcription): add marks only to plain words
chhoumann Nov 16, 2026
4909789
Merge commit '360cccbc' into feat/transcription-openai-compatible
chhoumann Nov 16, 2026
dea6eba
fix(transcription): restore punctuation after numbers, amounts and times
chhoumann Nov 16, 2026
6a11373
Merge commit 'dea6ebab' into feat/transcription-openai-compatible
chhoumann Nov 16, 2026
474c515
fix(transcription): restore nothing when any word has a mark at eithe…
chhoumann Nov 16, 2026
e7d8467
Merge commit '474c515e' into feat/transcription-openai-compatible
chhoumann Nov 16, 2026
648738c
fix(transcription): restore punctuation only when no word has any
chhoumann Nov 16, 2026
c11cd48
Merge commit '648738c6' into feat/transcription-openai-compatible
chhoumann Nov 16, 2026
c245255
fix(transcription): count .,:/ as part of a plain word only between d…
chhoumann Nov 16, 2026
d246f7e
Merge commit 'c2452556' into feat/transcription-openai-compatible
chhoumann Nov 16, 2026
c69d365
fix(transcription): count combining marks as part of a plain word
chhoumann Nov 16, 2026
c4782d4
Merge commit 'c69d365a' into feat/transcription-openai-compatible
chhoumann Nov 16, 2026
2a1bb11
Merge remote-tracking branch 'origin/master' into feat/transcription-…
chhoumann Nov 16, 2026
a5fa68f
fix(transcription): keep Transcribe with your server on while offline
chhoumann Nov 16, 2026
b717d81
fix(transcription): refuse a server address with a password, and keep…
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
10 changes: 9 additions & 1 deletion .claude/skills/verify/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,15 @@ its profile. It keeps the vault and `.obsidian-e2e-artifacts/`. Delete
live in `screens/scenes.mjs`, the instance calls in `screens/instance.mjs`,
and the contact sheet in `screens/sheet.mjs`.
- `.claude/skills/verify/fixtures.mjs` runs as `feed`, `feed-b`, `transcripts`,
`private`, `library`, `retitle`, `requests`, `audio [vault path]` or `stop`.
`private`, `library`, `retitle`, `requests`, `server`, `transcriptions`,
`audio [vault path]` or `stop`. `server` prints the address of an
OpenAI-compatible transcription server on the same port, for the
"OpenAI-compatible server" provider's Server address. It answers
`POST /v1/audio/transcriptions` with verbose_json words, two sentences 12 s
apart, whatever the audio, and json's text when asked for json. The model
`json-only` refuses verbose_json with a 400, as OpenAI's gpt-transcribe does.
`transcriptions` prints each request it answered: its Authorization header,
model, response format, timestamp granularities, file type and size.
`private` prints a feed at `priv3.supercast.com`, an address PodNotes keeps in
SecretStorage as it does a Supercast subscriber's. `library`
prints the URL of a manifest of eight podcasts, one whose feed answers 404, and
Expand Down
9 changes: 7 additions & 2 deletions .claude/skills/verify/features/transcripts.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ from `Transcript template`, and opens.
- `transcript-deepgram` does the same with `nova-3`.
- `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-openai-compatible` sends the audio to the address under `Server address`, with the model typed under `Model` and the key only when one is selected. It asks for verbose_json with word and segment times, and once the server refuses that, asks for json for that part and every later one. It writes timed paragraphs from words, punctuated from the answer's text when the words carry none, or from segments, and untimed ones from text. A server on this machine or a private network is reached.
- `transcript-existing` refuses a second run while the note exists.

## How to get to it (user POV)
Expand Down Expand Up @@ -59,7 +60,11 @@ Preconditions:
- **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 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.
- **OpenAI-compatible server.** `SERVER=$(node .claude/skills/verify/fixtures.mjs server)` prints `http://podnotes.test:<port>/v1`, a transcription route on the fixture server, which the instance reaches at 127.0.0.1 over the real network. `net.mjs` does not answer it. Choose `OpenAI-compatible server`: the rows read `Transcription provider`, `Server address`, `OpenAI-compatible server API key`, `Model` as a text field, then the shared rows, and `Speaker labels` reads `OpenAI-compatible server does not label speakers.` Fill `input[name="Server address"]` with `$SERVER` and `input[name="Model"]` with any model ID. An address without `http://` or `https://` shows `The address must start with http:// or https://.` under the field.
- Local file. Play an MP3 in the vault and run the audio command with no key. The note has `[00:00:00]` `This text came from the fixture server.` and `[00:00:12]` `A second sentence starts twelve seconds in.`, and `fixtures.mjs transcriptions` shows one request with `authorization` null, the model, `verbose_json`, `["word","segment"]` and the file's type and size.
- json only. With the model `json-only`, `fixtures.mjs transcriptions` shows a `verbose_json` request, then a `json` one with no granularities, and the note holds the text without timestamps. For an MP3 over 24 MB, which goes in two parts, such as `ffmpeg -f lavfi -i sine=frequency=440:duration=1900 -ac 1 -b:a 128k "$VAULT/Fixtures/Big Fixture.mp3"`, the requests read `verbose_json`, `json`, `json`, and the second `json` carries the other part's bytes.
- Refusals. An empty `Model` gives `Enter a model for your OpenAI-compatible server in the transcript settings.` and an empty or non-http(s) address `Enter the address of your OpenAI-compatible server, starting with http:// or https://, in the transcript settings.`, with no request. A port nothing listens on gives `Transcription failed: PodNotes could not reach the server at podnotes.test:<port>. Check the address in the transcript settings.` after three sends.
- **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`, `transcript.serverUrl`, `elevenLabsSecretId`, `openRouterSecretId` and `openAICompatibleSecretId` 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.

## Gotchas
Expand All @@ -68,7 +73,7 @@ Preconditions:
- To test the feed cache across a restart, reload inside Obsidian (`CLI --reload`, or `app:reload`). `npm run stop:e2e-obsidian` deletes the profile, and the cache with it.

- `net.mjs` sees `window.fetch` and `requestUrl`. The player streams audio through the media element, which only `fixtures.mjs requests` shows.
- A secret id must be `podnotes-<provider>-api-key` or `podnotes-<provider>-api-key-<n>`, where the provider is `elevenlabs`, `deepgram`, `openrouter` or `openai`. Any other id reads as missing on this device.
- A secret id must be `podnotes-<provider>-api-key` or `podnotes-<provider>-api-key-<n>`, where the provider is `elevenlabs`, `deepgram`, `openrouter`, `openai` or `openai-compatible`. Any other id reads as missing on this device.
- The progress notice hides about 5 s after a transcript is saved. A failure, or a transcript saved with a warning, stays until clicked. Notices also cover the PodNotes view's head and the full player's collapse button, and `ui.mjs` refuses a covered click, so dismiss them first.
- After editing `fixtures.mjs`, run `fixtures.mjs stop` before `fixtures.mjs transcripts`. A running server keeps serving the old routes.
- Every fixture transcript cue falls inside the 60 s WAV, so its links seek within the audio.
105 changes: 104 additions & 1 deletion .claude/skills/verify/fixtures.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,11 @@
// episode whose media answers 404
// node .claude/skills/verify/fixtures.mjs retitle rename the first feed's episodes, keeping their GUIDs, until the server stops
// node .claude/skills/verify/fixtures.mjs requests print the paths the server has answered, oldest first
// node .claude/skills/verify/fixtures.mjs server same server, print the address of its OpenAI-compatible
// transcription route, which answers verbose_json. The model
// "json-only" refuses verbose_json with a 400, as
// gpt-transcribe does, and answers json
// node .claude/skills/verify/fixtures.mjs transcriptions print each request the transcription route answered, as JSON
// node .claude/skills/verify/fixtures.mjs audio [path] write a 60 s WAV into this worktree's vault
// (default path: "Fixtures/Local Fixture.wav")
// node .claude/skills/verify/fixtures.mjs stop stop the feed server
Expand All @@ -41,6 +46,13 @@ const transcriptsUrl = `${base}/transcripts.xml`;
const PRIVATE_ROUTE = "/feeds/verify-subscriber-token/feed.xml";
const privateUrl = `http://${SUPERCAST_FIXTURE_HOST}:${port}${PRIVATE_ROUTE}`;
const libraryUrl = `${base}/library.json`;
const serverUrl = `${base}/v1`;
const TRANSCRIPTIONS_ROUTE = "/v1/audio/transcriptions";
const JSON_ONLY_MODEL = "json-only";
const SPOKEN = [
"This text came from the fixture server.",
"A second sentence starts twelve seconds in.",
];
const local = `http://127.0.0.1:${port}`;
const FEED_TITLE = "PodNotes Fixture";
const FEED_B_TITLE = "PodNotes Fixture B";
Expand Down Expand Up @@ -538,6 +550,75 @@ function libraryManifest() {
};
}

/**
* Answers the OpenAI-compatible transcription route as a Whisper server does: verbose_json
* with a word every 0.4 s and the second sentence 12 s in, or json's text.
* @param {http.IncomingMessage} request @param {http.ServerResponse} response
* @param {object[]} transcriptions
*/
async function answerTranscription(request, response, transcriptions) {
/** @type {Buffer[]} */
const chunks = [];
for await (const chunk of request) chunks.push(chunk);
const form = await new Request(local, {
method: "POST",
headers: { "content-type": request.headers["content-type"] ?? "" },
body: Buffer.concat(chunks),
}).formData();
const file = form.get("file");
const model = form.get("model");
const format = form.get("response_format");
transcriptions.push({
authorization: request.headers.authorization ?? null,
model,
responseFormat: format,
timestampGranularities: form.getAll("timestamp_granularities[]"),
fileType: file instanceof Blob ? file.type : null,
fileBytes: file instanceof Blob ? file.size : 0,
});
/** @param {number} status @param {unknown} body */
const answer = (status, body) =>
response
.writeHead(status, { "Content-Type": "application/json" })
.end(JSON.stringify(body));
if (model === JSON_ONLY_MODEL && format === "verbose_json") {
answer(400, {
error: {
message: `response_format 'verbose_json' is not compatible with model '${JSON_ONLY_MODEL}'. Use 'json' or 'text' instead.`,
type: "invalid_request_error",
param: "response_format",
code: "unsupported_value",
},
});
return;
}
const text = SPOKEN.join(" ");
if (format !== "verbose_json") {
answer(200, { text });
return;
}
const timed = SPOKEN.map((sentence, index) =>
sentence.split(" ").map((word, at) => ({
word,
start: index * 12 + at * 0.4,
end: index * 12 + at * 0.4 + 0.3,
})),
);
answer(200, {
task: "transcribe",
language: "english",
duration: 15,
text,
words: timed.flat(),
segments: timed.map((words, id) => ({
id,
start: words[0].start,
end: words[words.length - 1].end,
text: ` ${SPOKEN[id]}`,
})),
});
}

function serve() {
const audio = wav();
/** @type {Record<string, [string, Buffer | Stream]>} */
Expand Down Expand Up @@ -614,6 +695,8 @@ function serve() {
}
/** @type {string[]} */
const requests = [];
/** @type {object[]} */
const transcriptions = [];
const server = http.createServer(async (request, response) => {
if (request.method === "POST" && request.url === "/__retitle") {
routes["/feed.xml"][1] = Buffer.from(feedXml(audio.length, FEED_TITLE, "", true));
Expand All @@ -630,8 +713,17 @@ function serve() {
response.end(JSON.stringify(requests));
return;
}
if (request.url === "/__transcriptions") {
response.writeHead(200, { "Content-Type": "application/json" });
response.end(JSON.stringify(transcriptions));
return;
}
const fromPodNotes = request.headers.host?.startsWith(host);
if (fromPodNotes) requests.push(`${request.method} ${request.url}`);
if (request.method === "POST" && request.url === TRANSCRIPTIONS_ROUTE) {
await answerTranscription(request, response, transcriptions);
return;
}
const url = request.url ?? "";
let route = routes[url];
if (!route && videos[url]) {
Expand Down Expand Up @@ -737,6 +829,15 @@ async function printRequests() {
for (const line of /** @type {string[]} */ (await response.json())) console.log(line);
}

async function printTranscriptions() {
const response = await fetch(`${local}/__transcriptions`, {
signal: AbortSignal.timeout(1000),
});
for (const entry of /** @type {object[]} */ (await response.json())) {
console.log(JSON.stringify(entry));
}
}

async function retitleFeed() {
const response = await fetch(`${local}/__retitle`, {
method: "POST",
Expand Down Expand Up @@ -764,11 +865,13 @@ try {
else if (verb === "library") await startFeed(libraryUrl);
else if (verb === "retitle") await retitleFeed();
else if (verb === "requests") await printRequests();
else if (verb === "server") await startFeed(serverUrl);
else if (verb === "transcriptions") await printTranscriptions();
else if (verb === "audio") await writeAudio(arg);
else if (verb === "stop") await stopFeed();
else
throw new Error(
"Usage: fixtures.mjs feed | feed-b | transcripts | private | library | retitle | requests | audio [vault-relative path] | stop",
"Usage: fixtures.mjs feed | feed-b | transcripts | private | library | retitle | requests | server | transcriptions | audio [vault-relative path] | stop",
);
} catch (error) {
console.error(error instanceof Error ? error.message : String(error));
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,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.
After `npm run build`, `npm run size` enforces 334,091 raw bytes and 109,234 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
2 changes: 2 additions & 0 deletions obsidian-e2e.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -116,11 +116,13 @@ export default {
deepgramSecretId: "",
elevenLabsSecretId: "",
openRouterSecretId: "",
openAICompatibleSecretId: "",
transcript: {
path: "transcripts/{{podcast}}/{{title}}.md",
template: "# {{title}}\n\nPodcast: {{podcast}}\nDate: {{date}}\n\n{{transcript}}",
provider: "elevenlabs",
model: "",
serverUrl: "",
diarization: {
enabled: true,
speakerTemplate: "**{{speaker}}:** ",
Expand Down
3 changes: 2 additions & 1 deletion scripts/model-review.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@ import { PROVIDERS } from "src/services/transcription/registry";
import { curatedModels } from "./model-review.mjs";

it("reads the model IDs the providers offer", () => {
// An OpenAI-compatible server's model is the one its user names, so it has no ID here.
const offered = Object.entries(PROVIDERS).flatMap(([provider, { models }]) =>
models.map(({ id }) => ({ provider, id })),
models.filter(({ id }) => id).map(({ id }) => ({ provider, id })),
);
const byProvider = (a: { provider: string }, b: { provider: string }) =>
a.provider.localeCompare(b.provider);
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 108,180 bytes, and the raw budget 330,546. On 2026-10-14 it rose from 100,000 for
The gzip budget is now 109,234 bytes, and the raw budget 334,091. 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 @@ -90,6 +90,16 @@ main.js raw: 330546 bytes; budget 330546 bytes; 0 bytes remaining
main.js gzip (level 9): 108180 bytes; budget 108180 bytes; 0 bytes remaining
```

On 2026-11-16 both rose for the OpenAI-compatible server provider: from 330,546
raw by 3,545 bytes, and from 108,180 gzip by 1,054 bytes. That is the provider, a
verbose_json reader shared with OpenRouter, and Whisper's word pieces joined.
With it:

```text
main.js raw: 334091 bytes; budget 334091 bytes; 0 bytes remaining
main.js gzip (level 9): 109234 bytes; budget 109234 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_546 },
{ name: "gzip (level 9)", bytes: gzipSync(bundle, { level: 9 }).length, budget: 108_180 },
{ name: "raw", bytes: bundle.length, budget: 334_091 },
{ name: "gzip (level 9)", bytes: gzipSync(bundle, { level: 9 }).length, budget: 109_234 },
];
const rows = measurements.map(({ name, bytes, budget }) => {
const overage = Math.max(0, bytes - budget);
Expand Down
Loading
Loading