NetworkModPrincipal network.mod-principal@1

Generated at from openvibe-contracts v0.76.0 and openvibe-sdk v0.20.1.

Version
1.0.0
Owner
network
Visibility
first-party
Status
active
Compatibility
backward
Decision
ADR-013
Schema
https://openvibe.network/contracts/network/mod-principal.v1.json

network.mod-principal@1 (OpenVibe.Network; roadmap WS-M task 3, ADR-013): a mod install's principal, `mod:<mod_id>`. Its grants are the approved subset of the capabilities its manifest requests; the rest are pending (never approved) or revoked. A revoked principal (the install ended) has no approved grants and never gets any again. The owning runtime keeps a copy of `approved` for its hot path and follows network.mod.grants_changed.

Fields

FieldTypeRequiredDescriptionConstraints
principalstringyes
  • pattern ^mod:mod_[0-9A-HJKMNP-TV-Z]{26}$
mod_idstringyes
  • pattern ^mod_[0-9A-HJKMNP-TV-Z]{26}$
ownerstringyesThe runtime service that registered it (games).
  • pattern ^[a-z][a-z0-9-]{1,31}$
runtimestringyesThe manifest's runtime, e.g. games-content@1.
  • maxLength 60
namestring
  • maxLength 120
versionstring
  • maxLength 40
statusenumyes
  • one of "active", "revoked"
requestedarray of stringyes
  • maxItems 64
  • unique items
  • items: pattern ^[a-z][a-z0-9_]*(\.[a-z0-9_]+){2,}$
approvedarray of stringyes
  • maxItems 64
  • unique items
  • items: pattern ^[a-z][a-z0-9_]*(\.[a-z0-9_]+){2,}$
pendingarray of stringyes
  • maxItems 64
  • unique items
  • items: pattern ^[a-z][a-z0-9_]*(\.[a-z0-9_]+){2,}$
revokedarray of stringyes
  • maxItems 64
  • unique items
  • items: pattern ^[a-z][a-z0-9_]*(\.[a-z0-9_]+){2,}$
revisionintegeryes
  • minimum 1
updated_atstringyes
  • format date-time

Examples

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

Valid: active
{
  "principal": "mod:mod_01JAB2C3D4E5F6G7H8J9K0MNPQ",
  "mod_id": "mod_01JAB2C3D4E5F6G7H8J9K0MNPQ",
  "owner": "games",
  "runtime": "games-content@1",
  "name": "Lanterns",
  "version": "1.0.0",
  "status": "active",
  "requested": [
    "games.world.announce",
    "games.prop.place"
  ],
  "approved": [
    "games.world.announce"
  ],
  "pending": [
    "games.prop.place"
  ],
  "revoked": [],
  "revision": 1,
  "updated_at": "2026-09-27T23:40:00.000Z"
}
Rejected: bad-principal
{
  "principal": "app:mod_01JAB2C3D4E5F6G7H8J9K0MNPQ",
  "mod_id": "mod_01JAB2C3D4E5F6G7H8J9K0MNPQ",
  "owner": "games",
  "runtime": "games-content@1",
  "status": "active",
  "requested": [],
  "approved": [],
  "pending": [],
  "revoked": [],
  "revision": 1,
  "updated_at": "2026-09-27T23:40:00.000Z"
}

Validate

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