Lesson catalog: default lesson for every acted-on offense, not only Sdlc cops #1419
Labels
No labels
P0
P1
P2
P3
bug
category/code-change
category/cross-repo
category/eval-run
category/investigation
category/no-test-target
category/owner-ruling
category/prose-artifact
category/recurring-chore
category/structure
category/umbrella
crc-refactor
create
delete
enhancement
filed-by/agent
filed-by/user
frozen
lint-rule
needs-info
needs-triage
next
plugin/cc-architect
plugin/os
plugin/os-adr
plugin/os-aidd-lint
plugin/os-backlog
plugin/os-context
plugin/os-doc-hygiene
plugin/os-sdlc
plugin/os-vault
project/cc-os
ready-for-agent
ready-for-human
recurring
review
rule-proposal
update
waiting
wayfinder:grilling
wayfinder:map
wayfinder:map
wayfinder:research
wayfinder:task
wayfinder:task
wontfix
worklist/deviations
worklist/lint-rule
worklist/new-implement-build
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
jared/cc-os#1419
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Problem
#1414 gives the
_no-lesson-yetdefault only toSdlc/*keys. Jared ruled on 2026-10-27 that every offense the AI must act on gets a lesson, in any department. The only exception is a formatting cop that rubocop fixes by itself. Today aMetrics/AbcSize,Lint/*or detector offense with no lesson file reaches the agent with no guidance, and the agent guesses what the offense means.Reproduce
n/a: design gap;
Lesson::Catalog#lesson("Metrics/AbcSize")returns nil, so the relay drops the cop.Approach
The gate lints without
-a(plugins/os-sdlc/lib/os_sdlc/lint/run.rb:21-23), so autocorrectable offenses reach the relay. The code cannot rely on an autocorrect pass. The exception is therefore explicit: aLayout/*orStyle/*cop whose class supports autocorrect gets no default. Every other key gets the default.Sdlc/Dry/HandRolledFetchautocorrects, and its autocorrect is the #1346 bug).Lint/*autocorrectable cops get a lesson (Lint/UnusedMethodArgumentautocorrect only adds_, which can hide the smoke).Required work:
Sdlc/guard with the format-only exception — check: absentstart_with?("Sdlc/")inplugins/os-sdlc/lib/os_sdlc/lesson/catalog/cop_key.rbRejected: no exception — Jared ruled formatting cops need no lesson context.
Rejected: exempt every autocorrectable cop — catches Sdlc and Lint cops whose autocorrect hides the smoke.
Acceptance criteria
Metrics/AbcSizewith no lesson file, when the catalog looks it up, then it returns the default lesson namingMetrics/AbcSize.Layout/IndentationWidthwith no lesson file, when the catalog looks it up, then it returns nil.Lint/*cop with no lesson file, when the catalog looks it up, then it returns the default lesson.Sdlc/*cop with no lesson file, when the catalog looks it up, then it returns the default lesson.Owner sketch
Origin
CopKey#sdlc?guard inCatalog#lesson(plugins/os-sdlc/lib/os_sdlc/lesson/catalog.rb) ← DESIGN (#1414 scope cut, overruled)plugins/os-sdlc/lib/os_sdlc/lesson/catalog/cop_key.rbVERDICT: CREATE
Work started on branch ticket-1419 through /os-sdlc:implement (poodr-ticket-implementation).
Resolution
Done: CopKey#needs_lesson? replaces the Sdlc-only guard: every key gets the _no-lesson-yet default except Layout/Style cops whose class supports autocorrect.
Evidence: Implementation 185 complete (10 dispatches, 0 retries, 8 min 58 s); commit
f86d591fmerged to main; os-sdlc suite on main 2766 runs, 0 failures.Follow-ups: #1424: render the default lesson once per reply, naming every cop without a lesson (Jared's design, 2026-10-27).
Follow-up fix on main
aa6f984f(pattern-detection track, session 47f54f99): CopKey#cop_class reads RuboCop::Cop::Registry but the SubagentStart hook process never required rubocop, so every brief with lint-offense history raised NameError and recorded no dispatch (seen twice on implementation 186). Added require "rubocop" at the top of lesson/catalog/cop_key.rb. No behavior change.