openvibers/openvibe.network Commits

Grant Live the chat ingress, moderation-write, cache and J4b read capabilities on openvibe.chat (#59)

OP OpenVibers committed 5 Oct 2026 · bc8ad11bf4 · 1 file, +11 −0

* Grant Live the chat ingress, moderation-write, cache and J4b read capabilities on openvibe.chat

All 9 capability names verified; none missing.

**Changes** — all in `server/identity/principals.js`, `DEFAULT_GRANTS` (comment at :256-257):
- `server/identity/principals.js:258` — `['live','chat.event.publish','openvibe.chat',[]]`
- `server/identity/principals.js:259` — `['live','chat.moderation.write','openvibe.chat',[]]`
- `server/identity/principals.js:260` — `['live','chat.cache.invalidate','openvibe.chat',[]]`
- `server/identity/principals.js:261` — `['live','chat.stats.read','openvibe.chat',[]]`
- `server/identity/principals.js:262` — `['live','chat.messages.read','openvibe.chat',[]]`
- `server/identity/principals.js:263` — `['live','chat.analysis.read','openvibe.chat',[]]`
- `server/identity/principals.js:264` — `['live','chat.moderation.queue.read','openvibe.chat',[]]`
- `server/identity/principals.js:265` — `['live','chat.sounds.read','openvibe.chat',[]]`
- `server/identity/principals.js:266` — `['live','chat.sounds.write','openvibe.chat',[]]`

**Verification:** Every name is present in `node_modules/openvibe-contracts/manifests/services/chat.json` (pin v0.99.0) and in OpenVibe.Contracts `origin/main:manifests/services/chat.json`, all owned by `chat` (so audience `openvibe.chat` matches). Chat's `docs/chat-ingress.md` names exactly these routes/capabilities. Names not found: none. No matching entry is needed elsewhere — the `tips chat.message.send`/`chat.event.publish` precedent is a `DEFAULT_GRANTS` row plus only test assertions, and the existing all-grants test in `test/grants-admin.test.js:32` validates names/audiences against `openvibe-contracts`.

**Tests:** `ov test test/principals.test.js test/grants-admin.test.js test/loyalty-policy.test.js test/internal-projects.test.js` — 4 passed in 21 s (the latter two also assert `DEFAULT_GRANTS`). Nothing unrelated changed; not committed or pushed.

* Live reads Chat's data through Chat's internal read API (comment, review)

Changes

ddiff --git a/server/identity/principals.js b/server/identity/principals.js
iindex 426dc9ba..cb43ed24 100644
---- a/server/identity/principals.js
++++ b/server/identity/principals.js
@@@ -253,6 +253,17 @@ const DEFAULT_GRANTS = [
// Plan T3: Live reads a channel's moderation settings, its moderators and emote count from Chat.
['live', 'chat.moderation.read', 'openvibe.chat', []],
['live', 'chat.message.send', 'openvibe.chat', []],
++ // Plan T3 J2/J4b: Live writes through Chat's typed internal ingress (events, moderation, cache hints)
++ // and reads them through Chat's internal read API, in place of its mirrored copy (Chat docs/chat-ingress.md).
++ ['live', 'chat.event.publish', 'openvibe.chat', []],
++ ['live', 'chat.moderation.write', 'openvibe.chat', []],
++ ['live', 'chat.cache.invalidate', 'openvibe.chat', []],
++ ['live', 'chat.stats.read', 'openvibe.chat', []],
++ ['live', 'chat.messages.read', 'openvibe.chat', []],
++ ['live', 'chat.analysis.read', 'openvibe.chat', []],
++ ['live', 'chat.moderation.queue.read', 'openvibe.chat', []],
++ ['live', 'chat.sounds.read', 'openvibe.chat', []],
++ ['live', 'chat.sounds.write', 'openvibe.chat', []],
// Wave 8: Live as a Billing client (used only with BILLING_AUTHORITY=billing). Never cashout.manage
// or ledger.admin: approving payouts is a separately controlled capability (ADR-012 rule 10).
...['billing.intent.create', 'billing.transfer.create', 'billing.balance.read', 'billing.cashout.request',