Thread the injected runner to the os-backlog sites that build ShellRunner mid-chain #1629
Labels
No labels
P0
P1
P2
P3
bug
category/code-change
category/cross-repo
category/eval-run
category/investigation
category/no-test-target
category/owner-ruling
category/prose-artifact
category/recurring-chore
category/structure
category/umbrella
crc-refactor
create
delete
enhancement
filed-by/agent
filed-by/user
frozen
lint-rule
needs-info
needs-triage
next
plugin/cc-architect
plugin/os
plugin/os-adr
plugin/os-aidd-lint
plugin/os-backlog
plugin/os-context
plugin/os-doc-hygiene
plugin/os-sdlc
plugin/os-vault
project/cc-os
ready-for-agent
ready-for-human
recurring
review
rule-proposal
update
waiting
wayfinder:grilling
wayfinder:map
wayfinder:map
wayfinder:research
wayfinder:task
wayfinder:task
wontfix
worklist/deviations
worklist/lint-rule
worklist/new-implement-build
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
jared/cc-os#1629
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Problem
Three places in os-backlog build
Backlog::ShellRunner.newinside the call chain instead of receiving the runner from the caller. A test cannot replace the runner at those places, so those paths run realgitandgh. The classical test rule for I/O is that the fake enters once at the composition root and every object below receives it.bin/os-backlogandForgejoBackend#clientfollow that rule; these three sites do not.Observed
lib/backlog/cli/issue_commands.rb:30callsBacklog::IssueShow.build(repo_root:, forgejo:)with norunner:, soissue_show.rb:5falls back toShellRunner.new. Theissue-showcommand never uses the runner thatCLI.startreceived.bin/decision-sweep:9buildsDecisionSweep::Command.new(program: PROGRAM)with norunner:, sodecision_sweep/command.rb:6falls back toShellRunner.new.tests/support/in_process_cli_run.rb:8,13:run_cliandrun_captureddefault to the realShellRunner.new. 18 test files call them withoutrunner:. Only theNoRealTrackerCommandsguard stopsteaandgh; nothing stopsgit.Reproduce
n/a: structure change; the existing suite is the proof.
Approach
Pass the runner the caller already holds. The default arguments in
IssueShow.buildandDecisionSweep::Command#initializestay; the defect is callers that never override them.Required work:
IssueCommands#issue_showpassesrunner: session.runnertoIssueShow.build— check: presentrunner: session.runnerinplugins/os-backlog/lib/backlog/cli/issue_commands.rbbin/decision-sweepbuildsBacklog::ShellRunner.newonce and passes it asrunner:— check: presentrunner: Backlog::ShellRunner.newinplugins/os-backlog/bin/decision-sweeprun_cliandrun_captureddefault toCliFakeLabelsRunner.new, asrun_forgejo_clidoes — check: absentBacklog::ShellRunner.newinplugins/os-backlog/tests/support/in_process_cli_run.rbRejected: a class-level or global runner slot the test can set. That was
CliContext.runner; commit744ec47bremoved it after a parallel-suite race filed junk tickets.Acceptance criteria
CLI.start, whenissue-showruns on agithub:tracker, then the fake runner receives thegh issue viewcall and no real process starts.shell_runner_refuses_tracker_commands_test.rband the files that nameShellRunner.newon purpose constructs a realShellRunner.bin/decision-sweep, when it runs, then behavior is unchanged.Owner sketch
Non-goals
lib/backlog/project_index/registration.rb:27builds its ownShellRunner; #1594 and #853 replace that read with os-git.bin/wakeup-pollcallsOpen3andsystemdirectly. It is pilot-only perplugins/os-backlog/CLAUDE.mdand stays as it is.ShellRunneritself. That waits on the GitHub backend moving to an API client (ADR-0256) and the git calls moving to os-git.Origin
Backlog::ShellRunnerexists, session 2026-11-06issue-showordecision-sweepshell calls ← callers buildShellRunner.newmid-chain ←DESIGN(commit744ec47binjected the runner atCLI.startbut did not thread it to every caller)VERDICT: CREATE
Resolution
Done: run_cli and run_captured default to CliFakeLabelsRunner; four tests that built a real ShellRunner now pass CliFakeLabelsRunner. Required work items 1 and 2 were already obsolete: Backlog::IssueShow is gone (issue_show goes through IssueTarget#show and session.ticket, which use the session runner), and DecisionSweep::Command no longer takes or builds a runner. AC1 is moot: the GitHub host uses Octokit (FakeOctokitClient), not gh.
Evidence: main
1b935f83a(79a717bb3,f5dacbc56). os-backlog suite: 551 runs, 1228 assertions, 0 failures, 0 errors. grep ShellRunner.new in plugins/os-backlog/test: only shell_runner_refuses_tracker_commands_test.rb (tests ShellRunner itself). No lib code runs git through ShellRunner; remote reads go through OsGit::Repository.Follow-ups: none