CompareComparison compare.comparison@1

Generated at from openvibe-contracts v0.419.0 and openvibe-sdk v0.161.0.

Version
1.0.0
Owner
compare
Visibility
public
Status
active
Compatibility
backward
Schema
https://openvibe.network/contracts/compare/comparison.v1.json

A comparison of things by weighted criteria, with finite dated results and their public sources. Missing evidence is absent, never zero.

Fields

FieldTypeRequiredDescriptionConstraints
slugstringyes
  • pattern ^[a-z0-9]+(?:-[a-z0-9]+)*$
titlestringyes
  • minLength 1
kindstringyes
  • minLength 1
summarystringyes
  • minLength 1
thingsarray of objectyes
  • items: no other fields
things[].idstringyes
  • minLength 1
things[].namestringyes
  • minLength 1
things[].makerstringyes
  • minLength 1
things[].iconstringyes
  • minLength 1
things[].urlstringyes
  • pattern ^https://
  • format uri
criteriaarray of objectyes
  • items: no other fields
criteria[].idstringyes
  • minLength 1
criteria[].labelstringyes
  • minLength 1
criteria[].unitstringyes
  • minLength 1
criteria[].groupstringyes
  • minLength 1
criteria[].betterenumyes
  • one of "higher", "lower"
criteria[].weightnumberyes
  • minimum 0
  • maximum 100
resultsarray of objectyes
  • items: no other fields
results[].thingstringyes
  • minLength 1
results[].criterionstringyes
  • minLength 1
results[].valuenumberyes
results[].as_ofstringyes
  • format date-time
results[].sourceobjectyes
  • no other fields
results[].source.labelstringyes
  • minLength 1
results[].source.urlstringyes
  • pattern ^https://
  • format uri
methodstringyes
  • minLength 1
sourcesarray of objectyes
  • items: no other fields
sources[].labelstringyes
  • minLength 1
sources[].urlstringyes
  • pattern ^https://
  • format uri
updated_atstringyes
  • format date-time
versionsarray of objectyes
  • items: no other fields
versions[].idstringyes
  • minLength 1
versions[].urlstringyes
  • format uri
versions[].as_ofstringyes
  • format date-time
availabilityarray of string
  • items: minLength 1

Examples

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

Valid: models
{
  "slug": "ai-models",
  "title": "AI models",
  "kind": "ai.models",
  "summary": "Provider prices and measured Bench results. Unmeasured quality stays unknown.",
  "things": [
    {
      "id": "maker/a",
      "name": "A",
      "maker": "maker",
      "url": "https://openvibe.exchange/models/maker/a",
      "icon": "model"
    }
  ],
  "criteria": [
    {
      "id": "input",
      "label": "Input price",
      "unit": "USD / 1M tokens",
      "better": "lower",
      "weight": 40,
      "group": "Price"
    },
    {
      "id": "output",
      "label": "Output price",
      "unit": "USD / 1M tokens",
      "better": "lower",
      "weight": 40,
      "group": "Price"
    },
    {
      "id": "quality",
      "label": "Arena quality",
      "unit": "Elo",
      "better": "higher",
      "weight": 20,
      "group": "Quality"
    },
    {
      "id": "speed",
      "label": "Median response time",
      "unit": "ms",
      "better": "lower",
      "weight": 0,
      "group": "Speed"
    }
  ],
  "results": [
    {
      "thing": "maker/a",
      "criterion": "input",
      "value": 1,
      "as_of": "2026-11-10T00:00:00.000Z",
      "source": {
        "label": "undefined price book",
        "url": "https://example.com"
      }
    },
    {
      "thing": "maker/a",
      "criterion": "output",
      "value": 2,
      "as_of": "2026-11-10T00:00:00.000Z",
      "source": {
        "label": "undefined price book",
        "url": "https://example.com"
      }
    }
  ],
  "method": "Weights use min–max normalization within this comparison (higher or lower as labelled), then a weighted mean on a 0–100 scale. Equal values receive 50. Criteria with no measurements are excluded. A thing missing any selected, measured criterion is unranked; missing is never zero. All-zero weights give no ranking. Scores express these preferences, not statistical significance. Dates are source dates or explicitly labelled observation dates. No costs or benchmark results are estimated. Different benchmark versions are separate criteria. Builder and version history are reserved for a later release. Prices use the cheapest dated offer by input + output price; both prices come from that same provider. Arena quality requires at least ten judged games and exact model identity. Speed is total response time, not tokens per second.",
  "sources": [
    {
      "label": "market",
      "url": "https://api.openvibe.exchange/api/v1/exchange/market"
    },
    {
      "label": "quality",
      "url": "https://bench.openvibe.services/api/v1/boards/chat.arena"
    }
  ],
  "updated_at": "2026-11-10T00:00:00.000Z",
  "versions": [],
  "availability": [
    "quality is unavailable; no values have been filled in."
  ]
}
Rejected: undated-result
{
  "slug": "ai-models",
  "title": "AI models",
  "kind": "ai.models",
  "summary": "Provider prices and measured Bench results. Unmeasured quality stays unknown.",
  "things": [
    {
      "id": "maker/a",
      "name": "A",
      "maker": "maker",
      "url": "https://openvibe.exchange/models/maker/a",
      "icon": "model"
    }
  ],
  "criteria": [
    {
      "id": "input",
      "label": "Input price",
      "unit": "USD / 1M tokens",
      "better": "lower",
      "weight": 40,
      "group": "Price"
    },
    {
      "id": "output",
      "label": "Output price",
      "unit": "USD / 1M tokens",
      "better": "lower",
      "weight": 40,
      "group": "Price"
    },
    {
      "id": "quality",
      "label": "Arena quality",
      "unit": "Elo",
      "better": "higher",
      "weight": 20,
      "group": "Quality"
    },
    {
      "id": "speed",
      "label": "Median response time",
      "unit": "ms",
      "better": "lower",
      "weight": 0,
      "group": "Speed"
    }
  ],
  "results": [
    {
      "thing": "maker/a",
      "criterion": "input",
      "value": 1,
      "source": {
        "label": "undefined price book",
        "url": "https://example.com"
      }
    },
    {
      "thing": "maker/a",
      "criterion": "output",
      "value": 2,
      "as_of": "2026-11-10T00:00:00.000Z",
      "source": {
        "label": "undefined price book",
        "url": "https://example.com"
      }
    }
  ],
  "method": "Weights use min–max normalization within this comparison (higher or lower as labelled), then a weighted mean on a 0–100 scale. Equal values receive 50. Criteria with no measurements are excluded. A thing missing any selected, measured criterion is unranked; missing is never zero. All-zero weights give no ranking. Scores express these preferences, not statistical significance. Dates are source dates or explicitly labelled observation dates. No costs or benchmark results are estimated. Different benchmark versions are separate criteria. Builder and version history are reserved for a later release. Prices use the cheapest dated offer by input + output price; both prices come from that same provider. Arena quality requires at least ten judged games and exact model identity. Speed is total response time, not tokens per second.",
  "sources": [
    {
      "label": "market",
      "url": "https://api.openvibe.exchange/api/v1/exchange/market"
    },
    {
      "label": "quality",
      "url": "https://bench.openvibe.services/api/v1/boards/chat.arena"
    }
  ],
  "updated_at": "2026-11-10T00:00:00.000Z",
  "versions": [],
  "availability": [
    "quality is unavailable; no values have been filled in."
  ]
}

Validate

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