Commit Graph

71 Commits

Author SHA1 Message Date
starmen1265 0d8ed1f22f feat(13-06): implement extensible strategy architecture for segmentation
- Define SegmentationStrategy Protocol interface (Plan 13-06)
- Implement UnifiedSegmentationStrategy with unified approach for all video types
- Update SemanticSegmentationEngine to use strategy pattern
- Add comprehensive tests for strategy extensibility (STRAT-01, STRAT-02, STRAT-03)

Key changes:
- SegmentationStrategy Protocol defines the strategy interface
- UnifiedSegmentationStrategy implements unified approach (per user decision)
- SemanticSegmentationEngine now uses strategy injection pattern
- Tests verify strategy protocol, unified strategy, custom strategy injection, and extensibility

The architecture supports future extension (e.g., knowledge-type specific strategies)
while Phase 13 uses the unified strategy approach.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-22 00:29:54 +08:00
starmen1265 adc1aa3b1d test(13-03): add content completeness protection tests
- 添加 TestSentenceBoundaryProtection 测试类(COMP-01)
  - test_sentence_boundary_protection: 验证分段边界在标点符号后
  - test_sentence_boundary_in_prompt: 验证 Prompt 包含句边界指令

- 添加 TestArgumentCompleteness 测试类(COMP-02)
  - test_argument_completeness: 验证论点结构完整性
  - test_argument_completeness_in_prompt: 验证 Prompt 包含论点完整性指令

- 添加 TestParallelStructurePreservation 测试类(COMP-03)
  - test_parallel_structure_preserved: 验证并列结构不被错误拆分
  - test_no_special_handling_for_parallel_in_prompt: 验证遵守用户决策(不特别指定并列结构处理)

所有测试通过(29/29),semantic_engine.py 已包含所需的内容完整性保护指令:
- 第 337 行:保持句子完整性,列举所有中文句末标点(。?!……)
- 第 340 行:保持论点完整性,不在前提-结论结构中间截断
- 不包含并列结构特殊处理(符合用户决策)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-22 00:26:14 +08:00
starmen1265 759503f48a feat(13-05): 实现中文句边界检测指令
更新 SEGMENTATION_PROMPT,增强句边界检测:
- 列举所有中文句末标点(。?!……)
- 强调「自然停顿处」和「语义停顿」
- 说明「不仅依赖标点符号」

添加测试验证句边界检测效果:
- test_chinese_sentence_boundary_punctuations
- test_prompt_emphasizes_semantic_pause
- test_prompt_not_only_punctuation
- test_sentence_boundary_in_segmentation

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-22 00:25:40 +08:00
starmen1265 00319f523f feat(13-01): implement video type detection and Pydantic models
- 创建 SemanticSegmentationEngine 类
- 实现 VideoSegment 和 SegmentationResult Pydantic 模型
  - VideoSegment: title(可选), content(必填), start_index, end_index
  - SegmentationResult: video_type, segments[], actual_segment_count
  - 添加标题长度验证器(5-15字)
- 实现 _infer_video_type() 方法
  - 从元数据推断视频类型(知识类/故事类/访谈类/新闻类/vlog)
  - 支持从 title, category, tags 推断
  - 默认类型为"知识类"
- 实现 _build_prompt() 方法
  - 包含视频类型信息
  - 包含完整的分段要求(数量控制、句边界保护、标题生成等)
  - 包含 JSON 输出格式规范
- 添加 extract_json_from_llm_response() 工具函数
- 添加 AIClientProtocol 协议定义
- 添加 deferred-items.md 记录超出范围的测试

所有计划 13-01 测试通过(10个测试)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-22 00:25:21 +08:00
starmen1265 8c2b3e079a feat(13-04): 实现主题标题生成功能
实现 VideoSegment.title 字段和验证,Prompt 中的标题生成指令。

功能:
- VideoSegment.title: Optional[str] 字段
- @field_validator 验证标题长度(不超过 15 字)
- SEGMENTATION_PROMPT 包含标题生成指令
- LLM 自主判断是否需要标题(主题/章节有标题,论点/观点无标题)
- 测试验证标题生成和省略

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-22 00:24:58 +08:00
starmen1265 9862da7085 test(13-01): add failing tests for video type detection
- 创建 conftest.py 共享 fixtures(MockAIClient, sample_segments)
- 创建 test_semantic_engine.py 包含 8 个测试用例
  - test_video_type_detection_from_title: 测试从标题推断类型
  - test_video_type_detection_from_category: 测试从分类推断类型
  - test_video_type_fallback_to_default: 测试默认类型回退
  - test_video_type_in_prompt: 测试类型出现在 Prompt 中
  - test_prompt_format: 测试 Prompt 格式
  - test_video_segment_model: 测试 VideoSegment 模型
  - test_segmentation_result_model: 测试 SegmentationResult 模型
  - test_model_validation: 测试字段验证

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-22 00:23:40 +08:00
starmen1265 98709476ab test(12-02): add Bilibili video pipeline end-to-end tests
- Test Bilibili video uses SRTProcessor (not AnalyzeProcessor)
- Test Bilibili article uses AnalyzeProcessor (not SRTProcessor)
- Test Zhihu answer uses AnalyzeProcessor
- Test Markdown output format verification

