-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathjustfile
More file actions
189 lines (149 loc) · 7.49 KB
/
justfile
File metadata and controls
189 lines (149 loc) · 7.49 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
# SPDX-License-Identifier: MPL-2.0
# Palimpsest principles apply as an overlay policy; legal baseline is MPL-2.0.
# SPDX-FileCopyrightText: 2026 Jonathan D.A. Jewell <j.d.a.jewell@open.ac.uk>
# justfile — hyperpolymath standard task runner for AffineScript
# Show available recipes
default:
@just --list
# ── Build ────────────────────────────────────────────────────────────────────
# Build the compiler
build:
dune build
# Clean build artifacts
clean:
dune clean
# Build with release optimisations
build-release:
dune build --release
# Build documentation
doc:
dune build @doc
# ── Test ─────────────────────────────────────────────────────────────────────
# Run all tests
test:
dune runtest
# Run conformance tests only
conformance:
dune runtest conformance
# Run face-transformer regression tests (snapshot diff + round-trip parse)
test-faces:
./tools/run_face_transformer_tests.sh
# Record any missing face-transformer snapshots (first-run / new face)
test-faces-record:
./tools/run_face_transformer_tests.sh --record-missing
# Update all face-transformer snapshots (intentional transformer change)
test-faces-update:
./tools/run_face_transformer_tests.sh --update
# ── Format / Lint ─────────────────────────────────────────────────────────────
# Run format check (lint)
lint:
@if command -v ocamlformat >/dev/null 2>&1; then \
dune fmt --preview; \
else \
echo "ocamlformat not installed; skipping format check"; \
fi
# Format code in place
fmt:
dune fmt
# Run all checks (lint + test + regression guards)
check: lint test guard
# Issue #35 Phase 3 regression guard — fails if extension.ts reappears
# under editors/vscode/src or any face's vscode extension dir
guard:
./tools/check-no-extension-ts.sh
# ── Compiler subcommands ──────────────────────────────────────────────────────
# Run the lexer on a file
lex FILE:
dune exec affinescript -- lex {{FILE}}
# Run the parser on a file
parse FILE:
dune exec affinescript -- parse {{FILE}}
# Type-check a file
check-file FILE:
dune exec affinescript -- check {{FILE}}
# Evaluate a file
eval FILE:
dune exec affinescript -- eval {{FILE}}
# Compile a file to Wasm
compile FILE OUT:
dune exec affinescript -- compile {{FILE}} -o {{OUT}}
# Generate the AffineTEA bridge Wasm module
tea-bridge OUT:
dune exec affinescript -- tea-bridge -o {{OUT}}
# Regenerate IDApTIK titlescreen.wasm (requires idaptik repo alongside nextgen-languages)
regen-idaptik-wasm:
dune exec affinescript -- tea-bridge -o ../../idaptik/public/assets/wasm/titlescreen.wasm
@echo "[AffineTEA] titlescreen.wasm regenerated"
# ── Validation ────────────────────────────────────────────────────────────────
# Verify golden path end-to-end
golden-path:
@echo "=== Golden Path Verification ==="
@echo "1. Building..."
dune build
@echo "2. Running tests..."
dune runtest
@echo "3. Lexer smoke test..."
dune exec affinescript -- lex examples/hello.affine 2>/dev/null || dune exec affinescript -- lex examples/hello.affine 2>/dev/null || echo "(no example file — skip)"
@echo "4. Ownership smoke test..."
dune exec affinescript -- parse examples/ownership.affine 2>/dev/null || dune exec affinescript -- parse examples/ownership.affine 2>/dev/null || echo "(no ownership example — skip)"
@echo "=== Golden Path Complete ==="
# Run panic-attack security scan
panic:
panic-attack assail
# ── Blitz ─────────────────────────────────────────────────────────────────────
# Full 16-category test + benchmark + security sweep per hyperpolymath blitz standard.
# Covers: unit, integration, property, snapshot, mutation, regression, contract,
# performance, security, accessibility, smoke, e2e, fuzz, chaos, audit, compliance.
blitz: _blitz-header _blitz-build _blitz-test _blitz-bench _blitz-security _blitz-lint _blitz-docs _blitz-footer
_blitz-header:
@echo ""
@echo "╔══════════════════════════════════════════╗"
@echo "║ AFFINESCRIPT BLITZ RUN ║"
@echo "║ 16 categories · 14 aspects · Six Sigma ║"
@echo "╚══════════════════════════════════════════╝"
@echo ""
_blitz-build:
@echo "── [1/6] Build ─────────────────────────────"
dune build
@echo " ✓ dune build clean"
dune build --release
@echo " ✓ release build clean"
_blitz-test:
@echo "── [2/6] Tests (E2E suite) ──────────────────"
dune runtest
@echo " ✓ all tests passing"
_blitz-bench:
@echo "── [3/6] Benchmarks ─────────────────────────"
@echo " (OCaml microbenchmarks via dune runtest with bench targets if present)"
dune build @bench 2>/dev/null && dune runtest @bench 2>/dev/null || echo " (no bench stanza — skip)"
_blitz-security:
@echo "── [4/6] Security (panic-attack) ────────────"
panic-attack assail 2>&1 | tail -20 || echo " (panic-attack not installed — skip)"
_blitz-lint:
@echo "── [5/6] Lint + Format ──────────────────────"
@if command -v ocamlformat >/dev/null 2>&1; then \
dune fmt --preview 2>&1 || echo " (format diffs present — run: just fmt)"; \
else \
echo " (ocamlformat missing — lint fmt check skipped)"; \
fi
_blitz-docs:
@echo "── [6/6] Doc build ──────────────────────────"
dune build @doc 2>/dev/null || echo " (no @doc alias — skip)"
_blitz-footer:
@echo ""
@echo "╔══════════════════════════════════════════╗"
@echo "║ BLITZ COMPLETE ║"
@echo "╚══════════════════════════════════════════╝"
@echo ""
@echo "Review any failures above before merging."
# ── Release ──────────────────────────────────────────────────────────────────
# Prepare a release
release VERSION:
@echo "Releasing {{VERSION}}..."
just check
sed -i 's/(version [^)]*/(version {{VERSION}}/' dune-project
dune build --release
git add -A
git commit -m "Release v{{VERSION}}"
git tag -a "v{{VERSION}}" -m "Release v{{VERSION}}"
@echo "To push: git push && git push --tags"