Investigate lint_changed hook edits to unplanned files #1387

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

Problem

The os-sdlc lint_changed PostToolUse hook changes files that the agent did not plan to change. Builders must work around it, and the diff grows with unrelated edits.

Observed

The hook runs rubocop -a after Write and after ast-grep -U.
It wraps lines and adds MethodLength offenses in files the agent did not plan to change.
Builders worked around it with Bash edits.

Reproduce

n/a: the exact command is not recorded; see finding memos under docs/crc/os-sdlc/fast-batch-15/ on branch fast-batch-15.

Approach

Find which edits the hook rewrites, which cops cause the wrapped lines and MethodLength offenses, and whether the hook should autocorrect at all. State a decision.

Origin

  • Trigger: builder edits during fast-batch-15
  • Improvised this session: builders used Bash edits to avoid the hook
  • Chain: unplanned changes in files ← lint_changed runs rubocop -a after Write and ast-grep -U ← IMPROVISATION (Bash edits)
  • Root candidate: none found; searched lint_changed, autocorrect, rubocop -a, ast-grep -U
  • VERDICT: CREATE
  • Where: os-sdlc lint_changed PostToolUse hook
  • Session: 01c29715-c945-43b4-86fc-6c5fc6c4dd3f
  • Transcript: /home/jared/.claude/projects/-home-jared-dev-cc-os/01c29715-c945-43b4-86fc-6c5fc6c4dd3f.jsonl
## Problem The os-sdlc lint_changed PostToolUse hook changes files that the agent did not plan to change. Builders must work around it, and the diff grows with unrelated edits. ## Observed The hook runs rubocop -a after Write and after ast-grep -U. It wraps lines and adds MethodLength offenses in files the agent did not plan to change. Builders worked around it with Bash edits. ## Reproduce n/a: the exact command is not recorded; see finding memos under docs/crc/os-sdlc/fast-batch-15/ on branch fast-batch-15. ## Approach Find which edits the hook rewrites, which cops cause the wrapped lines and MethodLength offenses, and whether the hook should autocorrect at all. State a decision. ## Origin - Trigger: builder edits during fast-batch-15 - Improvised this session: builders used Bash edits to avoid the hook - Chain: unplanned changes in files ← lint_changed runs rubocop -a after Write and ast-grep -U ← IMPROVISATION (Bash edits) - Root candidate: none found; searched lint_changed, autocorrect, rubocop -a, ast-grep -U - VERDICT: CREATE - Where: os-sdlc lint_changed PostToolUse hook - Session: 01c29715-c945-43b4-86fc-6c5fc6c4dd3f - Transcript: /home/jared/.claude/projects/-home-jared-dev-cc-os/01c29715-c945-43b4-86fc-6c5fc6c4dd3f.jsonl
Author
Owner

Occurrence: Stop the lint_changed hook from autocorrecting files the builder did not plan to change
Seen: plugins/os-sdlc hooks lint_changed
Run: Session 6c6b6eae-4ebd-4ac4-9b32-535875a6b39b, fast-batch-15 ruling R22
Adds: in fast-batch-15 the stranger review flagged the churn (teardown order, assert_path_exists in plugins/os-aidd-lint/tests) as spec creep; ruling R22 accepted it as hook output. Each batch review now spends a row on it.

Occurrence: Stop the lint_changed hook from autocorrecting files the builder did not plan to change Seen: plugins/os-sdlc hooks lint_changed Run: Session 6c6b6eae-4ebd-4ac4-9b32-535875a6b39b, fast-batch-15 ruling R22 Adds: in fast-batch-15 the stranger review flagged the churn (teardown order, assert_path_exists in plugins/os-aidd-lint/tests) as spec creep; ruling R22 accepted it as hook output. Each batch review now spends a row on it.
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#1387
No description provided.