NetworkMachineRolesChangedPayload network.machine.roles_changed@1

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

Version
1.0.0
Owner
network
Visibility
first-party
Status
active
Compatibility
backward
Schema
https://openvibe.network/contracts/events/payloads/network.machine.roles_changed.v1.json

network.machine.roles_changed v1 (OpenVibe.Network, plan L34, step M4). A machine's roles changed: the whole set after the change, from the catalogue (network.machine-roles@1). The machine applies them at its next check-in, so this event says what was asked for, not what the machine has already done. Envelope: subject { type: machine, id: <dev_…> }, visibility internal, actor service:network.

Fields

FieldTypeRequiredDescriptionConstraints
machine_idstringyes
  • pattern ^dev_[0-9A-HJKMNP-TV-Z]{26}$
ownerstringyesThe person the machine belongs to.
  • pattern ^usr_[0-9A-HJKMNP-TV-Z]{26}$
rolesarray of stringyesThe machine's roles after the change.
  • unique items
  • items: pattern ^[a-z][a-z0-9-]*\.[a-z][a-z0-9-]*$
changed_bystringWho asked for the change: the person, or an app acting with their consent.
  • pattern ^(usr_[0-9A-HJKMNP-TV-Z]{26}|app:[a-z0-9-]+)$
atstringyes
  • format date-time

Examples

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

Valid: changed
{
  "machine_id": "dev_01JAB2C3D4E5F6G7H8J9K0MNPS",
  "owner": "usr_01JAB2C3D4E5F6G7H8J9K0MNPS",
  "roles": [
    "codes.worker",
    "ai.host"
  ],
  "changed_by": "usr_01JAB2C3D4E5F6G7H8J9K0MNPS",
  "at": "2026-10-31T09:00:00.000Z"
}
Rejected: bad-role
{
  "machine_id": "dev_01JAB2C3D4E5F6G7H8J9K0MNPS",
  "owner": "usr_01JAB2C3D4E5F6G7H8J9K0MNPS",
  "roles": [
    "nope"
  ],
  "at": "2026-10-31T09:00:00.000Z"
}

Validate

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