open-standards/joule-code
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Transaction Science 760ceca981
All checks were successful
joule-moq-remote host agent / joule-moq-remote · does this change touch it (push) Successful in 43s
joule-moq-room room service / joule-moq-room · does this change touch it (push) Successful in 35s
WAI breaking changes and the conformance runner / WAI breaking · does this change touch WAI (push) Successful in 30s
joule-moq-web browser client / joule-moq-web · does this change touch it (push) Successful in 42s
wai-app and Create / wai-app · does this change touch it (push) Successful in 27s
joule-code conformance gate / joule-moq-relay, its own energy on a counter (macos) (push) Successful in 1m29s
wai-fleet service / does this change touch it (push) Successful in 25s
WAI Studio / does this change touch it (push) Successful in 1m4s
wai-app and Create / wai-app · tests, clippy, the line language's verifier (linux) (push) Successful in 40s
WAI breaking changes and the conformance runner / WAI breaking · wire, record and API against main · linux (push) Successful in 58s
joule-moq-remote host agent / joule-moq-remote, every target (macos) (push) Successful in 1m2s
joule-code conformance gate / Build + round-trip C1-C4 vectors (push) Successful in 2m42s
wai-fleet service / service · macos (push) Successful in 1m6s
WAI Studio / the catalogue's actions, the unit tests and the core · linux (push) Successful in 1m18s
wai-fleet service / service · linux (push) Successful in 2m42s
joule-code conformance gate / joule-moq-ingest, every target (push) Successful in 7m7s
WAI breaking changes and the conformance runner / WAI breaking and conform · their tests, and the independent verifiers through wai conform · linux (push) Successful in 5m10s
wai-app and Create / wai-app · Create, browser end-to-end (macos) (push) Successful in 6m34s
repository checks / lockfiles, advisories, tests in CI, workflow hygiene, spec and section references, public text (push) Successful in 8m7s
joule-moq-room room service / joule-moq-room, every target (push) Successful in 8m23s
WAI Studio / Studio in Chromium and Firefox · macos (push) Successful in 8m12s
joule-code conformance gate / joule-moq-relay, every target (push) Successful in 14m5s
joule-moq-remote host agent / joule-moq-remote, every target (linux-arm64) (push) Successful in 12m47s
WAI Studio / Studio in WebKit · linux (push) Successful in 13m27s
joule-moq-web browser client / joule-moq-web · browser end-to-end (macos) (push) Successful in 18m37s
wai release binaries build on Windows / the seven release binaries · windows (push) Successful in 19m16s
joule-moq-relay closes a window at one cut across relays, hands over its counts by session bound to its record, and drains its summaries
Three gaps that kept waiTransport's relay in its own process with its meter
off, and its edges ending each window with a GOAWAY (waiTransport
docs/wai-additions.md §20, found against b85bba936):

One cut across relays (WAI live-metering §3.8, §3.10). A window ends, track
by track, at a cut: the first group of the window after it. A flush fixes
the relay's own cut, the group after the largest that began there before its
instant, so a relay alone counts as before. Relays that carry a room close at
one cut: `close` on each answers its own cut, the operator joins them track
by track to the greatest (window::Cut::join), and `seal` with the join seals
each (Relay::seal_at, seal_after), a cut below a relay's own refused,
cut_too_early, nothing sealed. A group first seen while a closed window waits
for its cut is counted under a provisional window (summary::Clock), placed at
the seal with every count of it, open and ended sessions alike, so a
session's windows still sum to its summary. The greatest is chosen because
each relay's own cut is above every group it began before its instant: no
relay has counted a group at or above the join in the window it closes, and
any order of the closes works. A cut stated by one end alone races the
group in flight to the other. The links' records then chain window by
window, and an edge rides through a window end with no GOAWAY.

A window's counts by session. `window` (Relay::window_statement) answers a
sealed window's parts, its cut and its DVR writes, signed with the relay's
summary key (joule-moq-relay/window/1), optionally of one room.
SignedWindow::check_record recomputes a room's record over the window from
the parts (metering::counts_over, split from hop_record_over) and refuses
parts that do not give the record signed (parts_mismatch): the counts are
bound to the record by the record itself. window::link_chain holds two
relays' statements of their link to each other, by the sessions whose peer
is the other relay.

Summaries drained (src/outbox.rs). Each ended session's signed summary is
held, numbered, until the operator acknowledges it (`summaries`, `ack`);
an acknowledgement past what was handed out frees nothing. At most
summary.held_max (65536) in memory; past it they go to summary.spill_path,
synced, read back in order, the acknowledged offset recorded beside the
file so a restart hands over what was not acknowledged and nothing twice.
With no spill file, or a write that fails, the summary is held anyway and
new sessions are refused (summaries_unacknowledged) until enough is
acknowledged. Refusing new windows was not chosen: it bounds nothing, as
ending sessions still add summaries, and it stalls the billing of the
sessions open.

