Move method to owner: CommandController superclass for the seven commands (copied:defn:8a8c27d3) #1090

Closed
opened 2026-10-17 16:37:11 +00:00 by jared · 4 comments
Owner

Problem

copied:defn:8a8c27d3 (copied_entry, score 25) spans 5 classes in concepts CrcCensus, CrcFile, CrcJobs, CrcRecords, CrcTickets.

  • OsSdlc::CrcCensus::Command (/home/jared/dev/cc-os/plugins/os-sdlc/lib/os_sdlc/crc_census/command.rb:17)
  • OsSdlc::CrcFile::Command (/home/jared/dev/cc-os/plugins/os-sdlc/lib/os_sdlc/crc_file/command.rb:11)
  • OsSdlc::CrcJobs::Command (/home/jared/dev/cc-os/plugins/os-sdlc/lib/os_sdlc/crc_jobs/command.rb:11)
  • OsSdlc::CrcRecords::Command (/home/jared/dev/cc-os/plugins/os-sdlc/lib/os_sdlc/crc_records/command.rb:9)
  • OsSdlc::CrcTickets::Command (/home/jared/dev/cc-os/plugins/os-sdlc/lib/os_sdlc/crc_tickets/command.rb:22)

IDENTICAL :defn mass 450; role controller

Approach

The copied or misplaced behavior belongs to one owner; move it there, callers delegate. Object: OsSdlc::CommandController. The copied defn is the memoized line that builds CommandLine from USAGE, @argv, @out, and @err with an options(parser) hook; it moves once into a new superclass OsSdlc::CommandController that owns the (argv, out, err, cwd) entry contract and the CommandLine it builds, and each of the seven commands inherits it, keeps its own USAGE, options(parser), and state set after super, so the copy is deleted rather than shared. The (argv, out, err, cwd) entry contract stays intact per the reject-expected clump ruling, and

Required work:

  1. OsSdlc::CrcCensus::Command takes argv, out, err, cwd — check: absent def line in plugins/os-sdlc/lib/os_sdlc/crc_census/command.rb
  2. OsSdlc::CrcFile::Command takes argv, out, err, cwd — check: absent def line in plugins/os-sdlc/lib/os_sdlc/crc_file/command.rb
  3. OsSdlc::CrcJobs::Command takes argv, out, err, cwd — check: absent def line in plugins/os-sdlc/lib/os_sdlc/crc_jobs/command.rb
  4. OsSdlc::CrcRecords::Command takes argv, out, err, cwd — check: absent def line in plugins/os-sdlc/lib/os_sdlc/crc_records/command.rb
  5. OsSdlc::CrcSweep::Command takes argv, out, err, cwd — check: absent def line in plugins/os-sdlc/lib/os_sdlc/crc_sweep/command.rb
  6. OsSdlc::CrcTickets::Command takes argv, out, err, cwd — check: absent def line in plugins/os-sdlc/lib/os_sdlc/crc_tickets/command.rb
  7. OsSdlc::CollaboratorPass::Command takes argv, out, err, cwd — check: present CommandController in plugins/os-sdlc/lib/os_sdlc/collaborator_pass/command.rb

Orchestrator work: re-measure with bin/collaborator-pass measure --runs docs/crc/os-sdlc/collaborator-runs, then stop-check.

Acceptance criteria

  1. Given today's lib, when bin/collaborator-pass measure --sources params,inward,flay runs after the change, then the copied_entry finding copied:defn:8a8c27d3 scores at most 0 (was 25) and none of appears in its names.
  2. Given each of the seven bins with the argv of its existing tests, when it runs, then its stdout, stderr, and exit code are unchanged.
  3. Given -h or a missing positional argument for any of the seven commands, when it runs, then it prints the same usage text and exits 0 or 2 as before.
  4. Given the os-sdlc suite after the move, when Flay runs over lib/os_sdlc, then no IDENTICAL :defn finding names the command controllers.

Owner sketch

OsSdlc::CommandController = Data.define(:initialize, :line, :options)

class OsSdlc::CrcCensus::Command
  def initialize(argv, out, err, cwd)
  end
end

class OsSdlc::CrcFile::Command
  def initialize(argv, out, err, cwd)
  end
end

class OsSdlc::CrcJobs::Command
  def initialize(argv, out, err, cwd)
  end
end

class OsSdlc::CrcRecords::Command
  def initialize(argv, out, err, cwd)
  end
end

class OsSdlc::CrcSweep::Command
  def initialize(argv, out, err, cwd)
  end
end

class OsSdlc::CrcTickets::Command
  def initialize(argv, out, err, cwd)
  end
end

class OsSdlc::CollaboratorPass::Command
  def initialize(argv, out, err, cwd)
  end
end

