Skip to content

Commit 058dad9

Browse files
hyperpolymathclaude
andcommitted
chore: standardise, Justfile, (rename,, fix, parse, errors,, remove, useless, commands)
Batch Justfile audit: standardised naming (lowercase→Justfile), fixed parse errors, removed useless build-riscv from non-Rust repos, added missing assail recipe, and fixed code quality issues. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 3a26606 commit 058dad9

3 files changed

Lines changed: 385 additions & 0 deletions

File tree

lithoglyph/Justfile

Lines changed: 169 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,169 @@
1+
# SPDX-License-Identifier: PMPL-1.0-or-later
2+
# justfile - Just recipes for Lithoglyph
3+
# Copyright (c) 2026 Jonathan D.A. Jewell (hyperpolymath) <j.d.a.jewell@open.ac.uk>
4+
5+
# Default recipe
6+
default:
7+
@just --list
8+
9+
# ============================================================
10+
# BUILD
11+
# ============================================================
12+
13+
# Build Zig libraries (static + shared)
14+
build-zig:
15+
cd core-zig && zig build
16+
17+
# Build shared library for FFI consumers
18+
build-ffi:
19+
cd core-zig && zig build-lib src/bridge.zig -dynamic -lc -O ReleaseFast
20+
21+
# Build C FFI integration test binary
22+
build-ffi-tests:
23+
cd core-zig && gcc -o test-ffi-integration test-ffi-integration.c -L zig-out/lib -llith_bridge
24+
cd core-zig && gcc -o test-version-only test-version-only.c -L zig-out/lib -llith_bridge
25+
cd core-zig && gcc -o test-db-open test-db-open.c -L zig-out/lib -llith_bridge
26+
27+
# Build everything
28+
build: build-zig
29+
30+
# ============================================================
31+
# TESTS
32+
# ============================================================
33+
34+
# Run Zig unit tests (bridge + blocks)
35+
test-zig:
36+
@echo "=== Zig Unit Tests ==="
37+
cd core-zig && zig build test
38+
@echo "Zig tests passed"
39+
40+
# Run Zig tests directly (faster, no build system)
41+
test-zig-fast:
42+
@echo "=== Zig Direct Tests ==="
43+
cd core-zig && zig test src/bridge.zig
44+
cd core-zig && zig test src/blocks.zig
45+
46+
# Run Forth block layer tests
47+
test-forth:
48+
@echo "=== Forth Block Tests ==="
49+
cd core-forth/test && gforth test-blocks.fs -e bye
50+
51+
# Run C FFI integration tests (requires build-zig first)
52+
test-ffi: build-zig
53+
@echo "=== C FFI Integration Tests ==="
54+
cd core-zig && LD_LIBRARY_PATH=zig-out/lib ./test-ffi-integration
55+
56+
# Run C FFI quick smoke tests
57+
test-ffi-smoke: build-zig
58+
@echo "=== C FFI Smoke Tests ==="
59+
cd core-zig && LD_LIBRARY_PATH=zig-out/lib ./test-version-only
60+
cd core-zig && LD_LIBRARY_PATH=zig-out/lib ./test-db-open
61+
62+
# Run Factor seam tests
63+
test-factor:
64+
@echo "=== Factor Seam Tests ==="
65+
cd core-factor/gql && factor seam-tests.factor
66+
67+
# Run ReScript property tests
68+
test-property:
69+
@echo "=== ReScript Property Tests ==="
70+
cd tests/property && deno task test
71+
72+
# Run ReScript fuzz tests (quick: 1K iterations)
73+
test-fuzz-quick:
74+
@echo "=== ReScript Fuzz Tests (Quick) ==="
75+
cd tests/fuzz && deno task fuzz:quick
76+
77+
# Run ReScript fuzz tests (standard: 10K iterations)
78+
test-fuzz:
79+
@echo "=== ReScript Fuzz Tests ==="
80+
cd tests/fuzz && deno task fuzz
81+
82+
# Run ReScript integration tests (requires Deno + ReScript)
83+
test-integration:
84+
@echo "=== ReScript Integration Tests ==="
85+
cd tests/integration && deno task test
86+
87+
# Run E2E tests (requires running Lith server on :8080)
88+
test-e2e:
89+
@echo "=== E2E Tests (requires server on :8080) ==="
90+
cd tests/e2e && deno task test
91+
92+
# Run all core tests (no server required)
93+
test: test-zig test-forth test-ffi
94+
95+
# Run all tests including ReScript suites
96+
test-all: test-zig test-forth test-ffi test-property test-fuzz-quick
97+
98+
# ============================================================
99+
# BENCHMARKS
100+
# ============================================================
101+
102+
# Run Factor GQL benchmarks
103+
bench-factor:
104+
@echo "=== Factor GQL Benchmarks ==="
105+
cd core-factor/gql && factor benchmarks.factor
106+
107+
# Run all benchmarks
108+
bench: bench-factor
109+
110+
# ============================================================
111+
# CHECKS & VALIDATION
112+
# ============================================================
113+
114+
# Check that Forth code loads without errors
115+
check-forth:
116+
@echo "Checking Forth code loads..."
117+
cd core-forth/src && gforth lithoglyph-blocks.fs -e 'bye'
118+
cd core-forth/src && gforth lithoglyph-journal.fs -e 'bye'
119+
cd core-forth/src && gforth lithoglyph-model.fs -e 'bye'
120+
@echo "All Forth files load successfully"
121+
122+
# Check that Lean code compiles
123+
check-lean:
124+
@echo "Checking Lean code compiles..."
125+
cd normalizer/lean && lake build
126+
@echo "Lean code compiles"
127+
128+
# Verify Zig ABI exports match expectations
129+
check-abi: build-zig
130+
@echo "=== ABI Export Verification ==="
131+
nm -D core-zig/zig-out/lib/liblith_bridge.so | grep ' T lith_' | sort
132+
@echo "Expected: lith_version, lith_db_open, lith_db_close, lith_txn_begin, lith_txn_commit, lith_txn_abort, lith_apply, lith_introspect_schema, lith_render_block, lith_render_journal, lith_blob_free"
133+
134+
# Run all checks
135+
check: check-forth check-lean check-abi
136+
137+
# Format Zig code
138+
fmt:
139+
cd core-zig && zig fmt src/
140+
141+
# ============================================================
142+
# CLEAN
143+
# ============================================================
144+
145+
# Clean build artifacts
146+
clean:
147+
@echo "Cleaning build artifacts..."
148+
rm -rf core-zig/zig-out core-zig/.zig-cache
149+
rm -f core-zig/test-*.lgh
150+
@echo "Clean complete"
151+
152+
# ============================================================
153+
# DEV TOOLS
154+
# ============================================================
155+
156+
# Show development environment status
157+
env-status:
158+
@echo "Development Environment Status:"
159+
@echo "================================"
160+
@which zig 2>/dev/null && echo "Zig: $(zig version)" || echo "Zig: NOT INSTALLED"
161+
@which gforth 2>/dev/null && echo "Forth: $(gforth --version 2>&1 | head -1)" || echo "gforth: NOT INSTALLED"
162+
@which factor 2>/dev/null && echo "Factor: installed" || echo "Factor: NOT INSTALLED"
163+
@which lean 2>/dev/null && echo "Lean: $(lean --version 2>&1 | head -1)" || echo "Lean: NOT INSTALLED"
164+
@which deno 2>/dev/null && echo "Deno: $(deno --version 2>&1 | head -1)" || echo "Deno: NOT INSTALLED"
165+
166+
# Start demo server for E2E testing
167+
serve:
168+
@echo "Starting Lithoglyph demo server on :8080..."
169+
cd core-zig && zig run ../demo-server.zig -- -lc

