Download PRODUCTION_INTEGRATION_GUIDE.md from Snapkitty/snapkitty-clojure-lisp-bridge: direct link, hf CLI and curl.
- Browser
- Download file 10.1 kB
-
https://huggingface.co/Snapkitty/snapkitty-clojure-lisp-bridge/resolve/main/PRODUCTION_INTEGRATION_GUIDE.md
- Command line
-
hf download hf://Snapkitty/snapkitty-clojure-lisp-bridge/PRODUCTION_INTEGRATION_GUIDE.md
-
curl -L -o PRODUCTION_INTEGRATION_GUIDE.md https://huggingface.co/Snapkitty/snapkitty-clojure-lisp-bridge/resolve/main/PRODUCTION_INTEGRATION_GUIDE.md
Production Integration Guide: Real Runtimes
Status: In Transition
Date: 2026-07-30
Target: Fully real repository runtimes in browser
Architecture
Current State (Compatibility Phase)
Browser (docs/sovereign-runtime.html)
β
docs/js/sovereign-runtime.mjs (JavaScript compatibility bridge)
ββ LISP Parser (pure JS, tokenizer + recursive descent)
ββ LISP Evaluator (11 built-in functions)
ββ EmojiScript/SoulVM (15-opcode stack machine)
ββ WASM Crypto Bridge (blake3_hash, ed25519_verify_wasm)
Note: Compatibility bridge is not the repository's real ClojureScript runtime. It is a reference implementation with identical API, created while the real build is being provisioned.
Target State (Real Runtimes)
Browser (docs/sovereign-runtime.html)
β
docs/js/main.js (Compiled ClojureScript)
ββ snapkitty.lisp.bridge.reader (real LISP parser)
ββ snapkitty.lisp.bridge.compiler (real LISP compiler)
ββ snapkitty.lisp.emojiscript (real EmojiScript VM)
ββ snapkitty.ltms.ltms (real LTMS knowledge system)
ββ snapkitty.lisp.jit (real SoulVM + proof certificates)
β
docs/wasm/skclisp_crypto_wasm_bg.wasm (real WASM crypto)
Real Runtime Locations
ClojureScript Source
Compiled from:
src/snapkitty/lisp/bridge/reader.cljsβ LISP tokenizer + parsersrc/snapkitty/lisp/bridge/compiler.cljsβ Semantic compilationsrc/snapkitty/lisp/emojiscript.cljsβ EmojiScript bytecode interpretersrc/snapkitty/ltms/ltms.cljsβ Layered Truth Maintenance Systemsrc/snapkitty/lisp/integration/world.cljsβ Browser entry point
Build Configuration:
shadow-cljs.edn::browsertarget defineddeps.edn: ClojureScript dependencies configured.github/workflows/build-clojurescript.yml: Production build automation
Compile Command:
npx shadow-cljs release browser
Output: docs/js/main.js (production-optimized)
LTMS Knowledge Layer
Real implementation: src/snapkitty/ltms/ltms.cljs (351 lines)
Features:
- Fact storage and conflict resolution
- Assumption tracking and dependency management
- Ambiguous concept disambiguation
- Hybrid knowledge (symbolic + embedding fallback)
Real operations:
(ltms/assert-fact value source confidence)(ltms/query-fact value)(ltms/resolve-conflict candidates)(ltms/mark-outdated fact)(ltms/inspect-justification fact)
Data source: Pre-seeded from docs/data/initial-facts.edn (to be generated)
Formal Proofs
Real Lean 4 sources: lean-formalization/skclisp/
Files:
Machine.leanβ State + execution semanticsMutation.leanβ Mutation journal + rollbackEquivalence.leanβ Semantic equivalence proofsBasic.leanβ Core definitionsPrimitiveTypes.leanβ Type systemProofCertificate.leanβ Certificate validation
Build command:
cd lean-formalization/skclisp && lake build
Evidence generated:
docs/PROOF_VERIFICATION_REPORT.mdβ Build output + metadatadocs/data/proofs-evidence.jsonβ Structured proof status
Constraints:
- Zero sorry declarations
- No unresolved goals
- All TypeClass resolution successful
- Termination checking passed
WASM Cryptography
Real implementation: native/src/lib.rs (Rust)
Exports:
blake3_hash(input: &[u8]) -> Vec<u8>ed25519_verify_wasm(message, signature, public_key) -> boolvalidate_mutation_wasm(...) -> MutationValidationResultvalidate_proof_certificate_wasm(cert_bytes) -> ProofCertificateValidationResult
Build:
cd native && wasm-pack build --target web --out-dir ../docs/wasm --release
Output: docs/wasm/skclisp_crypto_wasm_bg.wasm (73 KB)
Integration Phases
Phase 1: ClojureScript Build (In Progress)
Status: Workflow created, pending GitHub Actions execution
Trigger: Push to master or manual workflow dispatch
Action: .github/workflows/build-clojurescript.yml
Steps:
- Setup Java + Clojure CLI
- Install npm dependencies
- Run
npx shadow-cljs release browser - Generate build report
- Commit
docs/js/main.jsto master
Expected output:
docs/js/main.js (optimized bundle)
docs/js/main.js.map (source map)
docs/BUILD_REPORT.md (compiler output + evidence)
Load in browser:
<script src="/snapkitty-clojure-lisp-bridge/js/main.js"></script>
Phase 2: Lean Proof Verification (In Progress)
Status: Workflow created, pending GitHub Actions execution
Trigger: Push to master or manual workflow dispatch
Action: .github/workflows/verify-lean-proofs.yml
Steps:
- Setup Lean 4
- Run
lake buildinlean-formalization/skclisp/ - Extract proof metadata
- Generate evidence JSON
- Commit proof artifacts
Expected output:
docs/PROOF_VERIFICATION_REPORT.md (human-readable)
docs/data/proofs-evidence.json (structured)
Load in browser:
fetch('/snapkitty-clojure-lisp-bridge/data/proofs-evidence.json')
.then(r => r.json())
.then(proofs => {
// Display exact verification status from real Lean build
})
Phase 3: LTMS Data Loading (Ready)
Initial facts: To be generated from docs/data/initial-facts.edn
Example structure:
[
{:fact :sky-color :value :blue :source :observation :confidence 0.95 :priority 100}
{:fact :gravity-direction :value :down :source :physics :confidence 1.0 :priority 200}
]
Load in browser:
fetch('/snapkitty-clojure-lisp-bridge/data/initial-facts.edn')
.then(r => r.text())
.then(edn => {
// Parse and seed LTMS with real facts
window.snapkitty.ltms.seed(edn);
})
Phase 4: ONNX Embeddings (Decision Required)
Current status: NOT INTEGRATED
Decision options:
Option A: In-Browser ONNX Runtime
- Port:
ONNX Runtime Web+ real model - Size: ~50 MB (model) + 5 MB (runtime)
- Latency: 100-500ms per embedding
- Benefit: No server dependency
- Cost: Large download, startup delay
Option B: Backend Service
- Reuse existing
MCPendpoint or create HTTP service - Size: Minimal client
- Latency: Network + service latency
- Benefit: Fast, cacheable
- Cost: Requires running service
Option C: Precomputed Index
- Use static embedding JSON (pre-computed)
- Label as: "Precomputed Semantic Index (not live inference)"
- Size: ~1-5 MB
- Latency: Instant (in-memory)
- Benefit: Fast, no dependencies
- Cost: Static data; no real-time embeddings
Recommendation for this release: Option C (precomputed index) with path forward to Option B (backend service). This allows knowledge queries to work while maintaining honesty about live inference availability.
Real Runtime API
Once ClojureScript compiles, the browser will have access to:
// LISP operations
window.snapkitty.lisp.bridge.parseLisp(source: string) -> AST
window.snapkitty.lisp.bridge.compileLisp(ast: AST) -> CompiledForm
window.snapkitty.lisp.evaluateLisp(source: string) -> Result
// EmojiScript/SoulVM
window.snapkitty.lisp.emojiscript.compile(source: string) -> Bytecode
window.snapkitty.lisp.emojiscript.execute(bytecode: Bytecode) -> ExecutionResult
// LTMS Knowledge
window.snapkitty.ltms.assertFact(value, source, confidence) -> void
window.snapkitty.ltms.queryFact(value) -> FactResult
window.snapkitty.ltms.resolvConflict(candidates) -> Fact
window.snapkitty.ltms.inspectJustification(fact) -> Justification
// WASM Crypto
window.skclisp_crypto_wasm.blake3_hash(input: Uint8Array) -> Uint8Array
window.skclisp_crypto_wasm.ed25519_verify_wasm(msg, sig, pk) -> boolean
Compatibility Bridge (Temporary)
File: docs/js/sovereign-runtime.mjs
Status: Production fallback while real build is pending
API Surface: Identical to real runtime (above)
Differences:
- JavaScript implementation (not ClojureScript)
- Simplified LTMS (in-memory only, no persistence)
- No formal proof verification
- No JIT compilation
- No MCP integration
Removal: Delete once ClojureScript build is confirmed working
Deployment Checklist
- GitHub Actions runners provisioned with Java + Clojure CLI
- ClojureScript build completes successfully (check Actions tab)
-
docs/js/main.jsgenerated and committed - Lean proofs verify without errors (check Actions tab)
-
docs/data/proofs-evidence.jsongenerated - LTMS fact seeding configured
- ONNX decision made (Option A/B/C)
- UI updated to use real runtime APIs
- Production URL tested:
/snapkitty-clojure-lisp-bridge/sovereign-runtime.html - All controls verified against real implementations
Next Actions
Trigger ClojureScript build:
- Go to GitHub repo β Actions β "Build ClojureScript Runtime" β Run workflow
- Wait for completion (5-10 minutes)
Trigger Lean verification:
- Go to GitHub repo β Actions β "Verify Lean 4 Proofs" β Run workflow
- Wait for completion (2-5 minutes)
Update HTML to load real runtime:
- Once
docs/js/main.jsexists, update script tag - Test in browser developer console
- Once
Seed LTMS facts:
- Create
docs/data/initial-facts.edn - Populate with real knowledge
- Create
Make ONNX decision:
- Choose Option A/B/C
- Implement accordingly
Smoke test production:
- Evaluate
(+ 1 2)β 3 - Execute
π’6 π’7 βοΈ β©οΈβ 42 - Query knowledge base
- Verify proofs display real evidence
- Evaluate
Owner: Jessica (SnapKittyWest)
Last Updated: 2026-07-30
Maintenance: Update as workflows complete and real runtimes integrate