Repository navigation
feat(codec): add canonical source and namespace identities - #8
Merged
genedna merged 3 commits intoOct 5, 2026
Merged
Conversation
Ivanbeethoven
marked this pull request as ready for review
October 5, 2026 02:51
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Source, binding and view identities currently lack a shared implementation in mst2-codec. Add pure canonical binary codecs following the fixed Mega draft c488b78a82361ecc6e5bb285977b8439993c062e source-snapshot-v1 and namespace-manifest-v1 contracts, so later server/client adapters can generate identical identities.
The source codec preserves the existing SHA-1-only v1 contract and commit provenance. Binding identity includes its complete source descriptor, subpath and explicit policy; view identity separates instance, native source, binding root and override presence. Constructors validate canonical non-nil UUID text, lowercase OIDs, component/UTF-8 byte path limits, source path composition and root native scope. Decoders cap complete manifests, bound every length and reject unknown domains/tags, malformed UTF-8, truncation and trailing bytes.
Frozen independent .NET fixtures verify exact bytes and SHA-256 identities. Regressions cover every truncated prefix, maximum paths, invalid UUID/OID/length/tag inputs, Unicode preservation, same-tree/different-commit provenance and absent versus present override roots. Add Linux/macOS/Windows CI for both identity and zstd profiles, and compile compression-only helpers/imports only in the zstd profile.
Validation on the final source: format, builds and warnings-denied all-target Clippy pass in both profiles; all-feature tests pass 78 unit + 6 integration, identity tests pass 58 unit + 6 integration. Independent source review matched the fixed contract and confirmed both fixture hashes. actionlint v1.7.12 passes. All six Linux/macOS/Windows × identity/zstd jobs pass on c813373 in run 37256878716, including warnings-denied Clippy, builds and complete tests. The initial new Clippy failure on 94b9a3a was fixed in the golden-vector helper; no lint was disabled.
Stacked on #7. This is binary encoding only: no JSON deserializer, binding-index codec, source attestation, authorization, publication, release enforcement, product adoption or deployment is included. Identifier strings remain structurally validated codec inputs; adapters must retain distinct business types and enforce the current endpoint profile, including its additional depth limit. No docs, logs or environment files are committed.