open-standards/joule-ui
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Transaction Science 289d584b02
All checks were successful
standards workspaces build + test / which workspaces this change touches (pull_request) Successful in 15s
repository checks / lockfiles, tests in CI, workflow hygiene, spec and section references, public text (pull_request) Successful in 1m24s
joule-code conformance gate / Build + round-trip C1-C4 vectors (pull_request) Successful in 2m3s
jouleclaw public surface must stay documented / Public-surface audit (jouleclaw-rs) (pull_request) Successful in 58s
standards workspaces build + test / joule-code-rs (joule-code/joule-code-rs, joule-code-rs, linux-arm64, true) (pull_request) Successful in 10m11s
standards workspaces build + test / jcp-rs (jcp-conformance, jcp/jcp-rs, -p jcp-energy --features nvml, jcp-rs, linux) (pull_request) Successful in 1m52s
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 / joulecontract-rs (joulecontract/joulecontract-rs, joulecontract-rs, linux-arm64, true) (pull_request) Successful in 4m31s
standards workspaces build + test / joulehook-rs (joulehook/joulehook-rs, joulehook-rs, linux) (pull_request) Successful in 1m14s
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 17m16s
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 1m45s
standards workspaces build + test / proof-rs (proof-conformance, proof/proof-rs, proof-rs, linux, true) (pull_request) Successful in 1m37s
standards workspaces build + test / sandbox-rs (sandbox-conformance, sandbox/sandbox-rs, sandbox-rs, linux) (pull_request) Successful in 2m28s
standards workspaces build + test / macOS energy backends (pull_request) Successful in 7m41s
standards workspaces build + test / jouledesk-rs (jouledesk/jouledesk-rs, jouledesk-rs, macos) (pull_request) Successful in 1m54s
jcp: a ModelIn caveat says which model a grant authorizes, and the frame names the model it runs
A grant's capability names one resource by content address. When that
resource is an inference endpoint, the model it runs was chosen inside the
payload, and the decision point sees only the payload's hash. So a grant
could authorize "this endpoint" but never "this endpoint, running these
models". Only PayloadIs came close, and it makes the grant single-use. JCP
enforced a model's integrity (refuse wrong bytes) but not authorization
over which model runs.

- `Frame.model: Option<ContentId>` is the content address of the model the
  action runs. The dispatching runtime fills it, since it knows what it will
  load. It is omitted from the encoding when absent, so frames and every
  receipt and vector over them keep their bytes.
- `Caveat::ModelIn(Vec<ContentId>)` requires the frame to name one of these
  models. It fails closed: a frame naming no model is denied
  `caveat-unsatisfied`, so a dispatcher that does not say what it will run
  cannot exercise the grant. A delegate narrows the set by adding a smaller
  ModelIn beside the inherited one; both must hold, so the intersection
  governs. This is authorization by content address, not a registry
  (SPEC §12).
- SPEC §4.9 and §6 describe both, and C24's conformance check now covers
  ModelIn.
- Every Frame literal in the repository gains `model: None`. That is 28
  sites across jcp-rs, joule-code-rs, joule-ui-rs, jouleclaw-rs and
  sandbox-rs.

Checked on the build host:
- jcp-rs: 496 tests pass, and the conformance suite passes all checks,
  including C24 with ModelIn.
- Every vector gen-vectors writes is byte-identical to the published one.
- All eight workspaces that depend on jcp-schema pass `cargo check
  --all-targets`. The consumers jouleclaw-jcp, joule-code-jcp, sandbox-jcp
  and joule-ui pass their tests.
- Mutations: letting a frame with no model pass, and encoding an absent
  model, each fail tests.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-17 04:21:21 -04:00
..
conformance joule-ui: a meter is an estimator until it opts in, and a charge carries its grade 2026-09-30 20:10:14 -04:00
joule-ui-rs jcp: a ModelIn caveat says which model a grant authorizes, and the frame names the model it runs 2026-10-17 04:21:21 -04:00
LICENSE joule-ui: typed declarative protocol for agent-emitted user interfaces 2026-05-30 09:43:56 -04:00
README.md licences: ship the Apache-2.0 text the code already declares 2026-10-09 17:22:32 -04:00
SPEC.md joule-ui: served and example interactions are metered by this process's own CPU energy 2026-09-30 23:01:05 -04:00

joule-ui

A typed declarative protocol for agent-emitted user interfaces.

joule-ui is the sibling to JouleClaw for the moment when an agent's resolution has to become something a human can see and interact with. The agent emits a widget tree — (name, props, children), recursively — against a widget registry the host has published. The host renders. No React in the spec, no HTML over the wire, no agent holding the renderer.

The shape the field has converged on for this is declarative components against a registry: agents are far more reliable emitting structured data than emitting code, and renderers are far easier to harden when they own their own widgets. joule-ui pins that shape as a protocol; the renderer is product surface, owned by the consumer.

What ships in v1

  • joule-ui-rs/crates/joule-ui-core/ — the protocol types (Widget, PropValue, WidgetSchema, Registry) and the recursive validator. Pure Rust, no IO, JSON-serialisable.

  • joule-ui-rs/crates/joule-ui-interaction/ (v0.2) — the layer no other UI protocol carries: when a human or an agent fires an Action, the invocation is an accountable event. Every fire names the principal that made it — a did:key, the same whether a person or an agent (the protocol draws no distinction; both are traced). run_interaction authorizes it against a capability before it runs (a denied action's handler never executes), meters it in joules, charges its cost (a reading or an estimate, and which), and an InteractionLog seals it as the next link of a hash-chained receipt. The actor is bound into the signed core, so an interaction cannot be re-attributed without breaking the chain. A joule-ui session becomes a tamper-evident ledger of who fired it, what it computed, and what it cost — verifiable by anyone holding the host's key. The metering (Sandbox PowerMeter) and the capability (JCP grant) are recognized edges; the receipt, the chain, and the lifecycle are joule-ui's. See SPEC.md §5–§7 and examples/metered_surface.rs for the full loop.

The surface layer makes joule-ui a peer of the declarative-UI protocols (A2UI, MCP Apps). The interaction layer makes it the only one you can hand to an auditor: a UI whose every interaction is energy-accounted and sealed, by construction.

What is not here:

  • A renderer. The renderer is owned by the host (browser app, native shell, terminal UI). joule-ui validates the surface and seals the interaction; it does not paint pixels.
  • A transport. The validated spec and the interaction stream ride MCP, REST, SSE, gRPC, Web MoQ — any bytes-out protocol. Transport-agnostic.
  • A "model emits React" path. The agent emits a declarative tree against the registry; arbitrary code emission is out of scope.

Why a sibling, not inside JouleClaw

The spec layer is protocol — small, stable, conformant. The renderer registry is product surface — many of them, evolving fast. Splitting them protects the tools for use line: JouleClaw stays the runtime substrate; joule-ui is the UI protocol; consumers ship their own widgets.

Licence

Specification text and protocol document: CC-BY-4.0 (see LICENSE). Reference implementation in joule-ui-rs/: Apache-2.0 (see joule-ui-rs/LICENSE).