import assert from 'node:assert/strict'; import { readFile } from 'node:fs/promises'; import test from 'node:test'; const source = JSON.parse(await readFile(new URL('../json/card_source.json', import.meta.url), 'utf8')); test('L04 identity and task contract are stable', () => { assert.equal(source.card.number, '04'); assert.equal(source.card.uuid, 'f95c41db-8abd-5623-b40d-743cc19eb469'); assert.deepEqual(source.tasks_order, ['task01', 'task02', 'task03']); assert.deepEqual(source.front_page_scope.scope_table.rows.map(row => row.status), ['ready', 'ready', 'ready']); }); test('decoder safety invariants are explicit', () => { const text = JSON.stringify(source); for (const token of ['sign extension', 'illegal', 'x0', 'VCD']) assert.match(text, new RegExp(token, 'i')); for (const task of Object.values(source.tasks)) assert.equal(task.assessment_criterion_ref, 'RV04.KW01'); });