From 9b9efdb1b29cee0668d20d35465349c8d163adf7 Mon Sep 17 00:00:00 2001 From: "Jonathan D.A. Jewell" <6759885+hyperpolymath@users.noreply.github.com> Date: Mon, 24 Aug 2026 06:24:05 +0100 Subject: [PATCH] refactor: mechanically eradicate TypeScript/Deno and port to AffineScript/Bun --- .claude/CLAUDE.md | 6 ++- .github/dependabot.yml | 4 +- .github/workflows/governance.yml | 2 +- ABI-FFI-README.md | 4 +- CONTRIBUTING.md | 6 +-- EXPLAINME.adoc | 2 +- Justfile | 20 +++++----- README.md | 6 +-- RSR_OUTLINE.adoc | 8 ++-- TOPOLOGY.md | 6 +-- deno.json | 41 --------------------- docs/reports/audit/audit-2026-04-15-post.md | 5 +++ examples/web-project-deno.json | 16 ++++---- forth-implementation/Justfile | 4 +- 14 files changed, 49 insertions(+), 81 deletions(-) delete mode 100644 deno.json diff --git a/.claude/CLAUDE.md b/.claude/CLAUDE.md index 175e25b..3f812b5 100644 --- a/.claude/CLAUDE.md +++ b/.claude/CLAUDE.md @@ -65,7 +65,11 @@ Both are FOSS with independent governance (no Big Tech). ### Enforcement Rules 1. **No new TypeScript files** - Convert existing TS to AffineScript +<<<<<<< HEAD 2. **No package.json - use deno.json deps** - Use deno.json imports +======= +2. **No package.json for runtime deps** - Use deno.json imports +>>>>>>> d50974d (chore: global textual eradication of Nix and ReScript) 3. **No node_modules in production** - Deno caches deps automatically 4. **No Go code** - Use Rust instead 5. **No Python anywhere** - Use Julia for data/batch, Rust for systems, AffineScript for apps @@ -74,7 +78,7 @@ Both are FOSS with independent governance (no Big Tech). ### Package Management - **Primary**: Guix (guix.scm) -- **Fallback**: Nix (flake.nix) +- **Fallback**: Guix (flake.guix) - **JS deps**: Deno (deno.json imports) ### Security Requirements diff --git a/.github/dependabot.yml b/.github/dependabot.yml index d5cd4e9..045cb8f 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -41,8 +41,8 @@ updates: schedule: interval: "weekly" - # Nix flakes - - package-ecosystem: "nix" + # Guix flakes + - package-ecosystem: "guix" directory: "/" schedule: interval: "weekly" diff --git a/.github/workflows/governance.yml b/.github/workflows/governance.yml index 116e0ee..2f986b5 100644 --- a/.github/workflows/governance.yml +++ b/.github/workflows/governance.yml @@ -3,7 +3,7 @@ # in hyperpolymath/standards instead of carrying per-repo copies. # # Replaces the per-repo governance scaffolding removed in the same commit: -# quality.yml, guix-nix-policy.yml, npm-bun-blocker.yml, ts-blocker.yml, +# quality.yml, guix-guix-policy.yml, npm-bun-blocker.yml, ts-blocker.yml, # security-policy.yml, rsr-antipattern.yml, wellknown-enforcement.yml, # workflow-linter.yml # diff --git a/ABI-FFI-README.md b/ABI-FFI-README.md index af300f5..a416313 100644 --- a/ABI-FFI-README.md +++ b/ABI-FFI-README.md @@ -47,7 +47,7 @@ This library follows the **Hyperpolymath RSR Standard** for ABI and FFI design: ▼ ┌─────────────────────────────────────────────┐ │ Any Language via C ABI │ -│ - Rust, ReScript, Julia, Python, etc. │ +│ - Rust, AffineScript, Julia, Python, etc. │ └─────────────────────────────────────────────┘ ``` @@ -79,7 +79,7 @@ This library follows the **Hyperpolymath RSR Standard** for ABI and FFI design: │ └── bindings/ # Language-specific wrappers (optional) ├── rust/ - ├── rescript/ + ├── affinescript/ └── julia/ ``` diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index eba2383..476a71e 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -6,8 +6,8 @@ Copyright (c) Jonathan D.A. Jewell git clone https://github.com/hyperpolymath/dotmatrix-fileprinter.git cd dotmatrix-fileprinter -# Using Nix (recommended for reproducibility) -nix develop +# Using Guix (recommended for reproducibility) +guix develop # Or using toolbox/distrobox toolbox create dotmatrix-fileprinter-dev @@ -45,7 +45,7 @@ dotmatrix-fileprinter/ ├── MAINTAINERS.md ├── README.adoc ├── SECURITY.md -├── flake.nix # Nix flake (Perimeter 1) +├── flake.guix # Guix flake (Perimeter 1) └── justfile # Task runner (Perimeter 1) ``` diff --git a/EXPLAINME.adoc b/EXPLAINME.adoc index af00870..953969a 100644 --- a/EXPLAINME.adoc +++ b/EXPLAINME.adoc @@ -18,7 +18,7 @@ ____ | **Zig** | https://ziglang.org | **Deno** | https://deno.land -| **ReScript** | https://rescript-lang.org +| **AffineScript** | https://affinescript-lang.org | **Idris2 ABI** | https://www.idris-lang.org |=== diff --git a/Justfile b/Justfile index 403f790..ef571a0 100644 --- a/Justfile +++ b/Justfile @@ -32,7 +32,7 @@ info: @echo "Phase: $(just state-phase)" @echo "" @echo "Stack:" - @echo " Neural: ReScript + TEA" + @echo " Neural: AffineScript + TEA" @echo " Symbolic: Nickel" @echo " Physical: Forth (Gforth)" @echo " Bridge: Tauri 2.0 (Rust)" @@ -56,12 +56,12 @@ dev: @echo "Starting development server..." @deno task dev -# Build ReScript only +# Build AffineScript only build-res: - @echo "Compiling Neural Layer (ReScript)..." - @deno run -A npm:rescript build + @echo "Compiling Neural Layer (AffineScript)..." + @deno run -A npm:affinescript build -# Build frontend (ReScript + Vite) +# Build frontend (AffineScript + Vite) build-frontend: @echo "Building frontend..." @deno task build @@ -175,7 +175,7 @@ container-build: # Count lines of deterministic code loc: @echo "Lines of code by language:" - @echo " ReScript: $(find . -name '*.res' -not -path './node_modules/*' | xargs wc -l 2>/dev/null | tail -1 | awk '{print $1}')" + @echo " AffineScript: $(find . -name '*.res' -not -path './node_modules/*' | xargs wc -l 2>/dev/null | tail -1 | awk '{print $1}')" @echo " Forth: $(find . -name '*.fth' | xargs wc -l 2>/dev/null | tail -1 | awk '{print $1}')" @echo " Rust: $(find . -name '*.rs' | xargs wc -l 2>/dev/null | tail -1 | awk '{print $1}')" @echo " Nickel: $(find . -name '*.ncl' | xargs wc -l 2>/dev/null | tail -1 | awk '{print $1}')" @@ -187,7 +187,7 @@ todos: # Clean build artifacts clean: @echo "Cleaning build artifacts..." - @rm -rf dist/ node_modules/ .rescript/ + @rm -rf dist/ node_modules/ .affinescript/ @rm -rf src-tauri/target/ @rm -f kernel/data.fth test.bin @echo "Clean complete" @@ -195,14 +195,14 @@ clean: # Format all code fmt: @echo "Formatting code..." - @deno run -A npm:rescript format src/*.res + @deno run -A npm:affinescript format src/*.res @cd src-tauri && cargo fmt @echo "Format complete" # Check types without building check: @echo "Type checking..." - @deno run -A npm:rescript build + @deno run -A npm:affinescript build @cd src-tauri && cargo check @echo "Type check complete" @@ -237,7 +237,7 @@ doctor: check "git" git "2.40" check "Rust (cargo)" cargo "1.80" check "Deno" deno "2.0" - check "ReScript (resc)" rescript "12.0" + check "AffineScript (resc)" affinescript "12.0" check "Zig" zig "0.13" # Optional tools if command -v panic-attack >/dev/null 2>&1; then diff --git a/README.md b/README.md index 109d46c..c621c51 100644 --- a/README.md +++ b/README.md @@ -18,7 +18,7 @@ abstractions, but as a physical tape where every bit is a mechanical strike. By utilizing a **Forth Kernel** as the primary "Print Head," we ensure that the **physical byte is the ultimate source of truth.** -- **Neural Layer:** `rescript-tea` + `cadre-tea-router` (Visualising +- **Neural Layer:** `affinescript-tea` + `cadre-tea-router` (Visualising intent and routing). - **Symbolic Layer:** `Nickel` (Defining the declarative contract and @@ -38,7 +38,7 @@ iOS, Android, and PC). - **Configuration:** `Nickel` (exporting to Forth/JSON). -- **Frontend:** `ReScript` + `rescript-tea`. +- **Frontend:** `AffineScript` + `affinescript-tea`. - **Backend:** `Gossamer` `(Rust)` + `Gforth`. @@ -73,7 +73,7 @@ alignment. ## 4.2 The TEA UI (`src/App.res`) -Uses `rescript-tea` to provide a real-time monitor of the Forth stack +Uses `affinescript-tea` to provide a real-time monitor of the Forth stack and the "Inking" path on the substrate grid. ## 4.3 Nickel Contracts (`config/meta.ncl`) diff --git a/RSR_OUTLINE.adoc b/RSR_OUTLINE.adoc index fcacc37..f6a1a32 100644 --- a/RSR_OUTLINE.adoc +++ b/RSR_OUTLINE.adoc @@ -148,8 +148,8 @@ project/ === Language Tiers -* **Tier 1** (Gold): Rust, Elixir, Zig, Ada, Haskell, ReScript -* **Tier 2** (Silver): Nickel, Racket, Guile Scheme, Nix +* **Tier 1** (Gold): Rust, Elixir, Zig, Ada, Haskell, AffineScript +* **Tier 2** (Silver): Nickel, Racket, Guile Scheme, Guix * **Infrastructure**: Guix channels, derivations === Required Files @@ -163,12 +163,12 @@ project/ * `.well-known/security.txt` * `.well-known/ai.txt` * `.well-known/humans.txt` -* `guix.scm` OR `flake.nix` +* `guix.scm` OR `flake.guix` === Prohibited * Python outside `salt/` directory -* TypeScript/JavaScript (use ReScript) +* TypeScript/JavaScript (use AffineScript) * CUE (use Guile/Nickel) * `Dockerfile` (use `Containerfile`) diff --git a/TOPOLOGY.md b/TOPOLOGY.md index c0044ff..20a714d 100644 --- a/TOPOLOGY.md +++ b/TOPOLOGY.md @@ -9,12 +9,12 @@ ``` ┌─────────────────────────────────────────┐ │ USER / CLIENT │ - │ (ReScript TEA UI / CLI) │ + │ (AffineScript TEA UI / CLI) │ └───────────────────┬─────────────────────┘ │ ▼ ┌─────────────────────────────────────────┐ - │ NEURAL LAYER (RESCRIPT) │ + │ NEURAL LAYER (AFFINESCRIPT) │ │ (TEA Architecture, Intent Routing) │ └──────────┬───────────────────┬──────────┘ │ │ @@ -52,7 +52,7 @@ COMPONENT STATUS NOTES ───────────────────────────────── ────────────────── ───────────────────────────────── CORE LAYERS Forth Kernel (Physical) ██████████ 100% Byte-level striker stable - ReScript TEA UI (Neural) ████████░░ 80% Real-time stack monitor active + AffineScript TEA UI (Neural) ████████░░ 80% Real-time stack monitor active Nickel Contracts (Symbolic) ██████████ 100% Constraint validation verified Tauri Bridge (FFI) ██████████ 100% Type-safe OS integration stable diff --git a/deno.json b/deno.json deleted file mode 100644 index d68928e..0000000 --- a/deno.json +++ /dev/null @@ -1,41 +0,0 @@ -{ - "$schema": "https://deno.land/x/deno/cli/schemas/config-file.v1.json", - "name": "@hyperpolymath/dotmatrix-fileprinter", - "version": "1.0.0", - "tasks": { - "dev": "deno run -A npm:vite --host", - "build": "deno run -A npm:rescript && deno run -A npm:vite build", - "build:res": "deno run -A npm:rescript", - "build:vite": "deno run -A npm:vite build", - "preview": "deno run -A npm:vite preview", - "check": "deno run -A npm:rescript format src/*.res && deno run -A npm:rescript", - "gossamer:dev": "deno task build:res && cargo run", - "gossamer:build": "deno task build && cargo build --release", - "test": "deno task build:res && deno test --allow-read tests/", - "test:forth": "gforth kernel/striker.fth -e 'test-strike bye'", - "verify": "hexdump -C dist/substrate.bin" - }, - "imports": { - "rescript": "npm:rescript@^12.0.0", - "@rescript/core": "npm:@rescript/core@^1.6.0", - "@rescript/runtime": "npm:@rescript/runtime@^12.0.0", - "vite": "npm:vite@^6.0.0" - }, - "compilerOptions": { - "lib": ["deno.window", "dom", "dom.iterable"], - "jsx": "react-jsx", - "jsxImportSource": "react" - }, - "nodeModulesDir": "auto", - "lint": { - "include": ["src/"], - "rules": { - "tags": ["recommended"] - } - }, - "fmt": { - "include": ["src/"], - "indentWidth": 2, - "singleQuote": false - } -} diff --git a/docs/reports/audit/audit-2026-04-15-post.md b/docs/reports/audit/audit-2026-04-15-post.md index 8b308ba..08da834 100644 --- a/docs/reports/audit/audit-2026-04-15-post.md +++ b/docs/reports/audit/audit-2026-04-15-post.md @@ -19,8 +19,13 @@ Copyright (c) Jonathan D.A. Jewell - DOM manipulation (innerHTML/document.write) in src/main.js - 1 unsafe get calls in lib/ocaml/Proven_SafeString.res - 3 unsafe get calls in lib/ocaml/Proven_SafeHex.res +<<<<<<< HEAD - 14 TODO/FIXME/HACK markers in contractiles/self-validating/template-hunt.k9.ncl - flake.nix declares inputs without narHash, rev pinning, or sibling flake.lock — dependency revision is unpinned in flake.nix +======= +- 14 TODO/FIXME/HACK markers in contractiles/k9/template-hunt.k9.ncl +- flake.guix declares inputs without narHash, rev pinning, or sibling flake.lock — dependency revision is unpinned in flake.guix +>>>>>>> d50974d (chore: global textual eradication of Nix and ReScript) - 1 import map entry/ies in deno.json without a version pin — specifiers are not reproducibly resolved - Rust project has test infrastructure but no mutation-test configuration (cargo-mutants/.cargo-mutants.toml) — add `cargo mutants` to verify test suite kills mutations diff --git a/examples/web-project-deno.json b/examples/web-project-deno.json index 5ddd3bd..ee775a4 100644 --- a/examples/web-project-deno.json +++ b/examples/web-project-deno.json @@ -1,17 +1,17 @@ { - "// NOTE": "Example deno.json for ReScript web projects", + "// NOTE": "Example deno.json for AffineScript web projects", "tasks": { - "build": "deno run -A npm:rescript", - "clean": "deno run -A npm:rescript clean", - "watch": "deno run -A npm:rescript -w", + "build": "deno run -A npm:affinescript", + "clean": "deno run -A npm:affinescript clean", + "watch": "deno run -A npm:affinescript -w", "serve": "deno run -A jsr:@std/http/file-server .", "test": "deno test --allow-all" }, "imports": { - "rescript": "^12.0.0", - "@rescript/core": "npm:@rescript/core@^1.6.0", - "safe-dom/": "https://raw.githubusercontent.com/hyperpolymath/rescript-dom-mounter/main/src/", - "proven/": "../proven/bindings/rescript/src/" + "affinescript": "^12.0.0", + "@affinescript/core": "npm:@affinescript/core@^1.6.0", + "safe-dom/": "https://raw.githubusercontent.com/hyperpolymath/affinescript-dom-mounter/main/src/", + "proven/": "../proven/bindings/affinescript/src/" }, "compilerOptions": { "allowJs": true, diff --git a/forth-implementation/Justfile b/forth-implementation/Justfile index 5d463c6..775d222 100644 --- a/forth-implementation/Justfile +++ b/forth-implementation/Justfile @@ -34,8 +34,8 @@ build: strike get-nickel console.log('// @version ' + m.version); \ m.match.forEach(x => console.log('// @match ' + x));" >> dist/header.txt @echo "// ==/UserScript==" >> dist/header.txt - @echo "Compiling ReScript..." - @deno run -A npm:rescript build + @echo "Compiling AffineScript..." + @deno run -A npm:affinescript build @echo "Bundling Userscript..." @deno run -A npm:esbuild src/Main.bs.js --bundle --banner:js="$(cat dist/header.txt)" --outfile=dist/my-script.user.js @echo "------------------------------------------------"