Skip to content

Document target-hop and dependencies: rules in kind: rubric (closes #76)#97

Open
JuanVqz wants to merge 2 commits into
mainfrom
feature/document-target-hop-and-dependencies-rules
Open

Document target-hop and dependencies: rules in kind: rubric (closes #76)#97
JuanVqz wants to merge 2 commits into
mainfrom
feature/document-target-hop-and-dependencies-rules

Conversation

@JuanVqz

@JuanVqz JuanVqz commented May 5, 2026

Copy link
Copy Markdown
Member

Summary

Closes #76. Documents two rules in CLAUDE.md's ## Assigning kind: section that have been implicit in the rollout but never written down:

  1. Judge kind at the target hop, not the API's historical timeline.
  2. dependencies:kind relationship: when the dependencies: block applies and to which kinds.

Doc-only PR. No code changes. No pattern reclassifications.

What changed

Target-hop rule (added inside ## Assigning kind:)

A new paragraph above the four-value list states that each rails-XY-patterns.yml file is a statement about that hop — what changes when the user upgrades INTO that version. The same API can be deprecation in rails-31-patterns.yml and breaking in rails-40-patterns.yml. Concrete example called out: SCOPE_WITHOUT_LAMBDA (deprecated in Rails 3.1, raises in 4.0 → classified breaking in rails-40-patterns.yml).

This was the recurring source of "but it was deprecated earlier!" arguments during the classification reviews. The rule is consistent with how the patterns are already organized — one file per hop — but it wasn't written down.

New section: ## How the dependencies: section relates to kind

Added immediately after the four-value rubric. Documents that the dependencies: block serves two distinct purposes, not one:

  1. Bridge / compatibility gems for breaking patterns — e.g., protected_attributes rescues attr_accessible, responders rescues respond_with, rails-controller-testing rescues assigns / assert_template. A breaking pattern with a corresponding bridge entry is a softenable break.
  2. New gems Rails introduces or recommends at this version — e.g., bootsnap (5.2), propshaft (8.0), solid_cache / solid_queue / solid_cable (8.0), kamal (8.0), bundler-audit (8.1). These pair with optional patterns or with no pattern at all.

The original issue #76 framed dependencies: as "only relevant to breaking". That's too strong — the actual data across the 12 pattern files shows new-default gems (typically optional) also live in dependencies:. The PR uses the more accurate two-purpose framing.

The check: true / check: false flag is also explained: roughly "you should add this" vs "you may add this".

Files changed (2 files, +23 lines)

  • CLAUDE.md — target-hop paragraph + new ## How the dependencies: section relates to kind section
  • rails-upgrade/CHANGELOG.md — Unreleased entry

Test plan

  • bin/validate-patterns (all 12 files) still passes — no schema changes, doc-only
  • No code changes
  • No pattern reclassifications

Linked issues

Out of scope

@JuanVqz JuanVqz self-assigned this May 5, 2026
@JuanVqz JuanVqz requested review from arielj and etagwerker May 5, 2026 00:40
@JuanVqz JuanVqz marked this pull request as ready for review May 5, 2026 00:40
JuanVqz added a commit that referenced this pull request May 5, 2026
Three minor refinements per review of CLAUDE.md kind: rubric:

1. Split SCOPE_WITHOUT_LAMBDA example off the target-hop paragraph onto
   its own line for scannability.
2. Reframe check: true / check: false explanation. The flag is editorial
   advice about broad applicability, not a per-app determination. A
   check: false bridge gem still becomes effectively required for a
   specific app that triggers its rescued breaking pattern. Per-app
   applicability is driven by the per-pattern fix: field, not the flag.
3. Add explicit note that bin/validate-patterns does not enforce the
   dependencies: ↔ kind relationship — it's editorial guidance for
   authors and reviewers, not schema. Pre-empts future "why doesn't
   validate-patterns check this?" questions.

Refs #53, refs #76
JuanVqz added 2 commits May 4, 2026 18:58
Two implicit rules from the issue #53 rollout that were never written
down. Surfaced during reviews of #73 (rails-40 SCOPE_WITHOUT_LAMBDA
borderline) and #74 (rails-50 dependencies semantics).

1. **Target-hop rule** — judge kind at the target hop, not the API's
   historical timeline. Each rails-XY-patterns.yml file is a statement
   about that specific hop. The same API can be deprecation in
   rails-31-patterns.yml and breaking in rails-40-patterns.yml. Added
   as a paragraph above the four-value list, with the concrete example
   of SCOPE_WITHOUT_LAMBDA.

2. **dependencies: ↔ kind relationship** — added a new section
   "## How the dependencies: section relates to kind" documenting that
   dependencies: serves TWO purposes:
   - Bridge gems for breaking patterns (e.g. protected_attributes
     rescues attr_accessible)
   - New-default / new-recommended gems Rails introduces (e.g. bootsnap,
     propshaft, the solid_* family)
   The original #76 framing said dependencies is only relevant to
   breaking. That's too strong — actual data across the 12 pattern
   files shows both purposes. Used the accurate two-purpose framing.
   Also explains check: true vs check: false.

Doc-only. No code changes. No pattern reclassifications.

Refs #53, closes #76
Three minor refinements per review of CLAUDE.md kind: rubric:

1. Split SCOPE_WITHOUT_LAMBDA example off the target-hop paragraph onto
   its own line for scannability.
2. Reframe check: true / check: false explanation. The flag is editorial
   advice about broad applicability, not a per-app determination. A
   check: false bridge gem still becomes effectively required for a
   specific app that triggers its rescued breaking pattern. Per-app
   applicability is driven by the per-pattern fix: field, not the flag.
3. Add explicit note that bin/validate-patterns does not enforce the
   dependencies: ↔ kind relationship — it's editorial guidance for
   authors and reviewers, not schema. Pre-empts future "why doesn't
   validate-patterns check this?" questions.

Refs #53, refs #76
@JuanVqz JuanVqz force-pushed the feature/document-target-hop-and-dependencies-rules branch from 5e26ed6 to fb413d0 Compare May 5, 2026 00:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

Document 'judge kind at target hop' rule in CLAUDE.md kind: rubric

1 participant