Skip to content

refactor(schema): drop the declarations nothing has ever read - #562

Merged
EtienneLescot merged 2 commits into
mainfrom
claude/drop-dead-autotranscribe
Sep 10, 2026
Merged

refactor(schema): drop the declarations nothing has ever read#562
EtienneLescot merged 2 commits into
mainfrom
claude/drop-dead-autotranscribe

Conversation

@EtienneLescot

@EtienneLescot EtienneLescot commented Sep 1, 2026

Copy link
Copy Markdown
Collaborator

Summary

Three removals in schema/index.ts, all of them declarations nothing ever read.

addAssetInputSchema.autoTranscribe — declared with a true default, one occurrence in the whole tree: its own line. Worse than clutter, because it reads like the switch that decides whether an imported asset gets transcribed. The next person working on transcription finds it, believes the decision already has a home, and wires their logic to a flag no code path consults. It surfaced while designing #560, which needs somewhere to express "transcribe only what can carry speech" — and this looked like it.

addAssetInputSchema itself, and the AddAssetInput it exported. No parse site, no import, no namespace import of the module. It named an IPC contract that no boundary validates against. It was also actively confusing: document-service.ts declares a same-named AddAssetInput interface (line 38) and that is the one every caller uses. Two types, one name, and the one that looked canonical was inert.

chatInputSchema and its ChatInput — same story, no shadowing twist.

What is NOT removed, and why it looked removable

createProjectInputSchema stays. It reads as dead by exactly the same grep — zero references outside schema/index.ts — but its inferred CreateProjectInput types createEmptyDocument, which has 50 call sites. The reference is one line below the type export, inside the same file, and is easy to miss.

Worth stating rather than quietly keeping: "no references outside its own module" is not a liveness test for a type that a function in that module consumes.

Related issue

Refs #560 — found while pinning down where automatic transcription should be decided.

Type of change

  • Refactor / maintenance

Release impact

  • No release note needed

Desktop impact

  • Not platform-specific

Screenshots / video

None — no user-visible change.

Testing

  • npm run test2236 passed, 4 skipped, 0 failed (187 files)
  • npx tsc --noEmit and npx tsc -p tsconfig.test.json --noEmit — clean
  • npm run lint (Biome) — clean (15 pre-existing warnings in untouched files)

No test asserted on any of the removed declarations, so none needed changing. The typecheck is the real proof here: had any of the three been reachable, both tsc passes would say so.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Refactor
    • Removed the AI editing input validation schemas and their associated input types.

@EtienneLescot EtienneLescot changed the title refactor(schema): drop autoTranscribe, which nothing has ever read refactor(schema): drop the declarations nothing has ever read Sep 1, 2026
@coderabbitai

coderabbitai Bot commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

Review Change StackReview Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Advanced

Run ID: 23f96a84-7980-45db-9e6e-108164a2516b

📥 Commits

Reviewing files that changed from the base of the PR and between 01f69d4 and 756bfc4.

📒 Files selected for processing (1)
  • src/lib/ai-edition/schema/index.ts
💤 Files with no reviewable changes (1)
  • src/lib/ai-edition/schema/index.ts

Included review availability: Your plan provides up to 8 included reviews per hour; 6 remain after this review.


📝 Walkthrough

Walkthrough

The change removes addAssetInputSchema, chatInputSchema, AddAssetInput, and ChatInput from the AI edition schema module.

Changes

AI edition schema removal

Layer / File(s) Summary
Remove input schemas and types
src/lib/ai-edition/schema/index.ts
Removes the two Zod schemas and their derived TypeScript types.

Estimated code review effort: 1 (Trivial) | ~2 minutes

Merge Risk: ⚪ Minimal · up to 756bf

This maintenance-only change removes unused AI edition schemas without changing supported behavior or user-facing functionality. Reported checks pass, so it is ready to merge.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly describes the main change: removing unused schema declarations. It is concise and specific enough for project history.
Description check ✅ Passed The description is complete and follows the repository template. It explains the removed declarations, related issue, change type, release and platform impact, absence of visual changes, and validatio…
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 0…
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch claude/drop-dead-autotranscribe

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

`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.
`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.
@EtienneLescot

Copy link
Copy Markdown
Collaborator Author

Rebased on main. The conflict was worth a note: since this PR opened, addAssetInputSchema gained a kind: z.enum(["video", "audio"]) field for the external audio import (#350).

It still has zero consumers — git grep finds only its own declaration and its own z.infer, and document-service.ts keeps using its own same-named AddAssetInput interface (line 39). So the new field is dead on arrival too.

That is precisely the trap this PR describes: the schema looks like the place where "how an imported asset is handled" is declared, so the next person to touch the subject wires their work to it. Deleting it now, kind included.

@EtienneLescot
EtienneLescot force-pushed the claude/drop-dead-autotranscribe branch from 01f69d4 to 756bfc4 Compare September 10, 2026 10:25
@EtienneLescot
EtienneLescot merged commit 8ce0ecd into main Sep 10, 2026
22 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant