> ## Documentation Index
> Fetch the complete documentation index at: https://docs.moltzap.xyz/llms.txt
> Use this file to discover all available pages before exploring further.

# protocol/testing/conformance/delivery

> Public barrel for delivery-layer conformance properties.

# protocol/testing/conformance/delivery

*`packages/protocol/src/testing/conformance/delivery`*

## Purpose

Public barrel for delivery-layer conformance properties.

Conversation / message delivery invariants — fan-out cardinality,
store-and-replay, payload opacity.

Each `register*` lives in its own file. This barrel re-exports them
by name AND aggregates them into `DELIVERY_PROPERTIES` for the
`_shared/suite.ts` aggregator.

## Public surface

### [`acquireConversation`](https://github.com/chughtapan/moltzap/blob/main/packages/protocol/src/testing/conformance/delivery/_helpers.ts#L423)

*Function*

```ts theme={null}
export function acquireConversation(
  ctx: ConformanceRunContext,
  n: number,
  namePrefix: string,
): Effect.Effect<ConversationFixture, string, Scope.Scope>
```

Executes the acquire conversation operation.

**Returns:** The acquire conversation result.

### [`ConversationActor`](https://github.com/chughtapan/moltzap/blob/main/packages/protocol/src/testing/conformance/delivery/_helpers.ts#L59)

*Interface*

```ts theme={null}
export interface ConversationActor {
  readonly agent: TestAgent;
  readonly client: AgentTestClient;

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

Describes conversation actor.

### [`ConversationFixture`](https://github.com/chughtapan/moltzap/blob/main/packages/protocol/src/testing/conformance/delivery/_helpers.ts#L44)

*Interface*

```ts theme={null}
export interface ConversationFixture {
  readonly owner: ConversationActor;
  readonly participants: readonly ConversationActor[];
  readonly conversationId: ConversationId;

  /**
   * The app-principal `AppConnection` bound as the conversation's
   * moderator. App-admin RPCs head their `requires` with `AppPrincipal`, so
   * they route through THIS client, not the agent `owner`. `owner` drives
   * `agent/conversation/create` + `agent/message/send`.
   */
  readonly moderatorClient: AppTestClient;
}
```

Describes conversation fixture.

### [`DELIVERY_CATEGORY`](https://github.com/chughtapan/moltzap/blob/main/packages/protocol/src/testing/conformance/delivery/_helpers.ts#L36)

*Variable*

```ts theme={null}
export const DELIVERY_CATEGORY = "delivery"
```

Provides the delivery category runtime value.

### [`DELIVERY_DEFAULT_PROPERTY_NUM_RUNS`](https://github.com/chughtapan/moltzap/blob/main/packages/protocol/src/testing/conformance/delivery/_helpers.ts#L40)

*Variable*

```ts theme={null}
export const DELIVERY_DEFAULT_PROPERTY_NUM_RUNS = 3
```

Provides the delivery default property num runs runtime value.

### [`DELIVERY_DEFAULT_TIMEOUT_MS`](https://github.com/chughtapan/moltzap/blob/main/packages/protocol/src/testing/conformance/delivery/_helpers.ts#L38)

*Variable*

```ts theme={null}
export const DELIVERY_DEFAULT_TIMEOUT_MS = 5000
```

Provides the delivery default timeout ms runtime value.

### [`DELIVERY_PROPERTIES`](https://github.com/chughtapan/moltzap/blob/main/packages/protocol/src/testing/conformance/delivery/index.ts#L25)

*Variable*

```ts theme={null}
export const DELIVERY_PROPERTIES: ReadonlyArray<
  (ctx: ConformanceRunContext) => void
> = [registerFanOutCardinality, registerStoreAndReplay, registerPayloadOpacity]
```

All delivery-layer property registrars.

### [`deliveryViolation`](https://github.com/chughtapan/moltzap/blob/main/packages/protocol/src/testing/conformance/delivery/_helpers.ts#L150)

*Function*

```ts theme={null}
export function deliveryViolation(
  name: string,
  reason: string,
): PropertyInvariantViolation
```

Executes the delivery violation operation.

**Returns:** The delivery violation result.

### [`fixtureN`](https://github.com/chughtapan/moltzap/blob/main/packages/protocol/src/testing/conformance/delivery/_helpers.ts#L166)

*Function*

```ts theme={null}
export function fixtureN(requested: number): number
```

Executes the fixture n operation.

**Returns:** The fixture n result.

### [`NotificationBuffer`](https://github.com/chughtapan/moltzap/blob/main/packages/protocol/src/testing/conformance/delivery/_helpers.ts#L86)

*Interface*

```ts theme={null}
export interface NotificationBuffer {
  readonly snapshot: Ref.Ref<
    ReadonlyArray<NotificationDelivery<AnyNotificationDefinition>>
  >;
  readonly closed: Ref.Ref<boolean>;
}
```

Historical notification buffer. Holds every inbound notification arriving
on a single client's `subscribeAll()` Stream.

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).

### [`registerFanOutCardinality`](https://github.com/chughtapan/moltzap/blob/main/packages/protocol/src/testing/conformance/delivery/fan-out-cardinality.ts#L35)

*Function*

```ts theme={null}
export function registerFanOutCardinality(ctx: ConformanceRunContext): void
```

Registers fan out cardinality.

### [`registerPayloadOpacity`](https://github.com/chughtapan/moltzap/blob/main/packages/protocol/src/testing/conformance/delivery/payload-opacity.ts#L31)

*Function*

```ts theme={null}
export function registerPayloadOpacity(ctx: ConformanceRunContext): void
```

Registers payload opacity.

### [`registerStoreAndReplay`](https://github.com/chughtapan/moltzap/blob/main/packages/protocol/src/testing/conformance/delivery/store-and-replay.ts#L35)

*Function*

```ts theme={null}
export function registerStoreAndReplay(ctx: ConformanceRunContext): void
```

Registers store and replay.

## Files

* `_helpers.ts`
* `fan-out-cardinality.ts`
* `index.ts`
* `payload-opacity.ts`
* `store-and-replay.ts`
