Conversation
The shared, version-pinned canonicalization library consumed identically by signer and verifier. Any divergence here breaks every signature, so this package is tested hardest. - body.ts: canonical body (§5) — UTF-8 validation, CRLF/CR→LF, per-line trailing whitespace strip, exactly one trailing LF; content_hash. - frontmatter.ts: byte-boundary split at the closing `---` (§5 step 1) and YAML→JSON-data-model parse (core schema keeps timestamps as RFC 3339 strings; Date defensively coerced). - jcs.ts: RFC 8785 canonicalization (via `canonicalize`, re-typed). - payload.ts: signing payload = JCS(frontmatter*) || 0x0A || canonical body, removing only provenance.signature.value. - index.ts: canonicalizeConcept() convenience + re-exports. Tests (28): RFC 8785 key-order/number/escape vectors; §5 body cases; invalid-UTF-8 rejection; CRLF/trailing-ws hash-identical; key-reorder → identical JCS & signing payload; signature.value does not affect payload. build + test green. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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.
S1 —
@verifiable-okf/canon(VOKF-1)The shared, version-pinned canonicalization core (SPEC §5/§6). Signer and verifier will both depend on this; any divergence breaks every signature, so it is tested hardest.
Implements
content_hash=sha256:+ lowercase hex.---(§5 step 1); YAML→JSON data model (core schema → RFC 3339 timestamps stay strings).canonicalize.JCS(frontmatter*) ‖ 0x0A ‖ canonical_body, removing onlyprovenance.signature.value.canonicalizeConcept()convenience + re-exports.DoD(VOKF-1)
@verifiable-okf/canon@0.1.0)として signer/verifier が依存可能pnpm build/pnpm testgreen(28 tests)次
S2(signer+schema+DID)。本PRマージ後に着手します。
🤖 Generated with Claude Code