A3S Docs
A3S AHP

Typed Decisions

Specialized AHP decision contracts for context, memory, planning, reasoning, rate limits, confirmation, idle, and intent detection.

Typed Decisions

Generic Decision is enough for ordinary action and prompt gates. Some harness points need richer payloads, so AHP v2.4 defines specialized typed events and typed decisions.

Typed events are blocking JSON-RPC requests, but they are not batchable because ahp/batch returns Vec<Decision>, not heterogeneous typed responses. Send them with send_typed_event or send_typed_event_full.

Handler Defaults

EventHandler has explicit hooks for each specialized event:

EventHandlerDefault behavior
idlehandle_idleAllows idle processing.
intent_detectionhandle_intent_detectionReturns unsupported unless implemented.
context_perceptionhandle_context_perceptionReturns unsupported unless implemented.
memory_recallhandle_memory_recallReturns unsupported unless implemented.
planninghandle_planningReturns unsupported unless implemented.
reasoninghandle_reasoningReturns unsupported unless implemented.
rate_limithandle_rate_limitReturns unsupported unless implemented.
confirmationhandle_confirmationReturns unsupported unless implemented.

The server deserializes the typed payload before calling the handler, and serializes the typed decision back into the JSON-RPC result.

Context Perception

context_perception asks the harness for workspace or knowledge context before the model continues.

Field familyExamples
Intentrecognize, understand, locate, retrieve, explore, reason, validate, compare, track.
TargetEntity, location, event, relation, rule, state, resource, or pattern.
DomainCoding, writing, data analysis, research, project management, conversation, operations, security, or general.
ModalityText, code, structured data, table, chart, image, audio, video, or any.
Urgencycritical, high, normal, or low.
Freshnessrealtime, recent, or static.
ConstraintsMax results, max context length, and whether sources should be included.

The decision can:

DecisionMeaning
allowInject facts, file snippets, project summary, knowledge strings, and suggestions.
blockSkip or deny context injection with a reason.
refineAsk the runtime to narrow intent, target, or scope before retrying.

Use refine when the agent's request is too broad for a useful context lookup.

Memory, Planning, And Reasoning

EventPayloadDecision
memory_recallSession id, query, memory type, max results, and working directory.allow with injected facts, or block with a reason.
planningSession id, task description, available strategies, and optional constraints.allow with selected strategy/template, modify with a revised task and hints, or block.
reasoningSession id, reasoning type, problem statement, and optional hints.allow with optional hints, or block.

Planning strategies include none, step_by_step, tree_of_thoughts, graph_planning, and custom. Reasoning types include chain_of_thought, tree_of_thoughts, react, reflexion, and other.

Rate Limit And Confirmation

EventUse caseDecision
rate_limitToken, request, API, tool, or custom limit was hit.retry with a delay, queue, or skip with a reason.
confirmationSafety, user, cost, or custom approval is required.approve, reject, or escalate.

The runtime still owns enforcement: if the harness says queue, skip, reject, or escalate, the agent or host process must apply that result.

Intent Detection

intent_detection runs before deeper context work. The payload includes session id, prompt, workspace, and an optional language hint. The harness can return:

DecisionMeaning
allowDetected intent, confidence score from 0.0 to 1.0, and optional target hints.
blockSkip detection and let the runtime use a local fallback.

Target hints can include target type, target name, and domain.

Event Context

Any AHP event can also carry EventContext outside the typed payload. It provides recent facts, memory summary, session stats, current task, and arbitrary client capabilities. Harnesses should ignore unrecognized capabilities and only depend on fields they explicitly need.

On this page