-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathJustfile
More file actions
274 lines (248 loc) · 11.5 KB
/
Justfile
File metadata and controls
274 lines (248 loc) · 11.5 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
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
# SPDX-License-Identifier: PMPL-1.0-or-later
# PanLL Justfile — Project shortcut for eNSAID development
set shell := ["bash", "-uc"]
set dotenv-load := true
import? "contractile.just"
project := "PanLL"
version := "0.1.0-alpha"
# Default: list all recipes
default:
@just --list --unsorted
# Start full development environment (Tauri app + watchers)
dev:
@echo "🚀 Starting PanLL eNSAID Development Environment..."
@# Start watchers in background and run tauri dev in foreground
@(deno task res:watch) &
(deno task css:watch) &
deno task dev;
echo "Stopping background processes...";
pkill -P $$ 2>/dev/null || true
# Start web-only development environment (Browser + watchers)
serve:
@echo "🌐 Starting PanLL Web-only Development Environment..."
@(deno task res:watch) &
(deno task css:watch) &
deno task serve:dev;
echo "Stopping background processes...";
pkill -P $$ 2>/dev/null || true
# Run mock ECHIDNA theorem prover advisor
mock:
@echo "🦄 Starting Mock ECHIDNA server..."
deno task mock:echidna
# Build the project for production (Tauri)
build:
@echo "🏗️ Building PanLL for production..."
deno task res:build
deno task css:build
deno task build
# Run all tests
test *args:
@echo "🧪 Running PanLL test suite..."
deno task test {{args}}
# Run Invariant Path overlay tools for this repository
invariant-path *ARGS:
./scripts/invariant-path.sh {{ARGS}}
# Clean build artifacts
clean:
@echo "🧹 Cleaning build artifacts..."
deno task res:clean
rm -f public/styles.css
rm -rf src-tauri/target/
# ═══════════════════════════════════════════════════════════════════════════════
# RUNTIME & CONTAINERS
# ═══════════════════════════════════════════════════════════════════════════════
# Start the PanLL runtime environment (compose)
runtime *args:
@echo "🐳 Starting PanLL runtime stack..."
cd runtime && selur-compose up {{args}}
# Stop the PanLL runtime environment
runtime-down:
@echo "🛑 Stopping PanLL runtime stack..."
cd runtime && selur-compose down
# ═══════════════════════════════════════════════════════════════════════════════
# LINT & FORMAT
# ═══════════════════════════════════════════════════════════════════════════════
# Lint and format
lint:
deno task lint
deno task fmt --check
fmt:
deno task fmt
# 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"
# ═══════════════════════════════════════════════════════════════════════════════
# ONBOARDING & DIAGNOSTICS
# ═══════════════════════════════════════════════════════════════════════════════
# Check all required toolchain dependencies and report health
doctor:
#!/usr/bin/env bash
echo "═══════════════════════════════════════════════════"
echo " PanLL Doctor — Toolchain Health Check"
echo "═══════════════════════════════════════════════════"
echo ""
PASS=0; FAIL=0; WARN=0
check() {
local name="$1" cmd="$2" min="$3"
if command -v "$cmd" >/dev/null 2>&1; then
VER=$("$cmd" --version 2>&1 | head -1)
echo " [OK] $name — $VER"
PASS=$((PASS + 1))
else
echo " [FAIL] $name — not found (need $min+)"
FAIL=$((FAIL + 1))
fi
}
check "Deno" deno "2.0"
check "Rust (cargo)" cargo "1.80"
check "Zig" zig "0.13"
check "just" just "1.25"
# ReScript via deno
if deno run -A npm:rescript --version >/dev/null 2>&1; then
RESVER=$(deno run -A npm:rescript --version 2>&1 | head -1)
echo " [OK] ReScript — $RESVER"
PASS=$((PASS + 1))
else
echo " [FAIL] ReScript — not available via deno (need 12.0+)"
FAIL=$((FAIL + 1))
fi
# Optional tools
if command -v elixir >/dev/null 2>&1; then
echo " [OK] Elixir (optional) — $(elixir --version 2>&1 | grep Elixir | head -1)"
PASS=$((PASS + 1))
else
echo " [WARN] Elixir (optional) — not found (needed for beam/ middleware)"
WARN=$((WARN + 1))
fi
if command -v panic-attack >/dev/null 2>&1; then
echo " [OK] panic-attack — available"
PASS=$((PASS + 1))
else
echo " [WARN] panic-attack — not found (pre-commit scanner)"
WARN=$((WARN + 1))
fi
echo ""
echo " Result: $PASS passed, $FAIL failed, $WARN warnings"
if [ "$FAIL" -gt 0 ]; then
echo " Run 'just heal' to attempt automatic repair."
exit 1
fi
echo " All required tools present."
# Attempt to automatically install missing tools
heal:
#!/usr/bin/env bash
echo "═══════════════════════════════════════════════════"
echo " PanLL Heal — Automatic Tool Installation"
echo "═══════════════════════════════════════════════════"
echo ""
if ! command -v deno >/dev/null 2>&1; then
echo "Installing Deno..."
curl -fsSL https://deno.land/install.sh | sh
fi
if ! command -v cargo >/dev/null 2>&1; then
echo "Installing Rust via rustup..."
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
source "$HOME/.cargo/env"
fi
if ! command -v zig >/dev/null 2>&1; then
echo "Zig not found. Install with: asdf install zig latest"
echo " or download from https://ziglang.org/download/"
fi
if ! command -v just >/dev/null 2>&1; then
echo "Installing just..."
cargo install just
fi
# Install Deno deps (including ReScript)
echo "Installing Deno dependencies..."
deno install
echo ""
echo "Heal complete. Run 'just doctor' to verify."
# Guided tour of the project structure and key concepts
tour:
#!/usr/bin/env bash
echo "═══════════════════════════════════════════════════"
echo " PanLL eNSAID — Guided Tour"
echo "═══════════════════════════════════════════════════"
echo ""
echo "PanLL is a neurosymbolic AI development environment with three panels:"
echo ""
echo " Panel-L (Symbolic) Formal constraints, proof editor"
echo " Panel-N (Neural) Inference tokens, ECHIDNA advisor"
echo " Panel-W (World) Task canvas, VeriSimDB, security"
echo ""
echo "Architecture: ReScript TEA (The Elm Architecture)"
echo " Model.res → State composition root"
echo " Msg.res → Message variants"
echo " Update.res → State transition kernel (~7500 lines)"
echo " View.res → Root view renderer"
echo ""
echo "Backend: Gossamer (Rust + WebKitGTK)"
echo " src-gossamer/ → Rust commands and native window"
echo ""
echo "Key engines in src/core/:"
echo " AntiCrash.res Circuit breaker (validates neural tokens)"
echo " OrbitalSync.res Cross-panel synchronisation"
echo " Contractiles.res Elastic state contracts"
echo " TypeLLEngine.res Cross-panel type intelligence"
echo " VabEngine.res Verified Assembly Building"
echo ""
echo "Quick commands:"
echo " just dev Start full dev environment"
echo " just serve Browser-only dev (no native window)"
echo " just test Run 979 tests"
echo " just mock Start mock ECHIDNA prover (port 9000)"
echo " just build Production build"
echo ""
echo "Tests: 979 tests in 41 suites (deno test)"
echo "Panels: 106 across three panes"
echo ""
echo "Read more: docs/TEA_GUIDE.md, QUICKSTART-USER.adoc"
# Show help for common workflows
help-me:
#!/usr/bin/env bash
echo "═══════════════════════════════════════════════════"
echo " PanLL — Common Workflows"
echo "═══════════════════════════════════════════════════"
echo ""
echo "FIRST TIME SETUP:"
echo " deno install Install dependencies"
echo " just doctor Check toolchain"
echo " just heal Fix missing tools"
echo ""
echo "DEVELOPMENT:"
echo " just dev Full dev environment (Gossamer + watchers)"
echo " just serve Browser-only dev (no native window)"
echo " just mock Start mock ECHIDNA server (port 9000)"
echo ""
echo "BUILD & TEST:"
echo " just build Production build"
echo " just test Run all tests"
echo " just lint Lint and format check"
echo " just fmt Auto-format"
echo ""
echo "PRE-COMMIT:"
echo " just assail Run panic-attacker scan"
echo ""
echo "INFRASTRUCTURE:"
echo " just runtime Start compose stack"
echo " just runtime-down Stop compose stack"
echo " just clean Clean build artifacts"
echo ""
echo "LEARN:"
echo " just tour Guided project tour"
echo " just default List all recipes"
# Print the current CRG grade (reads from READINESS.md '**Current Grade:** X' line)
crg-grade:
@grade=$$(grep -oP '(?<=\*\*Current Grade:\*\* )[A-FX]' READINESS.md 2>/dev/null | head -1); \
[ -z "$$grade" ] && grade="X"; \
echo "$$grade"
# Generate a shields.io badge markdown for the current CRG grade
# Looks for '**Current Grade:** X' in READINESS.md; falls back to X
crg-badge:
@grade=$$(grep -oP '(?<=\*\*Current Grade:\*\* )[A-FX]' READINESS.md 2>/dev/null | head -1); \
[ -z "$$grade" ] && grade="X"; \
case "$$grade" in \
A) color="brightgreen" ;; B) color="green" ;; C) color="yellow" ;; \
D) color="orange" ;; E) color="red" ;; F) color="critical" ;; \
*) color="lightgrey" ;; esac; \
echo "[](https://github.com/hyperpolymath/standards/tree/main/component-readiness-grades)"