os-sdlc .rubocop.yml: allow trailing HTTP status codes in identifiers (Naming/VariableNumber AllowedPatterns) #230

Open
opened 2026-08-01 21:59:57 +00:00 by jared · 2 comments
Owner

During a fix-lints run on caldotcom-api, Naming/VariableNumber forced the rename test_unprocessable_entity_raised_on_422test_unprocessable_entity_raised_on_four_hundred_twenty_two. For API-wrapper test suites, "422" is domain vocabulary (HTTP status), and the spelled-out form is harder to read and grep.

Proposed change to the plugin's shipped .rubocop.yml:

Naming/VariableNumber:
  AllowedPatterns:
    - '_(?:[1-5]\d{2})$'

Deliberately narrow scope: only identifiers ending in _<valid HTTP status> (100–599) are exempt, so an agent cannot use this to sneak arbitrary numeric names past the cop (test_thing2, test_422_foo, retry_5x all still flag). Per the fix-lints exemption ladder, filing for human application rather than editing plugin config from a session.


Discoverer: /home/jared/dev/ruby-gems/caldotcom-api, session 640995ae-717a-443c-9430-772546887b90, 2026-08-01. Cop conflict surfaced during /os-sdlc:fix-lints residual phase; user requested this ticket.

During a fix-lints run on caldotcom-api, `Naming/VariableNumber` forced the rename `test_unprocessable_entity_raised_on_422` → `test_unprocessable_entity_raised_on_four_hundred_twenty_two`. For API-wrapper test suites, "422" is domain vocabulary (HTTP status), and the spelled-out form is harder to read and grep. Proposed change to the plugin's shipped `.rubocop.yml`: ```yaml Naming/VariableNumber: AllowedPatterns: - '_(?:[1-5]\d{2})$' ``` Deliberately narrow scope: only identifiers ending in `_<valid HTTP status>` (100–599) are exempt, so an agent cannot use this to sneak arbitrary numeric names past the cop (`test_thing2`, `test_422_foo`, `retry_5x` all still flag). Per the fix-lints exemption ladder, filing for human application rather than editing plugin config from a session. -------- **Discoverer:** /home/jared/dev/ruby-gems/caldotcom-api, session 640995ae-717a-443c-9430-772546887b90, 2026-08-01. Cop conflict surfaced during /os-sdlc:fix-lints residual phase; user requested this ticket.
Author
Owner

This was generated by AI during triage.

Agent Brief (human)

Category: enhancement
Summary: Add a Naming/VariableNumber AllowedPatterns exemption for trailing HTTP status codes to the plugin's shipped rubocop config

Why human: Per the fix-lints exemption ladder, shipped plugin lint config is edited only by a human — an agent granting itself a cop exemption is exactly what the ladder exists to prevent. The change itself is one stanza.

Current behavior:
Naming/VariableNumber forces renames like test_unprocessable_entity_raised_on_422test_unprocessable_entity_raised_on_four_hundred_twenty_two in API-wrapper test suites, where the numeric status code is domain vocabulary and the spelled-out form is harder to read and grep.

Desired behavior:
Identifiers ending in _<valid HTTP status> (100–599) are exempt; everything else still flags (test_thing2, test_422_foo, retry_5x all still offend). Proposed stanza for the shipped .rubocop.yml:

Naming/VariableNumber:
  AllowedPatterns:
    - '_(?:[1-5]\d{2})$'

Acceptance criteria:

  • test_unprocessable_entity_raised_on_422 no longer offends under the shipped config
  • test_thing2 and test_422_foo still offend
  • bin/refresh-plugins run after the config edit

Out of scope:

  • Any other cop exemption
  • Per-project overrides (projects can still layer their own config)
> *This was generated by AI during triage.* ## Agent Brief (human) **Category:** enhancement **Summary:** Add a `Naming/VariableNumber` AllowedPatterns exemption for trailing HTTP status codes to the plugin's shipped rubocop config **Why human:** Per the fix-lints exemption ladder, shipped plugin lint config is edited only by a human — an agent granting itself a cop exemption is exactly what the ladder exists to prevent. The change itself is one stanza. **Current behavior:** `Naming/VariableNumber` forces renames like `test_unprocessable_entity_raised_on_422` → `test_unprocessable_entity_raised_on_four_hundred_twenty_two` in API-wrapper test suites, where the numeric status code is domain vocabulary and the spelled-out form is harder to read and grep. **Desired behavior:** Identifiers ending in `_<valid HTTP status>` (100–599) are exempt; everything else still flags (`test_thing2`, `test_422_foo`, `retry_5x` all still offend). Proposed stanza for the shipped `.rubocop.yml`: ```yaml Naming/VariableNumber: AllowedPatterns: - '_(?:[1-5]\d{2})$' ``` **Acceptance criteria:** - [ ] `test_unprocessable_entity_raised_on_422` no longer offends under the shipped config - [ ] `test_thing2` and `test_422_foo` still offend - [ ] `bin/refresh-plugins` run after the config edit **Out of scope:** - Any other cop exemption - Per-project overrides (projects can still layer their own config)
Author
Owner

Frozen in the 2026-08-16 backlog reset — see #419 for the expiry procedure. Do not work unless a live run rediscovers this issue.

Frozen in the 2026-08-16 backlog reset — see #419 for the expiry procedure. Do not work unless a live run rediscovers this issue.
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#230
No description provided.