open-standards/jouleclaw/jouleclaw-rs/crates/jouleclaw-jcr1/conformance/coding-window-vectors.json
Transaction Science d8b576355a jouleclaw: wave-50 — streaming coding ops (jouleclaw-stream × joule-code)
The missing integration between wave-47's streaming substrate and
Joule-Code's coding-op cargo. Cursor / Copilot / Codex / Claude Code
stream typed-char + suggestion-appeared/accepted/rejected + cursor +
diagnostic events continuously, but no public standard types them up
so the cascade can gate per window and accepted suggestions can
materialize into a content-addressed coding-op cargo the federation
layer accepts.

This wave closes the gap end-to-end.

1. jouleclaw-coding-stream (new crate) — typed streaming primitives.
   - CodingEvent { TypedChar | SuggestionAppeared | SuggestionAccepted
     | SuggestionRejected | CursorMoved | DiagnosticDelta } —
     distilled from production coding-agent event surfaces.
   - CODING_STREAM_MIME = "application/x.jouleclaw-coding-event+json"
     so coding events ride in jouleclaw-stream::Tick bytes WITHOUT
     extending the tick schema. wave-47's conformance vectors stay
     valid.
   - CodingWindow::from_window extracts coding events from a
     jouleclaw-stream::StreamWindow, skipping ticks that aren't
     coding events (the stream often carries other channels).
   - CodingOpMaterializer accumulates SuggestionAccepted across
     windows, refuses overlapping edits (joule-code spec forbids
     them), sorts by (path, start) — joule-code canonical
     ordering — and emits a typed MaterializedCodingOp matching
     joule-code-cargo's wire shape (alg, prior, edits, author,
     intent, tier) plus a content-addressed `b3:...` op_id over
     deterministic JSON.
   - 11 tests.

2. jouleclaw-jcr1 — coding-window/1 schema.
   - CodingWindowReceipt { jc_receipt, id, closed_at, steward,
     stream_id, window_id, activity: CodingActivitySummary,
     materialized_op_id, author_pubkey_hex }. Activity summary
     carries typed_bytes + suggestions_{appeared, accepted,
     rejected} + cursor_moves + diagnostic_delta_net.
     materialized_op_id is empty for windows where the
     materializer didn't seal; non-empty windows correlate with
     a real joule-code cargo of the same id.
   - Pairs with wave-47's stream-window/1 by sharing stream_id +
     window_id. Downstream consumers correlate the two by those
     fields to reconstruct the full coding session at the stream
     level and the coding-op level simultaneously.
   - 2 conformance vectors (typed-only window; op-materialized
     window) with embedded byte-equal receipt_hash.
   - 3 coding_window tests on top of the existing jcr1 surface.

3. Demo binary — examples/wave50_coding_stream.rs in
   jouleclaw-stack. Five-window typed-coding session: user types
   "fn ad" → "d()" → suggestion appears → rejected → second
   suggestion appears → accepted → diagnostics clear → END.
   Materializer seals at w04 with a content-addressed op_id;
   each window mints a coding-window/1 receipt; the seal window's
   receipt carries the op_id, correlating it to the joule-code
   cargo the federation layer would accept.

Composition across waves 41-50:

  Triangle (41-45) — conservation + cone + oracle + elicitor + Datum
  Skill-compilation (e6741a1) — AgentTier hook
  Wave-46 — context-store + fuzz oracle + cone-gated inject +
            verified-code/1
  Wave-47 — streaming substrate (stream + stream-oracle +
            stream-window/1)
  Wave-48 — UI ladder (ui-output + ui-oracle + ui-output/1)
  Wave-49 — cross-standards binding (CrossStandardBinding +
            invariant verifier + cross-binding/1)
  Wave-50 — streaming coding ops (coding-stream + coding-window/1)

The triangle stays the type system; the streaming substrate stays
the per-window dispatch shape; this wave adds the coding-op cargo
materialization layer on top of both without modifying either.
A real coding agent now has: typed events on the wire, gated
per-window verification, accepted-suggestion accumulation across
windows, content-addressed op materialization matching joule-code's
spec, and a JCR-1 receipt correlating everything.

Workspace check clean.

Co-Authored-By: Claude Opus 4.7 <[email protected]>
2026-06-05 05:27:09 -04:00

53 lines
2.3 KiB
JSON

{
"spec": "JCR-1 coding-window v1",
"schema_id": "coding-window/1",
"canonical_encoding": "JSON with sorted object keys (recursively); UTF-8; no whitespace; no float coercion. receipt_hash is BLAKE3 hex of the canonical bytes.",
"note": "Two vectors covering the two load-bearing states a coding-stream window can land in: typed-only (no suggestion materialized) and op-materialized (window closed with a Joule-Code op_id sealed). The materialized op_id correlates with a real `joule-code` coding-op cargo in any downstream system; the stream_id + window_id correlate with the wave-47 stream-window/1 receipt the streaming substrate minted for the same window.",
"vector_count": 2,
"vectors": [
{
"n": 1,
"description": "Typed-only — user typed 12 bytes, no suggestions, no op materialized this window.",
"receipt_hash": "0db0cd50b35a91c6b5f0069cc419f1df4d694f7c56ad88670680a2136ba142d5",
"receipt": {
"jc_receipt": "coding-window/1",
"id": "stream-demo:cw:0001",
"closed_at": "2026-06-05T00:00:00Z",
"steward": "did:keri:EJ9testStewardAID000000000000000",
"stream_id": "stream-demo",
"window_id": 1,
"activity": {
"typed_bytes": 12,
"suggestions_appeared": 0,
"suggestions_accepted": 0,
"suggestions_rejected": 0,
"cursor_moves": 3,
"diagnostic_delta_net": 0
}
}
},
{
"n": 2,
"description": "Op-materialized — suggestion appeared + accepted; op_id sealed, diagnostics dropped by 2.",
"receipt_hash": "1c799e883eb9510cb6630b1a8e7066d68360cb162e87e080334ee0ebe79e95f1",
"receipt": {
"jc_receipt": "coding-window/1",
"id": "stream-demo:cw:0007",
"closed_at": "2026-06-05T00:00:01Z",
"steward": "did:keri:EJ9testStewardAID000000000000000",
"stream_id": "stream-demo",
"window_id": 7,
"activity": {
"typed_bytes": 0,
"suggestions_appeared": 1,
"suggestions_accepted": 1,
"suggestions_rejected": 0,
"cursor_moves": 1,
"diagnostic_delta_net": -2
},
"materialized_op_id": "b3:6Ysltc7O3IupNKFXybnzyv2ot32SSLLvCQRB8AHKIdQ",
"author_pubkey_hex": "d75a980182b10ab7d54bfed3c964073a0ee172f3daa62325af021a68f707511a"
}
}
]
}