Origin

  • Trigger: bin/collaborator-pass run 20261017T163118Z
  • Improvised this session: none
  • Chain: copied:defn:8a8c27d3 across 5 classes ← DESIGN (plugins/os-sdlc/lib/os_sdlc/crc_census/command.rb)
  • Root candidate: this ticket
  • Where: plugins/os-sdlc/lib/os_sdlc/crc_census/command.rb
  • Session: f1eaf768-77b4-48c7-afde-b0344f519273
  • Transcript: /home/jared/.claude/projects/-home-jared-dev-cc-os/f1eaf768-77b4-48c7-afde-b0344f519273.jsonl
## Problem copied:defn:8a8c27d3 (copied_entry, score 25) spans 5 classes in concepts CrcCensus, CrcFile, CrcJobs, CrcRecords, CrcTickets. - `OsSdlc::CrcCensus::Command` (`/home/jared/dev/cc-os/plugins/os-sdlc/lib/os_sdlc/crc_census/command.rb:17`) - `OsSdlc::CrcFile::Command` (`/home/jared/dev/cc-os/plugins/os-sdlc/lib/os_sdlc/crc_file/command.rb:11`) - `OsSdlc::CrcJobs::Command` (`/home/jared/dev/cc-os/plugins/os-sdlc/lib/os_sdlc/crc_jobs/command.rb:11`) - `OsSdlc::CrcRecords::Command` (`/home/jared/dev/cc-os/plugins/os-sdlc/lib/os_sdlc/crc_records/command.rb:9`) - `OsSdlc::CrcTickets::Command` (`/home/jared/dev/cc-os/plugins/os-sdlc/lib/os_sdlc/crc_tickets/command.rb:22`) IDENTICAL :defn mass 450; role controller ## Approach The copied or misplaced behavior belongs to one owner; move it there, callers delegate. Object: `OsSdlc::CommandController`. The copied defn is the memoized `line` that builds CommandLine from USAGE, @argv, @out, and @err with an options(parser) hook; it moves once into a new superclass OsSdlc::CommandController that owns the (argv, out, err, cwd) entry contract and the CommandLine it builds, and each of the seven commands inherits it, keeps its own USAGE, options(parser), and state set after super, so the copy is deleted rather than shared. The (argv, out, err, cwd) entry contract stays intact per the reject-expected clump ruling, and Required work: 1. `OsSdlc::CrcCensus::Command` takes `argv, out, err, cwd` — check: absent `def line` in `plugins/os-sdlc/lib/os_sdlc/crc_census/command.rb` 2. `OsSdlc::CrcFile::Command` takes `argv, out, err, cwd` — check: absent `def line` in `plugins/os-sdlc/lib/os_sdlc/crc_file/command.rb` 3. `OsSdlc::CrcJobs::Command` takes `argv, out, err, cwd` — check: absent `def line` in `plugins/os-sdlc/lib/os_sdlc/crc_jobs/command.rb` 4. `OsSdlc::CrcRecords::Command` takes `argv, out, err, cwd` — check: absent `def line` in `plugins/os-sdlc/lib/os_sdlc/crc_records/command.rb` 5. `OsSdlc::CrcSweep::Command` takes `argv, out, err, cwd` — check: absent `def line` in `plugins/os-sdlc/lib/os_sdlc/crc_sweep/command.rb` 6. `OsSdlc::CrcTickets::Command` takes `argv, out, err, cwd` — check: absent `def line` in `plugins/os-sdlc/lib/os_sdlc/crc_tickets/command.rb` 7. `OsSdlc::CollaboratorPass::Command` takes `argv, out, err, cwd` — check: present `CommandController` in `plugins/os-sdlc/lib/os_sdlc/collaborator_pass/command.rb` Orchestrator work: re-measure with bin/collaborator-pass measure --runs docs/crc/os-sdlc/collaborator-runs, then stop-check. ## Acceptance criteria 1. Given today's lib, when bin/collaborator-pass measure --sources params,inward,flay runs after the change, then the copied_entry finding copied:defn:8a8c27d3 scores at most 0 (was 25) and none of appears in its names. 2. Given each of the seven bins with the argv of its existing tests, when it runs, then its stdout, stderr, and exit code are unchanged. 3. Given -h or a missing positional argument for any of the seven commands, when it runs, then it prints the same usage text and exits 0 or 2 as before. 4. Given the os-sdlc suite after the move, when Flay runs over lib/os_sdlc, then no IDENTICAL :defn finding names the command controllers. ## Owner sketch ```ruby OsSdlc::CommandController = Data.define(:initialize, :line, :options) class OsSdlc::CrcCensus::Command def initialize(argv, out, err, cwd) end end class OsSdlc::CrcFile::Command def initialize(argv, out, err, cwd) end end class OsSdlc::CrcJobs::Command def initialize(argv, out, err, cwd) end end class OsSdlc::CrcRecords::Command def initialize(argv, out, err, cwd) end end class OsSdlc::CrcSweep::Command def initialize(argv, out, err, cwd) end end class OsSdlc::CrcTickets::Command def initialize(argv, out, err, cwd) end end class OsSdlc::CollaboratorPass::Command def initialize(argv, out, err, cwd) end end ``` ## Origin - Trigger: bin/collaborator-pass run 20261017T163118Z - Improvised this session: none - Chain: copied:defn:8a8c27d3 across 5 classes ← DESIGN (`plugins/os-sdlc/lib/os_sdlc/crc_census/command.rb`) - Root candidate: this ticket - Where: plugins/os-sdlc/lib/os_sdlc/crc_census/command.rb - Session: f1eaf768-77b4-48c7-afde-b0344f519273 - Transcript: /home/jared/.claude/projects/-home-jared-dev-cc-os/f1eaf768-77b4-48c7-afde-b0344f519273.jsonl
Author
Owner

