open-standards/sense
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Transaction Science a8fda668d8
All checks were successful
standards workspaces build + test / jouleclaw-rs (push) Successful in 1m44s
standards workspaces build + test / aac-rs (push) Successful in 33s
standards workspaces build + test / joule-code-rs (push) Successful in 37s
standards workspaces build + test / joulecontract-rs (push) Successful in 28s
standards workspaces build + test / map-rs (push) Successful in 27s
standards workspaces build + test / mesh-rs (push) Successful in 23s
standards workspaces build + test / openpay (push) Successful in 1m18s
standards workspaces build + test / eoc-rs (push) Successful in 1m55s
standards workspaces build + test / jcp-rs (push) Successful in 1m17s
standards workspaces build + test / proof-rs (push) Successful in 1m12s
standards workspaces build + test / sandbox-rs (push) Successful in 2m7s
standards workspaces build + test / smart-byte-rs (push) Successful in 2m30s
standards workspaces build + test / arl-rs (push) Successful in 2m19s
standards workspaces build + test / joule-ui-rs (push) Successful in 2m28s
standards workspaces build + test / jouledesk-rs (push) Successful in 2m32s
standards workspaces build + test / joulehook-rs (push) Successful in 2m51s
standards workspaces build + test / sense-rs (push) Successful in 2m17s
sense: read the published conformance pack; C1 had no coverage at all
The generator's doc says "the vectors are exactly what the in-repo tests assert",
but the in-crate tests assert properties, not the published values, and coverage
across the five classes is uneven:

  - C1 -- c1_replay_is_deterministic is assert_eq!(f(), f()). The published replay
    digest is compared to nothing.
  - C2/C3 -- real relational checks (changing trust or source changes the id; the
    burst fires a highlight and something surfaces), but the published id,
    highlights and decisions are never checked.
  - C4/C5 -- these do pin their published values, by restating them.

So three of five classes could publish anything unnoticed. Measured, not assumed:
moving one event in the scripted stream (tick 40 -> 41) leaves all five in-crate
tests GREEN, while the new pack test fails on both the C1 digest and the drift
check.

tests/pack.rs holds every class to the file on disk: the generator still emits
both published files (run into a temp dir via CARGO_BIN_EXE so the pack is never
touched); the C1 replay digest and C2 event id recompute; the C3 highlights and
decisions match in full rather than "at least one surfaces"; C4 still answers
recall with no model call and escalates the open-ended query; and the C5 chain
verifies and breaks where the pack says.

The sealed envelope is verified from the pack and RFC 9052 alone -- its
COSE_Sign1 is parsed with a hand-written CBOR reader rather than assumed, so the
protected header is checked to really be {1:-8, 4:steward} before anything is
verified over it, then re-sealing the first link must reproduce the published
bytes. A flipped payload byte and a stranger's key are included as negatives.

One gap recorded rather than papered over: every published C3 decision is
`surface`. The README calls them "surface/hold decisions", but no vector
exercises the gate's hold path. The test asserts that as the current state, with
a message saying to replace it with a real surface/hold check once a hold vector
exists.

The pack is current -- regenerating matched both files byte for byte.

Co-Authored-By: Claude Opus 5 <[email protected]>
2026-09-21 14:01:13 -04:00
..
conformance/v1 sense: the ambient context standard (v0.1) 2026-06-13 21:39:39 -04:00
sense-rs sense: read the published conformance pack; C1 had no coverage at all 2026-09-21 14:01:13 -04:00
LICENSE sense: the ambient context standard (v0.1) 2026-06-13 21:39:39 -04:00
LICENSE-SPEC sense: the ambient context standard (v0.1) 2026-06-13 21:39:39 -04:00
README.md sense: the ambient context standard (v0.1) 2026-06-13 21:39:39 -04:00
SPEC.md sense: the ambient context standard (v0.1) 2026-06-13 21:39:39 -04:00

Sense

The ambient context standard — the always-on, deterministic, energy-accounted record of what is happening around an agent, and a principled account of when that is worth attention.

The tool protocols (MCP, A2A, ACP) standardized the efferent half of an agent: reaching out for tools, peers, payments. Sense standardizes the afferent half — the observations flowing in. It is the substrate an ambient or proactive agent needs but none of them specify: a feed of the world, deterministic enough to audit, with a governed decision about when to interrupt a human.

Where OpenTelemetry traces the agent's own reasoning — non-deterministic by its own admission, and about the agent's insides — Sense records the agent's outside, deterministically, with every datum provenance- and trust-tagged, and every interruption priced in joules and sealed in a receipt.

The four tiers

observe ─▶ project ─▶ detect ─▶ gate ─▶ seal ─▶ verify ─▶ answer
  │           │          │        │       │        │         │
 store     attention  attention attention receipt receipt  cascade
  • sense-schema — the wire types: the content-addressed [Event], the vendor-neutral SourceClass, the TrustLevel, the family Energy/Provenance model, the StateProjection, the Highlight. Pure, no IO.
  • sense-store — a content-addressed, HLC-ordered, replay-deterministic event log. Two runs over the same events yield a byte-identical digest.
  • sense-attention — the part no observability stack carries: a deterministic salience/novelty/uncertainty observer, a k-sigma highlight detector, and the attention budget that gates surfacing by value vs. interruption cost, priced in joules. "Perception ⊗ attention-budget", the afferent dual of JCP's "capability ⊗ joule-budget".
  • sense-cascade — the synthesis tier: a query envelope, deterministic recall retrieval, and a speculative cascade that answers factual-recall queries with zero LLM calls and escalates to a frontier model only as a last resort.
  • sense-receipt — a hash-chained, Ed25519-signed surfacing log: the tamper-evident record of what was surfaced (or held), when, and what it cost. Sealable as a JCR-1 COSE_Sign1 envelope for cross-family verification.

See SPEC.md for the normative standard and conformance/v1/ for the reproducible vector pack.

Try it

cd sense-rs
cargo run -p sense-cli --bin sense     # the whole loop on a scripted stream
cargo test --workspace                 # the conformance suite

The demo scripts an ambient stream (a quiet shell baseline, a burst of file changes, a low-trust log line), then for each surfaced moment prints the projection, the gate decision, and the joules it cost — then verifies the hash-chained surfacing log and answers a recall query with no model call.

What is not here

  • A daemon, sensors, or a UI. A host wires its platform's sensors to the SourceClass vocabulary and renders highlights however it likes. Sense fixes the datum, the determinism, the attention decision, and the receipt — not the plumbing.
  • A model. The salience observer and the synthesis fallback are recognized edges; the reference observer is deterministic and the reference fallback is a recorder. A host brings the model it trusts.
  • A transport or storage engine. The wire is serde/JCR-1; the order is the HLC. Ride it over anything; persist it in anything that preserves the order.

Licence

Specification text: CC-BY-4.0 (LICENSE-SPEC). Reference implementation in sense-rs/: Apache-2.0 (LICENSE).