Define the local evaluation task
A synthetic result envelope supplies separate diagnostic and payload channels. Only payload is the business value; diagnostic is retained separately for local review. Payload must exist as an own property, including a permitted null value. A diagnostic that resembles the desired answer is never a fallback payload. These channels are authored labels, not claimed model-provider features.
- Check payload channel presence
- Read business value only from that channel
- Keep diagnostic text separate
Missing payload requires envelope correction, not a diagnostic fallback.
Use the filled cases
| Case | Supplied input | Expected structured output | Decision and reason |
|---|---|---|---|
| Diagnostic text differs from label | {"diagnostic":"drafting","payload":{"label":"A"}} | {"status":"payload-present","value":{"label":"A"}} | Business label A comes only from payload. |
| Only diagnostic channel | {"diagnostic":"label A"} | {"status":"missing-payload"} | A plausible diagnostic cannot fill the missing business channel. |
| Explicit null payload | {"diagnostic":"nothing found","payload":null} | {"status":"payload-present","value":null} | Presence and value are separate: the channel exists with null. |
Work the explicit-null-payload case. Which output is required, and why?
Show the worked answer
{"status":"payload-present","value":null} — Presence and value are separate: the channel exists with null.
Run the self-contained evaluator
import assert from 'node:assert/strict';
function evaluate(x){return Object.hasOwn(x,'payload')?{status:'payload-present',value:x.payload}:{status:'missing-payload'};}
const cases = [
{
"id": "diagnostic-not-label",
"input": {
"diagnostic": "drafting",
"payload": {
"label": "A"
}
},
"expected": {
"status": "payload-present",
"value": {
"label": "A"
}
}
},
{
"id": "diagnostic-only",
"input": {
"diagnostic": "label A"
},
"expected": {
"status": "missing-payload"
}
},
{
"id": "explicit-null-payload",
"input": {
"diagnostic": "nothing found",
"payload": null
},
"expected": {
"status": "payload-present",
"value": null
}
}
];
for (const c of cases) assert.deepEqual(evaluate(c.input), c.expected, c.id);
console.log(JSON.stringify({checked:cases.length,caseIds:cases.map(c=>c.id)}));
Use a separate validator for the extracted business value. Channel separation does not prove the value is correct, complete or authorised for import.