verirun-core 0.2.0

Deterministic core for verirun covering RFC 8785 canonical JSON, domain-separated SHA-256 digest framing, DAG validation, and Merkle manifests with std only.
Documentation
  • Coverage
  • 100%
    288 out of 288 items documented0 out of 113 items with examples
  • Size
  • Source code size: 218.4 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 2.0 MB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 2s Average build duration of successful builds.
  • all releases: 3s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • david-engelmann/verirun
    0 0 0
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • david-engelmann

verirun-core

verirun-core is the pure deterministic core of verirun. It implements the JSON data model, a strict recursive descent parser with byte-offset diagnostics, RFC 8785 (JCS) canonical encoding over the safe integer domain, domain-separated SHA-256 digest framing behind a streaming hasher trait, task graph validation, sandbox relative path rules, and Merkle manifest construction and diffing.

This crate depends strictly on the Rust standard library and forbids unsafe code. It performs no filesystem, process, network, clock, or randomness access. Concrete hash implementations and storage live in verirun-store.

Modules

  • value provides the JSON value representation used by canonical encoding.
  • parse parses byte slices strictly while rejecting duplicate keys, lone surrogates, and excessive nesting with byte offsets.
  • canonical encodes values under RFC 8785 with UTF-16 property sorting and ECMA-262 number formatting.
  • digest defines Digest, DomainTag, StreamingHasher, HasherFactory, and Pattern S and Pattern T tuple framing.
  • cas provides pure path derivation, temporary file naming, put phase types, and garbage collection reachability planning.
  • dag validates TaskSpec graphs in a fixed check order and computes deterministic Kahn topological schedules.
  • paths validates and normalizes sandbox relative paths without touching the host filesystem.
  • manifest builds, encodes, parses, verifies, and diffs Manifest, TaskRecord, and ArtifactRecord values.
  • error defines all typed domain errors with full diagnostic context.

Usage

use verirun_core::{canonical, parse};

let value = parse::parse(br#"{"b":[true,null],"a":1}"#).expect("valid JSON");
let bytes = canonical::to_vec(&value).expect("in-domain canonical JSON");
assert_eq!(bytes, br#"{"a":1,"b":[true,null]}"#);

Documentation

Licence

Dual licensed under the MIT licence and the Apache License 2.0.