open-standards/jouleclaw/jouleclaw-rs/crates/jouleclaw-jcr1/conformance/verified-code-vectors.json
Transaction Science 781c8d446f jouleclaw: wave-46 — ingest from today's SOTA research
Five concrete deliverables absorbing patterns from the day's research
(Hermes Desktop, turbovec, Axiom Math, Valkey/Madelyn Olson, Jerry Liu)
into the JouleClaw substrate. Each lands in an existing or new crate
without rearchitecting; all pure-Rust, no external runtime deps;
composable with the triangle just shipped.

1. jouleclaw-context-store (new crate) — typed deterministic recall.
   - TurnStore: SQLite + FTS5 over agent/CLI/chat turns. ~20ms per
     query at zero LLM cost. Microjoule-class recall as a first-class
     primitive between L0 cache and L2 embedding+retrieval.
   - FrozenSnapshot + StagedSnapshot: bounded byte-budget memory +
     user blocks. Mutations don't surface mid-session — they persist
     immediately but only the next session loads them. Rationale:
     keep the LLM prefix-cache warm. The byte block at the top of
     every prompt in a session is byte-identical, so providers can
     amortize attention over it.
   - 12 tests, all green. Ingested from Hermes Agent's documented
     memory pattern.

2. jouleclaw-oracle-fuzz (new crate) — adversarial Oracle backend.
   - FuzzOracle<P>: implements jouleclaw-oracle::Oracle over a
     caller-supplied deterministic FuzzProperty. Seeds ChaCha20 with
     (seed, round) to produce reproducible inputs; short-circuits on
     first counterexample with the structured FuzzFailure carried in
     FailReason::Custom.
   - Composes via CompositeOracle alongside type-checkers / linters /
     a future Lean Oracle.
   - 6 tests including determinism (same seed → byte-equal verdict)
     and composition. Ingested from the OSS-maintainer crash-harness
     pattern (Valkey CVE hunt).

3. jouleclaw-cone — cone-gated context injection.
   - cone_gated_inject helper + InjectDecision { Full | Skip } enum.
     Catalog (skills / tools / memory) is injected ONLY when the
     request's novelty crosses a configured threshold; below it, the
     agent uses cheap on-demand lookup tools instead of paying the
     unconditional prompt-token cost.
   - 4 new tests on top of the existing 23. Ingested from Hermes's
     own issue #4379 documenting catalog-injection token bloat.

4. jouleclaw-jcr1 — verified-code/1 receipt schema.
   - VerifiedCodeReceipt + ProgramRef + SpecRef + ProofRef
     { Lean | Fuzz | TestSuite } + VerifierRef + VerifiedCodeVerdict
     { Pass | Fail }. Canonical JSON with sorted keys; content-
     addressed via BLAKE3; ready for COSE_Sign1 over the canonical
     bytes via the existing v1 signing path.
   - 2 conformance vectors (Lean Pass + Fuzz Fail) with embedded
     content_hash that the Rust verifier asserts byte-equal at test
     time. Other-language verifiers MUST round-trip under canonical
     encoding and match the hash.
   - 5 verified_code tests. Ingested from the Axiom Math /
     "code-with-proof" pattern (Verina benchmark).

5. Demo binary — examples/wave46_recall_fuzz_verified.rs in
   jouleclaw-stack. Runs all five primitives end-to-end in one
   cargo run: seed FTS5 store, search, build + freeze snapshot, gate
   catalog injection by cone novelty, run fuzz Oracle over a property
   in two directions (pass + fail), mint a verified-code/1 receipt
   over the pass. Output is reproducible and self-checking.

The triangle is the type system; these five are concrete backends +
schemas + helpers that fill load-bearing slots the triangle types up
but leaves to consumers. None of them invalidate prior waves; each
sits beneath inference per doctrine.

Workspace check clean.

Co-Authored-By: Claude Opus 4.7 <[email protected]>
2026-06-05 03:56:59 -04:00

82 lines
3 KiB
JSON

{
"spec": "JCR-1 verified-code v1",
"schema_id": "verified-code/1",
"canonical_encoding": "JSON with sorted object keys (recursively); UTF-8; no whitespace; no float coercion. content_hash is BLAKE3 hex of the canonical bytes.",
"note": "Two vectors covering the two load-bearing proof modes: a Lean formal proof and an adversarial-fuzz counterexample. Implementers in any language MUST round-trip every receipt under canonical encoding and assert byte-equal content_hash against the embedded value.",
"vector_count": 2,
"vectors": [
{
"n": 1,
"description": "Lean Pass — formal proof of n + 0 = n, lean toolchain pinned.",
"content_hash": "06fd5cae83668d2eb4aaa589e87c03dffdba42b8a16a95dd7ed34bcfc457b67d",
"receipt": {
"jc_receipt": "verified-code/1",
"id": "vcr-lean-0001",
"closed_at": "2026-06-05T00:00:00Z",
"steward": "did:keri:EJ9testStewardAID000000000000000",
"program": {
"language": "lean",
"content_hash": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
"byte_length": 128
},
"spec": {
"content_hash": "bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb",
"summary": "all n ≥ 0, n + 0 = n"
},
"proof": {
"kind": "lean",
"content_hash": "cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc",
"toolchain": "leanprover/lean4:v4.13.0"
},
"verifier": {
"id": "lean-4.13.0",
"version": "4.13.0"
},
"verdict": {
"kind": "pass",
"chain": ["lean-4.13.0"]
}
}
},
{
"n": 2,
"description": "Fuzz Fail — binary_search returned OOB index on round 42 of 1024 seeded inputs.",
"content_hash": "f38df7e5b177a13ebd49a3e940c3ad3d487f533ea793087bfdc27101b44c50ad",
"receipt": {
"jc_receipt": "verified-code/1",
"id": "vcr-fuzz-0001",
"closed_at": "2026-06-05T00:00:00Z",
"steward": "did:keri:EJ9testStewardAID000000000000000",
"program": {
"language": "rust",
"content_hash": "dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd",
"byte_length": 256
},
"spec": {
"content_hash": "eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee",
"summary": "binary_search never returns OOB index"
},
"proof": {
"kind": "fuzz",
"property_id": "no-oob-index",
"seed": 7,
"rounds": 1024
},
"verifier": {
"id": "jouleclaw-oracle-fuzz",
"version": "0.1.0"
},
"verdict": {
"kind": "fail",
"reasons": ["counterexample found on round 42"],
"details": {
"property_id": "no-oob-index",
"round": 42,
"input_hex": "deadbeef",
"reason": "returned index 16 for len-8 slice"
}
}
}
}
]
}