Merge feat/vocabulary-hint: names-and-terms decoder prompt (spec 001 workstream 2)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> # Conflicts: # docs/Architecture.md # docs/Decisions.md # docs/WorkBreakdown.md # server-py/sidecar.py # src/App.tsx # src/server/live.ts # src/server/transcribe.ts # tests/fixtures/fake_sidecar.py # tests/transcribe.test.ts
This commit is contained in:
commit
2c87471fdc
26 files changed
+1177
-21
No files matched your search
@@ -121,7 +121,9 @@ describe("createLiveWebSocket", () => {
|
||||
handler.message(ws, toBuffer(speech(1)));
|
||||
handler.message(ws, toBuffer(silence(1.5))); // trailing silence commits the segment
|
||||
|
||||
await waitFor(() => sidecar.requests.length > 0);
|
||||
// The fake records the request before it finishes reading the PCM file —
|
||||
// wait for the payload itself, or a loaded machine races past it.
|
||||
await waitFor(() => sidecar.audioPayloads.length > 0);
|
||||
expect(sidecar.requests[0]).toEqual(
|
||||
// Live passes are short: sequential decoding, no batching/VAD (D-WS5a).
|
||||
expect.objectContaining({ model: "base", language: "da", task: "translate", mode: "live" }),
|
||||
@@ -140,6 +142,21 @@ describe("createLiveWebSocket", () => {
|
||||
await waitFor(async () => (await readdir(tempDir)).length === 0);
|
||||
});
|
||||
|
||||
test("every pass of a session carries the session's vocabulary hint (D-WS2a)", async () => {
|
||||
const tempDir = await makeTempDir();
|
||||
const sidecar = fakeSidecar();
|
||||
const handler = createLiveWebSocket({ sidecar });
|
||||
const ws = fakeSocket(sessionData({ prompt: "Maxwell, Voices of the Void", tempDir }));
|
||||
handler.open(ws);
|
||||
handler.message(ws, toBuffer(speech(1)));
|
||||
handler.message(ws, toBuffer(silence(1.5)));
|
||||
await waitFor(() => sidecar.requests.length > 0);
|
||||
for (const request of sidecar.requests) {
|
||||
expect(request.prompt).toBe("Maxwell, Voices of the Void");
|
||||
}
|
||||
await waitFor(async () => (await readdir(tempDir)).length === 0);
|
||||
});
|
||||
|
||||
test("a sidecar error surfaces on the update stream instead of crashing the session", async () => {
|
||||
const sidecar = fakeSidecar({ error: "model load failed" });
|
||||
const handler = createLiveWebSocket({ sidecar });
|
||||
|
||||
Reference in new issue
Block a user