A3S Docs
A3S AHP

Events

Blocking event families, notifications, durable runtime contracts, and batching rules.

AHP Events

AHP event types are grouped by synchronization semantics and decision shape.

Event Matrix

EventTimingBlockingDecision shapeBatchable
pre_actionBefore a tool or action executesYesDecisionYes
post_actionAfter a tool or action completesNoNotificationYes
pre_promptBefore an LLM requestYesDecisionYes
post_responseAfter an LLM responseNoNotificationYes
session_startSession beginsNoNotificationYes
session_endSession endsNoNotificationYes
errorOperation failedNoNotificationYes
heartbeatPeriodic liveness/statusNoNotificationYes
successOperation succeededNoNotificationYes
idleAgent asks whether background work should runYesIdleDecisionNo
intent_detectionClassify user intent before deeper context workYesIntentDetectionDecisionNo
context_perceptionRetrieve or inject workspace contextYesContextPerceptionDecisionNo
memory_recallRetrieve facts from memoryYesMemoryRecallDecisionNo
planningSelect or modify planning strategyYesPlanningDecisionNo
reasoningProvide reasoning hints or block reasoningYesReasoningDecisionNo
rate_limitDecide backpressure after a limit is hitYesRateLimitDecisionNo
confirmationAsk for approval, rejection, or escalationYesConfirmationDecisionNo
run_lifecycleDurable run state transitionNoNotificationYes
task_listAuthoritative task-list snapshotNoNotificationYes
verificationVerification status and evidence snapshotNoNotificationYes

Durable Runtime Contracts

AHP v2.4 adds three durable notification contracts for supervisors, dashboards, replay systems, and audit logs:

ContractPurpose
run_lifecycleStable state transition for a run: created, planning, executing, verifying, completed, failed, or cancelled.
task_listAuthoritative task graph snapshot with statuses, evidence, artifacts, dependencies, and errors.
verificationValidation snapshot with checks, artifacts, evidence, residual risks, and status.

These contracts do not replace policy hooks such as pre_action. They provide runtime state snapshots that can be reduced from richer SDK-specific events.

Batching

ahp/batch amortizes transport overhead for homogeneous generic policy checks. It is not a general-purpose multiplexing mechanism.

Rules:

  • Batch responses contain BatchResponse { decisions: Vec<Decision> }.
  • Event order is preserved.
  • The number of decisions must equal the number of submitted events.
  • Server-side handler failures become Decision::Block.
  • Specialized decision events are rejected.
  • handshake and query are rejected in batches.
  • The server can enforce HarnessConfig.batch_size.

Use individual typed events when the return type is not the generic Decision. See Typed Decisions for the specialized payload contracts.

Depth

The depth field makes recursive AHP activity visible. A harness can advertise and enforce HarnessConfig.max_depth; events above that depth are rejected.

On this page