agentfootprint
Version:
The explainable agent framework — backtrack a wrong answer to the exact context that caused it (evidence, not guesses). Built on footprintjs.
37 lines (36 loc) • 2.09 kB
TypeScript
/**
* refusalStatus — the HTTP status every hosting refusal answers with, by its
* code. ONE table, read by every door that speaks HTTP (`httpHost` and the
* adapters built on it, `streamHandler`), so the same refusal never answers
* with two statuses at two doors.
*/
/**
* Status codes mapped by refusal code. Anything else is a 500.
*
* Not one of them is a 5xx: none of them is the agent breaking. A closed host is
* shutting down (503); four are conflicts with the state the session is already
* in (409) — a run already going, a question already outstanding, a decision
* with nothing to decide, a pause this reply cannot describe. A 500 would tell
* every dashboard that ever sees it something untrue.
*
* `ERR_DECISION_REQUIRED` is the one 400 (8.13.0): the session is in a perfectly
* consistent state and it is the REQUEST that is wrong — it answered a consent
* gate with a value instead of a decision. Nothing ran and the pause is still
* there, so the same caller can send the right shape and continue.
*
* `ERR_RESUME_DECISION` is a 409: a decision that does not answer the request
* this session is paused on — a duplicate that arrived after the first one
* resumed the run and it paused again, a decision already used, one for a call
* the stored pause no longer holds. The decision conflicts with the session's
* state; nothing ran, and the pending ask (if any) is still there to answer.
*
* The artifact rows (9.23.0) follow the same reading. The two 400s are
* requests the same caller can fix (a malformed wire op; an op with no
* session). `ERR_ARTIFACT_NOT_FOUND` is 404 — the honest HTTP word for "no
* data at this name", and deliberately ONE status for missing, expired and
* another-session's alike, so the wire teaches a caller nothing about scopes
* it does not own. The two 501s are deployments that cannot do this at all —
* an agent without a store, a wire without the body shape — which no retry
* and no different request will change.
*/
export declare const REFUSAL_STATUS: Readonly<Record<string, number>>;