device-operation: machine operation log and reputation; conformance: 260 rules, 17 verifiers, 791 vectors
This commit is contained in:
1 parent
c1721b3bf1
commit
6ba33c477f
281 files changed
+115161
-46
No files matched your search
@@ -183,12 +183,14 @@ const ramase = () => [...Object.values(MODULE).map((m) => path.dirname(fileURLTo
|
||||
* everything else), the public task of a market job (each replay costs seconds), the configuration of the Travel Rule verifier (the
|
||||
* registries it trusts, its own KEM key file, which importKemKeys refuses to read when damaged, by design, and the status list argument
|
||||
* itself), the configuration of the compliance verifier (its policy, which definePolicy refuses by throwing, its audience and nonce, which it
|
||||
* requires, and the two list arguments themselves), and
|
||||
* requires, and the two list arguments themselves), the configuration of the operation verifier (its clock, the tolerance of its clock,
|
||||
* the manufacturers it trusts, and the five list arguments themselves, statusRecords included: each makes it throw when it cannot be read,
|
||||
* by design; the entries of the lists are damaged like everything else), and
|
||||
* the ai-trust bundle (its verifier runs the reference verifier, a program, several times per case).
|
||||
* @returns {{ cazuri: number, aruncate: string[], acceptate: string[] }} acceptate = the paths (without array positions) whose damage was accepted
|
||||
*/
|
||||
async function malformate() {
|
||||
const R = await incarca('risc'), C = await incarca('chitanta'), P = await incarca('piata'), B = await incarca('baza'), SC = await incarca('sidecar'), AR = await incarca('arbore'), L = await incarca('ledger'), ID = await incarca('identity'), DV = await incarca('device'), SJ = await incarca('sdjwt'), SV = await incarca('sdjwtvc'), TRm = await incarca('travelrule'), CF = await incarca('compliance'); const clona = (x) => JSON.parse(JSON.stringify(x));
|
||||
const R = await incarca('risc'), C = await incarca('chitanta'), P = await incarca('piata'), B = await incarca('baza'), SC = await incarca('sidecar'), AR = await incarca('arbore'), L = await incarca('ledger'), ID = await incarca('identity'), DV = await incarca('device'), SJ = await incarca('sdjwt'), SV = await incarca('sdjwtvc'), TRm = await incarca('travelrule'), CF = await incarca('compliance'), OPm = await incarca('operation'), RPm = await incarca('reputation'); const clona = (x) => JSON.parse(JSON.stringify(x));
|
||||
// the SD-JWT verifiers (2026-10-18), called the way the adapter calls them; a VC whose status was waived and not judged is PARTIAL, not accepted
|
||||
const optSd = (i) => { const o = { now: i.now }; for (const k of ['issuerKey', 'issuerAlg', 'classicalHalf', 'audience', 'nonce', 'expectedIssuer', 'requireKeyBinding', 'requireExp', 'maxAgeS', 'expectedTyp', 'expectedVct', 'statusListJwt', 'statusListKey', 'statusListAlg', 'requireStatus']) if (i[k] !== undefined) o[k] = i[k]; return o; };
|
||||
const J = { 'payment-risk': (i) => R.judeca(i.policy, i.inputs).decision === 'ALLOW', 'payment-receipt': (i) => C.verificaChitanta(i.receipt, { policy: i.policy, inputs: i.inputs, tx: i.tx, receipt: i.txReceipt }).verdict === 'VALID', 'market-timeline': (i) => P.judeca(i).verdict === 'VALID',
|
||||
@@ -209,7 +211,12 @@ async function malformate() {
|
||||
'travel-rule-message': (i) => TRm.openMessage(i.message, { me: i.me, kem: TRm.importKemKeys(i.kem), registries: i.registries, now: i.now, statusLists: i.statusLists || [], seen: i.seen === undefined ? null : Array.isArray(i.seen) ? new Set(i.seen) : i.seen, ...(i.maxAgeS !== undefined ? { maxAgeS: i.maxAgeS } : {}) }).ok,
|
||||
'travel-rule-receipt': (i) => TRm.verifyReceipt(i.receipt, { message: i.message, beneficiaryId: i.beneficiaryId }).ok,
|
||||
// compliance (2026-10-18): accepted = what the suite would call VALID, not PARTIAL (a status the policy waived and nobody read)
|
||||
'compliance-presentation': (i) => { const o = { audience: i.audience, nonce: i.nonce, now: i.now }; for (const k of ['statusLists', 'revocations']) if (i[k] !== undefined) o[k] = i[k]; const r = CF.checkCompliance(i.presentation, i.policy, o); return r.compliant && !r.unjudged.some((c) => NEJUDECATE_COMPLIANCE[c]); } };
|
||||
'compliance-presentation': (i) => { const o = { audience: i.audience, nonce: i.nonce, now: i.now }; for (const k of ['statusLists', 'revocations']) if (i[k] !== undefined) o[k] = i[k]; const r = CF.checkCompliance(i.presentation, i.policy, o); return r.compliant && !r.unjudged.some((c) => NEJUDECATE_COMPLIANCE[c]); },
|
||||
// a machine's operation log (2026-10-20) and everything handed with it, called the way the adapter calls it; accepted = VALID, not PARTIAL.
|
||||
// The verifier's own configuration (its clock, the tolerance of it, the manufacturers it trusts, the lists themselves) is left out below
|
||||
'device-operation-log': (i) => { const o = { now: i.now }; for (const k of ['clockSkewS', 'trustedManufacturers', 'statusLists', 'statusRecords', 'readings', 'beacons', 'otherRecords']) if (i[k] !== undefined) o[k] = i[k]; return OPm.verifyOperation(i.log, o).verdict === 'VALID'; },
|
||||
// a stated reputation (2026-10-20): every path of the facts, the parameters and the claim
|
||||
'device-reputation': (i) => RPm.checkReputation(i).verdict === 'VALID' };
|
||||
const cai = (x, p = []) => (x !== null && typeof x === 'object' ? [p, ...Object.keys(x).flatMap((k) => cai(x[k], [...p, Array.isArray(x) ? Number(k) : k]))] : [p]).filter((q) => q.length);
|
||||
const VAL = [null, 'x', 7, [], {}]; let cazuri = 0; const aruncate = [], acceptate = [], sarite = [];
|
||||
// a vector whose input is larger than MARE characters is not damaged path by path: thousands of paths, each judged over the whole input
|
||||
@@ -224,6 +231,7 @@ async function malformate() {
|
||||
if (v.artifact === 'device-bundle' && (['trustedManufacturers', 'now', 'maxAgeS'].includes(p[0]) || (p.length === 1 && ['statusLists', 'firmwarePolicies', 'statusRecords', 'anchors'].includes(p[0])))) continue;
|
||||
if (v.artifact.startsWith('travel-rule-') && (['registries', 'kem'].includes(p[0]) || (p.length === 1 && p[0] === 'statusLists'))) continue;
|
||||
if (v.artifact === 'compliance-presentation' && (p[0] === 'policy' || (p.length === 1 && ['audience', 'nonce', 'statusLists', 'revocations'].includes(p[0])))) continue;
|
||||
if (v.artifact === 'device-operation-log' && (['now', 'clockSkewS', 'trustedManufacturers'].includes(p[0]) || (p.length === 1 && ['statusLists', 'statusRecords', 'readings', 'beacons', 'otherRecords'].includes(p[0])))) continue;
|
||||
for (const op of ['remove', 0, 1, 2, 3, 4]) { const c = clona(inp); let o = c; for (const k of p.slice(0, -1)) o = o[k]; const k = p[p.length - 1];
|
||||
if (op === 'remove') { if (Array.isArray(o)) o.splice(k, 1); else delete o[k]; } else { if (JSON.stringify(o[k]) === JSON.stringify(VAL[op])) continue; o[k] = clona(VAL[op]); }
|
||||
cazuri++; try { if (J[v.artifact](c)) acceptate.push(v.artifact + ':' + p.filter((x) => typeof x !== 'number').join('.')); } catch (e) { aruncate.push(v.id + ' ' + p.join('.') + ' <- ' + (op === 'remove' ? 'removed' : JSON.stringify(VAL[op])) + ': ' + String(e.message).slice(0, 60)); } } }
|
||||
|
||||
Reference in new issue
Block a user