Commit Graph

202 Commits

Author SHA1 Message Date
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 aae4d2fd70 docs(debug): resolve asyncio nested loop debug session
Root cause: BilibiliExtractor sync wrappers use asyncio.run() internally,
which fails when called from async context in BilibiliAdapter.

Fix: Call async methods directly instead of sync wrappers.

Verified: Human confirmed fix works (bilibili_BV16cNMzpExh)
2026-03-15 22:59:24 +08:00
starmen1265 47c4ee39c1 Merge branch 'main' into fix/ci-deploy-reset
PR Test / lint (pull_request) Successful in 2s
2026-03-15 18:17:51 +08:00
starmen1265 5d06056b43 fix(download): handle formatted duration strings in metadata
PR Test / lint (pull_request) Successful in 1s
Parse duration strings like "12:34" or "01:23:45" into seconds.
Previously only integer duration values were handled.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-15 18:17:03 +08:00
starmen1265 368e946cd1 fix(bilibili): avoid nested asyncio.run() in async context
BilibiliAdapter._fetch_metadata_with_retry() now calls the underlying
async methods directly instead of sync wrappers that use asyncio.run().
This prevents "asyncio.run() cannot be called from a running event loop"
error when the adapter is called from within an already-running event loop.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-15 18:17:03 +08:00
starmen1265 264dbe1cde Merge pull request 'fix/ci-deploy-reset' (#9) from fix/ci-deploy-reset into main
Deploy kb-skills / deploy (push) Successful in 2s
Reviewed-on: http://192.168.1.22:8418/starmen1265/kb-skills/pulls/9
2026-03-15 01:05:13 +08:00
starmen1265 f7569af007 Merge branch 'main' into fix/ci-deploy-reset
PR Test / lint (pull_request) Successful in 1s
2026-03-15 01:04:55 +08:00
starmen1265 6883a701c0 docs(kb-workflow): update SKILL.md for new pipeline architecture
PR Test / lint (pull_request) Successful in 2s
- Simplify to single-command workflow: kb-workflow process <url>
- Document new CLI parameters and options
- Add architecture overview
- Remove deprecated multi-step manual process

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-15 01:03:18 +08:00
starmen1265 46f7feb146 chore: complete v1.0 milestone
- Archive ROADMAP and REQUIREMENTS to milestones/
- Delete original ROADMAP.md and REQUIREMENTS.md
- Update PROJECT.md with v1.0 validated requirements
- Update STATE.md for milestone complete status
- Update MILESTONES.md with key accomplishments
- Add VERIFICATION.md for phase 04

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-15 00:59:18 +08:00
starmen1265 7cf6ddd02f chore: complete v1.0 milestone 2026-03-15 00:59:12 +08:00
starmen1265 5736e2228e docs(04-05): complete CLI process subcommand and E2E tests plan
- CLI 'process' subcommand for single-command workflow execution
- End-to-end integration tests (16 tests passing)
- State persistence and resumability verified

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-15 00:10:10 +08:00
starmen1265 ec2d12a05b feat(04-05): implement Pipeline.run() method
- Add async run() method to Pipeline class
- Execute processors sequentially with state persistence
- Handle step-specific input types (Parse, Download, ASR, Analyze)
- Support skip_completed for resumable workflows
- Return PipelineOutput with results and content_dir

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-13 23:46:54 +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 33eeb6bc34 feat(04-05): add CLI 'process' subcommand
- Add process_command function that executes full pipeline
- Add subparser for 'process' command with URL argument
- Add --output-dir and --skip-completed flags
- Add --no-skip flag to re-run all steps
- Maintain backward compatibility with legacy arguments

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-13 23:44:10 +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 f9f8ec84fc docs(04-04): complete Pipeline schemas and class plan 2026-03-13 23:39:49 +08:00
starmen1265 0dfb51e9aa feat(04-04): create Pipeline class with processor initialization
- Pipeline class initializes with processors list
- Validates processor STEP_NAME matches config.steps
- _parse_url method parses URLs using LinkParser
- _get_content_dir creates content directory from parsed URL

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-13 23:38:17 +08:00
starmen1265 789d1f43e0 feat(04-04): add PipelineInput/Output/Config schemas
- PipelineInput: url (required), output_dir, skip_completed
- PipelineOutput: success, error_message, results, content_dir
- PipelineConfig: steps, output_dir, skip_completed, max_retries

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-13 23:37:35 +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 93c4f20044 docs(04-03): complete AnalyzeProcessor plan
- AnalyzeProcessor wraps DeepAnalyzer for AI-powered content analysis
- Analysis reports saved as Markdown with YAML frontmatter
- All 15 tests passing

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-13 23:34:52 +08:00
starmen1265 029718e7e0 feat(04-03): export AnalyzeProcessor from processors module
- Add AnalyzeProcessor to __init__.py exports
- Update module docstring

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-13 23:32:53 +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 51644997e4 feat(04-03): add AnalyzeInput and AnalyzeOutput schemas
- AnalyzeInput extends StepInput with metadata_file, content_file, content_type, output_file
- AnalyzeOutput extends StepOutput with analysis_file, summary, main_topics, key_insights, tags, stats
- Supports both video and article content types

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-13 23:28:30 +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 df4323af13 docs(04-02): complete DownloadProcessor plan 2026-03-13 23:25:27 +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
starmen1265 567bd32c94 test(04-02): add failing tests for DownloadProcessor metadata fetching
TDD RED phase:
- Test DownloadProcessor fetches Bilibili video metadata correctly
- Test DownloadProcessor fetches Zhihu answer metadata correctly
- Test DownloadProcessor records state on success
- Test DownloadProcessor records state on failure

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-13 23:19:21 +08:00
starmen1265 1e012366e1 feat(04-02): add DownloadInput and DownloadOutput schemas
TDD GREEN phase:
- DownloadInput extends StepInput with content_dir and content_type
- DownloadOutput extends StepOutput with metadata_file, content_file, title, author, duration
- Supports video, article, answer, zhuanlan content types
- All schema validation tests pass

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-13 23:18:29 +08:00
starmen1265 9d5c3ffc48 test(04-02): add failing tests for DownloadInput/DownloadOutput schemas
TDD RED phase:
- Test DownloadInput validates required fields (content_dir, content_type)
- Test DownloadOutput validates required fields (metadata_file, content_file, title, author)
- Test DownloadOutput handles both video and article content types

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-13 23:17:54 +08:00
starmen1265 57e6d9b6b2 docs(04-01): complete BaseProcessor and ParseProcessor plan
- BaseProcessor abstract class with unified interface
- ParseProcessor wrapping LinkParser for URL parsing
- ParseInput/ParseOutput schemas for parse step
- All tests passing (18 tests)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-13 23:16:17 +08:00
starmen1265 06d36fc440 feat(04-01): implement ParseProcessor and update module exports
- ParseProcessor wraps LinkParser for URL parsing
- Returns ParseOutput with platform, content_type, content_id
- Records state when state_manager is provided
- Handles unknown URLs with success=False
- Export BaseProcessor, ParseProcessor, ASRProcessor from __init__.py

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-13 23:14:32 +08:00
starmen1265 efddef98d3 feat(04-01): add ParseInput and ParseOutput schemas
- ParseInput extends StepInput with url field
- ParseOutput extends StepOutput with platform, content_type, content_id, resolved_url, original_url
- Tests for schema validation and inheritance

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-13 23:11:44 +08:00
starmen1265 3ad2576aed test(04-01): add failing tests for BaseProcessor abstract class
- Test BaseProcessor cannot be instantiated directly
- Test subclass must implement process() method
- Test state_manager attribute is provided
- Test STEP_NAME class attribute requirement

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-13 23:10:52 +08:00
starmen1265 747bb799ca docs(04): complete phase planning 2026-03-13 23:05:27 +08:00
starmen1265 0fd243c8e1 fix(04-05): revise plan based on checker feedback
Issues addressed:
1. Remove non-existent 04-06 from depends_on → [04-04] only
2. Add CLI 'process' subcommand implementation task (was missing)
3. Fix verify command syntax (pytest instead of malformed python -c)
4. Rewrite Task 2 action with proper test code structure

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-13 23:03:41 +08:00
starmen1265 bf44050392 docs(04): add validation strategy 2026-03-13 22:53:13 +08:00
starmen1265 4b4ed9cab6 docs(04-analysis-orchestration): create phase plans 2026-03-13 22:50:28 +08:00
starmen1265 debd53961a docs(04): research phase 04 domain 2026-03-13 22:43:32 +08:00
starmen1265 777fe38a9d docs(state): record phase 4 context session 2026-03-13 22:37:52 +08:00
starmen1265 62c33cdfd5 docs(04): capture phase context 2026-03-13 22:37:52 +08:00
starmen1265 6e4582f7ad docs(phase-03): complete phase execution 2026-03-13 19:39:56 +08:00
starmen1265 cb20090162 docs(03-01): complete ASr processing plan
- Created ASRInput/ASroputput schemas extending StepInput/StepOutput
- Implemented ASRProcessor with subtitle-first strategy
- Added Whisper.cpp integration with auto-cleanup
- Integrated speaker diarization (HF_TOKEN detection)
- All 22 tests passing
- Updated ROADMAP progress: Phase 3: 1/1 complete
- Updated state with completion timestamp and- Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-13 19:34:36 +08:00
starmen1265 d8f4df9149 docs(03-01): complete ASr processing plan
- Created ASRInput/ASroOutput schemas
- Implemented ASRProcessor with subtitle-first strategy
- Added whisper.cpp integration with auto-cleanup
- Integrated speaker diarization (HF_TOKEN detection)
- All 22 tests passing

- Updated ROADmap progress: Phase 3: 1/1 complete
- Updated state with completion timestamp

- recorded execution metrics

- Updated session info
- Added final documentation commit
2026-03-13 19:29:27 +08:00
starmen1265 6b3fae3543 test(03-01): fix state recording test mock behavior
- Fix test_state_recording_failure to use correct mock pattern
- _try_official_subtitle returning None triggers _Whisper` fallback
- Ensure proper exception propagation for accurate failure recording

- All 22 tests passing

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-13 19:27:21 +08:00
starmen1265 406c6cbbc6 feat(03-01): implement ASRProcessor with official subtitle download
- Create processors module with ASRProcessor class
- Implement _try_official_subtitle for B站字幕下载
- Support process() method with subtitle-first strategy
- Add helper functions for whisper.cpp integration

- All 5 processor tests passing

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-13 19:22:23 +08:00
starmen1265 b2330c32c8 test(03-01): add ASRInput and ASROutput schemas
- Add ASRInput schema with video_path and content_type fields
- Add ASROutput schema with tool/has_subtitle/output_files/segments/text/duration_seconds/speakers
- Create test_processors directory with conftest fixtures
- Add comprehensive schema tests (8 test cases)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-13 19:20:17 +08:00
starmen1265 2039a45bf0 docs(03): create ASR processing plan 2026-03-13 19:11:29 +08:00
starmen1265 eaa68acb9d docs(03): add research and validation strategy 2026-03-13 19:06:19 +08:00