Skip to content

Commit 2b36056

Browse files
hyperpolymathclaude
andcommitted
docs(claude): refresh language-policy tables for 2026-05-25 estate policy
Estate policy refresh delivered 2026-05-25 (in-session, owner-confirmed): * AffineScript is the primary application language going forward (this repo is its home). * ReScript moves from "primary application code" to LEGACY — existing .res files stay until migrated via tools/res-to-affine/ (#57); new .res files are banned. * TypeScript replacement updated: was "use ReScript", now "use AffineScript". Same for JavaScript in projects that have been meaningfully migrated. * MPL-1.0 + MPL-1.0-or-later are banned; rewrite to MPL-2.0 in both code (SPDX headers) and docs whenever encountered. Changes to .claude/CLAUDE.md: * Added a top-of-section policy-refresh banner pinned to 2026-05-25. * Promoted AffineScript to the primary application language row. * Demoted ReScript and JavaScript into a new LEGACY table with explicit "no new occurrences" disposition. * Updated BANNED table: TypeScript → AffineScript (was ReScript), Python → AffineScript/Rust/Julia (was ReScript/Rust), added explicit MPL-1.0 / MPL-1.0-or-later rows. * Renamed the exemption table from "TypeScript Exemptions" to "TypeScript / JavaScript Exemptions" since JS now has the same posture; cross-reference Hypatia's scanner-suppression mechanism. * Added a new enforcement rule (No new ReScript files) and updated the Tauri 2.0+ line to say "Web UI (AffineScript)". This mirrors the Hypatia rule changes landing in hypatia#318 (CicdRules `@blocked_patterns` updates + MPL-1.0 in `@wrong_licenses`). Repo CLAUDE.md is the human-readable source of truth; the Hypatia rules are the machine-enforced version. Approved exemptions (.d.ts files, affinescript-deno-test/*.ts, the affinescript-cli/mod.js shim, editors/vscode/test/*.js) stay honoured via the existing exemption-table rows further down in this file. Closes-Refs hypatia#318 (machine-enforced side of this policy). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 91c615d commit 2b36056

1 file changed

Lines changed: 33 additions & 19 deletions

File tree

.claude/CLAUDE.md

Lines changed: 33 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -15,62 +15,76 @@ 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).
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) |
5264

5365
### Mobile Development
5466

5567
**No exceptions for Kotlin/Swift** - use Rust-first approach:
5668

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

6072
Both are FOSS with independent governance (no Big Tech).
6173

6274
### Enforcement Rules
6375

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
76+
1. **No new TypeScript files** - Write new code in AffineScript (closed exemptions table below covers the residual `.d.ts` / Deno-test cases).
77+
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.
78+
3. **No package.json for runtime deps** - Use deno.json imports.
79+
4. **No node_modules in production** - Deno caches deps automatically.
80+
5. **No Go code** - Use Rust instead.
81+
6. **Python only for SaltStack** - All other Python must be rewritten.
82+
7. **No Kotlin/Swift for mobile** - Use Tauri 2.0+ or Dioxus.
83+
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).
7084

71-
### TypeScript Exemptions (Approved)
85+
### TypeScript / JavaScript Exemptions (Approved)
7286

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:
87+
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.
7488

7589
| Path | Files | Rationale | Unblock condition |
7690
|---|---|---|---|

0 commit comments

Comments
 (0)