Skip to main content

simulator/network

packages/simulator/src/network

Purpose

Simulator network contracts and run-scoped services.

Public surface

AgentConnection

Interface
Runtime identity issued for one scope-owned autonomous agent.

AgentHandle

Class
A participant whose autonomous runtime is owned by the run scope.

AttachedEndpoint

Interface
Router output used by an experiment-controlled endpoint.

Endpoint

Class
A run-scoped participant controlled directly by the experiment program.

EndpointInbox

Interface
Run-scoped delivery stream maintained by the simulator kernel.

EndpointTransport

Interface
A ready, scope-owned endpoint attachment. The receive ingress is subscribed before acquisition returns and retains deliveries until its consumer advances.

InboundLinkStage

TypeAlias
Wraps one in-process inbound delivery stream with the active policies of its receiver. The stage preserves per-sender FIFO order while letting deliveries from different senders progress independently.

LinkController

Class
Experiment-facing directed-link control installed by the run kernel.

LinkControllerService

Interface
Run-scoped, evidence-producing directed-link control.

LinkDelivery

Interface
One opaque signed message about to cross a directed link.

LinkDriver

Class
Platform link implementation. A program only requires this service when it actually acquires a disabled-link scope.

LinkDriverService

Interface
Platform operations that change one directed data-plane link. Waiting for the platform’s serialization permit is interruptible and leaves the link in its pre-call state. Once the permit is acquired, the mutation is an uninterruptible linearization point and is never rolled back. A pending interruption can therefore surface after the mutation with the link in its post-call state. A typed failure occurs before that point and also leaves the pre-call state. A caller that must own or compensate a committed mutation masks the driver call through scope-finalizer registration. Scoped release awaits enable instead of detaching cleanup.

linkPolicy

Variable
Canonical link policies for the common traffic shapes.

LinkPolicy

TypeAlias
Decides one delivery on a directed link. A policy reads only its input and the ambient Clock; the link interpreter, never the policy, spends time and records evidence.

LinkPolicyLease

Interface
Removes one installed policy from its directed link.

linkVerdict

Variable
Constructors and matchers for the closed verdict union.

LinkVerdict

TypeAlias
Closed per-delivery decision returned by a link policy.

makeAgentHandle

Function
Construct an agent handle at the simulator network boundary. Returns: Nominal autonomous-agent identity.

makeEndpoint

Function
Construct a controlled endpoint from one ready attachment and its inbox. Returns: The immutable controlled endpoint capability.

makeParticipantHandle

Function
Construct a participant handle at the simulator network boundary. Returns: Nominal participant identity.

makeRouterStopReport

Function
Construct a nominal stop report at a platform boundary. Returns: Immutable evidence that the Router scope released.

Network

Class
Network operations available to the customer program.

networkError

Function
Normalize an implementation failure at the network boundary. Error causes contribute their message alone so one operation reads the same way whether the boundary raised a thrown Error or a plain description. Returns: Typed network failure.

NetworkError

Class
An operational failure at a simulator network boundary.

NetworkOperation

TypeAlias
Network operation names used by typed failures.

NetworkService

Interface
Controlled endpoint operations installed for one run scope.

ParticipantHandle

Class
A network participant identity. The hidden symbol prevents structurally similar identity data from being used as a simulator handle.

ParticipantIds

TypeAlias
Nonempty participant identities accepted by a transport boundary.

Router

Interface
Run-scoped Router fixture lifecycle.

RouterProvider

Class
Router acquisition service supplied by the platform Layer.

RouterProviderService

Interface
Router acquisition service supplied by the platform Layer.

RouterStopped

Class
Shutdown evidence available only after the Router scope has released.

Files

  • endpoint.ts
  • failure.ts
  • index.ts
  • link.ts
  • participant.ts
  • router.ts