WorkloadRequirements platform.workload-requirements@1
Generated at from
openvibe-contracts v0.79.0 and
openvibe-sdk v0.25.0.
- Version
- 1.0.0
- Owner
- network
- Visibility
- first-party
- Status
- active
- Compatibility
- backward
- Decision
- ADR-034
- Schema
https://openvibe.network/contracts/platform/workload-requirements.v1.json
What a workload needs, so the platform can place it (roadmap WS-Z9). Hard constraints are filtered before any objective is scored; a cheaper candidate that misses one is never chosen.
Fields
| Field | Type | Required | Description | Constraints |
|---|---|---|---|---|
kind | string | yes | what runs, e.g. watch.browser, media.transcode, ai.run, events.deliver | |
mobility | enum | yes |
| |
latency_class | enum | yes |
| |
objective | enum | yes |
| |
max_latency_ms | number |
| ||
deadline_ms | number |
| ||
max_cost_usd | number |
| ||
durability | enum |
| ||
residency | string | region or jurisdiction the work and its data must stay in | ||
trust | array of enum | trust levels allowed to run it |
| |
region | string | a region, or 'nearest' | ||
capabilities | array of string | capabilities a candidate must offer (worker:browser, …) | ||
resources | object |
| ||
resources.cpu | number |
| ||
resources.memory_mb | number |
| ||
resources.gpu | boolean | |||
resources.scratch_gb | number |
| ||
resources.egress | enum |
| ||
project_id | string |
| ||
partition_key | string | stable key for rendezvous placement (room, stream, session) |
Examples
From the contract's own test fixtures: valid ones validate, rejected ones must fail.
Valid: browser-watch
{
"kind": "watch.browser",
"mobility": "job",
"latency_class": "interactive",
"objective": "balanced",
"max_latency_ms": 1000,
"max_cost_usd": 0.002,
"durability": "at-least-once",
"trust": [
"first-party",
"partner"
],
"region": "nearest",
"capabilities": [
"worker:browser"
],
"resources": {
"cpu": 2,
"memory_mb": 1024,
"egress": "public"
}
}Valid: ledger
{
"kind": "billing.post",
"mobility": "stateful-partition",
"latency_class": "critical",
"objective": "correctness",
"durability": "authoritative"
}Rejected: no-mobility
{
"kind": "x",
"latency_class": "background",
"objective": "cheapest"
}Rejected: unknown-objective
{
"kind": "x",
"mobility": "job",
"latency_class": "background",
"objective": "free"
}Validate
const contracts = require('openvibe-contracts');
contracts.validate('platform.workload-requirements@1', value); // { valid, errors: [{ path, message }] }