Make fix-lints autocorrect keep layout and give the residual phase an input #1446

Open
opened 2026-10-27 21:09:56 +00:00 by jared · 2 comments
Owner

Problem

Two steps of the /os-sdlc:fix-lints procedure do not work as written. The autocorrect phase damages the layout of the lines it fixes. The residual phase needs an input file that no step of the run writes.

Observed

  1. The worklist prints rubocop -a --only Layout/LineLength,Minitest/AssertPredicate,Minitest/RefutePredicate. The unit ran the same cops through OsSdlc::Lint::Run#correct (lesson from #1441). Layout/LineLength autocorrect split each long line at a comma or a block brace. The other Layout/* cops are not in --only, so the split lines kept trailing whitespace and had a continuation line at column 0. All four Layout/LineLength fixes needed a hand edit. Example from plugins/os-sdlc/tests/support/ticket_fixture.rb:
    File.write(path, 
"---\nnumber: #{number}\ntitle: Fixture ticket #{number}\nstate: open\nlabels: category/code-change\n---\n#{body}\n")
  1. Workflow step 5 runs bin/lint-worklist --residual <path> against "the autocorrect pre-pass's residual report (ticket #217)". No command in the run writes that report. .sdlc/tmp/ held only lint-batch/ and lint-burndown.json. The unit replaced step 5 with a full gate-config lint of the target.

Reproduce

plugins/os-sdlc/bin/lint-worklist --target os-sdlc --new
ls .sdlc/tmp/

Approach

Suggested: the autocorrect phase runs the printed cops together with the Layout/* cops that clean up after a split (or prints a command that does). Step 5 either names the command that writes the residual report, or the worklist writes it, or the step is removed in favor of a full-target lint.

Origin

  • Trigger: /os-sdlc:fix-lints on target os-sdlc, 2026-10-27
  • Improvised this session: hand edits for the four split lines; a full-target lint in place of step 5.
  • Chain: residual step cannot run ← no writer for the #217 residual report (DESIGN: plugins/os-sdlc/skills/fix-lints/references/residual-phase.md); broken split lines ← --only subset excludes the Layout/* cops that repair a split (DESIGN: plugins/os-sdlc/lib/os_sdlc/lint/worklist.rb)
  • Root candidate: none found; searched fix-lints, autocorrect, residual, rubocop -a, Layout/LineLength, #217, #220, lint-worklist (nearest #1441: config chain, a different fault)
  • Where: plugins/os-sdlc/skills/fix-lints/SKILL.md, plugins/os-sdlc/lib/os_sdlc/lint/worklist.rb
  • Session: 9f415790-a6bd-4850-8d70-3dd45004ce2b
  • Transcript: /home/jared/.claude/projects/-home-jared-dev-cc-os/9f415790-a6bd-4850-8d70-3dd45004ce2b.jsonl

VERDICT: CREATE

## Problem Two steps of the `/os-sdlc:fix-lints` procedure do not work as written. The autocorrect phase damages the layout of the lines it fixes. The residual phase needs an input file that no step of the run writes. ## Observed 1. The worklist prints `rubocop -a --only Layout/LineLength,Minitest/AssertPredicate,Minitest/RefutePredicate`. The unit ran the same cops through `OsSdlc::Lint::Run#correct` (lesson from #1441). `Layout/LineLength` autocorrect split each long line at a comma or a block brace. The other `Layout/*` cops are not in `--only`, so the split lines kept trailing whitespace and had a continuation line at column 0. All four `Layout/LineLength` fixes needed a hand edit. Example from `plugins/os-sdlc/tests/support/ticket_fixture.rb`: ``` File.write(path, "---\nnumber: #{number}\ntitle: Fixture ticket #{number}\nstate: open\nlabels: category/code-change\n---\n#{body}\n") ``` 2. Workflow step 5 runs `bin/lint-worklist --residual <path>` against "the autocorrect pre-pass's residual report (ticket #217)". No command in the run writes that report. `.sdlc/tmp/` held only `lint-batch/` and `lint-burndown.json`. The unit replaced step 5 with a full gate-config lint of the target. ## Reproduce ``` plugins/os-sdlc/bin/lint-worklist --target os-sdlc --new ls .sdlc/tmp/ ``` ## Approach Suggested: the autocorrect phase runs the printed cops together with the `Layout/*` cops that clean up after a split (or prints a command that does). Step 5 either names the command that writes the residual report, or the worklist writes it, or the step is removed in favor of a full-target lint. ## Origin - Trigger: `/os-sdlc:fix-lints` on target os-sdlc, 2026-10-27 - Improvised this session: hand edits for the four split lines; a full-target lint in place of step 5. - Chain: residual step cannot run ← no writer for the #217 residual report (DESIGN: plugins/os-sdlc/skills/fix-lints/references/residual-phase.md); broken split lines ← `--only` subset excludes the `Layout/*` cops that repair a split (DESIGN: plugins/os-sdlc/lib/os_sdlc/lint/worklist.rb) - Root candidate: none found; searched fix-lints, autocorrect, residual, rubocop -a, Layout/LineLength, #217, #220, lint-worklist (nearest #1441: config chain, a different fault) - Where: plugins/os-sdlc/skills/fix-lints/SKILL.md, plugins/os-sdlc/lib/os_sdlc/lint/worklist.rb - Session: 9f415790-a6bd-4850-8d70-3dd45004ce2b - Transcript: /home/jared/.claude/projects/-home-jared-dev-cc-os/9f415790-a6bd-4850-8d70-3dd45004ce2b.jsonl VERDICT: CREATE
Author
Owner

Second fix-lints run (os-aidd-lint, merged 7a92525b, 2026-10-27) hit more process defects of the same kind:

  1. The batch checkpoint row got the label "After autocorrect" again. The checkpoint label logic is wrong.
  2. Lint::Run#correct has no CLI flag; the run had to call it from a script.
  3. While known false positives (RawFileContentAssertion, ruling 2026-10-27) remain, lint-worklist never prints "Worklist clear", so the skill's done rule cannot be met. Same root as item 3 of the os-sdlc run.
  4. lint-worklist does not report existing rubocop:disable comments; the run found 17 by hand.
Second fix-lints run (os-aidd-lint, merged 7a92525b, 2026-10-27) hit more process defects of the same kind: 1. The batch checkpoint row got the label "After autocorrect" again. The checkpoint label logic is wrong. 2. Lint::Run#correct has no CLI flag; the run had to call it from a script. 3. While known false positives (RawFileContentAssertion, ruling 2026-10-27) remain, lint-worklist never prints "Worklist clear", so the skill's done rule cannot be met. Same root as item 3 of the os-sdlc run. 4. lint-worklist does not report existing rubocop:disable comments; the run found 17 by hand.
Author
Owner

Third and fourth fix-lints runs (os-adr df7b26bd, cc-architect f138ee07, os 189c039f, 2026-10-27): batch agents ran git stash / git stash pop in the shared worktree; one later agent popped an unrelated older stash entry. The skill or batch-agent brief should forbid git stash. Also: fix moves an offense to a different cop, so a checkpoint shows no progress and can send work back from iterative to batch.

Third and fourth fix-lints runs (os-adr df7b26bd, cc-architect f138ee07, os 189c039f, 2026-10-27): batch agents ran `git stash` / `git stash pop` in the shared worktree; one later agent popped an unrelated older stash entry. The skill or batch-agent brief should forbid git stash. Also: fix moves an offense to a different cop, so a checkpoint shows no progress and can send work back from iterative to batch.
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#1446
No description provided.