GET /namespaces/{ns}/documents/{id}?include=history returns a document’s evaluations for its current incarnation, newest first. Add all_incarnations=true for earlier lives of the same id, and history_limit to bound the list.
GET /namespaces/{ns}/evaluations/{id} (ns.evaluation(id) in both SDKs) returns one evaluation by its id, such as an answer’s evaluation_id, from any document, incarnation or judgment, shadow evaluations included. It always has context and raw, and latency_ms, how long the engine request took, retries excluded. latency_ms is absent on evaluations recorded before it was measured.
outputholds the engine’s raw numbers:p,value,dist,escape_porscore. A composite judgment’s evaluation hasparts, each part’sp; its combinedpis computed when the answer is read.include=history,contextaddscontext, the exact compiled context the engine saw.include=history,rawaddsraw, the engine’s raw response, without the engine’s token counts:context_tokensis the size that matters to you. Both are large, so they are left out by default.context_truncatedis true when the context was cut to fitmax_tokensor the engine’s limit.status: "failed"comes witherror: {class, message}.retryablefailures are retried with backoff and then hourly.terminalfailures wait for the document’s next write. A document’s answer becomes aterminalfailure, kept until the document is written again, in two cases: it failed for a reason of its own (the engine refused it or could not process it, such as output that is invalid or cannot be parsed, a document too large, or a content refusal), which is terminal at once; or it is still failing 24 hours after it last changed. Failures of the engine as a whole (server errors, timeouts, lost connections, rate limits) are retried: in an outage, documents are heldpending. The 24-hour rule applies whatever the cause. A context the engine will not take even cut to 80% of its limit failsterminalwith a message startingtoo_large:: lower the recipe’smax_tokensor send fewer fields.- The evaluation of a judgment with relations has
watermark, the log position its context was read at, andrelated_documents: every related document the context read, rendered or aggregated, as{relation, document_id, revision}. The list is part of the context, so it comes withinclude=history,contextand fromGET /namespaces/{ns}/evaluations/{id}. It is what lets an outcome or an audit see exactly what the engine read, after the documents have changed. shadow: truemarks evaluations from an activation’s shadow report. They never produce answers and are not billed.
evaluation_id still names the earlier evaluation, for an earlier revision.