Skip to content
20 min readUpdated 28 Oct 2026

Reaktor Service

A service in Reaktor is one Kotlin class that names its operations. The phone, a Cloudflare worker, a Durable Object and the Spring server all use that same class. A server overrides the operations it answers, a client binds the class to a link, and the graph wires either one into the nodes that need it. Every call runs through one pipeline that carries the trace, the deadline, retries and interceptors, whatever the transport. Every failure reaches the caller as one of four kinds it can tell apart.

Older code and pages may name RequestHandler, ServiceContract, ServiceNode, ServiceInterceptor or ServiceTransport. Those types are gone: Service, Link, Served, Interceptor and the graph's ContractNode replace them.

This page starts with the whole picture and a playground, then explains each part, what the layer improves on and where it falls short.

Overview#

How a Reaktor service works. One Kotlin class declares the operations. A client binds the class to a link and calls it like a function. The call passes the client's interceptors, travels over the link, passes the server's interceptors and reaches the handler that answers it. A failure reaches the caller as one of four kinds. In the graph, a service is a contract node that other nodes consume.MessagingApi : Service("bestbuds.messaging")val getMessages by get<ChatPage, Messages>("/messages/{chatId}")val markRead by post<String, MarkedRead>("/messages/{chatId}/read")Each operation also declares its effect, idempotency, deadline and status.MessagingApi() over linka server overrides what it hostsClientcalls it like a functiongetMessages(page)a Unit input takesno argumentClient interceptorsSpans · telemetryRetry · retryBearerAuth · securityyour own · applicationLinkHttpLink, LocalLinkbindingLinkdurableObjectLinkSocketLink, QueueLinkServer interceptorsSpansBearerAuthenticationAuthRequirementsyour ownHandlersuper.getMessages.handle { page -> … }reject(403, NotInChat)Interceptors run in order of position: telemetry 100, deadline 200, retry 300, security 400, application 500.outcome { … }WHAT THE CALLER GETSthe value, on successRejected: refused, not retriedUnavailable: retried, except 501OutcomeUnknown: retried if safeContractDrift: served as 502IN THE GRAPHremote(api) or serve(server) adds a ContractNode with a port per operationconsumes(MessagingApi()) gives a node a client, wired by typerelay(node) re-provides every port, so a backend can be switched/_reaktor/shape lets the Graph pane draw every service as one system
One class declares the operations. A call passes the client's interceptors, travels over a link and passes the server's interceptors before the handler answers it. The caller always gets the value or one of four failure kinds.

A service groups named operations that one graph offers another: phone to worker, worker to worker, worker to Durable Object, app to the Spring server, or two nodes in one process. The layer owns the contract, how a call travels and how it fails. Storage, durable workflows and native code have their own layers; see the Data layer and Unified FFI and RPC.

The same class works on both sides. A client binds it to a link with over and calls each operation like a suspend function. A server subclasses it and answers the operations it hosts with handle. Between the two, interceptors add tracing, retries and authentication on each side, and the link carries the call over HTTP, a Cloudflare service binding, a Durable Object, a socket, a queue or within one process. In the graph, a service is a contract node, and other nodes consume it by type.

PartWhat it isHow you declare it
ServiceA class that names its operations and who may call themopen class MessagingApi : Service("bestbuds.messaging")
OperationOne typed call, with its route, effect, idempotency and deadlineopen val getMessages by get<ChatPage, Messages>("/messages/{chatId}")
HandlerThe server's answer to one operationoverride val getMessages = super.getMessages.handle { page -> … }
LinkHow a client's calls leave the processMessagingApi() over HttpLink(baseUrl)
InterceptorCode that wraps calls on the client, the server or bothInterceptors.install(…), graph.intercept(…)
OutcomeThe value, or one of four failure kindsoutcome { messaging.getMessages(page) }
Contract nodeA service in the graph, consumed by typeremote(api), serve(server), consumes(api)

Try it#

