Skip to content

Commit 974c55d

Browse files
docs(claude): refresh language-policy tables for 2026-05-25 estate policy (#363)
## Summary Refreshes the `.claude/CLAUDE.md` language-policy tables to reflect the estate policy delivered in-session 2026-05-25. Mirrors the machine-enforced side in **hypatia#318** (CicdRules `@blocked_patterns` updates + MPL-1.0 added to `@wrong_licenses`). ## Changes - **Top-of-section banner** pinned to 2026-05-25 capturing the headline policy change. - **ALLOWED** table: AffineScript promoted from absent → "Primary application code" row. - **LEGACY** (new table): ReScript / JavaScript moved here with explicit "no new occurrences" disposition + migration-tool reference (#57). - **BANNED** table updates: - TypeScript → **AffineScript** (was ReScript) - ReScript (new files) → **AffineScript** (via #57 migration assistant) - JavaScript (in projects meaningfully migrated) → **AffineScript** - Python (general) → **AffineScript / Rust / Julia** (was ReScript/Rust) - **MPL-1.0** → **MPL-2.0** (new explicit row) - **MPL-1.0-or-later** → **MPL-2.0** (new explicit row) - **Exemption section** renamed `TypeScript Exemptions` → `TypeScript / JavaScript Exemptions` (JS now has the same posture). - **Enforcement rule 2** added: No new ReScript files (existing stays until migrated via #57). - **Enforcement rule 8** added: MPL-1.0 / MPL-1.0-or-later are non-conforming, rewrite to MPL-2.0. - Tauri 2.0+ description: "Web UI (ReScript) + Rust backend" → "Web UI (AffineScript) + Rust backend". ## Approved exemptions preserved `.d.ts` declaration files, `affinescript-deno-test/*.ts`, the `affinescript-cli/mod.js` shim, and `editors/vscode/test/*.js` — all remain in the carve-out table further down in CLAUDE.md. The policy refresh tightens the **default** posture; it does not retroactively invalidate documented exemptions. ## Migration ramp realism This repo's compiler-host tooling itself uses ReScript-derived patterns. Migration happens opportunistically via `tools/res-to-affine/` — not as a sweep. Closes-Refs hypatia#318 (machine-enforced side of this policy). 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent f4729f6 commit 974c55d

1 file changed

Lines changed: 34 additions & 19 deletions

File tree

.claude/CLAUDE.md

Lines changed: 34 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -15,62 +15,77 @@ The following files in `.machine_readable/` contain structured project metadata:
1515

1616
## Language Policy (Hyperpolymath Standard)
1717

18+
> **Policy refresh 2026-05-25**: AffineScript is now the primary application language across the estate (this is its home repo). ReScript / TypeScript / meaningfully-migrated JavaScript are banned going forward — write new code in AffineScript. Existing ReScript stays in place as legacy until the `.res → .affine` migration assistant (#57) walks the corpus. MPL-1.0 / MPL-1.0-or-later are banned; rewrite to MPL-2.0 wherever encountered (code + docs). **Jekyll is banned**; the canonical estate SSG is `hyperpolymath/casket-ssg` (Haskell). This repo already migrated via `.github/workflows/casket-pages.yml`.
19+
1820
### ALLOWED Languages & Tools
1921

2022
| Language/Tool | Use Case | Notes |
2123
|---------------|----------|-------|
22-
| **ReScript** | Primary application code | Compiles to JS, type-safe |
24+
| **AffineScript** (`.affine`) | Primary application code | Affine types, dependent types, row polymorphism, extensible effects; compiles to Wasm |
2325
| **Deno** | Runtime & package management | Replaces Node/npm/bun |
2426
| **Rust** | Performance-critical, systems, WASM | Preferred for CLI tools |
2527
| **Tauri 2.0+** | Mobile apps (iOS/Android) | Rust backend + web UI |
2628
| **Dioxus** | Mobile apps (native UI) | Pure Rust, React-like |
2729
| **Gleam** | Backend services | Runs on BEAM or compiles to JS |
2830
| **Bash/POSIX Shell** | Scripts, automation | Keep minimal |
29-
| **JavaScript** | Only where ReScript cannot | MCP protocol glue, Deno APIs |
3031
| **Python** | SaltStack only | No other Python permitted |
3132
| **Nickel** | Configuration language | For complex configs |
3233
| **A2ML** | State/meta files | .machine_readable/6a2/STATE.a2ml, .machine_readable/6a2/META.a2ml, .machine_readable/6a2/ECOSYSTEM.a2ml |
3334
| **Julia** | Batch scripts, data processing | Per RSR |
34-
| **OCaml** | AffineScript compiler | Language-specific |
35+
| **OCaml** | AffineScript compiler | Language-specific (compiler-host tooling lives here) |
3536
| **Ada** | Safety-critical systems | Where required |
3637

37-
### BANNED - Do Not Use
38+
### LEGACY — exists in tree, but write no new occurrences
39+
40+
| Language | Status | Disposition |
41+
|----------|--------|-------------|
42+
| **ReScript** (`.res`, `.resi`) | Legacy — pre-2026-05-25 | Migrate via `tools/res-to-affine/` (#57) when touching adjacent code; do not add new `.res` files. |
43+
| **JavaScript** (`.js`, `.cjs`, `.mjs`) | Legacy / carve-outs only | Approved runtime-exemption carve-outs (see below) remain; net-new JS in a project already migrated to AffineScript is banned. |
44+
45+
### BANNED — Do Not Use (write zero new occurrences)
3846

3947
| Banned | Replacement |
4048
|--------|-------------|
41-
| TypeScript | ReScript |
49+
| TypeScript | **AffineScript** |
50+
| ReScript (new files) | **AffineScript** (migration via #57) |
51+
| JavaScript (where the project has been meaningfully migrated to AffineScript) | **AffineScript** |
4252
| Node.js | Deno |
4353
| npm | Deno |
4454
| Bun | Deno |
4555
| pnpm/yarn | Deno |
4656
| Go | Rust |
47-
| Python (general) | ReScript/Rust |
48-
| Java/Kotlin | Rust/Tauri/Dioxus |
49-
| Swift | Tauri/Dioxus |
50-
| React Native | Tauri/Dioxus |
51-
| Flutter/Dart | Tauri/Dioxus |
57+
| Python (general) | **AffineScript** / Rust / Julia |
58+
| Java/Kotlin | Rust / Tauri / Dioxus |
59+
| Swift | Tauri / Dioxus |
60+
| React Native | Tauri / Dioxus |
61+
| Flutter/Dart | Tauri / Dioxus |
62+
| **MPL-1.0** | **MPL-2.0** (rewrite SPDX headers + LICENSE files wherever encountered, code AND docs) |
63+
| **MPL-1.0-or-later** | **MPL-2.0** (same) |
64+
| **Jekyll** (`jekyll.yml`, `jekyll-gh-pages.yml`, `_config.yml`, `Gemfile`) | **`hyperpolymath/casket-ssg`** (Haskell SSG, owner's own tool). This repo already migrated — see `.github/workflows/casket-pages.yml` for the canonical pattern. Hypatia flags Jekyll filenames as `jekyll_workflow_detected` / `jekyll_gh_pages_workflow_detected` / `jekyll_config_detected` / `gemfile_detected`. |
5265

5366
### Mobile Development
5467

5568
**No exceptions for Kotlin/Swift** - use Rust-first approach:
5669

57-
1. **Tauri 2.0+** - Web UI (ReScript) + Rust backend, MIT/Apache-2.0
70+
1. **Tauri 2.0+** - Web UI (AffineScript) + Rust backend, MIT/Apache-2.0
5871
2. **Dioxus** - Pure Rust native UI, MIT/Apache-2.0
5972

6073
Both are FOSS with independent governance (no Big Tech).
6174

6275
### Enforcement Rules
6376

64-
1. **No new TypeScript files** - Convert existing TS to ReScript
65-
2. **No package.json for runtime deps** - Use deno.json imports
66-
3. **No node_modules in production** - Deno caches deps automatically
67-
4. **No Go code** - Use Rust instead
68-
5. **Python only for SaltStack** - All other Python must be rewritten
69-
6. **No Kotlin/Swift for mobile** - Use Tauri 2.0+ or Dioxus
77+
1. **No new TypeScript files** - Write new code in AffineScript (closed exemptions table below covers the residual `.d.ts` / Deno-test cases).
78+
2. **No new ReScript files** - As of 2026-05-25 policy refresh; AffineScript is the go-forward. Existing `.res` files stay until migrated via #57.
79+
3. **No package.json for runtime deps** - Use deno.json imports.
80+
4. **No node_modules in production** - Deno caches deps automatically.
81+
5. **No Go code** - Use Rust instead.
82+
6. **Python only for SaltStack** - All other Python must be rewritten.
83+
7. **No Kotlin/Swift for mobile** - Use Tauri 2.0+ or Dioxus.
84+
8. **MPL-1.0 / MPL-1.0-or-later are non-conforming** - Rewrite to MPL-2.0 in SPDX headers and LICENSE files when encountered (Hypatia's `validate_license` flags both).
7085

71-
### TypeScript Exemptions (Approved)
86+
### TypeScript / JavaScript Exemptions (Approved)
7287

73-
The "no new TypeScript" rule has seven approved exemptions in this repo. These paths are *not* policy violations — they are documented carve-outs because the file format or downstream consumer requires TypeScript:
88+
The "no new TypeScript" / "no new JavaScript" rules have approved exemptions in this repo. These paths are *not* policy violations — they are documented carve-outs because the file format or downstream consumer requires the source language. They are honoured by Hypatia's scanner via path-based exemption + the per-repo CLAUDE.md exemption tables.
7489

7590
| Path | Files | Rationale | Unblock condition |
7691
|---|---|---|---|

0 commit comments

Comments
 (0)