- Test KBSettings has enable_semantic_segmentation field with bool type
- Test default value is True
- Test environment variable override (KB_ENABLE_SEMANTIC_SEGMENTATION)
- Test boolean string parsing (true/false, yes/no, 1/0)
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- 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>
- 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>
- 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>
- 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>
- Create IdempotencyChecker class with check_exists method
- Check for metadata JSON and content Markdown files
- Return tuple of (all_exist, existing_files)
- Follow naming convention: {platform}_{content_id}_{type}.{ext}
- Add get_expected_files helper method
- Add 8 unit tests covering all scenarios
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Create ParsedLink dataclass with platform, content_type, content_id fields
- Implement LinkParser class with regex-based URL parsing
- Support Bilibili video/article URLs (with/without www)
- Support Zhihu answer/zhuanlan URLs
- Support b23.tv short link resolution with requests.head
- Return None for unrecognized URLs (no exceptions)
- Add 15 unit tests covering all supported URL types
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Test retry on NetworkError (up to 3 times)
- Test no retry on non-NetworkError (ValidationError)
- Test reraise after max attempts
- Test preserved return value on success
- Test exponential backoff configuration
- Test cause exception preservation
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Test KBSettings required fields (base_path, archive_path)
- Test KBSettings optional fields with defaults
- Test secret fields (hf_token, zhihu_cookie) as SecretStr
- Test missing required fields raises ValidationError
- Test get_settings returns singleton via lru_cache
- Test env vars with KB_ prefix are read
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Test ErrorType enum (NETWORK, VALIDATION, SYSTEM, AUTH)
- Test KBError base class with to_dict method
- Test NetworkError with status_code and auto-suggestion
- Test ValidationError with validation_errors list
- Test SystemError with system_message
- Test AuthError with auth_type
- Test error class hierarchy
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Add tests for WorkflowState methods (mark_step_started, mark_step_completed, mark_step_failed)
- Add tests for StepResult schema
- Add tests for StepDefinition schema with dependencies
- Achieve 100% test coverage on kb_pipeline/schemas.py
- Total 37 tests passing
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Create kb_pipeline package structure
- Add test fixtures in conftest.py
- Add 28 test cases for StepInput, StepOutput, StepStatus, StepRecord, WorkflowState
- Add JSON serialization/deserialization tests
- TDD RED phase: tests fail because schemas.py not yet implemented
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>