The box below declares a cut-down messaging service and calls it five times. Edit the Kotlin and the right side updates as you type. Choose a call to see the request it becomes, with each field placed in the path, the query or the body. Below it, a table shows what the caller gets for each answer the server could send, and whether Retry repeats the call. The playground follows the rules of RouteBinding.kt and the Retry interceptor. It reads data classes, enum classes, value classes, one Service subclass with get, post, put, patch, delete and call operations, and calls at the bottom.

Some changes to try:

  • Change getMessages from get to post. limit moves from the query into the JSON body. Retry still repeats an unknown outcome, because the operation's effect is ReadOnly.
  • Then remove effect = Effect.ReadOnly as well. Retry no longer repeats an unknown outcome, because a POST with no idempotency might run twice.
  • Change search to get<ChatPage, Messages>("/search/{chatId}"). The call that went to the default route, POST /bestbuds.messaging/search, now has its own: the chat id moves into the path, encoded as c%201, the limit into the query, and before is left out because it is null.
  • In the last call, add chatId = "c2". The call encodes, because every field without a default now has a value.
data class ChatPage(val chatId: String, val limit: Int = 50, val before: String? = null)
data class Reaction(val messageId: String, val emoji: String)
data class Messages(val items: List<String>)
data class Sent(val id: String)

open class MessagingApi : Service("bestbuds.messaging") {
    open val getMessages by get<ChatPage, Messages>("/messages/{chatId}", effect = Effect.ReadOnly)
    open val markRead by post<String, Sent>("/messages/{chatId}/read")
    open val react by post<Reaction, Sent>("/messages/{messageId}/reactions", idempotency = Idempotency.Keyed)
    open val search by call<ChatPage, Messages>()
}

val messaging = MessagingApi() over HttpLink("https://messaging.example.com")
messaging.getMessages(ChatPage(chatId = "c1", limit = 20))
messaging.markRead("c1")
messaging.react(Reaction(messageId = "m9", emoji = "👍"))
messaging.search(ChatPage("c 1"))
messaging.getMessages(ChatPage(limit = 20))

How it works#

What exists in source#

The contract layer lives in reaktor-service/src/commonMain/kotlin/dev/shibasis/reaktor/service/contract/:

FileHolds
Service.ktThe root class: get, post, put, patch, delete, call, stream, topic, queue, handle, over, Unlinked
Operation.ktCall, Stream, Route, Effect, Idempotency
Link.ktThe client pipeline, CallAttributes, CallMetadata
Served.ktThe server pipeline, handle and dispatch for adapters, LocalLink
RouteBinding.ktHow an input becomes a path, a query and a body, and back again
Exchange.ktOne call in flight, Metadata, exchange()
Outcome.ktThe failure kinds, reject, outcome, reply bodies
Wire.ktReply shapes: Wire.Plain and Wire.Tagged
Interceptor.kt, Resilience.kt, Spans.ktInterceptors and their order, Retry with RetryBudget, spans
HttpLink.ktCalls over HTTP through Ktor
Channels.kt, Broker.kt, Socket.kt, Join.ktTopics and queues, an in-process broker, calls and streams over one socket, joins and quorums
Shape.kt, Compatibility.ktA contract's shape, its fingerprint, and whether two shapes are compatible

The package above it keeps Access (who may call), Trace and HttpTracing, and the legacy Request and Response bases that older wire types still extend.

Every Kotlin worker and the Spring server still serve /_reaktor/shape to worker service tokens. That is the island's graph with its contracts and operations, which the Graph pane draws as the whole system.

Native code is not a Service link yet. InteropRuntime already supports synchronous JSON calls and callbacks across Kotlin, C++ and TypeScript. The unified FFI/RPC design proposes a shared exchange engine and graph-admitted Service bindings; cross-runtime streams are still proposed work.

Declaring a service#

The class is the contract. This is BestBuds' messaging service, shortened:

open class MessagingApi : Service("bestbuds.messaging") {
    override val access = ServiceAccess(Callers.SignedIn, ::sendBotMessage to WorkerServices)
    override val wire = MessagingFailures

