CostSnapshot platform.cost-snapshot@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/cost-snapshot.v1.json

Cost and volume for a window, by carrier or provider, with the counterfactuals: what the same work would have cost all-local, all-provider and with the optimiser (roadmap WS-Z9 task 6).

Fields

FieldTypeRequiredDescriptionConstraints
window_startstringyes
  • format date-time
window_endstringyes
  • format date-time
project_idstring
  • pattern ^prj_[0-9A-HJKMNP-TV-Z]{26}$
scopestringyesevents, jobs, ai, media, …
by_targetarray of objectyes
  • items: no other fields
by_target[].idstringyes
by_target[].unitsnumberyes
  • minimum 0
by_target[].cost_usdnumberyes
  • minimum 0
by_target[].p50_msnumber
  • minimum 0
by_target[].p95_msnumber
  • minimum 0
actual_usdnumberyes
  • minimum 0
counterfactual_usdobjecte.g. all_local, all_provider, lowest_latency

Examples

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

Valid: events-day
{
  "window_start": "2026-09-28T00:00:00Z",
  "window_end": "2026-09-29T00:00:00Z",
  "scope": "events",
  "by_target": [
    {
      "id": "pg-delivery",
      "units": 18294,
      "cost_usd": 0,
      "p50_ms": 11,
      "p95_ms": 37
    }
  ],
  "actual_usd": 0,
  "counterfactual_usd": {
    "all_provider": 0.02
  }
}
Rejected: no-targets
{
  "window_start": "2026-09-28T23:00:00Z",
  "window_end": "2026-09-28T23:00:00Z",
  "scope": "events",
  "actual_usd": 0
}

Validate

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