fix(lab): salvage TOOL_CALLS envelope followed by model-continued transcript

↗ view on GitHub · Eli Ziff · 2026-08-06 · 2b8d4642

A completed two-call indenture envelope (126KB) was discarded because the
model hallucinated {"tool_results":...} + citations after its calls and
first-{..last-} spanned the concatenation. String-aware balanced-prefix
scan recovers the first complete object; accepted only on strict parse +
shape, so truncated and defective-string classes keep their paths.
Probe: real bad reply -> both calls recovered; truncation + dominant-string
regressions unchanged.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011pfUVhNFTRvhYGXBwoKNj6
Repository eliziff/Beaver
Author Eli Ziff <eliasziff@gmail.com>
Authored
Parents 56b0da47
Stats 1 file changed , +54 , -1
Part of Evaluation harness: Beaver-CAN and LegalBench-RAG adapters

Capture this commit into my fork

Download a Markdown prompt that tells Claude how to port this exact commit into your working tree. Run it via claude -p < capture-commit-2b8d4642.md from inside the repo you want the change in.

⬇ Download capture-commit-2b8d4642.md