Rename cop RegistryOutsideEntryPoint to match its lookup-by-id check #1684

Closed
opened 2026-11-11 07:04:39 +00:00 by jared · 2 comments
Owner

Problem

The Ruby cop Sdlc/Sequel/RegistryOutsideEntryPoint no longer checks a registry.
Ruling 134 (2026-11-10, docs/decisions/rulings.tsv) deleted its registry check and its path list.
The cop now holds one check: a Model[id] lookup outside initialize, with a test-path allowance.
The name RegistryOutsideEntryPoint names a check that is gone.
The ruling says: "The cop name no longer fits the check."

Observed

The cop file is plugins/os-sdlc/lib/os_sdlc/cops/sequel/registry_outside_entry_point.rb.
Its offense message already describes the lookup check: "looks up a model row by id outside initialize. Receive the model you act on and walk its associations, or look the root row up one time in initialize."
Its allowance is DEFAULT_ALLOWED_PATHS = %w[**/*_test.rb **/test/**/*].freeze (line 13).
Its lint lesson plugins/os-sdlc/lint-lessons/sdlc-sequel-registry-outside-entry-point.yml already describes the lookup check, and its key: is the old name.
These sites still carry the old name:

  • plugins/os-sdlc/.rubocop.yml:317 (the Sdlc/Sequel/RegistryOutsideEntryPoint: block, with a stale ratchet comment).
  • plugins/os-sdlc/lint-lessons/sdlc-sequel-registry-outside-entry-point.yml (file name and key:).
  • plugins/os-sdlc/lint-lessons/sdlc-sequel-row-index-on-model.yml:32 (related: entry).
  • plugins/os-sdlc/test/cops/registry_outside_entry_point_test.rb (file name, class name RegistryOutsideEntryPointTest, COP constant).
  • .claude/rules/os-sdlc-architecture.md:58 ("The cop Sdlc/Sequel/RegistryOutsideEntryPoint enforces the lookup part of rule 3").
  • plugins/os-sdlc/design/generated/* (generated; see the stale-text ticket).

Reproduce

n/a: naming defect. Run grep -rn RegistryOutsideEntryPoint plugins/os-sdlc/lib plugins/os-sdlc/lint-lessons plugins/os-sdlc/test plugins/os-sdlc/.rubocop.yml .claude/rules to list the sites.

Approach

Rename the cop to a name that states the check: a model row looked up by id outside initialize.
Pick the new name in the ticket decomposition, in the Sdlc/Sequel/ department (for example Sdlc/Sequel/LookupByIdOutsideInitialize).
Rename the Ruby class, the file, the test, the lint lesson file and its key:, the .rubocop.yml block, the related: entry, and the rules-file sentence.
Delete the stale Exclude: [] ratchet comment in the .rubocop.yml block or keep it only if it is still true.
Leave the cop behavior unchanged.
Use the structure fast path (docs/sdlc-fast-path.md); a rename changes no behavior.

Required work:

  1. Rename the cop class and file — check: absent RegistryOutsideEntryPoint in plugins/os-sdlc/lib/**/*.rb
  2. Rename the config block — check: absent RegistryOutsideEntryPoint in plugins/os-sdlc/.rubocop.yml
  3. Rename the lint lesson key and related: entry — check: absent RegistryOutsideEntryPoint in plugins/os-sdlc/lint-lessons/*.yml
  4. Rename the test — check: absent RegistryOutsideEntryPoint in plugins/os-sdlc/test/**/*.rb

Orchestrator work: update .claude/rules/os-sdlc-architecture.md:58; ticket #1381 names the old cop and describes the deleted registry check, so close or rewrite it.

Rejected: keep the name — it names a deleted check and misleads a reader of an offense line.

Non-goals (optional)

Any change to what the cop reports.

