openvibers/openvibe.bench Commits
Mirror: the benchmark names its licence (#46)
Changes
@@@ -184,6 +184,8 @@ function createMirror({ s, registry, fetchImpl = globalThis.fetch, log = console};}++ // The caller passes the licence's name (looked.licence); an object from the licence check works too.++ const licenceName = (l) => (typeof l === 'string' ? l : (l && l.licence) || 'unknown');/** The benchmark a mirrored group becomes: one per source and group, public, so anybody can read it. */async function benchmarkFor(row, { source, licence }) {const suite = matchSuite(row.benchmark);@@@ -195,7 +197,7 @@ function createMirror({ s, registry, fetchImpl = globalThis.fetch, log = consoleconst made = await registry.createBenchmark({owner: 'openvibe',title: (suite ? suite.title : row.benchmark) + ' (' + source.title + ')',-- description: 'Mirrored from ' + source.title + '. Licence: ' + licence.licence + '. ' + source.attribution + '.',++ description: 'Mirrored from ' + source.title + '. Licence: ' + licenceName(licence) + '. ' + source.attribution + '.',kind: 'text.answer',tags: tags.concat([tag]),visibility: 'public',@@@ -365,6 +365,8 @@ function multipart(filename, bytes) {assert.strictEqual(mirrored.source.kind, 'mirror');assert.strictEqual(mirrored.source.licence, 'Apache-2.0');assert.ok(mirrored.source.source_url, 'it says where it came from');++ const page = await t.ctx.registry.getBenchmark(applied.written[0].benchmark);++ assert.match(page.description, /Licence: Apache-2\.0\./, 'the benchmark names its licence (it said "undefined", 2026-10-30)');const again = await mirror.apply('helm', { group: 'mmlu', release: 'v1.13.0' });assert.strictEqual(again.written.length, 0, 'the same model, version and source do not land twice');
@@ -184,6 +184,8 @@ function createMirror({ s, registry, fetchImpl = globalThis.fetch, log = console
@@ -184,6 +184,8 @@ function createMirror({ s, registry, fetchImpl = globalThis.fetch, log = console
};
};
}
}
+ // The caller passes the licence's name (looked.licence); an object from the licence check works too.
+ const licenceName = (l) => (typeof l === 'string' ? l : (l && l.licence) || 'unknown');
/** The benchmark a mirrored group becomes: one per source and group, public, so anybody can read it. */
/** The benchmark a mirrored group becomes: one per source and group, public, so anybody can read it. */
async function benchmarkFor(row, { source, licence }) {
async function benchmarkFor(row, { source, licence }) {
const suite = matchSuite(row.benchmark);
const suite = matchSuite(row.benchmark);
@@ -195,7 +197,7 @@ function createMirror({ s, registry, fetchImpl = globalThis.fetch, log = console
@@ -195,7 +197,7 @@ function createMirror({ s, registry, fetchImpl = globalThis.fetch, log = console
const made = await registry.createBenchmark({
const made = await registry.createBenchmark({
owner: 'openvibe',
owner: 'openvibe',
title: (suite ? suite.title : row.benchmark) + ' (' + source.title + ')',
title: (suite ? suite.title : row.benchmark) + ' (' + source.title + ')',
- description: 'Mirrored from ' + source.title + '. Licence: ' + licence.licence + '. ' + source.attribution + '.',
+ description: 'Mirrored from ' + source.title + '. Licence: ' + licenceName(licence) + '. ' + source.attribution + '.',
kind: 'text.answer',
kind: 'text.answer',
tags: tags.concat([tag]),
tags: tags.concat([tag]),
visibility: 'public',
visibility: 'public',
@@ -365,6 +365,8 @@ function multipart(filename, bytes) {
@@ -365,6 +365,8 @@ function multipart(filename, bytes) {
assert.strictEqual(mirrored.source.kind, 'mirror');
assert.strictEqual(mirrored.source.kind, 'mirror');
assert.strictEqual(mirrored.source.licence, 'Apache-2.0');
assert.strictEqual(mirrored.source.licence, 'Apache-2.0');
assert.ok(mirrored.source.source_url, 'it says where it came from');
assert.ok(mirrored.source.source_url, 'it says where it came from');
+ const page = await t.ctx.registry.getBenchmark(applied.written[0].benchmark);
+ assert.match(page.description, /Licence: Apache-2\.0\./, 'the benchmark names its licence (it said "undefined", 2026-10-30)');
const again = await mirror.apply('helm', { group: 'mmlu', release: 'v1.13.0' });
const again = await mirror.apply('helm', { group: 'mmlu', release: 'v1.13.0' });
assert.strictEqual(again.written.length, 0, 'the same model, version and source do not land twice');
assert.strictEqual(again.written.length, 0, 'the same model, version and source do not land twice');