Skip to content

plugin-cardwire

Placement runtime (out-of-process over gRPC)
Source github.com/opencharly/plugin-cardwire/candy/plugin-cardwire
Candy plugin-cardwire

This plugin is not listed in charly/charly.yml’s compiled_plugins:. It is not part of the shipped binary: charly builds and loads it out-of-process over gRPC when a plan references one of its words (the coexist path).

The reserved words this plugin serves:

  • cardwire — command class

OUT-OF-TREE charly COMMAND-class plugin for the cardwire GPU-manager surface (ogc/cardwire — the Open Gaming Collective’s eBPF/LSM GPU-blocking daemon, CachyOS/Arch first): command:cardwire (status | list | config | gpu block|unblock | manager). status is a deterministic, GPU-less-graceful host report: the cardwired systemd state, the /etc/cardwire/cardwire.toml whitelisted keys (auto_apply_gpu_state / experimental_nvidia_block / battery_auto_switch / battery_auto_switch_mode / external_display_auto_switch) and the BPF-LSM facts read DIRECTLY from /sys/kernel/security/lsm (the same canonical reads plugin-bpf’s status performs — R3: one canonical surface, no ad-hoc copies, no shelling out to charly bpf; the plugin is self-contained). list parses the REAL cardwire list –json shape (the two-GPU fixture captured in the Phase-0 spike: Virtio 1.0 GPU id 0 + NVIDIA GeForce RTX 4080 SUPER id 1) into stable keys, N/A-graceful when cardwire is absent (exit 0 — the host-independent check-cardwire-local bed assertion), exit 1 only on a REAL failure of an installed cardwire. config get|set <key> [value] reads/writes the toml atomically (tmp+rename, mirroring cardwire’s own approach). gpu <id> block|unblock is the MUTATING enable/disable surface: it forks /usr/bin/cardwire, then VERIFIES the blocked flag actually flipped via cardwire list –json (the daemon enforces mode-dependent semantics; verification is the honest contract) — cardwire UNAVAILABLE → exit 1 (a mutating surface refuses, never pretends). manager status passes through.

This candy carries NO install content: the CachyOS/Arch install plan lives in the sibling candy/cardwire-install candy (the ONLY install surface), keeping the check-cardwire-local R10 bed’s host deploy NON-MUTATING (R1: the in-plugin-candy install executed on the operator host during the local bed’s deploy-add). The check-cardwire-vm bed (opencharly/distro-cachyos, goal task 4) composes both candies.

The CUE schema below is the authoritative grammar for this plugin’s input. It is the same single source that generates the plugin’s Go parameter types and answers the runtime Describe RPC, so this page cannot disagree with either.

// plugin-cardwire's OWN self-contained CUE schema — the SINGLE SOURCE for this plugin's
// served declaration surface (there is no schema-less plugin: every plugin ships a
// non-empty schema over Describe).
//
// SELF-CONTAINED and PACKAGE-LESS: it references no base def and carries no package
// clause, so it compiles STANDALONE — the property the SDK's serve-side compile needs
// and the property that lets the host splice `base ++ plugin` at the load gate
// (registerPluginUnitSchema); a self-contained schema that will not splice is a LOUD
// load failure.
//
// NO GO CONSUMER: the plugin declares no typed `plugin_input` (its authored input is
// its pass-through CLI grammar), so this schema generates NO `params` package and has
// NO `cue exp gengotypes` artifact — it is the SERVED documentation/config surface,
// not a code-generation source.
//
// It DOCUMENTS the `command: cardwire` contract. The command is CLI-dispatched (`syscall.Exec`), so the provider advertises NO gRPC capability; the concrete subcommands live in the CLI grammar.
#CardwirePlugin: {
// The command word the plugin serves.
command: "cardwire"
// What the command does, in one line (the public-docs surface).
contract: string & !=""
}

See also the candy reference for this candy’s install surface.