Move method to owner: CommandLine for the seven commands (copied:defn:b47f392a) #1088

Closed
opened 2026-10-17 16:17:42 +00:00 by jared · 2 comments
Owner

Problem

copied:defn:b47f392a (copied_entry, score 4) spans 2 classes in concepts CrcFile, CrcTickets.

  • OsSdlc::CrcFile::Command (/home/jared/dev/cc-os/plugins/os-sdlc/lib/os_sdlc/crc_file/command.rb:11)
  • OsSdlc::CrcTickets::Command (/home/jared/dev/cc-os/plugins/os-sdlc/lib/os_sdlc/crc_tickets/command.rb:22)

SIMILAR :defn mass 36; role controller

Approach

The copied or misplaced behavior belongs to one owner; move it there, callers delegate. Object: OsSdlc::CommandLine (built at plugins/os-sdlc/lib/os_sdlc/collaborator_pass/command.rb). OsSdlc::CommandLine is extracted from the table-driven OptionParser loop in CollaboratorPass::Command, not written new beside it, so all seven commands use the one owner; it also removes copied:iter:2ebcafd5, copied:resbody:28c01396, copied:cdecl:59d86c10.

Required work:

  1. OsSdlc::CrcFile::Command takes argv, out, err, cwd — check: absent OptionParser.new in plugins/os-sdlc/lib/os_sdlc/crc_file/command.rb
  2. OsSdlc::CrcJobs::Command takes argv, out, err, cwd — check: absent OptionParser.new in plugins/os-sdlc/lib/os_sdlc/crc_jobs/command.rb
  3. OsSdlc::CrcRecords::Command takes argv, out, err, cwd — check: absent OptionParser.new in plugins/os-sdlc/lib/os_sdlc/crc_records/command.rb
  4. OsSdlc::CrcCensus::Command takes argv, out, err, cwd — check: absent OptionParser.new in plugins/os-sdlc/lib/os_sdlc/crc_census/command.rb
  5. OsSdlc::CrcSweep::Command takes argv, out, err, cwd — check: absent OptionParser.new in plugins/os-sdlc/lib/os_sdlc/crc_sweep/command.rb
  6. OsSdlc::CrcTickets::Command takes argv, out, err, cwd — check: absent OptionParser.new in plugins/os-sdlc/lib/os_sdlc/crc_tickets/command.rb
  7. OsSdlc::CollaboratorPass::Command takes argv, out, err, cwd — check: absent OptionParser.new 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:b47f392a scores at most 0 (was 4) and none of appears in its names.
  2. Given any crc-* command with -h, when it runs, then it prints the same usage text and exits 0.
  3. Given a missing required argument, when a crc-* command runs, then it prints USAGE to stderr and exits 2.
  4. Given valid options, when a crc-* command runs, then its JSON output and exit code are unchanged.

Owner sketch

