Reasoning models (e.g. foundation-sec-8b) emit valid JSON then repeat it inside a markdown fence block. json.loads() fails on the combined text. extract_first_json_array() scans for the first '[' and walks to its matching ']' with proper string/escape/nesting handling, then returns just that slice. Combined with strip_json_fences(), this handles all observed output patterns: - bare JSON array (standard models) - fenced JSON array (fence-wrapping models) - bare array followed by fenced repeat (reasoning models) |
||
|---|---|---|
| .. | ||
| __init__.py | ||
| _llm_client.py | ||
| classifier.py | ||
| hypothesizer.py | ||
| legacy.py | ||
| models.py | ||
| pipeline.py | ||
| suppressor.py | ||
| synthesizer.py | ||
| timeline.py | ||