Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
66 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
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
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
5 changes: 4 additions & 1 deletion .claude/skills/verify/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,10 @@ its profile. It keeps the vault and `.obsidian-e2e-artifacts/`. Delete
- `.claude/skills/verify/net.mjs` runs as `watch`, `log` or `unwatch`. It logs
every `fetch` and `requestUrl` call PodNotes makes, without query strings,
and answers ElevenLabs, Deepgram, OpenRouter and OpenAI with a fixture
provider while it watches.
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.

- `.claude/skills/verify/ui.mjs` sends trusted input through
`obsidian dev:cdp`. Its verbs are `click <css> [--text <s>] [--right]`,
Expand Down
2 changes: 1 addition & 1 deletion .claude/skills/verify/features/transcripts.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ Preconditions:
- **OpenRouter.** Choose `OpenRouter` with its fake key. The notes read as for ElevenLabs.
- 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 the 70 min MP3 from the OpenAI steps below, 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. The fixture answers each with two speakers, so the note numbers six, and the progress notice ends with `OpenRouter transcribed this episode in 3 parts, and speaker labels restart in each, so one person can have several labels.`
- 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.`
- **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.
Expand Down
52 changes: 47 additions & 5 deletions .claude/skills/verify/net.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,42 @@ const WATCH = `(() => {
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)] };
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.
const hearOpenRouter = async (request, entry) => {
if (request.contentType !== "application/json") return 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));
const decoded = await new OfflineAudioContext(1, 1, 8000).decodeAudioData(bytes.buffer);
entry.decodedSeconds = Math.round(decoded.duration * 1000) / 1000;
const samples = decoded.getChannelData(0);
const step = decoded.sampleRate / 4;
const labels = new Map();
const words = [];
let before;
for (let at = 0; at + step <= samples.length; at += step) {
let energy = 0;
let crossings = 0;
for (let index = at + 1; index < at + step; index++) {
energy += samples[index] * samples[index];
if (samples[index] >= 0 !== samples[index - 1] >= 0) crossings++;
}
// A tone of f Hz crosses zero 2f times a second, so f is twice the crossings in 0.25 s.
const voice = energy / step < 0.001 ? undefined : crossings * 2 < 500 ? "Low" : "High";
const [start, end] = [at / decoded.sampleRate, (at + step) / decoded.sampleRate];
if (voice && voice === before) words[words.length - 1].end = end;
else if (voice) {
if (!labels.has(voice)) labels.set(voice, labels.size);
const speaker = labels.get(voice);
words.push({ word: voice + " voice.", start, end, speaker, speaker_label: "speaker_" + speaker, confidence: 0.99 });
}
before = voice;
}
entry.heardSpeakers = labels.size;
return { text: words.map(({ word }) => word).join(" "), words };
};
// A request that names an address in place of a file is a few hundred bytes: multipart
// with source_url for ElevenLabs, JSON with input_audio.url for OpenRouter.
const namedAddress = (request) => {
Expand All @@ -130,24 +166,30 @@ const WATCH = `(() => {
ipc.send = function (channel, replyChannel, request, ...rest) {
if (channel === "request-url" && typeof request?.url === "string") {
const method = (request.method ?? "GET").toUpperCase();
const entry = { via: "requestUrl", method, url: logged(request.url) };
const answer = request.url.startsWith("https://api.openai.com/")
? { text }
: request.url.startsWith("https://api.deepgram.com/")
? deepgram
: request.url.startsWith("https://api.elevenlabs.io/")
? elevenlabs
: request.url === ${jsLiteral(OPENROUTER_TRANSCRIPTIONS)}
? openrouter
? hearOpenRouter(request, entry)
: request.url.startsWith(${jsLiteral(OPENROUTER_CATALOG)})
? openrouterCatalog
: null;
if (answer) {
entries.push({ via: "requestUrl", method, url: logged(request.url), answeredBy: "fixture provider", contentType: request.contentType, uploadBytes: request.body?.byteLength ?? 0, sourceUrl: namedAddress(request) });
const body = new TextEncoder().encode(JSON.stringify(answer)).buffer;
queueMicrotask(() => ipc.emit(replyChannel, {}, { status: 200, headers: { "content-type": "application/json" }, body }));
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 }), () => {
entry.decodedSeconds = "undecodable";
return { status: 400, json: { error: { message: "Invalid audio file", code: 400 } } };
})
.then(({ status, json }) => ipc.emit(replyChannel, {}, { status, headers: { "content-type": "application/json" }, body: new TextEncoder().encode(JSON.stringify(json)).buffer }));
return;
}
entries.push({ via: "requestUrl", method, url: logged(request.url) });
entries.push(entry);
}
return originalSend.call(ipc, channel, replyChannel, request, ...rest);
};
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 106,562 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,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.

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

Expand Down
10 changes: 9 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 106,562 bytes. On 2026-10-14 it rose from 100,000 for
The gzip budget is now 107,399 bytes. 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 @@ -72,6 +72,14 @@ main.js raw: 326389 bytes; budget 330000 bytes; 3611 bytes remaining
main.js gzip (level 9): 106562 bytes; budget 106562 bytes; 0 bytes remaining
```

On 2026-11-16 it rose from 106,562 by 837 bytes for the speaker reel, which
matches speaker labels across an episode's parts. With it:

```text
main.js raw: 328677 bytes; budget 330000 bytes; 1323 bytes remaining
main.js gzip (level 9): 107399 bytes; budget 107399 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
2 changes: 1 addition & 1 deletion scripts/size.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ try {
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: 106_562 },
{ name: "gzip (level 9)", bytes: gzipSync(bundle, { level: 9 }).length, budget: 107_399 },
];
const rows = measurements.map(({ name, bytes, budget }) => {
const overage = Math.max(0, bytes - budget);
Expand Down
2 changes: 1 addition & 1 deletion scripts/size.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ describe("bundle budget CLI", () => {
const result = check("gzip.js", randomBytes(110_000));
expect(result.status).toBe(1);
expect(result.stdout).toMatch(
/gzip \(level 9\): \d+ bytes; budget 106562 bytes; OVER by \d+ bytes/,
/gzip \(level 9\): \d+ bytes; budget 107399 bytes; OVER by \d+ bytes/,
);
expect(result.stdout).toContain("budget 330000 bytes; 220000 bytes remaining");
});
Expand Down
Loading
Loading