Skip to content

Migrate ReScript → AffineScript; drop vendored BuckleScript .ast artifacts #33

@hyperpolymath

Description

@hyperpolymath

Context

ReScript is being banned in favour of AffineScript. This is a large, multi-stage epic — deliberately not bundled into the V-removal PR (#30).

Stage 1 is DONE (PR #34, merged f256bd2): the 248 vendored BuckleScript build artifacts under gui/lib/rescript-{d3,webapi}/lib/{bs,ocaml}/ were untracked (already .gitignored, committed pre-ignore). No source impact.

The remainder is blocked on standing up the AffineScript toolchain, planned below.


Toolchain facts (confirmed in-repo)

  • The AffineScript compiler is OCaml-based and lives in a separate ecosystem repo (hyperpolymath/affinescript, per ROADMAP.adoc and the OCaml | AffineScript compiler row in every .claude/CLAUDE.md). It is not vendored in reposystem and there are currently no .ml/AffineScript sources here.
  • rsr-antipattern.yml's failure message points migrators at Human_Programming_Guide.adoc → "Migrating from -script Languages". That guide does not exist in reposystem — confirm whether it lives in hyperpolymath/affinescript or a docs repo, or write it.

First-party ReScript footprint to port (~90 files, .res/.resi, excl. vendored gui/lib/)

  • recon-silly-ation/ (src+tests) ~32
  • gui/src/ (incl. bindings/, modules/) ~18
  • forge-ops/src/ (components/core/model/modules/commands) ~14
  • tools/dispatcher/src/ (engine/executors/validators/cli/types) ~10
  • tools/hud/frontend/src/ ~4
  • scattered examples/ (bitfuckit, contractiles, scaffoldia/repo-batcher) — likely delete, not port
  • Vendored libs (gui/lib/rescript-tea, rescript-webapi, rescript-d3): decide replace vs. drop (a consumer of gui/src decision).

Stage 2 — Toolchain bring-up (unblocks everything)

  • Confirm AffineScript repo name/location and a pinned release/commit to depend on.
  • Add AffineScript compiler as a pinned dependency via Guix (guix.scm) primary + Nix (flake.nix) fallback — matching the repo's existing dependency model. SHA-pinned per security policy.
  • Add a minimal hello.affs (or canonical extension — confirm) build target proving the toolchain compiles in the dev shell and in CI.
  • New CI workflow affinescript-build.yml (push/PR), SHA-pinned actions, permissions: read-all, mirroring the existing e2e.yml/rust-ci.yml conventions.
  • Locate or author the "Migrating from -script Languages" guide referenced by antipattern CI.

Stage 3 — Port first-party ReScript module-by-module

Order by isolation (fewest cross-deps first), one PR per module, tests green at each step:

  • tools/dispatcher (most self-contained)
  • forge-ops/src
  • tools/hud/frontend/src
  • gui/src (+ resolve vendored rescript-tea/webapi/d3 dependency)
  • recon-silly-ation (largest; src + tests together)
  • Delete *.res example files rather than porting (confirm none are referenced).

Stage 4 — Flip policy + enforce

  • Move ReScript ALLOWED→BANNED and AffineScript→ALLOWED in all .claude/CLAUDE.md files (15+ copies across subprojects — must be consistent or antipattern parsing diverges).
  • Add a .res/.resi blocker to rsr-antipattern.yml (mirror the TypeScript check + exemption-table mechanism).
  • Remove ReScript from dependabot.yml/build configs where applicable.
  • Drop the now-unused vendored gui/lib/rescript-* trees.

Open questions (need answers before Stage 2 can start)

  1. Canonical AffineScript source file extension(s)? (antipattern output says "AffineScript" but not the extension.)
  2. AffineScript repo: exact name, and is there a released/pinnable artifact or must it be built from source in CI?
  3. Does the "Migrating from -script Languages" guide exist anywhere, or is authoring it part of this epic?

Blocked on Q1–Q3; once answered, Stage 2 is concrete and actionable.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions