Skip to main content
Version: 0.14.0

Trying it

A Plugin runs only under a Core, and a Core runs only what an application describes. Trying a Plugin therefore means the smallest application there is: one unit, launched from the Plugin, run from its working directory with nothing installed. The composer made it when it made the project: try/ is an application project, and the Plugin is taken into it. It exists only to run the Plugin, and it is not part of it: taking the Plugin into another application never takes try/.

Take the greeter into it​

try/ holds the program the template wrote, taken when the project was made, and nothing follows a change to plugin/ by itself. After the program replaced it, take the greeter again. From greeter/, go into try/, which is the application project, and take the Plugin from .., the path it was taken from:

cd try
yoke-compose update plugin com.example.greeter
Taking com.example.greeter runs its author's build.
source: ..
commit: none: the source is not a git tree
in: plugin/
command: CGO_ENABLED=0 GOOS=linux GOARCH="$YOKE_GOARCH" GOFLAGS=-mod=mod go build -trimpath -o "$YOKE_OUT/greeter" .
Run it? [y/N] y
took com.example.greeter again from its path, recorded in plugins.yaml

Taking a Plugin runs its author's build, so the composer shows what it will run and asks first. Here the author is you; taking somebody else's Plugin asks the same question (taking the Plugins). It then puts the executable and the Manifest into the project, declares the unit and pins the executable by its digest, and records where the Plugin came from in plugins.yaml, which nothing packages:

greeter/try/yoke.yaml
model: 1
id: com.example.greeter-try
version: 0.1.0
arch: x86_64
core: ">=0.14.0"
units:
greeter:
kind: plugin
plugin: com.example.greeter
exec: components/plugins/greeter
digest: sha256:a386316b6adea21bc25611b0912b35827425480884973fba077cefbf28f65157

arch is this machine's, as uname -m prints it, and core is the composer's own release onward (a project).

Run it​

Back in greeter/, run try/:

yoke app run --from try
greeter-try-1 runs com.example.greeter-try 0.1.0, an ephemeral instance; an interrupt stops it
from /home/you/greeter/try, whose integrity is not verified
greeter-try-1 is starting
greeter-try-1 is observable
it says of itself: bundle.unverified at /home/you/greeter/try

It runs the working directory as it is, with the same gate, the same Core and the same admission as an installed application, and verifies nothing: the instance says so about itself. It keeps running until it is interrupted, and the instance goes with it. A line such as confinement.no_cgroup_delegation is the host saying what it could not do, not a refusal.

Ask it​

From a second terminal, ask the question as an operator would:

echo -n world | yoke unit ask greeter greeter.hello --input -
yoke: scope.withheld: the unit's grant does not cover the query greeter.hello

With another instance running on this account, yoke does not choose between them and names them all: this account has 2 instances, greeter-try-1, try-1: name one with --instance. Stop the other, or add --instance greeter-try-1, the name the run printed, to this command and to each yoke command after it (instances).

The refusal is the model working. The Plugin declared the capability, and nobody granted it, so it was admitted with the question withheld. Grant it, then restart the unit, since a grant reaches a unit at its next admission (the grant is an intersection):

yoke plugin grant com.example.greeter query.hello.answer
previously not granted
effective at the unit's next admission
consequence greeter incarnation 1: still under the scope of its admission, until it is admitted again
yoke unit restart greeter
echo -n world | yoke unit ask greeter greeter.hello --input -
hello, world

What the Core knows about the unit is one command away, including its condition and the library it was written with:

yoke unit show greeter | grep -E '"(state|line|language|sdk_line)"'
"state": "Running",
"line": "ready to greet",
"language": "go",
"sdk_line": "yoke-sdk-go 0.8.1"

The grant lasts as long as the instance, and this instance lasts as long as the run: the next yoke app run starts with nothing granted.

After a change​

Every build makes a new executable, and try/ still pins the old one. A run refuses it, naming both digests. So after each change, write the Manifest again if the declaration changed, interrupt the run, and take the Plugin again, from greeter/try/, as above — the build runs as part of taking it, and the Manifest is taken with the executable:

yoke-compose update plugin com.example.greeter

Then run try/ again, from greeter/. The new instance starts with nothing granted.

A changed declaration needs a new Manifest as well. A program that declares what its Manifest does not is refused at admission, and the unit's state says Refused; the template's continuous integration catches it before that.

When it is refused​

Look atWithIt says
the unityoke unit show greeterits state, its condition, and what its plugin declared and was granted
the instance's logyoke log query --unit greeter, yoke log followevery event of the unit, its health, its occurrences, and every line it wrote to its standard output and error
the guardian's log~/.local/state/yoke/guardian.logwhat the Core said: a refused admission with its stage, its code and the reason

An admission refused because the program and its Manifest disagree is written in the guardian's log like this:

time=2026-11-02T21:45:57.725+01:00 level=WARN msg=admission unit=greeter plugin=com.example.greeter outcome=refused stage=STAGE_DECLARATION_CONSISTENCY code=admission.consistency.divergent credential=examined reason="the process declares capabilities [command.set.accept query.hello.answer event.changed.report], and its Manifest [query.hello.answer]"

The cure is the one above: print the Manifest from the program again into plugin/, and take the Plugin into try/ again (admission).

Under a debugger, the Plugin is started by hand, and a process the Core did not launch has no token. yoke app run --from try --admit-unlaunched admits one anyway. It relaxes that one check and nothing else: the declaration is still compared with the Manifest, and the grant is still the operator's.

The same, by hand

Without the composer, the smallest application is made beside the Plugin, and the Plugin's two files put in it, from the directory that holds greeter/:

yoke-compose init com.example.greeter.try --dir greeter-try --version 0.1.0 --arch x86_64 --core ">=0.14.0"
mkdir -p greeter-try/components/plugins
com.example.greeter.try made: greeter-try/yoke.yaml, with manifests/ and components/ beside it
cp greeter/greeter greeter-try/components/plugins/greeter
cp greeter/com.example.greeter.yaml greeter-try/manifests/
yoke-compose add unit greeter --dir greeter-try --kind plugin --plugin com.example.greeter \
--exec components/plugins/greeter
wrote units.greeter in greeter-try/yoke.yaml
greeter-try/yoke.yaml
model: 1
id: com.example.greeter.try
version: 0.1.0
arch: x86_64
core: ">=0.14.0"
units:
greeter:
kind: plugin
plugin: com.example.greeter
exec: components/plugins/greeter
digest: sha256:ba22fa083cae32caff2e784084b94ba4c887a61b75845c31c4305a70f4377db4

add unit pins the executable by its digest, read from the file as it is now. The project and its files are a project; --arch is the machine's, as uname -m prints it.

Every build makes a new executable, and the project still pins the old one. A run refuses it, naming both digests:

yoke: the descriptor in /home/you/greeter-try is refused: component.digest at units.greeter.digest: the executable /home/you/greeter-try/components/plugins/greeter of the unit greeter is sha256:0555…, and the descriptor states sha256:ba22…

So after each build, copy the executable and the Manifest again, and write the digest again. add unit refuses a unit already declared; set writes one field:

yoke-compose set units.greeter.digest "sha256:$(sha256sum greeter-try/components/plugins/greeter | cut -d' ' -f1)" --dir greeter-try
wrote units.greeter.digest in greeter-try/yoke.yaml

A changed declaration needs a new Manifest as well. A program that declares what its Manifest does not is refused at admission, and the unit's state says Refused.

Then run it as above, with yoke app run --from greeter-try, and ask it the same way.