All 4 tests pass.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-19 23:45:49 +08:00
starmen1265 87b1919483 feat(12-01): implement SRTProcessor and Markdown generation
- Add SRTInput/SRTOutput schemas to pipeline
- Create SRTProcessor following BaseProcessor pattern
- Generate Markdown with YAML frontmatter
- Support metadata extraction and formatting
- Handle missing metadata gracefully

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-19 23:38:56 +08:00
starmen1265 757793bfa9 test(12-01): add failing tests for ASRCorrector
- Test obvious homophone error correction
- Test contextual error correction
- Test no overcorrection on correct text
- Test AI unavailable fallback
- Test batch processing for long text
- Test empty text handling

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-19 23:35:02 +08:00
starmen1265 81a7dc558b test(12-01): add failing tests for SemanticSegmenter
- Test merging short segments into paragraphs
- Test segmentation on topic change (time gap)
- Test max paragraph length constraint
- Test empty segments handling

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-19 23:33:43 +08:00
starmen1265 7023a57644 test(12-01): add failing tests for SRT parser module
- Test standard SRT format parsing
- Test special character handling
- Test error handling for invalid/empty content
- Test file parsing functionality

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-19 23:31:36 +08:00
starmen1265 56c21f3f36 test(11-02): add failing tests for stealth integration in ZhihuCrawler
- Test crawler accepts stealth_config parameter
- Test default stealth enabled behavior
- Test stealth can be disabled
- Test _start_browser_with_proxy calls apply_stealth_sync
- Test launch args include --disable-blink-features
- Test backward compatibility

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-18 23:52:23 +08:00
starmen1265 e152b8ea05 feat(11-01): create stealth fingerprint masking module
- Add StealthConfig Pydantic model with all playwright-stealth options
- Add apply_stealth_sync/apply_stealth_async functions for browser context
- Add get_default_stealth_config convenience function
- Add 9 unit tests covering config defaults, stealth application, and disabled mode
- Update conftest.py with stealth_config and mock_browser_context fixtures

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-18 23:47:50 +08:00
starmen1265 b66bcc08b1 feat(10-02): integrate ProxyPool into ZhihuCrawler
- Add proxy_pool parameter to ZhihuCrawler constructor
- Add _current_proxy tracking for health check feedback
- Implement _parse_proxy_url static method for URL parsing
- Implement _on_request_success/failure for proxy health feedback
- Prioritize proxy_pool over config.proxy for multi-proxy support
- Maintain backward compatibility with single proxy config

Tests:
- test_crawler_accepts_proxy_pool
- test_crawler_without_proxy_pool (backward compatibility)
- test_parse_proxy_url (HTTP, auth, SOCKS5)
- test_proxy_pool_takes_priority_over_config

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-18 16:48:48 +08:00
starmen1265 36a45095c1 test(10-02): add health check tests for proxy pool
- test_fail_threshold: verify 3 consecutive failures mark proxy unavailable
- test_success_resets_count: verify success resets failure count
- test_cooldown_recovery: verify proxy recovers after cooldown
- test_cooldown_not_elapsed: verify proxy stays unavailable during cooldown
- test_all_unavailable_fallback: verify fallback to first proxy when all fail
- test_get_available_count: verify available proxy count tracking

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-18 16:46:37 +08:00
starmen1265 bcf1a88613 test(10-01): add failing tests for proxy pool module
- Test load from YAML file with multiple proxies
- Test load from environment variable (backward compatibility)
- Test round-robin rotation
- Test empty pool handling
- Test single proxy handling
- Test ProxyEntry defaults

