ResourceOffer platform.resource-offer@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/resource-offer.v1.json

What one node or external provider can run right now (roadmap WS-Z9, decision 43): capabilities, multidimensional capacity, measured latencies, health and pricing. First-party only: it carries capacity the public node registry (network.node@1) deliberately leaves out.

Fields

FieldTypeRequiredDescriptionConstraints
offer_idstringyes
kindenumyes
  • one of "node", "provider"
node_idstringnetwork.node@1 id, for kind node
providerstringprovider or hosting company
adapterstringcarrier or provider adapter id, for kind provider (e.g. nats-v1, cf-queue-v1)
regionstringyes
cellstring
trustenumyes
  • one of "first-party", "partner", "community", "external"
capabilitiesarray of stringyese.g. node:http, worker:browser, worker:ffmpeg, worker:ai-gpu, events:gateway, events:durable, object:r2
  • items: pattern ^[a-z][a-z0-9-]*:[a-z0-9.-]+$
capacityobject
  • no other fields
capacity.cpuobject
  • no other fields
capacity.cpu.utilizationnumber
  • minimum 0
  • maximum 1
capacity.cpu.available_coresnumber
  • minimum 0
capacity.memoryobject
  • no other fields
capacity.memory.utilizationnumber
  • minimum 0
  • maximum 1
capacity.memory.available_mbnumber
  • minimum 0
capacity.networkobject
  • no other fields
capacity.network.ingress_mbpsnumber
  • minimum 0
capacity.network.egress_mbpsnumber
  • minimum 0
capacity.network.available_mbpsnumber
  • minimum 0
capacity.diskobject
  • no other fields
capacity.disk.iops_availablenumber
  • minimum 0
capacity.disk.scratch_gbnumber
  • minimum 0
capacity.disk.utilizationnumber
  • minimum 0
  • maximum 1
capacity.gpuobject
  • no other fields
capacity.gpu.typestring
capacity.gpu.vram_free_mbnumber
  • minimum 0
capacity.gpu.utilizationnumber
  • minimum 0
  • maximum 1
capacity.workersobjectfree worker slots by kind (browser, ffmpeg, ai, …)
capacity.queuesobjectqueue depth and age by name
capacity.event_loop_lag_msnumber
  • minimum 0
latency_msobjectmeasured p50/p95 by operation, e.g. publish_p95, ack_p95
healthobjectyes
  • no other fields
health.statusenumyes
  • one of "up", "degraded", "down", "draining"
health.error_ratenumber
  • minimum 0
  • maximum 1
health.checked_atstring
  • format date-time
pricingobjectyes
  • no other fields
pricing.modelenumyes
  • one of "prepaid", "per-request", "per-byte", "per-operation", "per-second", "free-allowance", "mixed"
pricing.marginal_usd_per_unitnumber
  • minimum 0
pricing.unitstring
pricing.rate_cardstringplatform.rate-card id when the price comes from one
updated_atstringyes
  • format date-time

Examples

From the contract's own test fixtures: valid ones validate, rejected ones must fail.

Valid: owned-node
{
  "offer_id": "off_oregon_1",
  "kind": "node",
  "node_id": "ovh-oregon-1",
  "provider": "ovh",
  "region": "us-west",
  "cell": "wnam-1",
  "trust": "first-party",
  "capabilities": [
    "node:http",
    "worker:browser",
    "worker:ffmpeg",
    "events:durable"
  ],
  "capacity": {
    "cpu": {
      "utilization": 0.31,
      "available_cores": 5.5
    },
    "memory": {
      "available_mb": 18300
    },
    "workers": {
      "browser": 6,
      "ffmpeg": 3
    },
    "queues": {
      "media-jobs": {
        "depth": 2,
        "oldest_ms": 40
      }
    }
  },
  "latency_ms": {
    "publish_p95": 3.1
  },
  "health": {
    "status": "up"
  },
  "pricing": {
    "model": "prepaid",
    "marginal_usd_per_unit": 0,
    "unit": "job"
  },
  "updated_at": "2026-09-28T23:00:00Z"
}
Valid: provider
{
  "offer_id": "off_cf_queue",
  "kind": "provider",
  "provider": "cloudflare",
  "adapter": "cf-queue-v1",
  "region": "global",
  "trust": "external",
  "capabilities": [
    "events:queue",
    "events:durable"
  ],
  "health": {
    "status": "up",
    "error_rate": 0.0001
  },
  "pricing": {
    "model": "per-operation",
    "rate_card": "rc_cf_queue_ops"
  },
  "updated_at": "2026-09-28T23:00:00Z"
}
Rejected: bad-capability
{
  "offer_id": "x",
  "kind": "node",
  "region": "us-west",
  "trust": "first-party",
  "capabilities": [
    "Browser"
  ],
  "health": {
    "status": "up"
  },
  "pricing": {
    "model": "prepaid"
  },
  "updated_at": "2026-09-28T23:00:00Z"
}
Rejected: missing-health
{
  "offer_id": "x",
  "kind": "node",
  "region": "us-west",
  "trust": "first-party",
  "capabilities": [
    "node:http"
  ],
  "pricing": {
    "model": "prepaid"
  },
  "updated_at": "2026-09-28T23:00:00Z"
}

Validate

const contracts = require('openvibe-contracts');
contracts.validate('platform.resource-offer@1', value);   // { valid, errors: [{ path, message }] }