Commit c919a1d
runtime: suppress hallucinated verdicts + require root_cause + de-leak system prompt
Three fixes for the "wrong verdict + no recovery affordance" pattern
observed in the lab 2026-05-28 not-earning transcript:
- Model emitted severity:red "Internet slow + clock unsynced" while
both tool_results in the transcript had payload:null (ok=False).
Pattern-copied directly from the system prompt's GOOD example
("Discovery unreachable + clock unsynced") with words rearranged.
- The verdict had no root_cause, but the schema allowed it, so the
app's synthetic-detector never triggered the Try-Again button.
- The thought event leaked the entire system prompt back as model
output, including the "93ms" number from the BAD example which
was then stuffed into a fake tool-response shape.
Fixes:
1. system prompt — delete the BAD/GOOD example block AND the FULL
EXAMPLE three-turn flow. Per advisor: a 1.7B model pattern-copies
structures, not just numbers; swapping 93ms for a placeholder
would just copy the placeholder. Inverse rules ("NEVER use
markdown headings", "Read tool_response field by field") are
already explicit elsewhere; the 174-example fine-tune teaches
the format. Add a stronger FIRST-ACTION directive: "Your VERY
FIRST output token MUST start a <tool_call> block. Do NOT repeat
these instructions back." Add explicit VERDICT RULES section
requiring root_cause AND specifying the insufficient_data
fallback for no-data sessions.
2. parse_verdict — require root_cause (was optional). Rejects when
missing or empty; the run_troubleshoot loop's no-verdict path
then synthesizes a proper insufficient_data verdict the app can
detect.
3. run_troubleshoot — no-evidence guardrail. Track
successful_tool_count across turns (increments only when
tool_result.ok is True AND payload is not None). Before
yielding a verdict, if successful_tool_count is 0 AND the
model's root_cause is not already insufficient_data, replace
the verdict with the insufficient_data synthetic verdict + drop
any recommendations (no evidence == no actions).
Also tighten the fula-ota SSE schema to require root_cause on the
wire (was schema-optional) so the contract matches the parser.
Two new tests pin the guardrail behaviour (overrides on no data;
passes through on healthy session). The existing force-verdict
test was updated to include a successful tool call so its intent
(directive triggers a model verdict) is preserved without
tripping the guardrail. Net 60 tests, all passing.
Companion change in apps/box (separate commit) adds
insufficient_data to SYNTHETIC_VERDICT_CODES + a friendlier copy
for SCHEMA_VIOLATION_RECOVERED so the Try-Again CTA surfaces in
both newly-covered paths.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>1 parent 58d2eae commit c919a1d
2 files changed
Lines changed: 232 additions & 54 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
604 | 604 | | |
605 | 605 | | |
606 | 606 | | |
607 | | - | |
608 | | - | |
609 | | - | |
610 | | - | |
611 | | - | |
612 | | - | |
613 | | - | |
614 | | - | |
615 | | - | |
616 | | - | |
617 | | - | |
618 | | - | |
619 | | - | |
620 | | - | |
621 | | - | |
622 | | - | |
623 | | - | |
624 | | - | |
625 | | - | |
626 | | - | |
627 | | - | |
628 | | - | |
629 | 607 | | |
630 | 608 | | |
631 | 609 | | |
| |||
639 | 617 | | |
640 | 618 | | |
641 | 619 | | |
642 | | - | |
| 620 | + | |
643 | 621 | | |
644 | | - | |
645 | | - | |
646 | | - | |
| 622 | + | |
647 | 623 | | |
648 | | - | |
649 | | - | |
650 | | - | |
| 624 | + | |
651 | 625 | | |
652 | | - | |
653 | | - | |
654 | | - | |
655 | | - | |
| 626 | + | |
| 627 | + | |
| 628 | + | |
656 | 629 | | |
657 | | - | |
| 630 | + | |
658 | 631 | | |
659 | | - | |
| 632 | + | |
| 633 | + | |
| 634 | + | |
| 635 | + | |
660 | 636 | | |
661 | | - | |
| 637 | + | |
| 638 | + | |
| 639 | + | |
| 640 | + | |
662 | 641 | | |
663 | 642 | | |
664 | 643 | | |
| |||
856 | 835 | | |
857 | 836 | | |
858 | 837 | | |
| 838 | + | |
859 | 839 | | |
860 | 840 | | |
861 | | - | |
862 | | - | |
863 | | - | |
864 | | - | |
| 841 | + | |
| 842 | + | |
| 843 | + | |
| 844 | + | |
| 845 | + | |
| 846 | + | |
| 847 | + | |
| 848 | + | |
| 849 | + | |
| 850 | + | |
| 851 | + | |
| 852 | + | |
| 853 | + | |
865 | 854 | | |
866 | 855 | | |
867 | 856 | | |
| |||
1150 | 1139 | | |
1151 | 1140 | | |
1152 | 1141 | | |
| 1142 | + | |
| 1143 | + | |
| 1144 | + | |
| 1145 | + | |
| 1146 | + | |
| 1147 | + | |
| 1148 | + | |
| 1149 | + | |
| 1150 | + | |
| 1151 | + | |
1153 | 1152 | | |
1154 | 1153 | | |
1155 | 1154 | | |
| |||
1276 | 1275 | | |
1277 | 1276 | | |
1278 | 1277 | | |
| 1278 | + | |
| 1279 | + | |
| 1280 | + | |
| 1281 | + | |
| 1282 | + | |
| 1283 | + | |
| 1284 | + | |
1279 | 1285 | | |
1280 | 1286 | | |
1281 | 1287 | | |
| |||
1309 | 1315 | | |
1310 | 1316 | | |
1311 | 1317 | | |
| 1318 | + | |
| 1319 | + | |
| 1320 | + | |
| 1321 | + | |
| 1322 | + | |
| 1323 | + | |
| 1324 | + | |
| 1325 | + | |
| 1326 | + | |
| 1327 | + | |
| 1328 | + | |
| 1329 | + | |
| 1330 | + | |
| 1331 | + | |
| 1332 | + | |
| 1333 | + | |
| 1334 | + | |
| 1335 | + | |
| 1336 | + | |
| 1337 | + | |
| 1338 | + | |
| 1339 | + | |
| 1340 | + | |
| 1341 | + | |
| 1342 | + | |
| 1343 | + | |
| 1344 | + | |
| 1345 | + | |
| 1346 | + | |
| 1347 | + | |
| 1348 | + | |
1312 | 1349 | | |
1313 | 1350 | | |
1314 | 1351 | | |
| |||
0 commit comments