Repository navigation
Expand file tree
/
Copy pathJustfile
More file actions
236 lines (187 loc) · 7.72 KB
/
Copy pathJustfile
File metadata and controls
236 lines (187 loc) · 7.72 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
# SPDX-License-Identifier: MPL-2.0
# Copyright (c) Jonathan D.A. Jewell <j.d.a.jewell@open.ac.uk>
# betlang - Development Tasks
# AUTHORITY: AUTHORITY_STACK.mustfile-nickel.scm
# All operations MUST be invoked via `just <recipe>`.
# If a recipe does not exist, ADD it here (and document it).
set shell := ["bash", "-uc"]
set dotenv-load := true
project := "betlang"
# ============================================================================
# DEFAULT
# ============================================================================
# Show all available recipes
default:
@just --list --unsorted
# ============================================================================
# LEGACY RACKET CORE (reference only — frozen, NOT authoritative)
# Canonical betlang is the Rust toolchain + ML surface; see
# docs/decisions/2026-06-15-L0-canonical-identity.adoc. These recipes drive the
# historical Racket prototype and require `racket` (not part of the build).
# ============================================================================
# Run the betlang test suite
test:
@echo "Running betlang test suite..."
racket tests/basics.rkt
# Run conformance tests (deterministic)
test-conformance-deterministic:
@echo "Running deterministic conformance tests..."
racket conformance/deterministic.rkt
# Run conformance tests (stochastic, seeded)
test-conformance-stochastic:
@echo "Running seeded stochastic conformance tests..."
racket conformance/stochastic-seeded.rkt
# Run all conformance tests
test-conformance: test-conformance-deterministic test-conformance-stochastic
# Run full test suite (unit + conformance)
test-all: test test-conformance
# Run smoke test (golden path verification)
smoke:
@echo "Running smoke test..."
racket repl/shell.rkt < conformance/smoke.bet
# Start the interactive REPL
repl:
racket repl/shell.rkt
# Demo: show basic betlang capabilities
demo:
@echo "=== betlang Demo ==="
@echo ""
@echo "Running examples..."
racket examples/basic-tutorial.rkt
@echo ""
@echo "Demo complete. Run 'just repl' for interactive mode."
# ============================================================================
# TOOLING (Rust - Optional, Non-Authoritative)
# ============================================================================
# Build Rust tooling (optional, non-authoritative)
build-tooling:
@echo "Building optional Rust tooling..."
@echo "NOTE: These are non-authoritative. See TOOLING.md"
cargo build --release
# Optimized release build for Betlang v3
build-v3: build-tooling
@echo "Betlang v3 optimized build: release tooling complete."
# Run Rust tooling tests (optional)
test-tooling:
@echo "Testing optional Rust tooling..."
cargo test
# Clean Rust build artifacts
clean-tooling:
cargo clean
# --- Rust toolchain recipes (the working compiler/interpreter pipeline) ------
# These drive the real multi-crate Rust implementation under compiler/, runtime/
# and tools/. (The Racket recipes above target the historical core/*.rkt tree.)
# Build the entire Rust workspace (all crates)
build-rust:
cargo build --workspace
# Test the entire Rust workspace
test-rust:
cargo test --workspace
# Type-check a betlang source file with the Rust checker
check FILE:
cargo run -q -p bet -- check {{FILE}}
# Run a betlang source file with the Rust interpreter
run FILE:
cargo run -q -p bet -- run {{FILE}}
# Compile a betlang source file to a backend (TARGET = js | llvm | beam)
compile FILE TARGET="js":
cargo run -q -p bet -- compile {{FILE}} --target {{TARGET}}
# Start the Rust REPL
repl-rust:
cargo run -q -p bet -- repl
# ============================================================================
# PROOFS (formal verification — see docs/AFFINESCRIPT-ALIGNMENT.adoc)
# ============================================================================
# Machine-check the Lean 4 formalisation (proofs/BetLang.lean)
proof-check-lean4:
@echo "Building Lean 4 proofs (lake build)..."
lake build
# Scan proof sources for banned soundness escape hatches
proof-scan:
@echo "Scanning proofs for banned patterns..."
bash tools/proof-scan.sh .
# Run all available proof checks (scan + machine-check)
proof-check-all: proof-scan proof-check-lean4
@echo "All proof checks complete."
# ============================================================================
# CODE QUALITY
# ============================================================================
# Format Racket code (if raco fmt available)
fmt:
@echo "Formatting not yet configured for Racket"
@echo "Consider: raco fmt (if available)"
# Lint Racket code (if raco lint available)
lint:
@echo "Linting not yet configured for Racket"
@echo "Consider: raco review (if available)"
# Format Rust tooling code
fmt-tooling:
cargo fmt
# Lint Rust tooling code
lint-tooling:
cargo clippy -- -D warnings
# ============================================================================
# BENCHMARKS
# ============================================================================
# Run performance benchmarks
bench:
@echo "Running performance benchmarks..."
racket benchmarks/performance.rkt
# ============================================================================
# DOCUMENTATION
# ============================================================================
# Show project status
status:
@echo "=== Project Status ==="
@echo ""
@echo "Canonical implementation: Rust toolchain + ML surface (compiler/, runtime/, tools/)"
@echo "Mechanised metatheory: proofs/BetLang.lean (Lean 4)"
@echo "Legacy/reference (frozen): Racket core (core/betlang.rkt), conformance/*.bet"
@echo "Identity decision: docs/decisions/2026-06-15-L0-canonical-identity.adoc"
@echo ""
@echo "See ANCHOR.scope-arrest.2026-01-01.Jewell.scm for semantic anchor"
@echo "See AUTHORITY_STACK.mustfile-nickel.scm for operational authority (just/must)"
@echo "See docs/decisions/2026-06-15-betlang-core-plan.adoc for the core build plan"
# ============================================================================
# CLEAN
# ============================================================================
# Clean all build artifacts and logs
clean:
@echo "Cleaning build artifacts..."
rm -rf logs/*.log logs/*.txt
@echo "Clean complete"
# Clean everything including Rust artifacts
clean-all: clean clean-tooling
# ============================================================================
# CONTAINER (podman-first per authority stack)
# ============================================================================
# Build container image
container-build:
podman build -f containers/Containerfile -t betlang:latest .
# Build development container
container-build-dev:
podman build -f containers/Containerfile.dev -t betlang:dev .
# Run container interactively
container-run:
podman run -it --rm betlang:latest
# ============================================================================
# HELP
# ============================================================================
# Show first-run workflow
first-run:
@echo "=== First Run Workflow ==="
@echo ""
@echo "1. Read ANCHOR*.scm and STATE.scm"
@echo "2. Run: just --list"
@echo "3. Run: just test"
@echo "4. Run: just demo"
@echo ""
@echo "For adding new capabilities:"
@echo "1. Update SPEC/ROADMAP first"
@echo "2. Add a just recipe (and tests)"
@echo "3. Only then edit code"
# Run panic-attacker pre-commit scan
assail:
@command -v panic-attack >/dev/null 2>&1 && panic-attack assail . || echo "panic-attack not found — install from https://github.com/hyperpolymath/panic-attacker"
secret-scan-trufflehog:
@command -v trufflehog >/dev/null && trufflehog filesystem . --only-verified || true