Capabilities
A capability is anything a machine, runtime, device or cloud service can do or hold: a processor, a camera, a browser's storage, a JVM, an Xcode install, a Cloudflare queue. Reaktor Capabilities puts all of them in one graph. Each capability is a node that can contain smaller capabilities, offers things through typed ports, needs other capabilities through typed ports, and says whether it is available right now. Apps use the graph to wire themselves to what their device can do, and the cluster uses it to choose the machine a task runs on.
This page is a design, and none of the capability model is built. Its foundations exist: reaktor-graph's nodes and ports, typed attachments, autoWire() and shape(); platform modules such as reaktor-media, each with its own API; and the cloud inventory in reaktor-cloud. What exists today lists them, and the rest of the page says how they would combine.
Overview#
The graph starts from the three places people look for things: their own machines (Mac, Windows and Linux), phones and browsers, and cloud platforms such as GCP, Cloudflare and Supabase. Under each, capabilities nest as deep as they need to. A phone holds a system on a chip, which holds a CPU and a GPU. A browser holds origin storage. A Cloudflare account holds Workers, D1 databases and queues.
Every node and every port says whether it is available, unavailable or unknown, and why. A phone whose camera permission was denied stays in the graph: only the camera's ports turn unavailable, and the reason says that the permission was denied.
The same matching answers two questions:
- Inside one app: which provider does this need get?
autoWire()already connects every consumer port to a provider by type and key. With capabilities it also checks that the provider supports what the consumer needs. An SQLite node that needs persistent storage with file locking gets the browser's origin private file system, and an in-memory store is passed over with the reasonnot persistent. - Across machines: where can this run? A build that needs Xcode 26 and 8 GB of free memory gets the machines that qualify, the exact capabilities that matched on each, and the reason every other machine was turned down.
Try it#
The box below describes three machines and asks where an iOS build can run. In the real system collectors report the machines; here you type them. Each need lists what the work requires, and the playground shows every machine's verdict with the capabilities that matched or the reasons that failed.
- The Mac Studio qualifies. The m1-worker has Xcode but only 6 GB of free memory, and the Pixel 9 has no Xcode at all.
- Add
need("Video call") { camera("front", modes = "1080p30") }. The phone's front camera supports that mode, but its permission was denied, so the phone is unavailable with that reason. Delete{ permission = denied }and the phone qualifies. - Add
state = offlineas the first line inside the m1-worker's block. Its capabilities become unknown, and an unknown machine is never chosen: the answer says what evidence is missing. - Add
need("Browser SQLite") { browser { storage(persistent = true) } }. A requirement nested in another must be met inside the capability that matched the outer one, so only the phone's Chrome qualifies. - Change the worker's memory to
free = unknownand the iOS build reports the worker as unknown.
val studio = machine("Mac Studio") {
os("macOS", "26.1")
cpu(arch = "arm64", cores = 20)
memory(total = 64.GB, free = 30.GB)
toolchain("Xcode", "26.1")
}
val worker = machine("m1-worker") {
os("macOS", "26.0")
cpu(arch = "arm64", cores = 10)
memory(total = 32.GB, free = 6.GB)
toolchain("Xcode", "26.0")
}
val pixel = machine("Pixel 9") {
os("Android", "16")
memory(total = 12.GB, free = 5.GB)
camera("rear", modes = "4K30 1080p60")
camera("front", modes = "1080p30") { permission = denied }
browser("Chrome") {
storage("OPFS", persistent = true)
}
}
need("iOS build") {
toolchain("Xcode", atLeast = "26.0")
memory(free = 8.GB)
}
How capabilities fit the graph#
Every part of the design is a piece reaktor-graph already has, or a small extension of one. Nothing runs beside the graph.
| Capability concept | reaktor-graph piece | What is new |
|---|---|---|
| A capability | A node | A CapabilityNode base class and a NodeKind.Capability for shapes and the Graph pane |
| Sub-capabilities | The node's child graph | Nothing: ownership is the graph tree, so each capability has exactly one owner |
| What a capability offers | A provider port | offers<T>(value, offer), a provider port that also describes what it supports |
| What a capability or a feature needs | A consumer port | needs<T>(need), a consumer port that carries a requirement |
| Properties, availability and their evidence | Typed attachments on the node and its ports | Attachment keys; Port and Node gain no fields |
| Choosing a provider | autoWire() and requireFullyWired() | A support check at each step, and a reason for every candidate passed over |
| Another machine's capabilities | Its GraphShape | A capability field on NodeShape and PortShape, read as data |
| Categories such as "all containers" | Queries over the graph | Saved views; a view never owns a node |
A capability node looks like any other node:
class Camera(graph: Graph, id: String, modes: List<VideoMode>) : CapabilityNode(graph), VideoCapture, StillCapture {
override val label = "Camera $id"
val video by offers<VideoCapture>(this, VideoOffer(modes))
val stills by offers<StillCapture>(this)
}
class BrowserSqlite(graph: Graph) : CapabilityNode(graph), SqlDatabase {
private val files by needs<FileStorage>(StorageNeed(persistent = true, locking = true, space = 50.MB))
val database by offers<SqlDatabase>(this)
}
class VideoCall(graph: Graph) : BasicNode(graph) {
private val camera by needs<VideoCapture>(VideoNeed(VideoMode(1920, 1080, fps = 30), facing = Front))
}
A capability's identity is a stable id computed from its machine's enrolled id and its path in that machine's graph, such as soc/cpu or camera/1, the way an ActorKey turns a name into a stable node id. The same camera therefore has the same id after a restart, and the Capabilities pane can keep a selection across refreshes. Cloud capabilities use the provider's ids: provider, account or project, region where it applies, resource kind and the provider's resource id. Labels, host names and list positions are never identity, and serial numbers stay out of every shared view.
reaktor-core already has an interface named Capability: an empty marker that extends AutoCloseable, with AtomicCapability and ConcurrencyCapability, which gives every Node and Graph its coroutine scope. One word with two unrelated meanings in one framework would confuse every reader, so the first step renames those three, for example to Disposable, AtomicDisposable and Concurrency, before Capability takes its new meaning. The reaktor MCP server's rename recipe does each in one step across both repositories.
Nesting and many routes to one capability#
A capability gets its own node when something needs to address it on its own: it can be busy or denied independently, it has its own contract, or work reserves it. CPUs, memory pools, cameras, storage volumes, runtimes and toolchains pass that test. Clock frequency, an OS version and a core count are properties of a node. Cores, caches and camera modes become nodes only when a consumer needs to reserve or address them one by one, so depth grows where it is useful and nowhere else.
One phone, as its owner graph:
Pixel 9
OS: Android 16, API 36
SoC: Tensor G4
CPU: performance cores, efficiency cores
GPU
memory: 12 GB, shared with the GPU
storage: internal, 256 GB
cameras
rear (logical): wide and ultra-wide (physical)
front
network: Wi-Fi, 5G
screen
Chrome
origin storage (OPFS), persistent
WebGPU adapter
Relations that are not ownership are ordinary graph edges: the GPU uses the shared memory pool, and SQLite uses the storage volume. Android distinguishes logical cameras from the physical cameras behind them and limits which streams can run at once, so the collector records those limits on the camera nodes. A physical camera that cannot be opened by itself carries that fact.
A cloud resource is often reachable along several routes. A container can be found under its provider, under its Kubernetes cluster, or in a list of every container:
GCP project → k3s cluster → workload → container C ownership
Containers view ─────────────────────→ container C a query
Machine view → VM → runtime ── hosts ─→ container C a relation
Only the first route owns C. The others are queries and relations that end at the same node, so C is counted once, its capacity is counted once, and deleting the Containers view deletes nothing. Moving or removing a capability follows its owner and nothing else.
Offers, needs and dependencies#
An offer is a provider port with a description of what it supports: a camera's video modes, a storage volume's persistence, locking and free space, a toolchain's version. A need is a consumer port with a requirement: a mode and a facing, persistent storage with locking and 50 MB of space, Xcode 26 or later. Matching compares the two field by field, and a need that only says "storage" is not enough to choose between an origin private file system and an in-memory store.
A capability's dependencies are its own needs. BrowserSqlite above needs FileStorage, and it offers SqlDatabase only once that need is wired. A need can also list alternatives in order of preference: SQLite in a browser can use the opfs file system, which needs cross-origin isolation and a worker, or opfs-sahpool, which needs only a worker but cannot be shared by two tabs at once. Each alternative is matched on its own requirements, and an in-memory database qualifies only when the need allows data that disappears with the page.
An offer seen on another machine describes that machine; it cannot be called from this one. Code calls a remote capability through a Reaktor service, with the failures, delays and permissions of a network call written into its contract. A local need is never satisfied by a remote offer, because a camera in another building cannot serve an in-process video call.
Available, unavailable and unknown#
Matching asks two questions at two different times:
- Support is what a capability can do at all: its modes, versions and sizes.
autoWire()checks support when it wires, and placement checks it when it chooses a machine. - Availability is whether a capability can be used right now. Placement checks it when it chooses a machine, and code checks it at the moment it uses the capability. Wiring does not wait for availability and does not rewire when availability changes.
Availability is one of three verdicts, each with a reason and the evidence behind it:
| Verdict | Reason | Example |
|---|---|---|
| Available | The camera supports the mode, permission is granted, nothing else holds it. | |
| Unavailable | Permission denied | The user declined camera access. |
| Unavailable | Busy | Another app holds the camera. |
| Unavailable | Disabled | The owner turned the capability off in the Capabilities pane. |
| Unavailable | Not enough | 6 GB of memory is free and the need asks for 8 GB. |
| Unavailable | Failed | The device reported an error. |
| Unknown | Offline | The machine has not been heard from for four minutes. |
| Unknown | Stale | The last memory sample is older than its maximum age. |
| Unknown | Not observed | A browser cannot see the CPU model, so nothing is known about it. |
| Unknown | Probe failed | The collector crashed while it read the GPUs. |
A few rules keep the verdicts honest:
- A node's verdict covers that node; its children have their own. A phone with a denied camera is still available for compute, and the pane shows the phone as partly available.
- Unavailable and unknown capabilities stay in the graph and in the pane, with their reason and their last observation. A denied permission never hides the hardware.
- Losing a connection makes a machine's capabilities unknown. It does not remove them. Only the collector that owns a capability removes it, after a complete scan no longer finds it.
- A collector can report something absent only within what it can see. A sandboxed browser that sees no GPU proves nothing about the machine underneath.
- An unknown requirement is never treated as met. Placement chooses only machines whose evidence says yes.
- The permission check a platform makes when code opens a camera or a file always wins over a stored verdict.
Every verdict and every measured value comes from an observation: the value, the collector that produced it, when it was taken and how long it stays useful. Age is measured on the clock of the side that reads it, so a machine whose clock is wrong cannot make old evidence look fresh.
Properties, measurements and budgets#
Properties are typed values with units. Each capability kind declares its properties with their units and how they compare, and modules add kinds without changing a central list.
| Kind | Main properties |
|---|---|
| OS | Family, version, kernel, architecture, API level |
| Runtime | JVM, native process, browser, JavaScript isolate, WebAssembly or container; version and limits |
| Toolchain | Xcode, Android SDK, JDK, Gradle, Node and the like; version, and the sign-ins or licences it depends on |
| CPU | Architecture and instruction features, core groups such as performance and efficiency cores, frequency, load, and how much of the CPU this process may use |
| GPU | Vendor, API such as Metal, Vulkan, CUDA or WebGPU, driver, dedicated or shared memory, measured bandwidth |
| Memory | Total, free, the process limit, bandwidth |
| Storage | Volume, total, free, persistence, locking, measured speed |
| Screens and cameras | One node each; resolutions, frame rates, facing, permission, and which can run at the same time |
| Network | Interfaces, reachability, measured bandwidth and latency, whether it is metered |
| Power | Source, battery level, thermal state, power ceiling in watts |
A value also says where it came from, because the same quantity means different things from different sources:
| Basis | Memory on the Mac Studio | Who sets it |
|---|---|---|
| Specified | 64 GB installed | The collector, from the hardware |
| Measured | 30 GB free at 21:04 | The collector, sampled |
| Configured | Agents may use up to 16 GB | The owner, in the Capabilities pane |
| Reserved | 8 GB held by a running build | The machine's admission actor, for work it admitted |
The capacity offered to new work is the smaller of the configured and measured amounts, minus what is reserved. A process limited to two CPUs offers two CPUs, whatever the host has. Memory shared by the CPU and GPU is one pool reached two ways and is counted once. A value nobody measured stays unknown, so a missing power ceiling never becomes zero.
For choosing where work runs, the best measure of a machine is how long the same task took there before. The cluster records each run's duration with its machine and its source snapshot, so a task such as :engine:compileKotlinJvm gets a measured time per machine. Synthetic benchmarks stand in only until a machine has history, and each records its suite, version, input size, runtime and thermal state, so only like is compared with like. Multiplying cores by frequency does not predict a build's time, and GPU core counts mean different things for each vendor, so neither is used as a score.
Matching: where can this run?#
One function compares a need with an offer and returns a verdict with reasons. autoWire() uses it to wire a process, and the placement resolver uses it to choose machines.
Wiring inside a process. autoWire() keeps its five places and their order: the same graph, the graphs passed to it, the enclosing graphs, the dependency-injection scope, and the only provider of the type. At each place, a provider counts only when its offer supports the need, and every provider passed over is recorded with its reason. When nothing qualifies, the input stays open, and requireFullyWired() lists each candidate and why it failed:
Graph 'Notes' has unconnected consumer ports:
- key='files' type='FileStorage'
memory store: not persistent
OPFS (opfs): needs cross-origin isolation, and this page is not isolated
A need marked optional may stay open, and its node then runs without that capability.
Placing work across machines. The resolver reads every machine's shape and answers in five steps:
- Find candidates by what the need names: the kind, the name, and where it must be, such as inside a browser or on the machine that holds the device.
- Check support: versions, modes and sizes.
- Check availability and capacity against the evidence and its age.
- Rank what is left by the need's preferences: measured duration, data already on the machine, cost or energy.
- Return the eligible machines with the exact capabilities that matched, and every other machine with its reasons.
Preferences only order machines that already qualify; they never rescue a failed requirement. Equal inputs give equal answers, with ties broken by stable id. The answer is advice: the cluster reserves capacity through the chosen machine's admission actor, which checks again, because permission and free memory can change between the answer and the start of the work. HTCondor's matchmaking, the closest prior art, separates matching from claiming in the same way.
Cameras and GPUs. A video need asks for a real mode, such as 1080p at 30 frames per second, and a valid combination of streams; the largest resolution and the highest frame rate of a camera often cannot run together. A WebGPU need is checked against the device the page actually created, whose features and limits can be narrower than the adapter's. The host's GPU model says little about what a page may use.
Collectors#
A collector reads what a platform exposes and turns it into capability nodes and observations. Collectors live in the platform modules: cameras in reaktor-media, location in reaktor-location, sensors in reaktor-sensors, cloud resources in reaktor-cloud. reaktor-capability holds only the types, the attachments and the matching.
| Target | Where the facts come from |
|---|---|
| macOS | sysctl, system_profiler, IOKit, Metal's MTLDevice, memory_pressure, pmset, xcodebuild -version |
| Windows | WMI classes such as Win32_Processor and Win32_VideoController, DXGI adapters, GetSystemPowerStatus |
| Linux | /proc/cpuinfo, /proc/meminfo, cgroup limits in /sys/fs/cgroup, /sys/class/power_supply, NVML for NVIDIA GPUs |
| Any JVM | OSHI as a portable first pass; Runtime.availableProcessors(), which respects container limits |
| Android | Build, ActivityManager.getMemoryInfo, CameraManager, StorageStatsManager, BatteryManager, PowerManager.getThermalHeadroom |
| iOS | ProcessInfo for memory, processors and thermal state, AVCaptureDevice.DiscoverySession, Metal, UIDevice battery state |
| Browser | navigator.hardwareConcurrency, navigator.deviceMemory (rounded, Chromium only), navigator.storage.estimate() and persist(), crossOriginIsolated, navigator.gpu, navigator.mediaDevices.enumerateDevices() |
| Cloud | The reaktor-cloud sources, Wrangler inventory for Cloudflare and observability sources for Supabase, k3s, Pub/Sub and Grafana, and the Cloud pane's readers, also in reaktor-cloud |
Each machine's Reaktor process owns its machine's capability graph and is the only writer of it. It publishes the graph as part of its shape(), which Workers and the JVM server already serve at /_reaktor/shape and debug apps already stream to Hangar. A restarted process starts with a full snapshot and then sends changes in order; a gap in the order asks for a fresh snapshot. A partial scan never removes what it did not cover.
Collectors run expensive scans when hardware or topology changes, and sample load at a bounded rate; high-rate telemetry goes through reaktor-telemetry, and the graph keeps a summary. Probes that prompt the user or cost money, such as a camera permission request, a GPU benchmark or a cloud call that needs extra rights, run only when someone asks for them. Opening the Capabilities pane never triggers one. Credentials stay in reaktor-secrets, and capability records hold references to them.
Exact inventory is for scheduling on the owner's machines. Anything shown to other people or sent to a browser gets coarse values: memory rounded, models generalised, no serial numbers.
Cloud platforms#
A cloud provider's capabilities nest under the provider, then the account or project, then its services and their resources: GCP project, Kubernetes cluster, workload, container; Cloudflare account, Worker, its bindings to D1, queues and Durable Objects; Supabase project, database, storage. Categories such as VMs, Kubernetes, Workers, actors, SQL, files, pub/sub, queues and containers are views across providers, so the Containers view lists every container from every provider while each container keeps one owner.
Two kinds of cloud capability need keeping apart. A provisioned resource is running and can be used now. A provisioning offer, such as "this project can create a VM of this class", is a management capability with a cost, a quota and a permission behind it; it says nothing about spare capacity on an existing machine. Managed services offer their API contracts and limits: a Worker offers its runtime, bindings and request limits, and has no processor to report.
Inventory sources such as GCP Cloud Asset Inventory are good for seeding the graph, but their data lags. Decisions that need fresh state ask the owning service directly.
The Capabilities pane#
Hangar's Compute pane is the pane family cloud in WorkbenchPaneCatalog, with the subpanes Resources, Operations, Runs and Work, and WorkbenchSubpanes describes each subpane. Capabilities would join them at cloud/capabilities, next to the Cluster subpane that the cluster design proposes.
- The map. A graph of the capability shapes, drawn by the Graph pane's renderer, so it looks like every other map in Hangar, with a searchable list beside it. Filters cover platform, machine, kind and availability. Expanding a node shows its sub-capabilities.
- The inspector. For a selected capability: where it sits in its owner graph, the other routes that reach it, its offers and needs, its properties with their basis and age, and its availability with the reason. Selecting a container from the Containers view or from its cluster selects the same node.
- Where can this run? An inspector that runs the resolver for a need, typed or taken from a task, and shows eligible machines with what matched and the others with their reasons. It links to the task or deployment that asked. It never starts work itself.
- Changes. Disabling a capability or setting an agents' budget are kernel operations with their usual permissions. Refresh asks the owning collector and respects its rate limits.
Unavailable and unknown items stay visible, and every verdict has a readable label as well as a colour. An empty pane says whether no machine is enrolled, visibility is denied, or a source is disconnected. The Resources and Capabilities subpanes share the selected resource id, and the CLI and agents read the same shapes and resolver as the pane.
What exists today#
- reaktor-graph. Nodes with typed, keyed provider and consumer ports;
autoWire()with its five places andrequireFullyWired(); typed attachments throughAttachableandAttachmentKey, which telemetry, port semantics and evidence already use; andshape(), whoseGraphShapelists scopes, nodes with their kind, ports, attributes, contracts and channels, and wires.NodeKindhas twelve values and no capability kind.ProviderPort.isConnected()means the port has edges andConsumerPort.isConnected()means it has a provider; both describe wiring and say nothing about availability. - Platform modules.
reaktor-mediahas camera adapters for Android and Apple platforms, with audio, video and file pickers beside them.reaktor-location,reaktor-sensors,reaktor-health,reaktor-notificationandreaktor-idbeach expose their platform through their own API.reaktor-performancecollects performance reports such as app and web vitals. None of them reports what it can do in a shared form. - Cloud inventory.
reaktor-cloudhas Wrangler inventory for Cloudflare and observability sources for Supabase, k3s, Pub/Sub and Grafana. The Cloud pane's readers, also inreaktor-cloud, map hosts, machines and resources across Cloudflare, Google Cloud and Kubernetes. - The two-Mac router.
~/dev/tools/remote-devprobes the two Macs with macOS tools such asmemory_pressureand routes Gradle work by observed capacity. The cluster design takes it over. - The name. reaktor-core's
Capabilitymarker,AtomicCapabilityandConcurrencyCapability, described under How capabilities fit the graph. - An earlier proposal. An older capability page described environment detection, profiles, support tiers and fallbacks. It was never built, and it was removed in the docs clean-up; Git history keeps it.
What capabilities improve#
| Usual approach | What goes wrong | With capabilities |
|---|---|---|
Platform checks scattered through the code, such as hasCamera | Each module answers differently, and a failure says nothing about why | One graph answers for every module, and every answer carries a reason |
| A device registry kept beside the app | Two sources of truth that drift apart | The app's own graph is the inventory |
| A boolean for each feature | A denied permission looks like missing hardware | Available, unavailable or unknown, with the reason; nodes stay visible |
| Routing work by host name | Cannot say "needs Xcode 26 and 8 GB free", and the probes only work on macOS | Typed needs matched against observed capabilities on any platform |
| Benchmark scores | They predict little about a real build, and vendors' numbers do not compare | The measured duration of the same task on each machine |
| A console per cloud provider | The same resource appears under several categories and gets counted twice | One node per resource, with many routes to it |
Limitations#
- Nothing is built. There are no capability nodes, collectors, resolver or pane yet.
- Platforms limit what can be seen. Browsers hide the CPU model and round memory; iOS exposes little about hardware; sandboxes hide devices. Much of a phone's or a browser's graph will be unknown, and the design treats that as an answer.
- Answers age. Availability is a snapshot. The executor has to check again before it uses what the resolver chose.
- History takes time. Measured durations exist only after a task has run on a machine, so new machines start with estimates.
- Exact inventory identifies people. Detailed hardware data works as a fingerprint, so shared and browser-facing views must stay coarse.
- Graphs can grow large. A node per core or per camera mode would bloat the graph; nodes are added only where a consumer addresses them.
- The old name. Until the rename lands,
Capabilitymeans two things in Reaktor.
Delivery plan#
Each step is useful without the later ones.
- The model. Rename reaktor-core's marker, add
NodeKind.Capability,CapabilityNode,offersandneeds, the attachment keys for properties and availability, and the support check and explanations inautoWire(). Prove nesting, many routes, partial availability and unknown values on fixture graphs. - Desktop collectors. macOS first, then Windows and Linux: OS, toolchains, CPU, memory, storage, network and configured budgets, with GPU and power where a collector can report them truthfully. The two Macs publish their shapes, and the Capabilities subpane shows them read-only.
- Placement. The resolver and the "Where can this run?" inspector. The cluster's first step routes the existing Gradle work with it.
- Phones and browsers. Cameras, storage, origin storage and WebGPU collectors, and app nodes that declare their needs, starting with browser SQLite.
- Cloud. Adapt the
reaktor-cloudsources, with provisioned resources and provisioning offers kept apart.
Sources#
Papers:
- Rajesh Raman, Miron Livny and Marvin Solomon, Matchmaking: Distributed Resource Management for High Throughput Computing, HPDC, 1998. Machines and jobs both advertise attributes and requirements, and matching is kept apart from claiming; the design's resolver follows the same split.
Platform documentation:
- Android CameraCharacteristics and multi-camera support, for logical and physical cameras and valid stream combinations.
- Apple AVCaptureDevice.DiscoverySession.
- WebGPU, for adapters, devices, features and limits.
- SQLite WASM persistent storage options, for the
opfsandopfs-sahpoolfile systems. - MDN on StorageManager and Navigator.deviceMemory.
- NVIDIA Management Library (NVML).
Systems and standards:
- HTCondor ClassAds, the matchmaking language in use today.
- W3C Web of Things Thing Description, which separates a model of a device from an instance and its interactions.
- hwloc, for CPU, cache, memory and device topology.
- OSHI, operating system and hardware information for the JVM.
- Kubernetes Node Feature Discovery and Dynamic Resource Allocation, which keeps discovering a device apart from claiming it.
- GCP Cloud Asset Inventory, Cloudflare bindings and the Supabase Management API.
Related docs#
- Cluster - Places work on machines using this graph.
- Graph - Nodes, ports,
autoWire()andshape(), which the design extends. - Service Layer - How code calls a capability on another machine.
- Cloud pane - The Compute pane's cloud inventory today.
- Data layer - Storage contracts that SQLite and other stores need.
- Reaktor V2 - The paper's places, capability offers and placement, which this design simplifies onto today's graph.