RED phase: tests fail because proxy_pool module does not exist yet

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-18 16:38:07 +08:00
starmen1265 76f06c330b feat(09-01): integrate ZhihuCrawler into ZhihuAdapter
- Replace ZhihuPlaywrightExtractor with ZhihuCrawler
- Add comment crawling with include_comments=True by default
- Implement cookie expiration detection and QR code login trigger
- Add idempotency check via IdempotencyChecker
- Add comment formatting with "## 热门评论" section
- Convert HTML content to Markdown using html2text

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-17 23:14:22 +08:00
starmen1265 95218c18cd test(09-00): add Wave 0 test scaffolding for Pipeline integration
- Add mock fixtures for ZhihuCrawler CrawlResult models:
  - mock_crawl_answer_result: simulates answer crawl with comments
  - mock_crawl_article_result: simulates zhuanlan article crawl
  - mock_comments_list: test data for comment formatting
  - mock_zhihu_login_result: simulates QR code login success
  - mock_crawl_failed_result: for error handling tests

- Add test skeletons (marked skip) for Wave 1 implementation:
  - test_fetch_metadata_answer
  - test_fetch_metadata_article
  - test_fetch_content_with_comments
  - test_cookie_expired_triggers_login
  - test_idempotent_execution
  - test_comment_formatting

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-17 22:59:07 +08:00
starmen1265 123e307522 docs(08-03): complete anti-crawl measures plan
- Proxy configuration from HTTP_PROXY/HTTPS_PROXY
- Random delay (1-3s) between requests
- Exponential backoff retry (3 attempts)
- x-zse-96 signature handled by browser

All 44 crawler tests passing

Requirements: NET-01, NET-02, NET-03 completed

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-17 22:20:38 +08:00
starmen1265 9e1452d2a9 feat(08-03): integrate proxy, delay, and retry into ZhihuCrawler
- Add CrawlerConfig with ProxyConfig, delay, and retry settings
- Integrate proxy configuration via _start_browser_with_proxy()
- Add random delay via _apply_random_delay()
- Add retry logic via _crawl_with_retry using tenacity
- Add ZhihuApiInterceptor tests for x-zse-96 handling
- All tests pass
2026-03-17 22:14:47 +08:00
starmen1265 626fb73a58 feat(08-03): create CrawlerConfig for proxy and rate limiting
- Add CrawlerConfig with ProxyConfig, delay, and retry settings
- Support HTTP_PROXY/HTTPS_PROXY environment variable parsing
- Add proxy_required validation with clear error message
- Add get_crawler_config singleton for configuration access

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-17 21:57:09 +08:00
starmen1265 f41e75a1b2 feat(08-02): implement crawl_comments method with hot sorting
- Add COMMENT_API_TEMPLATE for comment API URL
- Implement crawl_comments() returning CommentsResult
- Use order=hot for popular comments sorting
- Only fetch first-level comments (no nested replies)
- Add include_comments parameter to crawl_answer()
- Export CommentAuthor, CommentData, CommentsResult in __init__.py

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-17 21:56:47 +08:00
starmen1265 8cc46965c1 test(08-02): add failing tests for comment crawling
- Test crawl_comments returns CommentsResult
- Test comments use hot sorting (order=hot)
- Test comment has required fields (content, author, like_count)
- Test no nested replies (first-level only)
- Test include_comments parameter control

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-17 21:54:42 +08:00
starmen1265 912773fc65 test(08-01): add failing tests for ZhihuCrawler
- Add test_answer_crawler.py with tests for crawl_answer()
- Add test_article_crawler.py with tests for crawl_article()
- Add test_metadata_extraction.py with tests for author/metadata parsing

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-17 21:08:13 +08:00
starmen1265 a102a75b28 feat(08-01): create crawler data models and test scaffolding
- Add Pydantic models: AnswerData, ArticleData, ContentMetadata, AuthorInfo, CrawlResult
- Create test fixtures in conftest.py with mock browser and sample API responses
- Set up crawler module with __init__.py exports

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-17 21:06:33 +08:00
starmen1265 d9861aa6c3 feat(07-03): implement login CLI subcommand
- Add login_command function with QR code login, cookie import, and status check
- Add login subcommand with --import-cookie and --status options
- Update CLI help text with login examples
- Fix mock paths in tests to match actual import locations

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-17 18:10:43 +08:00
starmen1265 94c85baac9 test(07-03): add failing tests for login CLI subcommand
- Test login_default_mode - default QR code login flow
- Test login_import_cookie - --import-cookie JSON import
- Test login_status - --status cookie validation
- Test login_integration - successful login saves cookie
- Test login_error_handling - exception handling

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-17 18:01:53 +08:00
starmen1265 32bb22008b test(07-03): add failing tests for cookie validation
- Test validate_cookie_valid - valid cookie returns user info
- Test validate_cookie_expired - expired cookie returns False
- Test validate_cookie_empty - empty cookie returns False
- Test validate_cookie_malformed - network error handling
- Test validate_cookie_other_status_code - non-200/401 handling

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-17 17:59:28 +08:00
starmen1265 072d83da35 feat(07-01): implement ZhihuLogin QR code login class
TDD GREEN phase - implementation passes all 8 tests:

