conformance: the identity presentation verifier enrolled (134 rules of 10 verifiers, 273 vectors); the reference verifier instruction names all five files beside verify-proof.mjs; module READMEs point to aere.network/tools

This commit is contained in:
Aere Network committed 2026-10-05 18:53:32 +03:00
1 parent c9798a0013
commit 5fb38c5d0b
88 files changed
+20246 -179

No files matched your search

+19 -2
View File
@@ -2,7 +2,7 @@
// implementare-aere.mjs: the published verifiers behind the one verdict form (verdict.mjs). This file holds NO verification rule of
// its own: an AIP-23 envelope is judged by the reference verifier (verify-proof.mjs, run as the program it is), a payment by the
// risk module, a receipt by the receipt verifier, a market timeline by the market judge, a dataset record, answer, consistency proof
// or sample by the dataset module. What it adds is the translation: the rule ids those verifiers name -> the public rule ids and
// or sample by the dataset module, a presentation of a credential by the identity verifier. What it adds is the translation: the rule ids those verifiers name -> the public rule ids and
// the level of each (reguli.mjs), and the composition (a receipt or a timeline that carries an AIP-23 envelope gets that envelope
// judged too, so one verdict covers the artifact).
//
@@ -14,7 +14,7 @@
// verdict says so (PARTIAL: claim-not-checked). With --online the envelope goes to the reference verifier with the chain's endpoint.
// Exit: 0 VALID, 1 INVALID, 2 PARTIAL, 3 the artifact could not be judged at all (not a verdict).
import fs from 'node:fs'; import os from 'node:os'; import path from 'node:path'; import { spawn } from 'node:child_process';
import { VERIFICATOARE, FINALITY_SITES, VERIFY_PROOF, incarca } from './reguli.mjs';
import { VERIFICATOARE, FINALITY_SITES, VERIFY_PROOF, NEJUDECATE_IDENTITY, incarca } from './reguli.mjs';
import { acumulator, pica, trece, nemasurat, verdictUnic } from './verdict.mjs';
const RPC = { 2800: process.env.AERE_CONFORMANCE_RPC_2800 || 'https://rpc.aere.network', 28001: process.env.AERE_CONFORMANCE_RPC_28001 || 'https://testnet-rpc.aere.network' };
@@ -109,6 +109,23 @@ async function judeca(artifact, input, online) {
if (r.ok) { trece(acc, 'integrity', `the ledger verifies under its policy: ${r.seq} entries, ${r.allowedPayments} allowed payments, time ${r.time.lowerBound}`); trece(acc, 'authenticity', 'the agent id is derived from its ML-DSA-65 key and every entry is signed by it'); }
else { const m = R[r.rule]; if (!m) throw new Error('the ledger verifier refused without a rule this suite maps: ' + r.rule); pica(acc, m[1], m[0], r.error); nemasurat(acc, m[1] === 'integrity' ? 'authenticity' : 'integrity', 'not-reached', 'the verifier stopped at its first refusal'); }
for (const l of ['anchoring', 'finality']) nemasurat(acc, l, 'not-judged', 'a ledger head is anchored by notarizing its envelope, judged as the artifact `envelope`');
} else if (artifact === 'identity-presentation') {
// a presentation of a credential, judged by the identity verifier with what THIS verifier brings: its clock (required: a verdict
// on the clock of the machine that runs the vector would not reproduce), its audience, its nonce, the issuers it trusts, the
// status lists and the revocations it was handed. The verifier makes every check it can reach and names every rule that refused.
const M = await incarca('identity'); const R = VERIFICATOARE.identity.reguli;
if (typeof input.now !== 'string') throw new Error('an identity presentation is judged on the verifier\'s clock: input.now (an RFC 3339 time) is required');
const o = { now: input.now }; for (const k of ['audience', 'nonce', 'trustedIssuers', 'statusLists', 'revocations', 'maxAgeS']) if (input[k] !== undefined) o[k] = input[k];
const r = M.verifyPresentation(input.presentation, o);
if (r.valid !== (r.rules.length === 0)) throw new Error('the identity verifier refused without naming a rule');
for (const s of r.rules) { if (!R[s]) throw new Error('the identity verifier named a rule this suite does not map: ' + s); pica(acc, R[s][1], R[s][0], r.rows.filter((x) => x.pass === false && x.rule === s).map((x) => x.name + ': ' + x.detail).join('; ')); }
const oprit = r.rules.find((s) => M.OPRIRI.includes(s));
if (!r.rules.some((s) => R[s][1] === 'integrity')) trece(acc, 'integrity', 'no integrity rule of the identity verifier refused (' + r.rows.filter((x) => x.pass === true).length + ' checks held)');
if (!r.rules.some((s) => R[s][1] === 'authenticity')) { if (oprit) nemasurat(acc, 'authenticity', 'not-reached', 'the verifier stopped at ' + R[oprit][0] + ' before every signature was looked at'); else trece(acc, 'authenticity', 'the ids are derived from the keys; the credential, the presentation and every delegation link are signed with Ed25519 and ML-DSA-65, both'); }
// what the verifier did not judge, and why: a check that needs something the verifier did not bring leaves the verdict PARTIAL
const NEJ = NEJUDECATE_IDENTITY; if (M.NEJUDECATE.some((c) => !(c in NEJ))) throw new Error('the identity verifier declares a cause of not judging that this suite does not map');
for (const c of r.unjudged) { if (!(c in NEJ)) throw new Error('the identity verifier left unjudged for a cause this suite does not map: ' + c); if (NEJ[c]) nemasurat(acc, NEJ[c][0], NEJ[c][1], r.rows.filter((x) => x.unjudged === c).map((x) => x.name + ': ' + x.detail).join('; ')); }
for (const l of ['anchoring', 'finality']) nemasurat(acc, l, 'not-judged', 'a credential or a delegation is anchored by notarizing its AIP-23 envelope, judged as the artifact `envelope`');
} else if (artifact === 'ai-trust-bundle') {
// the trust chain of an AI result, judged by its own verifier (which runs the reference verifier on each envelope and the agents'
// and the audit log's verifiers on theirs). Offline, a notarization claimed by the attestation, the runtime record or the audit