    open val getTopMessages by get<Unit, MessagingResponse.TopMessages>("/topMessages")
    open val getMessages by get<ChatPage, MessagingResponse.Messages>("/messages/{chatId}")
    open val sendBotMessage by post<BotMessage, MessagingResponse.Sent>("/messages/{chatId}/bot", status = 201)
    open val markRead by post<String, MessagingResponse.MarkedRead>("/messages/{chatId}/read")
}
  • Identity. Service(id, version) names the service once; the version defaults to 1. Each by get<In, Out>(…) declares one Call<In, Out>. Its name is the property name and its id is the service id and the name, for example bestbuds.messaging/getMessages. call<In, Out>() declares one without a route, which is then POST /<service id>/<name>.
  • What a call does. Each declaration can say its effect, its idempotency, a deadline, the success status and an explicit name. Effects run from ReadOnly and LiveRead through NonProductionWrite, ProductionReversibleWrite, CredentialWrite and DataMigration to Destructive; the default is UnknownRemoteEffect.
  • When a retry is safe. A call may be repeated when its effect is a read, when it is idempotent, or when its method is GET, HEAD, PUT, DELETE or OPTIONS. An Idempotency.Keyed call gets a fresh idempotency-key header, which stays the same across that call's retries.
  • Who may call. access says it for the service, with exceptions per operation: everyone, anyone signed in, or holders of a permission. Above, every operation needs a signed-in user, and sendBotMessage is for worker services only.
  • How replies look. wire is described under Failures, outcomes and call context.
  • Shape and fingerprint. service.shape lists each operation's family, route, effect, idempotency, status and input and output schemas, and each channel. service.fingerprint is a hash of it. Every call sends reaktor-contract: <id>@<fingerprint>, and Compatibility.between(client, server) says whether two shapes match exactly, are compatible, or are not.

Serving and calling#

A server subclasses the root and answers the operations it hosts. From the messaging worker:

private class CloudflareMessagingService : MessagingApi() {
    override val getMessages = super.getMessages.handle { page ->
        signedIn {
            val entity = SocialWorkerRepository.entity(db, page.chatId, me.id) ?: reject(403, NotInChat)
            val names = if (entity.type == "campaign") MessagingWorkerRepository.circleNames(db, page.chatId, me.id) else emptyMap()
            val messages = MessagingWorkerRepository.getMessages(db, page.chatId, me.id, PaginationContext(page.limit, page.offset), names)
            val unread = MessagingWorkerRepository.unreadCount(db, page.chatId, me.id)
            announceDelivered(page.chatId)
            MessagingResponse.Messages(MessagingWorkerRepository.chat(page.chatId, entity, messages, unread))
        }
    }
}
  • super.getMessages.handle { input -> output } answers one operation. Leave early with return@handle value.
  • An operation the class does not override goes to the class's link. A server has no link, so it answers 501, which no retry repeats. A mock or a worker therefore implements only what it hosts.
  • signedIn { } is a BestBuds helper, not part of reaktor. It resolves the caller once and gives the handler me and the database.

A client is the same class bound to a link:

val messaging = MessagingApi() over HttpLink("https://messaging.example.com")
val page = messaging.getMessages(ChatPage(chatId = chatId, limit = 50))
val top = messaging.getTopMessages()
  • over binds once; binding a second link throws.
  • An operation whose input is Unit is called with no argument.
  • MessagingApi() over LocalLink(CloudflareMessagingService()) calls a server in the same process through the full server pipeline, with no network.

How an input travels#

RouteBinding.kt turns an input into a request and back, from the input's own fields:

  • Path parameters come from the fields of the same name. ChatPage(chatId, limit, offset) on GET /messages/{chatId} puts the chat id in the path and sends limit and offset as query parameters.
  • A single value fills the route's only parameter. markRead("c1") posts to /messages/c1/read with no body. This works for a String, a number, an enum or a value class.
  • POST, PUT and PATCH send the input as a JSON body. GET and DELETE send the remaining fields as query parameters, repeating the name for each list item.
  • On the server, path parameters override body fields, query values fill the fields the body leaves out, and a single path parameter decodes straight into a single-value input. A cron that posts {} to /purge/run?confirm=yes fills PurgeConfirmation(confirm = "yes").
  • An input that still extends Request keeps the old behaviour, so bodies from installed apps, with their headers and pathParams keys, still decode.

