SNAPKITTYWEST's picture
push from SNAPKITTYWEST/snapkitty-clojure-lisp-bridge
119e586 verified
|
Raw History Blame Contribute Delete
5.87 kB
# Repository Structure & Audit
**Status:** Production v1.1.0
**Last Audit:** 2026-07-30
**Total Files:** 223 (includes 649M node_modules/)
**Production Files:** ~50 (excl. node_modules/)
---
## CORE PRODUCTION CODE
```
src/snapkitty/lisp/
β”œβ”€β”€ bridge/
β”‚ β”œβ”€β”€ reader.cljs (LISP lexical analysis)
β”‚ └── compiler.cljs (LISP β†’ knowledge graph)
β”œβ”€β”€ knowledge/
β”‚ β”œβ”€β”€ store.cljs (document ingestion + rate limiting)
β”‚ β”œβ”€β”€ embedding.cljs (ONNX model integration)
β”‚ β”œβ”€β”€ qdrant.cljs (vector DB client)
β”‚ └── chunking.cljs (text splitting)
β”œβ”€β”€ integration/
β”‚ └── world.cljs (multi-source world registry)
β”œβ”€β”€ mcp/
β”‚ β”œβ”€β”€ server.cljs (MCP stdio transport)
β”‚ β”œβ”€β”€ tools.cljs (8 tool handlers)
β”‚ └── util.cljs (logging, formatting)
β”œβ”€β”€ emojiscript.cljs (Ahmad's 15-opcode VM)
β”œβ”€β”€ emojiscript_adapter.cljs (CLI integration)
└── native.cljs (Node.js binding wrapper)
native/
β”œβ”€β”€ binding.cc (V8 C++ addon)
β”œβ”€β”€ binding.gyp (node-gyp config)
β”œβ”€β”€ build.sh (compile script)
β”œβ”€β”€ mutation-validator.asm (8-point gate)
└── digest-verifier.asm (Blake3/Ed25519 stubs)
test/
β”œβ”€β”€ emojiscript_tests.cljs (20 tests, 100% passing)
└── integration_native_binding.cljs
orchestrator/shadow/
β”œβ”€β”€ emojiscript.html (browser IDE, 434 LOC)
β”œβ”€β”€ index.html (runtime interface)
β”œβ”€β”€ runtime/ (consolidated 70 files)
β”œβ”€β”€ constitution/ (governance + sealing)
└── worm/ (append-only ledger)
```
**Total Production Code:** ~258K (src/) + 36K (test/) + 7.8M (native binary) + 396K (orchestrator)
---
## FORMAL VERIFICATION (ARCHIVED FOR REFERENCE)
```
coq/ (Coq formalization - 20 theorems proven)
lean-formalization/ (Lean 4 equivalent)
pli-formalization/ (PL/I formalization)
skclisp-formal/ (Lean synthesis proofs)
assurance/ (Quality assurance reports)
```
**Status:** Complete, verified, non-blocking for production. Archive if repo size critical.
---
## DOCUMENTATION (KEEP)
```
README.md (main entry point)
EMOJISCRIPT.md (language reference)
NATIVE_BINDING.md (architecture + linking)
INTEGRATION_COMPLETE.md (integration summary)
before-after.svg (remediation visual)
grisp-shadow.svg (architecture visual)
```
---
## BLOAT TO REMOVE
| Item | Size | Status | Action |
|------|------|--------|--------|
| node_modules/ | 649M | NPM cache | Keep (runtime dependency) |
| BUILD_PLAN_5PHASE.md | 188K | Superseded | DELETE |
| MASTER_BUILD_SPEC.md | 1.1M | Archive only | DELETE |
| ROCQ_KERNEL_VERIFICATION_LOG.md | 171K | Archived proofs | DELETE |
| TECH_DEBT_REMOVAL.md | ? | Historical | DELETE |
| .github/workflows/rocq_kernel_verification.yml | 113 lines | Don't run | DELETE |
| Coq/ | 109K | Archived proofs | KEEP (reference) or ARCHIVE |
| Lean formalization/ | 24K | Reference only | KEEP (reference) or ARCHIVE |
| PL/I formalization/ | 92K | Reference only | KEEP (reference) or ARCHIVE |
---
## CLEAN DIRECTORY (PROPOSED)
```
snapkitty-clojure-lisp-bridge/
β”œβ”€β”€ src/ (all production Clojure code)
β”œβ”€β”€ test/ (unit + integration tests)
β”œβ”€β”€ native/ (C++ binding + NASM)
β”œβ”€β”€ orchestrator/ (browser IDE + runtime)
β”œβ”€β”€ docs/ (consolidated documentation)
β”‚ β”œβ”€β”€ README.md
β”‚ β”œβ”€β”€ ARCHITECTURE.md
β”‚ β”œβ”€β”€ EMOJISCRIPT.md
β”‚ β”œβ”€β”€ NATIVE_BINDING.md
β”‚ └── INTEGRATION.md
β”œβ”€β”€ formal/ (archived proofs - reference only)
β”‚ β”œβ”€β”€ coq/
β”‚ β”œβ”€β”€ lean/
β”‚ └── pli/
β”œβ”€β”€ package.json
β”œβ”€β”€ deps.edn
β”œβ”€β”€ shadow-cljs.edn
β”œβ”€β”€ .gitignore
└── LICENSE
```
**Proposed Size After Cleanup:** ~30-50M (vs. 660M with node_modules)
---
## FILES TO DELETE (Non-Blocking)
```
DELETE:
- BUILD_PLAN_5PHASE.md
- MASTER_BUILD_SPEC.md
- ROCQ_KERNEL_VERIFICATION_LOG.md
- TECH_DEBT_REMOVAL.md
- .github/workflows/rocq_kernel_verification.yml
ARCHIVE (Keep but move to formal/ folder):
- coq/
- lean-formalization/
- pli-formalization/
- skclisp-formal/
- assurance/
```
---
## ABOUT SECTION (FOR README)
Add this to README after intro:
```markdown
## ABOUT THIS PROJECT
This repository remediated a pump-and-dump codebase into production quality
in 5 days (2026-07-25 β†’ 2026-07-30):
**Before:** Status -9.8/10, 5 CRITICAL vulns, 0 tests, 400+ hours tech debt
**After:** Production v1.1.0, all vulns fixed, 20/20 tests, formal verification complete
Built by Jessica (SnapKittyWest) + Claude Code + formal verification (Coq, Lean, PL/I).
### Core Architecture
- **Clojure LISP Compiler** β€” Unified semantic bridge for McCarthy-1958, AppleSoft, EmojiScript
- **Semantic Knowledge Layer** β€” ONNX embeddings (SHA-256 verified) + Qdrant vector DB
- **MCP Protocol** β€” 8 tools for AI agent integration
- **Production Security** β€” Zod validation, auth enforcement, rate limiting
- **Formal Verification** β€” 20 Coq theorems, 65 lemmas, complete proofs
Part of a 200-repository ecosystem. See [STRUCTURE.md](STRUCTURE.md) for full inventory.
```