Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 0 additions & 15 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -52,18 +52,3 @@
[submodule "v-ecosystem/v-rest"]
path = v-ecosystem/v-rest
url = git@github.com:hyperpolymath/v-rest.git
[submodule "rescript-ecosystem/rescript"]
path = rescript-ecosystem/rescript
url = git@github.com:hyperpolymath/rescript.git
[submodule "rescript-ecosystem/rescript-evangeliser"]
path = rescript-ecosystem/rescript-evangeliser
url = git@github.com:hyperpolymath/rescript-evangeliser.git
[submodule "rescript-ecosystem/rescript-tea"]
path = rescript-ecosystem/rescript-tea
url = git@github.com:hyperpolymath/rescript-tea.git
[submodule "rescript-ecosystem/rescript-string-power"]
path = rescript-ecosystem/rescript-string-power
url = git@github.com:hyperpolymath/rescript-string-power.git
[submodule "rescript-ecosystem/idaptik-rescript13-staging"]
path = rescript-ecosystem/idaptik-rescript13-staging
url = git@github.com:hyperpolymath/idaptik-rescript13-staging.git
155 changes: 155 additions & 0 deletions rescript-ecosystem/MIGRATION.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,155 @@
// SPDX-License-Identifier: PMPL-1.0-or-later
// Copyright (c) 2026 Jonathan D.A. Jewell (hyperpolymath) <j.d.a.jewell@open.ac.uk>
= rescript-ecosystem — Consolidation Migration Record
:toc:

== Status