Work started 2026-10-17 on branch ticket-1090 via /os-sdlc:implement, dispatched by the collaborator pass loop (run 20261017T163118Z, iteration 3). delta-check (#1089) runs before merge.

Work started 2026-10-17 on branch ticket-1090 via /os-sdlc:implement, dispatched by the collaborator pass loop (run 20261017T163118Z, iteration 3). delta-check (#1089) runs before merge.
Author
Owner

Session wrap 2026-10-17: implementation 60 waits at needs-orchestrator after escalation 32 (unexpected_pass at test-writer round 2; same shape as #1086: pure refactor, the existing bin tests guard it). Nothing is implemented yet; branch ticket-1090 holds the worktree state. Next step per the escalation procedure: hand-finish (implement CommandController per the recipe at docs/crc/os-sdlc/collaborator-runs/20261017T163118Z/recipes/copied-defn-8a8c27d3.yml, suite, lint, one design audit, delta-check against baseline run 20261017T163118Z, then commit, merge, close, abandon run 60).

Session wrap 2026-10-17: implementation 60 waits at needs-orchestrator after escalation 32 (unexpected_pass at test-writer round 2; same shape as #1086: pure refactor, the existing bin tests guard it). Nothing is implemented yet; branch ticket-1090 holds the worktree state. Next step per the escalation procedure: hand-finish (implement CommandController per the recipe at docs/crc/os-sdlc/collaborator-runs/20261017T163118Z/recipes/copied-defn-8a8c27d3.yml, suite, lint, one design audit, delta-check against baseline run 20261017T163118Z, then commit, merge, close, abandon run 60).
Author
Owner

Blocked on the next session; label waiting applied by hand if needed. Blocker: session context limit, not a defect.

Blocked on the next session; label waiting applied by hand if needed. Blocker: session context limit, not a defect.
Author
Owner

Resolution

Done: OsSdlc::CommandController superclass owns initialize(argv, out, err, cwd) and the memoized line that builds CommandLine with an options(parser) hook; the seven commands inherit it one level deep and keep their USAGE and hook; the byte-identical line copies from #1088 are deleted.

Evidence: Commit f1460db4 merged to main. Suite 2042 runs, 0 failures. Rubocop clean on touched files. delta-check against run 20261017T163118Z: finding copied:defn:8a8c27d3 25 -> 0, copied_entry 49 -> 25, data_clump 309 -> 263, no shape rose. Implementation 60 escalated (unexpected_pass, pure refactor) and was hand-finished with suite, lint, one opus design audit.

Follow-ups: #1091 UnusedPrivateMethod cop flags superclass-called hooks (skeptic CREATE); line and options stay protected until it ships. None else.

## Resolution **Done:** OsSdlc::CommandController superclass owns initialize(argv, out, err, cwd) and the memoized line that builds CommandLine with an options(parser) hook; the seven commands inherit it one level deep and keep their USAGE and hook; the byte-identical line copies from #1088 are deleted. **Evidence:** Commit f1460db4 merged to main. Suite 2042 runs, 0 failures. Rubocop clean on touched files. delta-check against run 20261017T163118Z: finding copied:defn:8a8c27d3 25 -> 0, copied_entry 49 -> 25, data_clump 309 -> 263, no shape rose. Implementation 60 escalated (unexpected_pass, pure refactor) and was hand-finished with suite, lint, one opus design audit. **Follow-ups:** #1091 UnusedPrivateMethod cop flags superclass-called hooks (skeptic CREATE); line and options stay protected until it ships. None else.
jared closed this issue 2026-10-17 16:51:41 +00:00
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#1090
No description provided.