Skip to main content
Version: 0.15.0

The ideas it rests on

A handful of principles explains almost every behaviour the reference describes. When something in Yoke surprises you, such as a grant that does not reach a running unit, a stream that will not start by itself, or a Core that refuses to read your payload, one of these is usually the reason. Each is stated here with what it means for the person writing or running an application.

A declaration grants nothing — how Yoke admits a Plugin

The Core does not understand your application​

The Core supervises, routes and keeps records, and it never decodes what your units send. A question, an answer, a command or a stream frame is bytes to it, labelled with a name your unit declared. The Core holds no code about any particular unit and makes no decision based on what a payload means.

For you: you choose your payload's encoding: JSON, Protocol Buffers, CBOR or raw samples. The two ends that exchange it agree on it, and Yoke never needs to know which it is. Adding a new kind of unit to an application never means changing Yoke. And because the Core cannot read a payload, it cannot check one: validating what arrives is the receiving unit's job.

A declaration grants nothing​

Yoke keeps three kinds of information apart, and none ever turns into another:

  • what a program declares about itself, in its Manifest;
  • what an operator has authorised, in the Registry;
  • what is observed while it runs, worked out when asked and never stored.

A Plugin that declares a command has not been allowed to accept it. An operator's grant does that, and the two are compared once, when the unit is admitted. A program cannot widen its own permissions by editing its own file, because its file is never the source of a permission.

For you: a new unit starts with nothing granted, and each capability is granted by an operator with yoke plugin grant. A grant reaches a unit at its next admission, so a unit already running is restarted to receive it. Building an application shows it step by step in running it.

One contract, and no back door​

Every interface reaches the units through the same published contract, the interfaces shipped with Yoke included. The manager's own client verbs, the reference browser client and the reference panels use the contract that anyone else can use, with no privileged path.

For you: anything a shipped tool does, a tool you write can do. An interface can be written in any language that opens a socket, or speaks HTTP and WebSocket, without reading Yoke's source. And because the contract is the same on every channel, the panel, the browser and the command line all see the same units, with the same authority.

Many interfaces, and a declared order between them​

Several interfaces at once is the normal case, and who prevails is the application's decision. An application may declare that two channels exclude each other and which one wins. The Core then suspends the channel that yields, tells it so through the contract, and restores it when the other leaves. A channel that wins gets precedence, never an operation the others do not have.

For you: the technician who takes over the instrument from the network, and the panel that yields to them, is a line in the description, not code in either interface (arbitration).

Traffic separated by its shape​

Control travels as a request and its answer; live data travels as a stream, on a transport of its own. A stream is started at an interface's request, never by the unit itself, and a fast stream never delays a command. Units never address each other or an interface directly: everything passes through the Core.

For you: a Plugin publishes when it is told a stream is active, and stops when it is told to stop. It declares what its data tolerates: whether a lost frame is acceptable, and whether frames out of order are. Yoke chooses the transport from those two answers, never from what the data means. A stream that tolerates loss lets a slow reader miss frames rather than slow the producer, and the gap shows in the frames' sequence numbers (streams and transports).

One host, by choice​

Yoke runs on one machine and does not try to be distributed. There is no clustering, no failover and no horizontal scaling. Each store is a local file with a single writer, which buys a simple consistency model and state an administrator can copy.

For you: backing up an instance is copying a directory, and yoke instance copy does it for you. If your problem needs more than one machine, Yoke is not the tool for it.

Nothing is a constant​

No path, no name and no count is fixed in the code. Every socket and every directory is derived from a root and an instance's name, and every copy of a unit has its own identity. That is what lets the same application run as one service at boot and as five instances on a bench, and a camera Plugin run three times on a machine with three cameras.

For you: a unit is told where everything is when it is launched, in its environment, and looks nowhere else. A program that assumes a fixed path works in one form at most (what a unit arrives with).

Security starts at the filesystem​

Who may reach a channel is decided by the filesystem first, then by a credential, then by the Registry. The three layers are separate, and passing one says nothing about the next. A local socket lets the Core know who is at the other end, because the operating system tells it. A network port does not, so a channel reachable from off the machine must carry TLS and ask the person to sign in before it may be declared at all (signing in).

For you: a panel on the device's own screen, on a local socket, can rely on who owns the socket alone. A browser on the network needs a certificate and a sign-in. Which packages a host accepts at all is decided by the keys the host trusts (trust and sealing).

Every language, the same contract​

The libraries in Go, Rust, Python, C and C++ cover the same contract, and a conformance suite, not a promise, says so. Each library keeps the idioms of its language. What one family can do with a contract, every family that offers that contract can do.

For you: choose the language that suits the unit. One application can mix a C Plugin that drives the hardware with a Python Plugin that analyses and a Rust panel, and the Core cannot tell the difference (what each family offers).