Streams, channels and sockets#

  • stream<In, Out>() declares an operation that answers a Flow<Out>.
  • topic<M>(name) delivers each message to every subscriber, and queue<M>(name) to one consumer. Both take a delivery guarantee (at most once or at least once), an ordering (none, total or per key), a capacity, an overflow rule, a number of attempts and an optional dead-letter channel.
  • Broker delivers channel messages in process. SocketLink carries calls, streams and published messages over one WebSocket, and SocketSession serves them on the other end.
  • Join.kt has joinWithin, which pairs two flows by key within a time window, and firstSuccess and quorum for racing several attempts.

Failures, outcomes and call context#

Failures#

KindMeaningComes fromRetried by Retry
RejectedThe server refused. Repeating the call will not helpreject(…), and any other 4xx except 408 and 429Never
UnavailableNot served now; may work later408, 429, 501, 503, a connection that timed out, a deadline that passed before sendingYes, except 501
OutcomeUnknownThe call may or may not have happenedother 5xx, a broken connection, no answer within the deadline, an unclassified exceptionOnly when the call is safe to repeat
ContractDriftA 2xx whose body does not match the declared outputa client and server on different contract versionsNever. Served as 502

A handler refuses with a status and a message, or with a typed problem the caller can read back:

if (reaction.emoji.isBlank()) reject(400, "emoji is required")
reject(SlotTaken(slotId))

The second form answers 409 by default, and the caller reads the problem with failure.problemAs<SlotTaken>().

The caller decides what each kind means for it:

when (val result = outcome { messaging.getMessages(page) }) {
    is Outcome.Success -> show(result.value)
    is Outcome.Rejection -> explain(result.failure.message)
    is Outcome.Failure -> later(result.failure.retryAfter)
    is Outcome.Unknown -> refresh()
}

When only the value matters, outcome { … }.valueOrNull is enough. BestBuds wraps this as attempt, which also records the failure.

Replies#

A failure is answered as {"error": "<message>", "problem": { … }}, with a Retry-After header when an Unavailable says when to come back. A service's wire decides the final shape:

  • Wire.Plain, the default, writes the body as it is.
  • Wire.Tagged adds the output's type name to each reply. Failures become an error variant of the output type, such as {"type": "….Failure.NotFound", "message": "…"}, plus any fixed fields. BestBuds uses three of these, Refusals, LowercaseRefusals and Failures, to answer in the shapes its older store builds decode, including the hack field their failure classes require.

Call context#

  • Inside a handler, and anything it calls, exchange() returns the call: its metadata (headers, with case-insensitive names), attributes, deadline and remaining, attempt and the trace. exchangeOrNull() returns null outside a call.
  • Deadlines. Each call has one: its declared deadline, otherwise the link's, 25 seconds by default. It is never later than the deadline of the call it runs inside. It travels as reaktor-deadline in milliseconds, and a server refuses a call that arrives after it with 504.
  • Trace. Each call is a child span of the call it runs inside and sends traceparent. The app session travels as baggage: reaktor-session=….
  • Attributes. withContext(CallAttributes(values)) { … } adds attributes to every call made inside the block, and CallAttributes.install { … } adds them process-wide. LocalLink passes on only attributes whose names start with forward..
  • Headers. withContext(CallMetadata(headers)) { … } adds headers to every call made inside the block, including calls through graph ports. They are applied after reaktor's own headers, and interceptors run after both. The BestBuds analytics sink sends the signed-in user's token this way, so its EventBatch stays plain data:
val accepted = withContext(CallMetadata(headers)) { ingest(EventBatch(events, definition)) }

Interceptors#

An interceptor wraps calls on one or both sides:

