conformance: a conformance suite for the AIP-23 proof kinds (one verdict form over the published verifiers, 35 rules derived from code, 122 vectors, a runner for any implementation, a second verifier in Python); four defects it found in the published verifiers are fixed here: the market judge accepted a timeline with its submission event withheld, and three verifiers threw on malformed input instead of refusing by name

This commit is contained in:
Aere Network committed 2026-10-03 13:26:03 +03:00
1 parent 2c000478dc
commit c9f2932e04
145 files changed
+17395 -104

No files matched your search

+18
View File
@@ -0,0 +1,18 @@
#!/usr/bin/env node
// deriva-reguli.mjs: writes REGULI.json, the table of the rules the enrolled verifiers name, DERIVED from their code (reguli.mjs).
// node deriva-reguli.mjs derives and writes REGULI.json; refuses (1) if a rule is unmapped, unmarked or gone
// node deriva-reguli.mjs --verifica derives and compares with REGULI.json: LA ZI (0), DIFERIT (1), NEMASURAT (2: a source not here)
import fs from 'node:fs'; import path from 'node:path'; import { fileURLToPath } from 'node:url';
import { deriva } from './reguli.mjs';
const F = path.join(path.dirname(fileURLToPath(import.meta.url)), 'REGULI.json');
const { tabel, probleme, nemasurat } = await deriva();
for (const p of probleme) console.log('REFUSED: ' + p);
for (const n of nemasurat) console.log('NOT MEASURED: ' + n);
if (probleme.length) process.exitCode = 1;
else if (nemasurat.length) process.exitCode = 2;
else {
const text = JSON.stringify(tabel, null, 1) + '\n'; const n = Object.values(tabel.verifiers).reduce((s, v) => s + v.rules.length, 0);
if (process.argv.includes('--verifica')) { const egal = fs.existsSync(F) && fs.readFileSync(F, 'utf8').replace(/\r\n/g, '\n') === text; console.log(egal ? `LA ZI (${n} rules of ${Object.keys(tabel.verifiers).length} verifiers)` : 'DIFERIT: REGULI.json is not what the code derives now'); process.exitCode = egal ? 0 : 1; }
else { fs.writeFileSync(F, text); console.log(`written REGULI.json: ${n} rules of ${Object.keys(tabel.verifiers).length} verifiers; not enrolled: ` + tabel.notEnrolled.map((x) => x.verifier + ' (' + x.refusalSites + ' refusal sites)').join(', ')); }
}