open-standards/mesh
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Transaction Science b1510772d1
All checks were successful
wai-quantum WebGPU member / member · DX12 and Vulkan (cbio-windows) (pull_request) Successful in 12m55s
joule-moq-room room service / joule-moq-room · does this change touch it (pull_request) Successful in 10s
joule-moq-room room service / joule-moq-room, every target (pull_request) Has been skipped
joule-moq-web browser client / joule-moq-web · does this change touch it (pull_request) Successful in 10s
joule-moq-web browser client / joule-moq-web · browser end-to-end (macos) (pull_request) Has been skipped
wai-web reach builds / wai-web reach · does this change touch it (pull_request) Successful in 12s
wai-web reach builds / wai-web reach builds · the package of record, every output as recorded (pull_request) Has been skipped
wai-web reach builds / wai-web reach builds · this tree's wai-web, every rung on its engine line (pull_request) Has been skipped
standards workspaces build + test / which workspaces this change touches (pull_request) Successful in 7s
wai cross-architecture byte-equality / does this change touch it (pull_request) Successful in 5s
wai cross-architecture byte-equality / linux-aarch64 (pull_request) Has been skipped
wai cross-architecture byte-equality / linux-x86_64 (pull_request) Has been skipped
wai cross-architecture byte-equality / macos-arm64 (reference) (pull_request) Has been skipped
WAI conformance / does this change touch it (pull_request) Successful in 4s
WAI conformance / cargo-class corpora · linux (pull_request) Has been skipped
WAI conformance / cargo-class corpora · linux-arm64 (pull_request) Has been skipped
WAI conformance / cargo-class corpora · macos (pull_request) Has been skipped
WAI conformance / quantum core and corpus under wasm32-wasip2 (wasmtime) (pull_request) Has been skipped
WAI conformance / v2 vocabulary · manifests validate as stated (pull_request) Has been skipped
WAI conformance / independent verifiers · claims, JWP, key discovery and integer payloads (Python) (pull_request) Has been skipped
WAI conformance / delivery telemetry · CMCD and CMSD against an independent library (pull_request) Has been skipped
WAI conformance / cross-arch byte-equality · linux (pull_request) Has been skipped
WAI conformance / cross-arch byte-equality · linux-arm64 (pull_request) Has been skipped
WAI conformance / cross-arch byte-equality · macos (pull_request) Has been skipped
WAI conformance / codec wrappers · fuzz smoke, text decode limits, C entry points, provenance, the semantic path (pull_request) Has been skipped
WAI conformance / C2PA manifest emission · signed, read back, validated (pull_request) Has been skipped
WAI energy receipts / does this change touch it (pull_request) Successful in 4s
WAI energy receipts / energy receipts · linux (pull_request) Has been skipped
WAI energy receipts / energy receipts · linux-arm64 (pull_request) Has been skipped
WAI energy receipts / energy receipts · macos (pull_request) Has been skipped
WAI JPEG-AI whole decode (pinned inputs, required) / does this change touch it (pull_request) Successful in 4s
WAI JPEG-AI whole decode (pinned inputs, required) / fetch pinned JPEG-AI inputs → whole decode + pixel hash, required (pull_request) Has been skipped
repository checks / lockfiles, tests in CI, workflow hygiene, spec and section references, public text (pull_request) Successful in 35s
WAI neural sink gates / does this change touch it (pull_request) Successful in 4s
WAI neural sink gates / model-free refusals of the neural sink (pull_request) Has been skipped
wai-ops-gpu integer operators on GPUs / does this change touch it (pull_request) Successful in 4s
wai-ops-gpu integer operators on GPUs / builds · no adapter is not a pass (linux) (pull_request) Has been skipped
wai-ops-gpu integer operators on GPUs / Metal GPU and browser WebGPU (macos) (pull_request) Has been skipped
wai-ops integer operators / does this change touch it (pull_request) Successful in 6s
wai-ops integer operators / linux-aarch64 (pull_request) Has been skipped
wai-ops integer operators / linux-x86_64 (pull_request) Has been skipped
wai-ops integer operators / macos-arm64 (pull_request) Has been skipped
wai-ops integer operators / wasm32-wasip2 (wasmtime) (pull_request) Has been skipped
wai-ops integer operators / wasm32 under Node (pull_request) Has been skipped
wai-ops integer operators / independent checker (Python) (pull_request) Has been skipped
wai-pack / wai-pack · does this change touch it (pull_request) Successful in 4s
wai-pack / wai-pack · linux (pull_request) Has been skipped
wai-pack / wai-pack · linux-arm64 (pull_request) Has been skipped
wai-pack / wai-pack · macos (pull_request) Has been skipped
wai-quantum studio and desktop / does this change touch it (pull_request) Successful in 4s
wai-pack / wai-pack · independent verifier (Python) (pull_request) Has been skipped
wai-pack / wai-pack · the floor through a media prober (pull_request) Has been skipped
wai-quantum studio and desktop / studio · browser (pull_request) Has been skipped
wai-pack / wai-pack · dependency licences (pull_request) Has been skipped
wai-quantum studio and desktop / desktop app · macos (pull_request) Has been skipped
wai-quantum WebGPU member / does this change touch it (pull_request) Successful in 5s
wai-quantum WebGPU member / shader checks · browser build · wasip2 inertness · MSRV (pull_request) Has been skipped
wai-quantum WebGPU member / member · software Vulkan (linux) (pull_request) Has been skipped
wai-quantum WebGPU member / member · Metal (macos) (pull_request) Has been skipped
wai-quantum WebGPU member / member · discrete GPU, Vulkan (jetson-hub) (pull_request) Has been skipped
WAI mbt2018_mean integer decode (regenerated vectors) / does this change touch it (pull_request) Successful in 4s
wai-quantum WebGPU member / member · integrated GPU, Vulkan (framework-128gb) (pull_request) Has been skipped
wai-quantum WebGPU member / member · browser WebGPU (macos) (pull_request) Has been skipped
WAI mbt2018_mean integer decode (regenerated vectors) / regenerate mbt2018_mean integer vectors → Rust decode, required (pull_request) Has been skipped
wai-web wasm32 / does this change touch it (pull_request) Successful in 4s
wai-web wasm32 / wai-web wasm32 build · corpus, menu and writers (pull_request) Has been skipped
standards workspaces build + test / jcp-rs (jcp-conformance, jcp/jcp-rs, -p jcp-energy --features nvml, jcp-rs, linux) (pull_request) Successful in 1m47s
standards workspaces build + test / joule-ui-rs (joule-ui/joule-ui-rs, joule-ui-rs, linux) (pull_request) Successful in 1m11s
standards workspaces build + test / joulehook-rs (joulehook/joulehook-rs, joulehook-rs, linux) (pull_request) Successful in 1m14s
standards workspaces build + test / sandbox-rs (sandbox-conformance, sandbox/sandbox-rs, sandbox-rs, linux) (pull_request) Successful in 2m33s
standards workspaces build + test / jouleclaw-rs (-nodebug, jouleclaw/jouleclaw-rs, -p jouleclaw-energy --features rapl,nvml, jouleclaw-rs, linux-arm64, -C target-feature=+fp16) (pull_request) Successful in 2m22s
standards workspaces build + test / mesh-rs (mesh/mesh-rs, -p mesh-engine-gguf -p mesh-openai --features mesh-engine-gguf/gguf,mesh-openai/server, mesh-rs, linux-arm64) (pull_request) Successful in 1m2s
standards workspaces build + test / joule-code-rs (joule-code/joule-code-rs, joule-code-rs, linux-arm64, true) (pull_request) Successful in 3m16s
standards workspaces build + test / macOS energy backends (pull_request) Successful in 7m34s
standards workspaces build + test / jouledesk-rs (jouledesk/jouledesk-rs, jouledesk-rs, macos) (pull_request) Successful in 2m48s
jcp: WithinWindow, a sliding-window caveat over calls, payloads and measured joules
A grant's budget bounded its whole life and not its rate: a day's budget
could go in a minute. jcp-runtime budgets were cumulative only.

