Is malformed output invalid JSON, or just the wrong shape?
Both count. malformed_output fires in two distinct cases: output that doesn’t parse at all, broken JSON, a trailing comma, prose wrapped around what should be a raw object, and output that parses perfectly fine but violates the shape the call site declared, a field missing, the wrong type, an extra field nobody asked for.
The second case is the more common one, and the easier one to miss without something watching for it. Output that parses is easy to mistake for output that’s correct: a response returning a quantity as the string “3” instead of the number 3 loads without an error and then fails somewhere downstream, in code that never expected to receive a string there.
Either way, the classifier treats them the same, as a violation of the declared contract, and records the actual mismatch as evidence rather than just a pass or fail flag.