open-standards/jouleclaw/jouleclaw-rs/crates/jouleclaw-verify/src
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Transaction Science 0c63d61bd6 jouleclaw: three doctrine-operationalising crates + SPEC §9 game-engine framing
979 tests pass workspace-wide, 0 fail, 53 ignored. 30 → 33 crates.

The doctrine "deterministic compute, search first, LUT over compute,
inference last, open-ended inference last" got the code missing to
operationalise it. The elm-note research conversation flagged five
academic communities each holding one face of the architecture but
not yet assembled; this commit ships the JouleClaw assembly for three
of those faces.

jouleclaw-lut (NEW · ~876 LOC · 28 tests)
  Literal hash → answer table beneath L0:Cache. The "router IS the
  table" insight made real code, not abstraction. Hash-keyed exact-
  match LUT with explicit registration; registered entries never
  evict (unlike L0:Cache which is content-addressed cache with
  eviction). Normalises input (trim, collapse whitespace, ASCII
  lowercase) so casing/whitespace variants of the same query hit
  the same entry. Bulk-load from TOML and CSV. Implements `Tier`
  so it can register as the cheapest-cost tier in
  jouleclaw-cascade::Cascade. Picojoule resolution; `TierEstimate`
  reports 1 nJ joules, 100 ns latency, 0.9 confidence.

jouleclaw-verify (NEW · ~966 LOC · 24 tests)
  Verifier-in-the-loop. AI proposes, verifier disposes — the
  formal-methods pattern (Lean, BMC, SymCode, ProofNet++) as a
  small composable trait surface. `OutputVerifier` trait +
  `VerifierChain` with fail-fast semantics; each verifier emits
  a `jouleclaw_prov::ToolTouch` into the running receipt. Three
  concrete impls ship in v0.1:
    RegexVerifier       — must_match / must_not_match a pattern
    JsonSchemaVerifier  — top-level required-keys + JsonType
                          checking (not full draft-2020)
    BlakeHashVerifier   — exact byte-equality gate for
                          deterministic-output verification
  Receipt-integrity contract: verifier honesty is load-bearing; a
  verifier that lies corrupts the receipt's tools_touched ledger.

jouleclaw-deterministic (NEW · ~2007 LOC · 52 tests · 48 primitives)
  Standard library of L1 primitives ready to register into a
  LawfulRegistry. The "search first, LUT over compute" doctrine
  filled in for runtimes that don't ship a pattern-lang-class
  lexicon. 48 primitives across 7 categories:
    arithmetic  (11): gcd, lcm, factorial, fib, is_prime, factor,
                     eval (recursive-descent +-*/() parser), abs,
                     sign, square, cube
    units       (12): F↔C, C↔K, miles↔km, kg↔lb, m↔ft, L↔US-gal
    bases        (6): dec↔hex, dec↔bin, dec↔oct (signed; optional
                     0x / 0b / 0o prefixes)
    dates        (5): day_of_week, days_between, is_leap_year,
                     iso_weekday, add_days  (chrono-backed)
    strings      (8): length, uppercase, lowercase, reverse,
                     count_words, contains, starts_with, ends_with
    hashes       (3): blake3, sha256, md5 (lowercase hex)
    lookups      (3): 20-country ISO-3166-1, 20-currency ISO-4217
                     name + symbol (¥/€/£/₹/₩/₽/₺)
  Each primitive's `LawfulPrimitive::id()` is "lawful:<category>:<name>".
  `register_all() -> LawfulRegistry` plus per-category builders so
  operators can pick subsets.

SPEC.md §9 — Adjacent techniques
  Net-new section. Four subsections:
    §9.1 The architectural pattern — names the game-engine
         parallel directly. L0:Cache ↔ texture/asset cache,
         L1:Lawful ↔ pre-baked geometry/LUTs, L2:Embed ↔ BVH /
         spatial query, L3:Model ↔ procedural / runtime synthesis,
         L4:Wire ↔ server-streamed asset / CDN. Then a second
         table mapping nine specific game-engine techniques
         (frustum culling, LOD, deferred rendering, PBR, virtual
         texturing, temporal upsampling, Nanite-style streaming,
         ray tracing + denoiser, frame budget) to their AI
         counterpart and the JouleClaw component that ships it.
    §9.2 Five communities, one architecture — names the five
         research traditions (constrained decoding / DSPy /
         compound AI / NVIDIA-SLM / neurosymbolic / energy
         measurement) and which JouleClaw component each
         corresponds to. The standard's contribution is the
         assembly, not novelty.
    §9.3 The three-lever ceiling — the multiplicative-savings
         math. Route × cache × silicon = 10¹²–10¹⁸× below the
         naive baseline. The "90 %" marketing figure is the
         conservative floor.
    §9.4 The receipt is the proof, not the marketing — refuses
         the receipts-as-marketing failure mode. Every joules_uj
         traces to a real Provenance tag or the runtime is
         non-conformant.
  §10 References renumbered (was §9).

Deferred to v0.2 (per ROADMAP):
  jouleclaw-decode   — grammar-constrained decoding (XGrammar /
                       Outlines binding). Needs a real backend
                       choice that warrants its own session.
  jouleclaw-program  — DSPy-style typed signatures + module
                       compiler. Bigger architectural addition
                       than this commit's scope.

Co-Authored-By: Claude Opus 4.7 <[email protected]>
2026-05-27 05:09:07 -04:00
..
chain.rs jouleclaw: three doctrine-operationalising crates + SPEC §9 game-engine framing 2026-05-27 05:09:07 -04:00
error.rs jouleclaw: three doctrine-operationalising crates + SPEC §9 game-engine framing 2026-05-27 05:09:07 -04:00
hash_verifier.rs jouleclaw: three doctrine-operationalising crates + SPEC §9 game-engine framing 2026-05-27 05:09:07 -04:00
json_schema_verifier.rs jouleclaw: three doctrine-operationalising crates + SPEC §9 game-engine framing 2026-05-27 05:09:07 -04:00
lib.rs jouleclaw: three doctrine-operationalising crates + SPEC §9 game-engine framing 2026-05-27 05:09:07 -04:00
regex_verifier.rs jouleclaw: three doctrine-operationalising crates + SPEC §9 game-engine framing 2026-05-27 05:09:07 -04:00
verifier.rs jouleclaw: three doctrine-operationalising crates + SPEC §9 game-engine framing 2026-05-27 05:09:07 -04:00