fix(ci): clear pre-existing ruff + tsc failures on main#11
Merged
Conversation
CI has been red on main since the research trust layer merge (#8). None of these issues were caught before merge, and every PR since has inherited the failure. This commit resolves both jobs. Backend (ruff): - chat.py model: wrap Field() description so the line fits in 120 cols. - chat stream route: drop the unused persist_warning flag. - conversation_store: drop unused `field` and `Path` imports. - conversation store + cross-notebook tests: drop unused locals / imports (c2 binding, VectorStoreManager import). Kept the ordering assertion by calling create_conversation without binding the returned value. Desktop (tsc): - types.ts: extend StreamSource and SourceChunk with the fields the backend actually returns (relevance_score, notebook_id). This removes the need for unsafe `as Record<string, unknown>` casts at read sites. - useChat / SourcePanel: read the typed fields directly now that the shape is honest. - DocumentPreview: use a proper `'str' in item` narrow for the pdfjs TextItem | TextMarkedContent union instead of an ad-hoc structural type. - SetupWizard: drop the unused fetchConfig import and the dead uploadedFilename state (only the setter was ever called). - ZoteroImport: drop the unused useAppStore import. Verified locally: `uv run ruff check .` clean; `npm run build` clean. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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.
Summary
CI has been red on
mainsince the research trust layer landed in #8 — every PR since has inherited the failure. Both thebackendanddesktopjobs fail with 6 lint errors each. This PR resolves all 12.Backend (ruff)
models/chat.py:17Field()description to fit 120 colsroutes/chat.py:49persist_warningflagservices/conversation_store.py:8dataclasses.fieldimportservices/conversation_store.py:9pathlib.Pathimporttests/test_conversation_store.py:146c2binding; the assertion only readsconvs[0].titletests/test_cross_notebook.py:5VectorStoreManagerimportDesktop (tsc)
types.tsStreamSourceandSourceChunkwithrelevance_score?+notebook_id?— fields the backend already sends. Eliminates the need for unsafe casts at read sites.hooks/useChat.ts:50src.relevance_scoredirectly (was(src as Record<string, unknown>).relevance_score)components/layout/SourcePanel.tsx:30source.notebook_iddirectlyDocumentPreview.tsx:61'str' in itemto narrow pdfjsTextItem | TextMarkedContentunion instead of an ad-hoc structural annotationcomponents/ui/SetupWizard.tsx:2fetchConfigimportcomponents/ui/SetupWizard.tsx:37uploadedFilenamestate — only the setter was ever calledcomponents/ui/ZoteroImport.tsx:2useAppStoreimportVerification
cd backend && uv run ruff check .→All checks passed!cd apps/desktop && npm run build→ clean (✓ built in 872ms, no tsc errors)Why the type extensions matter
The two
as Record<string, unknown>casts inuseChatandSourcePanelexisted because the TS types forStreamSource/SourceChunkhadn't caught up with the backend. The backend has been shippingrelevance_scoreandnotebook_idfor a while — extending the interfaces is both the real fix and makes downstream code type-safe.🤖 Generated with Claude Code