Independent Python profile 0
This directory contains a second, mechanically independent implementation of the bounded NUIF v0 conformance path. It uses only Python’s standard library and neither imports nor invokes a Rust workspace package.
The implementation reads and structurally validates canonical nuif-text-0, writes the canonical bytes, preserves an opaque unknown payload through an unrelated edit, evaluates the declared profile-0 stack/freeform/responsive layout, lowers explicit fidelity, and rasterizes the v0 solid rectangles and pinned Ahem text. The differential harness supplies reference artifacts; the implementation computes its own results before comparing boxes, decoded RGBA and fidelity.
Its scope is deliberately narrower than the full draft model. It supports the semantics exercised by the responsive-card fixture and returns a failure for visual operations outside that independent render subset. It is evidence for Gate G’s v0 reproduction criterion, not a second general-purpose NUIF product.
Run its local unit tests with:
python3 -m unittest discover -s implementations/python/tests -p 'test_*.py'
The same standard-library boundary now includes nuif_tree_materializer.py.
It independently replays the bounded structural profile’s parent, sibling
order, stable-anchor, cycle-rejection, and replay-conflict decisions from the
Gate H fixture. It compares a structural projection (roots, children, active
positions, and replay conflicts) with the Rust checkpoint. It intentionally
does not decode canonical CBOR, recompute the canonical hash, or reimplement
the higher-level concurrent semantic-conflict classifier.
The complete cross-implementation run is exposed through cargo xtask gate-g.
nuif_package_oracle.py is a separate standard-library-only archive oracle for
nuif-package-0. It parses and rewrites the stored ZIP container without
zipfile or a Rust dependency, checking deterministic headers, member order,
offsets, CRCs and the exact MIME/member paths. cargo xtask gate-i-package
compares its bytes with the Rust package writer and records the two opaque
canonical payloads (document.cbor and manifest.cbor) explicitly. This is
archive-level cross-writer evidence; it does not claim that Python implements
the NUIF semantic model or canonical CBOR encoder.