@@ -9,7 +9,10 @@ set positional-arguments := true
99# Project metadata
1010project := " dotmatrix-fileprinter"
1111version := " 1.0.0"
12- tier := " infrastructure"
12+ tier := " infrastructure"
13+
14+ # Gforth is in toolbox
15+ gforth := " toolbox run gforth"
1316
1417# ═══════════════════════════════════════════════════════════════════════════════
1518# DEFAULT & HELP
@@ -23,36 +26,112 @@ default:
2326info :
2427 @ echo " Project: {{ project}} "
2528 @ echo " RSR Tier: {{ tier}} "
29+ @ echo " Version: {{ version}} "
2630 @ echo " Phase: $(just state-phase)"
31+ @ echo " "
32+ @ echo " Stack:"
33+ @ echo " Neural: ReScript + TEA"
34+ @ echo " Symbolic: Nickel"
35+ @ echo " Physical: Forth (Gforth)"
36+ @ echo " Bridge: Tauri 2.0 (Rust)"
2737
2838# ═══════════════════════════════════════════════════════════════════════════════
29- # BUILD & STRIKE (Project Specific)
39+ # DEVELOPMENT
3040# ═══════════════════════════════════════════════════════════════════════════════
3141
32- # Build the Neuro-Symbolic pipeline (ReScript + Tauri/Rust)
33- build :
42+ # Install dependencies (run once)
43+ setup :
44+ @ echo " Checking dependencies..."
45+ @ command -v deno >/ dev/ null || (echo " ERROR: Deno not found. Install from https://deno.land" && exit 1 )
46+ @ toolbox run command -v gforth >/ dev/ null || (echo " WARNING: Gforth not found in toolbox. Install with: toolbox run sudo dnf install gforth" && exit 0)
47+ @ command -v cargo >/ dev/ null || (echo " ERROR: Rust/Cargo not found. Install from https://rustup.rs" && exit 1 )
48+ @ echo " Installing npm packages via Deno..."
49+ @ deno install
50+ @ echo " Setup complete!"
51+
52+ # Start development server (hot-reload)
53+ dev :
54+ @ echo " Starting development server..."
55+ @ deno task dev
56+
57+ # Build ReScript only
58+ build-res :
3459 @ echo " Compiling Neural Layer (ReScript)..."
35- @ rescript build
36- @ echo " Compiling Physical Host (Tauri)..."
37- @ cargo tauri build
60+ @ deno run -A npm:rescript build
61+
62+ # Build frontend (ReScript + Vite)
63+ build-frontend :
64+ @ echo " Building frontend..."
65+ @ deno task build
66+
67+ # Build Tauri app (full release)
68+ build : build-frontend
69+ @ echo " Building Tauri application..."
70+ @ cd src-tauri && cargo build --release
71+ @ echo " Build complete: src-tauri/target/release/{{ project}} "
72+
73+ # Run Tauri in development mode
74+ tauri-dev : build-res
75+ @ echo " Starting Tauri development mode..."
76+ @ cargo tauri dev
77+
78+ # ═══════════════════════════════════════════════════════════════════════════════
79+ # FORTH KERNEL
80+ # ═══════════════════════════════════════════════════════════════════════════════
3881
39- # Execute a Deterministic Byte-Strike using the Golden Prompt
40- # Usage: just strike "104,101,108,108,111"
41- strike bytes : build
42- @ echo " Initiating Forth Strike Sequence..."
43- @ ./ src-tauri/ target/ release/ {{ project}} --strike " {{ bytes}} "
82+ # Test the Forth kernel directly
83+ test-forth :
84+ @ echo " Testing Forth kernel..."
85+ @ cd {{ justfile_directory ()}} && {{ gforth}} kernel/ striker.fth -e ' test-strike bye'
86+ @ echo " "
87+ @ echo " Verifying output..."
88+ @ hexdump -C test.bin
89+ @ rm -f test.bin
90+
91+ # Interactive Forth session
92+ forth-repl :
93+ @ echo " Starting Forth REPL (type 'bye' to exit)..."
94+ @ cd {{ justfile_directory ()}} && {{ gforth}} kernel/ striker.fth
95+
96+ # Execute a Deterministic Byte-Strike via Forth directly
97+ # Usage: just strike-direct "72,101,108,108,111" output.bin
98+ strike-direct bytes output = " dist/substrate.bin":
99+ @ echo " Preparing strike data..."
100+ @ mkdir -p $(dirname {{output}})
101+ @ echo " CREATE STRIKE-DATA {{ bytes}} ," > kernel/ data.fth
102+ @ echo " Executing Forth strike..."
103+ @ cd {{ justfile_directory ()}} && {{ gforth}} kernel/ striker.fth kernel/ data.fth -e ' s" {{ output}} " strike-init STRIKE-DATA $(echo "{{ bytes}} " | tr "," "\n" | wc -l) strike-sequence strike-close bye'
104+ @ echo " Strike complete. Verifying..."
105+ @ hexdump -C {{ output}}
106+
107+ # ═══════════════════════════════════════════════════════════════════════════════
108+ # VERIFICATION
109+ # ═══════════════════════════════════════════════════════════════════════════════
44110
45111# Verify the Physical Truth of the substrate (ASCII-clean, no 0xA0)
46112verify target = " dist/substrate.bin":
47113 @ echo " Verifying Physical Byte Truth for {{ target}} ..."
48114 @ hexdump -C {{ target}}
49- @ if grep -obUP " \x a0" {{ target}} ; then \
115+ @ echo " "
116+ @ if grep -obUaP ' \xa0' {{ target}} 2 >/ dev/ null; then \
50117 echo " FAIL: NBSP (0xA0) CONTAMINATION DETECTED" ; \
51118 exit 1 ; \
119+ elif grep -obUaP ' \xc2' {{ target}} 2 >/ dev/ null; then \
120+ echo " WARN: UTF-8 marker (0xC2) detected" ; \
52121 else \
53122 echo " PASS: Substrate is ASCII-pure." ; \
54123 fi
55124
125+ # Check for any non-ASCII bytes
126+ verify-strict target = " dist/substrate.bin":
127+ @ echo " Strict ASCII verification for {{ target}} ..."
128+ @ if LC_ALL=C grep -P ' [^\x00-\x7F]' {{ target}} 2 >/ dev/ null; then \
129+ echo " FAIL: Non-ASCII bytes detected" ; \
130+ exit 1 ; \
131+ else \
132+ echo " PASS: File is strictly ASCII (0x00-0x7F)" ; \
133+ fi
134+
56135# ═══════════════════════════════════════════════════════════════════════════════
57136# RSR COMPLIANCE & STATE
58137# ═══════════════════════════════════════════════════════════════════════════════
@@ -93,8 +172,34 @@ container-build:
93172
94173# Count lines of deterministic code
95174loc :
96- @ find . \( -name " *.res" -o -name " *.fth" -o -name " *.rs" -o -name " *.ncl" \) | xargs wc -l | tail -1
175+ @ echo " Lines of code by language:"
176+ @ echo " ReScript: $(find . -name '*.res' -not -path './node_modules/*' | xargs wc -l 2>/dev/null | tail -1 | awk '{print $1}')"
177+ @ echo " Forth: $(find . -name '*.fth' | xargs wc -l 2>/dev/null | tail -1 | awk '{print $1}')"
178+ @ echo " Rust: $(find . -name '*.rs' | xargs wc -l 2>/dev/null | tail -1 | awk '{print $1}')"
179+ @ echo " Nickel: $(find . -name '*.ncl' | xargs wc -l 2>/dev/null | tail -1 | awk '{print $1}')"
97180
98181# Show TODOs in the substrate
99182todos :
100- @ grep -rn " TODO\| FIXME" .
183+ @ grep -rn " TODO\| FIXME" --include=" *.res" --include=" *.rs" --include=" *.fth" --include=" *.ncl" . 2 >/ dev/ null || echo " No TODOs found"
184+
185+ # Clean build artifacts
186+ clean :
187+ @ echo " Cleaning build artifacts..."
188+ @ rm -rf dist/ node_modules/ .rescript/
189+ @ rm -rf src-tauri/ target/
190+ @ rm -f kernel/ data.fth test.bin
191+ @ echo " Clean complete"
192+
193+ # Format all code
194+ fmt :
195+ @ echo " Formatting code..."
196+ @ deno run -A npm:rescript format src/ *.res
197+ @ cd src-tauri && cargo fmt
198+ @ echo " Format complete"
199+
200+ # Check types without building
201+ check :
202+ @ echo " Type checking..."
203+ @ deno run -A npm:rescript build -- -warn-error + a
204+ @ cd src-tauri && cargo check
205+ @ echo " Type check complete"
0 commit comments