diff --git a/scripts/kb-update/lib/transform.mjs b/scripts/kb-update/lib/transform.mjs index 87a12df..14a1fdc 100644 --- a/scripts/kb-update/lib/transform.mjs +++ b/scripts/kb-update/lib/transform.mjs @@ -148,6 +148,30 @@ export function buildKbHeader(meta) { return `${header}\n---\n`; } +/** + * Format the `verified_by` judge-version label. Returns the WHOLE label (`judge-v3.1`). + * Absence (undefined) → the current JUDGE_VERSION default; otherwise the value — an integer + * major (`3` → judge-v3) or a `major.minor` string/float (`'3.2'`/`3.2` → judge-v3.2) — is + * validated against a strict numeric-label regex and honoured. Mirrors the DATE_RE throw + * discipline (stampVerifiedMeta): a malformed label THROWS rather than silently falling back + * to the default, so a caller bug surfaces instead of shipping a mislabelled provenance stamp + * into a public file. + * + * @param {number|string} [judgeVersion] — integer major or `major.minor`; absent → default + * @returns {string} the `judge-v