nti-spec

NTI-1 Conformance Test Suite & Examples

This directory contains official NTI-1 conformance JSON examples and the python validation engine.

Contents

What the validator checks, and what it does not

NTI-1 §3.4 makes the event hash SHA-256 over RFC 8785 (JCS) canonical JSON of the seven named fields, and requires completeness to be anchored. Both were missing here until a mutation matrix found them; both are checked now.

Change to the examples Result
an event edited, hashes left alone refused (hash mismatch)
an event edited and the chain re-hashed refused (head differs from the anchor)
the last event removed refused (length differs from the anchor)
the last event removed and the chain re-hashed refused (length)
events reordered, with or without re-hashing refused (linkage, or head and timestamps)
an extra event appended and re-hashed refused (length)
an event duplicated refused (linkage, or repeated event_id)
a timestamp moved backwards, chain re-hashed refused (order)
revocation_status set to a value outside the lifecycle refused (enum)
a field containing : chosen to collide under delimiter joining refused (the preimage is canonical JSON, not a join)
tampering with the chain and the anchor rewritten to match accepted

The last row is not a defect in the validator: the anchor is the trust root. A log is only as complete as the length and head somebody else holds, which is why §3.4 says completeness is anchored to a published root or an externally witnessed head. In this example the anchor is pinned in the repository so the check is reproducible; a deployment publishes or witnesses it elsewhere.

Signatures are not checked here. The examples are JSON structure, and the signature over an event is the runtime’s work (ube-foundation); the validator’s job is to show the shape a conforming record has and that a chain cannot be quietly edited, truncated or reordered.

Execution

To validate all conformance examples and run embedded code blocks:

python3 conformance/validate.py                 # examples, anchor and every Python code block
python3 conformance/validate.py --examples-only # the examples only, without the Markdown
python3 conformance/validate.py --self-test     # the preimage rule against its fixture
python3 conformance/mutation_matrix.py          # seventeen mutations, and what must happen to each