tests/window_cuts.rs holds each against planted faults (11, each caught):
parts raised or left out and signed by the relay's key, changed after
signing, or of another window, refused; a core and two edges whose edges
close before a group begins and the core after, sealed at the join, chain
exactly over their links in two windows, while an edge sealed at its own
cut is caught short then over, and a cut below the core's own refused; an
edge's viewer sent no GOAWAY across two window ends, and a restarted edge's
GOAWAY caught by the same check; past the bound every summary held and a
SETUP refused, an acknowledgement of what was not handed out refused, an
acknowledged summary freed, and the spill read back across a restart.
Falsified: each fix reverted in turn (an instant cut, no early-cut check,
parts not recomputed, an ack of what was not handed out, a summary dropped
past the bound, no refusal, the acknowledged offset ignored), and the test
that holds it fails.

live-metering §3.8 defines the cut and the one cut across hops, §3.10 adds
that records in parts chain across their cuts, §8 says what the reference
does. Breaking for the relay crate, not a WAI library (wai/changes entry):
a relay past 65536 unacknowledged summaries with no spill file refuses new
sessions; Relay::summaries is those not acknowledged; relay::Window has a
cut; Track::window_of takes the clock; a group arriving below a flush's cut
after it counts in the window the flush closed.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-10 10:31:57 -05:00
..
conformance joule-code: SPEC §5.1 grant-gated consultation + conformance class C5 2026-06-10 11:18:59 -04:00
examples The retired communicationOS name leaves the repository 2026-11-07 02:39:44 -05:00
joule-code-rs joule-moq-relay closes a window at one cut across relays, hands over its counts by session bound to its record, and drains its summaries 2026-11-10 10:31:57 -05:00
spec Every text that states the IOReport liveness rule states it as the meters apply it 2026-11-07 08:20:02 -05:00
vocab The retired communicationOS name leaves the repository 2026-11-07 02:39:44 -05:00
CHANGELOG.md joule-moq-relay closes a window at one cut across relays, hands over its counts by session bound to its record, and drains its summaries 2026-11-10 10:31:57 -05:00
CONTRIBUTING.md joule-code: stand up the Joule Code standard (v0.1.0 draft) 2026-06-02 14:07:00 -04:00
LICENSE joule-code: stand up the Joule Code standard (v0.1.0 draft) 2026-06-02 14:07:00 -04:00
LICENSE-SPEC joule-code: stand up the Joule Code standard (v0.1.0 draft) 2026-06-02 14:07:00 -04:00
README.md The retired communicationOS name leaves the repository 2026-11-07 02:39:44 -05:00
ROADMAP.md The retired communicationOS name leaves the repository 2026-11-07 02:39:44 -05:00
SPEC.md The retired communicationOS name leaves the repository 2026-11-07 02:39:44 -05:00

Joule Code

A carrier for coding work. Federated, energy-attributed, owned by no one.

Joule Code is the coding cargo class of the Transaction Science substrate. Where Smart Byte carries value, EOC carries compute, and WAI carries signal, Joule Code carries agentic coding operations — an edit, a refactor, a generated function, a review — as a content-addressed, signed transition with its energy cost intrinsic.

A coding operation is not a chat turn and not an opaque API call. It is a vesicle carrying exactly five things: identity (the blake3 content address of its canonical serialization), provenance (the prior tree state it builds on, and the author key that authorized it), an ownership chain (signature-bound transitions, so a change cannot be replayed onto a different base), cargo (the change itself — an edit set against a tree), and a two-part joule cost (measured + estimated, with an honest provenance tag on every reading). Operations resolve through an explicit energy-tiered cascade — cache, then deterministic, then retrieval, then a local model, then a remote frontier agent as the last resort — and stop at the first tier that closes the request. Inference is the escape hatch, not the entry point.

The substrate is intentionally ownerless: no protocol-level token, permissive licensing on the spec text and reference code, and conformance test vectors so any implementer can verify canonicity without a trust relationship with the authors. A conforming Joule Code endpoint drives a vendor's own logged-in coding agent (the vendor CLI owns its token; the protocol never sees a credential), measures the energy of every operation, and emits a signed receipt — with no contact with any single company's servers as a condition of operation. Transaction Science is one steward: it publishes the spec, ships a reference implementation, and operates commercial services around the substrate — not its proprietor.

The doctrine

Capability per joule, not capability per token. The durable layer of a coding tool is not token resale or editor convenience — both are commoditized. It is the substrate, measured in joules per accepted change. "Make it work" and "don't waste energy" are the same optimization: thrash is simultaneously the bug and the energy leak.

