DeliveryPolicy events.delivery-policy@1

Generated at from openvibe-contracts v0.79.0 and openvibe-sdk v0.25.0.

Version
1.0.0
Owner
events
Visibility
public
Status
active
Compatibility
backward
Decision
ADR-034
Schema
https://openvibe.network/contracts/events/delivery-policy.v1.json

How an event type is carried (roadmap WS-Z3 task 2): its delivery class sets the minimum semantics, which a publisher's intent may raise and never lower; ordering is per key; the route planner picks the carrier.

Fields

FieldTypeRequiredDescriptionConstraints
classenumyes
  • one of "realtime_ephemeral", "interactive", "interactive_durable", "domain", "critical", "background", "bulk", "webhook"
durabilityenumyes
  • one of "none", "optional", "required"
delivery_semanticsenumyes
  • one of "at_most_once", "at_least_once"
orderingobject
  • no other fields
ordering.scopestringyes
ordering.keystringyes
latencyobject
  • no other fields
latency.target_p95_msnumber
  • minimum 0
latency.maximum_p95_msnumber
  • minimum 0
retentionobject
  • no other fields
retention.hotstring
  • pattern ^[0-9]+[hdm]$
retention.replaystring
  • pattern ^[0-9]+[hdm]$
retention.archivestring
  • pattern ^[0-9]+[hdmy]$
routingobject
  • no other fields
routing.objectiveenum
  • one of "latency_first", "cheapest", "balanced", "correctness"
routing.multi_providerboolean
batchingobject
  • no other fields
batching.max_messagesinteger
  • minimum 1
batching.max_delay_msinteger
  • minimum 0
residencyobject
  • no other fields
residency.inherit_project_regionboolean
residency.regionstring
max_payload_bytesinteger
  • minimum 1
  • maximum 65536

Examples

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

Valid: chat-message
{
  "class": "interactive_durable",
  "durability": "required",
  "delivery_semantics": "at_least_once",
  "ordering": {
    "scope": "room",
    "key": "room_id"
  },
  "latency": {
    "target_p95_ms": 50,
    "maximum_p95_ms": 100
  },
  "retention": {
    "hot": "7d",
    "replay": "30d",
    "archive": "365d"
  },
  "routing": {
    "objective": "latency_first",
    "multi_provider": true
  },
  "residency": {
    "inherit_project_region": true
  }
}
Valid: page-view
{
  "class": "bulk",
  "durability": "optional",
  "delivery_semantics": "at_least_once",
  "latency": {
    "maximum_p95_ms": 30000
  },
  "routing": {
    "objective": "cheapest"
  },
  "batching": {
    "max_messages": 1000,
    "max_delay_ms": 5000
  }
}
Rejected: huge-payload
{
  "class": "domain",
  "durability": "required",
  "delivery_semantics": "at_least_once",
  "max_payload_bytes": 1048576
}
Rejected: unknown-class
{
  "class": "fast",
  "durability": "required",
  "delivery_semantics": "at_least_once"
}

Validate

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