Stranger pass of 21 Oct: x402 verify-payments reads all wallet transfers in windows under the endpoint range limit (was UNMEASURED on the live testnet; now VALID), device-operation reputation is byte-identical in JS --canonical and Python, module README figures as measured, .gitignore for the keys the examples write, temporary directories removed by the probes

This commit is contained in:
Aere Network committed 2026-10-21 23:20:15 +03:00
1 parent 82c5b261ac
commit fcece14a12
18 files changed
+266 -45

No files matched your search

+10 -4
View File
@@ -244,10 +244,16 @@ node operation-cli.mjs block --rpc <endpoint> --number 6157024 --out block.json
node operation-cli.mjs verify --log log.json --now <time> --trust <manufacturer id> --status status.json \
--reading reading.json --block block.json [--other records.json] [--json]
node operation-cli.mjs facts --log log.json --now <time> ... --out facts.json
node operation-cli.mjs reputation --facts facts.json --from 2026-10-01T00:00:00Z --to 2026-11-01T00:00:00Z --window 3600
python3 reputation.py --facts facts.json --from <ms> --to <ms> --window 3600 # the second implementation: the same text
node operation-cli.mjs reputation --facts facts.json --from 2026-10-01T00:00:00Z --to 2026-11-01T00:00:00Z --window 3600 # indented, to read
node operation-cli.mjs reputation --facts facts.json --from 1790812800000 --to 1793491200000 --window 3600 --canonical # canonical JSON
python3 reputation.py --facts facts.json --from 1790812800000 --to 1793491200000 --window 3600 # the second implementation
```
The last two lines print the same bytes, the line end included (`cmp` says nothing), on Windows as on Linux: the canonical JSON
(keys sorted, no spaces) and one `\n`. Without `--canonical` the first implementation indents its output, so the text differs while
the values are the same. `reputation.py` takes the times in milliseconds only; `operation-cli.mjs` takes milliseconds or an RFC 3339
UTC time (2026-10-01T00:00:00Z is 1790812800000).
`notarize` refuses chain 2800 unless `AERE_CONFIRM_MAINNET=yes`: there it is a real transaction paid by the key's account.
`reading` needs the AIP-23 reference verifier (`verify-proof.mjs` with the files beside it, `npm install` done there). A file given to
`--status`, `--status-list`, `--reading`, `--block` or `--other` holds one object, a JSON list of them, or `{ "records": [...] }`.
@@ -316,9 +322,9 @@ const rep = reputation(r.facts, { from, to, windowS: 3600 });
| what | command | measured |
|---|---|---|
| the probe | `node proba-operation.mjs` | 107/107 on 2026-10-20 (Node.js 24.14.1, Python 3.14.4, Windows): 18 logs that must be VALID, each with exactly its named causes; 15 PARTIAL, each for exactly its causes; 48 attack rows, each refused for exactly its named rules (four of them also require the facts to be of the formula's form, or to hold no equivocation); the proof of equivocation on its own, and every proof the verifier kept verifying on its own (7); the producers and the separation of purposes (2); the facts and the reputation (8); the two implementations, the vectors and six margins of the JSON text (6); 459 damaged logs each given a verdict, none counting a record the device did not sign; the command line through files only, the blocks read by the `block` command from a local endpoint (2). The 12 rows added by the adversarial review of 2026-10-20 were each red on the code before it, for the reason they name |
| the negative control | `node control-negativ-operation.mjs` | 62/62 on 2026-10-20: the untouched copy green; each of the 17 rules taken out of a copy, the rows that expect it, and only they, go red; 44 more plantings, each with exactly its rows: one condition of each compound check at a time (two conditions that guard one thing taken out together, and said so), the bounds and the counting of the facts, the reading of the registry and of the records beside the log, and both implementations of the reputation (their check, their form, their formula, and the Python reader of the JSON text); each defect the review of 2026-10-20 found is put back by one planting. A planting whose pattern is not found exactly once, or after which the probe does not reach its summary, counts as a failure |
| the negative control | `node control-negativ-operation.mjs` | 63/63 on 2026-10-21 (62/62 on 2026-10-20): the untouched copy green; each of the 17 rules taken out of a copy, the rows that expect it, and only they, go red; 45 more plantings (the 45th, since 2026-10-21: `reputation.py` made to write CRLF, which turns C01, and only it, red), each with exactly its rows: one condition of each compound check at a time (two conditions that guard one thing taken out together, and said so), the bounds and the counting of the facts, the reading of the registry and of the records beside the log, and both implementations of the reputation (their check, their form, their formula, and the Python reader of the JSON text); each defect the review of 2026-10-20 found is put back by one planting. A planting whose pattern is not found exactly once, or after which the probe does not reach its summary, counts as a failure |
| the vectors | `node genereaza-vectori.mjs --verifica` | 103 vectors in the form of the conformance suite (`vectori/`), derived from logs the producers made once (`fixturi/sursa-vectori.json`: eight scenarios, every key discarded): 56 VALID (eight logs, seven windowings), 19 INVALID `reputation.figures` and 28 INVALID `reputation.form`, each one operation away from a VALID one and checked at generation to be refused for exactly its rule. `LA ZI` on 2026-10-20. Two of the windowings (`quarter`, `cut`) were added that day, when the suite enrolled the reputation: until then no vector told `<` from `<=` at the end of a window or at `to` (an implementation with `<=` at either passed all 87); now they fail 6 and 4 |
| two implementations | `node ../conformance/conformance.mjs --vectors vectori --impl "node reputation.mjs"` and `--impl "python3 reputation.py"` | 103/103 each on 2026-10-20; and in the probe, byte for byte the same text on 249 computations over the facts of every row, and the same verdict on six margins of the JSON text that a vector written by `JSON.stringify` cannot carry (a whole number of 5,000 digits in the claim and in the facts, a claim nested 50,000 deep, 2^53 + 1, 1e-400, a member written twice) |
| two implementations | `node ../conformance/conformance.mjs --vectors vectori --impl "node reputation.mjs"` and `--impl "python3 reputation.py"` | 103/103 each on 2026-10-20; and in the probe, byte for byte the same text on 249 computations over the facts of every row, the two command lines byte for byte, line end included (row C01, since 2026-10-21: until then Python wrote CRLF on Windows and the row compared trimmed text; 107/107 on 2026-10-21 on Windows, and the control's planting of the CRLF turns C01, and only it, red), and the same verdict on six margins of the JSON text that a vector written by `JSON.stringify` cannot carry (a whole number of 5,000 digits in the claim and in the facts, a claim nested 50,000 deep, 2^53 + 1, 1e-400, a member written twice) |
| the conformance suite | `node ../conformance/proba-conformance.mjs` | since 2026-10-20 the verifier (17 rules, `device-operation-log`) and the reputation (2 rules, `device-reputation`) are enrolled there, each rule planted out of a copy of this component's file by the suite's own control; see that README for what it measured |
| cost | (measurement, not a gate) | a log of 10,000 records with 1,000 anchors, judged with 100,000 block readings: 4.1 s, 294 MB resident; 2,000 records: 1.0 s. The reputation of 10,000 records in 10,000 windows: 66 ms. Measured before the review of 2026-10-20 and not again after it |
@@ -71,6 +71,8 @@ export const PLANTARI = [
['reputation (Python): a whole number read digit by digit (int() refuses more than 4300 digits)', PY, 'val, i = num(m.group()), m.end()', "val, i = (int(m.group()) if m.group().lstrip('-').isdigit() else num(m.group())), m.end()", ['R14']],
['reputation (Python): the files read with json.loads (one recursion per level)', PY, 'return loads(f.read())', 'return json.loads(f.read(), parse_float=num)', ['R14']],
['reputation (Python): a claim nested deeper than the encoder goes not caught', PY, 'except (ValueError, TypeError, OverflowError, RecursionError):', 'except (ValueError, TypeError, OverflowError):', ['R14']],
// 2026-10-21 (the stranger pass): the line end Python writes on Windows, planted on every system (the default would differ only there)
['reputation (Python): the command line writes CRLF, as Python does on Windows by default', PY, "sys.stdout.reconfigure(newline='\\n')", "sys.stdout.reconfigure(newline='\\r\\n')", ['C01']],
];
const a = process.argv.slice(2); const doar = a.includes('--doar') ? a[a.indexOf('--doar') + 1] : null;
+3 -3
View File
@@ -330,9 +330,9 @@ spune('9. the command line, through files only');
const js = oc(['reputation', '--facts', f('facts.json'), '--from', from, '--to', to, '--window', '60', '--canonical']);
const pyr = py ? spawnSync(py, [path.join(AICI, 'reputation.py'), '--facts', f('facts.json'), '--from', from, '--to', to, '--window', '60'], { encoding: 'utf8' }) : null;
const rep = js.status === 0 ? JSON.parse(js.stdout) : null;
rand('C01', 'two device keys, two credentials, ten records with a rotation, an anchor, and the blocks read by the block command from a local endpoint, all through files: verify says VALID (exit 0), 10 of 10 minutes covered and 1 witnessed, and the reputation is the same text from both implementations',
!py ? 'NEMASURAT' : facuti && ver.status === 0 && /^VALID/m.test(ver.stdout) && !!rep && rep.availability.claimed === 10 && rep.availability.windows === 10 && rep.availability.witnessed === 1 && pyr.status === 0 && pyr.stdout.trim() === js.stdout.trim() ? 'VERDE' : 'ROSU',
`steps ${pasi.map((x) => x.status).join('')}, verify ${ver.status}: ${String(ver.stdout).trim().split('\n').slice(-3).join(' | ')} ${String(ver.stderr).slice(0, 200)}` + (rep ? ' ' + JSON.stringify(rep.availability) : ''));
rand('C01', 'two device keys, two credentials, ten records with a rotation, an anchor, and the blocks read by the block command from a local endpoint, all through files: verify says VALID (exit 0), 10 of 10 minutes covered and 1 witnessed, and the reputation is the same BYTES from both command lines (`operation-cli.mjs reputation --canonical` and `reputation.py --facts`, the line end included: before 2026-10-21 Python wrote CRLF on Windows and this row compared trimmed text)',
!py ? 'NEMASURAT' : facuti && ver.status === 0 && /^VALID/m.test(ver.stdout) && !!rep && rep.availability.claimed === 10 && rep.availability.windows === 10 && rep.availability.witnessed === 1 && pyr.status === 0 && pyr.stdout === js.stdout ? 'VERDE' : 'ROSU',
`steps ${pasi.map((x) => x.status).join('')}, verify ${ver.status}: ${String(ver.stdout).trim().split('\n').slice(-3).join(' | ')} ${String(ver.stderr).slice(0, 200)}` + (rep ? ' ' + JSON.stringify(rep.availability) : '') + (pyr && pyr.stdout !== js.stdout ? ` | the two outputs differ: JS ${Buffer.byteLength(js.stdout)} bytes ending ${JSON.stringify(js.stdout.slice(-2))}, Python ${Buffer.byteLength(pyr.stdout)} bytes ending ${JSON.stringify(pyr.stdout.slice(-2))}` : ''));
const Lf = JSON.parse(fs.readFileSync(f('log.json'), 'utf8')); Lf.records[3].statement.counter = 999; fs.writeFileSync(f('tampered.json'), JSON.stringify(Lf));
const t1 = oc(['verify', ...comun.map((x) => (x === f('log.json') ? f('tampered.json') : x))]), t2 = oc(['verify', ...comun.filter((x, i, a) => x !== '--status' && a[i - 1] !== '--status')]), t3 = oc(['verify', '--log', f('log.json')]);
const t4 = oc(['verify', '--log', f('log.json'), '--now', 'yesterday']);
+4
View File
@@ -313,6 +313,10 @@ def main(a):
if __name__ == '__main__':
# 2026-10-21 (the stranger pass): the same BYTES as `operation-cli.mjs reputation --canonical` on every system. Python's text-mode
# stdout turns '\n' into '\r\n' on Windows, Node's console.log writes '\n' everywhere; without this the two outputs differ by the
# line ending on Windows, and only there.
sys.stdout.reconfigure(newline='\n')
try:
sys.exit(main(sys.argv[1:]))
except (ValueError, OSError, KeyError, TypeError) as e: