Commit Graph

265 Commits

Author SHA1 Message Date
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 72d75e3454 feat(06-03): export Pipeline class from pipeline package
- Add Pipeline import from kb_workflow.pipeline.pipeline
- Add Pipeline to __all__ exports list
- Enables: from kb_workflow.pipeline import Pipeline

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-17 00:34:26 +08:00
starmen1265 8b07ef9dcd refactor(06-03): move sys.path manipulation to lazy import in analyze.py
- Remove top-level sys.path.insert for kb-deep-analyzer
- Add module-level flag _deep_analyzer_path_added for single execution
- Move sys.path manipulation inside _run_analysis method
- External dependency import now happens lazily at runtime

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-17 00:34:06 +08:00
starmen1265 81d67b7672 fix(06-03): remove sys.path manipulation from zhihu_metadata.py
- Remove unnecessary sys.path.insert for current directory
- Use relative import for zhihu_extractor
- Package imports work correctly without path manipulation

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-17 00:33:23 +08:00
starmen1265 2b305b0eb9 fix(06-03): remove sys.path manipulation from zhihu_extractor.py
- Remove unnecessary sys.path.insert for current directory
- Use pure relative import for markdown_converter
- Package imports work correctly without path manipulation

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-17 00:33:02 +08:00
starmen1265 ab8655de3a fix(06-03): remove sys.path manipulation from kb_workflow.py
- Remove unnecessary sys.path.insert for project root
- Update docstring to reference kb_workflow.pipeline
- Package imports work correctly without path manipulation

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-17 00:32:40 +08:00
starmen1265 fdd6c08211 docs(06): create gap closure plan 06-03 2026-03-17 00:28:35 +08:00
starmen1265 3edbdcc183 docs(06): add phase verification report
PR Test / lint (pull_request) Successful in 2s
9/9 core functions verified, but gaps found:
- 4 remaining sys.path manipulations
- Pipeline not exported at package level

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-17 00:24:34 +08:00
starmen1265 190a04068b docs(06-02): complete pipeline module consolidation plan
- Move kb_pipeline/ to kb_workflow.pipeline/
- Update all imports to use absolute paths
- 278 tests pass (14 pre-existing failures unrelated to refactoring)
- CLI works with new module structure

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-17 00:18:06 +08:00
starmen1265 2df08c6e26 chore(06-02): remove original kb_pipeline directory
All code has been moved to kb_workflow.pipeline with updated imports.
278 tests pass (14 pre-existing mock-related failures unrelated to refactoring).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-17 00:17:19 +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 fdca690bd6 feat(06-02): move processors and platforms to kb_workflow.pipeline
- Move all processor implementations (parse, download, asr, analyze, archive)
- Move all platform adapters (base, bilibili, zhihu)
- Update all internal imports to use kb_workflow.pipeline prefix

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-17 00:17:01 +08:00
starmen1265 279ae684ea feat(06-02): move pipeline core files to kb_workflow.pipeline
- Move pipeline.py, schemas.py, config.py, state.py, errors.py
- Move retry.py, idempotency.py, link_parser.py
- Create pipeline/__init__.py with updated imports
- Update all internal imports to use kb_workflow.pipeline prefix

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-17 00:16:56 +08:00
starmen1265 65fdf4646a docs(06-01): complete metadata consolidation plan 2026-03-17 00:08:09 +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 98f8ec2e27 refactor(06-01): update platform adapters to use standard imports
- Remove sys.path manipulation from bilibili.py and zhihu.py
- Use standard imports from kb_workflow.metadata
- Remove try/except wrappers around imports

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-17 00:01:22 +08:00
starmen1265 a4a7454cd0 feat(06-01): move zhihu modules to metadata directory
- Move zhihu_extractor.py, zhihu_metadata.py, zhihu_article_crawler.py, markdown_converter.py
- Update metadata/__init__.py to export ZhihuPlaywrightExtractor

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-16 23:59:55 +08:00
starmen1265 e2edce2e29 feat(06-01): create metadata directory and move bilibili modules
- Rename kb-workflow to kb_workflow for Python package compatibility
- Move bilibili_extractor.py and bilibili_metadata.py to kb_workflow/metadata/
- Create metadata/__init__.py with BilibiliExporter export

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-16 23:59:23 +08:00
starmen1265 444ac22e44 docs(06): create phase 6 consolidation plans 2026-03-16 23:52:44 +08:00
starmen1265 5fc7000ef7 docs(06): add research and validation strategy 2026-03-16 23:47:46 +08:00
starmen1265 33acdf0c2e docs(phase-06): research code consolidation domain 2026-03-16 23:46:37 +08:00
starmen1265 24806adb90 docs(state): record phase 6 context session 2026-03-16 23:42:40 +08:00
starmen1265 9f4aee0ac7 docs(06): capture phase context 2026-03-16 23:42:31 +08:00
starmen1265 bee61f6e08 docs(phase-05): complete phase execution - archive-directory
- Phase 5 归档与目录优化完成
- 所有 11 个需求 (INT/ARC/OUT) 已验证通过
- 测试: 8 个归档相关测试通过

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-16 23:36:14 +08:00
starmen1265 ea672f4526 docs(05-03): complete archive testing plan
- Add SUMMARY.md with 8 tests (5 unit + 3 integration)
- Update STATE.md: Phase 5 complete, advance to Phase 6
- Mark requirements OUT-01, OUT-02, OUT-03, OUT-04 complete
- Document test patterns and decisions

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-16 23:31:47 +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 bd5ffab6e7 docs(05-02): complete ArchiveProcessor implementation plan 2026-03-16 23:21:06 +08:00
starmen1265 d1497ca550 feat(05-02): integrate ArchiveProcessor into Pipeline
- Add ArchiveInput creation in Pipeline.run()
- Import ArchiveInput in pipeline.py
- Add archive_file and skipped to output field recording
- Add ArchiveProcessor to CLI processors list
- Update PipelineConfig steps to include archive
2026-03-16 23:19:23 +08:00
starmen1265 63dd88279c feat(05-02): implement ArchiveProcessor
- Create ArchiveProcessor with STEP_NAME = archive
- Implement process() method with idempotent execution
- Add _find_existing_archive() for duplicate detection
- Add _ask_overwrite() using rich.prompt with fallback
- Only copy md files (not json) to archive directory
- Export ArchiveProcessor in __init__.py
2026-03-16 23:18:24 +08:00
starmen1265 9c74f51b43 feat(05-02): add ArchiveInput and ArchiveOutput schemas
- Add ArchiveInput with content_dir, analysis_file, content_type fields
- Add ArchiveOutput with archive_file, skipped, platform fields
- Update PipelineConfig default steps to include archive step
2026-03-16 23:17:29 +08:00
starmen1265 129a6311f4 docs(05-01): complete unified intermediate directory plan
- Added intermediate_path config field with KB_INTERMEDIATE_PATH env var support
- Updated Pipeline to use configurable intermediate directory
- Updated CLI to default to intermediate_path instead of cwd
- Completed requirements: INT-01, INT-02, INT-03

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-16 23:16:09 +08:00
starmen1265 7f9caa32d2 feat(05-01): update CLI to use configurable intermediate directory default
- Import get_settings at top of process_command
- Change default output_dir from cwd to settings.intermediate_path
- Update docstring to document default behavior
- Users can still override with -o flag

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-16 23:13:38 +08:00
starmen1265 10f4dfa22e feat(05-01): update Pipeline to use configurable intermediate directory
- Change default output_dir from cwd to settings.intermediate_path
- Reorder settings initialization before output_dir assignment
- Maintain output_dir parameter for testing/custom override

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-16 23:13:04 +08:00
starmen1265 c5b2c66bc7 feat(05-01): add KB_INTERMEDIATE_PATH config to KBSettings
- Add intermediate_path field with default ~/work/intermediate/analysis/
- Follow pydantic-settings naming convention for env var override
- Users can customize via KB_INTERMEDIATE_PATH environment variable

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-16 23:12:36 +08:00
starmen1265 18bfb8886d docs(05): add INT-03 to Phase 5 requirements
- Update ROADMAP.md to include INT-03 (configurable intermediate path)
- Update 05-01 plan description to reflect INT-03 coverage

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-16 23:10:50 +08:00
starmen1265 ae69878b59 fix(05): revise plan to include KB_INTERMEDIATE_PATH config support
- Add INT-03 requirement to 05-01-PLAN.md requirements field
- Add Task 1 for KB_INTERMEDIATE_PATH config in KBSettings
- Update Task 2 and Task 3 to use configurable path instead of hardcoded
- Update 05-CONTEXT.md to reflect new decision (config support vs hardcoded)

