os-sdlc: root-less namespaces — CLI nests under Project, Lsp becomes Daemon #829

Closed
opened 2026-09-29 16:15:25 +00:00 by jared · 1 comment
Owner

Problem

The CLI namespace has no root file.
Zeitwerk builds it from the inflection "cli" => "CLI" (lib/os_sdlc.rb:22) and four directories.
All four hold project-configuration code, and CLI names a transport, not a noun.
module Lsp in controller/lsp/probe_cli.rb is an orphan: ProbeCLI drives the ruby-lsp daemon (Server/Daemon), not Probe::Lsp and not LspSession.
User ruling on the #781 follow-up (a), 2026-09-29.

Reproduce

n/a: naming and namespace change, nothing to reproduce.

Approach

Paths are relative to plugins/os-sdlc/lib/os_sdlc/.
Current files: model/cli/target_selection_error.rb, parser/cli/option_parser_builder.rb, command/cli/project_config_command.rb, presenter/cli/project_config_command/error_message.rb.
Evidence stays as it is.

Required work:

  1. Rename CLI::TargetSelectionError to Project::TargetSelectionError. About 11 lib sites and 7 test files use it. — check: grep -rn "CLI::" plugins/os-sdlc
  2. Rename CLI::OptionParserBuilder to Project::OptionParserBuilder.
  3. Rename CLI::ProjectConfigCommand to Project::ConfigCommand, and its ErrorMessage to Project::ConfigCommand::ErrorMessage.
  4. Delete the "cli" inflection in lib/os_sdlc.rb, and the "cli" key in lint/inward_dependencies.rb INFLECTIONS if that constant still exists.
  5. Move Lsp::ProbeCLI to Daemon::ProbeCLI in controller/daemon/probe_cli.rb. Update bin/lsp-probe:7 and tests/controller/lsp/probe_cli_resolves_root_from_subdirectory_test.rb.
  6. Check the Lsp::Listing / LspProbe::Listing inconsistency in presenter/lsp_probe/listing.rb, and make the namespace consistent.

Acceptance criteria

  1. Given the source tree, when searched for CLI:: and module Lsp, then no constant remains.
  2. Given the change, when the suite runs, then it passes.
  3. Given the same arguments as before, when bin/os-sdlc and bin/lsp-probe run, then stdout and stderr are unchanged.

Owner sketch

module Project
  class TargetSelectionError < StandardError; end
  class OptionParserBuilder; end
  class ConfigCommand; end
end

module Daemon
  class ProbeCLI; end
end

Origin

  • Trigger: #781 follow-up (a), user ruling.
  • Improvised this session: none
  • Chain: root-less CLI and Lsp namespaces ← "cli" => "CLI" inflection in lib/os_sdlc.rb:22 ← DESIGN (ADR-0236, controller/ layout by noun)
  • Root candidate: none
  • Where: lib/os_sdlc.rb, controller/lsp/probe_cli.rb
  • Session: 61834fd0-8fa2-40d2-8215-fb2f0622220d
  • Transcript: /home/jared/.claude/projects/-home-jared-dev-cc-os--claude-worktrees-crc-pass-os-sdlc/61834fd0-8fa2-40d2-8215-fb2f0622220d.jsonl
