open-standards/mesh
Repository files (latest commit first)
Filename Latest commit message Latest commit date
David Charlot 28c48b46e2
Some checks failed
wai cross-architecture byte-equality / windows-x86_64 (pull_request) Successful in 30s
wai cross-architecture byte-equality / linux-aarch64 (pull_request) Successful in 42s
joule-code conformance gate / Build + round-trip C1-C4 vectors (pull_request) Failing after 1m3s
WAI conformance / cargo-class corpora · linux-arm64 (pull_request) Successful in 1m1s
WAI conformance / cargo-class corpora · windows (pull_request) Successful in 1m21s
jouleclaw public surface must stay documented / Public-surface audit (jouleclaw-rs) (pull_request) Successful in 58s
WAI conformance / cross-arch byte-equality · linux-arm64 (pull_request) Successful in 20s
WAI conformance / cross-arch byte-equality · windows (pull_request) Successful in 22s
wai cross-architecture byte-equality / linux-x86_64 (pull_request) Successful in 14s
WAI conformance / cargo-class corpora · linux (pull_request) Successful in 29s
WAI conformance / cross-arch byte-equality · linux (pull_request) Successful in 15s
wai cross-architecture byte-equality / macos-arm64 (reference) (pull_request) Successful in 55s
WAI neural decoders end-to-end / synthetic fixtures → Rust decode → reference (±4) (pull_request) Failing after 1m5s
WAI conformance / cargo-class corpora · macos (pull_request) Successful in 13m25s
WAI conformance / cross-arch byte-equality · macos (pull_request) Successful in 3m42s
chore: Rust 1.98.0 (latest stable) + refresh every dependency
Toolchain 1.97.1 -> 1.98.0 (released 2026-08-18) in both `rust-toolchain.toml`
files, 33 pins across 5 CI workflows, and 26 workspace `rust-version`
declarations. Nothing pinned to 1.97 remains.

Dependencies refreshed in all 25 workspaces: 1,751 changes, every one
semver-compatible. The vendored `jouledesk-rs/vendor/libwebrtc` tree is
deliberately excluded — it is a patched vendor drop, not a managed dependency.

Note the `1.97` in `jouleclaw-loader-gguf/BENCHMARKS.md` is a benchmark timing
("1.97 ms"), not a version; a blind find-and-replace would have corrupted a
results table, so pins were matched by field rather than by string.

Also completes a cross-workspace regression this repo has been carrying. When
`budget_funds` and `caveats` were added to `jcp_schema::Grant`, the workspaces
that path-depend on `jcp-schema` were fixed one wave at a time, and three were
missed: `joule-ui`, `jouleclaw` and `mesh` still built `Grant` without the new
fields and had been failing to compile since. `cargo test --workspace` inside
`jcp-rs` never builds them, which is exactly why it went unseen; checking every
workspace independently is what surfaced it. Two of the six sites used field-init
shorthand (`budget_uj,` with no colon), so they needed a separate pass — a
reminder that a regex over initializers is not a substitute for compiling.

Verified: 21 of 25 workspaces `cargo check --workspace --all-targets` clean.

Not fixed here, and NOT caused by this change — each verified against the
pristine tree rather than assumed:

- `eoc/eoc-rs`: `RequestBuilder::query` is unavailable because reqwest is taken
  with `default-features = false`, which drops the feature providing it.
  reqwest is 0.13.4 before and after, and `serde_urlencoded` is absent from the
  lock in both, so this predates the refresh. Fixing it is a choice between
  enabling the feature and changing the call sites.
- `openpay`: `Hmac::new_from_slice` unresolved. hmac 0.12.1, digest 0.10.7 and
  sha2 0.10.9 are identical before and after — same versions in, same result.
