Repository navigation
Use query types everywhere and lint against copies - #362
Merged
byronwall merged 2 commits intoNov 28, 2026
Merged
Conversation
This was referenced Nov 28, 2026
Delete the local copies of the types that query modules export, and the 8 casts of fetch* results that hid them. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Add vn/no-query-type-redeclare and drop the six exceptions from vn/no-query-result-cast. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
byronwall
force-pushed
the
claude/cleanup-batch-2-5e0a9a
branch
from
November 28, 2026 06:07
9833b70 to
87fbd53
Compare
byronwall
marked this pull request as ready for review
November 28, 2026 06:07
Owner
Author
|
Code review (medium, inline, by the session that wrote the change) before merge: nothing blocking.
🤖 Generated with Claude Code |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The AI, embeddings, UMAP and chat code now uses the types that the queries export, and the research code declares
Topiconce. CI lint fails if someone copies a query module's type again or casts afetch*result.User impact: None. All 20 changed source files compile to the same JavaScript as the base.
Why
A local copy of a query's type keeps compiling after the query changes, as long as the fields stay assignable. A cast hides even the cases that do not. This is cleanup batch 2: move every caller, delete the copies, and add the check in one PR.
vn/no-query-result-castexceptions list (6 files) is gone.Prompt,UmapRunSummary,UmapRunDetail,UmapPoint, the UMAP points result,EmbeddingRunDetail,DocSectionItem,PromptDetail,PromptRunDetail,RunStatus,ChatThreadStatusand the dashboard prompt type.DashboardRunis now aPickofPromptRunItem.Topicmoved the other way: it is declared once inresearch.activity.ts, and the MCP layer imports it. The MCP file already imports that service, so the reverse import would make a cycle.vn/no-query-type-redeclare: no file may declare a type name that a*.queries.tsmodule exports.Proof
duplicate-typefinding on all ofapp/(srcly#483, unreleased):duplicate-typefindingsPrompt,UmapRunSummary,Topic(srcly refs)fetch*castsThe final lint config on the base source and on this branch:
No behavior change, checked by compiling each changed
srcfile at both commits with esbuild:Checks:
pnpm type-checkandpnpm lintpass.pnpm test: 924 passed, 86 skipped./ai, a prompt, a run, an embedding run and its sections, a UMAP run, and a chat thread.route-hydration-smoke,no-page-flash,note-safety-gaps,canvas-note-panel,homepage,research-board,research-editing,research-map), with--workers 1, after the rebase onto Drop write-only values and the casts that hid types #364: 45 of 47 pass.canvas-note-panel: "unsaved edits ask before the panel closes" and "a save in flight blocks closing until it finishes". Both also failed on the base before the rebase (3b320b53).routes/embeddings/[id].tsx: Drop write-only values and the casts that hid types #364 and this branch each deleted local types there. The result keeps both sets of deletions. The checks above were all rerun after it.Limits
PromptsManagerModalhas no importer, so its change was not seen in a browser. It looks like dead code; this PR does not delete it.*.queries.tsexports. A renamed copy passes (this PR foundSectionItemby reading), and so does a copy of a type from another module, such asTopic.services/umap.service.tsfetchUmapPointsandfetchUmapPointsForRunshare the query keyumap-points. Not changed here.Stack: type cleanup, layer 2 of 2
This slice: the remaining query-type copies and casts, and the check against new copies.
Why it is its own layer: #361 proved the method on
DocDetailand can merge alone.Full story: #361
🤖 Generated with Claude Code