## Problem The `CLI` namespace has no root file. Zeitwerk builds it from the inflection `"cli" => "CLI"` (lib/os_sdlc.rb:22) and four directories. All four hold project-configuration code, and `CLI` names a transport, not a noun. `module Lsp` in controller/lsp/probe_cli.rb is an orphan: `ProbeCLI` drives the ruby-lsp daemon (Server/Daemon), not `Probe::Lsp` and not `LspSession`. User ruling on the #781 follow-up (a), 2026-09-29. ## Reproduce n/a: naming and namespace change, nothing to reproduce. ## Approach Paths are relative to plugins/os-sdlc/lib/os_sdlc/. Current files: model/cli/target_selection_error.rb, parser/cli/option_parser_builder.rb, command/cli/project_config_command.rb, presenter/cli/project_config_command/error_message.rb. `Evidence` stays as it is. Required work: 1. Rename `CLI::TargetSelectionError` to `Project::TargetSelectionError`. About 11 lib sites and 7 test files use it. — check: `grep -rn "CLI::" plugins/os-sdlc` 2. Rename `CLI::OptionParserBuilder` to `Project::OptionParserBuilder`. 3. Rename `CLI::ProjectConfigCommand` to `Project::ConfigCommand`, and its `ErrorMessage` to `Project::ConfigCommand::ErrorMessage`. 4. Delete the `"cli"` inflection in lib/os_sdlc.rb, and the `"cli"` key in lint/inward_dependencies.rb INFLECTIONS if that constant still exists. 5. Move `Lsp::ProbeCLI` to `Daemon::ProbeCLI` in controller/daemon/probe_cli.rb. Update bin/lsp-probe:7 and tests/controller/lsp/probe_cli_resolves_root_from_subdirectory_test.rb. 6. Check the `Lsp::Listing` / `LspProbe::Listing` inconsistency in presenter/lsp_probe/listing.rb, and make the namespace consistent. ## Acceptance criteria 1. Given the source tree, when searched for `CLI::` and `module Lsp`, then no constant remains. 2. Given the change, when the suite runs, then it passes. 3. Given the same arguments as before, when bin/os-sdlc and bin/lsp-probe run, then stdout and stderr are unchanged. ## Owner sketch ```ruby module Project class TargetSelectionError < StandardError; end class OptionParserBuilder; end class ConfigCommand; end end module Daemon class ProbeCLI; end end ``` ## Origin - Trigger: #781 follow-up (a), user ruling. - Improvised this session: none - Chain: root-less `CLI` and `Lsp` namespaces ← `"cli" => "CLI"` inflection in lib/os_sdlc.rb:22 ← DESIGN (ADR-0236, controller/ layout by noun) - Root candidate: none - Where: lib/os_sdlc.rb, controller/lsp/probe_cli.rb - Session: 61834fd0-8fa2-40d2-8215-fb2f0622220d - Transcript: /home/jared/.claude/projects/-home-jared-dev-cc-os--claude-worktrees-crc-pass-os-sdlc/61834fd0-8fa2-40d2-8215-fb2f0622220d.jsonl
Author
Owner

Resolution

Done: CLI::TargetSelectionError, OptionParserBuilder and ProjectConfigCommand (+ErrorMessage) moved under Project (Project::ConfigCommand); cli inflection removed; Lsp::ProbeCLI and LspProbe::Listing moved to Daemon::ProbeCLI and Daemon::Listing.

Evidence: Commit 858349ec on main (fast-forwarded to 65ae0cd3); ADR-0246; suite 1328 runs 0 failures; bin/os-sdlc and bin/lsp-probe output byte-identical before/after.

Follow-ups: none captured; listed as untracked follow-ups in docs/crc/os-sdlc/HANDOFF.md (OsSdlcLspProbe*Test names, Probe::Lsp orphan check)

## Resolution **Done:** CLI::TargetSelectionError, OptionParserBuilder and ProjectConfigCommand (+ErrorMessage) moved under Project (Project::ConfigCommand); cli inflection removed; Lsp::ProbeCLI and LspProbe::Listing moved to Daemon::ProbeCLI and Daemon::Listing. **Evidence:** Commit 858349ec on main (fast-forwarded to 65ae0cd3); ADR-0246; suite 1328 runs 0 failures; bin/os-sdlc and bin/lsp-probe output byte-identical before/after. **Follow-ups:** none captured; listed as untracked follow-ups in docs/crc/os-sdlc/HANDOFF.md (OsSdlcLspProbe*Test names, Probe::Lsp orphan check)
jared closed this issue 2026-09-29 16:29:39 +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#829
No description provided.