Repository navigation
Conversation
Add tests for ingest, vector store, embeddings, chunker validation and the documents and query APIs with LLM, embeddings and Qdrant stubbed. Run the tokenizer offline in tests. Add a GitHub Actions workflow for lint, format check and tests with a 70% coverage gate. Fix POST /documents/ returning 500 from a lazy-loaded updated_at, cap upload reads at the size limit, truncate filenames to the column length and reject chunk windows that never advance.
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
aiosqliteadded to dev extras). The tokenizer is stubbed so the suite runs offline.make coverage, enforced in CI). Also ticks the ingest and API handler test items. Coverage is now 91% (was 19% locally).POST /api/v1/documents/returned 500 becauseupdated_atwas lazy-loaded outside the async session during serialization. The document is now flushed and refreshed before returning.MAX_FILE_SIZE + 1instead of loading the whole body first.chunk_textraisesValueErrorfor windows that never advance (overlap >= chunk_size), which previously looped forever.Test results
Before: 2 passed, 6 failed (chunker tests failed only because tiktoken downloads its vocabulary at runtime and the network was blocked). After: 60 passed, ruff check and format clean.
Security findings not fixed (would change behavior or need a decision)
QueryRequest.questionhas no length limit (cost and memory abuse). Addingmax_lengthwould reject previously accepted requests.Document.error_messagereturns raw exception text to clients and may leak internals.errorstatus is rolled back byget_db, so the client gets a 500 and the document row is lost instead of being stored aserror.GET /documents/is unpaginated althoughdefault_page_sizeandmax_page_sizeexist in settings.allow_credentials=Truewith wildcard methods and headers; safe only whilecors_originsstays an explicit allowlist.openai_api_key="sk-change-me"anddocuquery:docuquerydatabase credentials;/docsand/redocare always exposed.qdrant/qdrant:latest.Other notes
mypy app(strict) already fails on main with 17 errors, so it is not part of CI.claude/eloquent-hawking-5bwqaxwas the pre-assigned working branch.