- ZhihuLoginResult: Pydantic model for login results
- ZhihuLogin: Main class with QR code login flow
  - LOGIN_URL: https://www.zhihu.com/signin
  - CANVAS_SELECTORS: Multiple fallback selectors for QR canvas
  - _find_qrcode_canvas(): Find canvas with fallback selectors
  - _save_qrcode_image(): Save QR code to intermediate directory
  - check_login_cookie(): Detect z_c0 cookie for login state
  - get_cookies_str(): Extract cookie string from context
  - _wait_for_login(): Poll with configurable timeout (tenacity)
  - login_by_qrcode(): Main entry point for login flow

Key design decisions:
- Uses tenacity Retrying for configurable timeout
- QR code saved to intermediate_path with timestamp
- Multiple canvas selectors for robustness
- Proper browser lifecycle management

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-17 17:54:06 +08:00
starmen1265 fb9bc2d1ed test(07-01): add failing tests for ZhihuLogin QR code login
TDD RED phase - tests expect ZhihuLogin class that doesn't exist yet:

- test_login_page_access: verify correct login URL
- test_qrcode_screenshot: verify QR code capture and save
- test_cookie_detection_with_z_c0: verify login detection
- test_cookie_detection_without_z_c0: verify no login when missing z_c0
- test_cookie_extraction: verify cookie string format
- test_login_timeout: verify timeout after 60s polling
- test_result_model_success: verify success result model
- test_result_model_failure: verify failure result model

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-17 17:50:26 +08:00
starmen1265 19c377ef65 test(07-02): add failing tests for Cookie persistence
- Test save_cookie creates env file
- Test save_cookie updates existing line
- Test save_cookie appends new line
- Test save_cookie preserves other lines
- Test save_cookie sets file permissions to 600
- Test load_cookie returns saved value
- Test load_cookie returns empty if file not exists

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-17 17:49:47 +08:00
starmen1265 f90de6b8a6 test(07-01): add auth test fixtures
- Create tests/test_auth/conftest.py with pytest fixtures
- mock_browser: Mock PlaywrightBrowser for unit testing
- mock_canvas: Mock canvas element for QR code screenshot
- sample_cookies: Test cookie data with z_c0 login cookie
- sample_cookies_no_login: Test cookies without login state
- mock_env_file: Temporary .kb_env file fixture
- intermediate_path: Temporary intermediate directory fixture

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-17 17:49:22 +08:00
starmen1265 af3536aa92 test(07-02): add failing tests for Cookie JSON parsing
- Test parse_json_cookies for Chrome Cookie Editor format
- Test domain filtering for zhihu.com
- Test empty array handling
- Test malformed JSON error handling
- Test file not found error handling

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-17 17:48:23 +08:00
starmen1265 ee0fc74378 fix(download): return author name instead of mid in _extract_author
PR Test / lint (pull_request) Successful in 1s
- Fix download processor to return actual author name (e.g. "HOLA小测佬")
  instead of B站用户ID (mid, e.g. "406636263")
- Add 5 test cases for author extraction logic
- Resolves report display issue where UP主名称 showed numeric ID

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-17 13:50:02 +08:00
starmen1265 fae4ff2f28 fix(06-03): update test import to use new package structure
- Remove sys.path manipulation from test file
- Use standard package import from kb_workflow.metadata
- Test file now follows the same import pattern as production code

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-17 00:35:31 +08:00
starmen1265 c9ca1b538d refactor(06-02): update CLI and test imports to kb_workflow.pipeline
- Remove sys.path manipulation from kb_workflow.py
- Update CLI imports to use kb_workflow.pipeline prefix
- Update all test file imports and patch paths

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-17 00:17:10 +08:00
starmen1265 766283366e refactor(06-01): delete original metadata directories and update tests
- Remove kb-bilibili-metadata/ and kb-zhihu-metadata/ directories
- Create kb_workflow/__init__.py to export main and process_command
- Update test_cli/test_process_command.py imports for new package structure

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-17 00:06:01 +08:00
starmen1265 ccfa201250 fix(05-03): fix pre-existing test issues blocking verification
- Fix test_workflow_skips_completed_steps to mock _ask_rerun_step
- Fix test_fetch_video_metadata_success to use AsyncMock
- Document other pre-existing test issues in deferred-items.md

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-16 23:28:27 +08:00
starmen1265 360aee200f test(05-03): add Pipeline archive integration tests
- Test pipeline includes archive step
- Test archive uses platform directory structure
- Test no date-based subdirectories in archive
- Update default steps assertion to include archive

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-16 23:26:14 +08:00
starmen1265 be783f97fa test(05-03): add ArchiveProcessor unit tests
- Test archive copies to correct platform directory
- Test filename format {YYYYMMDD}_{content_id}_analysis.md
- Test skip when step already completed
- Test detect existing archive by content_id
- Test handle missing analysis file with error

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-16 23:24:17 +08:00
starmen1265 f05c93d2b1 fix(zhihu): remove noscript tags to prevent duplicate images
PR Test / lint (pull_request) Successful in 1s
Zhihu HTML structure includes noscript fallback images:
<figure><img data-actualsrc=...><noscript><img src=...></noscript></figure>