jcp-schema:
- Caveat::WithinWindow(Window { secs, limit }), where limit is
  WindowLimit::{MaxUj, MaxCalls, MaxDistinctPayloads}.
- DenyReason::WindowExceeded ("window-exceeded").
- holds() refuses only a zero-second window. Like FlowBelow, a window is
  decided by a runtime gate against state, not from the frame.

jcp-runtime (SPEC §4.12):
- Per grant carrying a window, a history of admissions (time, payload) and
  debits (time, µJ), pruned to the grant's longest window.
- A call counts once admitted: allowed in a one-shot decide, or authorised
  in the two-phase path. A denied call counts for nothing and is debited
  nothing. Every path gates and records: decide, decide_priced,
  decide_flow, authorize, authorize_flow, the chained paths and every
  charge. Every link of a chain is counted, so a parent's window bounds its
  delegates together.
- A joule window refuses a one-shot call whose cost would overfill it. In
  the two-phase path it admits while any of the window is left and binds at
  the debit: an overrun is denied window-exceeded and stays debited, as
  MaxCostUj does.
- A debit that arrives without its time (charge, charge_chained) is placed
  at the grant's latest admission, never earlier than its own call's, so
  its joules stay in a window at least as long as they should. A debit with
  no admission at all stays in every window. No caller signature changed.
