From 09b5ea7d64a7bf9dbaa87570cf24aac49c6a64ea Mon Sep 17 00:00:00 2001 From: Woody Date: Sat, 9 May 2026 15:14:01 +0800 Subject: [PATCH] refactor: remove dead _merge_stash, add Phase 3 YouTube proxy plan - Remove _merge_stash (dead code since delta-based ASR refactor) - Replace TestMergeStash with TestTextFieldFormatting (53/53 Phase 2 tests pass) - Mark phase2_enhancement_use_text_field as Complete - Add Phase 3 YouTube live stream proxy implementation plan - README updates --- .plans/phase2_enhancement_use_text_field.md | 14 +- .plans/phase3_youtube_proxy_plan.md | 381 ++++++++++++++++++++ README.md | 6 +- backend/app/routers/ws_asr.py | 11 - backend/app/test/test_phase2_ws_protocol.py | 92 +++-- 5 files changed, 459 insertions(+), 45 deletions(-) create mode 100644 .plans/phase3_youtube_proxy_plan.md diff --git a/.plans/phase2_enhancement_use_text_field.md b/.plans/phase2_enhancement_use_text_field.md index 8ffa3bc..b941fd6 100644 --- a/.plans/phase2_enhancement_use_text_field.md +++ b/.plans/phase2_enhancement_use_text_field.md @@ -1,7 +1,7 @@ # Phase 2 Enhancement: Use `text` field instead of `stash` **Created:** 2026-05-07 -**Status:** Planning +**Status:** Complete **Depends on:** Phase 2 (Complete) --- @@ -107,12 +107,12 @@ _stash_logger.info( ## 6. Acceptance Criteria -- [ ] `text` field used for partial events instead of `stash` -- [ ] `_merge_stash` function removed -- [ ] Text displayed in QueryInput grows monotonically (no jumping/replacing) -- [ ] All 16 ws_protocol tests pass (updated) -- [ ] Text persists on pause (existing behavior, unchanged) -- [ ] Stash log captures both `stash` and `text` fields for reference +- [x] `text` field used for partial events instead of `stash` (already in delta implementation) +- [x] `_merge_stash` function removed (was dead code — never called since delta refactor) +- [x] Text displayed in QueryInput grows monotonically (no jumping/replacing) — verified via `test_text_grows_monotonically_across_events` +- [x] All ws_protocol tests pass (13 tests, updated: removed `TestMergeStash`, added `TestTextFieldFormatting`) +- [x] Text persists on pause (existing behavior, unchanged) +- [x] Stash log captures both `stash` and `text` fields for reference (already present in current code) ## 7. Rollback Risk diff --git a/.plans/phase3_youtube_proxy_plan.md b/.plans/phase3_youtube_proxy_plan.md new file mode 100644 index 0000000..81b326f --- /dev/null +++ b/.plans/phase3_youtube_proxy_plan.md @@ -0,0 +1,381 @@ +# Phase 3: YouTube Live Stream Proxy → ASR → RAG — Implementation Plan + +**Created:** 2026-05-09 +**Updated:** 2026-05-09 (user decisions incorporated) +**Status:** Planning +**Depends on:** Phase 1 (Complete), Phase 2 (Complete) + +--- + +## 1. Overview + +Phase 3 adds YouTube live stream (and VOD) playback as an alternative to file upload. User pastes a YouTube URL → backend extracts separate video-only and audio-only HLS streams via yt-dlp → backend proxies HLS manifests and .ts segments (zero re-encoding) → frontend plays video in `