Estate language policy: RS/TS/JS → AffineScript → typed-wasm. This
monorepo is the **structural consolidation target** for scattered
hyperpolymath ReScript (estate handover Item #12). It is *distinct* from:

* The CI-text guidance sweep (handover Item 9 — complete 2026-05-17).
* The ReScript→AffineScript port (Epic #7 / Item #8) — blocked on
`affinescript#61–64`. **Do not hand-port ReScript ahead of the
compiler.**

== Mechanism (authoritative, ruled 2026-05-17)

**In-tree, history-preserving relocation. NOT git submodules.**

A prior session left a half-finished submodule approach: five
`rescript-ecosystem/*` stanzas in the parent `developer-ecosystem`
`.gitmodules` that did *not* correspond to gitlinks (the directories were
already tracked in-tree, git mode `100644`, with empty
`git submodule status`). Those orphan stanzas have been removed; the
directories remain in-tree content. This is the canonical mechanism going
forward, mirroring the `v-ecosystem` precedent.

Per policy `reference-rescript-ecosystem-policy`:

* Per-repo move; **delete from source only after the add here is
merged/verified** (reversible until merge).
* Preserve FFI / proven adapters *outside* the aggregate as
`connectors/` (see link:connectors/README.adoc[]).
* Footgun: never bare-delete a source tree without moving it.

== Physical state (2026-05-17)

Consolidation is **partial**. ~6,361 real `.res` files present.

[cols="2,1,3"]
|===
| Location | `.res` | Note

| `rescript/` (top-level) | 2985 | Largest; not yet grouped
| `idaptik-rescript13-staging/` | 176 | Top-level staging
| `cadre-router/` | 54 | Top-level
| `rescript-tea/` (top-level) | 27 | **Duplicated** vs `packages/web/tea` (14) — reconcile
| `rescript-evangeliser/` + `packages/tooling/evangeliser/` | 14+14 | **Duplicated** — reconcile
| `packages/core/poly-core` | 7 | Populated
| `packages/web/full-stack`, `packages/bindings/postgres`, `ppx-proven-record/`, `rescript-deno-starter/`, `rescript-vite-config/` | 0 | Empty scaffolds awaiting source
|===

Open structural debt: dedupe top-level packages into `packages/<group>/`;
populate or remove the empty scaffolds; resolve the README target-vs-actual
gap (README now flagged as target layout, not completed state).

== Package: rescript-tea (origin → target)

*Origin:* https://github.com/hyperpolymath/rescript-tea (standalone repo,
clean, on `main`, fully pushed).
*Target:* `rescript-ecosystem/rescript-tea/` (in-tree, committed).

This package is **left to this monorepo** as the canonical ReScript TEA
home. Ongoing ReScript TEA work happens here, not in the standalone repo.

=== Two-way divergence — RECONCILIATION REQUIRED (not done)

The source repo and this copy diverged in **both** directions; neither is
a superset. The standalone source repo has therefore **NOT** been retired
(would be irreversible loss). No ReScript toolchain was available in the
consolidating session to validate a semantic merge.

Per-module divergence (lines, source ↔ here):

[cols="2,1,1,3"]
|===
| Module | source | here | Disposition

| `src/Tea_Sub.{res,resi}` | 405/99 | 201/51 | source far ahead — needs merge review
| `src/Tea_Http.{res,resi}` | 388 | 268 (`src/tea/`) | diverged — merge review
| `src/Tea_Json.{res,resi}` | 354 | 362 | **here ahead** — keep here, port source deltas
| `src/Tea_Html`, `Tea_App`, `Tea_Cmd`, `Tea`, `Tea_Test` | larger | smaller | diverged — per-module merge review
| `src/Tea_Layout.{res,resi}` | present | ABSENT | **brought forward** (lossless, additive)
| `test/Tea_Cmd_test.res`, `test/Tea_Json_test.res` | present | ABSENT | **brought forward** (validate vs canonical modules)
| `examples/02_http/`, `examples/03_swot_dashboard/` | present | ABSENT | **brought forward**
|===

This copy additionally carries ~18 Tea modules under `src/tea/`
(Animationframe, Debug, Keyboard, Mouse, Render, Ssr, Svg, Time, Vdom,
Window, …) that do not exist in the standalone source — i.e. this copy is
the richer base for those.

Source-only governance/metadata forms (`.machines_readable/6scm/*.scm`,
old `.adoc` duplicates) are **intentionally not** carried forward — the
canonical RSR/a2ml scaffold here supersedes them (SCM→a2ml policy).

=== Build validation (2026-05-17, ReScript 12.2.0 + @rescript/core 1.6.1)

Toolchain installed at `~/dev/tools/languages/rescript/current`
(PATH-per-use). Two **committed git merge-conflict markers** were found
and fixed (botched merge `992e4b4`): `rescript.json` and `package.json`
each had `<<<<<<< HEAD … ======= … >>>>>>>` blocks (HEAD = canonical
`src/tea` / `@rescript/core`; other = old flat `src` / `@rescript/react`).
Resolved to the canonical side. No `.res/.resi` carried conflict markers.

**Canonical package now builds green:** `rescript build` →
`Parsed 75 source files / Compiled 75 modules`, exit 0, sources
`[{"dir":"src/tea"}]`.

Brought-forward source-only content does **not** compile against the
canonical API and is preserved losslessly in
`rescript-tea/reconcile/` (NOT in `sources`), each with a concrete port
task — see `rescript-tea/reconcile/README.adoc`:

* `Tea_Layout.{res,resi}` (~750 LOC) — `ReactDOM`-coupled; canonical
package dropped `@rescript/react`. Port off ReactDOM.
* `test/Tea_{Cmd,Json}_test.res`, `examples/{02_http,03_swot_dashboard}`
— written against the standalone repo's diverged API
(`Tea_Json.decodeValue` absent here; `Tea_Cmd.batch` list-vs-array).

=== Exit criteria for retiring the standalone rescript-tea repo

. ✅ Canonical `src/tea` builds green (toolchain-validated).
. ✅ Config integrity defects (conflict markers) resolved.
. Port `reconcile/` items to the canonical API; empty that directory.
. Per-module semantic merge of the diverged `src/*` (e.g. `Tea_Sub`
405↔201) against the standalone source — needs side-by-side review.
. Resolve the `rescript-tea` ↔ `packages/web/tea` duplication.
. Then, and only then: per-repo retirement of
https://github.com/hyperpolymath/rescript-tea (reversible until that PR
merges, and only after developer-ecosystem#69 merges).

== Go-forward: affinescript-tea

Per estate policy, the **successor to rescript-tea is `affinescript-tea`**
(an AffineScript TEA implementation), not continued ReScript TEA feature
work. `affinescript-tea` does not yet exist and **must not be hand-ported
now** — it is blocked on the same primitives as `gitbot-fleet#148`:
`affinescript#61` (`Http.fetch`), `#62` (`Promise`), `#63` (`Json`),
`#64` (`Dict`). `rescript-tea` here is the consolidated *legacy* base and
the reference for the eventual mechanical port. See
link:rescript-tea/SUCCESSOR.adoc[rescript-tea/SUCCESSOR.adoc].

== Next steps

. Per-module reconcile + retire standalone `rescript-tea` (above).
. Dedupe top-level packages into `packages/<group>/`; populate/remove
empty scaffolds.
. Continue per-repo consolidation of remaining scattered ReScript
(estate: `repos` ~1838, `hyperpolymath-archive` 208, `reposystem` 78
`.res` — `gitbot-fleet` is **blocked by gitbot-fleet#148**, do not move).
. Note: parent `developer-ecosystem/.gitmodules` still carries
`v-ecosystem/*` stanzas with the same orphan pattern — out of scope
here, flagged for the v-ecosystem owner.
32 changes: 28 additions & 4 deletions rescript-ecosystem/README.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,39 @@ Jonathan D.A. Jewell <j.d.a.jewell@open.ac.uk>
:toc: macro
:toclevels: 3

Consolidated monorepo for all hyperpolymath ReScript packages. 26 packages organized into 5 groups: core libraries, web frameworks, service bindings, FFI bridges, and developer tooling.
Consolidation monorepo for hyperpolymath ReScript packages. The target
layout is 5 groups (core, web, bindings, FFI, tooling) plus standalone
top-level packages; consolidation is **in progress, not complete**.

toc::[]

== Overview

This monorepo consolidates 26 previously-separate ReScript repositories into a single, cohesive workspace. Each package retains its own `rescript.json` and can be built independently, but they share a common root for easier cross-package development.

== Package Groups
This monorepo is the destination for previously-separate hyperpolymath
ReScript repositories. Consolidation is a live, partial migration — *not*
a finished state:

* Some `packages/*` entries are populated (e.g. `core/poly-core`,
`web/tea`, `tooling/evangeliser`); others are empty scaffolds
(e.g. `web/full-stack`, `bindings/postgres`) awaiting their source.
* Several large packages currently live as top-level directories
(`rescript/`, `idaptik-rescript13-staging/`, `cadre-router/`,
`rescript-tea/`, …) and are *not yet* deduplicated into `packages/`.
Note `rescript-tea` currently exists **both** top-level and as
`packages/web/tea` — a known duplication pending reconciliation.
* The mechanism is **in-tree, history-preserving relocation** (not git
submodules). Source repos are retired only *after* their content is
merged and verified here (reversible until then).

For authoritative per-package origin, status, and outstanding
reconciliation work, see link:MIGRATION.adoc[MIGRATION.adoc]. For the
community/transfer position see link:TRANSFER.adoc[TRANSFER.adoc].

== Package Groups (target layout)

NOTE: The tables below describe the *target* organization. Presence here
does not imply the package is fully populated — consult
link:MIGRATION.adoc[MIGRATION.adoc] for actual state.

=== Core (`packages/core/`)

Expand Down
67 changes: 67 additions & 0 deletions rescript-ecosystem/TRANSFER.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
// SPDX-License-Identifier: PMPL-1.0-or-later
= ReScript Ecosystem — Community Transfer Bundle
Jonathan D.A. Jewell <j.d.a.jewell@open.ac.uk>
:toc:
:toc-placement: preamble

This document describes the hyperpolymath ReScript work consolidated in
`developer-ecosystem/rescript-ecosystem/` and its transfer position,
following the estate language-consolidation decision (RS/TS/JS →
AffineScript → typed-wasm).

== Background

ReScript was used across the hyperpolymath estate for web (TEA), routing,
bindings, and tooling. The estate is standardising on AffineScript; the
ReScript corpus is being (a) structurally consolidated here and (b)
mechanically migrated to AffineScript once the compiler primitives land
(`affinescript#61–64`). Retiring ReScript is an ecosystem-fit decision —
too many parallel front-end stacks — not a judgement on ReScript.

This consolidation is **in progress, not complete**. See
link:MIGRATION.adoc[MIGRATION.adoc] for authoritative per-package state.

== Packages offered

The most transferable, self-contained pieces (each retains its own
`rescript.json` and builds independently):

=== rescript-tea

The Elm Architecture for ReScript. Consolidated base lives at
`rescript-ecosystem/rescript-tea/` with a broad module surface
(`src/tea/`: App, Cmd, Sub, Html, Json, Http, Vdom, Ssr, Svg, Time,
Keyboard, Mouse, Window, Animationframe, Debug, Render, Test). A
standalone upstream repo (https://github.com/hyperpolymath/rescript-tea)
still exists and has diverged; reconciliation is tracked in MIGRATION.adoc
and the standalone repo is **not yet retired**.

=== Other consolidated packages

`cadre-router`, `cadre-tea-router`, `rescript-evangeliser`,
`rescript-string-power`, `rescript-vite`, `rescript-dom-mounter`,
`idaptik-rescript13-staging`, and the `packages/{core,web,bindings,ffi,
tooling}/*` groups. Population is uneven (some empty scaffolds) — consult
MIGRATION.adoc before depending on any single package.

== FFI / proven adapters

ReScript↔native adapters and proven FFI seams are preserved **outside**
the aggregate as connectors — see link:connectors/README.adoc[]. They are
deliberately not folded into the package tree so consumers can depend on
the seam without the whole monorepo.

== Successor

Forward TEA development moves to `affinescript-tea` (AffineScript), once
`affinescript#61–64` land. The ReScript corpus here is the legacy base
and the reference for the mechanical port.

== Transfer Terms

All work here is offered under **PMPL-1.0-or-later**. PMPL-1.0-or-later is
the primary stated licence; until it achieves formal legal recognition,
MPL-2.0 is the automatic operative fallback — no separate request needed.
If an explicit OSI-approved identifier is required for a package registry,
MPL-2.0 is available on request. Code is functional and documented where
noted; population and reconciliation status is per MIGRATION.adoc.
37 changes: 37 additions & 0 deletions rescript-ecosystem/connectors/README.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
// SPDX-License-Identifier: PMPL-1.0-or-later
= rescript-ecosystem connectors
:toc:

== Purpose

Per `reference-rescript-ecosystem-policy` and the `v-ecosystem`
precedent, ReScript↔native **FFI / proven adapters are preserved here,
outside the aggregate package tree**.

Rationale: a consumer that only needs the FFI seam (e.g. a proven FFI
adapter, a Zig/WASM bridge) must be able to depend on the connector
without pulling the entire `rescript-ecosystem` monorepo. Folding adapters
into `packages/*` would couple the seam to the aggregate.

== Status

Scaffold. No adapters relocated yet. As per-repo consolidation proceeds
(see link:../MIGRATION.adoc[MIGRATION.adoc]), proven-FFI / native-bridge
adapters discovered in source repos are moved here — *not* into
`packages/` — with their origin recorded in MIGRATION.adoc.

== Layout (target)

----
connectors/
├── <name>/ # one dir per preserved adapter
│ ├── README.adoc # origin repo + seam description
│ └── … # adapter sources (in-tree, history-preserving)
└── README.adoc # this file
----

== Not in scope

Application code, framework packages, and bindings belong in
`packages/<group>/` or as top-level packages, not here. Connectors are
strictly the FFI/proven-adapter seams.
40 changes: 40 additions & 0 deletions rescript-ecosystem/rescript-tea/SUCCESSOR.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
// SPDX-License-Identifier: PMPL-1.0-or-later
= rescript-tea — Successor Notice
:toc:

== This package is the consolidated *legacy* base

`rescript-ecosystem/rescript-tea/` is the canonical, consolidated home
for the ReScript Elm Architecture. It is **left to this monorepo**: any
ReScript TEA changes happen here, not in the standalone
https://github.com/hyperpolymath/rescript-tea repo (which has diverged and
is pending reconciliation + retirement — see
link:../MIGRATION.adoc[../MIGRATION.adoc]).

== Go-forward: affinescript-tea

Per estate language policy (RS/TS/JS → AffineScript → typed-wasm), the
**successor is `affinescript-tea`** — an AffineScript TEA implementation.
New TEA feature work targets `affinescript-tea`, not continued ReScript
feature work here.

=== Do not hand-port yet

`affinescript-tea` does **not** exist and must **not** be hand-translated
ahead of the compiler. It is blocked on the same primitives as
`gitbot-fleet#148`:

* `affinescript#61` — `Http.fetch`
* `affinescript#62` — `Promise`
* `affinescript#63` — `Json`
* `affinescript#64` — `Dict`

Until those land, AffineScript cannot express the HTTP/async/JSON/dict
surface TEA relies on. This `rescript-tea` corpus is the reference for the
eventual **mechanical** port. Manual ports would diverge from it, need
redoing, and risk silent semantic drift.

=== Exit

Create/scaffold `affinescript-tea` when `affinescript#61–64` resolve;
mechanically port from this base; then this package becomes archival.
Loading
Loading