open-standards/joulehook/joulehook-rs/crates/joulehook-meter/src
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Transaction Science 94597bc668
All checks were successful
standards workspaces build + test / which workspaces this change touches (pull_request) Successful in 29s
repository checks / lockfiles, tests in CI, workflow hygiene, spec and section references, public text (pull_request) Successful in 3m3s
standards workspaces build + test / jcp-rs (jcp-conformance, jcp/jcp-rs, -p jcp-energy --features nvml, jcp-rs, linux) (pull_request) Successful in 2m46s
standards workspaces build + test / joule-ui-rs (joule-ui/joule-ui-rs, joule-ui-rs, linux) (pull_request) Successful in 1m17s
standards workspaces build + test / joulehook-rs (joulehook/joulehook-rs, joulehook-rs, linux) (pull_request) Successful in 1m35s
standards workspaces build + test / proof-rs (proof-conformance, proof/proof-rs, proof-rs, linux, true) (pull_request) Successful in 1m39s
standards workspaces build + test / sandbox-rs (sandbox-conformance, sandbox/sandbox-rs, sandbox-rs, linux) (pull_request) Successful in 2m51s
standards workspaces build + test / macOS energy backends (pull_request) Successful in 9m1s
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 6m29s
standards workspaces build + test / joule-code-rs (joule-code/joule-code-rs, joule-code-rs, linux-arm64, true) (pull_request) Successful in 2m39s
standards workspaces build + test / joulecontract-rs (joulecontract/joulecontract-rs, joulecontract-rs, linux-arm64, true) (pull_request) Successful in 1m33s
standards workspaces build + test / jouledesk-rs (jouledesk/jouledesk-rs, jouledesk-rs, macos) (pull_request) Successful in 2m3s
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 1m26s
jcp-efficiency: carry the Option through its cross-workspace consumers
CI caught what the previous commit's verification could not: `jcp-efficiency`
is a **path dependency of three other workspaces**, and
`cargo test --workspace` inside `jcp/jcp-rs` never compiles them. The
jouledesk-rs, sandbox-rs and joulehook-rs legs all failed to build.

The consumers are:

    jouledesk/.../jouledesk/Cargo.toml
    jouledesk/.../jouledesk-livekit/Cargo.toml
    jouledesk/.../jouledesk-github/Cargo.toml
    sandbox/.../sandbox-tee/Cargo.toml
    joulehook/.../joulehook-meter/Cargo.toml

Five call sites read a figure that is now an `Option`:

- `jouledesk/src/lib.rs` — the assertion that waste inflates
  joules-per-completed-unit. Two units completed there, so the ratio is
  defined; `.expect` now records that rather than hiding it.
- `jouledesk/examples/channel.rs`, `examples/room.rs` and
  `sandbox-tee/examples/attested_efficiency.rs` — `println!` of the figure.
  Each prints "—" when undefined, for the same reason `session.rs` does:
  0 is the optimum of a cost-per-result figure, so printing it would name
  the cheapest possible cost for work that delivered none.
- `joulehook-meter` — `assert_eq!` on a receipt field; 900 tokens were
  accepted, so the figure is present and the assertion takes `Some`.

`Efficiency`'s own fields did not change, so the `Efficiency { .. }`
literals in all four consumers are untouched; only reads of
`EfficiencyReceipt::uj_per_accepted_token` and `Totals::uj_per_completed_unit`
needed work.

Verified by building and testing **each** of the four workspaces that
compile this crate — jcp-rs, jouledesk-rs, sandbox-rs, joulehook-rs — rather
than only the one holding the edit: `cargo check --workspace --all-targets`
and `cargo test --workspace` exit 0 in all four, with 0 failed suites.

Co-Authored-By: Claude Opus 5 <[email protected]>
2026-10-17 09:29:59 -04:00
..
lib.rs jcp-efficiency: carry the Option through its cross-workspace consumers 2026-10-17 09:29:59 -04:00
main.rs joulehook: the deployable meter — joulehook-proxy (OpenAI-shaped base_url proxy) 2026-07-04 20:38:32 -04:00