From 6f82572dba1cbd4fe4e4c817f3cdd494ee56c8c5 Mon Sep 17 00:00:00 2001 From: Kjell Tore Guttormsen Date: Sat, 4 Jul 2026 22:51:52 +0200 Subject: [PATCH] =?UTF-8?q?feat(ms-ai-architect):=20G2=20=E2=80=94=20gener?= =?UTF-8?q?aliser=20stamp-guard=20til=20version-label-streng=20(TDD,=20kas?= =?UTF-8?q?ter=20p=C3=A5=20malformert)=20[skip-docs]?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- scripts/kb-update/lib/transform.mjs | 38 ++++++++++++++---- tests/kb-update/test-transform.test.mjs | 52 +++++++++++++++++++++++++ 2 files changed, 82 insertions(+), 8 deletions(-) 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