openvibers/openvibe.bench Commits

Mirror: the benchmark names its licence (#46)

OP OpenVibers committed 14 days ago · cb47d8ccf6 · 2 files, +5 −1

The caller passes the licence's name, and the description read .licence off that
string, so the first HELM mirror page said "Licence: undefined".

Changes

ddiff --git a/server/bench/mirror.js b/server/bench/mirror.js
iindex 3b8016e..026b6ba 100644
---- a/server/bench/mirror.js
++++ b/server/bench/mirror.js
@@@ -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 = console
const 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',
ddiff --git a/test/imports.test.js b/test/imports.test.js
iindex 926c336..d0761c7 100644
---- a/test/imports.test.js
++++ b/test/imports.test.js
@@@ -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');