Skip to content

Claude/migrate to affinescript zig u0i yx#3

Merged
hyperpolymath merged 3 commits intomainfrom
claude/migrate-to-affinescript-zig-U0iYX
Apr 18, 2026
Merged

Claude/migrate to affinescript zig u0i yx#3
hyperpolymath merged 3 commits intomainfrom
claude/migrate-to-affinescript-zig-U0iYX

Conversation

@hyperpolymath
Copy link
Copy Markdown
Owner

No description provided.

claude added 2 commits April 16, 2026 13:38
…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
@hyperpolymath
Copy link
Copy Markdown
Owner Author

@copilot resolve the merge conflicts in this pull request

@hyperpolymath hyperpolymath merged commit fdb5fb9 into main Apr 18, 2026
13 of 17 checks passed
@hyperpolymath hyperpolymath deleted the claude/migrate-to-affinescript-zig-U0iYX branch April 18, 2026 16:06
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.

2 participants