- `smart-byte/smart-byte-rs`: never resolved on main. Its manifest asked for two
  features that do not exist (`rand_core`'s `alloc`, which no version has ever
  had, and `cbc`'s `std`, where 0.2 offers `alloc`); both are corrected here,
  which advances it from "will not resolve" to "will not compile" and exposes
  the real problem — the manifest wants `rand = "0.10"` while the lock pinned
  `rand 0.8.8` and 38 files still use the 0.8-era API (`thread_rng`,
  `rand::rngs::OsRng`). That is a two-major-version source migration and wants
  its own change, not a side effect of a toolchain bump.

`wai/wai-rs` needs libjxl present to build its default feature set; CI installs
`libjxl-dev`, so this is a local environment gap rather than a repo failure.
2026-08-26 07:58:37 -04:00
..
conformance/v1 wai.generate.spectral: extend the lexicon to 370 words (data-only, pin unchanged) 2026-06-27 05:33:47 -04:00
mesh-rs chore: Rust 1.98.0 (latest stable) + refresh every dependency 2026-08-26 07:58:37 -04:00
CONTRIBUTING.md wai.generate.spectral: extend the lexicon to 370 words (data-only, pin unchanged) 2026-06-27 05:33:47 -04:00
LICENSE wai.generate.spectral: extend the lexicon to 370 words (data-only, pin unchanged) 2026-06-27 05:33:47 -04:00
LICENSE-SPEC wai.generate.spectral: extend the lexicon to 370 words (data-only, pin unchanged) 2026-06-27 05:33:47 -04:00
README.md wai.generate.spectral: extend the lexicon to 370 words (data-only, pin unchanged) 2026-06-27 05:33:47 -04:00
SPEC.md wai.generate.spectral: extend the lexicon to 370 words (data-only, pin unchanged) 2026-06-27 05:33:47 -04:00

Mesh

Energy-accounted inference serving & routing. One of the Transaction Science open standards.

Mesh treats every inference as a metered transaction. A request declares a joule ceiling and a fidelity floor; the mesh routes it to the cheapest-sufficient model on the cheapest-sufficient backend, serves it under an energy meter, and seals a receipt whose headline figure is microjoules per accepted output token — measured at the meter, not estimated from a price list.

The serving shelf reports dollars per token and tokens per second. Mesh reports the number that is physical, comparable across hardware, and impossible to inflate: the joule.

The shape

ServeRequest ──▶ authorise (JCP grant) ──▶ route (cheapest-sufficient)
                                              │
                                              ▼
                          meter ◀── serve (engine) ──▶ tokens
                                              │
                                              ▼
                         sealed JCR-1 receipt: µJ / accepted token

Four roles — caller, router, engine, steward — and four phases per serve: authorise, route, meter, seal. See SPEC.md §2.

The reference workspace

mesh-rs/ is a pure-Rust reference implementation:

Crate What it is
mesh-schema wire types — ServeRequest, Fidelity, two-part Energy, RouteDecision, ServeOutcome
mesh-router energy-weighted cheapest-sufficient routing with a full candidate audit
mesh-engine the ServingEngine interface + a deterministic, weights-free ReferenceEngine
mesh-engine-gguf a real backend (behind gguf): wraps the family's pure-Rust GGUF/Metal inference substrate so the mesh routes and meters actual model tokens
mesh-meter the meter window; an always-available estimator + an optional bridge to the family hardware meter (RAPL / NVML / Apple) behind hw-meter
mesh-receipt the mesh/1 receipt, JCR-1 sealing (det-CBOR + COSE_Sign1), and a hash-chained log
mesh-core the orchestration that ties authorise → route → meter → seal together
mesh-conformance the deterministic reference scenario, its checks, and the gen-vectors bin

Mesh rides on JCP (a serve request is authorised by a JCP grant; receipts seal in JCR-1), dispatches to runtimes such as JouleClaw, and routes across compute described by EOC and isolated by Sandbox. It introduces no new cryptography (see SPEC.md §9).

Run it

cd mesh-rs

# all crates green
cargo test --workspace
cargo clippy --workspace --all-targets

# end-to-end: mint a JCP grant, serve, print the sealed receipt
cargo run -p mesh-core --example demo

# on Linux/RAPL or a CUDA/NVML box, meter real silicon (HwShunt provenance)
cargo run -p mesh-core --example demo --features hw-meter-rapl

# regenerate the published conformance vectors
cargo run -p mesh-conformance --bin gen-vectors -- ../conformance/v1

# serve a REAL model end-to-end through Mesh (Falcon-H1 0.5B), seal the receipt
cargo run --release -p mesh-engine-gguf --features gguf --bin serve_falcon -- \
    /path/to/falcon-h1-0.5b-instruct 12 "The capital of France is"

The serve_falcon run demonstrates the whole standard on real model tokens: a JCP grant authorises each request (an underfunded grant is refused before any decode runs), the cheapest-sufficient backend is chosen, the decode is metered, and a mesh/1 receipt is sealed and hash-chained across the session — e.g. prompt "The capital of France is" → " Paris. It is known for its historical landmarks", prompt "Photosynthesis is the process by which" → " plants convert sunlight into chemical energy in the form of", with both seals verifying and the chain's prev-links intact.

The demo prints the route (every backend weighed, with the reason each was kept or rejected), the honest energy provenance, and the wedge metric — then verifies the sealed envelope under the steward key.

Status

v0.1.0-draft.1. Reference workspace builds and tests green (mesh-schema, mesh-router, mesh-engine, mesh-meter, mesh-receipt, mesh-core, mesh-conformance); cargo clippy --all-targets warning-free; published vectors in conformance/v1/. The reference engine is deterministic and weights-free; production backends implement the same ServingEngine interface — mesh-engine-gguf (behind gguf) is a real one over the family's pure-Rust GGUF/Metal substrate, kept out of the default build so it needs no weights.