contextgraph-types 2.0.0

Context Graph Protocol wire types: context frames, queries, capabilities, provenance. MIT, zero deps beyond serde — publishable to crates.io independently of any stella code.
Documentation
[package]
name = "contextgraph-types"
description = "Context Graph Protocol wire types: context frames, queries, capabilities, provenance. MIT, zero deps beyond serde — publishable to crates.io independently of any stella code."
version.workspace = true
edition.workspace = true
rust-version.workspace = true
license.workspace = true
repository.workspace = true
homepage.workspace = true
documentation = "https://docs.rs/contextgraph-types"
readme = "README.md"
keywords = ["contextgraph", "context", "protocol", "agents", "llm"]
categories = ["encoding", "api-bindings"]
# Overrides the workspace default (publish = false) — this crate is the
# industry-facing artifact meant to be published on its own (issue #19).
publish = true

[features]
# Off by default so the crate's "zero dependencies beyond serde" promise holds
# for the pure wire consumer. `ProvenanceAttestation` and `RecordAttestation`
# themselves always compile — only the hashing and signature checking need real
# cryptography.
default = []
# Frame-layer provenance attestation (`SPEC.md` §6.5, ADR 0010). Its preimage is
# a length-prefixed encoding of typed fields, so it needs no JSON canonicalizer.
attestation = ["dep:sha2", "dep:ed25519-dalek"]
# Record-layer content addressing (lifecycle profile LH1, ADR 0017):
# `record_hash` over the RFC 8785 (JCS) canonicalization of a record. A record
# is an open-ended JSON document, so this half genuinely needs a conforming
# canonicalizer and a JSON value model — which is why it is a feature of its own
# rather than a widening of `attestation`, and why a frame-only consumer never
# pays for it.
record-hash = ["dep:sha2", "dep:serde_json", "dep:serde_json_canonicalizer"]
# Record-layer attestation (profile LC3, ADR 0017): a detached Ed25519 signature
# over a `record_hash`. Implies `attestation` because the two layers share one
# verdict vocabulary and one hex/digest parser.
record-attestation = ["record-hash", "attestation"]

[dependencies]
serde.workspace = true
sha2 = { workspace = true, optional = true }
ed25519-dalek = { workspace = true, optional = true }
serde_json = { workspace = true, optional = true }
# RFC 8785 (JCS), delegated rather than hand-rolled. JCS number serialization is
# ECMAScript `Number::toString`, whose exponent thresholds and shortest-round-trip
# digit selection are precisely where reimplementations diverge silently; this
# crate routes them through `ryu-js`, the Boa engine's ECMAScript formatter.
serde_json_canonicalizer = { workspace = true, optional = true }

[dev-dependencies]
serde_json.workspace = true

[package.metadata.docs.rs]
# docs.rs renders the attestation surface; ordinary builds still opt in.
all-features = true