Implement proposal #19: Score-and-Retry + JSON format validation for 知微 pipeline
- Create json_validator.py utility module: - validate_json_syntax(): JSON syntax scoring (0-100) with auto-fix - validate_with_schema(): Multi-layer validation (syntax + schema) - score_and_retry(): Generic retry wrapper with error feedback - safe_parse_structured(): Safe <structured_data> extraction - FormatErrorLibrary: Persistent error tracking + stats + auto recommendations - CLI entry point for standalone use - Integrate into strategy_lifecycle.py: - safe_json_load() now uses json_validator for auto-fix + error logging - Falls back to legacy repair on ImportError - Integrate into update_data.py: - parse_report() uses safe_parse_structured() instead of bare json.loads() - Errors logged to FormatErrorLibrary silently - Convert strategy_lifecycle.py to Unix line endings
This commit is contained in:
+2590
-2577
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user