Repository navigation
feat(schema-identity): fix the D1.3 schema_digest and schema_name contracts (#63) - #64
Merged
Merged
Conversation
…tracts, with golden vectors and a Rust/Go differential schema_digest is the SHA-256 of the raw bytes of the pinned schema source (no parsing, no normalization; a final newline and the line endings are part of the identity). schema_name is identity.namespace + ':' + identity.kind, used as authored, with non-empty colon-separated namespace components and a colon-free kind. Absent or mismatching digest claims and invalid identity components are refused, in a fixed check order. - engine/src/schema_identity.rs and go/schemaidentity: the contract, in both languages; the receipt verifier is not changed. - conformance/differential/schema_identity: 23 vectors (5 accepted, 18 rejected) holding the real source bytes (-text), including the 314-byte golden file and its 313-byte variant. - docs: MATERIALIZATION-SPEC D1.3 and RECEIPT-SCHEMA 'Schema identity contract'. Refs #63. The pin update in cic-primitive-forms and production receipts (release-origin authenticity) are separate steps.
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.
Refs #63 (does not close it).
What
Fixes the two D1.3 contracts decided in the owner comment on #63, and proves them with golden and negative vectors read by both languages.
schema_digest="sha256:"+ lowercase hex of the SHA-256 of the raw bytes of the pinned schema file. No parsing, normalization or re-serialization; line endings and the final newline are part of the identity.schema_name=identity.namespace + ":" + identity.kind, as authored. Both non-empty; the namespace is colon-separated non-empty components; the kind has no colon. No trimming or case folding.Changes
engine/src/schema_identity.rsandgo/schemaidentity:schema_digest,schema_name,bind_schema_identity(+BindSchemaIdentity). The digest reuses the existing A7 hash function over the raw bytes; no new algorithm.E_SCHEMA_SOURCE_BINDINGandE_INVALID_SCHEMA_IDENTITY(rules inRECEIPT-SCHEMA.md).conformance/differential/schema_identity/: 23 vectors (5 accepted, 18 rejected). Each holds the real source bytes;.gitattributesmarks them-text, andgit ls-files --eolshows the index bytes unchanged (LF, no-final-LF, CRLF).docs/MATERIALIZATION-SPEC.mdD1.3 and a newRECEIPT-SCHEMA.mdsection, "Schema identity contract".receipt.rs,go/receipt). It still does not authenticate the source.Evidence
sha256sumandopenssl dgst(314 bytesa36e841d…d1a338; 313 bytes4fff76af…07f7), not copied from the issue comment. The Rust test also checks thespec.identitythe vectors state against the file with the engine's reader.cargo fmt --check,clippy -D warnings,cargo test --workspace(debug and release),gofmt,go vet,go test -race ./...: all clean.Not covered here
cic-primitive-formsand adopting the contract there: a separate, separately checked step after merge.