Skip to content
This repository was archived by the owner on Oct 3, 2026. It is now read-only.

test: add portable multi-leaf and Unicode anchor inclusion vectors - #137

Closed
dinakarjs wants to merge 2 commits into
agentrust-io:mainfrom
dinakarjs:test/anchor-vectors-448
Closed

dinakarjs wants to merge 2 commits into
agentrust-io:mainfrom
dinakarjs:test/anchor-vectors-448

Conversation

@dinakarjs

@dinakarjs dinakarjs commented Oct 2, 2026 •

Copy link
Copy Markdown
Contributor

Adds 27 portable JSON vectors for TR-ANC-002, addressing agentrust-io/trace-spec#448 row 22. Nine positives cover both sibling directions, odd 3/5/9-leaf trees, right-edge promotion, ASCII escaping and recursive Unicode code-point key order. Eighteen negatives each identify an accepted twin, including changed body/signature, malformed or incomplete proofs, UTF-8 leaf encoding, UTF-16 key order, omitted leaf prefix and duplicated odd leaves.

Positive fixtures expose fixed canonical preimages, leaf hashes and ordered batch hashes. The standard-library generator imports no verifier code and builds trees/proofs using recursive RFC 6962 splits rather than the implementation's iterative fn/sn walk. The new harness checks the persisted fixtures against TR-ANC-002, exact positive bytes, reproducibility and positive twins.

The optional Node.js 18+ cross_check.mjs reads the persisted JSON directly. It implements anchor ASCII escaping and code-point ordering in JavaScript, reconstructs proofs recursively, and checks all 27 outcomes plus the nine positive preimages, leaf hashes, roots, counts and leaf positions. It imports neither Python implementation. Node is not added to package dependencies or Python CI. This targets the fixture set, not a general conformance verifier.

Validation: Python 3.12 focused checks 28 passed after the JavaScript addition. Full Python suite on the preceding commit: 706 passed, 5 existing xpassed; no Python code changed in the follow-up. Ruff on both new Python files and git diff --check passed. Node v24.19.0: 27/27 outcomes, 9/9 preimages and roots, syntax check passed. Temporary mutant runs detected UTF-16 sorting, UTF-8 leaf encoding, omitted leaf prefix, duplicated odd leaf, unconditional acceptance and unconditional rejection. Base: 7d220ee.

Expected outcomes concern inclusion only. The small claim objects and opaque signature strings do not claim complete record validity, signature authentication or a Level 2 verdict. No verifier behavior or spec text changes; this does not resolve #448 row 21's transparency self-reference. Draft pending independent verifier/maintainer review and upstream CI.

imran-siddique added a commit to agentrust-io/trace-spec that referenced this pull request Oct 2, 2026
* test: preserve portable anchor vectors from trace-tests PR 137

Original contribution: dinakarjs, agentrust-io/trace-tests#137
Source head: 4614f4491ab0152403778fe7d600ad2c6ea42567
All 31 added files retain their original Git blob hashes under conformance/.

* docs: write anchor fixture range in house style
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants