Layers
graph TD
R[WorkManager runtime] --> H[Virtufin.Worker.Host]
C[Virtufin.WorkManager.Client] --> H
W[Worker package] --> D[Domain devkit]
D --> B[Virtufin.Behavior.DevKit]
B --> K[Virtufin.Worker.DevKit]
B --> C
K --> H
R -.loads.-> W
Rules
- Host → nothing. The runtime ships the host contract (
IWorker,IWorkerContext,WorkerEventRules); it must not know a worker toolkit exists. - Toolkit → the workmanager contracts and the API client only.
Virtufin.Worker.DevKitimplementsIWorker(WorkerCore<,>, and the single-outputWorkerBase<,>on it) and owns the codecs and envelope helpers;Virtufin.Behavior.DevKitbuildsBehaviorWorkerBaseonWorkerCore<,>and implementsIWorkManagerClient(Virtufin.WorkManager.Client) andIVirtufinApi(Virtufin.Api.Client) locally. Neither references a domain devkit. - Domain devkit → toolkit. One domain's codecs and bases, over
BehaviorWorkerBase. - Worker → domain devkit. A worker package is a thin subclass and its config constants.
Type identity
The WorkManager loads each worker into its own AssemblyLoadContext, which
resolves dependencies by simple assembly name from the host first. Two
consequences follow:
- The host contract assembly must be the only assembly with its name; the runtime and the worker then share the same types.
- A renamed host assembly needs a coordinated cutover (see Compatibility).
Why the host was renamed
The WorkerManager loads workers into per-worker AssemblyLoadContexts that
resolve by simple assembly name. A host contract named Virtufin.Worker.DevKit
and a toolkit of the same name cannot coexist in one host, so:
- the host contract moved to
Virtufin.Worker.Host0.24.0; - the toolkit took the freed name,
Virtufin.Worker.DevKit0.24.0; - the old 0.x package was deleted, and old worker packages do not load on 0.24.0.