From eec4eb3486462e6dd0c5eb9c42aa11af9d9b1f42 Mon Sep 17 00:00:00 2001 From: EtienneLescot Date: Tue, 1 Sep 2026 18:01:40 +0200 Subject: [PATCH 1/2] refactor(schema): drop autoTranscribe, which nothing has ever read MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit `addAssetInputSchema.autoTranscribe` was declared with a `true` default and consumed by nobody: one occurrence in the whole tree, its own declaration. That is worse than clutter. It reads like the switch that decides whether an imported asset gets transcribed, so the next person to work on transcription finds it, believes the decision already has a home, and wires their logic to a flag no code path consults. It surfaced during the design of #560 for exactly that reason. The field goes; the schema keeps its shape otherwise. Nothing type-checks against it — `document-service.ts` declares its own `AddAssetInput` interface and uses that one, so the inferred type this schema exports was not in play either. --- src/lib/ai-edition/schema/index.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/src/lib/ai-edition/schema/index.ts b/src/lib/ai-edition/schema/index.ts index 00c429de5..077cbbfcc 100644 --- a/src/lib/ai-edition/schema/index.ts +++ b/src/lib/ai-edition/schema/index.ts @@ -803,7 +803,6 @@ export const createProjectInputSchema = z.object({ export const addAssetInputSchema = z.object({ path: z.string().trim().min(1), label: z.string().trim().optional(), - autoTranscribe: z.boolean().default(true), }); export const chatInputSchema = z.object({ From 01f69d4ddcee7131b382a81ed165c27e6b07e5fb Mon Sep 17 00:00:00 2001 From: EtienneLescot Date: Tue, 1 Sep 2026 18:10:53 +0200 Subject: [PATCH 2/2] refactor(schema): drop the two input schemas nothing consumes MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit `addAssetInputSchema` and `chatInputSchema` had no reference anywhere outside their own declaration and their own `z.infer` line — no parse site, no import, no namespace import of the module. They named an IPC contract that no boundary actually validates against. `addAssetInputSchema` was the worse of the two: the `AddAssetInput` it exported is shadowed by a same-named interface declared in `document-service.ts`, and that interface is the one every caller uses. Two types, one name, and the one that looked canonical was inert. `createProjectInputSchema` STAYS. It reads as dead by the same grep — no use outside `schema/index.ts` — but its inferred `CreateProjectInput` types `createEmptyDocument`, which has 50 call sites. Same file, one line down; the reference is easy to miss and expensive to remove. --- src/lib/ai-edition/schema/index.ts | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/src/lib/ai-edition/schema/index.ts b/src/lib/ai-edition/schema/index.ts index 077cbbfcc..6ad211016 100644 --- a/src/lib/ai-edition/schema/index.ts +++ b/src/lib/ai-edition/schema/index.ts @@ -800,16 +800,6 @@ export const createProjectInputSchema = z.object({ title: z.string().trim().min(1).default("Untitled Project"), }); -export const addAssetInputSchema = z.object({ - path: z.string().trim().min(1), - label: z.string().trim().optional(), -}); - -export const chatInputSchema = z.object({ - sessionId: z.string().trim().min(1).optional(), - message: z.string().trim().min(1), -}); - // Every code whisper.cpp's multilingual model can resolve, plus "auto" for // detection. Codes and order mirror whisper.cpp's own `g_lang` table // (`src/whisper.cpp`, verified against the tag `nix/whisper-stt.nix` pins — @@ -945,8 +935,6 @@ export type AxcutLegacyEditor = z.infer; export type AxcutDocument = z.infer; export type AxcutDocumentInput = z.input; export type CreateProjectInput = z.infer; -export type AddAssetInput = z.infer; -export type ChatInput = z.infer; export type TranscriptLanguageCode = z.infer; /** A real whisper.cpp language code — `TranscriptLanguageCode` minus the "auto" detection sentinel. */ export type WhisperLanguageCode = Exclude;