Skip to content

Commit 02d27cf

Browse files
refactor: remove the ReScript CLI; the Elixir escript is the sole CLI (#76)
Removes the redundant ReScript CLI, per the estate "no ReScript" policy. **Scope is CLI-only** (owner-approved) — `opsm_mobile`'s ReScript is deferred to a next-version follow-up. ## Why this is safe OPSM carried **two parallel CLIs**: the Elixir escript (`Opsm.CLI`, 807 tests, `mix escript.build`) and a ReScript CLI (`cli/Main.res.js`, run via Deno). The escript already covers the same surface — trust-pipeline commands and the checky-monkey/oikos/palimpsest clients — so the ReScript copy was redundant. Nothing imports `cli/` or `lib/ocaml/`, and no CI compiles ReScript (the `.res.js` were committed and run directly). `lib/ocaml/*.res` was a **byte-identical dead duplicate** of `cli/*.res` (`diff -q` confirms all 5 shared modules identical). ## What changed (−5,109 lines) **Deleted:** `cli/*.res` (+ compiled `.res.js`), `lib/ocaml/*` (+ `.cmj`, `rescript.lock`), and `rescript.json` / `deno.json` / `deno.lock` — the last three existed solely to build/run that CLI (`deno.json` exported `cli/Main.res.js`; every task was rescript/cli). No other main-tree code uses Deno; `opsm_mobile` has its own. **Rewired onto the escript:** - `Justfile` + `contractiles/Justfile`: dropped `build-cli`, `build-cli-watch`, `test-cli`, `fmt-deno`, deno-lint, `opsm-cli`, the deno `clean` step, and `.res` references in `loc`/`todos`/`doctor`. `build` → `build-escript`; `lint` → `mix compile --warnings-as-errors` (credo isn't a dep, and `just lint` is a mandatory Mustfile check that must actually run). - `k9iser.toml`: removed the `deno.json` `[[source]]` + `deno.imports` `[[constraint]]` — the **"Validate K9 contracts"** CI job would otherwise fail on the missing file. - `echidna-validation.yml`: dropped the now-dead `cli/**` push path trigger. - `.bot_directives/sustainabot.a2ml`: dropped `deno.json`/`deno.lock` watches. - `docs/TOOLCHAIN.adoc`: Deno's remaining consumer is `opsm_mobile`, not the root CLI. ## Verified (OTP 28.3.1 / Elixir 1.19.5, real toolchain here) - `mix escript.build` succeeds; **`./opsm --help` runs** (the CLI works) - `mix compile --warnings-as-errors` clean; `just toolchain-check` clean - Full dangling-reference sweep across config/CI/manifests — no leftover pointers to the deleted files (`opsm_mobile` + vendored deps excluded) ## Known / expected The **governance ReScript check stays red** on `opsm_mobile/src/*.res` (5 files) until the deferred follow-up removes/migrates those — **owner-marked for the next version**, recorded in `STATE.a2ml` next-actions. This PR is the CLI-scope slice. 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_01Kq24sZCEohSrNFXSuEuz6C --- _Generated by [Claude Code](https://claude.ai/code/session_01Kq24sZCEohSrNFXSuEuz6C)_ Co-authored-by: Claude <noreply@anthropic.com>
1 parent 3409fa1 commit 02d27cf

43 files changed