typeql-experimental/Justfile

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
# SPDX-License-Identifier: PMPL-1.0-or-later
2+
# typeql-experimental — Build recipes for VQL-dt++ experimental type system
3+
4+
# Default recipe: type-check all Idris2 modules
5+
default: check
6+
7+
# Type-check the Idris2 kernel (formal specification + proofs)
8+
check:
9+
idris2 --typecheck typeql-experimental.ipkg
10+
11+
# Build the Idris2 kernel (produces TTCs)
12+
build:
13+
idris2 --build typeql-experimental.ipkg
14+
15+
# Build the ReScript parser
16+
build-parser:
17+
cd src/parser && npx rescript-legacy
18+
19+
# Run Idris2 type-level tests
20+
test-idris2:
21+
idris2 --typecheck typeql-experimental.ipkg
22+
@echo "All Idris2 modules type-check successfully."
23+
24+
# Run ReScript parser tests
25+
test-parser:
26+
cd src/parser && npx rescript-legacy
27+
@echo "ReScript parser builds successfully."
28+
29+
# Run all tests
30+
test: test-idris2 test-parser
31+
32+
# Verify no banned patterns in Idris2 code
33+
audit:
34+
@echo "Checking for banned patterns..."
35+
@! grep -rn "believe_me\|assert_total\|assert_smaller\|unsafePerformIO" src/abi/ \
36+
&& echo "PASS: No banned patterns found." \
37+
|| (echo "FAIL: Banned patterns detected!" && exit 1)
38+
39+
# Clean build artefacts
40+
clean:
41+
rm -rf build/
42+
rm -rf src/parser/lib/
43+
44+
# Full verification pipeline
45+
verify: audit check build-parser
46+
@echo "All verification checks passed."

