Claude/migrate to affinescript zig u0i yx#3
Merged
hyperpolymath merged 3 commits intomainfrom Apr 18, 2026
Merged
Conversation
…er (Phase 1a)
Phase 0 (decide) complete; starting Phase 1 of the migration from a
ReScript-only evangeliser to a multi-target nextgen-typed-languages
evangeliser. Flagship target becomes AffineScript; ReScript is
preserved as a legacy target.
This commit is rebrand-only — no engine/code behaviour changes yet.
Phase 1b will generalise src/Types.res for multi-target patterns.
Touched:
- Docs: README, CLAUDE.md, .claude/CLAUDE.md, EXPLAINME, ROADMAP,
CHANGELOG (md+adoc), CONTRIBUTING, SECURITY, MAINTAINERS, TOPOLOGY,
TEST-NEEDS, CODE_OF_CONDUCT, QUICKSTART-{DEV,MAINTAINER,USER},
docs/{RSR_COMPLIANCE,TPCF,CITATIONS}
- Metadata: 0-AI-MANIFEST.a2ml, .machine_readable/* (STATE, META,
ECOSYSTEM, INTENT, MUST, TRUST, ADJUST; plus 6a2 variants),
contractiles/{intend,must,trust}/*
- Build/config: deno.json, rescript.json, config.ncl, k9iser.toml,
stapeln.toml, Mustfile.epx, justfile, Justfile, flake.nix, guix.scm,
setup.sh, bin/evangeliser.js
- CI/meta: .github/workflows/ci.yml, .gitlab-ci.yml, .editorconfig,
.well-known/security.txt, llm-warmup-{dev,user}.md
- Source headers: src/{Types,Patterns,Glyphs,Narrative,Output,Cli}.res
(comment header lines and Output.res display strings only)
Policy additions:
- Zig formalised as canonical FFI (already true per 0-AI-MANIFEST);
V banned outside V-ecosystem-specific work.
- AffineScript declared flagship target; typed-wasm (separate repo)
noted as downstream codegen layer (AffineScript -> typed-wasm -> WASM).
GitHub repo rename (rescript-evangeliser -> nextgen-languages-evangeliser)
must be performed by the maintainer; all in-repo references are already
updated so the rename is a one-click action.
https://claude.ai/code/session_01RJWz6SUyUEHTBNLjVwF177
Phase 1b of the migration to a multi-target evangeliser. Introduces a
target-language abstraction so a single pattern can carry examples for
AffineScript (flagship), ReScript (legacy), and future targets (Rust,
Gleam, Zig) without the engine committing to any one of them.
Type model (src/Types.res):
- new `targetLang = AffineScript | ReScript | Rust | Gleam | Zig`
- new `targetExample = {language, code}` record
- `pattern.rescriptExample: string` replaced by `pattern.targets:
array<targetExample>`
- constant `flagshipTarget = AffineScript`
- helpers: `targetLangToString`, `targetLangLabel`, `targetLangSyntaxTag`,
`stringToTargetLang`, `patternExampleFor`, `patternCodeFor`,
`patternEffectiveTarget`
Pattern library (src/Patterns.res):
- `makePattern` keeps its `~rescriptExample` parameter and wraps it
internally as a single-entry `targets: [{language: ReScript, code}]`.
All 52 existing call-sites compile unchanged.
- new `makePatternMultiTarget` for Phase 2+ patterns that supply
AffineScript (flagship) alongside ReScript.
Engine threading:
- Scanner.res: `patternMatch.transformation` now derived from the
flagship target's example (falls back via `patternCodeFor`).
- Output.res: `formatRaw`, `formatFolded`, `formatGlyphed`, and
top-level `format` all take a `target: targetLang` parameter.
Match renderer shows the requested target's code and label, with a
"(fallback — pattern not yet ported to X)" note when a pattern is
only available in its legacy target.
- Output.res: `formatPatternList` now annotates each pattern with its
supported targets, e.g. `[ReScript]` today, `[AffineScript, ReScript]`
after Phase 2.
- Cli.res: adds `--target` flag (affinescript|rescript|rust|gleam|zig);
default is flagship (AffineScript). `stats` command now shows a
per-target pattern count.
Tests:
- test/Patterns_test.res: asserts `targets` is non-empty and each
target's code is non-empty (replaces the old `rescriptExample` check).
- test/Narrative_test.res: mock pattern construction updated to use
new `targets` shape.
Build & tests verified:
- `rescript build` → 71 modules compiled, no warnings
- 38 tests across 6 suites → all pass
- CLI smoke-tested: `scan --target affinescript` (default, with
fallback note) and `scan --target rescript` (no fallback) both render
correctly. `stats` shows `ReScript: 52` target coverage — correct
baseline before Phase 2 adds AffineScript coverage.
Behaviour preserved: the legacy ReScript catalogue continues to work
end-to-end. Phase 2 can now begin authoring AffineScript pattern
entries using `makePatternMultiTarget` without further engine changes.
https://claude.ai/code/session_01RJWz6SUyUEHTBNLjVwF177
Owner
Author
|
@copilot resolve the merge conflicts in this pull request |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.