Define the local evaluation task
A synthetic request sheet supplies one observed mark state per printed option: marked, empty or obscured. The local sheet allows exactly one selection. Empty means an observed blank; obscured means unresolved. Any obscured mark stops acceptance even if another option is marked; otherwise require exactly one marked option.
- Read observed mark states
- Hold obscured evidence first
- Check exactly one clear selection
Unknown state labels or obscured marks need source review, not a default false.
Use the filled cases
| Case | Supplied input | Expected structured output | Decision and reason |
|---|---|---|---|
| One clear mark | {"options":[{"id":"delivery","state":"empty"},{"id":"collection","state":"marked"}]} | {"status":"accepted","selected":["collection"],"unknown":[]} | Only collection is observed selected; printed delivery text is not a choice. |
| Another mark is obscured | {"options":[{"id":"collection","state":"marked"},{"id":"courier","state":"obscured"}]} | {"status":"review","selected":["collection"],"unknown":["courier"]} | Courier could affect the one-selection rule, so a visible collection mark cannot settle it. |
| Every option is visibly blank | {"options":[{"id":"delivery","state":"empty"},{"id":"collection","state":"empty"}]} | {"status":"count-error","selected":[],"unknown":[]} | This is a known zero-selection error, separate from obscured evidence. |
Work the nothing-selected case. Which output is required, and why?
Show the worked answer
{"status":"count-error","selected":[],"unknown":[]} — This is a known zero-selection error, separate from obscured evidence.
Run the self-contained evaluator
import assert from 'node:assert/strict';
function evaluate(x){
if(x.options.some(o=>!['marked','empty','obscured'].includes(o.state)))return {status:'invalid',selected:[]};
const selected=x.options.filter(o=>o.state==='marked').map(o=>o.id),unknown=x.options.filter(o=>o.state==='obscured').map(o=>o.id);
return {status:unknown.length?'review':selected.length===1?'accepted':'count-error',selected,unknown};
}
const cases = [
{
"id": "one-observed-mark",
"input": {
"options": [
{
"id": "delivery",
"state": "empty"
},
{
"id": "collection",
"state": "marked"
}
]
},
"expected": {
"status": "accepted",
"selected": [
"collection"
],
"unknown": []
}
},
{
"id": "obscured-second",
"input": {
"options": [
{
"id": "collection",
"state": "marked"
},
{
"id": "courier",
"state": "obscured"
}
]
},
"expected": {
"status": "review",
"selected": [
"collection"
],
"unknown": [
"courier"
]
}
},
{
"id": "nothing-selected",
"input": {
"options": [
{
"id": "delivery",
"state": "empty"
},
{
"id": "collection",
"state": "empty"
}
]
},
"expected": {
"status": "count-error",
"selected": [],
"unknown": []
}
}
];
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)}));
Retain the observed mark state beside the chosen option. This fixture assumes staff-supplied observations; it makes no claim about image recognition accuracy.