config_write_command.rb origin remote via Backlog::Issues::ShellRunner (#635c) #704

Closed
opened 2026-09-24 20:10:21 +00:00 by jared · 2 comments
Owner

Problem

config_write_command.rb uses a bare backtick to look up the origin remote instead of the plugin's own shell abstraction. This bypasses Backlog::Issues::ShellRunner#capture, which already wraps Open3.capture3 and returns [out, success?].

Observed

Verified on main today (2026-09-24).

plugins/os-backlog/lib/backlog/config_write_command.rb:39-41 uses a bare backtick, `git remote get-url origin 2>/dev/null`.strip, instead of the plugin's own Backlog::Issues::ShellRunner#capture(*cmd), which wraps Open3.capture3 and returns [out, success?] (stderr discarded, preserving the 2>/dev/null semantics). tests/cli_config_write_command_test.rb runs in a non-git tmpdir, so the remote resolves to nil either way — this test does not distinguish the two implementations.

Reproduce

grep -n '`git' plugins/os-backlog/lib

Approach

config_write_command.rb's origin_remote calls Backlog::Issues::ShellRunner.new.capture('git', 'remote', 'get-url', 'origin') and treats the result as nil unless the call succeeded and the output is non-empty.

Required work:

  1. Replace the bare backtick in config_write_command.rb with Backlog::Issues::ShellRunner#capture — check: grep -n '`git' plugins/os-backlog/lib returns nothing.
  2. Confirm cli_config_write_command_test.rb still passes (remote nil in its non-git tmpdir either way).

Rejected: an ENV variable override for the binary or remote lookup (out of scope; not the fragility this ticket addresses). Merging plugin load paths (a deliberate process boundary, not an accident to fix by removing it).

Non-goals: changing what happens when the origin lookup legitimately fails for a reason other than bypassing the shell abstraction. No ADR change.

VERDICT: CREATE

Acceptance criteria

  1. Given config_write_command.rb needs the origin remote, when it looks it up, then it calls Backlog::Issues::ShellRunner#capture, not a bare backtick, and returns nil under the same conditions as before (call fails or output empty).

Owner sketch

module Backlog
  class ConfigWriteCommand
    def origin_remote
      out, ok = Backlog::Issues::ShellRunner.new.capture('git', 'remote', 'get-url', 'origin')
      ok && !out.strip.empty? ? out.strip : nil
    end
  end
end

Non-goals

  • Merging plugin load paths.
  • Any environment-variable override for binary location.

Origin

  • Trigger: shell-call/ENV audit, session 16bf37b3-8cff-4121-896c-4a5fc61f2e9e (2026-09-23), user-requested.
  • Improvised this session: none.
  • Chain: fragile cross-plugin shell call ← bare backtick instead of the plugin's own ShellRunner abstraction ← DESIGN, plugins are separate load paths by design (not a bug to fix by merging them).
  • Root candidate: #635 (split 2026-09-24, session 082c3e8b).
  • Where: plugins/os-backlog/lib/backlog/config_write_command.rb:40
  • Session: 082c3e8b-5598-4c69-9ea6-b717e9c8afb2
  • Transcript: /home/jared/.claude/projects/-home-jared-dev-cc-os/082c3e8b-5598-4c69-9ea6-b717e9c8afb2.jsonl
## Problem `config_write_command.rb` uses a bare backtick to look up the origin remote instead of the plugin's own shell abstraction. This bypasses `Backlog::Issues::ShellRunner#capture`, which already wraps `Open3.capture3` and returns `[out, success?]`. ## Observed Verified on main today (2026-09-24). `plugins/os-backlog/lib/backlog/config_write_command.rb:39-41` uses a bare backtick, `` `git remote get-url origin 2>/dev/null`.strip ``, instead of the plugin's own `Backlog::Issues::ShellRunner#capture(*cmd)`, which wraps `Open3.capture3` and returns `[out, success?]` (stderr discarded, preserving the `2>/dev/null` semantics). `tests/cli_config_write_command_test.rb` runs in a non-git tmpdir, so the remote resolves to `nil` either way — this test does not distinguish the two implementations. ## Reproduce ``` grep -n '`git' plugins/os-backlog/lib ``` ## Approach `config_write_command.rb`'s `origin_remote` calls `Backlog::Issues::ShellRunner.new.capture('git', 'remote', 'get-url', 'origin')` and treats the result as `nil` unless the call succeeded and the output is non-empty. Required work: 1. Replace the bare backtick in `config_write_command.rb` with `Backlog::Issues::ShellRunner#capture` — check: `` grep -n '`git' plugins/os-backlog/lib `` returns nothing. 2. Confirm `cli_config_write_command_test.rb` still passes (remote `nil` in its non-git tmpdir either way). Rejected: an ENV variable override for the binary or remote lookup (out of scope; not the fragility this ticket addresses). Merging plugin load paths (a deliberate process boundary, not an accident to fix by removing it). Non-goals: changing what happens when the origin lookup legitimately fails for a reason other than bypassing the shell abstraction. No ADR change. VERDICT: CREATE ## Acceptance criteria 1. Given `config_write_command.rb` needs the origin remote, when it looks it up, then it calls `Backlog::Issues::ShellRunner#capture`, not a bare backtick, and returns `nil` under the same conditions as before (call fails or output empty). ## Owner sketch ```ruby module Backlog class ConfigWriteCommand def origin_remote out, ok = Backlog::Issues::ShellRunner.new.capture('git', 'remote', 'get-url', 'origin') ok && !out.strip.empty? ? out.strip : nil end end end ``` ## Non-goals - Merging plugin load paths. - Any environment-variable override for binary location. ## Origin - Trigger: shell-call/ENV audit, session 16bf37b3-8cff-4121-896c-4a5fc61f2e9e (2026-09-23), user-requested. - Improvised this session: none. - Chain: fragile cross-plugin shell call ← bare backtick instead of the plugin's own `ShellRunner` abstraction ← DESIGN, plugins are separate load paths by design (not a bug to fix by merging them). - Root candidate: #635 (split 2026-09-24, session 082c3e8b). - Where: plugins/os-backlog/lib/backlog/config_write_command.rb:40 - Session: 082c3e8b-5598-4c69-9ea6-b717e9c8afb2 - Transcript: /home/jared/.claude/projects/-home-jared-dev-cc-os/082c3e8b-5598-4c69-9ea6-b717e9c8afb2.jsonl
Author
Owner

Work started in session 082c3e8b on branch ticket-704 via /os-sdlc:implement.

Work started in session 082c3e8b on branch ticket-704 via /os-sdlc:implement.
Author
Owner

Resolution

Done: ConfigWriteCommand#origin_remote calls Backlog::Issues::ShellRunner#capture for the origin remote and returns nil unless the call succeeds with non-empty output. No bare backtick remains in plugins/os-backlog/lib.

Evidence: Pipeline implementation 34, 11 dispatches, implementation_complete. New test plugins/os-backlog/tests/cli_config_write_origin_remote_test.rb; os-backlog suite green at suite-check. Commit 82f374d2 on branch ticket-704.

Follow-ups: none

## Resolution **Done:** ConfigWriteCommand#origin_remote calls Backlog::Issues::ShellRunner#capture for the origin remote and returns nil unless the call succeeds with non-empty output. No bare backtick remains in plugins/os-backlog/lib. **Evidence:** Pipeline implementation 34, 11 dispatches, implementation_complete. New test plugins/os-backlog/tests/cli_config_write_origin_remote_test.rb; os-backlog suite green at suite-check. Commit 82f374d2 on branch ticket-704. **Follow-ups:** none
jared closed this issue 2026-09-24 21:10:14 +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#704
No description provided.