interface Interceptor {
    val position: Int get() = Position.Application
    val sides: Set<Side> get() = Side.Both
    val families: Set<Family> get() = AllFamilies
    suspend fun <In, R> intercept(exchange: Exchange<In, R>, next: Next<In, R>): R
}
  • Position sets the order, lowest first and outermost: Telemetry 100, Deadline 200, Retry 300, Security 400, Application 500.
  • Sides are Client and Server. Families are Call, Stream, Publish and Deliver.
  • Where to install one: for the whole process with Interceptors.install(…); for a graph and its child graphs with graph.intercept(…); for one service node through graph.serve(service, …) or graph.remote(api, …); for one link or served service with .intercept(…).
  • Order at the same position: process first, then graph, node and endpoint; outer graphs before inner ones; then installation order.

Built in:

InterceptorPositionWhat it does
RetryRetryClient calls and publishes. 3 attempts; waits 400 ms then 1.2 s, give or take 30%; honours Retry-After up to 4 s; stops when the deadline would pass; shares a budget of 10 retries that refills by 0.1 per success. HttpLink and QueueLink install one unless told not to
SpansTelemetryOne span per call on each side: trace, contract, operation, status and timing, plus the graph node, port and wire that made the call
BearerAuth, ServiceAccount, DevAuth (reaktor-auth)SecurityClient side. Add the user's bearer token and renew it once on a 401, or sign the call as a service account
BearerAuthentication, AuthRequirements (reaktor-auth)SecurityServer side. Resolve the caller from the token, then decide whether the call may proceed and record the decision

BestBuds' workers sign their calls to each other with one ServiceAccount interceptor on the internal links, instead of adding service headers to each request.

Links and adapters#

A link is how a client's calls leave the process. Client links:

LinkCarries calls to
LocalLink(service)A server in the same process, through its full pipeline
HttpLink(baseUrl)An HTTP server, through Ktor. Connect timeout 10 s, idle timeout 30 s
bindingLink(binding)Another worker through a Cloudflare service binding, without the public internet
durableObjectLink(namespace, name)One Durable Object
SocketLinkThe other end of one WebSocket: calls, streams and published messages
QueueLink(binding)A Cloudflare queue. The message travels in an envelope with its metadata, so the trace survives the queue
A graph port, through consumesWhichever service the graph wired to that port (see Services in the graph)
UnlinkedNothing. The default, which answers 501

Serving:

  • A Cloudflare worker mounts its services on Hono with Hono().mount(served), or every server node of a graph with Hono().mount(graph) or graph.toHono(). Routes with literal segments are registered before routes with parameters, so /plans/new wins over /plans/{id}.
  • A Durable Object or PartyServer room answers typed operations without a router: served.answers(request) says whether a request is one of the service's routes, and served.respond(request) answers it.
  • Handlers reach Cloudflare through the call. exchange().cloudflare is the worker's environment and execution context, with requireR2, d1OrNull, postgres(binding) { … } and exchange()[binding].
  • Work after the response. CloudflareContext.waitUntil("what") { … } keeps the caller's trace and logs a failure under its name.
  • Queues. graph.queue(batch, env, executionContext) is a worker's queue handler. It finds the channel for the queue, opens each envelope, delivers the message through the channel's broker, then acknowledges it or asks the queue to retry it with backoff.
  • Spring. served.toRouter(), or listOf(…).toRouter(), serves the same contracts from WebFlux.

Native code is not reachable through a link yet; see Unified FFI and RPC.

Services in the graph#

Service nodes#

A graph adds a service as a server it hosts or as a client of a remote one. From BestBuds' backends:

override val messaging by lazy { remote(MessagingApi() over userLink(Servers.MessagingServer, user)) }
override val circles by lazy { serve(CirclesMock(world, user.id)) }

Both create a ContractNode. It provides one port for the whole service, typed contract:<service id>, and one port per call, typed contract:<service id>/<operation>. Its shape attributes (service, version, role, transport, fingerprint and base URL) are what the Graph pane shows. Spans from its calls carry the node, the graph's digest and the port.