Addresses checker issue: requirement_coverage for INT-03

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-16 23:08:27 +08:00
starmen1265 a11a2dde99 docs(05): create phase 5 plans for archive and directory optimization 2026-03-16 23:03:14 +08:00
starmen1265 c92ace8e2d docs(state): record phase 5 context session 2026-03-16 22:54:58 +08:00
starmen1265 2eff597c3b docs(05): capture phase context 2026-03-16 22:54:52 +08:00
starmen1265 0bc5bb7584 docs: create milestone v1.1 roadmap (2 phases) 2026-03-16 21:06:43 +08:00
starmen1265 90b5ec2a27 docs: define milestone v1.1 requirements 2026-03-16 20:58:59 +08:00
starmen1265 643acbf165 docs: start milestone v1.1 Architecture Refactor 2026-03-16 20:54:53 +08:00
starmen1265 f358c52578 fix(zhihu): 修复文章归档格式问题
PR Test / lint (pull_request) Successful in 1s
1. author 字段清理零宽度空格和换行符,修复 Obsidian 解析
2. 扩展 content_type 条件,answer/zhuanlan 使用文章模板
3. 读取 content.md 时去除 YAML frontmatter
4. generate_frontmatter 正确推断 platform 为 zhihu

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-16 18:19:42 +08:00
starmen1265 e288a16944 docs: resolve debug zhihu-article-images-missing 2026-03-16 17:49:31 +08:00
starmen1265 84e9ada055 restore: 恢复误删的技能目录并修复导入方式
PR Test / lint (pull_request) Successful in 1s
- 恢复 kb-zhihu-metadata, kb-bilibili-metadata, kb-deep-analyzer
- 修改 zhihu.py 和 analyze.py 使用 sys.path 方式导入
- 删除符号链接 kb_zhihu_metadata

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-16 17:27:48 +08:00
starmen1265 ae8f6080c9 删除就技能
PR Test / lint (pull_request) Successful in 2s
2026-03-16 16:55:21 +08:00
starmen1265 f98d649b5c docs: resolve debug kb-workflow-legacy-code-removal
PR Test / lint (pull_request) Successful in 1s
2026-03-16 15:27:57 +08:00
starmen1265 0f0011b4a6 refactor(kb-workflow): remove legacy code - use kb_pipeline only
Root cause: kb_workflow.py contained 312 lines of deprecated legacy
code that was confusing AI agents. The legacy functions have been
completely replaced by the kb_pipeline package.

Changes:
- Removed all legacy functions (is_video_content, check_duplicate, etc.)
- Kept only process_command() and main() entry points
- Updated SKILL.md to remove old command examples
- File reduced from 495 to 143 lines (71% reduction)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-16 15:27:31 +08:00