- Add enable_semantic_segmentation: bool field with default=True
- Allow override via KB_ENABLE_SEMANTIC_SEGMENTATION env var
- Pydantic automatically parses boolean strings (true/false, yes/no, 1/0)
- Update docstring to document new field
CONFIG-01: LLM segmentation can be enabled/disabled via configuration
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- 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>
Change Segment(index=1, ...) to Segment(id=1, ...) to match
the actual Segment class definition in parser.py.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Mark Plan 14-05 as complete in plans list
- Update progress table: Phase 14 now 5/6 plans complete
- Mark Phase 13 as 7/7 complete (corrected)
- Update Phase 13 completion date to 2026-03-22
- Note Plan 14-04 partially implemented in 14-05
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Update current position to Phase 14 Plan 05 (completed)
- Update progress to 34% (42/44 plans)
- Add Phase 14 Plan 05 decisions to Accumulated Context
- Update performance metrics table with Plan 14-05 data
- Update session continuity information
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Summarize the execution of Plan 14-05:
- Completed 3 tasks (integrate cache, integrate SRTProcessor, fix tests)
- 3 atomic commits
- All tests passing (28/28 robustness, 23/23 SRTProcessor)
- Cache integration and configuration toggle working as expected
- Bonus: Implemented chunking methods from Plan 14-04
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Fix patch path for SimpleAIClient (deep_analyzer not semantic_engine)
- Remove config parameter from SRTProcessor initialization
- Add proper assertions for cache enabled/disabled states
- Import Mock from unittest.mock
- Remove duplicate test functions
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Add enable_cache parameter to SRTProcessor.__init__()
- Create SemanticCache instance when semantic segmentation is enabled
- Pass cache to UnifiedSegmentationStrategy through SemanticSegmentationEngine
- Add logging for cache status (enabled/disabled)
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Create 14-00-SUMMARY.md documenting test infrastructure
- Update STATE.md with position and progress
- Update ROADMAP.md for Phase 14
Summary details:
- 26 tests created/modified covering ROBUST-01 to COST-03
- Test infrastructure ready for Phase 14 implementation plans
- TDD RED state established for unimplemented features
- 18 tests passing (existing functionality)
- 8 tests failing (expected - features not yet implemented)
- Add comprehensive test suite in test_semantic_robustness.py
- TestLLMFailureFallback: LLM调用失败自动降级 (ROBUST-01)
- TestNonRecoverableErrorDetection: 不可恢复错误检测
- TestRecoverableErrorDetection: 可恢复错误检测
- TestRetryMechanism: 重试机制测试
- TestFallbackToRuleBased: 降级到规则分段 (ROBUST-03)
- TestLoggingBehavior: 日志记录行为 (ROBUST-04)
- TestParseFailureRetry: 解析失败重试 (ROBUST-02)
- TestExtractJSON: JSON提取功能
- Update conftest.py with Phase 14 fixtures:
- Mock AI clients for different failure scenarios
- Long text samples for chunking tests (COST-01)
- Cache-related fixtures (COST-02)
- Long subtitle segments for testing
- Add TestSemanticSegmentationToggle to test_srt_processor.py (COST-03):
- Test enabling/disabling semantic segmentation
- Test cache enable/disable functionality
- Test configuration switches
All tests follow TDD RED state - failing tests for future implementation
- Created SUMMARY.md with implementation details
- Updated STATE.md with new decisions and session info
- Updated ROADMAP.md progress (1/6 plans complete)
- Marked COST-02 requirement complete
Duration: 1 min (72s)
Tasks: 1 (TDD: RED → GREEN)
Tests: 11 passed
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Test JSONDecodeError triggers retry 1 time before fallback
- Test ValidationError directly fallbacks without retry
- Test parse error logs LLM output fragment (first 500 chars)
- Test fallback logs error type and message
- Test retry uses INFO level logging
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>