- restore(), a timeless spend ledger, leaves every window counted as full
  until resume_windows_at(t) names when history is complete and a whole
  window has passed since. An unknown history is not an empty one.
- authorize_chained_for(…, need_uj) takes a caller's ceiling into the
  budget test, so a call refused for its ceiling is refused before it is
  admitted.

mesh-core: authorise with the request's joule ceiling via
authorize_chained_for, replacing the after-the-fact BudgetTooLow check.
A serve refused for its ceiling therefore fills no window. The errors and
their figures are unchanged.

jcp-bridge: a window caveat is unprojectable into an OAuth token.

Durability: jcp-wire and mesh-core replay each decision through the gate at
its recorded time, so windows rebuild across a restart (tests in both). The
gateway resumes from receipts, which carry no time, so its windows stay
full after a resume (its clock is also fixed at 0, a separate gap).

SPEC:
- §4.12: semantics, durability, sharding (n points admit n × the limit
  unless they share history).
- The §4.9 wire form.
- Conformance class C27, with a C27 check in jcp-conformance.

Also: two pre-existing clippy errors (cloned_ref_to_slice_refs) in
jcp-runtime's tests, so the crates touched are clippy-clean.

Tests: 10 in jcp-runtime, 1 in jcp-wire, 1 in mesh-core, plus the bridge
case and C27. Mutation testing: 30 mutants, all killed. They cover every
limit's boundary, the slide, debit placement (latest, not first; MAX, not
0, without an admission), the restore gap, pruning, the ceiling-before-
admission test, and each path's gate and recording.

Verified on the build host:
- jcp-rs: 575 tests, 119 behind features, every conformance class.
- mesh-rs: 95 tests.
- Clippy -D warnings clean on jcp-schema, -runtime, -bridge, -wire,
  -conformance and mesh-core.
- sandbox-rs, joule-code-rs, jouledesk-rs, joulehook-rs and joule-ui-rs
  compile with --all-targets.
- Repo checks pass.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-21 07:30:20 -04:00
..
conformance/v1 mesh/1 + AR-1: receipts commit to the output; deterministic serves replay 2026-10-21 04:35:32 -04:00
mesh-rs jcp: WithinWindow, a sliding-window caveat over calls, payloads and measured joules 2026-10-21 07:30:20 -04:00
tools/joules-per-decision mesh: withdraw the GPU per-decision figure — another process held 99.5% of the GPU 2026-10-05 07:20:58 -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 mesh: a grant is spent only by its issuer, at the steward it names, and its spend survives a restart 2026-10-17 17:13:42 -04:00
SPEC.md mesh/1: a signed weights change record, and a gate that holds a backend to it 2026-10-21 05:18:58 -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 ──▶ route (cheapest-sufficient) ──▶ authorise (JCP grant)
                                                     │
                                                     ▼
                     meter + debit ◀── serve (engine) ──▶ tokens
                                                     │
                                                     ▼
                         sealed JCR-1 receipt: µJ / accepted token

Four roles — caller, router, engine, steward — and four phases per serve: route, authorise, meter, seal. The grant is decided by JCP's own runtime before any work runs, so its expiry, caveats and remaining budget bind here as at any JCP enforcement point, and the metered joules are debited against it afterwards. A grant is spent only by its issuer, who signs each presentation for one request, and only at the steward it was issued to; each decision is journalled before the work, so a restart gives no budget back. 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, and ProcessMeter: this process's own CPU and GPU energy for an engine that runs in process, measured when a span covers the whole request
mesh-receipt the mesh/1 receipt, JCR-1 sealing (det-CBOR + COSE_Sign1), and a hash-chained log
mesh-core the orchestration that ties route → authorise → 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, where
# the counter is live; a counter that is not live falls back to the estimator)
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.