openvibers/openvibe.network Commits
Bench may publish its events (the missing events.event.publish grant) (#516)
Changes
@@@ -669,6 +669,10 @@ const DEFAULT_GRANTS = [// other services' above. It publishes bench.* events and answers no other service today, so no Search grant.['bench', 'ai.run.create', 'openvibe.ai', ['ai.generate']],['bench', 'events.subscription.manage', 'openvibe.events', []],++ // Bench's outbox publishes bench.round.finished, bench.judgement.recorded and bench.rating.changed (contracts++ // events/payloads). The publish grant was missing, so every event failed at the token endpoint ("not granted:++ // events.event.publish") and was retried for good: about 430 refused token requests an hour (found 2026-11-02).++ ['bench', 'events.event.publish', 'openvibe.events', []],// Bench's model watch (Bench B10): when a followed score moves beyond its interval, or a model overtakes the one// someone follows, Bench pushes that person one notification through Network as app 'bench' (Bench's// server/watch/watch.js resolves the watch's user id, then pushes with openvibe-sdk/notifications). Its own name@@@ -22,4 +22,7 @@ for (const g of rows) {assert.ok(cap && cap.status === 'active', `${g[1]} is an active capability`);}++// Bench's outbox publishes its bench.* events (2026-11-02): without this grant every event failed at the token endpoint++// ("not granted: events.event.publish") and was retried for good.++assert.ok(principals.DEFAULT_GRANTS.some((g) => g[0] === 'bench' && g[1] === 'events.event.publish' && g[2] === 'openvibe.events'), 'bench may publish its events');console.log(`bench notify grants: ${rows.length}`);@@@ -199,7 +199,7 @@ const server = http.createServer(app);t = await token({ client_id: 'bench', client_secret: 'bench-secret', audience: 'openvibe.network' });assert.deepStrictEqual(t.body.scope.split(' '), ['network.account.deletion.confirm', 'network.account.export.contribute', 'network.notifications.push'], 'Bench answers account export and deletion, and pushes its watch notices');t = await token({ client_id: 'bench', client_secret: 'bench-secret', audience: 'openvibe.events' });-- assert.strictEqual(t.body.scope, 'events.subscription.manage', 'Bench subscribes to the account events at boot');++ assert.deepStrictEqual(t.body.scope.split(' ').sort(), ['events.event.publish', 'events.subscription.manage'], 'Bench subscribes to the account events at boot, and publishes its own bench.* events (2026-11-02)');t = await token({ client_id: 'bench', client_secret: 'bench-secret', audience: 'openvibe.ai' });assert.strictEqual(t.status, 200, JSON.stringify(t.body));const benchAiClaims = serviceAuth.verifyServiceToken(t.body.access_token, { publicKey: keys.publicKey, issuer: ISSUER, audience: 'openvibe.ai' });
@@ -669,6 +669,10 @@ const DEFAULT_GRANTS = [
@@ -669,6 +669,10 @@ const DEFAULT_GRANTS = [
// other services' above. It publishes bench.* events and answers no other service today, so no Search grant.
// other services' above. It publishes bench.* events and answers no other service today, so no Search grant.
['bench', 'ai.run.create', 'openvibe.ai', ['ai.generate']],
['bench', 'ai.run.create', 'openvibe.ai', ['ai.generate']],
['bench', 'events.subscription.manage', 'openvibe.events', []],
['bench', 'events.subscription.manage', 'openvibe.events', []],
+ // Bench's outbox publishes bench.round.finished, bench.judgement.recorded and bench.rating.changed (contracts
+ // events/payloads). The publish grant was missing, so every event failed at the token endpoint ("not granted:
+ // events.event.publish") and was retried for good: about 430 refused token requests an hour (found 2026-11-02).
+ ['bench', 'events.event.publish', 'openvibe.events', []],
// Bench's model watch (Bench B10): when a followed score moves beyond its interval, or a model overtakes the one
// Bench's model watch (Bench B10): when a followed score moves beyond its interval, or a model overtakes the one
// someone follows, Bench pushes that person one notification through Network as app 'bench' (Bench's
// someone follows, Bench pushes that person one notification through Network as app 'bench' (Bench's
// server/watch/watch.js resolves the watch's user id, then pushes with openvibe-sdk/notifications). Its own name
// server/watch/watch.js resolves the watch's user id, then pushes with openvibe-sdk/notifications). Its own name
@@ -22,4 +22,7 @@ for (const g of rows) {
@@ -22,4 +22,7 @@ for (const g of rows) {
assert.ok(cap && cap.status === 'active', `${g[1]} is an active capability`);
assert.ok(cap && cap.status === 'active', `${g[1]} is an active capability`);
}
}
+// Bench's outbox publishes its bench.* events (2026-11-02): without this grant every event failed at the token endpoint
+// ("not granted: events.event.publish") and was retried for good.
+assert.ok(principals.DEFAULT_GRANTS.some((g) => g[0] === 'bench' && g[1] === 'events.event.publish' && g[2] === 'openvibe.events'), 'bench may publish its events');
console.log(`bench notify grants: ${rows.length}`);
console.log(`bench notify grants: ${rows.length}`);
@@ -199,7 +199,7 @@ const server = http.createServer(app);
@@ -199,7 +199,7 @@ const server = http.createServer(app);
t = await token({ client_id: 'bench', client_secret: 'bench-secret', audience: 'openvibe.network' });
t = await token({ client_id: 'bench', client_secret: 'bench-secret', audience: 'openvibe.network' });
assert.deepStrictEqual(t.body.scope.split(' '), ['network.account.deletion.confirm', 'network.account.export.contribute', 'network.notifications.push'], 'Bench answers account export and deletion, and pushes its watch notices');
assert.deepStrictEqual(t.body.scope.split(' '), ['network.account.deletion.confirm', 'network.account.export.contribute', 'network.notifications.push'], 'Bench answers account export and deletion, and pushes its watch notices');
t = await token({ client_id: 'bench', client_secret: 'bench-secret', audience: 'openvibe.events' });
t = await token({ client_id: 'bench', client_secret: 'bench-secret', audience: 'openvibe.events' });
- assert.strictEqual(t.body.scope, 'events.subscription.manage', 'Bench subscribes to the account events at boot');
+ assert.deepStrictEqual(t.body.scope.split(' ').sort(), ['events.event.publish', 'events.subscription.manage'], 'Bench subscribes to the account events at boot, and publishes its own bench.* events (2026-11-02)');
t = await token({ client_id: 'bench', client_secret: 'bench-secret', audience: 'openvibe.ai' });
t = await token({ client_id: 'bench', client_secret: 'bench-secret', audience: 'openvibe.ai' });
assert.strictEqual(t.status, 200, JSON.stringify(t.body));
assert.strictEqual(t.status, 200, JSON.stringify(t.body));
const benchAiClaims = serviceAuth.verifyServiceToken(t.body.access_token, { publicKey: keys.publicKey, issuer: ISSUER, audience: 'openvibe.ai' });
const benchAiClaims = serviceAuth.verifyServiceToken(t.body.access_token, { publicKey: keys.publicKey, issuer: ISSUER, audience: 'openvibe.ai' });