After fixing lazy-load (replacing src with data-actualsrc), both imgs
have real URLs, causing duplicates. The fix removes noscript tags before
processing img elements.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-16 15:08:08 +08:00
starmen1265 8ad64a4d1b fix(asr): use content_dir for subtitle output instead of video_path
PR Test / lint (pull_request) Successful in 2s
- Add content_dir field to ASRInput schema
- Pass content_dir from pipeline when creating ASRInput
- Modify _try_official_subtitle to use content_dir for output
- Modify _run_whisper_basic to use content_dir for output
- Add validation for empty video_path in Whisper fallback

Root cause: DownloadProcessor sets content_file="" for video types,
causing Path("").parent to resolve to current directory instead of
content directory. Subtitle files were written to wrong location.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-15 22:59:24 +08:00
starmen1265 b6ff7c81aa fix(zhihu): handle lazy-load images in markdown conversion
知乎使用图片懒加载机制,`<img>` 标签的 `src` 属性包含 SVG 占位符,
真实图片 URL 在 `data-actualsrc` 或 `data-original` 属性中。
`markdownify` 只读取 `src`,导致转换后得到无效占位符。

修复:在转换前预处理 HTML,将真实图片 URL 替换到 `src` 属性。

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-15 22:59:24 +08:00
starmen1265 377794b5b3 test(04-05): add end-to-end integration tests
- Test full workflow execution from URL to analysis
- Test workflow error handling
- Test state persistence
- Test workflow resumability (skip completed steps)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-13 23:46:46 +08:00
starmen1265 76aefa23e1 test(04-05): add failing tests for CLI process subcommand
- Test process --help shows usage
- Test process <url> calls Pipeline.run()
- Test invalid URL returns error
- Test --output-dir flag
- Test --no-skip flag

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-13 23:43:06 +08:00
starmen1265 5d4cb93f8b test(04-04): add schema validation tests for PipelineInput/Output/Config
- Test PipelineInput validates url field (required)
- Test PipelineOutput contains results dict
- Test PipelineConfig has default steps list
- Test PipelineConfig allows custom output_dir

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-13 23:37:28 +08:00
starmen1265 0b7d8707bf feat(04-03): implement AnalyzeProcessor with DeepAnalyzer integration
- AnalyzeProcessor wraps existing DeepAnalyzer for pipeline integration
- Loads metadata and content from JSON files
- Generates analysis reports as Markdown with frontmatter
- Records state on success and failure
- Supports both video and article content types

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-13 23:32:31 +08:00
starmen1265 87d64b57c0 test(04-03): add failing tests for AnalyzeInput/AnalyzeOutput schemas
- Test schema validation for AnalyzeInput (metadata_file, content_file, content_type, output_file)
- Test schema validation for AnalyzeOutput (analysis_file, summary, main_topics, key_insights, tags, stats)
- Test AnalyzeProcessor integration with DeepAnalyzer
- Test state recording on success and failure

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-13 23:27:59 +08:00
starmen1265 ec268f7d17 feat(04-02): add content downloading and module export for DownloadProcessor
TDD GREEN phase:
- DownloadProcessor downloads article/answer/zhuanlan content
- Video content is skipped (handled by ASR in Phase 3)
- Content files saved with correct naming convention
- DownloadProcessor exported from kb_pipeline.processors
- All 17 tests pass

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-13 23:24:00 +08:00
starmen1265 fc6fba76b2 feat(04-02): implement DownloadProcessor with metadata fetching
TDD GREEN phase:
- DownloadProcessor inherits from BaseProcessor
- Fetches metadata from Bilibili and Zhihu adapters
- Saves metadata to content_dir as JSON
- Records state on success/failure
- Skips step if already completed (idempotency)
- All metadata tests pass

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-13 23:22:48 +08:00