Three consequences, normative in SPEC.md:

  1. The cascade. Every coding request dispatches through L0:Cache → L1:Lawful → L2:Embed → L3:Model → L4:Wire and stops at the first tier that closes it. The agent schema is JouleClaw; the remote frontier agents (Claude Code, Gemini, Codex, ...) are L4, reached over the Agent Client Protocol (ACP).
  2. The receipt. Every operation reports a two-part energy cost in microjoules — measured + estimated — with a Provenance tag (HwShunt | ModelBased | Estimator) on every reading, sealed as a JCR-1 envelope (canonical det-CBOR + COSE_Sign1/EdDSA — the family's shared signed-receipt format). The spec never claims an accuracy the platform cannot deliver.
  3. No capture. No protocol token. The credential to a frontier agent lives in the vendor's own CLI, never in the protocol. A conforming endpoint performs its core function without phoning home to any single company.

Contents

  • SPEC.md — the normative specification (RFC 2119). The coding-operation cargo, the cascade binding, the receipt schema, and the conformance contract.
  • spec/ — sub-specifications: the coding-operation cargo type, the cascade binding, the receipt format, and the federated collaboration binding.
  • vocab/ — the controlled vocabulary (LEXICON.md).
  • conformance/ — signed wire vectors. A standard is conformant if it round-trips these.
  • joule-code-rs/ — the Rust reference library: the protocol crates (schema, cargo, receipt, cascade, conformance), plus joule-code-jcp — the cascade as a JCP consumer: every stage consultation is decided by the JCP runtime against a metered Grant before the stage runs (the tier is the action, the source tree the content-addressed resource, the tier's energy class the debit), so the L4 escape hatch to a remote frontier agent exists only when a signed grant names it and can pay for it. Every consultation, allowed and denied, seals as a JCR-1 receipt. joule-code-joulecontract binds an operation to the sibling JouleContract standard: the edit set is the contract's frame (an out-of-frame edit is caught at the boundary and recorded, not suppressed), the tier cost is the ceiling, and JCR provenance maps downward-only onto the energy classes (Estimator can never serialize as Metered). joule-code-remediate is the reference verified-fix harness (joule-fix): it scans a Rust workspace, remediates at the cheapest sufficient tier (L1 lawful codemods first — deterministic, zero inference), and gates every fix behind a pipeline whose stages ARE the contract's obligations — baseline capture, build, no-new-test-failures, lint-delta, frame confinement, diff guard — each discharged with its actual outcome. A fix that fails any gate is reverted and never ships, and the refusal itself produces a receipt. The run's energy is measured by the sibling sandbox standard's hardware meter and sealed as a JCR-1 envelope that serves as the JouleContract receipt's meter attestation — one standard's receipt is the other's evidence — and the harness reports energy per verified fix from hardware counters, not estimates. A methodology layer makes spec-driven development auditable on top of the protocol: joule-code-spec is the signed, content-addressed Spec — intent plus individually addressable clauses (requirements, constraints, and first-class non-goals), with a signed Citation binding each operation to the clauses it implements and a deterministic coverage audit that names open obligations and flags any cited non-goal. joule-code-review makes two-stage review (spec-compliance, then quality) a signed artifact where separation of duties is a signature check: a review whose reviewer key equals the operation's author key is structurally void — self-review cannot stand, human or agent. joule-code-reviewer is the independent reviewer agent that produces those reviews — a distinct principal making a real, falsifiable judgment (it refuses to review its own work, and it can request changes), arranged as a cheapest-sufficient cascade: a learned tier (defect patterns a model has already taught it, applied model-free), a structural tier, and an optional semantic model tier behind a subprocess seam. The model's rejections compile into learned skills so a recurring defect is caught for nanojoules — the fix harness's amortization moat, applied to review — while approvals are never cached, because a stale approval is a silent-failure lane. joule-code-release is the total door: a release certifies only when all four gates — spec coverage, contract discharge, two-stage review, attested build — are present and satisfied, and otherwise refuses with the missing gate named. Two terminal states, no third. This is the lean library a third party implements against — not an editor.

Reference implementation and consumers

joule-code-rs/ is the protocol library. The flagship consumer is a hard fork of the Zed editor ("agent-zed"), which drives logged-in vendor coding agents over ACP, meters every turn, and surfaces the joule receipt in its UI — the SOTA editor surface for the standard. The protocol is what any party implements; the editor is one (high-quality) consumer, the way wai-rs implements the standard and joule-moq-room consumes it.

Status

v0.2.0 draft. Specification core published (cargo, cascade binding, receipt); reference library lands the schema, cargo, receipt, and cascade crates with a conformance harness. Receipts seal as JCR-1 envelopes (canonical det-CBOR + COSE_Sign1, EdDSA), the signed-receipt format shared across the family, so a Joule Code receipt verifies under existing JCR-1 tooling. The conformance vectors are real, cryptographically computed values (the harness passes the whole pack with no skips). The federated-collaboration binding is Research and is specified at the interface level only — single-endpoint operation is the current surface.

Readiness is classified per component (Solid / Engineering / Research / Theory) in SPEC.md §9 and respected when sequencing work.

  • JouleClaw — the energy-optimised AI runtime; Joule Code's agent schema. The cascade tiers and the receipt provenance discipline are JouleClaw's.
  • Smart Byte — the value carrier; a Joule Code operation is structurally a Smart Byte whose cargo is a code change. Identity, signing, and lockstep replication are shared.
  • EOC — the energy-optimised compute substrate; the cheap cascade tiers (cache / retrieval) follow EOC's resolution discipline.
  • WAI — the signal carrier; the federated-collaboration binding transports coding operations between collaborators over its group-state and media paths.

Licence

Reference code (everything under joule-code-rs/) is Apache-2.0 (LICENSE). Specification text (SPEC.md, spec/, vocab/) is CC-BY-4.0 (LICENSE-SPEC). The wire format and the right to fork are public.