verisimdb/Justfile

Lines changed: 170 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,170 @@
1+
# SPDX-License-Identifier: PMPL-1.0-or-later
2+
# SPDX-FileCopyrightText: 2026 Jonathan D.A. Jewell (hyperpolymath)
3+
#
4+
# justfile — VeriSimDB
5+
# Run with: just <recipe>
6+
7+
set shell := ["bash", "-euo", "pipefail", "-c"]
8+
9+
# Default recipe: show help
10+
default:
11+
@just --list
12+
13+
# ── Build ──────────────────────────────────────────────────────
14+
15+
# Build Rust core (release)
16+
build:
17+
OPENSSL_NO_VENDOR=1 cargo build --release
18+
19+
# Build Rust core (debug)
20+
build-dev:
21+
OPENSSL_NO_VENDOR=1 cargo build
22+
23+
# Build Elixir orchestration layer
24+
build-elixir:
25+
cd elixir-orchestration && mix deps.get && mix compile
26+
27+
# Build everything (Rust + Elixir)
28+
build-all: build build-elixir
29+
30+
# Compile Idris2 ABI definitions
31+
build-abi:
32+
cd src/abi && idris2 --build hypatia-abi.ipkg
33+
34+
# Build Zig FFI bridge
35+
build-ffi:
36+
cd ffi/zig && zig build
37+
38+
# ── Test ───────────────────────────────────────────────────────
39+
40+
# Run Rust tests
41+
test:
42+
OPENSSL_NO_VENDOR=1 cargo test
43+
44+
# Run Elixir tests
45+
test-elixir:
46+
cd elixir-orchestration && mix test
47+
48+
# Run Rust integration tests
49+
test-integration:
50+
OPENSSL_NO_VENDOR=1 cargo test --test integration
51+
52+
# Run all tests (Rust + Elixir)
53+
test-all: test test-elixir
54+
55+
# ── Lint & Format ──────────────────────────────────────────────
56+
57+
# Format all Rust code
58+
fmt:
59+
cargo fmt
60+
61+
# Run clippy lints
62+
lint:
63+
cargo clippy -- -D warnings
64+
65+
# Format Elixir code
66+
fmt-elixir:
67+
cd elixir-orchestration && mix format
68+
69+
# ── Run ────────────────────────────────────────────────────────
70+
71+
# Run verisimdb API server (dev mode)
72+
serve:
73+
RUST_LOG=debug cargo run -p verisim-api
74+
75+
# Run Elixir OTP orchestrator
76+
serve-otp:
77+
cd elixir-orchestration && MIX_ENV=dev mix run --no-halt
78+
79+
# ── Container ──────────────────────────────────────────────────
80+
81+
# Build container image with Podman
82+
container-build:
83+
podman build -t verisimdb:latest -f container/Containerfile .
84+
85+
# Run container locally
86+
container-run:
87+
podman run --rm -p 8080:8080 verisimdb:latest
88+
89+
# Build with stapeln layers
90+
stapeln-build:
91+
@if command -v stapeln &>/dev/null; then \
92+
stapeln build --config stapeln.toml --target production; \
93+
else \
94+
echo "stapeln not found — falling back to podman build"; \
95+
just container-build; \
96+
fi
97+
98+
# Deploy full stack with selur
99+
deploy:
100+
@if command -v selur &>/dev/null; then \
101+
selur seal && podman-compose -f selur-compose.yml up -d; \
102+
else \
103+
echo "selur not found — using podman-compose directly"; \
104+
podman-compose -f selur-compose.yml up -d; \
105+
fi
106+
107+
# Stop deployed stack
108+
deploy-stop:
109+
podman-compose -f selur-compose.yml down
110+
111+
# Sign container with cerro-torre
112+
container-sign:
113+
@if command -v cerro-torre &>/dev/null; then \
114+
cerro-torre sign verisimdb:latest --algorithm ML-DSA-87; \
115+
else \
116+
echo "cerro-torre not found — skipping image signing"; \
117+
fi
118+
119+
# ── Security ───────────────────────────────────────────────────
120+
121+
# Run panic-attack static analysis
122+
panic-scan:
123+
@if [ -x "/var/mnt/eclipse/repos/panic-attacker/target/release/panic-attack" ]; then \
124+
/var/mnt/eclipse/repos/panic-attacker/target/release/panic-attack assail . --verbose; \
125+
else \
126+
echo "panic-attack not built — run 'cd /var/mnt/eclipse/repos/panic-attacker && cargo build --release'"; \
127+
fi
128+
129+
# Run hypatia neurosymbolic scan
130+
hypatia-scan:
131+
@if command -v hypatia-v2 &>/dev/null; then \
132+
hypatia-v2 . --severity=critical --severity=high; \
133+
else \
134+
echo "hypatia-v2 not found — run via CI workflow instead"; \
135+
fi
136+
137+
# Run vordr runtime verification
138+
vordr-verify:
139+
@if command -v vordr &>/dev/null; then \
140+
vordr verify --target localhost:8080 --policy strict; \
141+
else \
142+
echo "vordr not found — skipping runtime verification"; \
143+
fi
144+
145+
# Check license compliance
146+
license-check:
147+
@echo "Checking for banned AGPL-3.0 headers..."
148+
@if grep -rl "AGPL-3.0" --include='*.rs' --include='*.ex' --include='*.exs' --include='*.idr' --include='*.zig' --include='*.yml' . 2>/dev/null; then \
149+
echo "FAIL: Found AGPL-3.0 headers"; \
150+
exit 1; \
151+
else \
152+
echo "PASS: No AGPL-3.0 headers found"; \
153+
fi
154+
155+
# Validate SCM files are in .machine_readable/ only
156+
check-scm:
157+
@for f in STATE.scm META.scm ECOSYSTEM.scm; do \
158+
if [ -f "$$f" ]; then \
159+
echo "ERROR: $$f found in root"; exit 1; \
160+
fi; \
161+
done
162+
@echo "PASS: No SCM files in root"
163+
164+
# ── Clean ──────────────────────────────────────────────────────
165+
166+
# Clean all build artifacts
167+
clean:
168+
cargo clean
169+
cd elixir-orchestration && mix clean 2>/dev/null || true
170+
@echo "Cleaned."

0 commit comments

Comments
 (0)