open-standards/jcp/jcp-rs/crates/jcp-trace/Cargo.toml
Transaction Science a5b8792f60 jcp-trace: a std-only OTLP /v1/traces receiver (server feature)
Makes jcp-trace a live receiver, not just a static ingest. Behind the `server`
feature (no async runtime, no extra deps — std::net only), POST a gen_ai.* OTLP
trace and get the sealed eval/1 receipt back the instant the run ends — the
incumbent logs the trace to a table; this seals it, with a joule on it, on
arrival.

- EvalServer holds a steward key, the quality gate every posted run is judged
  against, the Estimator µJ/token rate, and the hash-chained receipt state.
- POST /v1/traces accepts a bare OTLP doc or an envelope
  { trace: <otlp>, assessments: [ {name, source, value, …} ] } so a run posts
  its judge/human verdicts with the trace; the reply is the eval/1 wire plus
  envelope_hex. One connection at a time so the chain stays one ordered ledger.
  GET /healthz for liveness.

14 tests (was 13) incl. an in-process HTTP roundtrip asserting the sealed
receipt; clippy --all-features --all-targets clean; live curl smoke posts a
real OTLP gen_ai trace and gets a sealed eval/1 receipt (uj_per_accepted_token
+ a content-addressed gate verdict + the COSE envelope). Runnable example
`serve`.

Co-Authored-By: Claude Opus 4.8 <[email protected]>
2026-06-27 20:53:48 -04:00

33 lines
1.2 KiB
TOML

[package]
name = "jcp-trace"
version.workspace = true
edition.workspace = true
license.workspace = true
repository.workspace = true
rust-version.workspace = true
description = "Ingest an OpenTelemetry GenAI agent trace (gen_ai.* semantic conventions) plus its evaluation assessments (judge / human / code feedback), attach per-span joules from the family meter, and seal one eval/1 JCR-1 receipt — the sealed, energy-metered form of a logged agent run. A quality gate and an ARL validation-axis projection both read it. Ingest, not compete: the incumbent logs the trace; we seal it."
[dependencies]
jcp-schema = { workspace = true }
jcp-receipt = { workspace = true }
serde = { workspace = true }
serde_json = { workspace = true }
blake3 = { workspace = true }
ed25519-dalek = { workspace = true }
hex = { workspace = true }
thiserror = { workspace = true }
[features]
default = []
# A minimal, std-only OTLP /v1/traces receiver (no async runtime, no extra deps).
# Posts of a gen_ai.* trace come back as a sealed eval/1 receipt.
server = []
# The receiver example uses the `server` module, so it only builds with the
# feature on (keeps the default `--all-targets` build clean).
[[example]]
name = "serve"
required-features = ["server"]
[lints]
workspace = true