Define the local evaluation task
A synthetic call plan names the exact preceding step and output field supplying a later argument. The provided results are keyed by step ID. Accept the later argument only when that field exists as an own output property and its value equals the supplied argument. A valid-looking ID from another step fails provenance.
- Read explicit step/field reference
- Resolve only that preceding result
- Compare later argument with resolved value
Absent preceding output holds the argument binding.
Use the filled cases
| Case | Supplied input | Expected structured output | Decision and reason |
|---|---|---|---|
| Argument from wrong result | {"results":{"S1":{"caseId":"C7"},"S2":{"docId":"D2"}},"ref":{"step":"S1","field":"caseId"},"argument":"D2"} | {"status":"wrong-value","expected":"C7"} | S1.caseId is C7; the valid document ID D2 belongs to S2. |
| Correct step field | {"results":{"S1":{"caseId":"C7"}},"ref":{"step":"S1","field":"caseId"},"argument":"C7"} | {"status":"bound","expected":"C7"} | The exact argument retains its declared preceding-result source. |
| Field not produced | {"results":{"S1":{"docId":"D2"}},"ref":{"step":"S1","field":"caseId"},"argument":"C7"} | {"status":"missing-reference"} | Do not fill an absent result field from memory or another call. |
Work the field-not-produced case. Which output is required, and why?
Show the worked answer
{"status":"missing-reference"} — Do not fill an absent result field from memory or another call.
Run the self-contained evaluator
import assert from 'node:assert/strict';
function evaluate(x){
if(!Object.hasOwn(x.results,x.ref.step)||!Object.hasOwn(x.results[x.ref.step],x.ref.field))return {status:'missing-reference'};
const expected=x.results[x.ref.step][x.ref.field];return {status:x.argument===expected?'bound':'wrong-value',expected};
}
const cases = [
{
"id": "wrong-result-id",
"input": {
"results": {
"S1": {
"caseId": "C7"
},
"S2": {
"docId": "D2"
}
},
"ref": {
"step": "S1",
"field": "caseId"
},
"argument": "D2"
},
"expected": {
"status": "wrong-value",
"expected": "C7"
}
},
{
"id": "correct-reference",
"input": {
"results": {
"S1": {
"caseId": "C7"
}
},
"ref": {
"step": "S1",
"field": "caseId"
},
"argument": "C7"
},
"expected": {
"status": "bound",
"expected": "C7"
}
},
{
"id": "field-not-produced",
"input": {
"results": {
"S1": {
"docId": "D2"
}
},
"ref": {
"step": "S1",
"field": "caseId"
},
"argument": "C7"
},
"expected": {
"status": "missing-reference"
}
}
];
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 provenance references as well as values in a plan evaluator. This fixture tests exact scalar references; it makes no external call and does not authorise a later write.