Consumers#

A node takes a whole client, or only the operations it calls:

private val me by consumes(MeApi())
private val enqueueOperation by consumes(MatchingApi().enqueue)
  • consumes(service) returns a client of that service bound to a port. Its calls go to whichever service node the graph wires to the port, following relays back to the original node. Until something is wired, a call fails with a message that names the missing provider, and service.connected is false.
  • consumes(call) returns a CallPort for one operation, wired by that operation's own type, so the node depends on nothing else. It is called like the operation: enqueueOperation() for a Unit input, or enqueueOperation.attempt() through BestBuds' helper.
  • A call through a port keeps the caller's context, including CallMetadata, and adds the wire's id to its span, so a trace shows which graph edge carried each call.
  • consumes is also the verb for ordinary ports, so a node declares everything it needs the same way.

Relays and switchable backends#

graph.relay(source) re-provides every port of another node, connected by real edges, so the graph shows the hop. origin follows a chain of relays back to the first node.

BestBuds builds its backends from this. Remote and Mocked each provide all 18 services, the first from the real servers and the second from an in-memory world, and each opens a service only when something uses it. Build relays each service from the variant its wiring picks. The wiring mock,plans:Dev mocks everything except plans. Services that depend on another follow it: the chat and user streams follow messaging, rounds follow circles and compass follows trials. Tab graphs relay from the backend in turn, for example val service = relay(backend.circles).

Wiring#

Graph.wire() wires an application tree at once: the graph, its child graphs and the graphs inside its containers.

  1. Each graph auto-wires its own ports first.
  2. Each port left over is connected to the nearest provider of its type: first in its own graph and the graphs below it, then in its parent's tree, and so on outwards. A provider with a matching key wins over one that only matches the type.
  3. Two equally near candidates are an error that names both. A port still unconnected at the end is an error that lists it.

awaitWired() suspends until wiring has finished. Within one graph, auto-wiring falls back to the only provider of a type in scope, including imported graphs. A child graph runs on its parent's dispatcher unless it is given its own. graph.intercept(…) installs interceptors for every service node in the graph and its children.

Navigation is wired by the same rules. A binding declares where its screen can go, by the type of the destination's binding:

class LobbyBinding : RouteBinding<Payload>(Payload()) {
    val circleWelcome by exit<CircleWelcomeBinding>()
}

val route = Root("/circles", ::CirclesHomeBinding, ::CirclesHomeScreen)
val welcome = Route("/circles/{id}/welcome", ::CircleWelcomeBinding, ::CircleWelcomeScreen)
  • An exit is a port typed by its destination. Wiring connects it to the one route bound by that type, and Graph.wire() reports an exit that has no route.
  • Route(pattern, ::Binding, ::Screen) adds a route and its screen in one line. Root also makes it the bottom of the stack, and Root(::Container) does the same for a container.
  • A route carries a typed payload: circleWelcome.push(CircleRoute(circle)) on one side and toRoute<CircleRoute>() on the other. The class's fields become the route's parameters.
  • A graph can be steered directly with graph.currentRoute, graph.replaceWith(route) and graph.popToRoot().

What it improves#