OsSdlc::CommandLine = Data.define(:parser, :help, :usage, :positional)

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::CrcCensus::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 20261017T161455Z
  • Improvised this session: none
  • Chain: copied:defn:b47f392a across 2 classes ← DESIGN (plugins/os-sdlc/lib/os_sdlc/crc_file/command.rb)
  • Root candidate: this ticket
  • Where: plugins/os-sdlc/lib/os_sdlc/crc_file/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:b47f392a (copied_entry, score 4) spans 2 classes in concepts CrcFile, CrcTickets. - `OsSdlc::CrcFile::Command` (`/home/jared/dev/cc-os/plugins/os-sdlc/lib/os_sdlc/crc_file/command.rb:11`) - `OsSdlc::CrcTickets::Command` (`/home/jared/dev/cc-os/plugins/os-sdlc/lib/os_sdlc/crc_tickets/command.rb:22`) SIMILAR :defn mass 36; role controller ## Approach The copied or misplaced behavior belongs to one owner; move it there, callers delegate. Object: `OsSdlc::CommandLine` (built at plugins/os-sdlc/lib/os_sdlc/collaborator_pass/command.rb). OsSdlc::CommandLine is extracted from the table-driven OptionParser loop in CollaboratorPass::Command, not written new beside it, so all seven commands use the one owner; it also removes copied:iter:2ebcafd5, copied:resbody:28c01396, copied:cdecl:59d86c10. Required work: 1. `OsSdlc::CrcFile::Command` takes `argv, out, err, cwd` — check: absent `OptionParser.new` in `plugins/os-sdlc/lib/os_sdlc/crc_file/command.rb` 2. `OsSdlc::CrcJobs::Command` takes `argv, out, err, cwd` — check: absent `OptionParser.new` in `plugins/os-sdlc/lib/os_sdlc/crc_jobs/command.rb` 3. `OsSdlc::CrcRecords::Command` takes `argv, out, err, cwd` — check: absent `OptionParser.new` in `plugins/os-sdlc/lib/os_sdlc/crc_records/command.rb` 4. `OsSdlc::CrcCensus::Command` takes `argv, out, err, cwd` — check: absent `OptionParser.new` in `plugins/os-sdlc/lib/os_sdlc/crc_census/command.rb` 5. `OsSdlc::CrcSweep::Command` takes `argv, out, err, cwd` — check: absent `OptionParser.new` in `plugins/os-sdlc/lib/os_sdlc/crc_sweep/command.rb` 6. `OsSdlc::CrcTickets::Command` takes `argv, out, err, cwd` — check: absent `OptionParser.new` in `plugins/os-sdlc/lib/os_sdlc/crc_tickets/command.rb` 7. `OsSdlc::CollaboratorPass::Command` takes `argv, out, err, cwd` — check: absent `OptionParser.new` 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:b47f392a scores at most 0 (was 4) and none of appears in its names. 2. Given any crc-* command with -h, when it runs, then it prints the same usage text and exits 0. 3. Given a missing required argument, when a crc-* command runs, then it prints USAGE to stderr and exits 2. 4. Given valid options, when a crc-* command runs, then its JSON output and exit code are unchanged. ## Owner sketch ```ruby OsSdlc::CommandLine = Data.define(:parser, :help, :usage, :positional) 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::CrcCensus::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 20261017T161455Z - Improvised this session: none - Chain: copied:defn:b47f392a across 2 classes ← DESIGN (`plugins/os-sdlc/lib/os_sdlc/crc_file/command.rb`) - Root candidate: this ticket - Where: plugins/os-sdlc/lib/os_sdlc/crc_file/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-1088 via /os-sdlc:implement, dispatched by the collaborator pass loop (run 20261017T161455Z, iteration 2).

Work started 2026-10-17 on branch ticket-1088 via /os-sdlc:implement, dispatched by the collaborator pass loop (run 20261017T161455Z, iteration 2).
Author
Owner

Resolution

Done: OsSdlc::CommandLine extracted from CollaboratorPass::Command's table-driven OptionParser loop and used by all seven commands (six crc_* and collaborator-pass); the per-command parser bodies, help flag, usage-to-stderr exit 2, and positional handling live in one owner.

Evidence: Implementation 59 complete on the poodr-ticket-implementation map, 10 dispatches, 0 retries, 10 min 56 s; Runner commit on branch ticket-1088 (23 paths, no overlaps). Gates: diff-test, test-lint, lint, required-work, suite all green; contract-auditor pass. Collaborator pass recipe copied:defn:b47f392a (move_method_to_owner), ruling predicted amend.

Follow-ups: LENS line on the clock lambda default in CollaboratorPass::Command challenged by an opus agent this session; outcome in the handoff. Re-measure and stop-check follow in the loop. None else.

## Resolution **Done:** OsSdlc::CommandLine extracted from CollaboratorPass::Command's table-driven OptionParser loop and used by all seven commands (six crc_* and collaborator-pass); the per-command parser bodies, help flag, usage-to-stderr exit 2, and positional handling live in one owner. **Evidence:** Implementation 59 complete on the poodr-ticket-implementation map, 10 dispatches, 0 retries, 10 min 56 s; Runner commit on branch ticket-1088 (23 paths, no overlaps). Gates: diff-test, test-lint, lint, required-work, suite all green; contract-auditor pass. Collaborator pass recipe copied:defn:b47f392a (move_method_to_owner), ruling predicted amend. **Follow-ups:** LENS line on the clock lambda default in CollaboratorPass::Command challenged by an opus agent this session; outcome in the handoff. Re-measure and stop-check follow in the loop. None else.
jared closed this issue 2026-10-17 16:29:29 +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#1088
No description provided.