docs(04): complete phase planning
This commit is contained in:
@@ -36,11 +36,11 @@ must_haves:
|
||||
- from: "kb_pipeline/processors/parse.py"
|
||||
to: "kb_pipeline/link_parser.py"
|
||||
via: "LinkParser.parse()"
|
||||
pattern: "LinkParser\\(\\)\\.parse"
|
||||
pattern: "LinkParser\(\)\.parse"
|
||||
- from: "kb_pipeline/processors/base.py"
|
||||
to: "kb_pipeline/state.py"
|
||||
via: "WorkflowStateManager integration"
|
||||
pattern: "state_manager\\."
|
||||
pattern: "state_manager\."
|
||||
---
|
||||
|
||||
<objective>
|
||||
@@ -198,13 +198,14 @@ Add tests to existing test_schemas.py file.
|
||||
</task>
|
||||
|
||||
<task type="auto" tdd="true">
|
||||
<name>Task 3: Implement ParseProcessor</name>
|
||||
<files>kb_pipeline/processors/parse.py, tests/test_processors/test_parse.py</files>
|
||||
<name>Task 3: Implement ParseProcessor with __init__.py export</name>
|
||||
<files>kb_pipeline/processors/parse.py, kb_pipeline/processors/__init__.py, tests/test_processors/test_parse.py</files>
|
||||
<behavior>
|
||||
- Test 1: ParseProcessor parses Bilibili video URL correctly
|
||||
- Test 2: ParseProcessor parses Zhihu answer URL correctly
|
||||
- Test 3: ParseProcessor returns ParseOutput with success=False for unknown URLs
|
||||
- Test 4: ParseProcessor records state when state_manager is provided
|
||||
- Test 5: ParseProcessor can be imported from kb_pipeline.processors
|
||||
</behavior>
|
||||
<action>
|
||||
Create `kb_pipeline/processors/parse.py`:
|
||||
@@ -222,18 +223,8 @@ Create `kb_pipeline/processors/parse.py`:
|
||||
|
||||
4. Keep implementation simple - just wrap LinkParser
|
||||
5. Handle both success and failure cases with proper state recording
|
||||
</action>
|
||||
<verify>
|
||||
<automated>pytest tests/test_processors/test_parse.py -v -x</automated>
|
||||
</verify>
|
||||
<done>ParseProcessor correctly parses URLs and returns structured ParseOutput</done>
|
||||
</task>
|
||||
|
||||
<task type="auto">
|
||||
<name>Task 4: Update processors __init__.py</name>
|
||||
<files>kb_pipeline/processors/__init__.py</files>
|
||||
<action>
|
||||
Update `kb_pipeline/processors/__init__.py` to export new classes:
|
||||
Then update `kb_pipeline/processors/__init__.py` to export new classes:
|
||||
|
||||
```python
|
||||
from .base import BaseProcessor
|
||||
@@ -246,9 +237,9 @@ __all__ = ["BaseProcessor", "ParseProcessor", "ASRProcessor"]
|
||||
Keep existing ASRProcessor export and add new ones.
|
||||
</action>
|
||||
<verify>
|
||||
<automated>python -c "from kb_pipeline.processors import BaseProcessor, ParseProcessor, ASRProcessor; print('OK')"</automated>
|
||||
<automated>pytest tests/test_processors/test_parse.py -v -x && python -c "from kb_pipeline.processors import BaseProcessor, ParseProcessor, ASRProcessor; print('OK')"</automated>
|
||||
</verify>
|
||||
<done>All processors can be imported from kb_pipeline.processors</done>
|
||||
<done>ParseProcessor correctly parses URLs, returns structured ParseOutput, and is exported from processors module</done>
|
||||
</task>
|
||||
|
||||
</tasks>
|
||||
@@ -258,6 +249,7 @@ Keep existing ASRProcessor export and add new ones.
|
||||
- BaseProcessor is abstract and cannot be instantiated
|
||||
- ParseProcessor correctly wraps LinkParser
|
||||
- State recording works when state_manager is provided
|
||||
- All processors can be imported from kb_pipeline.processors
|
||||
</verification>
|
||||
|
||||
<success_criteria>
|
||||
|
||||
Reference in New Issue
Block a user