legco_ai_assistant/backend/app/test
Woody 284028bb1f feat: Phase 3.1 + 3.2 — YouTube config infra and URL extraction
Phase 3.1 — Configuration & Infrastructure:
- Add youtube_proxy_enabled, yt_dlp_timeout, yt_dlp_cache_ttl config fields
- Add yt-dlp and hls.js dependencies
- Create models/youtube.py (request/response schemas)
- Create service stubs (youtube_service, hls_proxy)
- Create router stub and register in main.py
- 11 config tests

Phase 3.2 — YouTube URL Extraction:
- yt-dlp wrapper with async extraction (run_in_executor)
- Format selection: ≤480p video-only + highest-bitrate audio (VOD)
- Combined format fallback: same URL for live streams
- In-memory URL cache: 5min TTL live, 30min VOD
- lru_cache singleton service for cache persistence
- Error handling: DownloadError → 200 with error field
- 18 extract tests, 82/82 total pass (zero regressions)

Real-URL verified: VOD (5bF3tkO5jAA) 24 formats, Live (fN9uYWCjQaw) 6 HLS
2026-05-09 15:53:04 +08:00
..
acceptance fix: Phase 2 ASR pipeline — 9 bugs resolved, Full Transcript works end-to-end 2026-05-06 18:26:17 +08:00
conftest.py feat: Phase 2.3 ASR proxy + full transcript and 2.4 frontend hooks 2026-05-06 13:41:24 +08:00
test_integration_phase2.py fix: Phase 2 ASR pipeline — 9 bugs resolved, Full Transcript works end-to-end 2026-05-06 18:26:17 +08:00
test_phase1_chunk_serving.py refactor(test): rewrite tests to comply with integration-first rules 2026-04-27 11:46:58 +08:00
test_phase1_chunking.py feat: Phase 1.2 ingestion pipeline with chunking and metadata 2026-04-22 16:49:52 +08:00
test_phase1_config.py feat: Phase 1.1 project setup with config, database, and models 2026-04-22 16:13:52 +08:00
test_phase1_database.py feat(history): Phase 3.5 — Query History backend (service, API, timing, XML capture) 2026-04-25 22:59:53 +08:00
test_phase1_documents_router.py refactor(test): rewrite tests to comply with integration-first rules 2026-04-27 11:46:58 +08:00
test_phase1_enhanced_metadata.py refactor(test): rewrite tests to comply with integration-first rules 2026-04-27 11:46:58 +08:00
test_phase1_ingest.py refactor(test): rewrite tests to comply with integration-first rules 2026-04-27 11:46:58 +08:00
test_phase1_ingest_page_aware.py feat(ingest): generate per-chunk PDFs for DOCX/TXT documents (Phase 5.3) 2026-04-28 17:32:22 +08:00
test_phase1_llm_client.py test(backend): update unit tests for LLM monitoring changes 2026-04-23 14:52:41 +08:00
test_phase1_metadata.py feat: Phase 1.2 ingestion pipeline with chunking and metadata 2026-04-22 16:49:52 +08:00
test_phase1_page_aware_chunking.py feat(backend): add page-aware chunking with adjacent-page overlap 2026-04-24 10:30:18 +08:00
test_phase1_parsers.py feat: Phase 1.2 ingestion pipeline with chunking and metadata 2026-04-22 16:49:52 +08:00
test_phase1_pdf_extractor.py feat(backend): add PDF page extractor and chunk PDF storage config 2026-04-24 10:52:57 +08:00
test_phase1_pdf_parser_pages.py feat(backend): add page-aware PDF parsing with per-page text extraction 2026-04-24 10:30:04 +08:00
test_phase1_query.py test: update integration mocks for dual-client architecture (Phase 6) 2026-05-04 14:59:23 +08:00
test_phase1_query_decomposer.py feat(history): Phase 3.5 — Query History backend (service, API, timing, XML capture) 2026-04-25 22:59:53 +08:00
test_phase1_rag_service.py refactor(test): rewrite tests to comply with integration-first rules 2026-04-27 11:46:58 +08:00
test_phase1_relevance_filter.py test(backend): extend existing tests for per-sub-q methods and templates 2026-04-26 23:29:27 +08:00
test_phase2_asr_client.py fix: Phase 2 ASR pipeline — 9 bugs resolved, Full Transcript works end-to-end 2026-05-06 18:26:17 +08:00
test_phase2_config.py feat: Phase 2.1 config + infrastructure and 2.2 video upload backend 2026-05-06 13:08:19 +08:00
test_phase2_full_transcript.py feat: Phase 2.3 ASR proxy + full transcript and 2.4 frontend hooks 2026-05-06 13:41:24 +08:00
test_phase2_video_upload.py feat: Phase 2.1 config + infrastructure and 2.2 video upload backend 2026-05-06 13:08:19 +08:00
test_phase2_ws_asr.py feat: Phase 2.3 ASR proxy + full transcript and 2.4 frontend hooks 2026-05-06 13:41:24 +08:00
test_phase2_ws_protocol.py refactor: remove dead _merge_stash, add Phase 3 YouTube proxy plan 2026-05-09 15:14:01 +08:00
test_phase3_config.py feat: Phase 3.1 + 3.2 — YouTube config infra and URL extraction 2026-05-09 15:53:04 +08:00
test_phase3_history_router.py refactor(test): rewrite tests to comply with integration-first rules 2026-04-27 11:46:58 +08:00
test_phase3_history_service.py feat(db): update history schema and generate prompt template for Package 4 2026-04-26 23:28:28 +08:00
test_phase3_prompt_injection.py refactor(test): rewrite tests to comply with integration-first rules 2026-04-27 11:46:58 +08:00
test_phase3_prompt_service.py feat(prompts): integrate filter_per_subq with PromptService, fix seed bugs, restructure UI 2026-04-27 11:14:27 +08:00
test_phase3_prompts_router.py feat(prompts): integrate filter_per_subq with PromptService, fix seed bugs, restructure UI 2026-04-27 11:14:27 +08:00
test_phase3_query_history_integration.py test: update integration mocks for dual-client architecture (Phase 6) 2026-05-04 14:59:23 +08:00
test_phase3_sqlite_db.py feat(prompts): integrate filter_per_subq with PromptService, fix seed bugs, restructure UI 2026-04-27 11:14:27 +08:00
test_phase3_youtube_extract.py feat: Phase 3.1 + 3.2 — YouTube config infra and URL extraction 2026-05-09 15:53:04 +08:00
test_phase4_generate_per_subq.py refactor(test): rewrite tests to comply with integration-first rules 2026-04-27 11:46:58 +08:00
test_phase4_history_format.py test(backend): add Phase 4 unit tests for generate, format, history, prompts 2026-04-26 23:28:58 +08:00
test_phase4_integration_query_pipeline.py test: update integration mocks for dual-client architecture (Phase 6) 2026-05-04 14:59:23 +08:00
test_phase4_prompt_templates.py feat(prompts): integrate filter_per_subq with PromptService, fix seed bugs, restructure UI 2026-04-27 11:14:27 +08:00
test_phase4_query_router_filter.py test(backend): add Phase 4 unit tests for retrieval and filtering 2026-04-26 23:28:45 +08:00
test_phase4_query_router_retrieval.py test(backend): add Phase 4 unit tests for retrieval and filtering 2026-04-26 23:28:45 +08:00
test_phase4_relevance_filter_per_subq.py fix(relevance): tolerate LLM score count mismatches via padding instead of discarding 2026-04-27 14:31:18 +08:00
test_phase4_response_format.py refactor(test): rewrite tests to comply with integration-first rules 2026-04-27 11:46:58 +08:00
test_phase4_retrieve_per_subquestion.py refactor(test): rewrite tests to comply with integration-first rules 2026-04-27 11:46:58 +08:00
test_phase5_chunk_highlight_service.py feat: add LLM-based batch highlight service and HTML rendering (Phase 5.4.4) 2026-04-29 09:26:33 +08:00
test_phase5_decompose_logging.py feat: structured LLM output for decompose + citation fuzzy matching (Phase 5) 2026-04-28 15:39:17 +08:00
test_phase5_docx_pdf_generation.py feat(ingest): generate per-chunk PDFs for DOCX/TXT documents (Phase 5.3) 2026-04-28 17:32:22 +08:00
test_phase5_highlight_cache.py feat: add SQLite highlight cache service (Phase 5.4.3) 2026-04-29 09:26:20 +08:00
test_phase5_highlight_endpoints.py feat: add highlight batch and GET endpoints (Phase 5.4.5) 2026-04-29 09:26:50 +08:00
test_phase5_highlight_models.py feat: track highlight generation prompt, response, and timing in history (Phase 5.5) 2026-04-29 11:18:21 +08:00
test_phase5_llm_client_structured.py feat: structured LLM output for decompose + citation fuzzy matching (Phase 5) 2026-04-28 15:39:17 +08:00
test_phase5_query_decomposer_structured.py feat: structured LLM output for decompose + citation fuzzy matching (Phase 5) 2026-04-28 15:39:17 +08:00
test_phase5_sentence_splitter.py feat: add sentence splitter and highlight data models (Phase 5.4.1-5.4.2) 2026-04-29 09:26:06 +08:00
test_phase5_subquestions_model.py feat: structured LLM output for decompose + citation fuzzy matching (Phase 5) 2026-04-28 15:39:17 +08:00
test_phase6_llm_client_dp.py feat: inject Pydantic JSON schema into Deepseek prompt (Phase 6) 2026-05-04 15:17:24 +08:00
test_phaseX_export.py feat(prompts): add JSON export/import for profile prompt configurations 2026-04-27 19:44:35 +08:00
test_phaseX_import.py feat(prompts): add JSON export/import for profile prompt configurations 2026-04-27 19:44:35 +08:00