fix(llm): tolerate trailing prose after compaction JSON #855
All Vouch review confidence checks passed
Residual risk 0.09 = Change Risk (0.28) × (1 − Review Confidence (0.68)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.28 · 23 lines diff across 2 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.35 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.190
Ai Authored
ai_authored
0.050
Real PR Conversation Timeline
2 items
Approved
Good find! I haven't looked at compaction in a while :)
<img src="https://static.klipy.com/ii/35ccce3d852f7995dd2da910f2abd795/bd/ac/Q0FDn1uo.gif"/>
andimarafioti
CJstate
_extract_jsonfell back totext.find("{")+text.rfind("}")when the wholereply was not bare JSON. If the model appended a note containing braces after
the object (e.g.
{old}),rfindpicked that later brace andjson.loadsraised
JSONDecodeError: Extra data, so history compaction failed.Use
JSONDecoder().raw_decodefrom the first{: it consumes exactly onecomplete JSON object and ignores whatever follows, which is what the fenced
block path already effectively does.
Validation:
pytest tests/test_compaction_json_extraction.py— 2 passedValueError