Usual approachWhat goes wrongReaktor's approach
A hand-written HTTP client next to a separate server routerThe two drift apart. A renamed field or route fails only when the call is made, often in production.One class is the contract for both sides. Every call sends the contract's fingerprint, and a reply that no longer matches arrives as ContractDrift instead of a half-decoded value.
An OpenAPI or protobuf file with generated codeIt is a second source of truth with a build step per language, and the generated types are not the ones the app uses.The Kotlin class is the only declaration. service.shape describes it as data for tools, and every Kotlin target shares the same types.
Exceptions or bare status codes as the failure modelA caller cannot tell "refused" from "maybe happened", so it either repeats a payment or gives up on a read.Four failure kinds, Rejected, Unavailable, OutcomeUnknown and ContractDrift, and Retry repeats an unknown outcome only when the operation says that is safe.
Retry loops written at each call siteRetries stack up across layers, ignore deadlines and hammer a struggling server.One Retry interceptor with jittered waits, Retry-After, a shared budget and the call's deadline, which travels with the call.
A different client for each transport: HTTP, service bindings, Durable Objects, queues and socketsThe same operation is written several times, and tracing, auth and retries differ by transport.One pipeline and one interceptor chain for every link. Moving a call from HttpLink to bindingLink or LocalLink changes one line.
Mocks wired by hand for tests and previewsEach screen needs its own fake, and the fakes drift from the real API.A mock is a subclass that overrides what it hosts. The graph relays each service from the real or the mocked backend, chosen by one wiring string.
Service dependencies hidden in constructorsNobody can see which feature calls which backend until something breaks.Contract nodes and consumes ports put every service dependency in the graph, and Hangar draws the whole system from /_reaktor/shape.

Limitations#

  • Retry decides from declarations. A POST that keeps the default effect, UnknownRemoteEffect, and no idempotency is never repeated after an unknown outcome, even when repeating it would be safe. Declare effect and idempotency to allow retries.
  • A mismatched reply is caught after the call ran. ContractDrift arrives with a 2xx, so the server has already done the work. Compatibility.between can compare two shapes before that happens.
  • Native code is not a link yet. FFI calls go through InteropRuntime, outside this pipeline. Unified FFI and RPC is the plan to bring them in.
  • The playground is a model. It follows the rules of RouteBinding.kt and Retry for the Kotlin it reads. It does not run Ktor, interceptors or the server's decoding, and it does not compute the contract's fingerprint.

What is left#

In reaktor:

  • The payload type parameter. RouteBinding<P> still carries a payload type that typed routes make unnecessary; it is written at 43 sites.
  • The tooling's own contract model. The kernel, the conductor, DevTools and Hangar's agent reads declare their operations, safety classes and outcomes separately from this layer, with 88 hand-written MCP tool schemas. Moving them onto Service is the largest remaining merge.
  • Not built yet: durable job handles, duplex contracts beyond sockets, and native calls as a link.

In BestBuds:

  • Message finishing. AcceptedChatMessage, the last input that extends Request, moves to a reaktor queue channel, whose envelope already carries the trace. The consumer needs a reader for raw bodies still in the queue during that deploy.
  • Empty acknowledgements. ChatUpdateAccepted and MessageFinished become Unit.
  • The last swallowed failures at service boundaries: login and account deactivation in UserRepository, push delivery in NotificationDispatchService, and two context reads in the Plans and Circles workers.
  • Deploys waiting on decisions: the Analytics worker waits on the ClickHouse migration, and the website worker on the next web deploy.
  • The legacy SocialApi retires when installed apps no longer call it.

Reference#

ModuleOwns
reaktor-service, package service.contractService roots, operations, links, serving, failures, reply shapes, interceptors, retry, spans, channels, contract shapes
reaktor-service, jvmMainServing contracts from Spring WebFlux: served.toRouter()
reaktor-graph-runtimeContract nodes, consumes, call ports, relays, graph-wide interceptors, Graph.wire(), navigation
reaktor-cloudflareMounting on Hono, Durable Object and PartyServer rooms, service-binding and Durable Object links, queues, the Cloudflare context
reaktor-authBearer-token and service-account interceptors, authentication and access decisions
reaktor-ffiNative calls. Not a service link yet

ContractTest in reaktor-service covers routes, a single value filling the only path parameter, the HTTP round trip, interceptor order, retries, deadlines over LocalLink, spans and compatibility. WireTest and TaggedWireTest cover reply shapes, and SocketTest, BrokerTest and JoinTest cover sockets, channels and joins.

  • Graph covers nodes, ports and wiring, which contract nodes build on.
  • Data layer covers storage and how the data design uses these contracts.
  • Auth covers the tokens and checks the security interceptors apply.
  • Unified FFI and RPC covers native calls and the proposed Service bindings.
  • Graph pane covers how Hangar draws services as one system.