|
| 1 | +// SPDX-License-Identifier: PMPL-1.0-or-later |
| 2 | +// Copyright (c) 2026 Jonathan D.A. Jewell (hyperpolymath) <j.d.a.jewell@open.ac.uk> |
| 3 | += rescript-ecosystem — Consolidation Migration Record |
| 4 | +:toc: |
| 5 | + |
| 6 | +== Status |
| 7 | + |
| 8 | +Estate language policy: RS/TS/JS → AffineScript → typed-wasm. This |
| 9 | +monorepo is the **structural consolidation target** for scattered |
| 10 | +hyperpolymath ReScript (estate handover Item #12). It is *distinct* from: |
| 11 | + |
| 12 | +* The CI-text guidance sweep (handover Item 9 — complete 2026-05-17). |
| 13 | +* The ReScript→AffineScript port (Epic #7 / Item #8) — blocked on |
| 14 | + `affinescript#61–64`. **Do not hand-port ReScript ahead of the |
| 15 | + compiler.** |
| 16 | + |
| 17 | +== Mechanism (authoritative, ruled 2026-05-17) |
| 18 | + |
| 19 | +**In-tree, history-preserving relocation. NOT git submodules.** |
| 20 | + |
| 21 | +A prior session left a half-finished submodule approach: five |
| 22 | +`rescript-ecosystem/*` stanzas in the parent `developer-ecosystem` |
| 23 | +`.gitmodules` that did *not* correspond to gitlinks (the directories were |
| 24 | +already tracked in-tree, git mode `100644`, with empty |
| 25 | +`git submodule status`). Those orphan stanzas have been removed; the |
| 26 | +directories remain in-tree content. This is the canonical mechanism going |
| 27 | +forward, mirroring the `v-ecosystem` precedent. |
| 28 | + |
| 29 | +Per policy `reference-rescript-ecosystem-policy`: |
| 30 | + |
| 31 | +* Per-repo move; **delete from source only after the add here is |
| 32 | + merged/verified** (reversible until merge). |
| 33 | +* Preserve FFI / proven adapters *outside* the aggregate as |
| 34 | + `connectors/` (see link:connectors/README.adoc[]). |
| 35 | +* Footgun: never bare-delete a source tree without moving it. |
| 36 | + |
| 37 | +== Physical state (2026-05-17) |
| 38 | + |
| 39 | +Consolidation is **partial**. ~6,361 real `.res` files present. |
| 40 | + |
| 41 | +[cols="2,1,3"] |
| 42 | +|=== |
| 43 | +| Location | `.res` | Note |
| 44 | + |
| 45 | +| `rescript/` (top-level) | 2985 | Largest; not yet grouped |
| 46 | +| `idaptik-rescript13-staging/` | 176 | Top-level staging |
| 47 | +| `cadre-router/` | 54 | Top-level |
| 48 | +| `rescript-tea/` (top-level) | 27 | **Duplicated** vs `packages/web/tea` (14) — reconcile |
| 49 | +| `rescript-evangeliser/` + `packages/tooling/evangeliser/` | 14+14 | **Duplicated** — reconcile |
| 50 | +| `packages/core/poly-core` | 7 | Populated |
| 51 | +| `packages/web/full-stack`, `packages/bindings/postgres`, `ppx-proven-record/`, `rescript-deno-starter/`, `rescript-vite-config/` | 0 | Empty scaffolds awaiting source |
| 52 | +|=== |
| 53 | + |
| 54 | +Open structural debt: dedupe top-level packages into `packages/<group>/`; |
| 55 | +populate or remove the empty scaffolds; resolve the README target-vs-actual |
| 56 | +gap (README now flagged as target layout, not completed state). |
| 57 | + |
| 58 | +== Package: rescript-tea (origin → target) |
| 59 | + |
| 60 | +*Origin:* https://github.com/hyperpolymath/rescript-tea (standalone repo, |
| 61 | +clean, on `main`, fully pushed). |
| 62 | +*Target:* `rescript-ecosystem/rescript-tea/` (in-tree, committed). |
| 63 | + |
| 64 | +This package is **left to this monorepo** as the canonical ReScript TEA |
| 65 | +home. Ongoing ReScript TEA work happens here, not in the standalone repo. |
| 66 | + |
| 67 | +=== Two-way divergence — RECONCILIATION REQUIRED (not done) |
| 68 | + |
| 69 | +The source repo and this copy diverged in **both** directions; neither is |
| 70 | +a superset. The standalone source repo has therefore **NOT** been retired |
| 71 | +(would be irreversible loss). No ReScript toolchain was available in the |
| 72 | +consolidating session to validate a semantic merge. |
| 73 | + |
| 74 | +Per-module divergence (lines, source ↔ here): |
| 75 | + |
| 76 | +[cols="2,1,1,3"] |
| 77 | +|=== |
| 78 | +| Module | source | here | Disposition |
| 79 | + |
| 80 | +| `src/Tea_Sub.{res,resi}` | 405/99 | 201/51 | source far ahead — needs merge review |
| 81 | +| `src/Tea_Http.{res,resi}` | 388 | 268 (`src/tea/`) | diverged — merge review |
| 82 | +| `src/Tea_Json.{res,resi}` | 354 | 362 | **here ahead** — keep here, port source deltas |
| 83 | +| `src/Tea_Html`, `Tea_App`, `Tea_Cmd`, `Tea`, `Tea_Test` | larger | smaller | diverged — per-module merge review |
| 84 | +| `src/Tea_Layout.{res,resi}` | present | ABSENT | **brought forward** (lossless, additive) |
| 85 | +| `test/Tea_Cmd_test.res`, `test/Tea_Json_test.res` | present | ABSENT | **brought forward** (validate vs canonical modules) |
| 86 | +| `examples/02_http/`, `examples/03_swot_dashboard/` | present | ABSENT | **brought forward** |
| 87 | +|=== |
| 88 | + |
| 89 | +This copy additionally carries ~18 Tea modules under `src/tea/` |
| 90 | +(Animationframe, Debug, Keyboard, Mouse, Render, Ssr, Svg, Time, Vdom, |
| 91 | +Window, …) that do not exist in the standalone source — i.e. this copy is |
| 92 | +the richer base for those. |
| 93 | + |
| 94 | +Source-only governance/metadata forms (`.machines_readable/6scm/*.scm`, |
| 95 | +old `.adoc` duplicates) are **intentionally not** carried forward — the |
| 96 | +canonical RSR/a2ml scaffold here supersedes them (SCM→a2ml policy). |
| 97 | + |
| 98 | +=== Exit criteria for retiring the standalone rescript-tea repo |
| 99 | + |
| 100 | +. Per-module semantic merge of the diverged `src/*` (toolchain-validated). |
| 101 | +. Brought-forward tests/examples compile against the canonical modules. |
| 102 | +. Resolve the `rescript-tea` ↔ `packages/web/tea` duplication. |
| 103 | +. Then, and only then: per-repo retirement of |
| 104 | + https://github.com/hyperpolymath/rescript-tea (reversible until that PR |
| 105 | + merges). |
| 106 | + |
| 107 | +== Go-forward: affinescript-tea |
| 108 | + |
| 109 | +Per estate policy, the **successor to rescript-tea is `affinescript-tea`** |
| 110 | +(an AffineScript TEA implementation), not continued ReScript TEA feature |
| 111 | +work. `affinescript-tea` does not yet exist and **must not be hand-ported |
| 112 | +now** — it is blocked on the same primitives as `gitbot-fleet#148`: |
| 113 | +`affinescript#61` (`Http.fetch`), `#62` (`Promise`), `#63` (`Json`), |
| 114 | +`#64` (`Dict`). `rescript-tea` here is the consolidated *legacy* base and |
| 115 | +the reference for the eventual mechanical port. See |
| 116 | +link:rescript-tea/SUCCESSOR.adoc[rescript-tea/SUCCESSOR.adoc]. |
| 117 | + |
| 118 | +== Next steps |
| 119 | + |
| 120 | +. Per-module reconcile + retire standalone `rescript-tea` (above). |
| 121 | +. Dedupe top-level packages into `packages/<group>/`; populate/remove |
| 122 | + empty scaffolds. |
| 123 | +. Continue per-repo consolidation of remaining scattered ReScript |
| 124 | + (estate: `repos` ~1838, `hyperpolymath-archive` 208, `reposystem` 78 |
| 125 | + `.res` — `gitbot-fleet` is **blocked by gitbot-fleet#148**, do not move). |
| 126 | +. Note: parent `developer-ecosystem/.gitmodules` still carries |
| 127 | + `v-ecosystem/*` stanzas with the same orphan pattern — out of scope |
| 128 | + here, flagged for the v-ecosystem owner. |
0 commit comments