Skip to content

feat(codec): preserve canonical namespace binding radix bytes - #9

Merged
genedna merged 1 commit into
feat/canonical-namespace-codecfrom
feat/canonical-binding-radix-codec
Oct 5, 2026
Merged

genedna merged 1 commit into
feat/canonical-namespace-codecfrom
feat/canonical-binding-radix-codec

Conversation

@Ivanbeethoven

@Ivanbeethoven Ivanbeethoven commented Oct 5, 2026 •

Copy link
Copy Markdown
Collaborator

Canonical namespace manifests need the existing binding-index byte contract to represent bindings_root. Add the pure local node and component-key codecs from Mega draft c488b78a82361ecc6e5bb285977b8439993c062e / docs/spec/namespace-index-v1.md, stacked on #8. Encoding preserves the v1 domain, big-endian lengths, binding digest, sorted byte edges and empty-root identity. Decoding rejects truncation, noncanonical local compression, duplicate/unsorted edges and budget violations.

Complete value keys preserve case/Unicode/literal backslashes, encode component separators as NUL and keep / as an empty key. The decoder rejects slash-based and NUL-only-root aliases that are not canonical encoder output. Compressed labels may split UTF-8; only complete assembled keys are path-validated. The existing v1 structural limits remain unchanged; MST/2's 256-component serving profile must be enforced by its adapter.

This change contains no CoW update algorithm, store, graph walker, SQL transaction, binding/source lookup, runtime serving or capability enablement. A future walker/store must verify requested digests, incoming child-label relationships, assembled-key limits, source membership and retention. A locally valid node is not proof of a valid complete namespace graph.

Validation on Windows, Rust 1.98.1:

  • cargo fmt --all --check and git diff --check: pass.
  • cargo clippy --all-targets --no-default-features --locked -- -D warnings, identity build and tests: pass, 70 unit + 6 integration tests.
  • cargo clippy --all-targets --all-features --locked -- -D warnings, zstd build and tests: pass, 90 unit + 6 integration tests.
  • Twelve new tests cover independent frozen .NET node bytes/digests, all-prefix truncation, malformed domains/tags/lengths, ordering, compression, max label and 256-byte fanout, UTF-8 split labels, key neighbors/order/aliases/budgets and identity changes. The frozen Draft JSON fixture was copied unchanged; SHA-256 95f33b6916ff3d3e82bbb70abed89c5ca9c5450bada60fe7404542ab7745f4b6.
  • At exact head 2589413984444f6a1c0064ccd85e2858647ec1e5, all six GitHub Actions jobs passed (Linux/macOS/Windows × identity/zstd): https://github.com/gitmono-dev/mst2-codec/actions/runs/37257559388 . Two independent static reviews found no blocking node/key codec correctness issue.

Only Rust code/tests and the canonical test fixture are pushed. Audit reports and plans remain private.

@Ivanbeethoven
Ivanbeethoven marked this pull request as ready for review October 5, 2026 03:02
@genedna
genedna merged commit 8317e60 into feat/canonical-namespace-codec Oct 5, 2026
6 checks passed
genedna pushed a commit that referenced this pull request Oct 5, 2026
* feat(codec): encode canonical namespace v1 identities

* test(codec): keep golden hex decoder lint clean

* feat(codec): preserve canonical namespace binding radix bytes (#9)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants