Skip to content

docs(guides): add Migration Playbook + frontier-guide v1.0 living-doc header#36

Merged
hyperpolymath merged 2 commits into
mainfrom
docs/migration-playbook
May 2, 2026
Merged

docs(guides): add Migration Playbook + frontier-guide v1.0 living-doc header#36
hyperpolymath merged 2 commits into
mainfrom
docs/migration-playbook

Conversation

@hyperpolymath
Copy link
Copy Markdown
Owner

Summary

  • Adds docs/guides/migration-playbook.adoc as the systematic companion to frontier-guide.adoc — the source-of-truth for re-decomposition rules when porting ReScript / TypeScript codebases into AffineScript.
  • Bumps docs/guides/frontier-guide.adoc to v1.0 with a "canonical, living document" status note, a cross-link to the playbook, and a Revision History appendix so subsequent edits have a place to land.

Why

Downstream consumers of the guide (notably idaptik, with ~542 .res and ~80 .ts files queued for migration) had no systematic playbook for how to re-decompose during translation — only the unveiling of what AffineScript is. The risk was a faithful-but-monolithic port that type-checks in AffineScript while still carrying the design problems AffineScript was built to solve.

This PR establishes the playbook upstream, here, so the rules don't fork into per-consumer docs or AI-agent memory entries.

What's in the playbook

  • The cardinal rulere-decompose, do not transliterate.
  • Source-pattern indices for ReScript and TypeScript (let mutablemut or State effect, exceptionResult[T,E], Js.PromiseAsync effect, classes → owned record + standalone fns, etc.).
  • Decision criteriaOption vs Result, mut vs effect, ref/mut/own, linear (@linear) vs affine (own).
  • A worked anti-pattern — a small file-buffer ported faithfully (still buggy, IO invisible, closed is a runtime check) paired with the re-decomposed form (open/closed as distinct types, IO in the effect row, ownership consumed by close).
  • Feedback channel — points future case studies at docs/guides/lessons/ so the upstream guide stays a living document.

Frontier Guide changes

  • :revnumber: 1.0 / :revdate: 2026-04-11.
  • "Canonical, living document" status note at the top, with the directive that edits land in the new Revision History appendix.
  • Cross-link to the migration playbook from "What to Read Next".
  • Revision History appendix at the end.

Test plan

  • asciidoctor --backend=html5 --safe-mode=safe renders both files cleanly (no warnings, no errors).
  • Cross-link from frontier-guide.adoc to migration-playbook.adoc resolves in the rendered HTML.
  • Revision History appendices render in both files.
  • Optional: human review of the ReScript/TS pattern tables for correctness against the live ReScript 12.2 / current TypeScript surface.

🤖 Generated with Claude Code

hyperpolymath and others added 2 commits May 2, 2026 06:38
…g-doc header

Adds docs/guides/migration-playbook.adoc as the systematic companion
to frontier-guide.adoc — the source-of-truth for re-decomposition rules
when porting ReScript / TypeScript codebases into AffineScript. Covers:
the cardinal rule (re-decompose, do not transliterate), source-pattern
indices for ReScript and TypeScript, decision criteria
(`Option` vs `Result`, `mut` vs effect, `ref`/`mut`/`own`,
linear vs affine), and a file-buffer anti-pattern paired with its
re-decomposed form.

Bumps frontier-guide.adoc to v1.0:
- adds :revnumber: / :revdate: attributes
- adds a "canonical, living document" status note pointing at the
  migration-playbook
- cross-links the playbook from "What to Read Next"
- adds a Revision History appendix so subsequent edits have a place
  to land — addresses the gap where the guide had no surface for
  incremental updates and downstream consumers (idaptik, etc.) had
  no way to see what had changed.

Both files render cleanly with asciidoctor.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…sons-pointer

Adds docs/guides/lessons/migrations/idaptik-user-settings.adoc — the
second migration case study, paired with the existing idaptik-hitbox
entry. Unlike hitbox (a pure-leaf compilable translation), UserSettings
has 5+ external deps (Storage/Audio/DesktopIntegration/GetEngine/Option)
and uses Float arithmetic, neither of which v0.1.0 can resolve, so this
lesson is explicitly marked **design-only**. The walk-through still
pressure-tests the playbook against a realistic, dependency-heavy file.

Stress-test outcome:
- Playbook held cleanly on stringly-typed→sum-type, unit→IO-effect,
  Option direct mapping, and let-_-discarded-Result patterns.
- Surfaced three small gaps:
  1. Service-locator globals (`GetEngine.get(): Option<engine>`) aren't
     named in the source-pattern index. Lift-to-effect is the right
     answer; needs one row.
  2. Coupled-write composition (one user action that updates both an
     in-memory subsystem AND persists) isn't covered by the decision
     criteria.
  3. The playbook pointed lessons/ at the wrong folder — that's the
     10-lesson tutorial track, not the migration case-study channel.
     Fixed inline.

Gap 3 fixed in this commit. Gaps 1 and 2 are playbook-text changes
deferred to a v1.1 follow-up so this PR stays focused.

The "Lessons from Real Migrations" section of the playbook now indexes
both case studies so reviewers can see the playbook validated against
two concrete files.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@hyperpolymath hyperpolymath merged commit 7644c85 into main May 2, 2026
16 of 20 checks passed
@hyperpolymath hyperpolymath deleted the docs/migration-playbook branch May 12, 2026 20:19
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