Skip to main content

protocol/testing/conformance/app

packages/protocol/src/testing/conformance/app

Purpose

Public barrel for app-layer conformance properties. App-layer conformance properties. Dispatch / lease / app-callback invariants — the 14 dispatch-admission properties (request / authorize / release / dispatch-lease-consumed / dispatch-lease-expired / dispatch-lease-get / slow-first / same-conv-concurrent / release-for-one-lease) plus app-disconnect fail-policy and idempotence. Each register* lives in its own file. The dispatch-admission properties draw on the cross-impl driver in app/_driver.ts.

Public surface

ABANDON_OBSERVATION_BUFFER_MS

Variable

ABANDON_POLL_EXTRA_MS

Variable

APP_PROPERTIES

Variable
All app-layer property registrars: dispatch-admission registrars first, then the cross-category registrars (boundary unavailable, rpc-semantics idempotence).

ConsumedFrameView

TypeAlias

DISPATCH_ADMISSION_CATEGORY

Variable

dispatchAdmissionViolation

Function

DispatchTestDriver

Interface
Cross-impl driver. One DispatchTestDriver instance per property, acquired under the property’s Scope. Wires up the real server, recipient + moderator clients, and shared task / conversation fixtures.

DispatchVerdict

TypeAlias
Closed verdict union mirroring the wire DispatchAdmissionDecisionSchema. Properties that need to script a moderator’s reply pass a DispatchVerdict value to recipient.expectAuthorize / respondWith; the driver encodes it to the wire shape internally.

FAST_ACK_THRESHOLD_MS

Variable

FORBIDDEN_ERROR_TAG

Variable

freshMessageId

Function

HOLD_DRAIN_BUFFER_MS

Variable

HOLD_RELEASE_MARGIN_MS

Variable

isUuidV4

Function

leaseId

Property

leaseId

Property

leaseId

Property

LeaseIdOnlyView

TypeAlias

LeaseState

TypeAlias
Closed lease-state union mirroring LeaseStateSchema. The driver’s assertLeaseState polls app/dispatch/lease/get until the registry settles to the named state or the bound elapses (the bound is per-property; default 5 s).

makeDispatchTestDriver

Function
Acquire a fully-wired driver under the surrounding Scope. Releases close every lifecycle client + drop the connected app registration. Property authors call this from inside their property body; the driver is per-property, never shared. Cross-property state leakage is the exact failure mode the per-property scope prevents.

messageId

Property

ModeratorHandle

Interface
Moderator-side surface. Owns one AppTestClient connected to the real server under a moderator app identity, with HTTP registration plus app/network/connect already driven to install a dispatch_authorize hook. Holds the registered appId for app/dispatch/lease/get scope assertions.

NEGATIVE_OBSERVABILITY_WINDOW_MS

Variable

NO_SECOND_RELEASE_WINDOW_MS

Variable

RecipientHandle

Interface
Recipient-side surface. Owns one AgentTestClient connected to the real server under a recipient agent identity. All methods return Effects scoped to the surrounding Scope; releasing the scope closes the underlying agent client.

registerAppDisconnectFailPolicy

Function

registerDispatchAuthorizeTimeoutSynthesizesDeny

Function

registerDispatchAuthorizeVerdictResolves

Function

registerDispatchLeaseConsumedFiresOnFirstSend

Function

registerDispatchLeaseConsumedSuppressedOnSecondSend

Function

registerDispatchLeaseExpiredFiresOnTtl

Function

registerDispatchLeaseExpiredSuppressedOnConsumeBeforeTtl

Function

registerDispatchLeaseGetModeratorSeesRecord

Function

registerDispatchReleaseFiresAfterResolve

Function

registerDispatchReleaseSkippedOnAbandoned

Function

registerDispatchRequestAckMintsLease

Function

registerDispatchRequestRecipientDisconnectAbandons

Function

registerIdempotence

Function

registerReleaseForOneLeaseDoesNotWaitOnAnother

Function

registerSameConversationDispatchRequestsConcurrent

Function

registerSlowFirstDoesNotDelaySecondAck

Function

ReleaseFrameView

TypeAlias

SHORT_LEASE_TIMEOUT_MS

Variable

TIMEOUT_RELEASE_WAIT_MS

Variable

TINY_MODERATOR_TIMEOUT_MS

Variable

TTL_OBSERVATION_BUFFER_MS

Variable

verdict

Property

withDriver

Function
Run a property body inside a fresh per-property scope; acquires the driver, runs body, releases on completion.

Files

  • _driver.ts
  • _helpers.ts
  • app-disconnect-fail-policy.ts
  • dispatch-authorize-timeout.ts
  • dispatch-authorize-verdict.ts
  • dispatch-lease-consumed-fires-on-first-send.ts
  • dispatch-lease-consumed-suppressed-on-second.ts
  • dispatch-lease-expired-fires-on-ttl.ts
  • dispatch-lease-expired-suppressed-on-consume.ts
  • dispatch-lease-get-moderator-sees.ts
  • dispatch-release-after-resolve.ts
  • dispatch-release-skipped-on-abandoned.ts
  • dispatch-request-ack.ts
  • dispatch-request-recipient-disconnect.ts
  • idempotence.ts
  • index.ts
  • release-for-one-lease-does-not-wait.ts
  • same-conv-dispatch-requests-concurrent.ts
  • slow-first-does-not-delay-second-ack.ts