Skip to content

docs(playbook): v1.1 — service-locator row + coupled-writes subsection#37

Merged
hyperpolymath merged 1 commit into
mainfrom
docs/migration-playbook-v1.1
May 2, 2026
Merged

docs(playbook): v1.1 — service-locator row + coupled-writes subsection#37
hyperpolymath merged 1 commit into
mainfrom
docs/migration-playbook-v1.1

Conversation

@hyperpolymath
Copy link
Copy Markdown
Owner

Summary

Two playbook additions surfaced by the idaptik-user-settings design walk-through that landed in #36:

  1. Service-locator-globals row added to the ReScript pattern index. Module.get(): Option<Thing> is a common ReScript pattern; lifting it to an effect makes the dependency visible at the call site and lets tests install a mock without monkey-patching a global. Without this row, the playbook covered ref and let mutable but missed the service-locator one level above.

  2. Coupled-writes subsection added to Decision Criteria. When one user action must update both an in-memory subsystem AND persist to storage (volume, theme, settings), the choice is between one function calling two effects (default — keep coupling local) and a wrapper effect (only when partial success is a bug). The rule tracks the same logic as mut vs State.

Why stacked on #36

Both gaps were identified inside #36's lesson but deferred so that PR could land focused as policy. This PR is the v1.1 follow-up. It targets docs/migration-playbook so reviewers see only the v1.1 delta; once #36 merges, GitHub will retarget this PR to main automatically.

What's in this PR

  • docs/guides/migration-playbook.adoc:
    • :revnumber: 1.1, :revdate: 2026-05-02
    • New row in the ReScript source-pattern index for module-level singleton getters
    • New "Coupled writes — multiple effects in one action" subsection in Decision Criteria
    • New v1.1 row in the Revision History appendix
  • docs/guides/lessons/migrations/idaptik-user-settings.adoc:
    • Retires the "deferred to v1.1" note now that v1.1 exists
    • Cross-references the two new playbook sections

No removals; existing v1.0 guidance unchanged.

Test plan

  • asciidoctor --backend=html5 --safe-mode=safe renders both files cleanly.
  • New section markers (service-locator, coupled writes, "both succeed or neither") present in rendered HTML.
  • Lesson cross-references resolve to the new playbook sections.
  • Optional: review whether the wrapper-effect example in Coupled Writes wants a code snippet.

🤖 Generated with Claude Code

Two additions surfaced by the idaptik-user-settings design walk-through:

1. Service-locator-globals row added to the ReScript pattern index.
   `Module.get(): Option<Thing>` is a common ReScript pattern; lifting
   it to an effect makes the dependency visible at the call site and
   lets tests install a mock without monkey-patching a global. Without
   this row, the playbook covered `ref` and `let mutable` but missed
   the service-locator one level above.

2. Coupled-writes subsection added to Decision Criteria. When one
   user action must update both an in-memory subsystem AND persist to
   storage (volume, theme, settings), the choice is between one
   function calling two effects (default — keep coupling local) and a
   wrapper effect (only when partial success is a bug). The rule
   tracks the same logic as `mut` vs `State`.

Bumps :revnumber: to 1.1, appends row to Revision History.
No removals; existing v1.0 guidance unchanged.

Updates idaptik-user-settings.adoc to retire the "deferred to v1.1"
note and cross-reference the new sections, since v1.1 now exists.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@hyperpolymath hyperpolymath changed the base branch from docs/migration-playbook to main May 2, 2026 18:05
@hyperpolymath hyperpolymath merged commit ed8b175 into main May 2, 2026
12 checks passed
@hyperpolymath hyperpolymath deleted the docs/migration-playbook-v1.1 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