conformance: 97 rules of 9 verifiers, 206 vectors; verify-layer and agents refuse a classical key under an ML-DSA-65 name; market-settlement reads the notarization time from the certified read; proof-of-ai README in English

This commit is contained in:
Aere Network committed 2026-10-05 17:17:59 +03:00
1 parent c9f2932e04
commit c9798a0013
111 files changed
+15871 -292

No files matched your search

+7
View File
@@ -38,6 +38,13 @@ export function fixturi(P) {
F.push({ nume: 'N12 S5 an event whose time is not a whole number of seconds: refused by name (form)', asteptat: 'INVALID', paza: 'forma', r: () => { const d = date('S5'); ev(d, 'JobPosted').timestamp += 0.5; return v(P.judeca(d)); } });
F.push({ nume: 'N14 S1 finalized inside the window by a third party, with the ResultSubmitted event withheld (the window rule would be skipped): refused as not whole', asteptat: 'INVALID', paza: 'intreg', r: () => { const d = date('S1'); ev(d, 'JobPaid').timestamp = d.job.submittedAt + 1; d.events = d.events.filter((e) => e.name !== 'ResultSubmitted'); const r = P.judeca(d); return { verdict: r.verdict, detail: r.reguli.join() + ': ' + r.motive.join('; ') }; } });
F.push({ nume: 'N15 S4 the JobClaimed event withheld (the deadline rule of an expiry would be skipped): refused as not whole', asteptat: 'INVALID', paza: 'intreg', r: () => { const d = date('S4'); d.events = d.events.filter((e) => e.name !== 'JobClaimed'); return v(P.judeca(d)); } });
// the notarization time is the chain's (a certified reading), not the envelope's claim
const cuCert = (d, x = {}) => ({ ...d, certified: { statementHash: d.envelope.statementHash, firstSeen: d.envelope.notarization.firstSeen, ...x } });
F.push({ nume: 'C1 S1 with the certified reading of its envelope (the same time the claim says): VALID, nothing left unmeasured', asteptat: 'VALID', r: () => { const r = P.judeca(cuCert(date('S1'))); return { verdict: r.verdict === 'VALID' && r.nemasurat.length === 0 ? 'VALID' : 'INVALID', detail: r.motive.join('; ') + ' unmeasured: ' + r.nemasurat.length }; } });
F.push({ nume: 'C2 S1 without a certified reading: VALID by the claim, and the judge says the time was not measured', asteptat: 'VALID', r: () => { const r = P.judeca(date('S1')); return { verdict: r.verdict === 'VALID' && r.nemasurat.length === 1 ? 'VALID' : 'INVALID', detail: r.nemasurat.join('; ') }; } });
F.push({ nume: 'N16 S1 the envelope claims an earlier time than the chain certifies', asteptat: 'INVALID', paza: 'dovada', r: () => { const d = date('S1'); const c = cuCert(d); c.envelope.notarization.firstSeen -= 600; return v(P.judeca(c)); } });
F.push({ nume: 'N17 S1 the chain certifies a time after the window closed, whatever the claim says', asteptat: 'INVALID', paza: 'dovada', r: () => { const d = date('S1'); return v(P.judeca(cuCert(d, { firstSeen: d.job.submittedAt + d.job.challengeWindow + 1 }))); } });
F.push({ nume: 'N18 S1 a certified reading that is for another envelope', asteptat: 'INVALID', paza: 'dovada', r: () => v(P.judeca(cuCert(date('S1'), { statementHash: '0x' + 'dd'.repeat(32) }))) });
F.push({ nume: 'N13 malformed timelines (no constants, an event without args, events not a list) are refused by name, never thrown', asteptat: 'INVALID', r: () => { const rez = [(d) => { delete d.constants; }, (d) => { delete d.events[0].args; }, (d) => { d.events = 'x'; }].map((f) => { const d = date('S2'); f(d); const r = P.judeca(d); return r.verdict + ':' + r.reguli.join(); }); return { verdict: rez.every((x) => x === 'INVALID:forma') ? 'INVALID' : 'VALID', detail: rez.join(' ') }; } });
F.push({ nume: 'R1 the settlement receipt of S1 is an AIP-23 settlement envelope naming the payout tx and the provider', asteptat: 'VALID', r: () => { const d = date('S1'); const c = P.chitanta(d); const t = ev(d, 'JobPaid'); return { verdict: c.kind === 'aere-proof-of-settlement-attestation' && c.statement.txHash === t.txHash && c.statement.to.toLowerCase() === d.job.provider.toLowerCase() && c.statement.chainId === 28001 ? 'VALID' : 'INVALID', detail: c.statementHash.slice(0, 18) + '..' }; } });
return F;