Commit Graph
1 Commits
Author SHA1 Message Date
知微 7cebcba13a 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
2026-07-08 01:18:48 +08:00