Skip to content

descriptor_dir and qualification_dir: the scan of an add, written and answered - #141

Merged
linuxnow merged 10 commits into
mainfrom
cluster/plugin-hostd-140-descriptor-dir
Oct 24, 2026
Merged

linuxnow merged 10 commits into
mainfrom
cluster/plugin-hostd-140-descriptor-dir

Conversation

@linuxnow

@linuxnow linuxnow commented Oct 24, 2026 •

Copy link
Copy Markdown
Contributor

Closes #140.

Two keys beside state_root: descriptor_dir (default $XDG_STATE_HOME/omx/descriptors, else ~/.local/state/omx/descriptors, /var/lib/omx/descriptors run as root) and qualification_dir (the same under omx/qualification). OMX_DESCRIPTOR_DIR and OMX_QUALIFICATION_DIR stand in for the defaults in tests; the key in the settings file holds over them. A missing directory is made 0700; one that cannot be written stops the daemon with -528.

After an add is answered, a plugin whose binary has no descriptor yet is scanned in a child (probe key, default plugin-hostd-probe, run as describe) and the descriptor is written once as @-<sha256 first 12>.json, the naming rule of plugin-qualify#141. The add never waits for the scan. descriptor_get answers the file's path, or -529 none, -530 the scan runs, -531 it wrote nothing.

The man page has a DIRECTORIES section generated from the same rows. make test is green on the desk; six new sabotage arms each turn their test red.

Scan: the descriptor of an add is gathered through plugin-hostd's own plugin-hostd-probe describe, selected by the probe key, and not through plugin-qualify's scanners. The file name and location rule is the one plugin-qualify#141 uses, so both write and find the same files. Switching the scanner later is a change of that key in the settings file, not of the code.

A daemon that reads a JSON file on every scan must give the tree back;
the probe never needed to.
The CLAP id after the last '#', or the LV2 URI: what a scanned
descriptor's file is named by.
A row says which one file holds the plugin's code: the .clap of a CLAP
uri, the file an LV2 bundle's manifest names with lv2:binary. The name
of a scanned descriptor hashes it, as plugin-qualify's scanners do.
Two state directories beside state_root, with the defaults of the
directory table of the contract-definitions spec (6.9):
$XDG_STATE_HOME/omx/descriptors and $XDG_STATE_HOME/omx/qualification,
/var/lib/omx/... for a daemon run as root, else ~/.local/state/omx/...;
OMX_DESCRIPTOR_DIR and OMX_QUALIFICATION_DIR stand in for the defaults
in tests. The probe key names the scanner an add runs.

A scanned descriptor is named <id>@<version>-<hash>.json, the rule of
plugin-qualify's scanners: characters outside [A-Za-z0-9._-] as _,
'unversioned' when the plugin states none, and the first 12 hex digits
of the binary's SHA-256. descriptor_get answers the file's path, or one
of four new codes: -528 a directory that cannot be written, -529 no
descriptor, -530 the scan runs, -531 the scan wrote nothing.

The man page gains a DIRECTORIES section generated from the same rows,
so the documented defaults are the code's.
At start both directories are resolved, made 0700 when missing and
tried for a write; one that cannot be written stops the daemon with
-528 and names the key and the path.

After an add is answered, a plugin whose binary has no descriptor yet
is scanned by '<probe> describe <target>' in a child of its own; its
stdout goes to a temporary file, which is named by the plugin id, the
version it states and the binary's hash and renamed into place once.
The add never waits for the scan and is never refused by it.
descriptor_get answers from the file in the directory.

The tests' daemons keep both directories in their own temporary tree.
Values over the wire and on disk: the file a CLAP and an LV2 add write,
named as the header says and byte-identical to describe's output; one
scan per binary; a changed binary gets a new file and the old one
stays, a changed LV2 data file keeps the name; pending and failed scans
answer their codes while the add stands; a read-only or missing-parent
directory stops the daemon with -528; a missing key lands in the
default the protocol documents, the variable stands in for it and the
key holds over the variable.

Six sabotage arms break each of these guards and see its test go red.
The descriptor and qualification directory comments named a private specification; they now say what the rule is.
…E default is not run as root

The test expected the $HOME path from whatever euid it ran under. CI runs as root, where the daemon picks /var/lib; that branch would write there, so the test skips it as root and checks the $HOME one otherwise.
@linuxnow
linuxnow merged commit 7a77818 into main Oct 24, 2026
35 checks passed
@linuxnow
linuxnow deleted the cluster/plugin-hostd-140-descriptor-dir branch October 24, 2026 12:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

descriptor_dir and qualification_dir: configured, read on add, written by the scanners it runs

1 participant