Skip to content

chore: migrate language policy from ReScript to AffineScript estate-wide#35

Merged
hyperpolymath merged 2 commits intomainfrom
chore/rescript-to-affinescript-sweep
Apr 30, 2026
Merged

chore: migrate language policy from ReScript to AffineScript estate-wide#35
hyperpolymath merged 2 commits intomainfrom
chore/rescript-to-affinescript-sweep

Conversation

@hyperpolymath
Copy link
Copy Markdown
Owner

Summary

Migrate the estate language policy from "TypeScript → ReScript" to "TypeScript / ReScript → AffineScript → typed-wasm" across CI rules, contractile rules, agent-facing policy docs, templates, and a stale migration guide.

This is the wider sweep promised in PR #34's body, now landed.

Per-user directive (2026-04-30)

"yes 1 yes 2 yes 3 yes and drop 4 change .res is out all .ts to .affine now 5 affinescript-config-present replaces"

What changed

CI rule workflows

File Change
.github/workflows/ts-blocker.yml Renamed concept to "TypeScript / JavaScript / ReScript Blocker"; added .res to forbidden patterns; replaced "Use ReScript instead" / "ReScript policy enforced" with "Use AffineScript instead" / "AffineScript policy enforced"; dropped the .res.js$ JS exclusion (no longer needed once .res is banned).
.github/workflows/rsr-antipattern.yml Added a new "Check for ReScript" step blocking .res files; added a new "Check for rescript.json" step; updated all "use ReScript instead" messages to "use AffineScript instead"; allowed-list now AffineScript, Deno, WASM, Rust, OCaml, Haskell, Guile/Scheme.
.github/workflows/language-policy.yml Added a new "Check for ReScript files" step; updated "Use ReScript instead" / "Rewrite in Rust/ReScript" → AffineScript; switched .scm references to .a2ml in the Required Files check (per the .a2ml-canonical rule confirmed in PR #33); added affine to SPDX-header file extensions.
a2ml/actions/validate/.github/workflows/ts-blocker.yml Same shape as top-level.
a2ml/actions/validate/.github/workflows/rsr-antipattern.yml Same shape as top-level.
consent-aware-http/.github/workflows/ts-blocker.yml Same shape as top-level.

Canonical machine-readable rule

File Change
hypatia-rules/rsr-self-compliance.a2ml @forbidden_files: updated .ts reason to point at AffineScript; added new **/*.res entry. (Supersedes PR #34's narrower one-line fix; that PR can be closed in favour of this one.)

Contractile rules

File Change
.machine_readable/contractiles/must/Mustfile.a2ml Renamed rescript-json-presentaffinescript-config-present (checks for affinescript.toml or dune-project instead of rescript.json); updated no-unsafe-coerce to scan .affine (not .res) since .res is now banned and AffineScript has no equivalent escape hatch by design; added new no-rescript rule mirroring no-typescript; updated no-typescript and no-python replacement messages to AffineScript.

Agent-facing policy

File Change
.claude/CLAUDE.md Allowed-languages table: ReScript row → AffineScript row; ReScript-as-fallback note in JS row → AffineScript-as-fallback. Banned-languages table: TypeScript replacement is now AffineScript; new ReScript row added (banned 2026-04-30). Mobile section + enforcement rules updated. Note paragraph at end now mentions four banned categories (Python, V-lang, ATS2, ReScript).
consent-aware-http/.claude/CLAUDE.md Same shape (sub-project copy).
ai-instruction/sonnet.md Language-policy hard-rule line now lists AffineScript first; ReScript added to no-list.

Tier / Replacement docs

File Change
0-ai-gatekeeper-protocol/RSR_OUTLINE.adoc Tier-1 list: ReScript → AffineScript; "TypeScript/JavaScript (use ReScript)" → "TypeScript/JavaScript/ReScript (use AffineScript)".
0-ai-gatekeeper-protocol/repo-guardian-fs/RSR_OUTLINE.adoc Same.
consent-aware-http/RSR_OUTLINE.adoc Same.

Templates

File Change
a2ml-templates/META.a2ml.template code-style common-values comment: rescriptaffinescript.
a2ml-templates/AGENTIC.a2ml.template languages allowed list: drop rescript, add affinescript. banned list: add rescript.

Roadmap / migration

File Change
agentic-a2ml/docs/ROADMAP.adoc "ReScript template (Tier 1)" → "AffineScript template (Tier 1)" in the templates phase.
consent-aware-http/.migration/PYTHON_TO_RUST_RESCRIPT.md DELETED.
consent-aware-http/.migration/PYTHON_TO_RUST_AFFINESCRIPT.adoc NEW. Rewritten content: Python → Rust(+SPARK) / AffineScript directly (no ReScript hop); also converted from .md.adoc per the doc-format rule (PR rsr-template-repo#28).

Files deliberately not changed (legitimate ReScript references)

  • .machine_readable/bot_exclusion_registry.a2ml — references hyperpolymath/rescript (the ReScript compiler fork repo). Legitimate.
  • .gitignore lines for ReScript build artifacts — kept as transitional defence; existing repos still have .res build output to ignore until migrations complete.
  • Dustfile.a2ml no-tracked-rescript-build — language-agnostic build hygiene rule.
  • consent-aware-http/SCOPE.adoc:54 — factual statement about an existing impl.
  • 0-ai-gatekeeper-protocol/repo-guardian-fs/README.adoc — names of real ReScript libraries that some downstream repos still consume.
  • agentic-a2ml/examples/web-project-deno.json — example showing how to set up ReScript+Deno; left as-is for transitional reference. Could add a parallel AffineScript example in a follow-up if desired.

Relationship to other open PRs

🤖 Generated with Claude Code

Per user directive 2026-04-30: '.res is out, all .ts to .affine now;
affinescript-config-present replaces.'

CI rule workflows (.github/workflows/ + a2ml-action duplicates):
  - ts-blocker.yml: extend to also block .res; messages -> AffineScript
  - rsr-antipattern.yml: new ReScript-block step + new rescript.json
    block step; allowed/blocked lists updated
  - language-policy.yml: new ReScript-block step; replace 'use ReScript'
    with 'use AffineScript'; switch .scm to .a2ml in required-files;
    add 'affine' to SPDX-header extensions

Canonical rule (hypatia-rules/rsr-self-compliance.a2ml):
  - @forbidden_files: .ts reason -> AffineScript; new .res entry

Contractile rules (.machine_readable/contractiles/must/Mustfile.a2ml):
  - rescript-json-present -> affinescript-config-present
  - no-typescript / no-python messages -> AffineScript
  - new no-rescript rule
  - no-unsafe-coerce now scans .affine (was .res)

Agent-facing policy (.claude/CLAUDE.md + sonnet.md + consent-aware-http
copy): ReScript replaced by AffineScript in allowed/banned tables;
ReScript explicitly added to banned list (2026-04-30).

RSR_OUTLINE.adoc (3 copies): Tier-1 'ReScript' -> 'AffineScript';
prohibited 'TypeScript/JavaScript (use ReScript)' -> 'TypeScript/
JavaScript/ReScript (use AffineScript)'.

a2ml-templates/{META,AGENTIC}.a2ml.template: drop rescript, add
affinescript; rescript added to banned list.

agentic-a2ml/docs/ROADMAP.adoc: ReScript template -> AffineScript template.

consent-aware-http/.migration/PYTHON_TO_RUST_RESCRIPT.md DELETED;
replaced by .../PYTHON_TO_RUST_AFFINESCRIPT.adoc with rewritten content
(no ReScript intermediate hop) and .md->.adoc per doc-format rule.

Supersedes the narrower PR #34. Files deliberately not touched are
listed in the PR body (bot exclusion registry, .gitignore artefacts,
language-agnostic build hygiene rules, factual references).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@hyperpolymath hyperpolymath enabled auto-merge (squash) April 30, 2026 17:03
@hyperpolymath hyperpolymath disabled auto-merge April 30, 2026 17:04
@hyperpolymath hyperpolymath merged commit 7f3681a into main Apr 30, 2026
16 of 19 checks passed
@hyperpolymath hyperpolymath deleted the chore/rescript-to-affinescript-sweep branch April 30, 2026 17:04
hyperpolymath added a commit that referenced this pull request May 1, 2026
…idue formalism

Adds Agda to Tier-1 alongside the existing Tier-1 set in three
RSR_OUTLINE.adoc copies (with the ReScript -> AffineScript and
Rust -> Rust(+SPARK) updates from PR #35 inlined to avoid build
conflict).

Adds two new rows to .claude/CLAUDE.md:
  - Agda (formal verification, foundational/type-theoretic)
  - echo-types library (canonical loss-with-residue formalism;
    cite from hyperpolymath/echo-types rather than reinventing)

Reframes Idris2 row from 'sole option' to 'primary, ABI-style
proofs' since Agda now formally complements it.

Updates ai-instruction/sonnet.md hard-rules language-policy line
to list AffineScript first, include Agda explicitly, ban ReScript,
and reference RS/TS/JS -> AffineScript -> typed-wasm.

Coordinates with:
  hyperpolymath/echo-types#29 (.scm -> .a2ml + Justfile fix)
  hyperpolymath/echo-types#30 (RSR floor scaffolding)
  #33 (REQUIRED-FILES doc-drift fix)
  #35 (ReScript -> AffineScript sweep;
    line-overlap with this PR; mechanical rebase at merge)

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
hyperpolymath added a commit that referenced this pull request May 1, 2026
…idue formalism (#36)

## Summary

Recognise **Agda** as a Tier-1 language and
**`hyperpolymath/echo-types`** as the canonical loss-with-residue
formalism in the agent-facing policy and tier docs.

## What changed

### Tier-1 list (3 RSR_OUTLINE.adoc copies)

```diff
- * **Tier 1** (Gold): Rust, Elixir, Zig, Ada, Haskell, ReScript
+ * **Tier 1** (Gold): Rust(+SPARK), Elixir, Zig, Ada, Haskell, AffineScript, Agda
```

Adds Agda alongside the existing tier. Replaces ReScript with
AffineScript and qualifies Rust as Rust(+SPARK), tracking the broader
ReScript→AffineScript migration in PR #35 (this PR's diff includes those
updates so the file builds without conflict; #35 may need a rebase but
the resolutions are mechanical).

Files updated:
- `0-ai-gatekeeper-protocol/RSR_OUTLINE.adoc` line 149
- `0-ai-gatekeeper-protocol/repo-guardian-fs/RSR_OUTLINE.adoc` line 149
- `consent-aware-http/RSR_OUTLINE.adoc` line 149

### Agent-facing language policy (`.claude/CLAUDE.md`)

Adds two new rows to the allowed-languages table:

```
| **Agda**            | Formal verification (foundational / type-theoretic constructions) | Used by hyperpolymath/echo-types ... |
| **echo-types library** | Loss-with-residue formalism (Agda) | hyperpolymath/echo-types — canonical formalisation of Echo f y := Σ (x : A) , (f x ≡ y) ... |
```

Reframes Idris2 from "Formal verification (sole option)" to "Formal
verification (primary, ABI-style proofs)" since Agda now formally
complements it for foundational constructions where Idris2's specific
dependent-type idiom isn't the right tool.

### `ai-instruction/sonnet.md`

The hard-rules language-policy line now lists AffineScript first,
includes Agda explicitly, bans ReScript, and references the
AffineScript→typed-wasm direction:

```diff
- - <Language policy: ReScript / Rust / Deno / Zig / Idris2 / Gleam; no
-   TypeScript, Node, npm/bun/yarn, Go, general Python>
+ - <Language policy: AffineScript / Rust(+SPARK) / Deno / Zig / Idris2 / Agda / Gleam; no
+   TypeScript, ReScript, Node, npm/bun/yarn, Go, general Python (RS/TS/JS → AffineScript → typed-wasm; Agda for foundational proofs incl. echo-types)>
```

## Why

Echo-types (`hyperpolymath/echo-types`) is an active, well-developed
Agda formalisation that the `coord-mcp` TODO file already aspires to
dogfood. Until now, the standards' policy docs name only Idris2 as the
ecosystem's formal-verification language, which understates Agda's role
for the foundational-construction track. This PR makes the actual
two-prover posture explicit.

The echo-types row is added because the canonical fiber/echo
construction `Echo f y := Σ (x : A) , (f x ≡ y)` should not be
re-derived in downstream design docs and proofs — they should cite the
library. Naming it explicitly in CLAUDE.md prevents accidental
reinvention.

## Coordinated companion PRs

- `hyperpolymath/echo-types#29` — `.scm` → `.a2ml` 6a2 file rename +
Justfile `make` → `just`. (Bringing echo-types into compliance with the
canonical extension rule.)
- `hyperpolymath/echo-types#30` — RSR template floor (23 new files:
githealth + RSR docs + dotfiles + 4 mandatory workflows + contractiles +
stapeln). (Bringing echo-types to file-presence floor.)
- `#33` — `.scm` → `.a2ml` doc fix in
REQUIRED-FILES.adoc + workflow-count drift fix.
- `#35` — ReScript → AffineScript estate-wide
sweep. (Some line-overlap with this PR; mechanical rebase at merge.)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant