Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 1 addition & 1 deletion .claude/skills/verify/features/transcripts.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ 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. Speakers not matched across parts got new numbers, so one person can have more than one.`
- 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.`
- 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, and Qwen3 ASR with words that carry no punctuation, which PodNotes restores from the answer's text. 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 GPT Transcribe does not label speakers. These providers do: ElevenLabs, Deepgram, OpenRouter.` and stays until clicked.
Expand Down
5 changes: 3 additions & 2 deletions .claude/skills/verify/net.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,8 @@ const watchSource = (turns) => `(() => {
// 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: fullText, words: turns.flatMap(([from, speaker, line]) => openRouterWords(line, speaker, from)) };
// Voxtral times segments and refuses word times; Qwen3 ASR times words and labels no speaker.
// Voxtral times segments and refuses word times. Qwen3 ASR times words, labels no speaker,
// and keeps the punctuation only in its text.
const plainOpenRouter = {
"mistralai/voxtral-mini-transcribe-3-0": (form) =>
form.has("timestamp_granularities[]")
Expand All @@ -122,7 +123,7 @@ const watchSource = (turns) => `(() => {
return { id, start: from, end: Math.round(turnWords[turnWords.length - 1].end * 10) / 10, text: " " + line };
}),
},
"qwen/qwen3-asr-1.7b": () => ({ text: openrouter.text, words: openrouter.words.map(({ word, start, end }) => ({ word, start, end })) }),
"qwen/qwen3-asr-1.7b": () => ({ text: openrouter.text, words: openrouter.words.map(({ word, start, end }) => ({ word: word.replace(/^[^\\p{L}\\p{M}\\p{N}]+|[^\\p{L}\\p{M}\\p{N}]+$/gu, ""), 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
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 334,165 raw bytes and 109,270 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,171 raw bytes and 109,282 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 109,270 bytes, and the raw budget 334,165. On 2026-10-14 it rose from 100,000 for
The gzip budget is now 109,282 bytes, and the raw budget 334,171. 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 @@ -118,6 +118,14 @@ main.js raw: 334165 bytes; budget 334165 bytes; 0 bytes remaining
main.js gzip (level 9): 109270 bytes; budget 109270 bytes; 0 bytes remaining
```

On 2026-11-21 both rose for Arabic marks restored onto unpunctuated words: from
334,165 raw by 6 bytes, and from 109,270 gzip by 12 bytes. With it:

```text
main.js raw: 334171 bytes; budget 334171 bytes; 0 bytes remaining
main.js gzip (level 9): 109282 bytes; budget 109282 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: 334_165 },
{ name: "gzip (level 9)", bytes: gzipSync(bundle, { level: 9 }).length, budget: 109_270 },
{ name: "raw", bytes: bundle.length, budget: 334_171 },
{ name: "gzip (level 9)", bytes: gzipSync(bundle, { level: 9 }).length, budget: 109_282 },
];
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(334_165)).status).toBe(0);
const result = check("over.js", "a".repeat(334_166));
expect(check("boundary.js", "a".repeat(334_171)).status).toBe(0);
const result = check("over.js", "a".repeat(334_172));
expect(result.status).toBe(1);
expect(result.stdout).toContain("budget 334165 bytes; OVER by 1 bytes");
expect(result.stdout).toContain("budget 334171 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 109270 bytes; OVER by \d+ bytes/,
/gzip \(level 9\): \d+ bytes; budget 109282 bytes; OVER by \d+ bytes/,
);
expect(result.stdout).toContain("budget 334165 bytes; 224165 bytes remaining");
expect(result.stdout).toContain("budget 334171 bytes; 224171 bytes remaining");
});

it("fails on absent or empty artifacts instead of reporting a small build", () => {
Expand Down
6 changes: 6 additions & 0 deletions src/services/TranscriptionService.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1825,6 +1825,12 @@ describe("TranscriptionService", () => {
"we'll see Okay",
"we'll see. Okay.",
],
[
"gives Qwen's words Arabic punctuation from its text",
"مرحبا، كيف حالك؟ أنا بخير؛ شكرا.",
"مرحبا كيف حالك أنا بخير شكرا",
"مرحبا، كيف حالك؟ أنا بخير؛ شكرا.",
],
[
"adds nothing to Qwen's words when it lists quotes as entries of their own",
'"Hello world." Next!',
Expand Down
2 changes: 1 addition & 1 deletion src/services/transcription/providers/verboseJson.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ const PLAIN_WORD =
/** Opening quotes and brackets a word takes from the start of its token. */
const LEADING = /^['“"‘([¿¡「『《【(]+/u;
/** Closing punctuation a word takes from the end of its token, and none of `%` or `#`, which are words' own. */
const TRAILING = /['.,?!;:…—–”"’)\]。,、?!;:」』》】)।॥]+$/u;
const TRAILING = /['.,?!;:…—–”"’)\]。,、?!;:」』》】)।॥،؛؟]+$/u;

/**
* Qwen3 ASR, and the servers that run it or Whisper, can list words without punctuation and
Expand Down
Loading