Repository navigation
Add title bitmap OCR in transcript component - #838
Open
allenporter wants to merge 2 commits into
Open
allenporter wants to merge 2 commits into
allenporter wants to merge 2 commits into
Conversation
…safety, and migration/prompt tests
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #838 +/- ##
========================================
Coverage 95.54% 95.55%
========================================
Files 256 257 +1
Lines 27907 28021 +114
========================================
+ Hits 26665 26776 +111
- Misses 1242 1245 +3 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
This branch has not been deployed
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.
Implements Step 4 of ADR 0004 for #501.
Summary
d0e1f2a3b4c5):NoteTitleTranscriptDO(f_note_title_transcript, composite PK(user_id, file_id, bitmap_md5),text_content,create_time,update_time) insupernote/server/db/models/note_processing.py.f_note_title.text_content, removestext_by_md5carry-over fromNoteMetadataModule._sync_titles(), and removestextfromNoteTitleVOandtypes.d.tsNoteTitle.PromptId.TITLE_TRANSCRIPTION,supernote/server/resources/prompts/title/default/prompt.md, andformat_title_ocr_prompt()insupernote/server/ai/prompts.py.OcrModule(supernote/server/components/transcript/processor.py):<TITLEBITMAP>crops for the current page usingNoteMetadataService.get_title_png_key()andblob_storage.get_bytes(), normalizing output to a single line and upserting safely under concurrent page execution.""for unrenderable crops sorun_if_needed()settles, prunes stale title transcripts when headings change, and implementscleanup_file()scoped by(user_id, file_id).TranscriptService.get_title_transcripts()(joined withNoteTitleDOso stale titles are never served, omitting empty strings, and preserving read compatibility with unmigrated legacy DBs).titles: dict[str, str](keyed bybitmapMd5) onWebTranscriptResponseVO/POST /api/extended/transcript.Verification
./script/lint(ruff, ty, tsc, biome, codespell, yamllint) passes.uv run --no-sync pytest -q -n 8) passes, including new tests for title crop OCR, title-only backfill with evicted page PNGs, concurrent duplicatebitmap_md5upserts, unrenderable crops,cleanup_file,format_title_ocr_prompt, andd0e1f2a3b4c5upgrade/downgrade.