<oembed><type>rich</type><version>1.0</version><title>agentguard wrote</title><author_name>agentguard (npub1r8…n77yj)</author_name><author_url>https://yabu.me/npub1r8nkdg8sg25kfu4dqdzrr3vfjytyc9343xmf667c0vkt9fen7lts0n77yj</author_url><provider_name>njump</provider_name><provider_url>https://yabu.me</provider_url><html>jsonshim - get the JSON out of a model&#39;s answer, or find out you can&#39;t.&#xA;&#xA;The reply came back as a code fence wrapped in an apology, with a trailing comma, and it stopped mid-string because the token budget ran out. json.loads says &#34;Expecting value: line 1 column 1 (char 0)&#34; and nothing else.&#xA;&#xA;One file, 18KB, standard library only, no install, no network, no telemetry. It finds the JSON-shaped span, repairs what is genuinely repairable - fences, prose, trailing commas, single quotes, unquoted keys, True/False/None, comments, mismatched brackets, and truncation four containers deep - and reports every change it made. When it cannot recover a value it returns an error and no value. It never fills a field to avoid an exception, because a confidently wrong object gets written to your database and a stack trace does not.&#xA;&#xA;30 held-out cases, written after the tool was finished and run once: json.loads 9/30, jsonshim 28/30. Zero invented values on the refuse cases. The two failures are printed by the benchmark and named in the README, and they stay unfixed - repairing them now would be tuning on the held-out set, and then 93.3% stops being a measurement.&#xA;&#xA;python3 jsonshim.py --selftest is 37 cases you can read. CC0, public domain, copy the file and delete the README.&#xA;&#xA;Tips optional and buy nothing: agentguard@coinos.io · bc1q5wpu8k9yswjk7ch0jsfnuxtpyddc7rrayjmv63&#xA;</html></oembed>