Origin

  • Trigger: ruling 134 deleted the registry check from the cop while Thor replaced Boot (#1646).
  • Improvised this session: none
  • Chain: cop name does not match its check ← ruling 134 removed the registry check (docs/decisions/rulings.tsv, row 134) ← Project#connect(:db) calls Db.connect_project!, which the registry check reported
  • Root candidate: none found (ticket-skeptic)
  • Where: plugins/os-sdlc/lib/os_sdlc/cops/sequel/registry_outside_entry_point.rb
  • Session: a48658d5-b566-40ce-8257-ebeabf56f7e1
  • Transcript: /home/jared/.claude/projects/-home-jared-dev-cc-os-plugins-os-sdlc/a48658d5-b566-40ce-8257-ebeabf56f7e1.jsonl

VERDICT: CREATE
REASON: Ruling 134 left the cop with only the lookup-by-id check; the name is wrong. #1381 describes the deleted registry check and is not the same fault.

## Problem The Ruby cop `Sdlc/Sequel/RegistryOutsideEntryPoint` no longer checks a registry. Ruling 134 (2026-11-10, `docs/decisions/rulings.tsv`) deleted its registry check and its path list. The cop now holds one check: a `Model[id]` lookup outside `initialize`, with a test-path allowance. The name `RegistryOutsideEntryPoint` names a check that is gone. The ruling says: "The cop name no longer fits the check." ## Observed The cop file is `plugins/os-sdlc/lib/os_sdlc/cops/sequel/registry_outside_entry_point.rb`. Its offense message already describes the lookup check: "looks up a model row by id outside initialize. Receive the model you act on and walk its associations, or look the root row up one time in initialize." Its allowance is `DEFAULT_ALLOWED_PATHS = %w[**/*_test.rb **/test/**/*].freeze` (line 13). Its lint lesson `plugins/os-sdlc/lint-lessons/sdlc-sequel-registry-outside-entry-point.yml` already describes the lookup check, and its `key:` is the old name. These sites still carry the old name: - `plugins/os-sdlc/.rubocop.yml:317` (the `Sdlc/Sequel/RegistryOutsideEntryPoint:` block, with a stale ratchet comment). - `plugins/os-sdlc/lint-lessons/sdlc-sequel-registry-outside-entry-point.yml` (file name and `key:`). - `plugins/os-sdlc/lint-lessons/sdlc-sequel-row-index-on-model.yml:32` (`related:` entry). - `plugins/os-sdlc/test/cops/registry_outside_entry_point_test.rb` (file name, class name `RegistryOutsideEntryPointTest`, `COP` constant). - `.claude/rules/os-sdlc-architecture.md:58` ("The cop `Sdlc/Sequel/RegistryOutsideEntryPoint` enforces the lookup part of rule 3"). - `plugins/os-sdlc/design/generated/*` (generated; see the stale-text ticket). ## Reproduce n/a: naming defect. Run `grep -rn RegistryOutsideEntryPoint plugins/os-sdlc/lib plugins/os-sdlc/lint-lessons plugins/os-sdlc/test plugins/os-sdlc/.rubocop.yml .claude/rules` to list the sites. ## Approach Rename the cop to a name that states the check: a model row looked up by id outside `initialize`. Pick the new name in the ticket decomposition, in the `Sdlc/Sequel/` department (for example `Sdlc/Sequel/LookupByIdOutsideInitialize`). Rename the Ruby class, the file, the test, the lint lesson file and its `key:`, the `.rubocop.yml` block, the `related:` entry, and the rules-file sentence. Delete the stale `Exclude: []` ratchet comment in the `.rubocop.yml` block or keep it only if it is still true. Leave the cop behavior unchanged. Use the structure fast path (`docs/sdlc-fast-path.md`); a rename changes no behavior. Required work: 1. Rename the cop class and file — check: absent `RegistryOutsideEntryPoint` in `plugins/os-sdlc/lib/**/*.rb` 2. Rename the config block — check: absent `RegistryOutsideEntryPoint` in `plugins/os-sdlc/.rubocop.yml` 3. Rename the lint lesson key and `related:` entry — check: absent `RegistryOutsideEntryPoint` in `plugins/os-sdlc/lint-lessons/*.yml` 4. Rename the test — check: absent `RegistryOutsideEntryPoint` in `plugins/os-sdlc/test/**/*.rb` Orchestrator work: update `.claude/rules/os-sdlc-architecture.md:58`; ticket #1381 names the old cop and describes the deleted registry check, so close or rewrite it. Rejected: keep the name — it names a deleted check and misleads a reader of an offense line. ## Non-goals (optional) Any change to what the cop reports. ## Origin - Trigger: ruling 134 deleted the registry check from the cop while Thor replaced `Boot` (#1646). - Improvised this session: none - Chain: cop name does not match its check ← ruling 134 removed the registry check (`docs/decisions/rulings.tsv`, row 134) ← `Project#connect(:db)` calls `Db.connect_project!`, which the registry check reported - Root candidate: none found (ticket-skeptic) - Where: plugins/os-sdlc/lib/os_sdlc/cops/sequel/registry_outside_entry_point.rb - Session: a48658d5-b566-40ce-8257-ebeabf56f7e1 - Transcript: /home/jared/.claude/projects/-home-jared-dev-cc-os-plugins-os-sdlc/a48658d5-b566-40ce-8257-ebeabf56f7e1.jsonl VERDICT: CREATE REASON: Ruling 134 left the cop with only the lookup-by-id check; the name is wrong. #1381 describes the deleted registry check and is not the same fault.
Author
Owner

This ticket takes over the one remainder of #1381: replace the test globs in DEFAULT_ALLOWED_PATHS (lib/os_sdlc/cops/sequel/registry_outside_entry_point.rb:13) by shape.

This ticket takes over the one remainder of #1381: replace the test globs in `DEFAULT_ALLOWED_PATHS` (`lib/os_sdlc/cops/sequel/registry_outside_entry_point.rb:13`) by shape.
Author
Owner

Resolution

Done: Renamed the cop to Sdlc/Sequel/LookupByIdOutsideInitialize: class, file, test, lesson, .rubocop.yml block (stale ratchet comment removed), the related entry in sdlc-sequel-row-index-on-model.yml, and .claude/rules/os-sdlc-architecture.md. No behavior change.

Evidence: Commit a2996eb8e on main. Suite: 5326 runs, 0 failures, 0 errors. The renamed cop reports 0 offenses over lib.

Follow-ups: The #1381 remainder (replace the test globs in DEFAULT_ALLOWED_PATHS by shape) is not done; it needs a ruling on the shape (#1450 calls it a separate ruling). It stays on #1381, which is open with the review label. design/generated was regenerated under #1686.

## Resolution **Done:** Renamed the cop to Sdlc/Sequel/LookupByIdOutsideInitialize: class, file, test, lesson, .rubocop.yml block (stale ratchet comment removed), the related entry in sdlc-sequel-row-index-on-model.yml, and .claude/rules/os-sdlc-architecture.md. No behavior change. **Evidence:** Commit a2996eb8e on main. Suite: 5326 runs, 0 failures, 0 errors. The renamed cop reports 0 offenses over lib. **Follow-ups:** The #1381 remainder (replace the test globs in DEFAULT_ALLOWED_PATHS by shape) is not done; it needs a ruling on the shape (#1450 calls it a separate ruling). It stays on #1381, which is open with the review label. design/generated was regenerated under #1686. <!-- os-backlog kind: resolution -->
jared closed this issue 2026-11-12 18:28:12 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
jared/cc-os#1684
No description provided.