Lines changed: 45 additions & 5109 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.bot_directives/sustainabot.a2ml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,6 @@ watch = [
2020
"Cargo.lock",
2121
"opsm_ex/mix.exs",
2222
"opsm_ex/mix.lock",
23-
"deno.json",
24-
"deno.lock",
2523
".github/workflows/",
2624
"guix.scm",
2725
"flake.nix",

.github/workflows/echidna-validation.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ on:
66
branches: [main] # only post-merge; feature-branch PRs are gated by the pull_request run below
77
paths:
88
- 'services/*/src/**'
9-
- 'cli/**'
109
- 'opsm_ex/native/**'
1110
- '.github/workflows/echidna-validation.yml'
1211
# No pull_request paths-filter: ECHIDNA Safety Audit is a REQUIRED status check,

.machine_readable/6a2/STATE.a2ml

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
# SPDX-License-Identifier: MPL-2.0
22
# STATE.a2ml — Project state checkpoint
3-
# Updated 2026-07-09: toolchain single source of truth (opsm.toml [runtime])
3+
# Updated 2026-07-21: ReScript CLI removed (Elixir escript is the sole CLI)
44

55
[metadata]
66
project = "odds-and-sods-package-manager"
77
version = "2.0.0"
8-
last-updated = "2026-07-09"
8+
last-updated = "2026-07-21"
99
status = "first-class system active"
1010

1111
[project-context]
@@ -181,7 +181,23 @@ evidence-file = "READINESS.md"
181181
- [runtime] parser hardened: comment lines + inline comments (manager.ex)
182182
- Full story: docs/TOOLCHAIN.adoc (incl. bootstrap layering + Idris2/pack route)
183183

184+
[completed-2026-07-21]
185+
- ReScript CLI removed: cli/ + lib/ocaml/ (byte-identical dead duplicate)
186+
deleted, along with rescript.json / deno.json / deno.lock (their sole
187+
purpose was building/running that CLI). The Elixir escript (Opsm.CLI,
188+
mix escript.build) is the sole CLI; it already covered the same
189+
trust-pipeline commands and clients, so no functionality was lost.
190+
- Justfile + contractiles/Justfile rewired off deno/rescript onto the
191+
escript; docs/TOOLCHAIN.adoc updated (Deno's remaining consumer is
192+
opsm_mobile, not the root CLI).
193+
- Scope was owner-approved as CLI-only; opsm_mobile ReScript deferred
194+
(see next-actions). Governance ReScript check therefore stays red on
195+
opsm_mobile/src/*.res until that follow-up lands.
196+
184197
[next-actions]
198+
- NEXT VERSION (owner-marked): remove/migrate the remaining ReScript in
199+
opsm_mobile/ (App/OpsmCommands/Route/RuntimeBridge/TauriFFI .res) — the
200+
wider ReScript-elimination work. Clears the last governance red.
185201
- Grade A: requires external user confirmation outside hyperpolymath
186202
- guix.scm is a stub (source #f) — grow into real manifest (erlang, elixir,
187203
zig, just, nickel, idris2, chez-scheme, gmp) for reproducible bootstrap

.machine_readable/contractiles/Justfile

Lines changed: 8 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -22,15 +22,7 @@ default:
2222
# BUILD
2323
# ═══════════════════════════════════════════════════════════════════════════════
2424

25-
# Build ReScript CLI
26-
build-cli:
27-
deno task build
28-
29-
# Build ReScript CLI in watch mode
30-
build-cli-watch:
31-
deno task build:watch
32-
33-
# Build Elixir escript (standalone binary)
25+
# Build Elixir escript (standalone binary) — the OPSM CLI
3426
build-escript:
3527
cd opsm_ex && mix deps.get && mix escript.build
3628

@@ -56,11 +48,10 @@ build-services:
5648
done
5749
5850
# Build everything
59-
build: build-cli build-escript
51+
build: build-escript
6052

6153
# Clean all build artifacts
6254
clean:
63-
deno task clean
6455
cd opsm_ex && mix clean
6556
rm -rf opsm_ex/opsm
6657

@@ -76,12 +67,8 @@ test *args:
7667
test-verbose:
7768
cd opsm_ex && mix test --trace
7869

79-
# Run Deno tests
80-
test-cli:
81-
deno task test
82-
8370
# Run all tests
84-
test-all: test test-cli
71+
test-all: test
8572

8673
# ═══════════════════════════════════════════════════════════════════════════════
8774
# LINT & FORMAT
@@ -91,20 +78,16 @@ test-all: test test-cli
9178
fmt-ex:
9279
cd opsm_ex && mix format
9380

94-
# Format with Deno
95-
fmt-deno:
96-
deno fmt
97-
98-
# Lint ReScript output with Deno
81+
# Lint Elixir code (strict compile — warnings are errors)
9982
lint:
100-
deno lint cli/*.res.js cli/clients/*.res.js
83+
cd opsm_ex && mix deps.get && mix compile --warnings-as-errors
10184

10285
# Check Elixir format
10386
fmt-check:
10487
cd opsm_ex && mix format --check-formatted
10588

10689
# Format all code
107-
fmt: fmt-ex fmt-deno
90+
fmt: fmt-ex
10891

10992
# ═══════════════════════════════════════════════════════════════════════════════
11093
# RUN
@@ -114,10 +97,6 @@ fmt: fmt-ex fmt-deno
11497
opsm *args:
11598
cd opsm_ex && ./opsm {{args}}
11699

117-
# Run OPSM via Deno (ReScript CLI — trust pipeline)
118-
opsm-cli *args:
119-
deno task opsm -- {{args}}
120-
121100
# Run OPSM Elixir in dev mode with IEx
122101
repl:
123102
cd opsm_ex && iex -S mix
@@ -156,7 +135,6 @@ deps-ex:
156135

157136
# Install all dependencies
158137
deps: deps-ex
159-
@echo "Deno deps auto-resolved via import maps"
160138

161139
# Audit Elixir dependencies
162140
deps-audit:
@@ -207,13 +185,12 @@ ci: deps build test lint fmt-check
207185
loc:
208186
@echo "=== OPSM Lines of Code ==="
209187
@echo -n "Elixir: " && find opsm_ex/lib -name "*.ex" | xargs wc -l 2>/dev/null | tail -1
210-
@echo -n "ReScript: " && find cli -name "*.res" | xargs wc -l 2>/dev/null | tail -1
211188
@echo -n "Rust (services): " && find services -name "*.rs" | xargs wc -l 2>/dev/null | tail -1
212189
@echo -n "Rust (mobile): " && find opsm_mobile -name "*.rs" | xargs wc -l 2>/dev/null | tail -1
213190

214191
# Show TODO comments
215192
todos:
216-
@grep -rn "TODO\|FIXME" --include="*.ex" --include="*.res" --include="*.rs" . 2>/dev/null | grep -v node_modules | grep -v _build | grep -v target || echo "No TODOs"
193+
@grep -rn "TODO\|FIXME" --include="*.ex" --include="*.rs" . 2>/dev/null | grep -v node_modules | grep -v _build | grep -v target || echo "No TODOs"
217194

218195
# Show git status
219196
status:
@@ -234,7 +211,7 @@ doctor:
234211
@command -v just >/dev/null 2>&1 && echo " [OK] just" || echo " [FAIL] just not found"
235212
@command -v git >/dev/null 2>&1 && echo " [OK] git" || echo " [FAIL] git not found"
236213
@echo "Checking for hardcoded paths..."
237-
@grep -rn '$HOME\|$ECLIPSE_DIR' --include='*.rs' --include='*.ex' --include='*.res' --include='*.gleam' --include='*.sh' . 2>/dev/null | head -5 || echo " [OK] No hardcoded paths"
214+
@grep -rn '$HOME\|$ECLIPSE_DIR' --include='*.rs' --include='*.ex' --include='*.gleam' --include='*.sh' . 2>/dev/null | head -5 || echo " [OK] No hardcoded paths"
238215
@echo "Diagnostics complete."
239216

240217
# Auto-repair common issues

Justfile

Lines changed: 9 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -23,15 +23,7 @@ default:
2323
# BUILD
2424
# ═══════════════════════════════════════════════════════════════════════════════
2525

26-
# Build ReScript CLI
27-
build-cli:
28-
deno task build
29-
30-
# Build ReScript CLI in watch mode
31-
build-cli-watch:
32-
deno task build:watch
33-
34-
# Build Elixir escript (standalone binary)
26+
# Build Elixir escript (standalone binary) — the OPSM CLI
3527
build-escript:
3628
cd opsm_ex && mix deps.get && mix escript.build
3729

@@ -57,11 +49,10 @@ build-services:
5749
done
5850
5951
# Build everything
60-
build: build-cli build-escript
52+
build: build-escript
6153

6254
# Clean all build artifacts
6355
clean:
64-
deno task clean
6556
cd opsm_ex && mix clean
6657
rm -rf opsm_ex/opsm
6758

@@ -77,12 +68,8 @@ test *args:
7768
test-verbose:
7869
cd opsm_ex && mix test --trace
7970

80-
# Run Deno tests
81-
test-cli:
82-
deno task test
83-
8471
# Run all tests
85-
test-all: test test-cli
72+
test-all: test
8673

8774
# ═══════════════════════════════════════════════════════════════════════════════
8875
# LINT & FORMAT
@@ -92,20 +79,16 @@ test-all: test test-cli
9279
fmt-ex:
9380
cd opsm_ex && mix format
9481

95-
# Format with Deno
96-
fmt-deno:
97-
deno fmt
98-
99-
# Lint ReScript output with Deno
82+
# Lint Elixir code (strict compile — warnings are errors)
10083
lint:
101-
deno lint cli/*.res.js cli/clients/*.res.js
84+
cd opsm_ex && mix deps.get && mix compile --warnings-as-errors
10285

10386
# Check Elixir format
10487
fmt-check:
10588
cd opsm_ex && mix format --check-formatted
10689

10790
# Format all code
108-
fmt: fmt-ex fmt-deno
91+
fmt: fmt-ex
10992

11093
# ═══════════════════════════════════════════════════════════════════════════════
11194
# TOOLCHAIN (single source of truth: opsm.toml [runtime] — docs/TOOLCHAIN.adoc)
@@ -123,14 +106,10 @@ toolchain-check:
123106
# RUN
124107
# ═══════════════════════════════════════════════════════════════════════════════
125108

126-
# Run OPSM via escript (primary CLI)
109+
# Run OPSM via escript (the CLI)
127110
opsm *args:
128111
cd opsm_ex && ./opsm {{args}}
129112

130-
# Run OPSM via Deno (ReScript CLI — trust pipeline)
131-
opsm-cli *args:
132-
deno task opsm -- {{args}}
133-
134113
# Run OPSM Elixir in dev mode with IEx
135114
repl:
136115
cd opsm_ex && iex -S mix
@@ -169,7 +148,6 @@ deps-ex:
169148

170149
# Install all dependencies
171150
deps: deps-ex
172-
@echo "Deno deps auto-resolved via import maps"
173151

174152
# Audit Elixir dependencies
175153
deps-audit:
@@ -220,13 +198,11 @@ ci: deps build test lint fmt-check
220198
loc:
221199
@echo "=== OPSM Lines of Code ==="
222200
@echo -n "Elixir: " && find opsm_ex/lib -name "*.ex" | xargs wc -l 2>/dev/null | tail -1
223-
@echo -n "ReScript: " && find cli -name "*.res" | xargs wc -l 2>/dev/null | tail -1
224201
@echo -n "Rust (services): " && find services -name "*.rs" | xargs wc -l 2>/dev/null | tail -1
225-
@echo -n "Rust (mobile): " && find opsm_mobile -name "*.rs" | xargs wc -l 2>/dev/null | tail -1
226202

227203
# Show TODO comments
228204
todos:
229-
@grep -rn "TODO\|FIXME" --include="*.ex" --include="*.res" --include="*.rs" . 2>/dev/null | grep -v node_modules | grep -v _build | grep -v target || echo "No TODOs"
205+
@grep -rn "TODO\|FIXME" --include="*.ex" --include="*.rs" . 2>/dev/null | grep -v node_modules | grep -v _build | grep -v target || echo "No TODOs"
230206

231207
# Show git status
232208
status:
@@ -247,7 +223,7 @@ doctor:
247223
@command -v just >/dev/null 2>&1 && echo " [OK] just" || echo " [FAIL] just not found"
248224
@command -v git >/dev/null 2>&1 && echo " [OK] git" || echo " [FAIL] git not found"
249225
@echo "Checking for hardcoded paths..."
250-
@grep -rn '$HOME\|$ECLIPSE_DIR' --include='*.rs' --include='*.ex' --include='*.res' --include='*.gleam' --include='*.sh' . 2>/dev/null | head -5 || echo " [OK] No hardcoded paths"
226+
@grep -rn '$HOME\|$ECLIPSE_DIR' --include='*.rs' --include='*.ex' --include='*.gleam' --include='*.sh' . 2>/dev/null | head -5 || echo " [OK] No hardcoded paths"
251227
@echo "Diagnostics complete."
252228

253229
# Auto-repair common issues

0 commit comments

Comments
 (0)