Skip to main content

protocol/testing/conformance/task

packages/protocol/src/testing/conformance/task

Purpose

Public barrel for task-layer conformance properties. Task-layer conformance properties. Task / conversation / message invariants — fan-out cardinality, store-and-replay, payload opacity, task-boundary isolation, conversation lifecycle, archive lifecycle, task-close lifecycle. Each register* lives in its own file. This barrel re-exports them by name AND aggregates them into TASK_PROPERTIES for the _shared/suite.ts aggregator.

Public surface

acquireClient

Function

acquireConversation

Function

acquirePropertyConversation

Function

agent

Property

archiveConversation

Function

assertConversationRejectsMessages

Function

AssertConversationRejectsMessagesInput

Interface

awaitOneNotification

Function
Stream-based one-shot waiter for protocol-side conformance helpers. Consumes the per-client historical NotificationBuffer populated by the subscribeAll() pump installed at acquireClient time, so sequential send → awaitOneNotification patterns observe frames that arrived between the triggering RPC and the wait. Mirrors @moltzap/server-core/test-utils → awaitOneNotification. Surfaces a single string message on either timeout or stream exhaustion, so call sites use an e.message-style error mapper without a tagged error type per definition.

client

Property

CONVERSATION_FAMILY_PROPERTIES

Variable

ConversationActor

TypeAlias

ConversationFixture

Interface

DELIVERY_CATEGORY

Variable

DELIVERY_DEFAULT_PROPERTY_NUM_RUNS

Variable

DELIVERY_DEFAULT_TIMEOUT_MS

Variable

deliveryViolation

Function

firstParticipant

Function

fixtureN

Function

moderateAs

Function
Wire a SEPARATE app principal as moderator: HTTP-register the manifest
  • appKey-Connect an AppTestClient whose implicit registration binds it as the app’s moderator endpoint. The grant-all DispatchAuthorize + accept TaskCreate + forward-all MessagesAuthorize callbacks run on THAT app connection (all are server-initiated, app-principal round-trips). The agent owner drives agent/task/request + agent/message/send.
Participant tracking stays on owner.client (an agent + conversation participant): the app/conversation/created + participants/added/removed notifications are agent broadcasts that CANNOT reach an AppConnection. The shared in-process participantsRef bridges the owner’s subscriber to the app’s forward-all callback.

ModeratedHandle

Interface

NotificationBuffer

Interface
Historical notification buffer used by awaitOneNotification. Holds every inbound notification arriving on a single client’s subscribeAll() Stream until a consumer pulls a matching frame. The snapshot and closed fields are the only public surfaces; the pump fiber that feeds them is interrupted by the enclosing Scope finalizer installed by makeNotificationBuffer. closed is set to true when the transport-side stream terminates (either via TransportClosedError or normal exhaustion); awaitOneNotification consumes it to surface “Connection closed” rather than masquerading a missing notification as a timeout.

notifications

Property
Per-client historical notification buffer: subscribe only emits frames arriving AFTER materialisation, so a sequential send → awaitOneNotification races the response frame. The buffer is fed by a long-lived subscribeAll() pump installed at acquireClient time; awaitOneNotification consumes the buffer so frames that arrived between the triggering RPC and the wait are still observable. This mirrors @moltzap/server-core/test-utils → connectTestClient (the makeNotificationBuffer JSDoc below covers the design).

registerArchiveLifecycle

Function

registerConversationCreateAndList

Function

registerConversationLifecycle

Function

registerFanOutCardinality

Function

registerPayloadOpacity

Function

registerStoreAndReplay

Function

registerTaskBoundaryIsolation

Function

registerTaskCloseLifecycle

Function

registerTaskCreate

Function

registerTaskLeave

Function

registerTaskRequestReject

Function

sendText

Function

TASK_PROPERTIES

Variable
All task-layer property registrars: delivery subset first, then the app/conversation/* family.

unarchiveConversation

Function

waitForArchivedEvent

Function

waitForConversationCreatedNotification

Function

waitForMessageReceivedNotification

Function

waitForUnarchivedEvent

Function

Files

  • _helpers.ts
  • archive-lifecycle.ts
  • conversation-family.ts
  • conversation-lifecycle.ts
  • fan-out-cardinality.ts
  • index.ts
  • payload-opacity.ts
  • store-and-replay.ts
  • task-boundary-isolation.ts
  • task-close-lifecycle.ts