Make the new-offense gate ignore metric scores in offense messages #1343

Open
opened 2026-10-25 21:09:47 +00:00 by jared · 1 comment
Owner

Problem

FastGate::NewOffenseCheck keys offenses by [path, cop, message]. Metric cops put the score in the message. An edit that lowers an existing offense score therefore appears as a new offense.

Observed

Metrics/AbcSize message <7, 21, 2> 22.23/15 on main became <6, 19, 1> 19.95/15 after an edit that lowered the score. Layout/LineLength messages carry 125/120. The check reported both as new offenses. bin/os-sdlc-lint and the fast gate both use the check. Seen on Adr::Migration#convert (plugins/os-adr/lib/adr/migration.rb) and plugins/os-sdlc/tests/support/evidence_report_scenario.rb:31.

Reproduce

n/a: found by inspection during #1322. Any edit that lowers a metric score on an existing offense triggers it.

Origin

  • Trigger: fast gate run during #1322
  • Improvised this session: none
  • Chain: improved offense reported as new ← NewOffenseCheck key includes the message ← DESIGN (FastGate::NewOffenseCheck)
  • Root candidate: none found; searched NewOffenseCheck, new offense, reported as new, offense key, offense score, metric score in message
  • Where: FastGate::NewOffenseCheck
  • Session: eb98cdcd-6783-46a0-b7df-cf18a8fe2a56
  • Transcript: /home/jared/.claude/projects/-home-jared-dev-cc-os--claude-worktrees-ticket-1325/eb98cdcd-6783-46a0-b7df-cf18a8fe2a56.jsonl

VERDICT: CREATE

## Problem `FastGate::NewOffenseCheck` keys offenses by [path, cop, message]. Metric cops put the score in the message. An edit that lowers an existing offense score therefore appears as a new offense. ## Observed `Metrics/AbcSize` message `<7, 21, 2> 22.23/15` on main became `<6, 19, 1> 19.95/15` after an edit that lowered the score. `Layout/LineLength` messages carry `125/120`. The check reported both as new offenses. `bin/os-sdlc-lint` and the fast gate both use the check. Seen on `Adr::Migration#convert` (plugins/os-adr/lib/adr/migration.rb) and plugins/os-sdlc/tests/support/evidence_report_scenario.rb:31. ## Reproduce n/a: found by inspection during #1322. Any edit that lowers a metric score on an existing offense triggers it. ## Origin - Trigger: fast gate run during #1322 - Improvised this session: none - Chain: improved offense reported as new ← NewOffenseCheck key includes the message ← DESIGN (FastGate::NewOffenseCheck) - Root candidate: none found; searched NewOffenseCheck, new offense, reported as new, offense key, offense score, metric score in message - Where: FastGate::NewOffenseCheck - Session: eb98cdcd-6783-46a0-b7df-cf18a8fe2a56 - Transcript: /home/jared/.claude/projects/-home-jared-dev-cc-os--claude-worktrees-ticket-1325/eb98cdcd-6783-46a0-b7df-cf18a8fe2a56.jsonl VERDICT: CREATE
Author
Owner

Occurrence: fast-gate NewOffenseCheck reports a smaller Metrics offense as new
Seen: fast-gate NewOffenseCheck
Run: fast-batch-15, session 01c29715
Adds: Metrics length messages carry the count, for example Metrics/ClassLength [144/100] on the branch against 145/100 on main. The offense got smaller, but the gate reported it as new and failed.

Occurrence: fast-gate NewOffenseCheck reports a smaller Metrics offense as new Seen: fast-gate NewOffenseCheck Run: fast-batch-15, session 01c29715 Adds: Metrics length messages carry the count, for example Metrics/ClassLength [144/100] on the branch against 145/100 on main. The offense got smaller, but the gate reported it as new and failed.
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#1343
No description provided.