From a fresh clone to a green gate. Users who only run the app need just quickstart.md; this page is for building, testing, and changing code.
- Linux x86_64 (bare metal or WSL2).
- Python 3.10+ with
venv(3.12 used here). - OpenSSL 3 runtime:
libssl.so.3+libcrypto.so.3(Debian/Ubuntu:sudo apt install libssl3). Bothbuild.shandtest.shfail fast withlibssl.so.3 not foundwithout it. - A few GB free if you run
./embed-setup.sh(llama.cpp server + GGUF weights); the core build needs only tens of MB.
git clone https://github.com/JohnnyOpcode/MetaMining
cd MetaMining
python3 -m venv .venv
.venv/bin/pip install "mojo==1.2.0" # the tested toolchain
./build.sh # -> bin/metamining
./test.sh # 13 suites + self-test, a few minutesNotes:
- The repo pins nothing itself —
.venv/is git-ignored, so themojo==1.2.0pin above is this checkout's tested version, not a lockfile. Newer Mojo may work; if the gate breaks on a newer toolchain, that pin is the known-good one. - Every script exports
.venv/binontoPATH, so plain./test.shfindsmojowith no activation step. - Browser probes (
/tmp/*probe.pyduring development) additionally want.venv/bin/pip install playwrightplus a Playwright Chromium (PLAYWRIGHT_BROWSERS_PATH=/tmp/mspw ... -m playwright install chromium). Not needed for the gate. MODULAR_CACHE_DIRwarnings (read-only home/cache) are harmless; point the variable at a writable dir to silence them.
| Script | Does |
|---|---|
./build.sh |
mojo build → bin/metamining (links system libssl) |
./test.sh |
Full gate: 13 mojo run suites + --self-test e2e |
./run.sh |
Rebuild-if-stale, then run the binary in the foreground (args pass through) |
./serve.sh |
Detached server + health proof (--port N supported) |
./metamining.sh |
Full stack: embed server + MetaMining; stop, --no-embed |
./embed-setup.sh |
Download llama.cpp + Nomic Q8_0 GGUF; serve runs :8080 |
web/ is read from disk at runtime — dashboard edits need no
rebuild, but the binary only rebuilds at startup, so restart the
server after touching src/ or tests/.
src/main.mojo CLI entry, flags, --self-test e2e
src/metamining/libc.mojo sockets, processes, files (FFI, no stdlib net)
src/metamining/json.mojo JSON parser/renderer (no dependency)
src/metamining/tls.mojo TLS 1.3 client over system OpenSSL
src/metamining/http.mojo HTTP server + client primitives
src/metamining/endpoint.mojo Meta Responses/chat/embed calls
src/metamining/explorer.mojo expedition math (KDE, entropy, stops)
src/metamining/linalg.mojo PCA + vector ops
src/metamining/topo.mojo Vietoris-Rips, Mapper, merge tree
src/metamining/scoring.mojo novelty x coherence, Pareto, judges
src/metamining/steering.mojo warp/teleport/push, vein lock
src/metamining/sim.mojo deterministic sim backend
src/metamining/worker.mojo forked branch workers, journals, veins
src/metamining/server.mojo routes, SSE, control, MCP dispatch
src/metamining/mcp.mojo MCP JSON-RPC helpers + tool catalog
tests/test_*.mojo one suite per module (run via ./test.sh)
web/ dashboard: index.html + app.js + app.css
data/benchmarks/ seeded reference journals + signatures
Housekeeping state (git-ignored, directory-local): journals/,
veins/, bin/, .venv/, tools/, models/. See manual §17
before deleting any of it.
- Pure Mojo in the product. HTTP, JSON, TLS client, PCA,
topology — all Mojo; only libc and system OpenSSL via FFI. Python
appears solely as
/tmpthrowaway tooling, never in the repo. - Gate before done.
./test.shmust exit 0 after anysrc/,tests/, orweb/change. Focused runs look likemojo run -Xlinker <ssl> -Xlinker <cry> -I src tests/test_web.mojo(seetest.shfor the exact flags);META_OFFLINE=1skips the live-TLS probe. - Tests live with the code. Bug fixes add or extend the matching
tests/test_*.mojosuite first (fail observed, then fixed);tests/test_web.mojocovers the dashboard statically (id cross-references, route wiring). - Behavior changes update docs. User-visible changes land in
docs/manual.md(or the topical doc),README.mdwhere it summarizes, andCHANGELOG.mdunder[Unreleased].