openvibers/openvibe.network Commits
Meme runs AI's generate operation: the judge that writes its entries (#471)
Changes
@@@ -606,8 +606,11 @@ const DEFAULT_GRANTS = [['domains', 'events.subscription.manage', 'openvibe.events', []],// OpenVibe.Meme (contracts 0.234.0): its public entries in Search through the owner API (owner meme), and its// account-event subscriptions at boot; its export and deletion grants are with the other services' above.++ // It also runs OpenVibe.AI's generate operation (the judge that scores a candidate from its own citations and++ // writes the entry, and the writing pass for the encyclopedia), the same way Design and Bench do.['meme', 'search.document.write', 'openvibe.search', []],['meme', 'events.subscription.manage', 'openvibe.events', []],++ ['meme', 'ai.run.create', 'openvibe.ai', ['ai.generate']],// OpenVibe.Vision (contracts 0.235.0): model calls through AI's OpenAI-compatible endpoint (workflow ai.complete),// its account-event subscriptions, and the export/deletion pair above. It has no public records, so no Search grant.['vision', 'ai.run.create', 'openvibe.ai', ['ai.complete']],@@@ -103,6 +103,12 @@ const server = http.createServer(app);assert.strictEqual(t.body.scope, 'events.subscription.manage', 'Meme subscribes to the account events at boot');t = await token({ client_id: 'meme', client_secret: 'meme-secret', audience: 'openvibe.network' });assert.deepStrictEqual(t.body.scope.split(' '), ['network.account.deletion.confirm', 'network.account.export.contribute'], 'Meme answers account export and deletion, and holds no identity.subject.resolve');++ // Meme's judge and the encyclopedia's writing pass run OpenVibe.AI's generate operation, like Design and Bench.++ t = await token({ client_id: 'meme', client_secret: 'meme-secret', audience: 'openvibe.ai' });++ assert.strictEqual(t.status, 200, JSON.stringify(t.body));++ const memeAiClaims = serviceAuth.verifyServiceToken(t.body.access_token, { publicKey: keys.publicKey, issuer: ISSUER, audience: 'openvibe.ai' });++ assert.ok(memeAiClaims.ok, memeAiClaims.reason);++ assert.deepStrictEqual([memeAiClaims.claims.cap, memeAiClaims.claims.ns], [['ai.run.create'], ['ai.generate']], 'Meme runs AI workflow ai.generate for its judge');// OpenVibe.Vision and OpenVibe.Exchange (contracts 0.235.0): both answer account export and deletion and create// their two account-event subscriptions at boot; Vision runs AI workflow ai.complete, Exchange feeds Search.
@@ -606,8 +606,11 @@ const DEFAULT_GRANTS = [
@@ -606,8 +606,11 @@ const DEFAULT_GRANTS = [
['domains', 'events.subscription.manage', 'openvibe.events', []],
['domains', 'events.subscription.manage', 'openvibe.events', []],
// OpenVibe.Meme (contracts 0.234.0): its public entries in Search through the owner API (owner meme), and its
// OpenVibe.Meme (contracts 0.234.0): its public entries in Search through the owner API (owner meme), and its
// account-event subscriptions at boot; its export and deletion grants are with the other services' above.
// account-event subscriptions at boot; its export and deletion grants are with the other services' above.
+ // It also runs OpenVibe.AI's generate operation (the judge that scores a candidate from its own citations and
+ // writes the entry, and the writing pass for the encyclopedia), the same way Design and Bench do.
['meme', 'search.document.write', 'openvibe.search', []],
['meme', 'search.document.write', 'openvibe.search', []],
['meme', 'events.subscription.manage', 'openvibe.events', []],
['meme', 'events.subscription.manage', 'openvibe.events', []],
+ ['meme', 'ai.run.create', 'openvibe.ai', ['ai.generate']],
// OpenVibe.Vision (contracts 0.235.0): model calls through AI's OpenAI-compatible endpoint (workflow ai.complete),
// OpenVibe.Vision (contracts 0.235.0): model calls through AI's OpenAI-compatible endpoint (workflow ai.complete),
// its account-event subscriptions, and the export/deletion pair above. It has no public records, so no Search grant.
// its account-event subscriptions, and the export/deletion pair above. It has no public records, so no Search grant.
['vision', 'ai.run.create', 'openvibe.ai', ['ai.complete']],
['vision', 'ai.run.create', 'openvibe.ai', ['ai.complete']],
@@ -103,6 +103,12 @@ const server = http.createServer(app);
@@ -103,6 +103,12 @@ const server = http.createServer(app);
assert.strictEqual(t.body.scope, 'events.subscription.manage', 'Meme subscribes to the account events at boot');
assert.strictEqual(t.body.scope, 'events.subscription.manage', 'Meme subscribes to the account events at boot');
t = await token({ client_id: 'meme', client_secret: 'meme-secret', audience: 'openvibe.network' });
t = await token({ client_id: 'meme', client_secret: 'meme-secret', audience: 'openvibe.network' });
assert.deepStrictEqual(t.body.scope.split(' '), ['network.account.deletion.confirm', 'network.account.export.contribute'], 'Meme answers account export and deletion, and holds no identity.subject.resolve');
assert.deepStrictEqual(t.body.scope.split(' '), ['network.account.deletion.confirm', 'network.account.export.contribute'], 'Meme answers account export and deletion, and holds no identity.subject.resolve');
+ // Meme's judge and the encyclopedia's writing pass run OpenVibe.AI's generate operation, like Design and Bench.
+ t = await token({ client_id: 'meme', client_secret: 'meme-secret', audience: 'openvibe.ai' });
+ assert.strictEqual(t.status, 200, JSON.stringify(t.body));
+ const memeAiClaims = serviceAuth.verifyServiceToken(t.body.access_token, { publicKey: keys.publicKey, issuer: ISSUER, audience: 'openvibe.ai' });
+ assert.ok(memeAiClaims.ok, memeAiClaims.reason);
+ assert.deepStrictEqual([memeAiClaims.claims.cap, memeAiClaims.claims.ns], [['ai.run.create'], ['ai.generate']], 'Meme runs AI workflow ai.generate for its judge');
// OpenVibe.Vision and OpenVibe.Exchange (contracts 0.235.0): both answer account export and deletion and create
// OpenVibe.Vision and OpenVibe.Exchange (contracts 0.235.0): both answer account export and deletion and create
// their two account-event subscriptions at boot; Vision runs AI workflow ai.complete, Exchange feeds Search.
// their two account-event subscriptions at boot; Vision runs AI workflow ai.complete, Exchange feeds Search.