Repository navigation
Releases
v0.1.5
v0.1.5
The command-line binary is renamed from canon to canonprims, and gains
three jcs modes: golden vectors, strict NDJSON prefixes framed as one
canonical array, and canonical sets. The helpers behind them are public in
the Rust crate canonprims-json and the Go package canon. The Go package
path, the crate names, the language bindings and the conformance corpus are
unchanged.
What it ships
- Rust crates
canonprims-coreandcanonprims-json(crates.io). - Go module
github.com/3leaps/canonprims(packagecanon), standard
library only and cgo-free. canonprimscommand for linux amd64/arm64, darwin arm64 and windows
amd64/arm64, in archives namedcanonprims-0.1.5-<platform>.- Python package
canonprims(PyPI): an abi3 wheel per platform for
CPython 3.10 and later, on linux amd64/arm64 (manylinux2014, glibc 2.17 or
later), darwin arm64 and windows amd64/arm64. No source distribution. - npm package
@3leaps/canonprims: one WebAssembly module with no
imports, embedded in an ES module with no runtime dependencies. Tested on
Node.js 20 and 22.
The wheels and the npm package are release assets: built and tested in the
tag workflow, listed in both checksum manifests and covered by both
signatures. The packages on PyPI and npm are these exact files.
Command line
The binary is canonprims; the name in version output and in diagnostics
is canonprims. Its subcommands, flags, output and exit codes are those of
canon 0.1.4 except that numeric options (--max-*, --head) now accept
only ASCII decimal digits: a sign, space or _ is a usage error (exit 2).
Of these, 0.1.4 accepted a leading + (for example +5). New jcs modes:
--vector: one canonical JSON object, then a newline:
{"byte_length":N,"canonical":"...","digest":"sha256:...","scheme":"jcs/rfc8785"}.
The object is itself canonical;canonicalis the canonical bytes as a
JSON string.--ndjson-array [--head N]: the input is LF-terminated NDJSON lines (no
CR LF, no empty or whitespace-only line, no unterminated line). Each line
is canonicalized one level below--max-depthand the lines form one
canonical array, in order. With--head Nexactly the first N lines are
used: the command answers once they have arrived, so a writer may keep the
stream open, and nothing after them is parsed. Input is read through a
buffer, so bytes after the selected lines may be consumed from a pipe or
shared descriptor. The selected lines must fit in--max-bytes.--sort-set: the array's elements are sorted by their canonical bytes
(unsigned, byte by byte); two elements with the same canonical bytes are
refused withduplicate_set_element, and a non-array withnot_an_array.
With--check, the input must already be that sorted canonical set.
--vector, --digest and --check are mutually exclusive;
--ndjson-array cannot be combined with --check; --head requires
--ndjson-array. Numeric options accept only ASCII decimal digits.
Library
Rust canonprims-json: vector, Vector (from_canonical, canonical,
byte_length, digest, scheme, to_json), ndjson_elements,
canonicalize_ndjson, sort_canonical_set, check_canonical_set and
assemble_canonical_set. Go canon: VectorOf, VectorOfCanonical,
Vector, NDJSONElements, CanonicalizeNDJSON, SortCanonicalSet,
CheckCanonicalSet and AssembleCanonicalSet (the zero Go Vector holds
no bytes and its JSON is nil). Their behaviour, including
the order in which defects are reported, is specified in
docs/spec/jcs-rfc8785.md ("Composition helpers").
Code::ALL (Rust) and the binding CODES lists still name only the scheme
codes; the two set codes are in Code::SET.
Release machinery
- The release workflow packages the
canonprimsbinary as
canonprims-X.Y.Z-<platform>.{tar.gz,zip}; its pin in
config/release/release-workflow.sha256is updated. scripts/release-common.shexpectscanon-X.Y.Z-<platform>archives for
releases 0.1.0 through 0.1.4 andcanonprims-X.Y.Z-<platform>from 0.1.5,
so staging and verifying a published older release is unchanged.
Conformance
- Corpus
conformance/canonical-json/v0, 180 cases, unchanged.
MANIFEST.jsonsha256:
de3ac543580ddb90f7e3a6e72239097274d3635ea783f302a9260b5a7d0c8d90. - Rust and Go agree byte for byte on the corpus and on generated input:
crosscheck seeds20261022and20261023, 5000 inputs each, on every
native CI cell. The same seeds also generate inputs shaped for the new
helpers, and the two drivers agree on every helper. - Each binding runs the whole corpus against its installed package (the
wheel, or the packed npm tarball), and its corpus results and its output on
the same crosscheck seeds equal Rust's byte for byte.
Verification
canonprims canonicalizes and digests; it verifies no signatures, so it
embeds no key. To verify this release, check the signed tag v0.1.5 and the
signed checksum manifests against the public pins committed in the tagged
commit (docs/security/); see docs/security/README.md. A wheel or the npm
tarball downloaded from PyPI or npm has the SHA-256 listed for it in
SHA256SUMS.
v0.1.4
v0.1.4
Release preflight alignment for read-only GitHub Actions GITHUB_TOKEN
execution inside registry-publish.yml. The library, language bindings,
conformance corpus and canon command are unchanged from 0.1.3.
What it ships
- Rust crates
canonprims-coreandcanonprims-json(crates.io). - Go module
github.com/3leaps/canonprims(packagecanon), standard
library only and cgo-free. canoncommand for linux amd64/arm64, darwin arm64 and windows
amd64/arm64.- Python package
canonprims(PyPI): an abi3 wheel per platform for
CPython 3.10 and later, on linux amd64/arm64 (manylinux2014, glibc 2.17 or
later), darwin arm64 and windows amd64/arm64. No source distribution. - npm package
@3leaps/canonprims: one WebAssembly module with no
imports, embedded in an ES module with no runtime dependencies. Tested on
Node.js 20 and 22.
The wheels and the npm package are release assets: built and tested in the
tag workflow, listed in both checksum manifests and covered by both
signatures. The packages on PyPI and npm are these exact files.
Release machinery
scripts/release-github-preflight.sh: when invoked under GitHub Actions
(GITHUB_ACTIONS=true) with acontents: readGITHUB_TOKEN(which has no
Administrationscope), accepts the redactedbypass_actors: nullfield on
GET /repos/3leaps/canonprims/rulesets/<id>while verifying all other ruleset
fields, and verifies release immutability on the published release object
(GET /repos/3leaps/canonprims/releases/tags/vX.Y.Z,.immutable == true)
when/immutable-releasesreturns HTTP 403. Maintainer preflight outside
GitHub Actions continues to require both the explicitOrganizationAdmin
bypass_actorsarray and/immutable-releases.docs/releases/v0.1.3.md: records the runner group (default) and runner
image versions for the two unversioned arm64 cells of thev0.1.3release
workflow run.
Conformance
- Corpus
conformance/canonical-json/v0, 180 cases, unchanged.
MANIFEST.jsonsha256:
de3ac543580ddb90f7e3a6e72239097274d3635ea783f302a9260b5a7d0c8d90. - Rust and Go agree byte for byte on the corpus and on generated input:
crosscheck seeds20261022and20261023, 5000 inputs each, on every
native CI cell. - Each binding runs the whole corpus against its installed package (the
wheel, or the packed npm tarball), and its corpus results and its output on
the same crosscheck seeds equal Rust's byte for byte.
Verification
canon canonicalizes and digests; it verifies no signatures, so it embeds no
key. To verify this release, check the signed tag v0.1.4 and the signed
checksum manifests against the public pins committed in the tagged commit
(docs/security/); see docs/security/README.md. A wheel or the npm tarball
downloaded from PyPI or npm has the SHA-256 listed for it in SHA256SUMS.
v0.1.3
v0.1.3
OIDC Trusted Publishing for PyPI (canonprims) and npm (@3leaps/canonprims),
published-release staging and live registry digest verification, and
release-script portability hardening. The library, language bindings,
conformance corpus and canon command are unchanged from 0.1.2.
What it ships
- Rust crates
canonprims-coreandcanonprims-json(crates.io). - Go module
github.com/3leaps/canonprims(packagecanon), standard
library only and cgo-free. canoncommand for linux amd64/arm64, darwin arm64 and windows
amd64/arm64.- Python package
canonprims(PyPI): an abi3 wheel per platform for
CPython 3.10 and later, on linux amd64/arm64 (manylinux2014, glibc 2.17 or
later), darwin arm64 and windows amd64/arm64. No source distribution. - npm package
@3leaps/canonprims: one WebAssembly module with no
imports, embedded in an ES module with no runtime dependencies. Tested on
Node.js 20 and 22.
The wheels and the npm package are release assets: built and tested in the
tag workflow, listed in both checksum manifests and covered by both
signatures. The packages on PyPI and npm are these exact files.
Release machinery and OIDC publication
.github/workflows/registry-publish.yml: manualworkflow_dispatch
workflow on av*tag ref. Theverifyjob restores and verifies the
signed tag onorigin, checks source inertness, stages and verifies the
published GitHub release viascripts/release-stage-published.sh, and
uploads the verified release bundle. Thepublish-pypi(publish-pypi
environment) andpublish-npm(publish-npmenvironment) jobs re-verify
every wheel and tarball SHA-256 against the signedSHA256SUMSmanifest
(scripts/ci-prepare-pypi-publish.sh,scripts/ci-publish-npm-oidc.sh),
publish via OIDC Trusted Publishing with PEP 740 and npm provenance
attestations, and runscripts/release-verify-registries.sh.- Live registry and provenance verification (
make release-stage-published,make release-verify-registries):
binds staged public signing keys, fingerprint pins and release notes
byte-for-byte to the verified tag commit, verifies bothSHA256SUMSand
SHA512SUMSsignatures, and confirms that PyPI serves the exact five wheels
under.ownership.organization == "3leaps"with PEP 740 provenance
attestations (/integrity/canonprims/<version>/<wheel>/provenance) and npm
serves the exact@3leaps/canonprimstarball (dist.integritySHA-512 SRI
anddist.shasum) with Sigstore provenance (dist.attestations.provenance). - GitHub environment, ruleset, and signing ceremony guards: adds
scripts/release-github-preflight.sh(make release-github-preflight) to
verify thepublish-pypiandpublish-npmenvironments (required reviewer +
v*tag policy), theTag Publish Protectionruleset, and
immutable_releases; pinsgit -c gpg.format=openpgp -c gpg.program=gpg -c gpg.openpgp.program=gpgfor tag signing and verification; refuses the
default~/.gnupgkeyring during signing; and updates
scripts/release-prepare-tag-message.pyto the 3-line attribution trailer. - Portability and ceremony helpers: adds
make release-stage,
make release-crates-cleanandmake release-pack-npm-redirector, declares
npm(>= 10.0.0) anduv(>= 0.5.0) in.goneat/tools.yamland
config/doctor-versions.txt, enforces lowercase-only ASCII hex in the Rust
canon-diffcrosscheck driver, guards against unguarded Bash 3.2 empty-array
expansions inscripts/jq-portability.sh, uses mode-120000git index
entries andcore.autocrlf=falsein the surface-check test suites, and
separates project name and trademark notices intoNOTICEalongside verbatim
LICENSE-MITandLICENSE-APACHEfiles in the repository root and binding
packages.
Conformance
- Corpus
conformance/canonical-json/v0, 180 cases, unchanged.
MANIFEST.jsonsha256:
de3ac543580ddb90f7e3a6e72239097274d3635ea783f302a9260b5a7d0c8d90. - Rust and Go agree byte for byte on the corpus and on generated input:
crosscheck seeds20261022and20261023, 5000 inputs each, on every
native CI cell. - Each binding runs the whole corpus against its installed package (the
wheel, or the packed npm tarball), and its corpus results and its output on
the same crosscheck seeds equal Rust's byte for byte.
Verification
canon canonicalizes and digests; it verifies no signatures, so it embeds no
key. To verify this release, check the signed tag v0.1.3 and the signed
checksum manifests against the public pins committed in the tagged commit
(docs/security/); see docs/security/README.md. A wheel or the npm tarball
downloaded from PyPI or npm has the SHA-256 listed for it in SHA256SUMS.
v0.1.2
v0.1.2
Python and TypeScript bindings for canonprims. Both are thin layers over the
Rust canonprims-json crate, pass the same conformance corpus as the Rust and
Go implementations, and agree with Rust byte for byte. The library, corpus and
canon command are otherwise unchanged from 0.1.1.
What it ships
- Python package
canonprims(PyPI): an abi3 wheel per platform for
CPython 3.10 and later, on linux amd64/arm64 (manylinux2014, glibc 2.17 or
later), darwin arm64 and windows amd64/arm64. No source distribution. - npm package
@3leaps/canonprims: one WebAssembly module with no
imports, embedded in an ES module with no runtime dependencies. Tested on
Node.js 20 and 22. - Rust crates
canonprims-coreandcanonprims-json, the Go module
github.com/3leaps/canonprims(packagecanon) and thecanoncommand
for linux amd64/arm64, darwin arm64 and windows amd64/arm64, as in 0.1.1.
The wheels and the npm package are release assets: built and tested in the
tag workflow, listed in both checksum manifests and covered by both
signatures. The packages on PyPI and npm are these exact files.
The bindings
Both expose the same four verbs as Rust and Go: canonicalize, check, digest
and scheme info. Canonicalize, check and digest take explicit limits on
every call, with the same defaults (16 MiB of input, depth 128, 1,048,576
members per object, 16 MiB per string); a negative limit behaves as 0.
Input outside the I-JSON domain is refused with the same nine normative
codes, plus not_canonical from check, and is never repaired.
- Python: input is any buffer, read as its bytes; a
stris encoded as
UTF-8. Refusals raisecanonprims.Refusal, aValueErrorcarryingcode
andoffset. - TypeScript: input is a
Uint8Arrayor anyArrayBufferView, read as
its bytes; a string is encoded as UTF-8, and a string with an unpaired
surrogate, which has no UTF-8 form, is aTypeError. An input longer than
maxBytesis refused before it is copied into the module. Refusals throw
Refusalwithcodeandoffset.
The WebAssembly crate allows unsafe code only on its exported functions;
SecDR-0001 records
why, the residual risk and the check that enforces it.
Conformance
- Corpus
conformance/canonical-json/v0, 180 cases, unchanged.
MANIFEST.jsonsha256:
de3ac543580ddb90f7e3a6e72239097274d3635ea783f302a9260b5a7d0c8d90. - Rust and Go agree byte for byte on the corpus and on generated input:
crosscheck seeds20261022and20261023, 5000 inputs each, on every
native CI cell. - Each binding runs the whole corpus against its installed package (the
wheel, or the packed npm tarball), and its corpus results and its output on
the same crosscheck seeds equal Rust's byte for byte.
Release machinery
- The release tag restore now confirms origin's tag object even when the
checkout already holds it. - Built bindings carry no build-host path.
Verification
canon canonicalizes and digests; it verifies no signatures, so it embeds no
key. To verify this release, check the signed tag v0.1.2 and the signed
checksum manifests against the public pins committed in the tagged commit
(docs/security/); see docs/security/README.md. A wheel or the npm tarball
downloaded from PyPI or npm has the SHA-256 listed for it in SHA256SUMS.
v0.1.1
v0.1.1
The first published release of canonprims: the RFC 8785 JSON
Canonicalization Scheme (jcs/rfc8785) in two independent implementations,
Rust and pure Go, gated against one conformance corpus.
A v0.1.0 tag exists but was never released. Its tag workflow looked up the
tag with an anonymous request, which cannot read a private repository, so it
stopped before building anything. 0.1.1 looks the tag up with the workflow's
read-only job token and carries the same library, corpus and command.
What it ships
- Rust crates
canonprims-core(schemes, refusal codes, limits, digests)
andcanonprims-json(RFC 8785 over a strict I-JSON loader), published to
crates.io. Minimum supported Rust 1.88. - Go module
github.com/3leaps/canonprims, packagecanon, standard
library only and cgo-free, on Go 1.21 or later. - The
canoncommand (canon jcs [--check] [--digest] FILE|-,
canon info,canon version [--extended]) for linux amd64/arm64, darwin
arm64 and windows amd64/arm64.
Both implementations refuse input outside the I-JSON domain with the same
nine normative codes (invalid_json, invalid_utf8, duplicate_member,
lone_surrogate, noncharacter, non_finite_number,
integer_outside_binary64, too_deep, too_large), never repair it, and
take explicit limits on every call. canon jcs --check adds not_canonical
for well-formed input that is not already canonical. The
defaults are 16 MiB of input, depth 128, 1,048,576 members per object and
16 MiB per string.
Conformance
- Corpus
conformance/canonical-json/v0, 180 cases.
MANIFEST.jsonsha256:
de3ac543580ddb90f7e3a6e72239097274d3635ea783f302a9260b5a7d0c8d90. - Expected bytes are written by hand or taken from RFC 8785, never generated
by either implementation. The expected bytes of the file-based accept cases
are also checked by two independent witnesses: ECMAScriptJSON.stringify
(all 63) and a separate Python checker (crucible v0.2.2,
scripts/rfc8785-canonicalize.py; 58 of them, as it cannot witness the five
ES6-spelled integers). Refusal cases and generated input are not witnessed;
they are covered by the Rust/Go agreement below. - Rust and Go agree byte for byte on the corpus and on generated input:
crosscheck seeds20261022and20261023, 5000 inputs each, on every
native CI cell.
Verification
canon canonicalizes and digests; it verifies no signatures, so it embeds no
key. To verify this release, check the signed tag v0.1.1 and the signed
checksum manifests against the public pins committed in the tagged commit
(docs/security/); see docs/security/README.md.